increases stripper limit from 16 to 127

This commit is contained in:
duncathan 2021-03-23 19:29:02 -06:00
parent b5115d4d03
commit 5b6b353fff
10 changed files with 502 additions and 416 deletions

View File

@ -3,60 +3,41 @@ offset 40cf90
#define #define
count=EBP-4 count=EBP-4
Strip_addr=0049D628 Strip_addr=0049D628
Credit=49D620 Credit.mode=49D620
MAX_STRIP=7F MAX_STRIP=7F
size=50 size=50
Strip.flag=EAX
Strip.x=EAX+4
Strip.y=EAX+8
Strip.cast=EAX+0C
Strip.str=EAX+10
#enddefine #enddefine
push ebp
mov ebp, esp
push ecx
:ActionStripper mov eax, [Strip_addr]
PUSH EBP mov edx, MAX_STRIP
MOV EBP,ESP
PUSH ECX
MOV [count],0 // s = 0
MOV ECX,[Strip_addr] // ECX = *Strip :$LL4@ActionStri
#define test BYTE [Strip.flag], 80
Strip.flag=ECX je :$LN5@ActionStri
Strip.x=ECX+4 cmp [Credit.mode], 0
Strip.y=ECX+8 je :$LN5@ActionStri
Strip.cast=ECX+0C
Strip.str=ECX+10
#enddefine
JMP :loop sub [Strip.y], 100
:increment :$LN5@ActionStri
MOV EAX,[count] cmp [Strip.y], -2000
ADD EAX,1 jg :$LN2@ActionStri
MOV [count],EAX // s++
:loop
CMP [count],MAX_STRIP // s < MAX_STRIP
JGE :end
MOV EBX,[count] and [Strip.flag], 0
IMUL EBX,EBX,size // EBX = s * sizeof(STRIP)
:move_up :$LN2@ActionStri
MOV EAX,[EBX+Strip.flag] add eax, size
AND EAX,00000080 sub edx, 1
JE :remove_offscreen jne :$LL4@ActionStri
CMP [Credit],0
JE :remove_offscreen
MOV EAX,[EBX+Strip.y] leave
SUB EAX,100 retn
MOV [EBX+Strip.y],EAX
:remove_offscreen
CMP [EBX+Strip.y],-2000
JG :endloop
MOV [EBX+Strip.flag],0
:endloop
JMP :increment
:end
MOV ESP,EBP
POP EBP
RETN
INT3

View File

@ -8,18 +8,28 @@ Strip_addr=0049d628
PUSH EBP PUSH EBP
MOV EBP,ESP MOV EBP,ESP
PUSH 18 PUSH 18
PUSH 0 PUSH 0
PUSH 0049D610 PUSH 0049D610
CALL 00480D30 CALL 00480D30
ADD ESP,0C ADD ESP,0C
/*
PUSH 500
PUSH 0
PUSH 0049D628
CALL 00480D30
ADD ESP,0C
*/
PUSH size PUSH size
PUSH MAX_STRIP PUSH MAX_STRIP
CALL 00487701 CALL 00487701
ADD ESP,8 ADD ESP,8
MOV [Strip_addr],EAX MOV [Strip_addr],EAX
POP EBP POP EBP
RETN RETN
INT3 INT3

View File

@ -4,4 +4,5 @@ LoadGenericDataMAX_STRIP.txt
PutStripper.txt PutStripper.txt
RestoreStripper.txt RestoreStripper.txt
SetStripper.txt SetStripper.txt
StartCreditScript.txt StartCreditScript.txt
ReleaseCreditScript.txt

View File

