Function at 0x407940
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
mov ebx, dword [ebp + 0x10]
cmp word [ebx + 8], 1
push esi
push edi
jne 0x407961
mov edi, dword [ebx + 0xc]
add edi, edi
add edi, edi
call fcn.00406e80
jmp 0x407964
mov eax, dword [ebp + 0xc]
mov edi, dword [ebx]
movsx ecx, word [ebx + 0xa]
mov esi, dword [ebx + 0xc]
mov ebx, dword [ebx + 0x10]
push edi
push 1
lea edx, [ebp - 1]
push 1
push edx
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], 0
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], esi
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x10
cmp byte [ebp - 1], 0x81
jne 0x407a47
mov eax, dword [ebp + 0x10]
movsx ecx, word [eax + 8]
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
push ecx
push edx
mov edx, dword [ebp - 0xc]
push eax
push ebx
push esi
mov ecx, edi
call fcn.00407b60
add esp, 0x14
mov dword [ebp - 8], eax
test eax, eax
jne 0x407b32
push edi
push 1
lea eax, [ebp - 1]
push 1
push eax
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x10
test ebx, ebx
je 0x407b32
test esi, esi
je 0x407b32
mov edi, dword [ebp - 0x18]
dec edi
js 0x407b32
mov ecx, dword [ebp - 0x14]
imul ebx, ebx, 0xd
mov edx, dword [ebp + 0xc]
mov esi, edi
lea eax, [edx + ecx*8]
imul esi, esi, 0xd
add ebx, dword [ebp + 8]
mov dword [ebp - 0x14], eax
lea esp, [esp]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ecx + 0x24]
add edx, esi
push 0x24
push edx
call dword [sym.imp.MSVCR100.dll_strchr]
add esp, 8
test eax, eax
je 0x407b16
mov eax, dword [ebp + 8]
push 0xd
sub ebx, 0xd
lea ecx, [esi + eax]
push ebx
push ecx
call dword [sym.imp.MSVCR100.dll_memmove]
add esp, 0xc
jmp 0x407b28
test esi, esi
je 0x407abd
mov ecx, dword [ebp + 0x10]
cmp word [ecx + 8], 2
push edi
push 1
je 0x407af3
mov eax, dword [ebp - 0xc]
lea edx, [esi*4]
push edx
push eax
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x10
cmp eax, 1
je 0x407a82
mov dword [ebp - 8], 1
jmp 0x407b32
xor ecx, ecx
test esi, esi
jle 0x407abd
fld dword [0x448678]
fld qword [0x4596d0]
mov edx, dword [ebp - 0xc]
fld dword [edx + ecx*4]
fcomp st(2)
fnstsw ax
test ah, 0x41
jne 0x407aae
fld dword [edx + ecx*4]
mov edx, dword [ebp + 0xc]
fstp qword [edx + ecx*8]
jmp 0x407ab4
mov eax, dword [ebp + 0xc]
fst qword [eax + ecx*8]
inc ecx
cmp ecx, esi
jl 0x407a94
fstp st(1)
fstp st(0)
test ebx, ebx
jle 0x4079c6
mov esi, dword [ebp + 8]
mov dword [ebp - 0x10], ebx
jmp 0x407ad0
push edi
push 1
push 0xc
push esi
call dword [sym.imp.MSVCR100.dll_fread]
mov byte [esi + 0xc], 0
add esp, 0x10
add esi, 0xd
dec dword [ebp - 0x10]
jne 0x407ad0
mov esi, dword [ebp - 0x14]
jmp 0x4079c6
mov edx, dword [ebp + 0xc]
lea ecx, [esi*8]
push ecx
push edx
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x10
cmp eax, 1
je 0x407abd
mov dword [ebp - 8], 1
jmp 0x407b32
mov eax, dword [ebp - 0x14]
fld qword [eax - 8]
mov edx, dword [ebp + 0xc]
sub eax, 8
fstp qword [edx + edi*8]
mov dword [ebp - 0x14], eax
sub esi, 0xd
dec edi
jns 0x407a10
mov eax, dword [ebp + 0x10]
cmp word [eax + 8], 1
pop edi
pop esi
pop ebx
jne 0x407b50
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x407b50
push eax
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
mov eax, dword [ebp - 8]
mov esp, ebp
pop ebp
ret