Function at 0x405fc6
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x978
push ebx
lea eax, [ebp - 0x178]
xor ebx, ebx
push 0x104
push eax
push ebx
mov dword [ebp - 0x14], ebx
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
test eax, eax
je 0x4061bb
push esi
push edi
mov esi, dword [sym.imp.KERNEL32.DLL_CreateFileA]
mov edi, 0x80
push ebx
push edi
push 3
push ebx
push 1
lea eax, [ebp - 0x178]
push bind
push eax
call esi
cmp eax, 0xffffffff
mov dword [ebp - 0x10], eax
je 0x4061b6
push ebx
push edi
push 2
push ebx
push ebx
push 0x40000000
push dword [ebp + 8]
call esi
cmp eax, 0xffffffff
mov dword [ebp - 8], eax
je 0x4061ad
or dword [ebp - 0x24], 0xffffffff
mov esi, dword [sym.imp.KERNEL32.DLL_ReadFile]
lea eax, [ebp - 4]
push ebx
push eax
mov edi, 0x800
lea eax, [ebp - 0x978]
push edi
push eax
mov dword [ebp - 0x20], ebx
push dword [ebp - 0x10]
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp + 8], ebx
call esi
test eax, eax
je 0x4061a4
cmp dword [ebp - 4], ebx
je 0x406128
mov dword [ebp - 0xc], ebx
jbe 0x4060e4
mov eax, dword [ebp - 0x20]
lea ecx, [ebp - 0x978]
sub eax, ecx
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp + 8]
lea ecx, [ebp + eax - 0x978]
mov al, byte [ebp + eax - 0x978]
cmp byte [edx + 0x40d8d0], al
je 0x4060b7
cmp dword [ebp + 8], ebx
je 0x4060d9
cmp byte [0x40d8d0], al
mov dword [ebp + 8], ebx
jne 0x4060a7
cmp dword [ebp + 8], ebx
jne 0x4060c4
mov eax, dword [ebp - 0x2c]
add eax, ecx
mov dword [ebp - 0x28], eax
inc dword [ebp + 8]
cmp dword [ebp + 8], 0x14
jb 0x4060d9
mov eax, dword [ebp - 0x28]
inc dword [ebp - 0x1c]
mov dword [ebp - 0x24], eax
mov dword [ebp + 8], ebx
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 4]
jb 0x40608b
lea eax, [ebp - 0x18]
push ebx
push eax
lea eax, [ebp - 0x978]
push dword [ebp - 4]
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x4061a4
mov eax, dword [ebp - 4]
cmp dword [ebp - 0x18], eax
jne 0x4061a4
add dword [ebp - 0x20], eax
lea eax, [ebp - 4]
push ebx
push eax
lea eax, [ebp - 0x978]
push edi
push eax
push dword [ebp - 0x10]
jmp 0x406065
push 0x14
lea eax, [ebp - 0x40]
push 0x40d8d0
push eax
mov dword [ebp - 0x14], ebx
call sub.MSVCRT.dll_memcpy
or dword [ebp - 0x38], 2
add esp, 0xc
push 1
pop esi
cmp dword [ebp - 0x1c], esi
jne 0x4061a4
push ebx
push ebx
push dword [ebp - 0x24]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.DLL_SetFilePointer]
cmp eax, 0xffffffff
je 0x4061a4
lea eax, [ebp - 0x18]
push ebx
push eax
lea eax, [ebp - 0x40]
push 0x14
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x4061a4
cmp dword [ebp - 0x18], 0x14
jne 0x4061a4
lea eax, [ebp - 0x74]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.DLL_GetFileInformationByHandle]
test eax, eax
je 0x4061a1
lea eax, [ebp - 0x60]
push eax
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp - 0x70]
push eax
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.DLL_SetFileTime]
mov dword [ebp - 0x14], esi
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov eax, dword [ebp - 0x14]
pop edi
pop esi
pop ebx
leave
ret