Function at 0x4058e0
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 + 4], ecx
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 0x405933
mov esi, eax
mov eax, edi
or eax, edx
jne 0x40594a
xor ecx, ecx
cmp dword [ebp + 0x14], 0
je 0x40594e
mov eax, esi
and eax, 0x400
jne 0x40594e
mov cx, 8
test esi, 0x10000
mov dword [esp + 0x14], edx
jne 0x405963
movzx ecx, cx
or ecx, 0x800
mov dword [esp + 0x90], ecx
mov eax, esi
and eax, 0xf
mov dword [esp + 0x24], eax
sete dh
mov eax, esi
xor eax, 0xfffffbff
or esi, 0x400
and esi, eax
setne al
mov ecx, dword [ebx + 0x48]
mov dword [esp + 0x10], ecx
test ecx, ecx
je 0x405dad
cmp dword [ebx + 0x14], 2
jne 0x405dad
cmp dword [ebp + 0x14], 0
sete cl
cmp dword [ebp + 0x10], 0
setne dl
cmp dword [ebp + 0xc], 0
je 0x405dad
or dl, cl
je 0x405dad
cmp word [ebp + 0x1c], 0
setne cl
cmp dword [ebp + 0x18], 0
sete dl
test dl, cl
jne 0x405dad
cmp dword [esp + 0x24], 0xb
jae 0x405dad
mov byte [esp + 0x20], dh
mov ecx, dword [esp + 0x10]
cmp dword [ecx + 0x34], 0
mov ecx, dword [ebx + 0x10]
je 0x405a0e
xor ebx, ebx
cmp ecx, 0xffffffff
mov edx, dword [esp + 0x14]
jne 0x405a2d
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 2
jmp 0x405db6
mov edx, dword [esp + 0x14]
test edx, edx
jne 0x405a20
mov bl, 1
cmp ecx, 0xffff
jne 0x405a2d
mov ecx, dword [esp + 0x10]
mov dword [ecx + 0x34], 1
xor ebx, ebx
mov ecx, edi
or ecx, edx
je 0x405a46
test esi, esi
jne 0x405a46
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x18
jmp 0x405db4
mov ecx, dword [ebp + 0xc]
cmp byte [ecx], 0x2f
je 0x405ac2
test esi, esi
je 0x405a63
mov eax, dword [ebp + 0x2c]
mov dword [esp + 0x94], eax
mov byte [esp + 0x28], 1
jmp 0x405ab0
or byte [esp + 0x20], al
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 + 0x40], edi
mov dword [esp + 0x44], 0
mov eax, 0
cmp edi, 4
setb cl
jb 0x405a9c
mov eax, dword [esp + 0x24]
mov dword [esp + 0x14], 0
or cl, byte [esp + 0x20]
mov byte [esp + 0x28], cl
mov dword [esp + 0x24], eax
push dword [ebp + 0xc]
call fcn.00408e30
add esp, 4
cmp eax, 0x10000
jb 0x405ad1
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x19
jmp 0x405db4
mov dword [esp + 0x20], eax
movzx eax, word [ebp + 0x1c]
mov dword [esp + 0x98], eax
mov dword [esp + 0xc], 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x20]
mov ecx, dword [edx + 0x24]
or ecx, eax
mov ecx, 0
je 0x405b0c
mov ecx, 0xfffffffe
add ecx, eax
inc ecx
mov edx, dword [edx]
and edx, ecx
sub eax, edx
and eax, ecx
mov ecx, eax
mov dword [esp + 0x1c], ecx
mov eax, dword [esp + 0x10]
mov eax, dword [eax + 4]
lea ecx, [eax + eax]
and ecx, 0x5c
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x2c], eax
xor eax, 0x2e
xor ecx, ecx
mov edx, dword [esp + 0x98]
add edx, dword [esp + 0x20]
setb cl
mov dword [esp + 0x8c], edx
add eax, edx
adc ecx, 0
add eax, dword [esp + 0x4c]
adc ecx, 0
add eax, 0x1c
adc ecx, 0
mov edx, 0xfffffffe
cmp edx, eax
sbb dword [esp + 0xc], ecx
jae 0x405b6d
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0xf
jmp 0x405db4
test bl, bl
je 0x405be0
mov ecx, dword [esp + 0x20]
mov eax, ecx
shr eax, 0x1f
mov dword [esp + 0x4c], eax
mov dword [esp + 0xc], 0
mov edx, dword [esp + 0x98]
add edx, dword [ebp + 0x38]
mov ebx, 0
adc ebx, 0xffffffff
add edx, dword [ebp + 0x40]
adc ebx, 0
mov eax, ecx
add ecx, ecx
add edx, ecx
mov ecx, eax
adc ebx, dword [esp + 0x4c]
add edx, dword [esp + 0x1c]
adc ebx, 0
add edx, dword [esp + 0x2c]
adc ebx, 0
mov eax, dword [ebp + 8]
add edx, dword [eax]
adc ebx, dword [eax + 4]
add edx, 0x72
adc ebx, 0
cmp ebx, 0xffffffff
je 0x405bec
mov eax, dword [esp + 0x10]
mov dword [eax + 0x34], 1
mov dword [esp + 0xc], 0x1c
jmp 0x405bec
mov dword [esp + 0xc], 0x1c
mov ecx, dword [esp + 0x20]
xor edx, edx
test ecx, ecx
je 0x405c28
mov eax, ecx
xor eax, 1
and ecx, 0xfffe
add ecx, ecx
sub ecx, eax
mov eax, dword [ebp + 0xc]
cmp byte [eax + ecx], 0x2f
mov ebx, dword [ebp + 8]
jne 0x405c28
cmp dword [ebp + 0x14], 0
jne 0x405dad
mov edx, 0x10
mov eax, edi
or eax, dword [esp + 0x14]
jne 0x405dad
mov dword [esp + 0x4c], edx
mov eax, dword [esp + 0x8c]
add eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0xc]
add eax, ecx
add eax, 0x2e
mov ebx, dword [esp + 0x10]
cmp dword [ebx + 8], eax
jae 0x405c60
push 1
push eax
push ebx
push dword [ebp + 8]
call fcn.00408b10
add esp, 0x10
test eax, eax
je 0x405dc0
mov eax, dword [ebx + 0x14]
inc eax
cmp dword [ebx + 0x18], eax
jae 0x405c83
lea ecx, [ebx + 0x10]
push 1
push eax
push ecx
push dword [ebp + 8]
call fcn.00408b10
add esp, 0x10
test eax, eax
je 0x405dc0
cmp dword [ebp + 0x14], 0
sete cl
xor eax, eax
or cl, byte [esp + 0x28]
mov ebx, dword [ebp + 8]
jne 0x405cad
push 0x4df40
push 1
push dword [ebx + 0x34]
call dword [ebx + 0x28]
add esp, 0xc
test eax, eax
je 0x405df5
mov dword [esp + 0xc], eax
mov ecx, ebx
mov edx, dword [esp + 8]
push dword [esp + 0x1c]
mov ebx, dword [esp + 8]
push ebx
call fcn.004064a0
add esp, 8
test eax, eax
je 0x405dcc
test esi, esi
setne al
mov edx, dword [esp + 8]
add edx, dword [esp + 0x1c]
adc ebx, 0
mov dword [esp + 0x38], edx
mov dword [esp + 0x3c], ebx
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 dword [esp + 0x80], 0
mov dword [esp + 0x84], 0
mov word [esp + 0x88], 0
movzx ecx, byte [esp + 0x28]
xor cl, 1
or cl, al
mov byte [esp + 0x1c], cl
movzx eax, cl
shl eax, 3
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x10]
cmp dword [eax + 0x34], 0
mov esi, ebx
je 0x405dde
xor eax, eax
mov ecx, 0xfffffffe
cmp ecx, edi
mov ecx, 0
sbb ecx, dword [esp + 0x14]
mov ebx, edx
jb 0x405d8b
xor ecx, ecx
mov edx, 0xfffffffe
cmp edx, ebx
sbb ecx, esi
mov edx, ebx
mov ecx, esi
mov dword [esp + 0x10], 0
jae 0x405f20
xor eax, eax
mov ecx, 0xfffffffe
cmp ecx, ebx
mov ecx, 0
sbb ecx, esi
mov edx, 0xfffffffe
jb 0x405edf
xor ecx, ecx
jmp 0x405ee3
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 0x405db4
push dword [esp + 0xc]
mov eax, dword [ebp + 8]
push dword [eax + 0x34]
call dword [eax + 0x2c]
add esp, 8
jmp 0x405db4
test esi, esi
mov ecx, dword [esp + 0x90]
je 0x405dfe
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], 0x1d
jmp 0x405db4
mov dword [ebx + 0x1c], 0x10
jmp 0x405db4
mov dword [esp + 0x6c], 0x4034b50
movzx eax, byte [esp + 0x1c]
test al, al
je 0x405e11
mov al, 0x14
mov byte [esp + 0x70], al
movzx eax, cx
mov byte [esp + 0x72], cl
mov byte [esp + 0x73], ah
mov eax, dword [esp + 0x2c]
mov byte [esp + 0x74], al
mov dword [esp + 0x75], 0
mov dword [esp + 0x79], 0
mov dword [esp + 0x7d], 0
mov dword [esp + 0x81], 0
mov byte [esp + 0x85], 0
mov ebx, dword [esp + 0x20]
mov byte [esp + 0x86], bl
mov byte [esp + 0x87], bh
mov eax, dword [ebp + 0x38]
mov byte [esp + 0x88], al
mov byte [esp + 0x89], ah
lea eax, [esp + 0x6c]
push 0x1e
push eax
push esi
push edx
mov edi, edx
mov dword [esp + 0x14], esi
mov esi, dword [ebp + 8]
push dword [esi + 0x44]
call dword [esi + 0x3c]
add esp, 0x14
cmp eax, 0x1e
jne 0x40603b
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 [esi + 0x44]
call dword [esi + 0x3c]
add esp, 0x14
cmp eax, ebx
jne 0x40602e
add edi, ebx
mov dword [esp + 8], edi
adc dword [esp + 4], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0x14], 0
jmp 0x406053
lea ecx, [esp + 0x38]
cmp edx, edi
mov edx, 0
sbb edx, dword [esp + 0x14]
jb 0x405ef7
mov edx, 0
jmp 0x405efb
lea edx, [esp + 0x30]
jae 0x405f01
lea eax, [esp + 0x40]
lea edi, [esp + 0xa8]
push ecx
push edx
push eax
mov dword [esp + 0x1c], edi
push edi
call fcn.00406550
add esp, 0x10
mov edx, dword [esp + 0x38]
mov ecx, dword [esp + 0x3c]
mov edi, edx
mov dword [esp + 4], esi
mov dword [esp + 8], ebx
mov dword [esp + 0x14], eax
mov edx, dword [ebp + 0x38]
add edx, eax
mov dword [esp + 0x6c], 0x4034b50
movzx eax, byte [esp + 0x1c]
test al, al
je 0x405f46
mov al, 0x14
mov byte [esp + 0x70], al
mov byte [esp + 0x71], 0
movzx ebx, word [esp + 0x90]
mov byte [esp + 0x72], bl
mov byte [esp + 0x73], bh
mov ebx, dword [esp + 0x2c]
mov byte [esp + 0x74], bl
mov dword [esp + 0x75], 0
mov dword [esp + 0x79], 0
mov dword [esp + 0x7d], 0
mov dword [esp + 0x81], 0
mov byte [esp + 0x85], 0
mov ebx, dword [esp + 0x20]
mov byte [esp + 0x86], bl
mov byte [esp + 0x87], bh
mov byte [esp + 0x88], dl
mov byte [esp + 0x89], dh
lea edx, [esp + 0x6c]
push 0x1e
push edx
push ecx
push edi
mov esi, dword [ebp + 8]
push dword [esi + 0x44]
call dword [esi + 0x3c]
add esp, 0x14
cmp eax, 0x1e
jne 0x40603b
mov eax, dword [esp + 8]
add eax, 0x1e
mov edi, dword [esp + 4]
adc edi, 0
push ebx
push dword [ebp + 0xc]
push edi
mov dword [esp + 0x14], eax
push eax
push dword [esi + 0x44]
call dword [esi + 0x3c]
add esp, 0x14
cmp eax, ebx
jne 0x40602e
mov ecx, dword [esp + 8]
add ecx, ebx
adc edi, 0
cmp dword [esp + 0x10], 0
mov dword [esp + 8], ecx
je 0x406047
lea eax, [esp + 0xa8]
mov ebx, dword [esp + 0x14]
push ebx
push eax
push edi
push ecx
push dword [esi + 0x44]
call dword [esi + 0x3c]
add esp, 0x14
cmp eax, ebx
jne 0x40603b
add dword [esp + 8], ebx
adc edi, 0
mov dword [esp + 4], edi
jmp 0x406053
push dword [esp + 0xc]
push dword [esi + 0x34]
call dword [esi + 0x2c]
add esp, 8
mov dword [esi + 0x1c], 0x13
jmp 0x405db4
mov dword [esp + 4], edi
mov dword [esp + 0x10], 0
mov eax, dword [ebp + 0x38]
test eax, eax
je 0x406085
push eax
push dword [ebp + 0x34]
mov ebx, dword [esp + 0xc]
push ebx
mov edi, dword [esp + 0x14]
push edi
push dword [esi + 0x44]
call dword [esi + 0x3c]
mov ecx, dword [ebp + 0x38]
add esp, 0x14
cmp eax, ecx
jne 0x40603b
add edi, ecx
mov dword [esp + 8], edi
adc ebx, 0
mov dword [esp + 4], ebx
cmp byte [esp + 0x28], 0
je 0x4060cc
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 0x406281
mov eax, dword [ebp + 0x14]
add dword [esp + 8], eax
adc dword [esp + 4], 0
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], 0
jmp 0x406181
cmp dword [ebp + 0x14], 0
je 0x406181
mov eax, dword [ebp + 8]
mov dword [esp + 0x50], eax
mov eax, dword [esp + 8]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 4]
mov dword [esp + 0x5c], eax
mov dword [esp + 0x64], 0
mov dword [esp + 0x60], 0
xor eax, eax
mov ecx, dword [esp + 0x24]
cmp ecx, 4
setb al
shl eax, 0xe
or eax, dword [ecx*4 + 0x43f84c]
test ecx, ecx
jne 0x40611c
or eax, 0x80000
lea ecx, [esp + 0x50]
push eax
push ecx
push 0x4059c0
mov esi, dword [esp + 0x18]
push esi
call fcn.00404d20
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.004038f0
add esp, 0x18
cmp eax, 1
jne 0x406296
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x34], ecx
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x58]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x5c]
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 esi, eax
mov dword [esp + 0x24], ecx
or eax, ecx
je 0x40628d
mov dword [esp + 0x50], 0x8074b50
mov ecx, dword [esp + 0x94]
mov byte [esp + 0x54], cl
mov byte [esp + 0x55], ch
mov eax, ecx
shr eax, 0x10
mov byte [esp + 0x56], al
mov eax, ecx
shr eax, 0x18
mov byte [esp + 0x57], al
mov ebx, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
cmp dword [esp + 0x10], 0
je 0x4062b2
mov byte [esp + 0x58], bl
mov byte [esp + 0x59], bh
mov eax, ebx
shr eax, 0x10
mov byte [esp + 0x5a], al
mov eax, ecx
shr eax, 0x10
shr ebx, 0x18
mov byte [esp + 0x5b], bl
mov ebx, ecx
shr ebx, 0x18
mov byte [esp + 0x5c], cl
mov byte [esp + 0x5d], ch
mov byte [esp + 0x5e], al
mov byte [esp + 0x5f], bl
mov ecx, esi
mov byte [esp + 0x60], cl
mov byte [esp + 0x61], ch
mov eax, esi
shr eax, 0x10
mov byte [esp + 0x62], al
mov eax, esi
shr eax, 0x18
mov byte [esp + 0x63], al
mov dword [esp + 0x1c], 0x38
mov dword [esp + 0xa0], 0x30
mov ecx, 0x28
mov dword [esp + 0x28], 0x18
mov dword [esp + 0xc], 0x17
mov eax, dword [esp + 0x24]
mov byte [esp + 0x1b], al
mov dword [esp + 0x8c], 0x16
mov dword [esp + 0x9c], 0x15
mov edi, 0x14
jmp 0x406307
push dword [esp + 0xc]
mov esi, dword [ebp + 8]
jmp 0x406032
xor eax, eax
xor ecx, ecx
jmp 0x4063aa
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 0x405db4
test ecx, ecx
jne 0x405de9
mov dword [esp + 0x58], ebx
mov dword [esp + 0x1c], 0x18
mov dword [esp + 0xa0], 0x10
mov ecx, 8
mov dword [esp + 0xc], 0xf
mov dword [esp + 0x8c], 0xe
mov eax, esi
mov byte [esp + 0x1b], al
mov dword [esp + 0x9c], 0xd
mov edi, 0xc
mov dword [esp + 0x28], 0x10
mov ebx, esi
mov eax, dword [esp + 0x24]
shrd ebx, eax, cl
shr eax, cl
movzx edx, byte [esp + 0x1b]
mov byte [esp + edi + 0x50], dl
test cl, 0x20
jne 0x406322
mov eax, ebx
mov ebx, esi
mov ecx, dword [esp + 0xa0]
mov edx, dword [esp + 0x24]
shrd ebx, edx, cl
mov edi, dword [esp + 0x9c]
mov byte [esp + edi + 0x50], al
mov eax, edx
shr eax, cl
test cl, 0x20
jne 0x406348
mov eax, ebx
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x24]
shrd esi, edx, cl
mov edi, dword [esp + 0x8c]
mov byte [esp + edi + 0x50], al
shr edx, cl
test cl, 0x20
jne 0x406367
mov edx, esi
mov eax, dword [esp + 0xc]
mov byte [esp + eax + 0x50], dl
lea eax, [esp + 0x50]
mov esi, dword [esp + 0x28]
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 0x405db4
mov eax, dword [esp + 0x28]
add dword [esp + 8], eax
adc dword [esp + 4], 0
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
cmp dword [esp + 0x10], 0
je 0x40640f
xor edx, edx
mov esi, 0xfffffffe
cmp esi, dword [esp + 0x38]
mov esi, 0
sbb esi, dword [esp + 0x3c]
jb 0x4063cb
xor edi, edi
jmp 0x4063cf
lea edi, [esp + 0x38]
mov esi, 0xfffffffe
cmp esi, eax
mov eax, 0
sbb eax, ecx
jb 0x4063e6
mov eax, 0
jmp 0x4063ea
lea eax, [esp + 0x30]
jae 0x4063f0
lea edx, [esp + 0x40]
lea ecx, [esp + 0xa8]
push edi
push eax
push edx
push ecx
call fcn.00406550
add esp, 0x10
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x44]
movzx ebx, word [esp + 0x90]
movzx esi, word [esp + 0x2c]
movzx edx, word [esp + 0x14]
movzx edi, word [esp + 0x20]
push dword [ebp + 0x40]
push dword [ebp + 0x3c]
push dword [esp + 0x54]
push dword [esp + 0x48]
push dword [esp + 0x48]
push 0
push 0
push ebx
push esi
push dword [esp + 0xb8]
push dword [esp + 0x5c]
push dword [esp + 0x5c]
push ecx
push eax
push dword [esp + 0xd0]
push dword [ebp + 0x18]
push edx
push dword [esp + 0x54]
push edi
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00406610
add esp, 0x54
test eax, eax
je 0x405db4
mov eax, dword [ebp + 8]
inc dword [eax + 0x10]
mov ecx, dword [esp + 8]
mov dword [eax], ecx
mov ecx, dword [esp + 4]
mov dword [eax + 4], ecx
mov ebx, 1
jmp 0x405db6