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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x264
mov eax, dword [0x41f608]
push ebx
push esi
push edi
mov dword [esp + 0x26c], eax
mov dword [esp + 0xc], ecx
xor eax, eax
mov word [esp + 0x58], 0x20
mov ecx, 0x40
lea edi, [esp + 0x5a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x104
lea eax, [esp + 0x5c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
lea ecx, [esp + 0x70]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40a77e
mov edx, dword [ebp + 8]
mov esi, dword [edx + 4]
push 0
push ebx
add esi, 0xd
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
push ebx
sub edi, esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov dword [esp + 0x45], eax
lea ecx, [esp + 0x44]
push ecx
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x4d], eax
push edi
lea edx, [esp + 0x60]
mov dword [esp + 0x55], eax
push edx
mov byte [esp + 0x50], 0
mov dword [esp + 0x5d], eax
call fcn.00408580
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
lea eax, [esp + 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40a77e
push 2
push 0
neg esi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov byte [esp + 0x160], 0
xor eax, eax
mov ecx, 0x40
lea edi, [esp + 0x161]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x58]
stosw word es:[edi], ax
push ecx
lea edx, [esp + 0x164]
push edx
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [esp + 0x160]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0
push 2
push 2
push 0
lea eax, [esp + eax + 0x170]
push 1
push 0x40000000
lea ecx, [esp + 0x178]
push ecx
mov byte [eax - 4], 0x20
mov byte [eax - 3], 0x2e
mov byte [eax - 2], 0x65
mov byte [eax - 1], 0x78
mov byte [eax], 0x65
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40a795
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
mov ecx, dword [esp + 0x26c]
call fcn.0040e486
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [ebp + 8]
mov edi, dword [ecx]
xor edx, edx
xor eax, eax
mov dword [esp + 0x1d], edx
mov dword [esp + 0x31], eax
mov dword [esp + 0x21], edx
mov dword [esp + 0x25], edx
mov dword [esp + 0x35], eax
mov dword [esp + 0x39], eax
push eax
mov dword [esp + 0x2d], edx
mov byte [esp + 0x34], dl
lea edx, [esp + 0x18]
push edx
mov dword [esp + 0x45], eax
push 0x10
lea eax, [esp + 0x28]
push eax
push ebx
mov byte [esp + 0x30], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0x10
lea ecx, [esp + 0x48]
push ecx
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x38]
push edx
lea eax, [esp + 0x28]
push eax
call fcn.0040a540
cmp edi, 0x10
jbe 0x40a852
lea eax, [edi - 0x11]
shr eax, 4
inc eax
mov dword [esp + 0x10], eax
push 0
lea ecx, [esp + 0x1c]
push ecx
push 0x10
lea edx, [esp + 0x3c]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [esp + 0x18]
push eax
push 0x10
lea ecx, [esp + 0x28]
push ecx
push ebx
sub edi, 0x10
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0x10
lea edx, [esp + 0x48]
push edx
lea eax, [esp + 0x38]
push eax
lea ecx, [esp + 0x28]
push ecx
mov ecx, dword [esp + 0x1c]
call fcn.0040a540
dec dword [esp + 0x10]
jne 0x40a805
push 0
lea edx, [esp + 0x1c]
push edx
push edi
lea eax, [esp + 0x3c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call edi
push esi
call edi
mov ecx, dword [esp + 0x26c]
call fcn.0040e486
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4