Function at 0x401408
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
enter 0x34, 0
mov eax, dword [0x4013fc]
mov dword [ebp - 8], eax
push 0x4016de
call dword [sym.imp.msvcrt.dll_printf]
add esp, 4
mov eax, dword [0x401d30]
cmp eax, 2
jb 0x401431
cmp eax, 3
jbe 0x401441
push 0x4017a1
call dword [sym.imp.msvcrt.dll_printf]
add esp, 4
leave
ret
mov eax, dword [0x401d30]
cmp eax, 2
jne 0x401468
xor ecx, ecx
inc ecx
mov eax, 0x401d34
jecxz 0x401463
cmp byte [eax], 0
je 0x401463
inc eax
cmp byte [eax], 0
jne 0x40145a
inc eax
loop 0x401455
mov dword [ebp - 4], eax
jmp 0x401483
push 2
pop ecx
mov eax, 0x401d34
jecxz 0x401480
cmp byte [eax], 0
je 0x401480
inc eax
cmp byte [eax], 0
jne 0x401477
inc eax
loop 0x401472
mov dword [ebp - 4], eax
push 0
push 0x20
push 3
push 0
push 3
push 0x80000000
xor ecx, ecx
inc ecx
call fcn.00401b82
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0xffffffff
jne 0x4014ba
push 0x4017bf
call dword [sym.imp.msvcrt.dll_printf]
add esp, 4
leave
ret
push 0
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
add eax, 0xa
mov dword [ebp - 0x30], eax
push dword [ebp - 0x30]
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x28], eax
push dword [ebp - 0x30]
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [ebp - 0x24], eax
push 0
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x30]
push dword [ebp - 0x28]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 7
push 0x4017d8
push dword [ebp - 0x28]
call dword [sym.imp.msvcrt.dll_strncmp]
add esp, 0xc
test eax, eax
je 0x40152f
push 0x4017e0
call dword [sym.imp.msvcrt.dll_printf]
add esp, 4
jmp 0x4016ca
mov esi, dword [ebp - 0x28]
add esi, 7
cmp byte [esi], 0x31
je 0x40154d
push 0x401808
call dword [sym.imp.msvcrt.dll_printf]
add esp, 4
jmp 0x4016ca
mov eax, dword [ebp - 0x28]
add eax, 0x14
mov eax, dword [eax]
mov dword [ebp - 0x34], eax
push 0x401e34
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x2c]
push dword [ebp - 0x28]
call fcn.0040188a
mov esi, dword [ebp - 0x28]
add esi, 0x1c
cmp dword [esi], 0
je 0x40159a
push 0x40181e
call dword [sym.imp.msvcrt.dll_printf]
mov dword [0x401404], 0x40122e
mov eax, dword [0x401400]
mov dword [ebp - 8], eax
add esp, 4
mov eax, dword [ebp - 0x1c]
add eax, dword [ebp - 8]
mov dword [ebp - 0x14], eax
push 0
push dword [ebp - 0x14]
fild qword [esp]
fmul qword [0x401b98]
add esp, 8
fstp qword [ebp - 0x10]
push 0
push dword [ebp - 0x2c]
fild qword [esp]
fdivr qword [ebp - 0x10]
pop eax
pop eax
fstp qword [ebp - 0x10]
wait
push dword [ebp - 0xc]
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push dword [ebp - 0x2c]
push 0x40183d
call dword [sym.imp.msvcrt.dll_printf]
add esp, 0x14
mov eax, dword [ebp - 0x2c]
cmp dword [ebp - 0x14], eax
jbe 0x4015fa
push 0x401859
call dword [sym.imp.msvcrt.dll_printf]
add esp, 4
leave
ret
mov eax, dword [ebp - 0x14]
mov esi, dword [0x401404]
add esi, 0x10
mov dword [esi], eax
mov eax, dword [ebp - 0x34]
add eax, dword [ebp - 0x14]
add eax, 0x1000
mov esi, dword [0x401404]
add esi, 0x14
mov dword [esi], eax
mov esi, dword [0x401404]
add esi, 0x18
mov dword [esi], eax
mov eax, dword [ebp - 0x34]
mov esi, dword [0x401404]
add esi, 0x20
mov dword [esi], eax
mov esi, dword [ebp - 0x28]
add esi, 0x1c
cmp dword [esi], 0
je 0x401653
mov eax, dword [ebp - 0x34]
add eax, dword [ebp - 0x14]
mov esi, dword [0x401404]
add esi, 0x1c
mov dword [esi], eax
mov eax, dword [ebp - 0x1c]
mov esi, dword [0x401404]
add esi, 0x24
mov dword [esi], eax
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x20], eax
cmp eax, 0xffffffff
je 0x4016bc
push 0
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 8]
push dword [0x401404]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x1c]
push dword [ebp - 0x24]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4016ca
push 0x401870
call dword [sym.imp.msvcrt.dll_printf]
add esp, 4
push dword [ebp - 0x28]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
leave
ret