mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 04:52:39 +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 "../types.h"
|
||||||
#include "../sf/service.h"
|
#include "../sf/service.h"
|
||||||
#include "../services/fs.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.
|
/// Initialize fsp-ldr.
|
||||||
Result fsldrInitialize(void);
|
Result fsldrInitialize(void);
|
||||||
@ -18,5 +26,5 @@ void fsldrExit(void);
|
|||||||
/// Gets the Service object for the actual fsp-ldr service session.
|
/// Gets the Service object for the actual fsp-ldr service session.
|
||||||
Service* fsldrGetServiceSession(void);
|
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);
|
Result fsldrIsArchivedProgram(u64 pid, bool *out);
|
||||||
|
@ -32,21 +32,40 @@ Service* fsldrGetServiceSession(void) {
|
|||||||
return &g_fsldrSrv;
|
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};
|
char send_path[FS_MAX_PATH]={0};
|
||||||
strncpy(send_path, path, FS_MAX_PATH-1);
|
strncpy(send_path, path, FS_MAX_PATH-1);
|
||||||
|
|
||||||
serviceAssumeDomain(&g_fsldrSrv);
|
if (hosversionAtLeast(10,0,0)) {
|
||||||
return serviceDispatchIn(&g_fsldrSrv, 0, tid,
|
serviceAssumeDomain(&g_fsldrSrv);
|
||||||
.buffer_attrs = {
|
return serviceDispatchIn(&g_fsldrSrv, 0, tid,
|
||||||
SfBufferAttr_HipcPointer | SfBufferAttr_In,
|
.buffer_attrs = {
|
||||||
},
|
SfBufferAttr_FixedSize | SfBufferAttr_HipcPointer | SfBufferAttr_Out,
|
||||||
.buffers = {
|
SfBufferAttr_FixedSize | SfBufferAttr_HipcPointer | SfBufferAttr_In,
|
||||||
{ send_path, FS_MAX_PATH },
|
},
|
||||||
},
|
.buffers = {
|
||||||
.out_num_objects = 1,
|
{ out_code_info, sizeof(*out_code_info) },
|
||||||
.out_objects = &out->s,
|
{ 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) {
|
Result fsldrIsArchivedProgram(u64 pid, bool *out) {
|
||||||
|
Loading…
Reference in New Issue
Block a user