@ -1,120 +1,135 @@
offset 40D010 offset 40D010
#define #define
count=EBP-14 ; Constants
Strip_addr=0049D628
Credit=49D620
MAX_STRIP=7F MAX_STRIP=7F
MAX_STRIPx10=7f0
size=50 size=50
; Locals
ArrayPad=EBP-4
rc_addr=EBP-14
rc.left=EBP-14
rc.right=EBP-0C
rc.top=EBP-10
rc.bottom=EBP-8
; References
Strip_addr=0049D628
Strip.flag=ecx
Strip.x=ecx+4
Strip.y=ecx+8
Strip.cast=ecx+0c
Strip.str=ecx+10
grcFull=0048f92c grcFull=0048f92c
rc = EBP-10 ; Functions
rcleft=EBP-10 PutBitmap3=0040c3c0
rcright=EBP-8
rctop=EBP-0C
rcbottom=EBP-4
DIV200=data 99 81 E2 FF 01 00 00 03 C2 C1 F8 09 ; Builtins
___security_cookie=498b20
__security_check_cookie=00480dc1
#enddefine #enddefine
PUSH EBP push ebp
MOV EBP,ESP mov ebp,esp
SUB ESP,14 sub esp, 14 ; 00000018H
MOV [count],0 // s = 0
MOV ECX,[Strip_addr] //ECX = *Strip push ebx
#define push esi
Strip.flag=ECX push edi
Strip.x=ECX+4 ; Line 92
Strip.y=ECX+8 xor esi, esi
Strip.cast=ECX+0C xor edi, edi
Strip.str=ECX+10
#enddefine
JMP :loop
:increment :$LL4@PutStrippe
MOV EBX,[count] ; Line 94
INC EBX mov ecx, [Strip_addr]
MOV [count],EBX test BYTE [esi+Strip.flag], 80 ; 00000080H
:loop je :$LN2@PutStrippe
CMP EBX,MAX_STRIP ; Line 97
JGE :end and [rc.left], 0
mov [rc.right], 140 ; 00000140H
mov [rc.top], edi
lea eax, [edi+10]
mov [rc.bottom], eax
IMUL EBX,EBX,size //EBX = s * sizeof(STRIP) ; Line 102
push 23 ; 00000023H
MOV EDX,[EBX+Strip.flag] lea eax, [rc_addr]
AND EDX,00000080 push eax
JE :increment
//rects mov ebx, 1ff ; 000001ffH
MOV [rcleft],0 mov eax, [esi+Strip.y]
MOV [rcright],140 cdq
MOV EAX,[count] and edx, ebx
SHL EAX,4 add eax, edx
MOV [rctop],EAX sar eax, 9
ADD EAX,10 push eax
MOV [rcbottom],EAX
//arg5 = SURFACE_ID_CREDIT_CAST mov eax, [esi+Strip.x]
PUSH 23 cdq
//arg4 = &rc and edx, ebx
LEA EDX,[rc] add eax, edx
PUSH EDX sar eax, 9
//arg3 = Strip[s].y / 0x200 push eax
MOV EAX,[EBX+Strip.y]
DIV200
PUSH EAX
//arg2 = Strip[s].x / 0x200
MOV EAX,[EBX+Strip.x]
DIV200
PUSH EAX
//arg1 = &grcFull
PUSH grcFull
//PutBitmap3()
CALL 0040C3C0
ADD ESP,14
//rects push grcFull
MOV EAX,[EBX+Strip.cast]
CDQ
PUSH ECX
MOV ECX,0D
IDIV ECX
POP ECX
IMUL EDX,EDX,18
MOV [rc.left],EDX
ADD EDX,18
MOV [rc.right],EDX
IMUL EAX,EAX,18
MOV [rc.top],EAX
ADD EAX,18
MOV [rc.bottom],EAX
//arg5 = SURFACE_ID_CASTS call PutBitmap3
PUSH 25
//arg4 = &rc
LEA EAX,[rc]
PUSH EAX
//arg3 = Strip[s].y / 0x200 - 8
MOV EAX,[EBX+Strip.y]
DIV200
SUB EAX,8
PUSH EAX
//arg2 = Strip[s].x / 0x200 - 24
MOV EAX,[EBX+Strip.x]
DIV200
SUB EAX,18
PUSH EAX
//arg1 = &grcFull
PUSH grcFull
//PutBitmap3()
CALL 0040C3C0
ADD ESP,14
JMP :increment ; Line 110
push 25 ; 00000025H
:end mov ecx, [Strip_addr]
MOV ESP,EBP mov eax, [esi+Strip.cast]
POP EBP cdq
RETN mov ebx, 0d
INT3 idiv ebx
imul edx, edx, 18
imul eax, eax, 18
mov [rc.left], edx
add edx, 18 ; 00000018H
mov [rc.right], edx
mov [rc.top], eax
add eax, 18
mov [rc.bottom], eax
lea eax, [rc_addr]
push eax
mov ebx, 1ff
mov eax, [esi+Strip.y]
cdq
and edx, ebx
add eax, edx
sar eax, 9
sub eax, 8
push eax
mov eax, [esi+Strip.x]
cdq
and edx, ebx
add eax, edx
sar eax, 9
sub eax, 18 ; 00000018H
push eax
push grcFull
call PutBitmap3
add esp, 28 ; 00000028H
:$LN2@PutStrippe
; Line 92
add edi, 10 ; 00000010H
add esi, size ; 00000050H
cmp edi, MAX_STRIPx10 ; 000007f0H
jl :$LL4@PutStrippe
; Line 113
pop edi
pop esi
pop ebx
leave
retn

