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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x210
push edi
lea edx, [ebp - 0x104]
push 0x104
push edx
push dword [section.data]
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
lea edx, [ebp - 0x104]
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push edx
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
cmp eax, 0xffffffff
je 0x40188d
mov dword [0x40312c], eax
push 0
push 0
push 3
push 0
push 1
push 0xc0000000
push 0x403190
call dword [sym.imp.KERNEL32.DLL_CreateFileA]
cmp eax, 0xffffffff
je 0x401897
mov dword [0x403130], eax
test word [0x403126], 1
je 0x4015fb
xor edi, edi
push 0
push dword [0x403130]
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov dword [ebp - 0x20c], eax
push 1
push 0
push 0
push dword [0x403130]
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
imul eax, eax, 0x64
xor edx, edx
div dword [ebp - 0x20c]
lea edx, [ebp - 0x208]
push eax
push 0x402202
push edx
call dword [sym.imp.user32.dll_wsprintfA]
add esp, 0xc
lea edx, [ebp - 0x208]
push edx
push 0x6d
push dword [ebp + 8]
call dword [sym.imp.user32.dll_SetDlgItemTextA]
push dword [ebp + 8]
call dword [sym.imp.user32.dll_UpdateWindow]
lea edx, [ebp - 0x108]
push 0
push edx
push 0x10000
push 0x403390
push dword [0x403130]
call dword [sym.imp.KERNEL32.DLL_ReadFile]
cmp dword [ebp - 0x108], 0
je 0x401560
push dword [ebp - 0x108]
push 0x403390
push edi
call fcn.004018f8
mov edi, eax
jmp 0x4014ba
lea edx, [ebp - 0x208]
push 0x64
push 0x402202
push edx
call dword [sym.imp.user32.dll_wsprintfA]
add esp, 0xc
lea edx, [ebp - 0x208]
push edx
push 0x6d
push dword [ebp + 8]
call dword [sym.imp.user32.dll_SetDlgItemTextA]
push dword [ebp + 8]
call dword [sym.imp.user32.dll_UpdateWindow]
cmp edi, dword [0x403128]
je 0x4015fb
push 0x1004
push 0x402108
push 0x402121
push dword [ebp + 8]
call dword [sym.imp.user32.dll_MessageBoxA]
cmp eax, 6
je 0x4015fb
push 0x402101
push 0x6d
push dword [ebp + 8]
call dword [sym.imp.user32.dll_SetDlgItemTextA]
push dword [ebp + 8]
call dword [sym.imp.user32.dll_UpdateWindow]
push dword [0x40312c]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push dword [0x403130]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
jmp 0x401888
mov eax, dword [0x403120]
add eax, 0x12c
sub eax, 5
neg eax
mov dword [0x403188], 0
mov dword [0x40318c], 0
push 2
push 0
push eax
push dword [0x40312c]
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
mov dword [ebp - 0x210], eax
push 1
push 0
push 0
push dword [0x40312c]
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
sub eax, dword [ebp - 0x210]
imul eax, eax, 0x64
xor edx, edx
div dword [0x403120]
lea edx, [ebp - 0x208]
push eax
push 0x402087
push edx
call dword [sym.imp.user32.dll_wsprintfA]
add esp, 0xc
lea edx, [ebp - 0x208]
push edx
push 0x6d
push dword [ebp + 8]
call dword [sym.imp.user32.dll_SetDlgItemTextA]
push dword [ebp + 8]
call dword [sym.imp.user32.dll_UpdateWindow]
lea edx, [ebp - 0x108]
push 0
push edx
push 3
push 0x403188
push dword [0x40312c]
call dword [sym.imp.KERNEL32.DLL_ReadFile]
cmp dword [ebp - 0x108], 0
je 0x401854
mov eax, dword [0x403188]
mov byte [0x40318a], al
shr eax, 0x10
mov byte [0x403188], al
cmp dword [0x403188], 0x454f46
je 0x401854
push 0
push 0
push dword [0x403188]
push dword [0x403130]
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
lea edx, [ebp - 0x108]
push 0
push edx
push 2
push 0x40318c
push dword [0x40312c]
call dword [sym.imp.KERNEL32.DLL_ReadFile]
cmp dword [ebp - 0x108], 0
je 0x401854
mov ax, word [0x40318c]
xchg al, ah
mov word [0x40318c], ax
test ax, ax
jne 0x4017e9
lea edx, [ebp - 0x108]
push 0
push edx
push 2
push 0x40318c
push dword [0x40312c]
call dword [sym.imp.KERNEL32.DLL_ReadFile]
cmp dword [ebp - 0x108], 0
je 0x401854
lea edx, [ebp - 0x108]
push 0
push edx
push 1
push 0x403390
push dword [0x40312c]
call dword [sym.imp.KERNEL32.DLL_ReadFile]
cmp dword [ebp - 0x108], 0
je 0x401854
mov al, byte [0x403390]
xor ecx, ecx
mov cx, word [0x40318c]
xchg cl, ch
mov word [0x40318c], cx
push es
push ds
pop es
lea edi, [0x403390]
cld
rep stosb byte es:[edi], al
pop es
jmp 0x40181c
lea edx, [ebp - 0x108]
push 0
push edx
push dword [0x40318c]
push 0x403390
push dword [0x40312c]
call dword [sym.imp.KERNEL32.DLL_ReadFile]
cmp dword [ebp - 0x108], 0
je 0x401854
lea edx, [ebp - 0x108]
push 0
push edx
push dword [0x40318c]
push 0x403390
push dword [0x403130]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
cmp dword [ebp - 0x108], 0
je 0x401854
jmp 0x40163d
push dword [0x40312c]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push dword [0x403130]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push 0x4020e6
push 0x6d
push dword [ebp + 8]
call dword [sym.imp.user32.dll_SetDlgItemTextA]
push dword [ebp + 8]
call dword [sym.imp.user32.dll_UpdateWindow]
pop edi
leave
ret 4
push 0x4020c0
jmp 0x4018a8
push dword [0x40312c]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push 0x40209d
push 0x6d
push dword [ebp + 8]
call dword [sym.imp.user32.dll_SetDlgItemTextA]
push dword [ebp + 8]
call dword [sym.imp.user32.dll_UpdateWindow]
jmp 0x401888