Function at 0x4059d0
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 eax, dword [ebp + 8]
mov dword [esp + 0x34], edx
mov dword [esp + 0x30], edi
mov ecx, dword [eax]
mov ebx, eax
mov eax, dword [eax + 4]
mov dword [esp + 0x28], ecx
mov dword [esp + 0x10], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x4c], 0
mov dword [esp + 0x48], 0
mov eax, dword [ebp + 0x20]
mov esi, 6
test eax, eax
js 0x405a21
mov esi, eax
mov dword [esp + 0x18], ecx
mov dword [esp + 8], edi
mov eax, edi
or eax, edx
je 0x405a39
mov ecx, esi
and ecx, 0x400
jmp 0x405a4d
mov edi, esi
and edi, 0x400
xor ecx, ecx
cmp dword [ebp + 0x14], 0
je 0x405a53
test edi, edi
jne 0x405a53
mov edi, ecx
mov cx, 8
test esi, 0x10000
mov dword [esp + 0x14], edx
jne 0x405a68
movzx ecx, cx
or ecx, 0x800
and esi, 0xf
sete al
test edi, edi
setne ah
mov edx, dword [ebx + 0x48]
mov dword [esp + 4], edx
test edx, edx
je 0x405af2
cmp dword [ebx + 0x14], 2
jne 0x405af2
mov dword [esp + 0x24], edi
mov edi, dword [ebp + 0xc]
cmp dword [ebp + 0x14], 0
je 0x405aa1
test edi, edi
mov edi, dword [esp + 0x24]
je 0x405af2
cmp dword [ebp + 0x10], 0
jne 0x405aa9
jmp 0x405af2
test edi, edi
mov edi, dword [esp + 0x24]
je 0x405af2
cmp word [ebp + 0x1c], 0
mov dword [esp + 0x98], ecx
setne cl
cmp dword [ebp + 0x18], 0
sete dl
test dl, cl
mov ebx, dword [ebp + 8]
jne 0x405af2
cmp esi, 0xb
jae 0x405af2
mov ecx, dword [esp + 4]
mov edx, dword [ecx + 0x34]
mov ecx, dword [ebx + 0x10]
test edx, edx
je 0x405b03
mov dword [esp + 0x44], edx
cmp ecx, 0xffffffff
mov edx, dword [esp + 0x14]
jne 0x405b2e
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 2
jmp 0x405af9
mov dword [ebx + 0x1c], 0x18
xor eax, eax
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, dword [esp + 0x14]
test edx, edx
jne 0x405b1b
mov dword [esp + 0x44], 0
cmp ecx, 0xffff
jne 0x405b2e
mov ecx, dword [esp + 4]
mov dword [ecx + 0x34], 1
mov dword [esp + 0x44], 1
mov ecx, dword [esp + 8]
or ecx, edx
je 0x405b46
test edi, edi
jne 0x405b46
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x18
jmp 0x405af9
mov ecx, dword [ebp + 0xc]
cmp byte [ecx], 0x2f
je 0x405bd3
or al, ah
mov byte [esp + 0x20], al
test edi, edi
je 0x405b70
mov eax, dword [ebp + 0x2c]
mov dword [esp + 0x94], eax
mov edi, dword [esp + 4]
movzx ebx, word [ebp + 0x1c]
jmp 0x405bc3
mov edi, dword [ebp + 0x14]
push edi
push dword [ebp + 0x10]
push 0
call fcn.004037b0
add esp, 0xc
mov dword [esp + 0x94], eax
mov dword [esp + 0x14], 0
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], 0
mov eax, 0
cmp edi, 4
setb cl
mov edi, dword [esp + 4]
movzx ebx, word [ebp + 0x1c]
jb 0x405bb3
mov eax, esi
or byte [esp + 0x20], cl
mov ecx, dword [ebp + 0x14]
mov dword [esp + 8], ecx
mov esi, eax
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.00408e20
add esp, 4
cmp eax, 0x10000
jb 0x405be2
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x19
jmp 0x405af9
mov dword [esp + 0x40], eax
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x20]
mov dword [esp + 0xc], 0
mov ecx, dword [edx + 0x24]
or ecx, eax
mov ecx, 0
je 0x405c0d
lea ecx, [eax - 1]
mov edx, dword [edx]
and edx, ecx
sub eax, edx
and eax, ecx
mov ecx, eax
mov dword [esp + 0x54], ecx
mov edi, dword [edi + 4]
movzx eax, bx
xor ecx, ecx
mov dword [esp + 0xa0], eax
mov edx, eax
mov eax, dword [esp + 0x40]
add edx, eax
setb cl
mov dword [esp + 0x90], edi
add edx, edi
adc ecx, 0
mov ebx, edx
mov dword [esp + 0x3c], edx
add edx, 0x4a
adc ecx, 0
mov ebx, 0xfffffffe
cmp ebx, edx
sbb dword [esp + 0xc], ecx
jae 0x405c5f
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0xf
jmp 0x405af9
mov edx, dword [esp + 0x44]
test edx, edx
mov ebx, dword [esp + 4]
jne 0x405ccb
shr eax, 0x1f
mov edi, eax
mov ecx, dword [esp + 0xa0]
add ecx, dword [ebp + 0x38]
mov edx, 0
adc edx, 0xffffffff
add ecx, dword [ebp + 0x40]
adc edx, 0
mov eax, dword [esp + 0x40]
add eax, eax
add ecx, eax
adc edx, edi
add ecx, dword [esp + 0x54]
adc edx, 0
add ecx, dword [esp + 0x90]
adc edx, 0
mov eax, dword [ebp + 8]
add ecx, dword [eax]
adc edx, dword [eax + 4]
mov eax, dword [esp + 0x40]
add ecx, 0x72
adc edx, 0
cmp edx, 0xffffffff
mov edx, 0
je 0x405ccb
mov dword [ebx + 0x34], 1
mov edx, 1
mov dword [esp + 0x44], 0
test eax, eax
je 0x405d06
mov ecx, eax
mov eax, dword [ebp + 0xc]
cmp byte [ecx + eax - 1], 0x2f
mov eax, dword [ebp + 8]
jne 0x405d06
cmp dword [ebp + 0x14], 0
jne 0x405b3d
mov dword [esp + 0x44], 0x10
mov ecx, dword [esp + 8]
or ecx, dword [esp + 0x14]
jne 0x405b3d
test edx, edx
je 0x405d0f
mov edx, 0x1c
mov eax, dword [esp + 0x3c]
add eax, edx
add eax, 0x2e
mov edx, dword [ebx + 8]
cmp edx, eax
mov dword [esp + 0x14], esi
jae 0x405d55
mov ecx, 1
test edx, edx
je 0x405d2e
mov ecx, edx
mov esi, ecx
add ecx, ecx
cmp esi, eax
jb 0x405d2e
push esi
push dword [ebx + 0xc]
push dword [ebx]
mov edi, dword [ebp + 8]
push dword [edi + 0x34]
call dword [edi + 0x30]
add esp, 0x10
test eax, eax
je 0x405eae
mov dword [ebx], eax
mov dword [ebx + 8], esi
mov eax, dword [ebx + 0x14]
mov edx, dword [ebx + 0x18]
inc eax
cmp edx, eax
jae 0x405d94
mov ecx, 1
test edx, edx
je 0x405d6b
mov ecx, edx
mov esi, ecx
add ecx, ecx
cmp esi, eax
jb 0x405d6b
push esi
push dword [ebx + 0x1c]
push dword [ebx + 0x10]
mov edi, dword [ebp + 8]
push dword [edi + 0x34]
call dword [edi + 0x30]
add esp, 0x10
test eax, eax
je 0x405eae
mov dword [ebx + 0x10], eax
mov dword [ebx + 0x18], esi
cmp dword [ebp + 0x14], 0
sete cl
xor eax, eax
or cl, byte [esp + 0x20]
jne 0x405dbe
push 0x4df40
push 1
mov eax, dword [ebp + 8]
push dword [eax + 0x34]
call dword [eax + 0x28]
add esp, 0xc
test eax, eax
je 0x405efd
mov dword [esp + 0xc], eax
mov ecx, dword [ebp + 8]
mov edi, dword [esp + 0x18]
mov edx, edi
mov ebx, dword [esp + 0x54]
push ebx
mov esi, dword [esp + 0x14]
push esi
call fcn.004065c0
add esp, 8
test eax, eax
je 0x405eba
cmp dword [esp + 0x24], 0
sete dl
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x28]
add eax, ebx
adc ecx, 0
mov dword [esp + 8], eax
mov dword [esp + 0x28], eax
add edi, ebx
mov ebx, edx
mov dword [esp + 0x18], edi
adc esi, 0
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x70], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x7c], 0
mov dword [esp + 0x80], 0
mov dword [esp + 0x84], 0
mov dword [esp + 0x88], 0
mov word [esp + 0x8c], 0
and bl, byte [esp + 0x20]
mov edx, ebx
xor dl, 1
movzx edx, dl
shl edx, 3
mov dword [esp + 0x24], edx
mov eax, dword [esp + 4]
cmp dword [eax + 0x34], 0
je 0x405ecf
mov dword [esp + 0x10], esi
mov edi, dword [esp + 0x30]
mov esi, dword [esp + 0x34]
mov dword [esp + 4], 0
mov eax, 0xfffffffe
cmp eax, edi
mov edx, 0
sbb edx, esi
jb 0x405f0c
xor edx, edx
cmp eax, dword [esp + 8]
sbb edx, ecx
jb 0x405f0c
xor eax, eax
jmp 0x405f65
mov dword [edi + 0x1c], 0x10
jmp 0x405af9
push dword [esp + 0xc]
mov eax, dword [ebp + 8]
push dword [eax + 0x34]
call dword [eax + 0x2c]
add esp, 8
jmp 0x405af9
cmp dword [esp + 0x4c], 0
jne 0x4063de
test esi, esi
jne 0x4063de
mov dword [esp + 0x70], 0x4034b50
test bl, bl
mov dword [esp + 0x10], esi
jne 0x40607f
mov dl, 0x14
jmp 0x406081
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x10
jmp 0x405af9
xor edx, edx
cmp eax, dword [esp + 8]
mov eax, 0
sbb eax, ecx
jb 0x405f1f
xor eax, eax
jmp 0x405f23
lea eax, [esp + 0x28]
mov ecx, 0xfffffffe
cmp ecx, edi
mov ecx, 0
sbb ecx, esi
jb 0x405f3a
mov esi, 0
jmp 0x405f3e
lea esi, [esp + 0x48]
jae 0x405f44
lea edx, [esp + 0x30]
lea ecx, [esp + 0xa8]
mov dword [esp + 4], ecx
push eax
push esi
call fcn.00406660
add esp, 8
mov ecx, dword [esp + 0x28]
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x2c]
mov edx, eax
mov edi, dword [ebp + 0x38]
and edx, edi
mov dword [esp + 0x3c], eax
mov esi, eax
xor esi, edi
lea edx, [esi + edx*2]
mov dword [esp + 0x70], 0x4034b50
test bl, bl
jne 0x405f87
mov bl, 0x14
jmp 0x405f89
xor ebx, ebx
mov byte [esp + 0x74], bl
mov byte [esp + 0x75], 0
movzx ebx, word [esp + 0x98]
mov byte [esp + 0x76], bl
mov byte [esp + 0x77], bh
mov ebx, dword [esp + 0x24]
mov byte [esp + 0x78], bl
mov dword [esp + 0x79], 0
mov dword [esp + 0x7d], 0
mov dword [esp + 0x81], 0
mov dword [esp + 0x85], 0
mov byte [esp + 0x89], 0
mov ebx, dword [esp + 0x40]
mov byte [esp + 0x8a], bl
mov byte [esp + 0x8b], bh
mov byte [esp + 0x8c], dl
mov byte [esp + 0x8d], dh
lea edx, [esp + 0x70]
push 0x1e
push edx
push ecx
push dword [esp + 0x14]
mov esi, dword [ebp + 8]
push dword [esi + 0x44]
call dword [esi + 0x3c]
add esp, 0x14
cmp eax, 0x1e
jne 0x4061e0
mov edi, dword [esp + 0x18]
add edi, 0x1e
mov eax, esi
mov esi, dword [esp + 0x10]
adc esi, 0
push ebx
push dword [ebp + 0xc]
push esi
push edi
push dword [eax + 0x44]
call dword [eax + 0x3c]
add esp, 0x14
cmp eax, ebx
jne 0x4061d0
add edi, ebx
adc esi, 0
cmp dword [esp + 4], 0
mov ebx, edi
je 0x406151
lea eax, [esp + 0xa8]
mov edi, dword [esp + 0x3c]
push edi
push eax
push esi
push ebx
mov eax, dword [ebp + 8]
push dword [eax + 0x44]
call dword [eax + 0x3c]
add esp, 0x14
cmp eax, edi
jne 0x4061ec
add ebx, edi
adc esi, 0
jmp 0x406159
xor edx, edx
mov byte [esp + 0x74], dl
mov ebx, dword [esp + 0x98]
movzx edx, bx
mov byte [esp + 0x76], bl
mov byte [esp + 0x77], dh
mov edx, dword [esp + 0x24]
mov byte [esp + 0x78], dl
mov dword [esp + 0x79], 0
mov dword [esp + 0x7d], 0
mov dword [esp + 0x81], 0
mov dword [esp + 0x85], 0
mov byte [esp + 0x89], 0
mov ebx, dword [esp + 0x40]
mov byte [esp + 0x8a], bl
mov byte [esp + 0x8b], bh
mov edx, dword [ebp + 0x38]
mov byte [esp + 0x8c], dl
mov byte [esp + 0x8d], dh
lea edx, [esp + 0x70]
push 0x1e
push edx
push ecx
push dword [esp + 0x14]
mov esi, dword [ebp + 8]
push dword [esi + 0x44]
call dword [esi + 0x3c]
add esp, 0x14
cmp eax, 0x1e
jne 0x4061e0
mov edi, dword [esp + 0x18]
add edi, 0x1e
mov eax, esi
mov esi, dword [esp + 0x10]
adc esi, 0
push ebx
push dword [ebp + 0xc]
push esi
push edi
push dword [eax + 0x44]
call dword [eax + 0x3c]
add esp, 0x14
cmp eax, ebx
jne 0x4061d0
add edi, ebx
adc esi, 0
mov dword [esp + 4], 0
mov dword [esp + 0x3c], 0
mov ebx, edi
jmp 0x406159
mov dword [esp + 4], 0
mov edi, dword [ebp + 0x38]
test edi, edi
je 0x40617b
push edi
push dword [ebp + 0x34]
push esi
push ebx
mov eax, dword [ebp + 8]
push dword [eax + 0x44]
call dword [eax + 0x3c]
add esp, 0x14
cmp eax, edi
jne 0x4061ec
add ebx, edi
adc esi, 0
mov edi, dword [ebp + 0x14]
movzx eax, byte [esp + 0x20]
test al, al
mov dword [esp + 0x10], esi
je 0x4061fb
push edi
push dword [ebp + 0x10]
push esi
mov esi, ebx
push ebx
mov eax, dword [ebp + 8]
push dword [eax + 0x44]
call dword [eax + 0x3c]
add esp, 0x14
cmp eax, edi
jne 0x4061d0
mov edx, esi
mov eax, esi
mov esi, dword [ebp + 0x14]
and eax, esi
mov ecx, eax
shr ecx, 0x1f
add eax, eax
xor edx, esi
add edx, eax
mov dword [esp + 0x18], edx
adc dword [esp + 0x10], ecx
mov dword [esp + 0x48], esi
mov dword [esp + 0x4c], 0
jmp 0x4062c2
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 0x405af9
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x13
jmp 0x405af9
mov dword [esp + 0x18], ebx
test edi, edi
je 0x4062c2
mov eax, dword [ebp + 8]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x18]
mov dword [esp + 0x60], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x64], eax
mov dword [esp + 0x6c], 0
mov dword [esp + 0x68], 0
mov eax, dword [esp + 0x14]
mov ecx, eax
cmp eax, 0xa
jl 0x40623e
mov ecx, 0xa
xor eax, eax
mov edx, dword [esp + 0x14]
cmp edx, 4
setl al
shl eax, 0xe
or eax, dword [ecx*4 + 0x43da58]
test edx, edx
jne 0x40625d
or eax, 0x80000
lea ecx, [esp + 0x58]
push eax
push ecx
push 0x4066d0
mov esi, dword [esp + 0x18]
push esi
call fcn.00404d10
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.00403890
add esp, 0x18
cmp eax, 1
jne 0x4063be
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x6c]
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x60]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x64]
mov dword [esp + 0x10], eax
push dword [esp + 0xc]
mov eax, dword [ebp + 8]
push dword [eax + 0x34]
call dword [eax + 0x2c]
add esp, 8
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x34]
mov esi, ecx
mov dword [esp + 0x14], eax
or ecx, eax
je 0x4064d1
mov dword [esp + 0x58], 0x8074b50
mov edx, dword [esp + 0x94]
mov byte [esp + 0x5c], dl
mov byte [esp + 0x5d], dh
mov ecx, edx
shr ecx, 0x10
mov byte [esp + 0x5e], cl
mov ecx, edx
shr ecx, 0x18
mov byte [esp + 0x5f], cl
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x4c]
cmp dword [esp + 4], 0
je 0x4063da
mov byte [esp + 0x60], cl
mov byte [esp + 0x61], ch
mov ebx, ecx
shr ebx, 0x10
mov byte [esp + 0x62], bl
mov ebx, edx
shr ebx, 0x10
shr ecx, 0x18
mov byte [esp + 0x63], cl
mov ecx, edx
shr ecx, 0x18
mov byte [esp + 0x64], dl
mov byte [esp + 0x65], dh
mov byte [esp + 0x66], bl
mov byte [esp + 0x67], cl
mov edx, esi
mov byte [esp + 0x68], dl
mov byte [esp + 0x69], dh
mov ecx, esi
shr ecx, 0x10
mov byte [esp + 0x6a], cl
mov ecx, esi
shr ecx, 0x18
mov byte [esp + 0x6b], cl
mov dword [esp + 0xc], 0x38
mov dword [esp + 0x90], 0x30
mov ecx, 0x28
mov dword [esp + 8], 0x18
mov dword [esp + 0x20], 0x17
mov eax, dword [esp + 0x14]
mov edx, eax
mov byte [esp + 0x1f], al
mov dword [esp + 0x54], 0x16
mov dword [esp + 0x9c], 0x15
mov edi, 0x14
jmp 0x406437
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 0x405af9
test edx, edx
je 0x4063ed
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x1d
jmp 0x405af9
mov dword [esp + 0x60], ecx
mov dword [esp + 0xc], 0x18
mov dword [esp + 0x90], 0x10
mov ecx, 8
mov dword [esp + 0x20], 0xf
mov dword [esp + 0x54], 0xe
mov edx, esi
mov byte [esp + 0x1f], dl
mov dword [esp + 0x9c], 0xd
mov edi, 0xc
mov dword [esp + 8], 0x10
mov edx, esi
mov ebx, dword [esp + 0x14]
shrd edx, ebx, cl
shr ebx, cl
movzx eax, byte [esp + 0x1f]
mov byte [esp + edi + 0x58], al
test cl, 0x20
jne 0x406452
mov ebx, edx
mov edx, esi
mov ecx, dword [esp + 0x90]
mov eax, dword [esp + 0x14]
shrd edx, eax, cl
mov edi, dword [esp + 0x9c]
mov byte [esp + edi + 0x58], bl
mov ebx, eax
shr ebx, cl
test cl, 0x20
jne 0x406478
mov ebx, edx
mov ecx, dword [esp + 0xc]
mov eax, dword [esp + 0x14]
shrd esi, eax, cl
mov edx, esi
mov esi, dword [esp + 0x54]
mov byte [esp + esi + 0x58], bl
shr eax, cl
test cl, 0x20
jne 0x406496
mov eax, edx
mov ecx, dword [esp + 0x20]
mov byte [esp + ecx + 0x58], al
lea eax, [esp + 0x58]
mov esi, dword [esp + 8]
push esi
push eax
push dword [esp + 0x18]
push dword [esp + 0x24]
mov eax, dword [ebp + 8]
push dword [eax + 0x44]
call dword [eax + 0x3c]
add esp, 0x14
cmp eax, esi
jne 0x405af9
mov eax, dword [esp + 8]
add dword [esp + 0x18], eax
adc dword [esp + 0x10], 0
cmp dword [esp + 4], 0
je 0x406530
xor edx, edx
mov eax, 0xfffffffe
cmp eax, dword [esp + 0x28]
mov eax, 0
sbb eax, dword [esp + 0x2c]
jb 0x4064f2
xor eax, eax
jmp 0x4064f6
lea eax, [esp + 0x28]
mov ecx, 0xfffffffe
cmp ecx, dword [esp + 0x30]
mov ecx, 0
sbb ecx, dword [esp + 0x34]
jb 0x406511
mov edi, 0
jmp 0x406515
lea edi, [esp + 0x48]
jae 0x40651b
lea edx, [esp + 0x30]
lea ecx, [esp + 0xa8]
push eax
push edi
call fcn.00406660
add esp, 8
mov dword [esp + 0x3c], eax
movzx ebx, word [esp + 0x98]
movzx esi, word [esp + 0x24]
movzx eax, word [esp + 0x3c]
movzx edi, word [esp + 0x40]
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
push dword [ebp + 0x40]
push dword [ebp + 0x3c]
push dword [esp + 0x4c]
push dword [esp + 0x38]
push dword [esp + 0x38]
push 0
push 0
push ebx
push esi
push dword [esp + 0xb8]
push dword [esp + 0x74]
push dword [esp + 0x74]
push dword [esp + 0x64]
push dword [esp + 0x64]
push dword [esp + 0xd8]
push dword [ebp + 0x18]
push eax
push dword [esp + 0x48]
push edi
call fcn.00406720
add esp, 0x4c
test eax, eax
je 0x405af9
mov eax, dword [ebp + 8]
inc dword [eax + 0x10]
mov ecx, dword [esp + 0x18]
mov dword [eax], ecx
mov ecx, dword [esp + 0x10]
mov dword [eax + 4], ecx
mov eax, 1
jmp 0x405afb