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

Disassembly:
push ebp
mov ebp, esp
in al, dx
and esp, 0xfffffff8
sub esp, 0x7c
mov eax, dword [0x4ae38c]
xor eax, esp
mov dword [esp + 0x78], eax
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
mov dword [esp + 8], eax
movzx eax, word [ecx]
push esi
push edi
mov dword [esp + 0x18], 0
test ax, ax
je 0x402b98
cmp ax, 0x25
je 0x402595
test ebx, ebx
je 0x402588
mov word [ebx], ax
add ebx, 2
inc dword [esp + 0x18]
add dword [ebp + 0xc], 2
jmp 0x402b89
mov ecx, dword [ebp + 0xc]
xor esi, esi
or edi, 0xffffffff
mov dword [esp + 0x30], esi
mov dword [esp + 0x28], edi
mov byte [esp + 0x1e], 0
mov byte [esp + 0x2e], 0
mov byte [esp + 0x2f], 0
mov byte [esp + 0x1f], 0
mov byte [esp + 0x17], 0
mov byte [esp + 0x27], 0
mov dword [esp + 0x34], 0x20
mov dword [esp + 0x20], 0x4cc138
lea edx, [esi + 0x30]
movzx eax, word [ecx + 2]
add ecx, 2
add eax, 0xffffffe0
cmp eax, 0x10
ja case.0x4025ec.33
movzx eax, byte [eax + 0x402bd8]
jmp dword [eax*4 + 0x402bc0]
mov byte [esp + 0x1e], 1
jmp 0x4025d6
mov byte [esp + 0x2e], 1
jmp 0x4025d6
mov dword [esp + 0x34], edx
jmp 0x4025d6
mov byte [esp + 0x2f], 1
jmp 0x4025d6
mov byte [esp + 0x1f], 1
jmp 0x4025d6
movzx eax, word [ecx]
cmp eax, 0x2a
jne 0x402634
mov eax, dword [esp + 0x10]
add eax, 4
mov dword [esp + 0x10], eax
mov eax, dword [eax - 4]
mov dword [esp + 0x30], eax
add ecx, 2
jmp 0x40265f
cmp ax, dx
jb 0x40265f
cmp eax, 0x39
ja 0x40265f
mov edi, edi
cmp ax, 0x39
ja 0x40265b
movzx eax, ax
lea esi, [esi + esi*4]
add ecx, 2
lea esi, [eax + esi*2 - 0x30]
movzx eax, word [ecx]
cmp ax, dx
jae 0x402640
mov dword [esp + 0x30], esi
cmp word [ecx], 0x2e
jne 0x4026af
movzx eax, word [ecx + 2]
add ecx, 2
xor edi, edi
mov dword [esp + 0x28], edi
cmp eax, 0x2a
jne 0x402689
mov eax, dword [esp + 0x10]
mov edi, dword [eax]
add eax, 4
mov dword [esp + 0x10], eax
add ecx, 2
jmp 0x4026ab
cmp ax, dx
jb 0x4026af
mov edi, edi
cmp ax, 0x39
ja 0x4026ab
movzx eax, ax
lea esi, [edi + edi*4]
add ecx, 2
lea edi, [eax + esi*2 - 0x30]
movzx eax, word [ecx]
cmp ax, dx
jae 0x402690
mov dword [esp + 0x28], edi
movzx eax, word [ecx]
cmp eax, 0x49
je 0x4026f0
cmp eax, 0x68
je 0x4026c6
cmp eax, 0x6c
jne 0x4026c9
mov byte [esp + 0x17], 1
add ecx, 2
mov dl, byte [esp + 0x27]
movzx eax, word [ecx]
add ecx, 2
sub eax, 0x25
mov dword [ebp + 0xc], ecx
cmp eax, 0x53
ja case.0x4026e9.38
movzx ecx, byte [eax + 0x402c18]
jmp dword [ecx*4 + 0x402bec]
cmp word [ecx + 2], 0x36
jne 0x4026c9
cmp word [ecx + 4], 0x34
jne 0x4026c9
add ecx, 6
mov dl, 1
jmp 0x4026cd
mov eax, dword [esp + 0x10]
push 0xa
test dl, dl
je 0x40272d
mov ecx, dword [eax + 4]
add eax, 8
lea edx, [esp + 0x3c]
push edx
mov edx, dword [eax - 8]
push ecx
push edx
mov dword [esp + 0x20], eax
call fcn.00402ca0
add esp, 0x10
jmp 0x402752
mov edx, dword [eax]
add eax, 4
cmp byte [esp + 0x1b], 0
lea ecx, [esp + 0x3c]
push ecx
mov dword [esp + 0x18], eax
push edx
je 0x40274a
call fcn.00402e30
jmp 0x40274f
call fcn.00402e30
add esp, 0xc
cmp word [esp + 0x38], 0x2d
jne 0x402767
mov dword [esp + 0x20], 0x4ae4cc
jmp case.0x4026e9.110
cmp byte [esp + 0x2e], 0
je 0x40277b
mov dword [esp + 0x20], 0x4ae4c8
jmp case.0x4026e9.110
cmp byte [esp + 0x2f], 0
je case.0x4026e9.110
mov dword [esp + 0x20], 0x4ae4e0
jmp case.0x4026e9.110
test dl, dl
je 0x4027be
mov eax, dword [esp + 0x10]
mov edx, dword [eax + 4]
add eax, 8
push 0xa
lea ecx, [esp + 0x3c]
push ecx
mov dword [esp + 0x18], eax
mov eax, dword [eax - 8]
push edx
push eax
call fcn.00402ee0
add esp, 0x10
jmp case.0x4026e9.110
mov eax, dword [esp + 0x10]
mov edx, dword [eax]
add eax, 4
push 0xa
lea ecx, [esp + 0x3c]
push ecx
push edx
mov dword [esp + 0x1c], eax
call fcn.00403040
add esp, 0xc
jmp case.0x4026e9.110
test dl, dl
jne 0x402797
cmp byte [esp + 0x1f], dl
je 0x4027f2
mov dword [esp + 0x20], 0x4ae4e4
mov eax, dword [esp + 0x10]
mov esi, dword [eax]
add eax, 4
push 8
lea ecx, [esp + 0x3c]
push ecx
push esi
mov dword [esp + 0x1c], eax
call fcn.00403040
add esp, 0xc
test esi, esi
jne case.0x4026e9.110
mov dword [esp + 0x20], 0x4cc138
jmp case.0x4026e9.110
cmp byte [esp + 0x1f], 0
je 0x40282c
mov dword [esp + 0x20], 0x4ae4d0
mov eax, dword [esp + 0x10]
push 0x10
test dl, dl
je 0x402859
mov edi, dword [eax + 4]
mov esi, dword [eax]
add eax, 8
lea edx, [esp + 0x3c]
push edx
push edi
push esi
mov dword [esp + 0x20], eax
call fcn.00402ee0
add esp, 0x10
or esi, edi
mov edi, dword [esp + 0x28]
jmp 0x402872
mov esi, dword [eax]
add eax, 4
mov dword [esp + 0x14], eax
lea eax, [esp + 0x3c]
push eax
push esi
call fcn.00403040
add esp, 0xc
test esi, esi
jne 0x40287c
mov dword [esp + 0x20], 0x4cc138
lea ecx, [esp + 0x38]
push ecx
call fcn.004030e0
add esp, 4
cmp edi, 0xffffffff
jne 0x402893
mov edi, 1
cmp word [esp + 0x38], 0x2d
lea ecx, [esp + 0x38]
mov dword [esp + 0x28], ecx
jne 0x4028ab
lea ecx, [esp + 0x3a]
mov dword [esp + 0x28], ecx
test ecx, ecx
jne 0x402988
xor esi, esi
jmp 0x4029a2
cmp byte [esp + 0x1f], 0
je 0x4028c9
mov dword [esp + 0x20], 0x4ae4d8
mov eax, dword [esp + 0x10]
push 0x10
test dl, dl
je 0x4028f6
mov edi, dword [eax + 4]
mov esi, dword [eax]
add eax, 8
lea edx, [esp + 0x3c]
push edx
push edi
push esi
mov dword [esp + 0x20], eax
call fcn.00402ee0
add esp, 0x10
or esi, edi
mov edi, dword [esp + 0x28]
jmp 0x40290f
mov esi, dword [eax]
add eax, 4
mov dword [esp + 0x14], eax
lea eax, [esp + 0x3c]
push eax
push esi
call fcn.00403040
add esp, 0xc
test esi, esi
jne 0x402919
mov dword [esp + 0x20], 0x4cc138
lea ecx, [esp + 0x38]
push ecx
call fcn.00402350
jmp 0x402886
mov eax, dword [esp + 0x10]
mov dx, word [eax]
add eax, 4
mov dword [esp + 0x10], eax
mov word [esp + 0x38], dx
lea esi, [esp + 0x38]
mov eax, 1
jmp 0x402b16
mov eax, dword [esp + 0x10]
mov esi, dword [eax]
add eax, 4
mov dword [esp + 0x10], eax
test esi, esi
jne 0x40295e
xor eax, eax
jmp 0x402970
mov eax, esi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x402960
sub eax, esi
sar eax, 1
dec eax
cmp edi, 0xffffffff
je 0x402b16
cmp edi, eax
jge 0x402b16
mov eax, edi
jmp 0x402b16
mov eax, ecx
lea ebx, [ebx]
mov dx, word [eax]
add eax, 2
test dx, dx
jne 0x402990
sub eax, ecx
sar eax, 1
lea esi, [eax - 1]
sub edi, esi
mov edx, edi
jns 0x4029aa
xor edx, edx
mov ecx, dword [esp + 0x20]
test ecx, ecx
jne 0x4029b6
xor eax, eax
jmp 0x4029d0
mov eax, ecx
jmp 0x4029c0
mov di, word [eax]
add eax, 2
test di, di
jne 0x4029c0
sub eax, ecx
sar eax, 1
dec eax
mov ecx, dword [esp + 0x30]
sub ecx, eax
sub ecx, edx
sub ecx, esi
jns 0x4029de
xor ecx, ecx
cmp word [esp + 0x34], 0x30
mov edi, dword [esp + 0x20]
jne 0x402a0f
movzx eax, word [edi]
test ax, ax
je 0x402a0f
test ebx, ebx
je 0x4029ff
mov word [ebx], ax
add ebx, 2
add edi, 2
movzx eax, word [edi]
inc dword [esp + 0x18]
test ax, ax
jne 0x4029f2
mov dword [esp + 0x20], edi
test ecx, ecx
je 0x402a35
cmp byte [esp + 0x1e], 0
jne 0x402a31
add dword [esp + 0x18], ecx
mov eax, dword [esp + 0x34]
dec ecx
test ebx, ebx
je 0x402a2d
mov word [ebx], ax
add ebx, 2
test ecx, ecx
jne 0x402a22
mov edi, dword [esp + 0x20]
cmp word [edi], 0
je 0x402a59
mov eax, edi
sub eax, ebx
nop
test ebx, ebx
je 0x402a4e
mov di, word [ebx + eax]
mov word [ebx], di
add ebx, 2
inc dword [esp + 0x18]
cmp word [ebx + eax], 0
jne 0x402a40
test edx, edx
jle 0x402a75
add dword [esp + 0x18], edx
dec edx
test ebx, ebx
je 0x402a71
mov eax, 0x30
mov word [ebx], ax
add ebx, 2
test edx, edx
jg 0x402a61
test esi, esi
jle 0x402a96
mov eax, dword [esp + 0x28]
sub eax, ebx
add dword [esp + 0x18], esi
dec esi
test ebx, ebx
je 0x402a92
mov dx, word [ebx + eax]
mov word [ebx], dx
add ebx, 2
test esi, esi
jg 0x402a83
test ecx, ecx
je 0x402b89
add dword [esp + 0x18], ecx
dec ecx
test ebx, ebx
je 0x402ab2
mov eax, 0x20
mov word [ebx], ax
add ebx, 2
test ecx, ecx
jne 0x402aa2
jmp 0x402b89
mov ecx, 0x25
mov word [esp + 0x38], cx
lea esi, [esp + 0x38]
lea eax, [ecx - 0x24]
jmp 0x402b16
mov esi, 0x4ae4e8
xor edx, edx
cmp edx, esi
jne 0x402add
xor eax, eax
jmp 0x402b16
mov eax, 0x4ae4e8
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x402ae2
jmp 0x402b0e
mov esi, 0x4ae4e8
xor edx, edx
cmp edx, esi
jne 0x402afe
xor eax, eax
jmp 0x402b16
mov eax, 0x4ae4e8
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x402b03
sub eax, 0x4ae4e8
sar eax, 1
dec eax
mov ecx, dword [esp + 0x30]
cmp ecx, eax
jle 0x402bba
sub ecx, eax
test ecx, ecx
je 0x402b49
cmp byte [esp + 0x1e], 0
jne 0x402b49
add dword [esp + 0x18], ecx
mov edx, dword [esp + 0x34]
dec ecx
test ebx, ebx
je 0x402b42
mov word [ebx], dx
add ebx, 2
test ecx, ecx
jne 0x402b37
or ecx, 0xffffffff
test eax, eax
jle 0x402b66
add dword [esp + 0x18], eax
dec eax
test ebx, ebx
je 0x402b62
mov dx, word [esi]
mov word [ebx], dx
add ebx, 2
add esi, 2
test eax, eax
jg 0x402b51
test ecx, ecx
je 0x402b89
cmp byte [esp + 0x1e], 0
je 0x402b89
add dword [esp + 0x18], ecx
dec ecx
test ebx, ebx
je 0x402b85
mov eax, 0x20
mov word [ebx], ax
add ebx, 2
test ecx, ecx
jne 0x402b75
mov ecx, dword [ebp + 0xc]
movzx eax, word [ecx]
test ax, ax
jne 0x402578
mov eax, dword [esp + 0x18]
test ebx, ebx
je 0x402ba5
xor edx, edx
mov word [ebx], dx
mov ecx, dword [esp + 0x84]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0046c536
mov esp, ebp
pop ebp
ret
xor ecx, ecx
jmp 0x402b49