Function at 0x407690
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40ae8b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x288
mov ecx, dword [0x40f430]
push ebx
push ebp
push esi
lea eax, [esp + 0x154]
push edi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
jne 0x4076f1
mov dword [0x410be0], 0
xor eax, eax
mov ecx, dword [esp + 0x298]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [0x40f430]
mov ebp, dword [sym.imp.MSVCRT.dll_fopen]
mov ecx, 0xa
xor eax, eax
lea edi, [esp + 0x6c]
mov dword [esp + 0x64], 0
mov dword [esp + 0x68], 0
mov dword [esp + 0x94], eax
rep stosd dword es:[edi], eax
mov ecx, 0xa
lea edi, [esp + 0x9c]
mov dword [esp + 0x98], eax
push 0x40f0f0
rep stosd dword es:[edi], eax
push edx
xor edi, edi
call ebp
mov esi, eax
add esp, 8
test esi, esi
jne 0x40775f
mov ecx, dword [esp + 0x298]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
test byte [esi + 0xc], 0x10
jne 0x407799
mov ebx, dword [sym.imp.MSVCRT.dll_ftell]
push esi
call ebx
mov ecx, edi
push esi
and ecx, 0xffff
lea edx, [esp + 0xfc]
push 0x64
push edx
mov dword [ecx*4 + 0x40f470], eax
call dword [sym.imp.MSVCRT.dll_fgets]
mov al, byte [esi + 0xc]
add esp, 0x10
inc edi
test al, 0x10
je 0x40776b
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, edi
add esp, 4
and eax, 0xffff
cmp di, 4
mov dword [0x410be0], eax
jae 0x4077cd
xor eax, eax
mov ecx, dword [esp + 0x298]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 0x66
mov eax, dword [0x40f430]
push 0x40f0f0
push eax
ja 0x407976
call ebp
add esp, 8
mov dword [esp + 0x24], eax
test eax, eax
je 0x407af4
mov ecx, dword [0x40f474]
push 1
push ecx
push eax
call dword [sym.imp.MSVCRT.dll_fseek]
mov edx, dword [0x410be0]
add esp, 0xc
add edx, 0xfffffffe
mov dword [esp + 0x20], 0
test edx, edx
jbe 0x407af4
mov eax, dword [esp + 0x24]
lea ecx, [esp + 0xf4]
push eax
push 0x64
push ecx
call dword [sym.imp.MSVCRT.dll_fgets]
xor edx, edx
add esp, 0xc
mov dword [esp + 0x30], edx
lea eax, [esp + 0x40]
mov dword [esp + 0x34], edx
lea ecx, [esp + 0x3c]
mov dword [esp + 0x38], edx
push eax
mov dword [esp + 0x40], edx
push ecx
mov dword [esp + 0x48], edx
lea edx, [esp + 0x40]
lea eax, [esp + 0x3c]
push edx
lea ecx, [esp + 0x3c]
push eax
lea edx, [esp + 0x3c]
push ecx
push edx
lea eax, [esp + 0x10c]
push str._f_t_f_t_f_t_f_t_f_t_f_t
push eax
mov dword [esp + 0x4c], 0
call dword [sym.imp.MSVCRT.dll_sscanf]
mov ecx, dword [esp + 0x40]
add esp, 0x20
mov ebx, 0x410eb8
lea ebp, [esp + 0x2c]
lea edi, [ecx*8 + 0x410eb8]
xor esi, esi
fld dword [ebp]
fstp qword [esp + 0x14]
fld qword [esp + 0x14]
fadd qword [esp + esi + 0x64]
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov dword [edi], edx
mov dword [edi + 4], eax
fstp qword [esp + esi + 0x64]
fld qword [esp + 0x14]
fld qword [0x40cc38]
call sub.MSVCRT.dll__CIpow
fadd qword [esp + esi + 0x94]
mov ecx, dword [esp + 0x20]
test ecx, ecx
fstp qword [esp + esi + 0x94]
jne 0x4078f3
fld qword [ebx]
fst qword [esi + 0x410c18]
fstp qword [esi + 0x410c48]
jmp 0x40793d
fld qword [esp + 0x14]
fcomp qword [esi + 0x410c48]
fnstsw ax
test ah, 1
je 0x407918
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov dword [esi + 0x410c48], edx
mov dword [esi + 0x410c4c], eax
fld qword [esp + 0x14]
fcomp qword [esi + 0x410c18]
fnstsw ax
test ah, 0x41
jne 0x40793d
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov dword [esi + 0x410c18], edx
mov dword [esi + 0x410c1c], eax
add ebx, 0x320
add ebp, 4
add edi, 0x320
add esi, 8
cmp ebx, 0x412178
jb 0x40789e
mov edx, dword [0x410be0]
inc ecx
add edx, 0xfffffffe
mov dword [esp + 0x20], ecx
cmp ecx, edx
jb 0x40781e
jmp 0x407af4
call ebp
add esp, 8
mov dword [esp + 0x24], eax
test eax, eax
je 0x407af4
mov ecx, dword [0x410be0]
push 0
mov edx, dword [ecx*4 + 0x40f2dc]
push edx
push eax
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
mov dword [esp + 0x20], 0
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0xf4]
push ecx
push 0x64
push edx
call dword [sym.imp.MSVCRT.dll_fgets]
xor eax, eax
add esp, 0xc
mov dword [esp + 0x30], eax
lea ecx, [esp + 0x40]
mov dword [esp + 0x34], eax
lea edx, [esp + 0x3c]
mov dword [esp + 0x38], eax
push ecx
mov dword [esp + 0x40], eax
push edx
mov dword [esp + 0x48], eax
lea eax, [esp + 0x40]
lea ecx, [esp + 0x3c]
push eax
lea edx, [esp + 0x3c]
push ecx
lea eax, [esp + 0x3c]
push edx
push eax
lea ecx, [esp + 0x10c]
push str._f_t_f_t_f_t_f_t_f_t_f_t
push ecx
mov dword [esp + 0x4c], 0
call dword [sym.imp.MSVCRT.dll_sscanf]
mov edx, dword [esp + 0x40]
add esp, 0x20
mov ebx, 0x410eb8
lea ebp, [esp + 0x2c]
lea edi, [edx*8 + 0x410eb8]
xor esi, esi
fld dword [ebp]
fstp qword [esp + 0x14]
fld qword [esp + 0x14]
fadd qword [esp + esi + 0x64]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov dword [edi], eax
mov dword [edi + 4], ecx
fstp qword [esp + esi + 0x64]
fld qword [esp + 0x14]
fld qword [0x40cc38]
call sub.MSVCRT.dll__CIpow
fadd qword [esp + esi + 0x94]
mov ecx, dword [esp + 0x20]
test ecx, ecx
fstp qword [esp + esi + 0x94]
jne 0x407a7e
fld qword [ebx]
fst qword [esi + 0x410c18]
fstp qword [esi + 0x410c48]
jmp 0x407ac8
fld qword [esp + 0x14]
fcomp qword [esi + 0x410c48]
fnstsw ax
test ah, 1
je 0x407aa3
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov dword [esi + 0x410c48], edx
mov dword [esi + 0x410c4c], eax
fld qword [esp + 0x14]
fcomp qword [esi + 0x410c18]
fnstsw ax
test ah, 0x41
jne 0x407ac8
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
mov dword [esi + 0x410c18], edx
mov dword [esi + 0x410c1c], eax
add ebx, 0x320
add ebp, 4
add edi, 0x320
add esi, 8
cmp ebx, 0x412178
jb 0x407a29
inc ecx
cmp ecx, 0x64
mov dword [esp + 0x20], ecx
jb 0x4079a9
mov ecx, dword [esp + 0x24]
push ecx
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [0x410be0]
add esp, 4
cmp eax, 0x66
ja 0x407b15
add eax, 0xfffffffe
mov dword [esp + 0x20], eax
jmp 0x407b1d
mov dword [esp + 0x20], 0x64
mov ecx, 0xa
xor eax, eax
lea edi, [esp + 0xcc]
mov dword [esp + 0xc4], 0
mov dword [esp + 0xc8], 0
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x20]
and eax, 0xffff
mov dword [esp + 0x24], eax
jbe 0x407ba0
fild dword [esp + 0x24]
mov ebx, 0x410eb8
mov ebp, eax
fstp qword [esp + 0x54]
mov edi, ebx
xor esi, esi
fld qword [esp + esi + 0x64]
fdiv qword [esp + 0x54]
fsubr qword [edi]
fld qword [0x40cc38]
call sub.MSVCRT.dll__CIpow
fadd qword [esp + esi + 0xc4]
add esi, 8
add edi, 0x320
cmp esi, 0x30
fstp qword [esp + esi + 0xbc]
jb 0x407b65
add ebx, 8
dec ebp
jne 0x407b61
mov eax, dword [esp + 0x24]
fild dword [esp + 0x24]
dec eax
mov ecx, 0xc
mov dword [esp + 0x14], eax
lea esi, [esp + 0x94]
fstp qword [esp + 0x54]
fild dword [esp + 0x14]
mov edi, 0x412b08
mov ebp, 0x3ff19999
rep movsd dword es:[edi], dword [esi]
fstp qword [esp + 0x5c]
xor esi, esi
mov ebx, 0xeb851eb8
mov edi, 0x3fe6b851
fld qword [esi + 0x410c18]
fcomp qword [esi + 0x40f268]
fnstsw ax
test ah, 0x41
jne 0x407c06
mov edx, dword [esi + 0x410c18]
mov eax, dword [esi + 0x410c1c]
mov dword [esi + 0x410c78], edx
mov dword [esi + 0x410c7c], eax
jmp 0x407c1e
mov ecx, dword [esi + 0x40f268]
mov edx, dword [esi + 0x40f26c]
mov dword [esi + 0x410c78], ecx
mov dword [esi + 0x410c7c], edx
fld qword [esi + 0x410c48]
fcomp qword [esi + 0x40f298]
fnstsw ax
test ah, 1
je 0x407c4b
mov eax, dword [esi + 0x410c48]
mov ecx, dword [esi + 0x410c4c]
mov dword [esi + 0x410ca8], eax
mov dword [esi + 0x410cac], ecx
jmp 0x407c63
mov edx, dword [esi + 0x40f298]
mov eax, dword [esi + 0x40f29c]
mov dword [esi + 0x410ca8], edx
mov dword [esi + 0x410cac], eax
fld qword [esp + esi + 0x64]
fdiv qword [esp + 0x54]
fst qword [esp + 0x4c]
fstp qword [esi + 0x412b38]
fld qword [esp + esi + 0xc4]
fdiv qword [esp + 0x5c]
fld qword [0x40cca8]
call sub.MSVCRT.dll__CIpow
fstp qword [esp + 0x14]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
cmp word [esp + 0x20], 0x14
mov dword [esi + 0x410cd8], ecx
mov dword [esi + 0x410cdc], edx
ja 0x407cb8
mov eax, dword [esp + 0x24]
fld dword [eax*4 + 0x40f20c]
jmp 0x407cbe
fld dword [0x40f260]
fmul qword [esp + 0x14]
fstp qword [esi + 0x410d08]
fld qword [esp + 0x14]
fcomp qword [0x40cce8]
fnstsw ax
test ah, 0x40
jne 0x407d44
fld qword [esp + 0x14]
fmul qword [0x40cc98]
fld qword [esi + 0x40f268]
fsub qword [esp + 0x4c]
fdiv st(1)
fst qword [esp + 0x44]
fstp qword [esi + 0x410d68]
fld qword [esp + 0x4c]
fsub qword [esi + 0x40f298]
fdivrp st(1)
fst qword [esi + 0x410d98]
fld qword [esi + 0x40f268]
fsub qword [esi + 0x40f298]
fld qword [esp + 0x14]
fmul qword [0x40cc60]
fdivp st(1)
fstp qword [esi + 0x410d38]
fld qword [esp + 0x44]
fcomp st(1)
fnstsw ax
test ah, 1
je 0x407d3c
fstp st(0)
fld qword [esp + 0x44]
fstp qword [esi + 0x410dc8]
jmp 0x407d89
mov eax, 0x9999999a
mov dword [esi + 0x410d98], 0x1eb851ec
mov dword [esi + 0x410d68], eax
mov dword [esi + 0x410d38], 0x3d70a3d7
mov dword [esi + 0x410dc8], eax
mov dword [esi + 0x410d6c], ebp
mov dword [esi + 0x410d9c], 0x3ffdeb85
mov dword [esi + 0x410d3c], 0x3ff7d70a
mov dword [esi + 0x410dcc], ebp
fld qword [esi + 0x410d08]
fcomp qword [0x40cce8]
fnstsw ax
test ah, 0x40
jne 0x407e0b
fld qword [esi + 0x410d08]
fmul qword [0x40cc98]
fld qword [esi + 0x40f268]
fsub qword [esp + 0x4c]
fdiv st(1)
fst qword [esp + 0x44]
fstp qword [esi + 0x410e28]
fld qword [esp + 0x4c]
fsub qword [esi + 0x40f298]
fdivrp st(1)
fst qword [esi + 0x410e58]
fld qword [esi + 0x40f268]
fsub qword [esi + 0x40f298]
fld qword [esi + 0x410d08]
fmul qword [0x40cc60]
fdivp st(1)
fstp qword [esi + 0x410df8]
fld qword [esp + 0x44]
fcomp st(1)
fnstsw ax
test ah, 1
je 0x407e03
fstp st(0)
fld qword [esp + 0x44]
fstp qword [esi + 0x410e88]
jmp 0x407e4b
mov dword [esi + 0x410e28], 0x28f5c28f
mov dword [esi + 0x410e58], ebx
mov dword [esi + 0x410df8], 0xa3d70a4
mov dword [esi + 0x410e88], ebx
mov dword [esi + 0x410e2c], 0x3fea8f5c
mov dword [esi + 0x410e5c], edi
mov dword [esi + 0x410dfc], 0x3fe8a3d7
mov dword [esi + 0x410e8c], edi
add esi, 8
cmp esi, 0x30
jb 0x407bd9
lea ecx, [esp + 0x28]
call sub.MFC42.DLL_CString::CString
mov eax, dword [0x410be0]
mov dword [esp + 0x2a0], 0
cmp eax, 0x3e8
jb 0x407f3e
mov ecx, dword [0x40f430]
mov ebp, dword [sym.imp.MSVCRT.dll_fopen]
push 0x40f0f0
push ecx
call ebp
mov ebx, dword [sym.imp.MSVCRT.dll_fgets]
mov esi, eax
push esi
lea edx, [esp + 0x100]
push 0x64
push edx
call ebx
add esp, 0x14
lea eax, [esp + 0xf4]
lea ecx, [esp + 0x28]
push eax
push 0x40f0d8
push ecx
call sub.MFC42.DLL_CString::Format
mov edx, dword [0x410be0]
push 0
mov eax, dword [edx*4 + 0x40f2dc]
push eax
push esi
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0x18
mov edi, 0x64
push esi
lea ecx, [esp + 0xf8]
push 0x64
push ecx
call ebx
add esp, 0xc
lea edx, [esp + 0xf4]
lea ecx, [esp + 0x28]
push edx
call fcn.0040a5cc
dec edi
jne 0x407edd
mov edi, dword [sym.imp.MSVCRT.dll_fclose]
push esi
call edi
mov eax, dword [0x40f430]
push 0x40f0d4
push eax
call ebp
mov ecx, dword [esp + 0x34]
add esp, 0xc
mov esi, eax
mov eax, dword [ecx - 8]
push esi
push eax
push 1
push eax
lea ecx, [esp + 0x38]
call sub.MFC42.DLL_CString::GetBuffer
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
push esi
call edi
add esp, 0x14
lea ecx, [esp + 0x28]
mov dword [esp + 0x2a0], 0xffffffff
call fcn.0040a58a
mov ecx, dword [esp + 0x298]
pop edi
mov eax, 1
mov dword fs:[0], ecx
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret