From c64273bcc029161e1c34806fd3194975836d652b Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 12 Dec 2017 10:48:31 -0500 Subject: mdso_structs: initial commit, providing raw (endian-agnostic) struct defs. --- include/mdso/mdso_structs.h | 80 +++++++++++++++++++++++++++++++++++++++++++++ project/headers.mk | 1 + 2 files changed, 81 insertions(+) create mode 100644 include/mdso/mdso_structs.h diff --git a/include/mdso/mdso_structs.h b/include/mdso/mdso_structs.h new file mode 100644 index 0000000..133825e --- /dev/null +++ b/include/mdso/mdso_structs.h @@ -0,0 +1,80 @@ +#ifndef MDSO_STRUCTS_H +#define MDSO_STRUCTS_H + +#ifdef __cplusplus +extern "C" { +#endif + +struct mdso_raw_arg_m32 { + unsigned char marg_utf8 [0x04]; /* 0x00 */ + unsigned char marg_utf16 [0x04]; /* 0x04 */ +}; + +struct mdso_raw_arg_m64 { + unsigned char marg_utf8 [0x08]; /* 0x00 */ + unsigned char marg_utf16 [0x08]; /* 0x08 */ +}; + +union mdso_raw_arg { + struct mdso_raw_arg_m32 marg_m32; + struct mdso_raw_arg_m64 marg_m64; +}; + + +struct mdso_raw_sym_entry_m32 { + unsigned char msym_string [0x04]; /* 0x00 */ + unsigned char msym_meta [0x04]; /* 0x04 */ +}; + +struct mdso_raw_sym_entry_m64 { + unsigned char msym_string [0x08]; /* 0x00 */ + unsigned char msym_meta [0x08]; /* 0x08 */ +}; + +union mdso_raw_sym_entry { + struct mdso_raw_sym_entry_m32 msym_m32; + struct mdso_raw_sym_entry_m64 msym_m64; +}; + + +struct mdso_raw_meta_record_m32 { + unsigned char mrec_base [0x04]; /* 0x00 */ + unsigned char mrec_name [0x04]; /* 0x04 */ + unsigned char mrec_flags [0x04]; /* 0x08 */ + unsigned char mrec_priority [0x04]; /* 0x0c */ + unsigned char mrec_nsyms [0x04]; /* 0x10 */ + unsigned char mrec_padding [0x04]; /* 0x14 */ + unsigned char mrec_hashtbl [0x04]; /* 0x18 */ + unsigned char mrec_symtbl [0x04]; /* 0x1c */ + unsigned char mrec_fncarg [0x04]; /* 0x20 */ + unsigned char mrec_fncargarr [0x04]; /* 0x24 */ + unsigned char mrec_fnr1 [0x04]; /* 0x28 */ + unsigned char mrec_fnr2 [0x04]; /* 0x2c */ +}; + +struct mdso_raw_meta_record_m64 { + unsigned char mrec_base [0x08]; /* 0x00 */ + unsigned char mrec_name [0x08]; /* 0x08 */ + unsigned char mrec_flags [0x04]; /* 0x10 */ + unsigned char mrec_priority [0x04]; /* 0x14 */ + unsigned char mrec_nsyms [0x04]; /* 0x18 */ + unsigned char mrec_padding [0x04]; /* 0x1c */ + unsigned char mrec_hashtbl [0x08]; /* 0x20 */ + unsigned char mrec_symtbl [0x08]; /* 0x28 */ + unsigned char mrec_fncarg [0x08]; /* 0x30 */ + unsigned char mrec_fncargarr [0x08]; /* 0x38 */ + unsigned char mrec_fnr1 [0x08]; /* 0x40 */ + unsigned char mrec_fnr2 [0x08]; /* 0x48 */ +}; + +union mdso_raw_meta_record { + struct mdso_raw_meta_record_m32 mrec_m32; + struct mdso_raw_meta_record_m64 mrec_m64; +}; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/project/headers.mk b/project/headers.mk index 7fb8763..e44ed18 100644 --- a/project/headers.mk +++ b/project/headers.mk @@ -5,6 +5,7 @@ API_HEADERS = \ $(PROJECT_DIR)/include/$(PACKAGE)/mdso_crc64.h \ $(PROJECT_DIR)/include/$(PACKAGE)/mdso_output.h \ $(PROJECT_DIR)/include/$(PACKAGE)/mdso_specs.h \ + $(PROJECT_DIR)/include/$(PACKAGE)/mdso_structs.h \ INTERNAL_HEADERS = \ $(PROJECT_DIR)/src/internal/argv/argv.h \ -- cgit v1.2.3