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

Disassembly:
push 0xffffffffffffffff
push 0x593f94
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x48
mov eax, dword [esp + 0x64]
mov edx, dword [esp + 0x5c]
push esi
push edi
push 0x80101010
xor esi, esi
push esi
push eax
mov eax, dword [esp + 0x6c]
mov edi, ecx
mov ecx, dword [esp + 0x74]
push ecx
push edx
push eax
mov ecx, edi
call fcn.0041ac20
mov eax, 9
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov eax, 7
push str._r_a_a_a
mov ecx, edi
mov dword [esp + 0x34], esi
mov dword [esp + 0x44], esi
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], esi
mov dword [esp + 0x50], eax
call fcn.0041ad60
lea ecx, [esp + 0x30]
push ecx
mov ecx, edi
call fcn.0041ad90
mov ecx, dword [edi + 0xcc]
cmp ecx, esi
je 0x4021e8
mov edx, dword [ecx]
push 1
call dword [edx + 4]
mov dword [edi + 0xcc], esi
cmp word [edi + 4], si
jle 0x4024c9
cmp word [edi + 6], si
jle 0x4024c9
push ebx
push ebp
push 0x38
call fcn.00591ce0
add esp, 4
mov dword [esp + 0x74], eax
cmp eax, esi
mov dword [esp + 0x60], esi
je 0x40221f
mov ecx, eax
call fcn.0057b740
mov ebp, eax
jmp 0x402221
xor ebp, ebp
movsx eax, word [edi + 6]
mov edx, dword [edi]
push 1
push esi
push eax
mov ecx, edi
mov dword [esp + 0x6c], 0xffffffff
call dword [edx + 0x54]
movsx ecx, word [edi + 4]
imul eax, ecx
push eax
push 8
mov ecx, ebp
call fcn.0057c160
push esi
mov ecx, ebp
call fcn.0057bf60
inc word [ebp + 0x1c]
movsx edx, word [edi + 4]
mov eax, dword [edi]
mov ecx, edi
mov dword [esp + 0x30], edx
call dword [eax + 0x54]
mov ebx, eax
cmp ebx, esi
mov dword [esp + 0x10], ebx
jle 0x4024c7
lea ecx, [esp + 0x18]
push ecx
push 0x1d5
call fcn.0057b230
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x28]
cdq
idiv ebx
mov ecx, dword [esp + 0x20]
add esp, 8
mov dword [esp + 0x70], ebx
mov edx, eax
sub edx, ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x28], edx
jmp 0x4022b0
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
lea ecx, [ecx]
mov edx, dword [esp + 0x1c]
push edx
mov edx, dword [esp + 0x28]
sub edx, dword [esp + 0x20]
push ecx
push edx
sub eax, ecx
mov ecx, dword [esp + 0x80]
push eax
push 0
push esi
push ebp
call fcn.0057a740
mov eax, dword [esp + 0x20]
sub eax, dword [esp + 0x18]
push 0
push eax
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.USER32.dll_OffsetRect]
movsx ecx, word [edi + 4]
mov eax, dword [esp + 0x70]
add esi, ecx
dec eax
mov dword [esp + 0x70], eax
jne 0x4022a5
lea edx, [esp + 0x18]
push edx
push 0x1d7
call fcn.0057b230
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x28]
cdq
idiv ebx
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x38]
mov edx, ecx
add esp, 8
sub edx, eax
add esi, edx
mov dword [esp + 0x30], esi
movsx esi, word [edi + 4]
sub esi, eax
mov dword [esp + 0x20], eax
add esi, ecx
jmp 0x402340
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
mov edi, edi
mov edx, dword [esp + 0x1c]
push edx
mov edx, dword [esp + 0x28]
sub edx, dword [esp + 0x20]
push ecx
push edx
sub eax, ecx
mov ecx, dword [esp + 0x80]
push eax
push 0
push esi
push ebp
call fcn.0057a740
mov eax, dword [esp + 0x20]
sub eax, dword [esp + 0x18]
push 0
push eax
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.USER32.dll_OffsetRect]
movsx ecx, word [edi + 4]
add esi, ecx
dec ebx
jne 0x402336
lea edx, [esp + 0x18]
push edx
push 0x1d6
call fcn.0057b230
mov ebx, dword [esp + 0x18]
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x28]
cdq
idiv ebx
mov ecx, dword [esp + 0x30]
mov esi, dword [esp + 0x38]
add esp, 8
sub esi, ecx
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x14], esi
mov dword [esp + 0x68], ebx
mov dword [esp + 0x20], eax
jmp 0x4023c2
mov eax, dword [esp + 0x20]
test esi, esi
mov ecx, dword [esp + 0x6c]
mov dword [esp + 0x70], ecx
mov ecx, dword [esp + 0x18]
jle 0x402427
sub eax, ecx
push eax
push esi
call dword [sym.imp.SanCalc.dll_int___cdecl_min_int__int_]
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x2c]
add esp, 8
mov ebx, eax
mov eax, dword [esp + 0x1c]
push eax
push edx
mov edx, dword [esp + 0x78]
sub ecx, eax
push ecx
mov ecx, dword [esp + 0x80]
push ebx
push 0
push edx
push ebp
call fcn.0057a740
mov eax, dword [esp + 0x70]
mov ecx, dword [esp + 0x18]
add eax, ebx
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x20]
mov edx, ecx
sub edx, eax
add esi, edx
test esi, esi
jg 0x4023d2
mov esi, dword [esp + 0x14]
sub eax, ecx
push 0
push eax
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.USER32.dll_OffsetRect]
movsx ecx, word [edi + 4]
mov edx, dword [esp + 0x6c]
mov eax, dword [esp + 0x68]
add edx, ecx
dec eax
mov dword [esp + 0x6c], edx
mov dword [esp + 0x68], eax
jne 0x4023be
mov ecx, dword [esp + 0x74]
test ecx, ecx
je 0x402462
push ebp
call fcn.005797f0
push 0x44
call fcn.00591ce0
add esp, 4
mov dword [esp + 0x74], eax
test eax, eax
mov dword [esp + 0x60], 1
je 0x402485
mov ecx, eax
call fcn.00579120
jmp 0x402487
xor eax, eax
push ebp
mov ecx, eax
mov dword [esp + 0x64], 0xffffffff
mov dword [edi + 0xcc], eax
call fcn.00577180
mov ecx, dword [edi + 0xcc]
push 1
call fcn.00579470
mov edx, dword [esp + 0x10]
mov ecx, dword [edi + 0xcc]
push edx
call fcn.005794b0
mov eax, dword [edi + 0xcc]
mov dword [eax + 0x14], 0x40
pop ebp
pop ebx
mov ecx, dword [esp + 0x50]
pop edi
pop esi
mov dword fs:[0], ecx
add esp, 0x54
ret 0x10