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

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x2e4
mov esi, dword [esp + 0x2fc]
cmp byte [esp + 0x2f8], 0
mov ebx, edx
mov ebp, ecx
je 0x406161
lea eax, [esi + 0x48]
lea ecx, [esp + 0x1e4]
push 0x100
push eax
push ecx
call fcn.00570db0
add esp, 0xc
jmp 0x40616d
lea ecx, [esp + 0x1e4]
call fcn.0040d903
mov dword [esp], ebx
test bl, bl
mov ebx, dword [esi + 8]
jne 0x4061a1
mov ecx, ebx
mov edx, 0x5890d8
lea esi, [ebx + ebx]
not ecx
shr ecx, 0x1f
call fcn.004bb341
xor ecx, ecx
cmp esi, 4
mov edx, 0x5890e8
lea ebx, [ebx + ebx - 4]
setae cl
call fcn.004bb341
movzx esi, byte [esp + 0x2e3]
bsr ecx, esi
xor eax, eax
mov dword [esp + 0x14], esi
dec eax
not ecx
shr eax, cl
lea edx, [eax + 1]
not eax
bsf ecx, edx
and eax, edx
xor edx, edx
inc edx
test esi, esi
cmove ecx, esi
mov esi, ebx
cmove eax, edx
mov dword [esp + 0x10], edx
mov edx, 0x5890f8
mov dword [esp + 0x18], ecx
shl esi, cl
xor ecx, ecx
mov edi, esi
sub edi, eax
setae cl
call fcn.004bb341
cmp edi, 0x7ffffffe
jbe 0x406218
and dword [ebp + 8], 0
mov dword [ebp + 0xc], edi
and dword [ebp + 0x14], 0
mov dword [ebp + 0x10], 0x7ffffffe
and dword [ebp + 0x1c], 0
mov dword [ebp + 0x18], edi
mov dword [ebp], 1
jmp 0x406b22
mov eax, dword [esp + 0x2fc]
mov dword [esp + 0xc], ebx
xor ecx, ecx
mov ebx, dword [eax + 0x154]
add ebx, 0xffffffff
setb cl
cmp byte [esp], 0
je 0x40623e
mov edx, 0x589128
jmp 0x406256
mov edx, 0x589108
call fcn.004bb341
mov ecx, ebx
add ebx, ebx
mov edx, 0x589118
not ecx
shr ecx, 0x1f
call fcn.004bb341
lea ecx, [esp + 0x70]
mov edx, esi
call fcn.004053ca
test ebx, ebx
mov dword [esp + 0x6c], ebp
je 0x4062a1
cmp ebx, 0xaaaaaaa
ja 0x406b2d
imul edi, ebx, 0xc
test edi, edi
js 0x406b2d
push 4
pop ecx
mov edx, edi
call fcn.00404294
mov ebp, eax
test eax, eax
jne 0x4062a4
push 4
pop ecx
mov edx, edi
call fcn.00580af0
ud2
push 4
pop ebp
xor esi, esi
mov dword [esp + 8], ebp
lea edi, [esi + 1]
cmp edi, ebx
jae 0x4062e1
lea ecx, [esp + 0x88]
push 4
pop edx
push 0
call fcn.004051b3
pop eax
mov eax, dword [esp + 0x90]
inc esi
mov dword [ebp + 8], eax
movsd xmm0, qword [esp + 0x88]
movsd qword [ebp], xmm0
add ebp, 0xc
jmp 0x4062aa
test ebx, ebx
je 0x4062f6
mov dword [ebp], 4
and dword [ebp + 4], 0
and dword [ebp + 8], 0
jmp 0x406302
push 4
pop ecx
xor edx, edx
call fcn.00473538
mov edi, esi
mov esi, dword [esp + 0x2fc]
lea ecx, [esp + 0x44]
mov edx, dword [esi + 0x30]
push dword [esi + 0x38]
call fcn.004051b3
pop eax
mov eax, dword [esi + 0x3c]
test eax, eax
mov dword [esp + 0x20], eax
je 0x406344
lock inc dword [eax]
jle 0x406b34
mov esi, dword [esp + 0x2fc]
mov eax, dword [esi + 0x40]
mov ecx, dword [esi + 0x44]
mov dword [esp + 0x40], eax
mov dword [esp + 0x68], ecx
jmp 0x40634b
mov esi, dword [esp + 0x2fc]
mov al, byte [esi + 0x160]
inc dword [esp + 0x14]
lea ebp, [esp + 0xc8]
mov byte [esp + 0x1c], al
lea eax, [esp + 0x1e4]
push 0x100
push eax
push ebp
call fcn.00570db0
add esp, 0xc
mov eax, dword [esp + 0x78]
and dword [ebp + 0x10c], 0
and dword [ebp + 0x108], 0
and dword [ebp + 0x114], 0
and dword [ebp + 0x110], 0
movsd xmm0, qword [esp + 0x70]
mov ecx, dword [esp + 0x18]
mov dword [ebp - 0x38], eax
mov eax, dword [esp + 8]
movsd qword [ebp - 0x40], xmm0
movsd xmm0, qword [esp + 0x44]
mov dword [ebp - 0x34], eax
mov eax, dword [esp + 0x4c]
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x2c], edi
lea edi, [esp + 0xa0]
and dword [ebp - 0x1c], 0
mov ebx, dword [esp + 0xc]
movsd qword [edi], xmm0
mov dword [edi + 8], eax
mov eax, dword [esp + 0x20]
mov dword [edi + 0x10], eax
mov eax, dword [esp + 0x40]
mov dword [edi + 0x14], eax
mov eax, dword [esp + 0x68]
mov dword [edi + 0x18], eax
mov al, byte [esp + 0x1c]
mov byte [edi + 0x140], al
mov eax, dword [esp + 0x14]
mov dword [edi + 0x1c], ebx
mov dword [edi + 0x20], eax
mov eax, dword [esi + 0x148]
mov dword [edi + 0x24], ecx
mov dword [edi + 0x128], eax
mov eax, dword [esi + 0x14c]
mov dword [edi + 0x12c], eax
mov eax, dword [esp]
cmp al, 2
je 0x406435
movzx eax, al
cmp eax, 1
lea eax, [esp + 0x88]
jne 0x40644d
xor ecx, ecx
mov edx, esi
jmp 0x406441
xor ecx, ecx
mov edx, esi
lea eax, [esp + 0x88]
inc ecx
push eax
call fcn.0040db79
pop eax
jmp 0x406a9f
mov edi, dword [esi]
mov ebp, esi
mov esi, dword [esi + 8]
mov ecx, dword [esp + 0x18]
shl dword [esp + 0x10], cl
lea ecx, [esp + 0x28]
mov edx, esi
call fcn.004053ca
lea ecx, [esp + 0x34]
mov edx, esi
call fcn.004053ca
mov ecx, ebx
call fcn.00405396
mov dword [esp + 8], eax
lea eax, [esp + 4]
imul ebx, esi, 0x14
mov ecx, esi
mov dword [esp + 0x40], edx
and dword [eax], 0
add ebx, edi
call fcn.00407687
lea eax, [esp + 0x70]
mov edx, dword [ebp + 0x158]
mov ecx, dword [ebp + 0x15c]
mov dword [eax], edi
mov dword [eax + 4], ebx
and dword [eax + 8], 0
mov ebx, eax
mov dword [eax + 0xc], esi
mov dword [esp + 0x20], edx
mov dword [esp + 0x1c], ecx
mov ecx, ebx
call fcn.004076c6
test edx, edx
je 0x4068fd
mov edi, eax
cmp eax, 2
jae 0x406510
mov esi, dword [esp + 4]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
push 0x589278
push edi
call fcn.00470464
pop ecx
pop edx
mov dword [eax], esi
mov esi, dword [esp + 4]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
push 0x589288
push edi
call fcn.00470464
pop ecx
pop edx
mov ecx, dword [esp + 0x10]
mov dword [eax], esi
add dword [esp + 4], ecx
jmp 0x4064ba
mov eax, dword [esp + 0x20]
mov esi, edx
cmp edi, eax
jne 0x406551
mov ebx, dword [esp + 4]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
push 0x589258
push eax
mov ebp, eax
call fcn.00470464
pop ecx
pop edx
mov dword [eax], ebx
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
push 0x589268
push ebp
call fcn.00470464
pop ecx
pop edx
and dword [eax], 0
jmp 0x4065b4
mov eax, dword [esp + 0x1c]
cmp edi, eax
jne 0x4066fc
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
push 0x589228
push eax
mov ebp, eax
call fcn.00470464
pop ecx
pop edx
and dword [eax], 0
mov ebx, dword [esp + 4]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
push 0x589238
push ebp
call fcn.00470464
pop ecx
pop edx
mov dword [eax], ebx
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0xc]
mov eax, dword [esp + 4]
shr eax, cl
mov ecx, dword [esp + 8]
push 0x589248
push eax
call fcn.0047bc90
pop ecx
pop edx
mov byte [eax], 1
cmp dword [esi + 8], 0
mov ebp, dword [esp + 0x2fc]
je 0x4065e2
mov esi, dword [esp + 4]
mov ecx, ebp
mov edx, edi
call fcn.00407785
mov ebx, edx
lea ecx, [esp + 0x88]
mov edx, esi
push ebx
push eax
call fcn.0040da7a
pop eax
pop ecx
mov ecx, ebp
mov edx, edi
call fcn.00407727
xor esi, esi
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], edx
mov dword [esp], 0
lea ecx, [esp + 0x44]
lea edx, [esp + 0x58]
call fcn.00407744
cmp byte [esp + 0x44], 0
je 0x406698
movzx edi, byte [esp + 0x45]
mov ebp, dword [esp + 0x46]
mov ecx, dword [esp]
mov edx, esi
cmp edx, edi
jae 0x40665e
movzx eax, dl
inc edx
test cl, cl
mov cl, 1
mov bl, byte [esp + eax + 0xc8]
je 0x40663b
cmp bh, bl
je 0x406622
mov esi, edx
lea ecx, [esp + 0x88]
lea edx, [esp + 4]
movzx eax, bl
push 1
push eax
call fcn.0040db40
mov edx, esi
mov cl, 1
add esp, 8
mov bh, bl
jmp 0x406622
mov bl, byte [esp + edi + 0xc8]
test cl, cl
je 0x40666d
cmp bh, bl
je 0x40668b
mov esi, edx
lea edx, [esp + 4]
movzx eax, bl
lea ecx, [esp + 0x88]
push ebp
push eax
call fcn.0040db40
mov edx, esi
add esp, 8
mov bh, bl
inc edx
mov al, 1
mov esi, edx
mov dword [esp], eax
jmp 0x4065fc
mov dword [esp + 0x44], esi
mov dword [esp + 0x48], 0xff
mov byte [esp + 0x4c], 0
lea ecx, [esp + 0x44]
call fcn.00569e49
test eax, eax
je 0x4066eb
movzx eax, dl
cmp byte [esp], 0
mov bl, byte [esp + eax + 0xc8]
mov al, 1
mov dword [esp], eax
je 0x4066cf
cmp bh, bl
je 0x4066a9
movzx eax, bl
lea ecx, [esp + 0x88]
lea edx, [esp + 4]
push 1
push eax
call fcn.0040db40
pop eax
pop ecx
mov bh, bl
jmp 0x4066a9
mov eax, dword [esp + 0x10]
add dword [esp + 4], eax
lea ebx, [esp + 0x70]
jmp 0x4064ba
mov ebx, dword [esp + 4]
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x30]
lea eax, [ebx + ecx]
mov dword [esp + 0x64], ebx
mov dword [esp + 0x24], eax
add eax, ecx
mov ecx, dword [esp + 0x28]
mov dword [esp + 4], eax
push 0x5891f8
push edi
call fcn.00470464
pop ecx
pop edx
mov dword [eax], ebx
mov ebx, dword [esp + 0x24]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
push 0x589208
push edi
call fcn.00470464
pop ecx
pop edx
mov dword [eax], ebx
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0xc]
mov eax, dword [esp + 0x24]
shr eax, cl
mov ecx, dword [esp + 8]
push 0x589218
push eax
call fcn.0047bc90
pop ecx
pop edx
mov byte [eax], 1
mov ebp, dword [esp + 0x2fc]
lea eax, [esp + 0x88]
cmp dword [esi + 8], 0
je 0x4067cf
mov eax, dword [esp + 0x64]
mov ecx, ebp
mov edx, edi
mov dword [esp], eax
call fcn.00407785
mov ebx, edx
mov edx, dword [esp]
lea ecx, [esp + 0x88]
push ebx
push eax
call fcn.0040da7a
pop eax
pop ecx
mov eax, dword [esp + 0x24]
mov ecx, ebp
mov edx, edi
mov dword [esp], eax
call fcn.00407785
mov ebx, edx
mov edx, dword [esp]
lea ecx, [esp + 0x88]
push ebx
push eax
call fcn.0040da7a
lea eax, [esp + 0x90]
add esp, 8
mov dword [esp + 0x44], esi
mov dword [esp + 0x48], ebp
mov dword [esp + 0x4c], eax
lea eax, [esp + 0x64]
mov ecx, ebp
mov edx, edi
mov dword [esp + 0x50], eax
lea eax, [esp + 0x24]
mov dword [esp + 0x54], eax
call fcn.00407727
xor ebx, ebx
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], edx
mov dword [esp], 0
lea ecx, [esp + 0x58]
lea edx, [esp + 0x80]
call fcn.00407744
cmp byte [esp + 0x58], 0
je 0x4068a9
mov edi, dword [esp + 0x5a]
movzx esi, byte [esp + 0x59]
mov ecx, dword [esp]
mov dl, byte [esp + 0x14]
mov ebp, ebx
mov ebx, ebp
cmp ebp, esi
jae 0x406873
movzx eax, bl
test cl, cl
lea ebp, [ebx + 1]
mov cl, 1
mov al, byte [esp + eax + 0xc8]
je 0x406855
cmp dl, al
je 0x406838
lea ecx, [esp + 0x44]
mov edx, ebx
mov byte [esp], al
movzx eax, al
push 1
push eax
call fcn.0040d956
mov cl, 1
add esp, 8
mov dl, byte [esp]
jmp 0x406838
mov al, byte [esp + esi + 0xc8]
test cl, cl
je 0x406882
cmp dl, al
je 0x40689a
mov edx, esi
mov byte [esp], al
movzx eax, al
lea ecx, [esp + 0x44]
push edi
push eax
call fcn.0040d956
pop eax
pop ecx
mov dl, byte [esp]
mov al, 1
mov byte [esp + 0x14], dl
inc ebx
mov dword [esp], eax
jmp 0x40680b
mov dword [esp + 0x58], ebx
mov dword [esp + 0x5c], 0xff
mov byte [esp + 0x60], 0
lea ecx, [esp + 0x58]
call fcn.00569e49
test eax, eax
je 0x4066f3
movzx eax, dl
cmp byte [esp], 0
mov bl, byte [esp + eax + 0xc8]
mov al, 1
mov dword [esp], eax
je 0x4068e6
cmp byte [esp + 0x14], bl
je 0x4068ba
movzx eax, bl
lea ecx, [esp + 0x44]
push 1
push eax
call fcn.0040d956
pop eax
pop ecx
mov byte [esp + 0x14], bl
jmp 0x4068ba
mov ecx, dword [esp + 0xbc]
xor eax, eax
mov dword [esp], ecx
mov edx, dword [esp + 0xc]
cmp eax, dword [esp]
je 0x4069e8
mov esi, eax
mov ecx, dword [esp + 0x18]
lea ebp, [eax + 1]
shl esi, cl
mov ecx, dword [esp + 8]
push 0x589188
push eax
call fcn.0047bc90
pop ecx
pop edx
cmp byte [eax], 0
mov ecx, dword [esp + 0x88]
mov edx, dword [esp + 0x90]
je 0x406993
push 0x5891c8
push esi
call fcn.00449733
pop ecx
pop ecx
mov ecx, eax
push 0x5891d8
push dword [esp + 0x14]
call fcn.00409e12
pop ecx
pop ecx
mov esi, edx
mov edi, eax
shl esi, 2
test esi, esi
je 0x4069e1
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x3c]
lea ebx, [edi + 4]
push 0x5891e8
push dword [edi]
call fcn.00470464
pop ecx
pop edx
mov eax, dword [eax]
add esi, 0xfffffffc
mov dword [edi], eax
mov edi, ebx
jmp 0x40696b
push 0x589198
push esi
call fcn.00449733
pop ecx
pop ecx
mov ecx, eax
push 0x5891a8
push dword [esp + 0x14]
call fcn.00409e12
pop ecx
pop ecx
mov esi, edx
mov edi, eax
shl esi, 2
test esi, esi
je 0x4069e1
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
lea ebx, [edi + 4]
push 0x5891b8
push dword [edi]
call fcn.00470464
pop ecx
pop edx
mov eax, dword [eax]
add esi, 0xfffffffc
mov dword [edi], eax
mov edi, ebx
jmp 0x4069b9
mov eax, ebp
jmp 0x406909
mov edi, dword [esp + 0x3c]
mov esi, dword [esp + 0x34]
mov ecx, esi
mov edx, edi
push 0x589148
mov ebx, dword [esp + 0x300]
push dword [ebx + 0x150]
call fcn.00470464
pop ecx
pop edx
mov eax, dword [eax]
mov ecx, esi
mov edx, edi
mov dword [esp + 0x1d0], eax
push 0x589158
push dword [ebx + 0x154]
call fcn.00470464
pop ecx
pop edx
mov eax, dword [eax]
mov ebx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
mov dword [esp + 0x1d4], eax
mov ecx, ebx
push 0x589168
push dword [esp + 0x24]
call fcn.00470464
pop ecx
pop edx
mov eax, dword [eax]
mov ecx, esi
mov edx, edi
mov dword [esp + 0x1d8], eax
push 0x589178
push dword [esp + 0x20]
call fcn.00470464
pop ecx
pop edx
mov eax, dword [eax]
mov ecx, dword [esp + 8]
mov edx, dword [esp + 0x40]
mov dword [esp + 0x1dc], eax
call fcn.00448429
mov edx, dword [esp + 0x38]
mov ecx, esi
call fcn.00473538
mov edx, dword [esp + 0x2c]
mov ecx, ebx
call fcn.00473538
lea edi, [esp + 0xa0]
lea esi, [esp + 0x88]
mov ecx, esi
call fcn.00405225
mov ecx, edi
call fcn.00405225
mov eax, dword [esi + 0x10]
mov ebp, dword [esi + 0x14]
cmp eax, ebp
jbe 0x406b09
mov ecx, dword [esp + 0x94]
imul eax, eax, 0xc
test ebp, ebp
je 0x406ae3
imul edi, ebp, 0xc
mov edx, eax
push edi
call fcn.0040527b
pop ecx
mov ebx, eax
test eax, eax
push 4
pop ecx
jne 0x406aef
jmp 0x406b02
push 4
pop ebx
mov edx, ebx
push eax
call fcn.004042eb
pop eax
mov ecx, 0x80000001
mov dword [esp + 0x94], ebx
mov dword [esp + 0x98], ebp
mov edx, edi
call fcn.0040424b
mov edi, dword [esp + 0x6c]
lea eax, [edi + 4]
push 0x15c
push esi
push eax
call fcn.00570db0
add esp, 0xc
and dword [edi], 0
add esp, 0x2e4
pop esi
pop edi
pop ebx
pop ebp
ret
call fcn.00412860
ud2
ud2