Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
load_engine_data_obfuscated.c File Reference

Go to the source code of this file.

Functions

void load_engine_data_obfuscated (void)
 

Variables

u8 obfuscated_load_engine_data []
 

Function Documentation

◆ load_engine_data_obfuscated()

void load_engine_data_obfuscated ( void )

Definition at line 13 of file load_engine_data_obfuscated.c.

13 {
14 s32 seed = 0x3C01A775;
15 u32 thisInsn = 0xB0018FFC;
16 HeapNode*(*load_engine_data)(void) = (HeapNode* (*)(void)) obfuscated_load_engine_data; // load_engine_data - ????????
17 s32 hash = 0;
18 u32 prevInsn;
19 u32* it;
20
21 while (IO_READ(PI_STATUS_REG) & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY));
22 seed -= IO_READ(thisInsn + 0xFFFE7508);
23
24 prevInsn = 0;
25
26 for (it = (u32*) create_audio_system_obfuscated_ROM_START; it < (u32*) create_audio_system_obfuscated_ROM_END; it++) {
27 while (IO_READ(PI_STATUS_REG) & (PI_STATUS_DMA_BUSY | PI_STATUS_IO_BUSY));
28 thisInsn = IO_READ(it + 0x4000000); // ???
29
30 hash += LOWER(thisInsn) + UPPER(thisInsn);
31
32 if (OPCODE(prevInsn) == LUI &&
33 OPCODE(thisInsn) == ADDIU &&
34 GET_RS(thisInsn) == GET_RT(prevInsn) &&
35 GET_RS(thisInsn) == GET_RT(thisInsn))
36 {
37 hash -= LOWER(thisInsn);
38 hash -= LOWER(prevInsn);
39 }
40
41 if (OPCODE(thisInsn) == JAL) {
42 hash -= LOWER(thisInsn) + (UPPER(thisInsn) & 0xFC00);
43 }
44
45 prevInsn = thisInsn;
46 }
47
48 load_engine_data += seed + 0xDDD20 - hash;
50}
u8 obfuscated_load_engine_data[]
void load_engine_data(void)
Definition main_loop.c:285
#define ADDIU
Definition mips.h:5
#define LOWER(x)
Definition mips.h:8
#define GET_RS(x)
Definition mips.h:11
#define UPPER(x)
Definition mips.h:9
#define JAL
Definition mips.h:4
#define GET_RT(x)
Definition mips.h:12
#define OPCODE(x)
Definition mips.h:10
#define LUI
Definition mips.h:6

Referenced by shim_load_engine_data_obfuscated().

Variable Documentation

◆ obfuscated_load_engine_data

u8 obfuscated_load_engine_data[]
extern