cave-story-randomizer/cs-hacks/IncreaseMAX_STRIP/StartCreditScript.txt
2021-04-02 00:15:21 -06:00

160 lines
2.3 KiB
Plaintext

offset 40d440
#define
; Constants
MAX_STRIP=40
size=50
; Locals
path=EBP-108
ArrayPad=EBP-4
; References
Strip_addr=0049D628
Credit.pData=49D614
Credit.size=49d610
Credit.offset=49d618
Credit.wait=49d61c
Credit.mode=49d620
Illust.x=49d60c
Illust.act_no=49d608
grcGame.left=48f91c
gDataPath=0049E220
; Functions
GetFileSizeLong=00410d80
EncryptionBinaryData2=004215c0
ReloadBitmapFile=0040BFD0
; Builtins
___security_cookie=498b20
__security_check_cookie=00480dc1
_malloc=004813a3
_calloc=00487701
_free=0048128B
_memset=00480d30
_sprintf=00481010
_fopen=00480FFD
_fread=00480f55
; Strings
credit_script=48f918
format=0048C374
str_rb=0048C37C
str_casts=0048c380
#enddefine
push ebp
mov ebp, esp
sub esp, 108 ; 00000108H
mov eax, [___security_cookie]
mov [ArrayPad], eax
; Line 241
mov eax, [Credit.pData]
push esi
xor esi, esi
push edi
test eax, eax
je :$LN2@StartCredi
; Line 243
push eax
call _free
pop ecx
; Line 244
mov [Credit.pData], esi
:$LN2@StartCredi
; Line 248
push [credit_script]
lea eax, [path]
push gDataPath
push format
push eax
call _sprintf
; Line 250
lea eax, [path]
push eax
call GetFileSizeLong
add esp, 14 ; 00000014H
mov [Credit.size], eax
; Line 251
cmp eax, -1
je :$LN8@StartCredi
; Line 255
push eax
call _malloc
mov [Credit.pData], eax
pop ecx
; Line 256
test eax, eax
je :$LN8@StartCredi
; Line 259
lea eax, [path]
push str_rb
push eax
call _fopen
pop ecx
pop ecx
; Line 260
test eax, eax
jne :$LN5@StartCredi
; Line 262
push [Credit.pData]
call _free
pop ecx
:$LN8@StartCredi
; Line 299
xor eax, eax
:$LN1@StartCredi
pop edi
pop esi
mov ecx, [ArrayPad]
call __security_check_cookie
leave
retn
:$LN5@StartCredi
; Line 267
push eax
push [Credit.size]
xor edi, edi
inc edi
push edi
push [Credit.pData]
call _fread
; Line 274
push [Credit.size]
push [Credit.pData]
call EncryptionBinaryData2
; Line 293
push 25 ; 00000025H
push str_casts
mov [Credit.offset], esi
mov [Credit.wait], esi
mov [Credit.mode], edi
mov [Illust.x], fffec000 ; fffec000H
mov [Illust.act_no], esi
mov [grcGame.left], 0a0 ; 000000a0H
call ReloadBitmapFile
add esp, 20 ; 00000020H
test eax, eax
je SHORT :$LN8@StartCredi
; Line 297
mov eax, [Strip_addr]
test eax, eax
je :blah
push eax
call _free
pop ecx
:blah
push size
push MAX_STRIP
call _calloc
add ESP,8
mov [Strip_addr],EAX
; Line 298
mov eax, edi
jmp :$LN1@StartCredi
data cc cc cc cc cc cc cc cc