mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
fsldr: update for 10.0.0
This commit is contained in:
parent
ca6a48d2b6
commit
fa0234efff
@ -8,6 +8,14 @@
|
||||
#include "../types.h"
|
||||
#include "../sf/service.h"
|
||||
#include "../services/fs.h"
|
||||
#include "../crypto/sha256.h"
|
||||
|
||||
typedef struct {
|
||||
u8 signature[0x100];
|
||||
u8 hash[SHA256_HASH_SIZE];
|
||||
bool is_signed;
|
||||
u8 reserved[3];
|
||||
} FsCodeInfo;
|
||||
|
||||
/// Initialize fsp-ldr.
|
||||
Result fsldrInitialize(void);
|
||||
@ -18,5 +26,5 @@ void fsldrExit(void);
|
||||
/// Gets the Service object for the actual fsp-ldr service session.
|
||||
Service* fsldrGetServiceSession(void);
|
||||
|
||||
Result fsldrOpenCodeFileSystem(u64 tid, const char *path, FsFileSystem* out);
|
||||
Result fsldrOpenCodeFileSystem(FsCodeInfo* out_code_info, u64 tid, const char *path, FsFileSystem* out);
|
||||
Result fsldrIsArchivedProgram(u64 pid, bool *out);
|
||||
|
@ -32,21 +32,40 @@ Service* fsldrGetServiceSession(void) {
|
||||
return &g_fsldrSrv;
|
||||
}
|
||||
|
||||
Result fsldrOpenCodeFileSystem(u64 tid, const char *path, FsFileSystem* out) {
|
||||
Result fsldrOpenCodeFileSystem(FsCodeInfo* out_code_info, u64 tid, const char *path, FsFileSystem* out) {
|
||||
memset(out_code_info, 0, sizeof(*out_code_info));
|
||||
|
||||
char send_path[FS_MAX_PATH]={0};
|
||||
strncpy(send_path, path, FS_MAX_PATH-1);
|
||||
|
||||
serviceAssumeDomain(&g_fsldrSrv);
|
||||
return serviceDispatchIn(&g_fsldrSrv, 0, tid,
|
||||
.buffer_attrs = {
|
||||
SfBufferAttr_HipcPointer | SfBufferAttr_In,
|
||||
},
|
||||
.buffers = {
|
||||
{ send_path, FS_MAX_PATH },
|
||||
},
|
||||
.out_num_objects = 1,
|
||||
.out_objects = &out->s,
|
||||
);
|
||||
if (hosversionAtLeast(10,0,0)) {
|
||||
serviceAssumeDomain(&g_fsldrSrv);
|
||||
return serviceDispatchIn(&g_fsldrSrv, 0, tid,
|
||||
.buffer_attrs = {
|
||||
SfBufferAttr_FixedSize | SfBufferAttr_HipcPointer | SfBufferAttr_Out,
|
||||
SfBufferAttr_FixedSize | SfBufferAttr_HipcPointer | SfBufferAttr_In,
|
||||
},
|
||||
.buffers = {
|
||||
{ out_code_info, sizeof(*out_code_info) },
|
||||
{ send_path, FS_MAX_PATH },
|
||||
},
|
||||
.out_num_objects = 1,
|
||||
.out_objects = &out->s,
|
||||
);
|
||||
} else {
|
||||
serviceAssumeDomain(&g_fsldrSrv);
|
||||
return serviceDispatchIn(&g_fsldrSrv, 0, tid,
|
||||
.buffer_attrs = {
|
||||
SfBufferAttr_FixedSize | SfBufferAttr_HipcPointer | SfBufferAttr_In,
|
||||
},
|
||||
.buffers = {
|
||||
{ send_path, FS_MAX_PATH },
|
||||
},
|
||||
.out_num_objects = 1,
|
||||
.out_objects = &out->s,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Result fsldrIsArchivedProgram(u64 pid, bool *out) {
|
||||
|
Loading…
Reference in New Issue
Block a user