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

Disassembly:
push ebp
xor ecx, ecx
mov ebp, esp
sub esp, 0x48
mov dword [ebp - 8], esi
mov esi, dword [ebp + 8]
mov dword [ebp - 4], edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0xc], ebx
mov ebx, dword [esi]
movzx edx, byte [ebx + 0x98]
movzx eax, byte [ebx]
or dl, 1
and al, 0x7f
and dl, byte [edi + 0x30]
shl dl, 7
or al, dl
mov byte [ebx], al
test al, al
js 0x4029c5
xor ecx, ecx
test dword [ebx + 0xb0], 0x3000
setne cl
mov eax, dword [edi + 0x10]
cmp eax, dword [esi + 0x3c]
je 0x402a44
cmp byte [esi + 0x5c], 0
jne 0x4029f0
cmp eax, dword [esi + 0x78]
je 0x402ab0
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
cmp eax, dword [esi + 0x6c]
jne 0x4029d3
mov byte [esi + 0x5c], 1
test ecx, ecx
je 0x402ac7
movzx eax, word [esi + 0x66]
mov word [ebp - 0x20], ax
dec ax
je 0x402bde
cmp word [ebp - 0x20], 0
jne 0x402bfd
movsx eax, word [esi + 0x5e]
cmp dword [edi + 0x24], eax
jge 0x402c34
mov dword [ebp + 0xc], 0x423448
mov dword [ebp + 8], esi
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
jmp fcn.00402420
mov edx, dword [edi + 0x18]
test edx, edx
jne 0x4029cd
mov eax, dword [edi + 0x1c]
mov edx, dword [ebx + 0x14c]
mov dword [ebp - 0x24], eax
sub eax, edx
cmp eax, 0x1f3
setbe al
movzx eax, al
test ecx, ecx
mov dword [ebp - 0x10], eax
jne 0x402c68
mov eax, dword [edi + 0x34]
mov edx, dword [ebx + 0x154]
cmp eax, edx
je 0x402a87
xor eax, eax
mov dword [ebx + 0x148], eax
mov eax, dword [edi + 0x34]
cmp eax, 1
je 0x402c91
cmp eax, 3
je 0x402cd5
mov edx, dword [ebp - 0x24]
mov dword [ebx + 0x14c], edx
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
mov dword [ebp + 0xc], edi
mov ebx, dword [ebp - 0xc]
mov edi, dword [ebp - 4]
mov dword [ebp + 8], esi
mov esi, dword [ebp - 8]
mov esp, ebp
pop ebp
jmp fcn.00410aa0
movzx edx, word [esi + 0x66]
mov word [ebp - 0x20], dx
dec dx
je 0x402b3d
cmp word [ebp - 0x20], 0
jne 0x402b88
movsx eax, word [esi + 0x5e]
mov byte [ebp - 0x11], 0xff
mov ecx, dword [edi + 0x24]
cmp ecx, eax
jl 0x402afd
movsx eax, word [esi + 0x60]
cmp ecx, eax
jle 0x402b88
mov byte [ebp - 0x11], 1
mov dword [ebx + 0x58], 0x28
mov eax, 1
mov dword [esp + 8], eax
movsx eax, byte [ebp - 0x11]
mov dword [esp], esi
not eax
shr eax, 0x1f
mov dword [esp + 4], eax
call fcn.00408a90
test eax, eax
je 0x4029dc
movzx eax, byte [ebp - 0x11]
sar al, 7
and al, 0x11
add al, 0x44
mov byte [esi + 0x5c], al
jmp 0x4029dc
movzx eax, word [esi + 0x60]
mov ecx, dword [edi + 0x24]
movsx edx, ax
mov word [ebp - 0x1e], ax
cmp ecx, edx
mov dword [ebp - 0x18], edx
jle 0x402dd9
movzx eax, word [esi + 0x68]
mov byte [ebp - 0x11], 0xff
movsx edx, ax
mov word [ebp - 0x2a], ax
mov eax, dword [ebp - 0x18]
lea eax, [eax + edx + 1]
cmp ecx, eax
jle 0x402afd
movsx eax, word [ebp - 0x1e]
movsx edx, word [ebp - 0x2a]
mov byte [ebp - 0x11], 1
lea eax, [eax + edx + 1]
cmp ecx, eax
jg 0x402afd
mov eax, dword [edi + 0x34]
cmp eax, 2
je 0x402d5e
ja 0x402d2f
dec eax
jne 0x4029dc
cmp byte [ebx + 5], 0
jne 0x402bb3
movsx edx, word [esi + 0x62]
mov eax, dword [edi + 0x24]
sub eax, edx
mov dword [ebx + 0x54], eax
cmp word [ebp - 0x20], 2
je 0x402e5d
movsx eax, word [esi + 0x62]
mov edx, dword [edi + 0x24]
cmp edx, eax
jl 0x402e18
movsx eax, word [esi + 0x64]
cmp edx, eax
jg 0x402c49
mov byte [esi + 0x5c], 0x6d
jmp 0x4029dc
movsx edx, word [esi + 0x60]
mov ecx, dword [edi + 0x24]
cmp ecx, edx
jle 0x402d0e
movsx eax, word [esi + 0x68]
lea eax, [edx + eax + 1]
cmp ecx, eax
jle 0x402a29
cmp word [ebp - 0x20], 1
je 0x402d0e
cmp word [ebp - 0x20], 0
je 0x402c34
mov eax, dword [edi + 0x34]
cmp eax, 2
je 0x402dfb
ja 0x402de6
dec eax
jne 0x4029dc
mov dword [ebp + 0xc], str.e_6
jmp 0x402a30
movsx eax, word [esi + 0x60]
cmp dword [edi + 0x24], eax
jle 0x402c0f
mov dword [ebp + 0xc], 0x423451
jmp 0x402a30
movzx eax, word [esi + 0x10]
dec eax
mov dword [esp + 8], eax
mov eax, 1
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.00408a90
jmp 0x4029dc
mov eax, dword [edi + 0x30]
mov dword [ebx + 0x150], eax
mov eax, dword [edi + 0x34]
mov dword [ebx + 0x154], eax
mov dword [esp + 4], edi
mov dword [esp], esi
call fcn.004026d0
mov edi, dword [edi + 0x1c]
mov dword [ebp - 0x24], edi
jmp 0x402a99
dec edx
sete al
xor edx, edx
cmp dword [ebp - 0x10], 0
setne dl
test edx, eax
je 0x402d1f
inc dword [ebx + 0x148]
mov eax, dword [edi + 0x24]
mov dword [esp + 0xc], eax
mov eax, dword [edi + 0x20]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x148]
mov dword [esp], esi
mov esi, 1
mov dword [esp + 4], eax
call fcn.0040d6b0
mov dword [ebx + 0x154], esi
jmp 0x402c86
cmp edx, 3
sete al
xor edx, edx
cmp dword [ebp - 0x10], 0
setne dl
test edx, eax
je 0x402d3d
mov eax, dword [edi + 0x24]
mov dword [esp + 8], eax
mov eax, dword [edi + 0x20]
mov dword [esp], esi
mov dword [esp + 4], eax
call fcn.0040d780
mov edx, 3
mov dword [ebx + 0x154], edx
jmp 0x402c86
movsx eax, word [esi + 0x60]
movsx edx, word [esi + 0x68]
lea eax, [eax + edx + 1]
jmp 0x402c38
mov eax, 1
mov dword [ebx + 0x148], eax
jmp 0x402ca8
cmp eax, 3
jne 0x4029dc
jmp 0x402bb3
mov ecx, 1
mov dword [esp + 0xc], ecx
mov eax, dword [edi + 0x24]
mov dword [esp + 8], eax
mov eax, dword [edi + 0x20]
mov dword [esp], esi
mov dword [esp + 4], eax
call fcn.0040d570
jmp 0x402cfe
movzx eax, byte [ebx + 5]
cmp eax, 1
je 0x402e0c
jle 0x402e3a
cmp eax, 2
je 0x402e28
cmp word [ebp - 0x20], 2
je 0x402e07
movsx eax, word [esi + 0x62]
mov ecx, dword [edi + 0x24]
cmp ecx, eax
jl 0x402d9c
movsx eax, word [esi + 0x64]
cmp ecx, eax
jle 0x402bd5
movzx edi, word [esi + 0x5e]
movsx edx, word [esi + 0x60]
movsx eax, di
sub edx, eax
cmp word [ebp - 0x20], 1
lea eax, [edx - 0xe]
je 0x402db6
lea eax, [edx - 0xa]
mov dword [esp + 8], eax
movsx eax, di
sub ecx, eax
mov eax, dword [ebx + 0x54]
mov dword [esp], esi
sub ecx, eax
mov dword [esp + 4], ecx
call fcn.0040a150
mov byte [esi + 0x5c], 0x6d
jmp 0x4029dc
movzx edx, word [esi + 0x68]
mov word [ebp - 0x2a], dx
jmp 0x402b70
cmp eax, 3
jne 0x4029dc
mov dword [ebp + 0xc], str.e_5
jmp 0x402a30
mov dword [ebp + 0xc], 0x42345a
jmp 0x402a30
mov ecx, dword [edi + 0x24]
jmp 0x402d9c
mov dword [ebx + 0x54], 0
jmp 0x402d7a
movzx eax, word [esi + 0x10]
dec eax
mov dword [esp + 8], eax
xor eax, eax
jmp 0x402c57
movsx eax, word [esi + 0x64]
movsx edx, word [esi + 0x62]
sub eax, edx
mov dword [ebx + 0x54], eax
jmp 0x402d7a
test eax, eax
jne 0x402d7a
movsx edx, word [esi + 0x62]
movsx eax, word [esi + 0x64]
sub eax, edx
mov edx, eax
shr edx, 0x1f
add eax, edx
sar eax, 1
mov dword [ebx + 0x54], eax
jmp 0x402d7a
movsx ecx, word [esi + 0x5e]
mov eax, dword [edi + 0x24]
movzx ebx, word [esi + 0x10]
sub eax, ecx
imul ebx, eax
movsx eax, word [esi + 0x60]
sub eax, ecx
lea ecx, [eax - 0xa]
mov eax, ebx
cdq
idiv ecx
mov dword [esp + 8], eax
xor eax, eax
cmp dword [edi + 0x34], 1
sete al
jmp 0x402c57