Skip to content

Commit

Permalink
sce-elf-defs: Add alternative module imports struct
Browse files Browse the repository at this point in the history
  • Loading branch information
VelocityRa authored and d3m3vilurr committed Sep 14, 2018
1 parent dadf354 commit cc9473d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/sce-elf-defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ typedef struct SCE_TYPE(sce_module_imports) {
uint16_t num_syms_funcs; /* Number of function imports */
uint16_t num_syms_vars; /* Number of variable imports */
uint16_t num_syms_unk;

uint32_t reserved1;
uint32_t module_nid; /* NID of module to import */
SCE_PTR(const char *) module_name; /* Pointer to name of imported module, for debugging */
Expand All @@ -78,5 +79,22 @@ typedef struct SCE_TYPE(sce_module_imports) {
SCE_PTR(const void **) unk_entry_table;
} SCE_TYPE(sce_module_imports);

/* alternative module imports struct with a size of 0x24 */
typedef struct SCE_TYPE(sce_module_imports_short) {
uint16_t size; /* Size of this struct, set to 0x24 */
uint16_t version; /* Set to 0x1 */
uint16_t flags; /* Set to 0x0 */
uint16_t num_syms_funcs; /* Number of function imports */
uint16_t num_syms_vars; /* Number of variable imports */
uint16_t num_syms_unk;

uint32_t module_nid; /* NID of module to import */
SCE_PTR(const char *) module_name; /* Pointer to name of imported module, for debugging */
SCE_PTR(uint32_t *) func_nid_table; /* Pointer to array of function NIDs to import */
SCE_PTR(const void **) func_entry_table; /* Pointer to array of stub functions to fill */
SCE_PTR(uint32_t *) var_nid_table; /* Pointer to array of variable NIDs to import */
SCE_PTR(const void **) var_entry_table; /* Pointer to array of data pointers to write to */
} SCE_TYPE(sce_module_imports_short);

#undef SCE_TYPE
#undef SCE_PTR

0 comments on commit cc9473d

Please sign in to comment.