View File

@ -0,0 +1,32 @@
offset 40d410
#define
Credit.pData=49d614
Strip=49d628
_free=0048128b
#enddefine
push ebp
mov ebp,esp
mov eax, [Credit.pData]
test eax, eax
je :$LN2@ReleaseCre
push eax
call _free
pop ecx
and [Credit.pData], 0
:$LN2@ReleaseCre
mov eax, [Strip]
test eax, eax
je :$LN3@ReleaseCre
push eax
call _free
pop ecx
:$LN3@ReleaseCre
retn

View File

@ -1,79 +1,83 @@
offset 40d240 offset 40d240
#define #define
count=EBP-14 ; Constants
Strip_addr=0049D628 MAX_STRIPx10=7F0
; Locals
ArrayPad = EBP-4
rc_addr = EBP-14
rc.left=EBP-14
rc.right=EBP-0c
rc.top=EBP-10
rc.bottom=EBP-8
; References
Credit=49D620 Credit=49D620
MAX_STRIP=7F Strip_addr=0049D628
size=50 Strip.flag=0049D628
Strip.x=0049D62C
Strip.y=0049D630
Strip.cast=0049D634
Strip.str=0049D638
rc = EBP-10 ; Functions
rcleft=EBP-10 CortBox2=0040ca80
rcright=EBP-8 PutText2=0040ceb0
rctop=EBP-0C
rcbottom=EBP-4 ; Builtins
___security_cookie=498b20
__security_check_cookie=00480dc1
#enddefine #enddefine
PUSH EBP push ebp
MOV EBP,ESP mov ebp, esp
SUB ESP,14 sub esp, 14 ; 00000014H
MOV [count],0 push esi
push edi
; Line 151
xor edi, edi
xor esi, esi
:$LL4@RestoreStr
; Line 153
mov eax, [Strip_addr]
test [edi+eax], 128 ; 00000080H
je :$LN2@RestoreStr
; Line 155
and [rc.left], 0
; Line 156
mov [rc.right], 140 ; 00000140H
; Line 157
mov [rc.top], esi
; Line 158
lea eax, [esi+16]
mov [rc.bottom], eax
; Line 160
push 23 ; 00000023H
push 0
lea eax, [rc_addr]
push eax
MOV ECX,[Strip_addr] // ECX = *Strip call CortBox2
#define ; Line 161
Strip.flag=ECX push 23 ; 00000023H
Strip.x=ECX+4 push 00feffff ; 00feffffH
Strip.y=ECX+8 mov eax, [Strip_addr]
Strip.cast=ECX+0C add eax, 10 ; 00000010H
Strip.str=ECX+10 add eax, edi
#enddefine push eax
push [rc.top]
JMP :loop push 0
call PutText2
:increment add esp, 20 ; 00000020H
MOV EAX,[count] :$LN2@RestoreStr
INC EAX ; Line 151
MOV [count],EAX add esi, 10 ; 00000010H
:loop add edi, 50 ; 00000050H
CMP [count],MAX_STRIP cmp esi, MAX_STRIPx10 ; 000007f0H
JGE :end jl :$LL4@RestoreStr
; Line 164
MOV EBX,[count] pop edi
IMUL EBX,EBX,size pop esi
leave
MOV EDX,[EBX+Strip.flag] retn
AND EDX,00000080
JE :increment
MOV [rcleft],0
MOV [rcright],140
MOV EAX,[count]
SHL EAX,4
MOV [rctop],EAX
ADD EAX,10
MOV [rcbottom],EAX
PUSH 23
PUSH 0
LEA EDX,[rc]
PUSH EDX
CALL 0040CA80
ADD ESP,0C
PUSH 23
PUSH 0FEFFFF
LEA EAX,[EBX+Strip.str]
PUSH EAX
MOV EAX,[rctop]
PUSH EAX
PUSH 0
CALL 0040CEB0
ADD ESP,14
JMP :increment
:end
MOV ESP,EBP
POP EBP
RETN
INT3

View File

