Originally posted by einstein95 Instead of an offset, could you give the 5 hex bytes before and after? That way it might be able to be found in later versions.
Sure, it'll better with the asm code:
; function: 0055FED0
.text:005600A9 D9 EE fldz
.text:005600AB 89 47 08 mov [edi+8], eax
.text:005600AE D9 50 54 fst dword ptr [eax+54h]
.text:005600B1 D9 58 64 fstp dword ptr [eax+64h]
.text:005600B4 D9 80 A0 00 00 00 fld dword ptr [eax+0A0h]
.text:005600BA DC 25 08 FA 61 00 fsub ds:dbl_61FA08
.text:005600C0 D9 58 74 fstp dword ptr [eax+74h]
.text:005600C3 EB 02 jmp short loc_5600C7
.text:005600C5 ; ---------------------------------------------------------------------------
.text:005600C5
.text:005600C5 loc_5600C5: ; CODE XREF: sub_55FED0+187j
.text:005600C5 33 FF xor edi, edi
.text:005600C7
.text:005600C7 loc_5600C7: ; CODE XREF: sub_55FED0+1F3j
.text:005600C7 8B 75 F8 mov esi, [ebp+var_8]
.text:005600CA 6A 40 push 40h ; TitleScreenID
.text:005600CC E8 9F 33 04 00 call SK_SetId ; init the second id
.text:005600CC ; update id
.text:005600D1 8B 4D FC mov ecx, [ebp+var_4]
.text:005600D4
.text:005600D4 loc_5600D4: ; CODE XREF: sub_55FED0+C8j
.text:005600D4 ; sub_55FED0+D5j
.text:005600D4 8D 79 58 lea edi, [ecx+58h]
.text:005600D7 C7 45 F8 07 00 00 00 mov [ebp+var_8], 7
.text:005600DE 8B FF mov edi, edi
Basically, SK_SetId (005A3470) sets the given argument to a global variable. The patch modifies the argument (005600CA + 1) from 0x40 (TitleScreenID) to 0x5D (DevMenuId).
;function: 005A3470 (SK_SetId)
.text:005A34B5 8B 45 08 mov eax, [ebp+DataId]
.text:005A34B8 A3 10 6D 63 00 mov g_SK_NextId
This ID is then copied to another global variable:
; function: 005A3050
.text:005A3152 8B 15 10 6D 63 00 mov edx, g_SK_NextId
.text:005A3158 8B 0D 0C 6D 63 00 mov ecx, g_SK_CurId
.text:005A315E 89 35 10 6D 63 00 mov g_SK_NextId, esi
.text:005A3164 8B 35 2C 42 5F 00 mov esi, ds:SDL_GetTicks
.text:005A316A 89 0D 14 6D 63 00 mov dword_636D14, ecx
.text:005A3170 89 15 0C 6D 63 00 mov g_SK_CurId
Finally, this ID is used to fetch an entry from a global array of structure which contains every "scenes" of the game:
; function: 0048A4E0
.text:0048A4EC A1 0C 6D 63 00 mov eax, g_SK_CurId
.text:0048A4F1 56 push esi ; Args
.text:0048A4F2 8B 35 E4 40 5F 00 mov esi, ds:sprintf
.text:0048A4F8 8D 04 40 lea eax, [eax+eax*2]
.text:0048A4FB 8B 0C C5 08 80 62 00 mov ecx, dword ptr g_DataEntries.Name[eax*8]
In this case, we're looking for 0x5D because it contains the entry "Dev Init".
.data:00628008 dd offset aDevInit ; [5Dh].Name
.data:00628008 dd 0 ; [5Dh].PakPath
.data:00628008 dd offset byte_5FF6FE ; [5Dh].DataPath
.data:00628008 dd offset aDev ; [5Dh].Type
.data:00628008 dd 2 ; [5Dh].anonymous_4
.data:00628008 dd 0 ; [5Dh].anonymous_5
There's more way to access this devmenu, but I think this one is the cleaner.
Tell me if you need further info.
BTW, the PC version contains references to StreetPass:
 |