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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0xc8
mov edi, dword [ebp + 0x24]
mov edx, dword [ebp + 0x28]
mov ebx, dword [ebp + 8]
mov dword [esp + 0x44], edx
mov dword [esp + 0x40], edi
mov eax, dword [ebx]
mov ecx, dword [ebx + 4]
mov dword [esp + 8], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x34], 0
mov dword [esp + 0x30], 0
mov eax, dword [ebp + 0x20]
mov esi, 6
test eax, eax
js 0x4067cf
mov esi, eax
mov dword [esp + 4], ecx
mov dword [esp + 0x18], edi
mov eax, edi
or eax, edx
je 0x4067eb
mov edi, esi
and edi, 0x400
mov ax, 8
jmp 0x406805
cmp dword [ebp + 0x14], 0
setne al
mov edi, esi
and edi, 0x400
sete cl
and cl, al
movzx eax, cl
shl eax, 3
test esi, 0x10000
mov dword [esp + 0x1c], edx
jne 0x406819
movzx eax, ax
or eax, 0x800
mov dword [esp + 0x88], eax
mov eax, esi
xor eax, 0xfffffff0
or esi, 0xf
and esi, eax
sete al
test edi, edi
setne ah
mov ecx, dword [ebx + 0x48]
mov dword [esp + 0x10], ecx
test ecx, ecx
je 0x406c59
cmp dword [ebx + 0x14], 2
jne 0x406c59
cmp dword [ebp + 0x14], 0
sete cl
cmp dword [ebp + 0x10], 0
setne dl
cmp dword [ebp + 0xc], 0
je 0x406c59
or dl, cl
je 0x406c59
cmp word [ebp + 0x1c], 0
setne cl
cmp dword [ebp + 0x18], 0
sete dl
test dl, cl
jne 0x406c59
cmp esi, 0xb
jae 0x406c59
mov ecx, dword [esp + 0x10]
cmp dword [ecx + 0x34], 0
mov ecx, dword [ebx + 0x10]
je 0x4068b2
xor ebx, ebx
cmp ecx, 0xffffffff
mov edx, dword [esp + 0x1c]
jne 0x4068d1
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 2
jmp 0x406c62
mov edx, dword [esp + 0x1c]
test edx, edx
jne 0x4068c4
mov bl, 1
cmp ecx, 0xffff
jne 0x4068d1
mov ecx, dword [esp + 0x10]
mov dword [ecx + 0x34], 1
xor ebx, ebx
mov ecx, dword [esp + 0x18]
or ecx, edx
je 0x4068ec
test edi, edi
jne 0x4068ec
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x18
jmp 0x406c60
mov ecx, dword [ebp + 0xc]
cmp byte [ecx], 0x2f
je 0x406970
test edi, edi
je 0x406909
mov eax, dword [ebp + 0x2c]
mov dword [esp + 0x90], eax
mov byte [esp + 0x24], 1
jmp 0x40695e
or ah, al
mov byte [esp + 0x18], ah
mov eax, dword [ebp + 0x14]
push eax
push dword [ebp + 0x10]
push 0
call fcn.00404620
add esp, 0xc
mov dword [esp + 0x90], eax
mov ecx, dword [ebp + 0x14]
mov dword [esp + 0x40], ecx
mov dword [esp + 0x44], 0
mov eax, 0
cmp ecx, 4
setb cl
jb 0x406945
mov eax, esi
mov dword [esp + 0x1c], 0
or cl, byte [esp + 0x18]
mov byte [esp + 0x24], cl
mov ecx, dword [ebp + 0x14]
mov dword [esp + 0x18], ecx
mov esi, eax
push dword [ebp + 0xc]
call fcn.00409b80
add esp, 4
cmp eax, 0x10000
jb 0x40697f
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x19
jmp 0x406c60
mov dword [esp + 0x2c], eax
movzx eax, word [ebp + 0x1c]
mov dword [esp + 0x84], eax
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x20]
mov dword [esp + 0xc], 0
mov edx, dword [ecx + 0x24]
or edx, eax
mov edx, 0
je 0x4069b5
lea edx, [eax - 1]
mov ecx, dword [ecx]
and ecx, edx
sub eax, ecx
and eax, edx
mov edx, eax
mov dword [esp + 0x14], edx
mov eax, dword [esp + 0x10]
mov edx, dword [eax + 4]
lea ecx, [edx + edx]
and ecx, 0x5c
mov dword [esp + 0x28], edx
xor edx, 0x2e
xor eax, eax
add edx, dword [esp + 0x2c]
setb al
add edx, ecx
adc eax, 0
lea ecx, [edx + edx]
and ecx, 0x38
xor edx, 0x1c
add edx, dword [esp + 0x84]
adc eax, 0
add edx, ecx
adc eax, 0
mov ecx, 0xfffffffe
cmp ecx, edx
sbb dword [esp + 0xc], eax
jae 0x406a0f
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0xf
jmp 0x406c60
test bl, bl
je 0x406a88
mov ecx, dword [esp + 0x2c]
mov eax, ecx
shr eax, 0x1f
mov dword [esp + 0x8c], eax
mov dword [esp + 0xc], 0
mov ebx, dword [esp + 0x84]
add ebx, dword [ebp + 0x38]
mov edx, 0
adc edx, 0xffffffff
add ebx, dword [ebp + 0x40]
adc edx, 0
mov eax, ecx
add ecx, ecx
add ebx, ecx
mov ecx, eax
adc edx, dword [esp + 0x8c]
add ebx, dword [esp + 0x14]
adc edx, 0
add ebx, dword [esp + 0x28]
adc edx, 0
mov eax, dword [ebp + 8]
add ebx, dword [eax]
adc edx, dword [eax + 4]
add ebx, 0x72
adc edx, 0
cmp edx, 0xffffffff
je 0x406a94
mov eax, dword [esp + 0x10]
mov dword [eax + 0x34], 1
mov dword [esp + 0xc], 0x1c
jmp 0x406a94
mov dword [esp + 0xc], 0x1c
mov ecx, dword [esp + 0x2c]
xor edx, edx
test ecx, ecx
je 0x406ac4
mov eax, dword [ebp + 0xc]
cmp byte [eax + ecx - 1], 0x2f
mov ebx, dword [ebp + 8]
jne 0x406ac4
cmp dword [ebp + 0x14], 0
jne 0x406c59
mov edx, 0x10
mov eax, dword [esp + 0x18]
or eax, dword [esp + 0x1c]
jne 0x406c59
mov dword [esp + 0x8c], edx
mov eax, dword [esp + 0x84]
add eax, ecx
mov ecx, dword [esp + 0x28]
add ecx, eax
mov eax, dword [esp + 0xc]
add eax, ecx
add eax, 0x2e
mov ebx, dword [esp + 0x10]
cmp dword [ebx + 8], eax
jae 0x406b04
mov ecx, dword [ebp + 8]
mov edx, ebx
push 1
push eax
call fcn.004099c0
add esp, 8
test eax, eax
je 0x406c6c
mov eax, dword [ebx + 0x14]
inc eax
cmp dword [ebx + 0x18], eax
jae 0x406b26
lea edx, [ebx + 0x10]
mov ecx, dword [ebp + 8]
push 1
push eax
call fcn.004099c0
add esp, 8
test eax, eax
je 0x406c6c
cmp dword [ebp + 0x14], 0
sete cl
xor eax, eax
or cl, byte [esp + 0x24]
mov ebx, dword [ebp + 8]
jne 0x406b50
push 0x4df40
push 1
push dword [ebx + 0x34]
call dword [ebx + 0x28]
add esp, 0xc
test eax, eax
je 0x406c9a
mov dword [esp + 0xc], eax
mov ecx, ebx
mov ebx, dword [esp + 8]
mov edx, ebx
push dword [esp + 0x14]
push dword [esp + 8]
call fcn.00407380
add esp, 8
test eax, eax
je 0x406c78
test edi, edi
setne al
add ebx, dword [esp + 0x14]
mov edi, dword [esp + 4]
adc edi, 0
mov dword [esp + 8], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], edi
mov dword [esp + 0x64], 0
mov dword [esp + 0x68], 0
mov dword [esp + 0x6c], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
mov word [esp + 0x80], 0
movzx ebx, byte [esp + 0x24]
xor bl, 1
or bl, al
movzx eax, bl
shl eax, 3
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x10]
cmp dword [eax + 0x34], 0
je 0x406c8a
mov eax, 0xfffffffe
cmp eax, dword [esp + 0x18]
mov eax, 0
sbb eax, dword [esp + 0x1c]
mov dword [esp + 4], edi
jb 0x406c36
xor edi, edi
mov ecx, dword [esp + 8]
mov edx, 0xfffffffe
cmp edx, ecx
mov eax, 0
sbb edi, dword [esp + 4]
mov edi, dword [esp + 4]
mov edx, edi
mov dword [esp + 0x14], 0
jae 0x406dc7
xor edx, edx
mov eax, 0xfffffffe
cmp eax, dword [esp + 8]
mov eax, 0
sbb eax, edi
mov edi, dword [esp + 0x18]
jb 0x406d83
xor eax, eax
jmp 0x406d87
mov dword [ebx + 0x1c], 0x18
xor ebx, ebx
mov eax, ebx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x10
jmp 0x406c60
push dword [esp + 0xc]
mov eax, dword [ebp + 8]
push dword [eax + 0x34]
call dword [eax + 0x2c]
add esp, 8
jmp 0x406c60
test edi, edi
je 0x406ca3
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x1d
jmp 0x406c60
mov dword [ebx + 0x1c], 0x10
jmp 0x406c60
mov dword [esp + 0x64], 0x4034b50
test bl, bl
je 0x406cb1
mov bl, 0x14
mov byte [esp + 0x68], bl
mov ecx, dword [esp + 0x88]
movzx eax, cx
mov byte [esp + 0x6a], cl
mov byte [esp + 0x6b], ah
mov eax, dword [esp + 0x28]
mov byte [esp + 0x6c], al
mov dword [esp + 0x6d], 0
mov dword [esp + 0x71], 0
mov dword [esp + 0x75], 0
mov dword [esp + 0x79], 0
mov byte [esp + 0x7d], 0
mov ebx, dword [esp + 0x2c]
mov byte [esp + 0x7e], bl
mov byte [esp + 0x7f], bh
mov eax, dword [ebp + 0x38]
mov byte [esp + 0x80], al
mov byte [esp + 0x81], ah
lea eax, [esp + 0x64]
push 0x1e
push eax
push edi
push dword [esp + 0x14]
mov dword [esp + 0x14], edi
mov edi, dword [ebp + 8]
push dword [edi + 0x44]
call dword [edi + 0x3c]
add esp, 0x14
cmp eax, 0x1e
jne 0x407146
mov eax, dword [esp + 8]
add eax, 0x1e
mov ecx, dword [esp + 4]
adc ecx, 0
push ebx
push dword [ebp + 0xc]
mov dword [esp + 0xc], ecx
push ecx
mov dword [esp + 0x14], eax
push eax
push dword [edi + 0x44]
call dword [edi + 0x3c]
add esp, 0x14
cmp eax, ebx
jne 0x407139
mov ecx, dword [esp + 8]
add ecx, ebx
adc dword [esp + 4], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x1c], 0
jmp 0x406ede
lea eax, [esp + 0x38]
mov ecx, 0xfffffffe
cmp ecx, edi
mov ecx, 0
sbb ecx, dword [esp + 0x1c]
jb 0x406da0
mov edi, 0
jmp 0x406da4
lea edi, [esp + 0x30]
jae 0x406daa
lea edx, [esp + 0x40]
lea ecx, [esp + 0xa8]
mov dword [esp + 0x14], ecx
push eax
push edi
call fcn.00407430
add esp, 8
mov ecx, dword [esp + 0x38]
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x10], edx
mov dword [esp + 0x1c], eax
mov edx, dword [ebp + 0x38]
add edx, eax
mov dword [esp + 0x64], 0x4034b50
test bl, bl
je 0x406de2
mov bl, 0x14
mov byte [esp + 0x68], bl
mov byte [esp + 0x69], 0
movzx ebx, word [esp + 0x88]
mov byte [esp + 0x6a], bl
mov byte [esp + 0x6b], bh
mov ebx, dword [esp + 0x28]
mov byte [esp + 0x6c], bl
mov dword [esp + 0x6d], 0
mov dword [esp + 0x71], 0
mov dword [esp + 0x75], 0
mov dword [esp + 0x79], 0
mov byte [esp + 0x7d], 0
mov ebx, dword [esp + 0x2c]
mov byte [esp + 0x7e], bl
mov byte [esp + 0x7f], bh
mov byte [esp + 0x80], dl
mov byte [esp + 0x81], dh
lea edx, [esp + 0x64]
push 0x1e
push edx
push dword [esp + 0x18]
push ecx
mov edi, dword [ebp + 8]
push dword [edi + 0x44]
call dword [edi + 0x3c]
add esp, 0x14
cmp eax, 0x1e
jne 0x407146
mov ecx, edi
mov edi, dword [esp + 8]
add edi, 0x1e
mov eax, dword [esp + 4]
adc eax, 0
push ebx
push dword [ebp + 0xc]
mov dword [esp + 0xc], eax
push eax
push edi
push dword [ecx + 0x44]
call dword [ecx + 0x3c]
add esp, 0x14
cmp eax, ebx
jne 0x406f57
add edi, ebx
mov edx, dword [esp + 4]
adc edx, 0
cmp dword [esp + 0x14], 0
mov ecx, edi
mov dword [esp + 4], edx
je 0x406ed6
lea eax, [esp + 0xa8]
mov ebx, dword [esp + 0x1c]
push ebx
push eax
push edx
push ecx
mov eax, dword [ebp + 8]
push dword [eax + 0x44]
mov edi, ecx
call dword [eax + 0x3c]
add esp, 0x14
cmp eax, ebx
jne 0x40712a
mov ecx, ebx
add edi, ebx
adc dword [esp + 4], 0
mov ecx, edi
jmp 0x406ede
mov dword [esp + 0x14], 0
mov eax, dword [ebp + 0x38]
test eax, eax
mov dword [esp + 8], ecx
je 0x406f15
push eax
push dword [ebp + 0x34]
mov ebx, dword [esp + 0xc]
push ebx
push ecx
mov edi, dword [ebp + 8]
push dword [edi + 0x44]
call dword [edi + 0x3c]
mov ecx, dword [ebp + 0x38]
add esp, 0x14
cmp eax, ecx
jne 0x407146
add dword [esp + 8], ecx
adc ebx, 0
mov dword [esp + 4], ebx
cmp byte [esp + 0x24], 0
je 0x406f73
mov esi, dword [ebp + 0x14]
push esi
push dword [ebp + 0x10]
push dword [esp + 0xc]
push dword [esp + 0x14]
mov eax, dword [ebp + 8]
push dword [eax + 0x44]
call dword [eax + 0x3c]
add esp, 0x14
cmp eax, esi
jne 0x406f57
mov ecx, esi
add dword [esp + 8], esi
adc dword [esp + 4], 0
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], 0
jmp 0x407024
push dword [esp + 0xc]
mov esi, dword [ebp + 8]
push dword [esi + 0x34]
call dword [esi + 0x2c]
add esp, 8
mov dword [esi + 0x1c], 0x13
jmp 0x406c60
cmp dword [ebp + 0x14], 0
je 0x407024
mov eax, dword [ebp + 8]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 8]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 4]
mov dword [esp + 0x54], eax
mov dword [esp + 0x5c], 0
mov dword [esp + 0x58], 0
xor eax, eax
cmp esi, 4
setb al
shl eax, 0xe
or eax, dword [esi*4 + 0x44184c]
test esi, esi
jne 0x406fbf
or eax, 0x80000
lea ecx, [esp + 0x48]
push eax
push ecx
push 0x4074a0
mov esi, dword [esp + 0x18]
push esi
call fcn.00405b30
add esp, 0x10
mov eax, dword [ebp + 0x14]
mov dword [esp + 0xa4], eax
lea eax, [esp + 0xa4]
push 4
push 0
push 0
push eax
push dword [ebp + 0x10]
push esi
call fcn.00404710
add esp, 0x18
cmp eax, 1
jne 0x40715b
mov eax, dword [esp + 0x58]
mov ecx, dword [esp + 0x5c]
mov dword [esp + 0x34], ecx
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x50]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x54]
mov dword [esp + 4], eax
push dword [esp + 0xc]
mov eax, dword [ebp + 8]
push dword [eax + 0x34]
call dword [eax + 0x2c]
add esp, 8
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
mov edi, eax
mov dword [esp + 0x10], ecx
or eax, ecx
je 0x407152
mov dword [esp + 0x48], 0x8074b50
mov ecx, dword [esp + 0x90]
mov byte [esp + 0x4c], cl
mov byte [esp + 0x4d], ch
mov eax, ecx
shr eax, 0x10
mov byte [esp + 0x4e], al
mov eax, ecx
shr eax, 0x18
mov byte [esp + 0x4f], al
mov ebx, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
cmp dword [esp + 0x14], 0
je 0x407177
mov byte [esp + 0x50], bl
mov byte [esp + 0x51], bh
mov eax, ebx
shr eax, 0x10
mov byte [esp + 0x52], al
mov eax, ecx
shr eax, 0x10
shr ebx, 0x18
mov byte [esp + 0x53], bl
mov ebx, ecx
shr ebx, 0x18
mov byte [esp + 0x54], cl
mov byte [esp + 0x55], ch
mov byte [esp + 0x56], al
mov byte [esp + 0x57], bl
mov ecx, edi
mov byte [esp + 0x58], cl
mov byte [esp + 0x59], ch
mov eax, edi
shr eax, 0x10
mov byte [esp + 0x5a], al
mov eax, edi
shr eax, 0x18
mov byte [esp + 0x5b], al
lea eax, [esp + 0x5c]
mov dword [esp + 0x98], eax
mov dword [esp + 0x24], 0x38
mov dword [esp + 0x9c], 0x30
mov ecx, 0x28
mov dword [esp + 0x18], 0x18
mov eax, dword [esp + 0x10]
mov byte [esp + 0x23], al
mov dword [esp + 0xc], 0x17
mov dword [esp + 0xa0], 0x16
mov dword [esp + 0x94], 0x15
jmp 0x4071d2
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x13
jmp 0x406c60
push dword [esp + 0xc]
push dword [edi + 0x34]
call dword [edi + 0x2c]
add esp, 8
mov dword [edi + 0x1c], 0x13
jmp 0x406c60
xor eax, eax
xor ecx, ecx
jmp 0x40727a
push dword [esp + 0xc]
mov esi, dword [ebp + 8]
push dword [esi + 0x34]
call dword [esi + 0x2c]
add esp, 8
mov dword [esi + 0x1c], 0xc
jmp 0x406c60
test ecx, ecx
jne 0x406c8e
mov dword [esp + 0x50], ebx
lea eax, [esp + 0x54]
mov dword [esp + 0x98], eax
mov dword [esp + 0x24], 0x18
mov dword [esp + 0x9c], 0x10
mov ecx, 8
mov dword [esp + 0xc], 0xf
mov eax, edi
mov byte [esp + 0x23], al
mov dword [esp + 0xa0], 0xe
mov dword [esp + 0x94], 0xd
mov dword [esp + 0x18], 0x10
mov ebx, edi
mov eax, dword [esp + 0x10]
shrd ebx, eax, cl
shr eax, cl
mov esi, dword [esp + 0x98]
movzx edx, byte [esp + 0x23]
mov byte [esi], dl
test cl, 0x20
jne 0x4071f2
mov eax, ebx
mov ebx, edi
mov ecx, dword [esp + 0x9c]
mov edx, dword [esp + 0x10]
shrd ebx, edx, cl
mov esi, dword [esp + 0x94]
mov byte [esp + esi + 0x48], al
mov eax, edx
shr eax, cl
test cl, 0x20
jne 0x407218
mov eax, ebx
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x10]
shrd edi, edx, cl
mov ebx, dword [esp + 0xa0]
mov byte [esp + ebx + 0x48], al
shr edx, cl
test cl, 0x20
jne 0x407237
mov edx, edi
mov eax, dword [esp + 0xc]
mov byte [esp + eax + 0x48], dl
lea eax, [esp + 0x48]
mov esi, dword [esp + 0x18]
push esi
push eax
push dword [esp + 0xc]
push dword [esp + 0x14]
mov eax, dword [ebp + 8]
push dword [eax + 0x44]
call dword [eax + 0x3c]
add esp, 0x14
cmp eax, esi
jne 0x406c60
mov eax, dword [esp + 0x18]
add dword [esp + 8], eax
adc dword [esp + 4], 0
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
cmp dword [esp + 0x14], 0
je 0x4072dd
xor edx, edx
mov esi, 0xfffffffe
cmp esi, dword [esp + 0x38]
mov esi, 0
sbb esi, dword [esp + 0x3c]
jb 0x40729b
xor edi, edi
jmp 0x40729f
lea edi, [esp + 0x38]
mov esi, 0xfffffffe
cmp esi, eax
mov eax, 0
sbb eax, ecx
jb 0x4072b6
mov eax, 0
jmp 0x4072ba
lea eax, [esp + 0x30]
jae 0x4072c0
lea edx, [esp + 0x40]
lea ecx, [esp + 0xa8]
push edi
push eax
call fcn.00407430
add esp, 8
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
movzx ebx, word [esp + 0x88]
movzx esi, word [esp + 0x28]
movzx edx, word [esp + 0x1c]
movzx edi, word [esp + 0x2c]
push dword [ebp + 0x40]
push dword [ebp + 0x3c]
push dword [esp + 0x94]
push dword [esp + 0x48]
push dword [esp + 0x48]
push 0
push 0
push ebx
push esi
push dword [esp + 0xb4]
push dword [esp + 0x5c]
push dword [esp + 0x5c]
push ecx
push eax
push dword [esp + 0xbc]
push dword [ebp + 0x18]
push edx
push dword [esp + 0x58]
push edi
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.004074f0
add esp, 0x54
test eax, eax
je 0x406c60
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x10]
mov ecx, eax
and ecx, 1
xor eax, 1
lea eax, [eax + ecx*2]
mov dword [edx + 0x10], eax
mov eax, dword [esp + 8]
mov dword [edx], eax
mov eax, dword [esp + 4]
mov dword [edx + 4], eax
mov ebx, 1
jmp 0x406c62