@ -1,92 +1,116 @@
offset 40d150 offset 40d150
#define #define
count=EBP-14 ; Constants
Strip_addr=0049D628
Credit=49D620
MAX_STRIP=7F MAX_STRIP=7F
size=50 size=50
rc=EBP-10 ; Locals
rcleft=EBP-10 ArrayPad=EBP-4
rcright=EBP-8 rc_addr=EBP-14
rctop=EBP-14 rc.left=EBP-14
rcbottom=EBP-0C rc.right=EBP-0C
rc.top=EBP-10
rc.bottom=EBP-8
; Arguments
argx=EBP+8
argy=EBP+0C
argtext=EBP+10
argcast=EBP+14
; References
Strip_addr=0049D628
Strip.flag=edx
Strip.x=edx+4
Strip.y=edx+8
Strip.cast=edx+0c
Strip.str=edx+10
; Functions
CortBox2=0040ca80
PutText2=0040ceb0
; Builtins
___security_cookie=498b20
__security_check_cookie=00480dc1
_strcpy=00481100
#enddefine #enddefine
PUSH EBP push ebp
MOV EBP,ESP mov ebp, esp
SUB ESP,14 sub esp, 14 ; 00000014H
MOV [count],0 mov eax, [___security_cookie]
MOV ECX,[Strip_addr] //ECX = *Strip mov [ArrayPad], eax
#define mov edx, [Strip_addr]
Strip.flag=ECX mov eax, edx
Strip.x=ECX+4 push esi
Strip.y=ECX+8 push edi
Strip.cast=ECX+0C mov edi, [argtext]
Strip.str=ECX+10 ; Line 121
#enddefine xor esi, esi
JMP :loop :$LL4@SetStrippe
; Line 122
test [eax], 80 ; 00000080H
je :$LN13@SetStrippe
; Line 121
inc esi
add eax, size ; 00000050H
mov ecx, esi
cmp esi, MAX_STRIP ; 0000007fH
jl :$LL4@SetStrippe
; Line 125
cmp ecx, MAX_STRIP ; 0000007fH
je :$LN1@SetStrippe
:$LN13@SetStrippe
; Line 129
imul ecx, esi, size
mov [ecx+Strip.flag], 80 ; 00000080H
; Line 130
mov eax, [argx]
mov [ecx+Strip.x], eax
; Line 131
mov eax, [argy]
mov [ecx+Strip.y], eax
; Line 132
mov eax, [argcast]
mov [ecx+Strip.cast], eax
; Line 133
push edi
lea eax, [Strip.str]
add eax, ecx
push eax
call _strcpy
; Line 136
and [rc.left], 0
; Line 137
mov [rc.right], 140 ; 00000140H
; Line 138
shl esi, 4
mov [rc.top], esi
; Line 139
lea eax, [esi+10]
mov [rc.bottom], eax
:increment ; Line 141
MOV EAX,[count] push 23 ; 00000023H
INC EAX push 0
MOV [count],EAX lea eax, [rc_addr]
:loop push eax
MOV EBX,[count] call CortBox2
IMUL EBX,EBX,size //EBC = s * sizeof(STRIP) ; Line 142
CMP [count],MAX_STRIP push 23 ; 00000023H
JGE :break push 00feffff ; 00feffffH
MOV EDX,[EBX+Strip.flag] push edi
AND EDX,00000080 push [rc.top]
JNE :increment push 0
JMP :break call PutText2
add esp, 28 ; 00000028H
:break :$LN1@SetStrippe
CMP [count],MAX_STRIP ; Line 143
JNE :initcast pop edi
JMP :end pop esi
mov ecx, [ArrayPad]
:initcast call __security_check_cookie
MOV [EBX+Strip.flag],80 leave
MOV [EBX+Strip.x],[EBP+8] retn
MOV [EBX+Strip.y],[EBP+0C]
MOV [EBX+Strip.cast],[EBP+14]
MOV EAX,[EBP+10]
PUSH EAX
LEA EAX,[EBX+Strip.str]
PUSH EAX
CALL 00481100
ADD ESP,8
MOV [rcleft],0
MOV [rcright],140
MOV EAX,[count]
SHL EAX,4
MOV [rctop],EAX
ADD EAX,10
MOV [rcbottom],EAX
PUSH 23
PUSH 0
LEA EDX,[rc]
PUSH EDX
CALL 0040CA80
ADD ESP,0C
PUSH 23
PUSH 0FEFFFF
MOV EAX,[EBP+10]
PUSH EAX
MOV EAX,[rctop]
PUSH EAX
PUSH 0
CALL 0040CEB0
ADD ESP,14
:end
MOV ESP,EBP
POP EBP
RETN
INT3

