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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x7c
push ebx
push esi
push edi
mov edi, eax
mov dword [esp + 0x10], 0
test edi, edi
jne 0x4021a4
lea eax, [edi - 0x66]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x58]
add eax, dword [edi + 0x48]
mov ecx, dword [edi + 0x5c]
mov edx, dword [edi + 0x10]
adc ecx, dword [edi + 0x4c]
mov esi, dword [edi + 0x30]
test edx, edx
je 0x4021ca
push 0
push ecx
push eax
mov eax, dword [edi + 0x1c]
push esi
push eax
call edx
add esp, 0x14
jmp 0x4021e3
xor edx, edx
cmp eax, eax
jne 0x4021e7
cmp edx, ecx
jne 0x4021e7
mov ecx, dword [edi + 0x1c]
push edx
mov edx, dword [edi + 0x28]
push eax
push esi
push ecx
call edx
add esp, 0x10
test eax, eax
je 0x4021f0
or esi, 0xffffffff
mov dword [esp + 0x10], esi
jmp 0x402225
mov ebx, dword [edi + 0x30]
lea eax, [esp + 0x1c]
push eax
mov esi, edi
call fcn.004011a0
add esp, 4
test eax, eax
je 0x402210
mov dword [esp + 0x10], 0xffffffff
jmp 0x402222
cmp dword [esp + 0x1c], 0x2014b50
je 0x402222
mov dword [esp + 0x10], 0xffffff99
or esi, 0xffffffff
mov ebx, dword [edi + 0x30]
lea ecx, [esp + 0x30]
push ecx
call fcn.00401100
add esp, 4
test eax, eax
je 0x40223d
mov dword [esp + 0x10], esi
mov ebx, dword [edi + 0x30]
lea edx, [esp + 0x34]
push edx
call fcn.00401100
add esp, 4
test eax, eax
je 0x402255
mov dword [esp + 0x10], esi
mov ebx, dword [edi + 0x30]
lea eax, [esp + 0x38]
push eax
call fcn.00401100
add esp, 4
test eax, eax
je 0x40226d
mov dword [esp + 0x10], esi
mov ebx, dword [edi + 0x30]
lea ecx, [esp + 0x3c]
push ecx
call fcn.00401100
add esp, 4
test eax, eax
je 0x402285
mov dword [esp + 0x10], esi
mov ebx, dword [edi + 0x30]
lea edx, [esp + 0x40]
push edx
mov esi, edi
call fcn.004011a0
add esp, 4
test eax, eax
je 0x4022a3
mov dword [esp + 0x10], 0xffffffff
mov ecx, dword [esp + 0x40]
xor edx, edx
mov esi, ecx
mov eax, edx
shrd esi, eax, 0x10
mov ebx, esi
shr eax, 0x10
mov dword [esp + 0x28], esi
and ebx, 0x1f
mov dword [esp + 0x7c], ebx
mov ebx, eax
shrd esi, ebx, 5
and esi, 0xf
dec esi
mov dword [esp + 0x80], esi
mov esi, dword [esp + 0x28]
shrd esi, eax, 9
and esi, 0x7f
shr eax, 9
add esi, 0x7bc
mov dword [esp + 0x84], esi
mov eax, ecx
mov esi, edx
shrd eax, esi, 0xb
and eax, 0x1f
mov dword [esp + 0x78], eax
mov eax, ecx
and ecx, 0x1f
shrd eax, edx, 5
add ecx, ecx
mov dword [esp + 0x70], ecx
lea ecx, [esp + 0x44]
and eax, 0x3f
shr ebx, 5
mov ebx, dword [edi + 0x30]
shr esi, 0xb
push ecx
mov esi, edi
shr edx, 5
mov dword [esp + 0x78], eax
call fcn.004011a0
add esp, 4
test eax, eax
je 0x402339
mov dword [esp + 0x10], 0xffffffff
mov ebx, dword [edi + 0x30]
lea edx, [esp + 0x14]
push edx
call fcn.004011a0
add esp, 4
test eax, eax
je 0x402355
mov dword [esp + 0x10], 0xffffffff
mov eax, dword [esp + 0x14]
mov ebx, dword [edi + 0x30]
lea ecx, [esp + 0x14]
push ecx
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], 0
call fcn.004011a0
add esp, 4
test eax, eax
je 0x402381
mov dword [esp + 0x10], 0xffffffff
mov edx, dword [esp + 0x14]
mov ebx, dword [edi + 0x30]
lea eax, [esp + 0x58]
push eax
mov dword [esp + 0x54], edx
mov dword [esp + 0x58], 0
call fcn.00401100
add esp, 4
or esi, 0xffffffff
test eax, eax
je 0x4023ac
mov dword [esp + 0x10], esi
mov ebx, dword [edi + 0x30]
lea ecx, [esp + 0x5c]
push ecx
call fcn.00401100
add esp, 4
test eax, eax
je 0x4023c4
mov dword [esp + 0x10], esi
mov ebx, dword [edi + 0x30]
lea edx, [esp + 0x60]
push edx
call fcn.00401100
add esp, 4
test eax, eax
je 0x4023dc
mov dword [esp + 0x10], esi
mov ebx, dword [edi + 0x30]
lea eax, [esp + 0x64]
push eax
call fcn.00401100
add esp, 4
test eax, eax
je 0x4023f4
mov dword [esp + 0x10], esi
mov ebx, dword [edi + 0x30]
lea ecx, [esp + 0x68]
push ecx
call fcn.00401100
add esp, 4
test eax, eax
je 0x40240c
mov dword [esp + 0x10], esi
mov ebx, dword [edi + 0x30]
lea edx, [esp + 0x6c]
push edx
mov esi, edi
call fcn.004011a0
add esp, 4
test eax, eax
je 0x40242a
mov dword [esp + 0x10], 0xffffffff
mov ebx, dword [edi + 0x30]
lea eax, [esp + 0x14]
push eax
call fcn.004011a0
add esp, 4
test eax, eax
je 0x402446
mov dword [esp + 0x10], 0xffffffff
cmp dword [esp + 0x10], 0
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x58]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x2c], 0
mov dword [esp + 0x14], esi
jne 0x40253d
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x4024b8
mov ecx, dword [ebp + 0x14]
cmp esi, ecx
jae 0x40247f
mov byte [esi + eax], 0
mov ebx, esi
jmp 0x402481
mov ebx, ecx
test esi, esi
je 0x4024a7
test ecx, ecx
je 0x4024a7
mov edx, dword [edi + 0x30]
mov ecx, dword [edi + 4]
push ebx
push eax
mov eax, dword [edi + 0x1c]
push edx
push eax
call ecx
add esp, 0x10
cmp eax, ebx
je 0x4024a7
mov dword [esp + 0x10], 0xffffffff
sub esi, ebx
cmp dword [esp + 0x10], 0
mov dword [esp + 0x14], esi
jne 0x40253d
cmp dword [ebp + 0x18], 0
je 0x40253d
mov edx, dword [esp + 0x5c]
mov ebx, edx
cmp edx, dword [ebp + 0x1c]
jb 0x4024cc
mov ebx, dword [ebp + 0x1c]
cmp dword [esp + 0x14], 0
je 0x4024fe
mov eax, dword [esp + 0x14]
mov esi, dword [edi + 0x30]
cdq
push edx
push eax
mov edx, 1
mov eax, edi
call fcn.00407ac0
add esp, 8
test eax, eax
jne 0x4024f6
mov dword [esp + 0x14], eax
jmp 0x4024fe
mov dword [esp + 0x10], 0xffffffff
mov esi, dword [esp + 0x5c]
test esi, esi
je 0x402535
cmp dword [ebp + 0x1c], 0
jbe 0x402535
mov eax, dword [ebp + 0x18]
mov ecx, dword [edi + 0x30]
mov edx, dword [edi + 0x1c]
push ebx
push eax
mov eax, dword [edi + 4]
push ecx
push edx
call eax
add esp, 0x10
xor ecx, ecx
cmp eax, ebx
jne 0x40252d
xor eax, eax
cmp ecx, eax
je 0x402535
mov dword [esp + 0x10], 0xffffffff
sub esi, ebx
add dword [esp + 0x14], esi
jmp 0x402545
mov ecx, dword [esp + 0x5c]
add dword [esp + 0x14], ecx
cmp dword [esp + 0x10], 0
jne 0x40279a
cmp dword [esp + 0x5c], 0
je 0x4026e6
mov edx, dword [esp + 0x5c]
sub dword [esp + 0x14], edx
mov dword [esp + 0x1c], 0
je 0x402598
mov eax, dword [esp + 0x14]
mov esi, dword [edi + 0x30]
cdq
push edx
push eax
mov edx, 1
mov eax, edi
call fcn.00407ac0
add esp, 8
test eax, eax
jne 0x402590
mov dword [esp + 0x14], eax
jmp 0x402598
mov dword [esp + 0x10], 0xffffffff
cmp dword [esp + 0x5c], 0
jbe 0x4026db
mov ebx, dword [edi + 0x30]
lea eax, [esp + 0x20]
push eax
call fcn.00401100
add esp, 4
or esi, 0xffffffff
test eax, eax
je 0x4025be
mov dword [esp + 0x10], esi
mov ebx, dword [edi + 0x30]
lea ecx, [esp + 0x18]
push ecx
call fcn.00401100
add esp, 4
test eax, eax
je 0x4025d6
mov dword [esp + 0x10], esi
cmp dword [esp + 0x20], 1
mov ebx, dword [esp + 0x18]
jne 0x402687
cmp dword [esp + 0x50], esi
jne 0x40260d
cmp dword [esp + 0x54], 0
jne 0x40260d
mov eax, dword [edi + 0x30]
lea edx, [esp + 0x50]
push edx
push eax
mov eax, edi
call fcn.004012b0
add esp, 8
test eax, eax
je 0x40260d
mov dword [esp + 0x10], esi
cmp dword [esp + 0x48], esi
jne 0x402635
cmp dword [esp + 0x4c], 0
jne 0x402635
mov edx, dword [edi + 0x30]
lea ecx, [esp + 0x48]
push ecx
push edx
mov eax, edi
call fcn.004012b0
add esp, 8
test eax, eax
je 0x402635
mov dword [esp + 0x10], esi
cmp dword [esp + 0x28], esi
jne 0x40265d
cmp dword [esp + 0x2c], 0
jne 0x40265d
mov ecx, dword [edi + 0x30]
lea eax, [esp + 0x28]
push eax
push ecx
mov eax, edi
call fcn.004012b0
add esp, 8
test eax, eax
je 0x40265d
mov dword [esp + 0x10], esi
cmp dword [esp + 0x64], esi
jne 0x4026c5
mov ebx, dword [edi + 0x30]
lea edx, [esp + 0x24]
push edx
mov esi, edi
call fcn.004011a0
mov ebx, dword [esp + 0x1c]
add esp, 4
test eax, eax
je 0x4026c5
mov dword [esp + 0x10], 0xffffffff
jmp 0x4026c5
mov eax, dword [edi + 0x10]
mov ecx, dword [edi + 0x30]
xor edx, edx
test eax, eax
je 0x4026a3
push 1
push edx
push ebx
push ecx
mov ecx, dword [edi + 0x1c]
push ecx
call eax
add esp, 0x14
jmp 0x4026bd
xor eax, eax
cmp ebx, ebx
jne 0x4026c1
cmp eax, edx
jne 0x4026c1
mov edx, dword [edi + 0x1c]
mov eax, dword [edi + 0x28]
push 1
push ebx
push ecx
push edx
call eax
add esp, 0x10
test eax, eax
je 0x4026c5
mov dword [esp + 0x10], esi
mov ecx, dword [esp + 0x1c]
lea eax, [ecx + ebx + 4]
mov dword [esp + 0x1c], eax
cmp eax, dword [esp + 0x5c]
jb 0x4025a3
cmp dword [esp + 0x10], 0
jne 0x40279a
mov ecx, dword [ebp + 0x20]
test ecx, ecx
je 0x402774
mov ebx, dword [esp + 0x60]
mov eax, dword [ebp + 0x24]
cmp ebx, eax
jae 0x402706
mov byte [ebx + ecx], 0
mov dword [esp + 0x1c], ebx
jmp 0x40270a
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x14]
test eax, eax
je 0x402733
mov esi, dword [edi + 0x30]
cdq
push edx
push eax
mov edx, 1
mov eax, edi
call fcn.00407ac0
add esp, 8
test eax, eax
je 0x402733
mov dword [esp + 0x10], 0xffffffff
test ebx, ebx
je 0x40276d
cmp dword [ebp + 0x24], 0
jbe 0x40276d
mov esi, dword [esp + 0x1c]
mov edx, dword [ebp + 0x20]
mov eax, dword [edi + 0x30]
mov ecx, dword [edi + 0x1c]
push esi
push edx
mov edx, dword [edi + 4]
push eax
push ecx
call edx
add esp, 0x10
cmp eax, esi
je 0x40276d
mov dword [esp + 0x10], 0xffffffff
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esp + 0x10], 0
jne 0x40279a
mov edi, dword [ebp + 8]
test edi, edi
je 0x402786
mov ecx, 0x16
lea esi, [esp + 0x30]
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x40279a
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
mov dword [eax], ecx
mov dword [eax + 4], edx
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret