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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x49d2bb
mov eax, dword fs:[0]
push eax
sub esp, 0xa8
push ebx
push esi
push edi
mov eax, dword [str.Open_0_2]
xor eax, esp
push eax
lea eax, [esp + 0xb8]
mov dword fs:[0], eax
mov esi, ecx
lea eax, [esi + 0x64]
xor edi, edi
cmp eax, edi
je 0x406764
mov eax, dword [eax + 4]
cmp eax, edi
je 0x406764
mov ebx, dword [ebp + 8]
push eax
mov eax, dword [ebx + 4]
push eax
call dword [0x4a51c0]
jmp 0x406767
mov ebx, dword [ebp + 8]
call fcn.00431af2
xor ecx, ecx
cmp eax, edi
setne cl
cmp ecx, edi
jne 0x406781
push 0x80004005
call fcn.00401dc0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x30], eax
mov edx, dword [ebx]
mov edx, dword [edx + 0x28]
lea eax, [esi + 0x84]
push eax
mov ecx, ebx
mov dword [esp + 0xc4], edi
call edx
mov dword [esp + 0x48], eax
mov eax, dword [ebx]
mov edx, dword [eax + 0x30]
push 0xffffff
mov ecx, ebx
call edx
mov eax, dword [esi + 0xac]
sub eax, dword [esi + 0xa4]
push edi
cdq
idiv dword [esi + 0x1e38]
mov ecx, ebx
mov dword [esp + 0x20], eax
fild dword [esp + 0x20]
mov eax, dword [ebx]
mov edx, dword [eax + 0x30]
fstp qword [esp + 0x40]
call edx
mov eax, dword [esi + 0x100]
cmp eax, 4
jg 0x406beb
mov ecx, 5
mov dword [esp + 0x1c], ecx
jne 0x406803
mov dword [esp + 0x1c], ecx
jmp 0x406810
cmp eax, 2
jne 0x406810
mov dword [esp + 0x1c], 1
mov eax, dword [esi + 0x1e38]
mov dword [esp + 0x14], edi
test eax, eax
jl 0x406eaa
jmp 0x406828
mov edi, dword [esp + 0x14]
cdq
sub eax, edx
sar eax, 1
mov edx, edi
sub edx, eax
cmp byte [esi + 0x108], 0
je 0x4068f5
lea ecx, [esi + 0xe0]
cmp edi, eax
push ecx
mov eax, edx
jg 0x4068a0
shl eax, 4
sub eax, edx
add eax, eax
add eax, eax
cdq
mov edi, eax
add edi, dword [ecx]
lea eax, [esp + 0x58]
mov ebx, edx
adc ebx, dword [ecx + 4]
push eax
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x406875
mov ecx, dword [esp + 0x58]
jmp 0x406878
or ecx, 0xffffffff
mov eax, dword [esi + 0x1e38]
cdq
sub eax, edx
mov edx, dword [esp + 0x14]
sar eax, 1
sub ecx, eax
lea eax, [ecx + edx + 0x3c]
cdq
mov ecx, 0x3c
idiv ecx
lea eax, [esi + 0xe0]
jmp 0x406996
shl eax, 4
sub eax, edx
add eax, eax
add eax, eax
cdq
mov edi, eax
add edi, dword [ecx]
mov ebx, edx
adc ebx, dword [ecx + 4]
lea edx, [esp + 0x58]
push edx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x4068ca
mov ecx, dword [esp + 0x58]
jmp 0x4068cd
or ecx, 0xffffffff
mov eax, dword [esi + 0x1e38]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [esp + 0x14]
lea eax, [ecx + eax + 0x3c]
cdq
mov ecx, 0x3c
idiv ecx
lea eax, [esi + 0xe0]
jmp 0x406996
lea ecx, [esi + 0xf8]
cmp edi, eax
push ecx
mov eax, edx
jg 0x406946
shl eax, 4
sub eax, edx
add eax, eax
add eax, eax
cdq
mov edi, eax
add edi, dword [ecx]
mov ebx, edx
adc ebx, dword [ecx + 4]
lea ecx, [esp + 0x58]
push ecx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x40692c
mov ecx, dword [esp + 0x58]
jmp 0x40692f
or ecx, 0xffffffff
mov eax, dword [esi + 0x1e38]
cdq
sub eax, edx
mov edx, dword [esp + 0x14]
sar eax, 1
sub ecx, eax
lea eax, [ecx + edx + 0x3c]
jmp 0x406988
shl eax, 4
sub eax, edx
add eax, eax
add eax, eax
cdq
mov edi, eax
add edi, dword [ecx]
mov ebx, edx
adc ebx, dword [ecx + 4]
lea edx, [esp + 0x58]
push edx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x406970
mov ecx, dword [esp + 0x58]
jmp 0x406973
or ecx, 0xffffffff
mov eax, dword [esi + 0x1e38]
cdq
sub eax, edx
sar eax, 1
sub ecx, eax
mov eax, dword [esp + 0x14]
lea eax, [ecx + eax + 0x3c]
cdq
mov ecx, 0x3c
idiv ecx
lea eax, [esi + 0xf8]
mov dword [esp + 0x24], edx
push eax
lea edx, [esp + 0x58]
push edx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x4069b6
mov eax, dword [esp + 0x54]
mov dword [esp + 0x18], eax
jmp 0x4069be
mov dword [esp + 0x18], 0xffffffff
fild dword [esp + 0x18]
fld qword [esp + 0x3c]
fmul st(1), st(0)
fxch st(1)
fdiv qword [0x4a5b70]
call fcn.0046d300
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x18], eax
mov eax, ecx
cdq
idiv dword [esp + 0x1c]
mov dword [esp + 0x4c], edi
mov dword [esp + 0x50], ebx
test edx, edx
jne 0x406aa1
lea ecx, [esp + 0x4c]
fstp st(0)
push ecx
lea edx, [esp + 0x58]
push edx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x406a12
mov edi, dword [esp + 0x58]
jmp 0x406a15
or edi, 0xffffffff
lea eax, [esp + 0x4c]
push eax
lea ecx, [esp + 0x7c]
push ecx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x406a34
mov eax, dword [esp + 0x80]
jmp 0x406a37
or eax, 0xffffffff
push 0
push edi
push eax
lea edx, [esp + 0x3c]
push 0x4a5bb8
push edx
call fcn.004066f0
fild dword [esp + 0x28]
mov edi, dword [esi + 0xb0]
add esp, 0x14
fmul qword [esp + 0x3c]
sub edi, 0x12
fiadd dword [esi + 0xa4]
fadd qword [0x4a5b10]
fsub qword [0x4a5bb0]
fisub dword [esp + 0x18]
call fcn.0046d300
mov ecx, dword [esp + 0x30]
mov edx, dword [ecx - 0xc]
mov ebx, dword [ebp + 8]
mov dword [esp + 0x34], edx
push dword [esp + 0x34]
mov edx, dword [ebx]
push ecx
push edi
push eax
mov eax, dword [edx + 0x5c]
mov ecx, ebx
call eax
fld qword [esp + 0x3c]
mov ecx, dword [esp + 0x24]
jmp 0x406aa4
mov ebx, dword [ebp + 8]
cmp ecx, 5
jge 0x406af6
fimul dword [esp + 0x14]
mov ecx, dword [esi + 0xb0]
sub ecx, 5
push ecx
fst qword [esp + 0x28]
fild dword [esp + 0x1c]
fst qword [esp + 0x38]
fild dword [esi + 0xa4]
faddp st(2)
fxch st(1)
fadd qword [0x4a5b10]
fsubrp st(1)
call fcn.0046d300
push eax
lea edx, [esp + 0xb4]
push edx
mov ecx, ebx
call fcn.0042d2f6
mov eax, dword [esi + 0xb0]
push eax
jmp 0x406bab
mov eax, 0x66666667
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
lea edx, [eax + eax*4]
add edx, edx
mov eax, ecx
sub eax, edx
je 0x406b63
mov eax, 0x66666667
imul ecx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add eax, edx
lea edx, [eax + eax*4]
sub ecx, edx
je 0x406b63
fimul dword [esp + 0x14]
mov eax, dword [esi + 0xb0]
sub eax, 5
push eax
fst qword [esp + 0x28]
fild dword [esp + 0x1c]
fst qword [esp + 0x38]
fild dword [esi + 0xa4]
faddp st(2)
fxch st(1)
fadd qword [0x4a5b10]
fsubrp st(1)
call fcn.0046d300
lea ecx, [esp + 0xa0]
jmp 0x406b9b
fimul dword [esp + 0x14]
mov eax, dword [esi + 0xb0]
sub eax, 8
push eax
fst qword [esp + 0x28]
fild dword [esp + 0x1c]
fst qword [esp + 0x38]
fild dword [esi + 0xa4]
faddp st(2)
fxch st(1)
fadd qword [0x4a5b10]
fsubrp st(1)
call fcn.0046d300
lea ecx, [esp + 0xa8]
push eax
push ecx
mov ecx, ebx
call fcn.0042d2f6
mov edx, dword [esi + 0xb0]
push edx
fild dword [esi + 0xa4]
fadd qword [esp + 0x28]
fadd qword [0x4a5b10]
fsub qword [esp + 0x38]
call fcn.0046d300
push eax
mov ecx, ebx
call fcn.0042cbd0
mov ecx, dword [esp + 0x14]
mov eax, dword [esi + 0x1e38]
inc ecx
cmp ecx, eax
mov dword [esp + 0x14], ecx
jle 0x406824
mov ebx, dword [ebp + 8]
jmp 0x406eaa
mov eax, dword [esi + 0x1e38]
add eax, 1
mov dword [esp + 0x14], edi
js 0x406eaa
mov edi, edi
cmp byte [esi + 0x108], 0
lea ecx, [esp + 0x78]
je 0x406cac
lea edi, [esi + 0xe0]
push edi
push ecx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x406c2e
mov ecx, dword [esp + 0x80]
jmp 0x406c31
or ecx, 0xffffffff
mov eax, dword [esi + 0x1e38]
cdq
sub eax, edx
mov edx, dword [esp + 0x14]
sar eax, 1
sub ecx, eax
lea eax, [ecx + edx + 0x18]
cdq
mov ecx, 0x18
idiv ecx
push edi
mov dword [esp + 0x28], edx
lea edx, [esp + 0x7c]
push edx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x406c6e
mov eax, dword [esp + 0x7c]
mov dword [esp + 0x1c], eax
jmp 0x406c76
mov dword [esp + 0x1c], 0xffffffff
lea ecx, [esp + 0x54]
push edi
push ecx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x406c8e
mov eax, dword [esp + 0x54]
jmp 0x406c91
or eax, 0xffffffff
mov ecx, dword [esp + 0x1c]
mov edx, ecx
shl edx, 4
sub edx, ecx
lea eax, [eax + edx*4]
mov dword [esp + 0x34], eax
fild dword [esp + 0x34]
jmp 0x406d42
lea edi, [esi + 0xf8]
push edi
push ecx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x406cc9
mov ecx, dword [esp + 0x80]
jmp 0x406ccc
or ecx, 0xffffffff
mov eax, dword [esi + 0x1e38]
cdq
sub eax, edx
mov edx, dword [esp + 0x14]
sar eax, 1
sub ecx, eax
lea eax, [ecx + edx + 0x18]
cdq
mov ecx, 0x18
idiv ecx
push edi
mov dword [esp + 0x28], edx
lea edx, [esp + 0x7c]
push edx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x406d09
mov eax, dword [esp + 0x7c]
mov dword [esp + 0x1c], eax
jmp 0x406d11
mov dword [esp + 0x1c], 0xffffffff
lea ecx, [esp + 0x54]
push edi
push ecx
call fcn.0046d6a8
add esp, 8
test eax, eax
jne 0x406d29
mov ecx, dword [esp + 0x54]
jmp 0x406d2c
or ecx, 0xffffffff
mov eax, dword [esp + 0x1c]
mov edx, eax
shl edx, 4
sub edx, eax
lea eax, [ecx + edx*4]
mov dword [esp + 0x34], eax
fild dword [esp + 0x34]
fld qword [esp + 0x3c]
fmul st(1), st(0)
fxch st(1)
fdiv qword [0x4a5ba8]
call fcn.0046d300
cmp dword [esi + 0x100], 8
mov dword [esp + 0x1c], eax
mov edi, 1
jne 0x406d6c
mov edi, 2
mov ecx, dword [esp + 0x24]
mov eax, ecx
cdq
idiv edi
test edx, edx
jne 0x406e29
push ecx
fstp st(0)
lea ecx, [esp + 0x34]
push 0x4a5b9c
push ecx
call fcn.004066f0
add esp, 0xc
cmp edi, 1
jne 0x406dae
mov edx, dword [esp + 0x24]
push edx
lea eax, [esp + 0x34]
push 0x4a5b94
push eax
call fcn.004066f0
add esp, 0xc
fild dword [esp + 0x14]
mov edi, dword [esi + 0xb0]
sub edi, 0x14
fmul qword [esp + 0x3c]
fst qword [esp + 0x24]
fild dword [esp + 0x1c]
fst qword [esp + 0x1c]
fild dword [esi + 0xa4]
faddp st(2)
fxch st(1)
fadd qword [0x4a5b10]
fsubrp st(1)
call fcn.0046d300
mov ecx, dword [esp + 0x30]
mov edx, dword [ecx - 0xc]
mov dword [esp + 0x34], edx
push dword [esp + 0x34]
mov edx, dword [ebx]
push ecx
push edi
push eax
mov eax, dword [edx + 0x5c]
mov ecx, ebx
call eax
fild dword [esi + 0xa4]
mov ecx, dword [esi + 0xb0]
sub ecx, 0xa
fadd qword [esp + 0x24]
push ecx
fadd qword [0x4a5b10]
fsub qword [esp + 0x20]
call fcn.0046d300
lea edx, [esp + 0xa8]
jmp 0x406e61
fimul dword [esp + 0x14]
mov ecx, dword [esi + 0xb0]
sub ecx, 5
push ecx
fst qword [esp + 0x28]
fild dword [esp + 0x20]
fst qword [esp + 0x20]
fild dword [esi + 0xa4]
faddp st(2)
fxch st(1)
fadd qword [0x4a5b10]
fsubrp st(1)
call fcn.0046d300
lea edx, [esp + 0xa0]
push eax
push edx
mov ecx, ebx
call fcn.0042d2f6
fild dword [esi + 0xa4]
mov eax, dword [esi + 0xb0]
push eax
fadd qword [esp + 0x28]
fadd qword [0x4a5b10]
fsub qword [esp + 0x20]
call fcn.0046d300
push eax
mov ecx, ebx
call fcn.0042cbd0
mov eax, dword [esp + 0x14]
mov ecx, dword [esi + 0x1e38]
inc eax
inc ecx
cmp eax, ecx
mov dword [esp + 0x14], eax
jle 0x406c00
mov edx, dword [ebx]
mov eax, dword [esp + 0x48]
mov edx, dword [edx + 0x28]
push eax
mov ecx, ebx
call edx
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
mov dword [esp + 0xc0], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406ee3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0xb8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4