View File

@ -1,12 +1,16 @@
offset 40d440 offset 40d440
#define #define
Strip_addr=0049D628 ; Constants
MAX_STRIP=7F MAX_STRIP=7F
sizeof=50 fullsize=27b0 ; 0x50 * 0x7f
fp=EBP-4 ; Locals
path=EBP-110 path=EBP-108
ArrayPad=EBP-4
; References
Strip_addr=0049D628
Credit.pData=49D614 Credit.pData=49D614
Credit.size=49d610 Credit.size=49d610
Credit.offset=49d618 Credit.offset=49d618
@ -15,117 +19,132 @@ Credit.mode=49d620
Illust.x=49d60c Illust.x=49d60c
Illust.act_no=49d608 Illust.act_no=49d608
grcGame.left=48f91c grcGame.left=48f91c
gDataPath=0049E220
; Functions
GetFileSizeLong=00410d80
EncryptionBinaryData2=004215c0
ReloadBitmapFile=0040BFD0
; Builtins
___security_cookie=498b20
__security_check_cookie=00480dc1
_malloc=004813a3
_free=0048128B
_memset=00480d30
_sprintf=00481010
_fopen=00480FFD
_fread=00480f55
; Strings
credit_script=48f918
format=0048C374
str_rb=0048C37C
str_casts=0048c380
#enddefine #enddefine
PUSH EBP push ebp
MOV EBP,ESP mov ebp, esp
SUB ESP,110 sub esp, 108 ; 00000108H
MOV EAX,[498B20] mov eax, [___security_cookie]
MOV [EBP-8],EAX 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
CMP [Credit.pData],0 :$LN2@StartCredi
JE :openfile ; Line 248
MOV EAX,[Credit.pData] push [credit_script]
PUSH EAX lea eax, [path]
CALL 0048128B push gDataPath
ADD ESP,4 push format
MOV [Credit.pData],0 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
push fullsize
push esi
push [Strip_addr]
call _memset
add esp, 0c ; 0000000cH
; Line 298
mov eax, edi
jmp :$LN1@StartCredi
:openfile data cc cc cc cc cc cc cc cc
MOV ECX,[48F918]
PUSH ECX
PUSH 0049E220
PUSH 0048C374
LEA EDX,[path]
PUSH EDX
CALL 00481010
ADD ESP,10
LEA EDX,[path]
PUSH EDX
CALL 00410D80
ADD ESP,4
MOV [Credit.size],EAX
CMP EAX,-1
JNE :allocatebuffer
XOR EAX,EAX
JMP :end
:allocatebuffer
MOV ECX,[Credit.size]
PUSH ECX
CALL 004813A3
ADD ESP,4
MOV [Credit.pData],EAX
CMP EAX,0
JNE :fopen
JMP :end //EAX must be 0, return false
:fopen
PUSH 0048C37C
LEA EAX,[path]
PUSH EAX
CALL 00480FFD
ADD ESP,8
MOV [fp],EAX
CMP EAX,0
JNE :readdata
MOV EDX,[Credit.pData]
PUSH EDX
CALL 0048128B
ADD ESP,4
JMP :end //EAX must be 0, return false
:readdata
MOV ECX,[fp]
PUSH ECX
MOV EDX,[Credit.size]
PUSH EDX
PUSH 1
MOV EAX,[Credit.pData]
PUSH EAX
CALL 00480F55
ADD ESP,8
MOV EDX,[Credit.size]
PUSH EDX
MOV ECX,[Credit.pData]
PUSH ECX
CALL 004215C0
ADD ESP,8
MOV [Credit.offset],0
MOV [Credit.wait],0
MOv [Credit.mode],1
MOV [Illust.x],FFFEC000
MOV [Illust.act_no],0
MOV [grcGame.left],0A0
PUSH 25
PUSH 0048C380
CALL 0040BFD0
ADD ESP,8
TEST EAX,EAX
JNE :clearcasts
JMP :end //EAX is 0, return false
:clearcasts
MOV EDX,sizeof
IMUL EDX,EDX,MAX_STRIP
PUSH EDX
PUSH 0
MOV EAX,[Strip_addr]
PUSH EAX
CALL 00480D30
ADD ESP,0C
MOV EAX,1
:end
MOV ECX,[EBP-8]
CALL 00480DC1
MOV ESP,EBP
POP EBP
RETN
INT3

Binary file not shown.

Binary file not shown.