Function at 0x501a40
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x9c
mov edi, dword [esp + 0xb8]
mov ebx, dword [esp + 0xb0]
mov ebp, dword [esp + 0xb4]
mov esi, dword [esp + 0xbc]
cmp edi, 1
jbe 0x501c50
mov eax, dword [ebx + 0x58]
mov dword [ebx + 0x60], esi
test eax, eax
jne 0x501b70
movzx eax, byte [ebp]
movzx edx, byte [ebp + 1]
shl eax, 8
add edx, eax
cmp dword [ebx + 0x54], edx
jb 0x501c16
mov eax, dword [ebx + 0x50]
test eax, eax
je 0x501c80
cmp edi, edx
mov dword [ebx + 0x5c], edx
ja 0x501be7
mov dword [esp + 8], edi
mov dword [esp + 4], ebp
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov ecx, dword [ebx + 0x5c]
mov dword [ebx + 0x58], edi
mov dword [ebx + 0x60], esi
cmp ecx, edi
jne 0x501b9c
xor ebp, ebp
mov dword [esp + 0x48], esi
jmp 0x501ad7
mov edi, dword [ebx + 0x58]
mov ebp, esi
lea eax, [ebp + 4]
cmp eax, edi
ja 0x501b5d
lea eax, [ebp + 2]
add eax, dword [ebx + 0x50]
movzx esi, byte [eax]
movzx edx, byte [eax + 1]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], edi
shl esi, 8
lea esi, [edx + esi]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ebp
mov dword [esp + 8], str.SPUtest:_x_d_y_d_off_d_size_d_n
mov dword [esp + 4], 7
mov dword [esp], 0x1a
call fcn.0042b9b0
cmp ebp, esi
je 0x501c88
cmp ebp, esi
jae 0x501b32
mov ecx, dword [ebx + 0x5c]
cmp ecx, esi
nop
ja 0x501ad2
mov dword [esp + 0x10], ebp
mov dword [esp + 0xc], esi
mov dword [esp + 8], str.SPUtest:_broken_packet______y_d___x_d_n
mov dword [esp + 4], 2
mov dword [esp], 0x1a
call fcn.0042b9b0
mov dword [ebx + 0x5c], 0
mov dword [ebx + 0x58], 0
add esp, 0x9c
pop ebx
pop esi
pop edi
pop ebp
ret
lea edx, [edi + eax]
cmp dword [ebx + 0x5c], edx
jb 0x501bb2
add eax, dword [ebx + 0x50]
mov dword [esp + 8], edi
mov dword [esp + 4], ebp
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
add edi, dword [ebx + 0x58]
mov dword [ebx + 0x58], edi
mov ecx, dword [ebx + 0x5c]
cmp ecx, edi
je 0x501aca
lea eax, [edi + 1]
cmp ecx, eax
je 0x501aca
add esp, 0x9c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], str.SPUasm:_invalid_fragment_n
mov dword [esp + 4], 2
mov dword [esp], 0x1a
call fcn.0042b9b0
mov dword [ebx + 0x58], 0
mov dword [ebx + 0x5c], 0
add esp, 0x9c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], edx
mov dword [esp + 8], str.SPUasm:_invalid_frag_len___len2:__d____d__n
mov dword [esp + 4], 2
mov dword [esp], 0x1a
call fcn.0042b9b0
add esp, 0x9c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebx + 0x50]
mov dword [esp + 0x44], edx
mov dword [esp], eax
call fcn.008f2ba8
mov edx, dword [esp + 0x44]
mov dword [esp], edx
call sub.msvcrt.dll_malloc
mov edx, dword [esp + 0x44]
cmp eax, 1
sbb ecx, ecx
not ecx
and ecx, edx
mov dword [ebx + 0x50], eax
mov dword [ebx + 0x54], ecx
jmp 0x501a96
mov dword [esp + 0xb8], str.SPUasm:_packet_too_short_n
mov dword [esp + 0xb4], 2
mov dword [esp + 0xb0], 0x1a
add esp, 0x9c
pop ebx
pop esi
pop edi
pop ebp
jmp fcn.0042b9b0
mov edi, dword [ebx + 0x58]
jmp 0x501b91
cmp ebp, 3
jbe 0x501b25
mov eax, dword [ebx + 0x5c]
mov esi, dword [esp + 0x48]
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0x58]
mov dword [esp + 8], str.SPUgot:_off_d__size_d__n
mov dword [esp + 4], 7
mov dword [esp], 0x1a
mov dword [esp + 0xc], eax
call fcn.0042b9b0
mov eax, dword [ebx + 0x108]
test eax, eax
je 0x501cf8
test esi, esi
js 0x501b5d
mov edx, dword [ebx + 0x50]
mov dword [0x9136e8], esi
mov dword [0x9136dc], edx
mov edx, dword [ebx + 0x5c]
mov dword [esp], 0x9136d8
mov dword [0x9136e0], edx
call dword [eax + 0x10]
jmp 0x501b5d
mov edx, dword [ebx + 0x50]
movzx eax, byte [edx + 2]
movzx ecx, byte [edx + 3]
shl eax, 8
add ecx, eax
mov dword [esp + 0x80], ecx
je 0x501b5d
mov eax, esi
mov edi, ecx
neg eax
xor ebp, ebp
lea ecx, [esi - 1]
mov dword [esp + 0x88], 0
mov dword [esp + 0x84], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x68], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x64], 0
mov dword [esp + 0x60], 0
mov dword [esp + 0x6c], 0
mov dword [esp + 0x5c], 0
mov dword [esp + 0x78], eax
mov dword [esp + 0x8c], ecx
lea eax, [edx + edi]
movzx ecx, byte [eax + 1]
movzx eax, byte [eax]
shl eax, 8
lea eax, [ecx + eax]
shl eax, 0xa
mov dword [esp + 0x48], eax
lea eax, [edx + edi + 2]
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
mov dword [esp + 8], str.date_d_n
mov dword [esp + 4], 7
mov dword [esp], 0x1a
shl eax, 8
lea eax, [edx + eax]
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0xc], eax
call fcn.0042b9b0
mov eax, dword [ebx + 0x50]
movzx edx, byte [eax + edi + 4]
cmp edx, 0xff
je 0x501e55
mov ecx, dword [esp + 0x48]
lea eax, [edi + 5]
mov dword [esp + 0x7c], edi
mov edi, esi
add ecx, esi
mov esi, ebx
mov dword [esp + 0x74], ecx
mov ebx, eax
mov dword [esp + 0xc], edx
mov dword [esp + 0x44], edx
mov dword [esp + 8], str.cmd_d
mov dword [esp + 4], 7
mov dword [esp], 0x1a
call fcn.0042b9b0
mov edx, dword [esp + 0x44]
cmp edx, 6
jbe switch.0x00501eb3
mov ecx, dword [esp + 0x54]
mov eax, ebx
mov ebx, esi
mov dword [esp + 0xc], edx
mov esi, edi
mov edi, dword [esp + 0x7c]
mov dword [esp + 8], str.spudec:_Error_determining_control_type_0x_02x.__Skipping__d_bytes._n
mov dword [esp + 4], 2
sub ecx, eax
mov dword [esp + 0x10], ecx
mov dword [esp], 0x1a
call fcn.0042b9b0
mov eax, dword [esp + 0x6c]
test eax, eax
je 0x501e9d
cmp ebp, 0xffffffff
jne 0x501e95
cmp edi, dword [esp + 0x54]
je 0x501e95
mov eax, dword [esp + 0x54]
xor ebp, ebp
add eax, dword [ebx + 0x50]
movzx edx, byte [eax + 1]
movzx eax, byte [eax]
shl eax, 8
lea eax, [edx + eax]
mov edx, 1
shl eax, 0xa
sub edx, esi
cmp eax, edx
jbe 0x501ea7
mov ebp, dword [esp + 0x8c]
add ebp, eax
test ebp, ebp
jne 0x502276
cmp dword [esp + 0x54], edi
je 0x501b5d
mov edx, dword [ebx + 0x50]
mov edi, dword [esp + 0x54]
jmp 0x501d79
jmp dword [edx*4 + 0x9ec190]
mov ecx, dword [esi + 0x50]
lea edx, [ecx + ebx]
movzx eax, byte [edx + 1]
mov dword [esp + 0x4c], eax
movzx eax, byte [edx]
movzx edx, byte [edx + 2]
shl eax, 8
add eax, dword [esp + 0x4c]
shl eax, 8
lea edx, [eax + edx]
mov dword [esp + 0x4c], edx
lea edx, [ecx + ebx + 3]
movzx eax, byte [edx]
movzx ecx, byte [edx + 1]
shl eax, 8
lea eax, [ecx + eax]
movzx ecx, byte [edx + 2]
shl eax, 8
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x58], 0
lea ecx, [eax + ecx]
mov eax, dword [esp + 0x4c]
sar edx, 0xc
mov dword [esp + 0x60], edx
and eax, 0xfff
cmp edx, eax
ja 0x501f2a
lea edx, [eax + 1]
mov dword [esp + 0x58], edx
mov edx, dword [esp + 0x60]
sub dword [esp + 0x58], edx
mov edx, dword [esp + 0x58]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x60]
mov dword [esp + 8], str.Coords__col:__d____d__row:__d____d____dx_d__n
mov dword [esp + 4], 7
add edx, 7
and edx, 0xfffffff8
mov dword [esp + 0x70], edx
mov edx, ecx
and ecx, 0xfff
sar edx, 0xc
mov dword [esp + 0x64], edx
mov edx, ecx
sub edx, dword [esp + 0x64]
cmp ecx, dword [esp + 0x64]
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x68], edx
sbb edx, edx
add ebx, 6
not edx
and dword [esp + 0x68], edx
mov edx, dword [esp + 0x68]
mov dword [esp + 0x14], ecx
mov dword [esp + 0xc], eax
mov dword [esp], 0x1a
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x58]
mov dword [esp + 0x1c], edx
call fcn.0042b9b0
mov eax, dword [esi + 0x50]
movzx edx, byte [eax + ebx]
cmp edx, 0xff
je 0x502269
add ebx, 1
jmp 0x501df0
mov edx, dword [esi + 0x50]
movzx ecx, byte [edx + ebx]
movzx eax, byte [edx + ebx]
and ecx, 0xf
mov dword [esp + 0x4c], ecx
movzx edx, byte [edx + ebx + 1]
shr al, 4
movzx eax, al
mov byte [esp + 0x50], dl
movzx ecx, byte [esp + 0x50]
shr dl, 4
movzx edx, dl
and ecx, 0xf
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x6c]
test ecx, ecx
je 0x502041
mov ecx, dword [esi + 0x74]
cmp eax, ecx
mov dword [esp + 0x50], ecx
jae 0x502007
mov eax, ecx
mov ecx, dword [esi + 0x78]
cmp dword [esp + 0x4c], ecx
mov dword [esp + 0x50], ecx
jae 0x502018
mov dword [esp + 0x4c], ecx
mov ecx, dword [esi + 0x7c]
cmp edx, ecx
mov dword [esp + 0x50], ecx
jae 0x502025
mov edx, ecx
mov ecx, dword [esi + 0x80]
mov dword [esp + 0x50], ecx
mov ecx, dword [esp + 0x3c]
cmp ecx, dword [esp + 0x50]
jae 0x50203d
mov ecx, dword [esp + 0x50]
mov dword [esp + 0x3c], ecx
mov ecx, dword [esp + 0x4c]
add ebx, 2
mov dword [esi + 0x7c], edx
mov dword [esi + 0x74], eax
mov dword [esi + 0x78], ecx
mov ecx, dword [esp + 0x3c]
mov dword [esi + 0x80], ecx
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x18], ecx
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.Alpha__d___d___d___d_n
mov dword [esp + 0x10], edx
mov dword [esp + 4], 7
mov dword [esp], 0x1a
call fcn.0042b9b0
jmp 0x501fa4
mov ecx, dword [esi + 0x50]
lea eax, [ecx + ebx]
movzx edx, byte [eax]
lea ecx, [ecx + ebx + 1]
add ebx, 2
shr dl, 4
movzx edx, dl
mov dword [esi + 0x64], edx
mov dword [esp + 0x4c], edx
movzx eax, byte [eax]
and eax, 0xf
mov dword [esi + 0x68], eax
movzx edx, byte [ecx]
shr dl, 4
movzx edx, dl
mov dword [esi + 0x6c], edx
mov dword [esp + 0x50], edx
movzx edx, byte [ecx]
mov ecx, dword [esp + 0x50]
and edx, 0xf
mov dword [esi + 0x70], edx
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], ecx
mov dword [esp + 8], str.Palette__d___d___d___d_n
mov dword [esp + 0xc], eax
mov dword [esp + 4], 7
mov dword [esp], 0x1a
call fcn.0042b9b0
jmp 0x501fa4
mov dword [esp + 8], str.Stop_display__n
mov dword [esp + 4], 7
mov dword [esp], 0x1a
call fcn.0042b9b0
test edi, edi
js 0x502225
mov ebp, dword [esp + 0x74]
jmp 0x501fa4
mov dword [esp + 8], str.Start_display__n
mov dword [esp + 4], 7
mov dword [esp], 0x1a
call fcn.0042b9b0
test edi, edi
js 0x50223a
mov eax, dword [esp + 0x74]
mov dword [esp + 0x5c], eax
mov dword [esi + 0x114], 0
mov ebp, 0xffffffff
mov dword [esp + 0x6c], 1
jmp 0x501fa4
mov edx, dword [esi + 0x50]
lea eax, [edx + ebx]
movzx ecx, byte [eax + 1]
lea edx, [edx + ebx + 2]
add ebx, 4
movzx eax, byte [eax]
shl eax, 8
lea eax, [ecx + eax]
movzx ecx, byte [edx + 1]
movzx edx, byte [edx]
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.Graphic_offset_1:__d__offset_2:__d_n
mov dword [esp + 4], 7
shl edx, 8
lea edx, [ecx + edx]
lea ecx, [edx + edx]
mov dword [esp + 0x10], edx
lea edx, [eax + eax]
mov dword [esp + 0x88], ecx
mov dword [esp + 0x84], edx
mov dword [esp], 0x1a
call fcn.0042b9b0
jmp 0x501fa4
mov dword [esp + 8], str.Menu_ID_n
mov dword [esp + 4], 7
mov dword [esp], 0x1a
call fcn.0042b9b0
test edi, edi
js 0x502255
mov edx, dword [esp + 0x74]
mov dword [esp + 0x5c], edx
mov dword [esi + 0x114], 0xffffffff
mov ebp, 0xffffffff
mov dword [esp + 0x6c], 1
jmp 0x501fa4
mov edx, dword [esp + 0x78]
xor ebp, ebp
cmp dword [esp + 0x48], edx
jbe 0x501fa4
jmp 0x50212c
mov ecx, dword [esp + 0x78]
cmp dword [esp + 0x48], ecx
mov dword [esp + 0x5c], 0
jbe 0x502161
jmp 0x502159
mov eax, dword [esp + 0x78]
cmp dword [esp + 0x48], eax
mov dword [esp + 0x5c], 0
jbe 0x502209
jmp 0x502201
mov ebx, esi
mov esi, edi
mov edi, dword [esp + 0x7c]
jmp 0x501e55
mov dword [esp + 4], 0x5c
mov dword [esp], 1
call sub.msvcrt.dll_calloc
mov ecx, dword [esp + 0x84]
mov edx, eax
mov eax, dword [esp + 0x5c]
mov dword [edx + 0x30], ecx
mov ecx, dword [esp + 0x64]
mov dword [edx + 0x54], ebp
mov dword [edx + 0x50], eax
mov eax, dword [esp + 0x88]
mov dword [edx + 0x40], ecx
mov ecx, dword [esp + 0x58]
mov dword [edx + 0x34], eax
mov eax, dword [esp + 0x60]
mov dword [edx + 0x44], ecx
mov ecx, dword [esp + 0x70]
mov dword [edx + 0x3c], eax
mov eax, dword [esp + 0x68]
mov dword [edx + 0x4c], ecx
mov dword [edx + 0x48], eax
mov eax, dword [esp + 0x80]
mov dword [edx + 0x2c], eax
mov eax, dword [ebx + 0x74]
mov dword [edx + 0x1c], eax
mov eax, dword [ebx + 0x64]
mov dword [edx + 0xc], eax
mov eax, dword [ebx + 0x78]
mov dword [edx + 0x20], eax
mov eax, dword [ebx + 0x68]
mov dword [edx + 0x10], eax
mov eax, dword [ebx + 0x7c]
mov dword [edx + 0x24], eax
mov eax, dword [ebx + 0x6c]
mov dword [edx + 0x14], eax
mov eax, dword [ebx + 0x80]
mov dword [edx + 0x28], eax
mov eax, dword [ebx + 0x70]
mov dword [edx + 0x18], eax
mov ecx, dword [ebx + 0x5c]
mov dword [esp + 0x44], edx
mov dword [esp + 0x48], ecx
mov dword [esp], ecx
call sub.msvcrt.dll_malloc
mov edx, dword [esp + 0x44]
mov ecx, dword [esp + 0x48]
mov dword [edx + 4], eax
mov dword [esp + 8], ecx
mov ecx, dword [ebx + 0x50]
mov dword [esp], eax
mov dword [esp + 4], ecx
call sub.msvcrt.dll_memcpy
mov edx, dword [esp + 0x44]
cmp dword [ebx], 0
je 0x502352
mov eax, dword [ebx + 4]
mov dword [eax + 0x58], edx
mov dword [ebx + 4], edx
jmp 0x501e9d
mov dword [ebx], edx
jmp 0x50234a