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

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4ac
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x80000000
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.KERNEL32.DLL_CreateFileA
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
sete dl
test eax, eax
sete al
mov ecx, 0
or dl, al
jne 0x40869e
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0x40000000
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sub.KERNEL32.DLL_CreateFileA
sub esp, 0x1c
mov dword [ebp - 0x494], eax
cmp eax, 0xffffffff
sete dl
test eax, eax
sete al
or dl, al
je 0x408368
mov dword [esp], esi
call sub.KERNEL32.DLL_CloseHandle
sub esp, 4
mov ecx, 0
jmp 0x40869e
lea edi, [ebp - 0x38]
cld
mov eax, 0
mov ecx, 7
rep stosd dword es:[edi], eax
mov word [edi], 0
lea edi, [ebp - 0x88]
mov ecx, 0xb
rep stosd dword es:[edi], eax
mov word [edi], 0
lea edi, [ebp - 0x58]
mov ecx, 5
rep stosd dword es:[edi], eax
mov word [edi], 0
mov dword [ebp - 0x38], 0x4034b50
mov word [ebp - 0x34], 0xa
mov word [ebp - 0x82], 0xa
mov word [ebp - 0x32], 0
mov word [ebp - 0x80], 0
mov word [ebp - 0x30], 0
mov word [ebp - 0x7e], 0
lea ebx, [ebp - 0x38]
lea eax, [ebp - 0x2c]
mov dword [esp + 4], eax
lea eax, [ebp - 0x2e]
mov dword [esp], eax
call fcn.0040814c
movzx eax, word [ebp - 0x2e]
mov word [ebp - 0x7c], ax
mov eax, dword [ebp - 0x2c]
mov word [ebp - 0x7a], ax
mov dword [esp], esi
call fcn.004081d8
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x78], eax
mov dword [esp + 4], 0
mov dword [esp], esi
call sub.KERNEL32.DLL_GetFileSize
sub esp, 8
mov dword [ebp - 0x26], eax
mov dword [ebp - 0x74], eax
mov dword [esp + 4], 0
mov dword [esp], esi
call sub.KERNEL32.DLL_GetFileSize
sub esp, 8
mov dword [ebp - 0x22], eax
mov dword [ebp - 0x70], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.KERNEL32.DLL_lstrlenA
sub esp, 4
mov word [ebp - 0x1e], ax
mov word [ebp - 0x6c], ax
mov word [ebp - 0x1c], 0
mov word [ebp - 0x6a], 0
mov dword [ebp - 0x5e], 0
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x48c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x1e
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x494]
mov dword [esp], eax
call sub.KERNEL32.DLL_WriteFile
sub esp, 0x14
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.KERNEL32.DLL_lstrlenA
sub esp, 4
mov dword [esp + 0x10], 0
lea edx, [ebp - 0x48c]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x494]
mov dword [esp], eax
call sub.KERNEL32.DLL_WriteFile
sub esp, 0x14
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.KERNEL32.DLL_lstrlenA
sub esp, 4
lea ebx, [eax + 0x1e]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], esi
call sub.KERNEL32.DLL_SetFilePointer
sub esp, 0x10
lea edi, [ebp - 0x488]
mov dword [ebp - 0x48c], 0
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x48c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x400
mov dword [esp + 4], edi
mov dword [esp], esi
call sub.KERNEL32.DLL_ReadFile
sub esp, 0x14
test eax, eax
je 0x408577
cmp dword [ebp - 0x48c], 0
je 0x408577
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x490]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x48c]
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov eax, dword [ebp - 0x494]
mov dword [esp], eax
call sub.KERNEL32.DLL_WriteFile
sub esp, 0x14
add ebx, dword [ebp - 0x48c]
jmp 0x4084fe
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x88], 0x2014b50
mov word [ebp - 0x84], 0x14
mov word [ebp - 0x64], 0
mov dword [ebp - 0x62], 0x20
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x48c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x2e
lea eax, [ebp - 0x88]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x494]
mov dword [esp], eax
call sub.KERNEL32.DLL_WriteFile
sub esp, 0x14
add ebx, 0x2e
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.KERNEL32.DLL_lstrlenA
sub esp, 4
mov dword [esp + 0x10], 0
lea edx, [ebp - 0x48c]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x494]
mov dword [esp], eax
call sub.KERNEL32.DLL_WriteFile
sub esp, 0x14
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.KERNEL32.DLL_lstrlenA
sub esp, 4
add ebx, eax
mov dword [ebp - 0x58], 0x6054b50
mov word [ebp - 0x54], 0
mov word [ebp - 0x52], 0
mov word [ebp - 0x50], 1
mov word [ebp - 0x4e], 1
mov eax, ebx
sub eax, dword [ebp - 0x48]
mov dword [ebp - 0x4c], eax
mov word [ebp - 0x44], 0
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x48c]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x16
lea eax, [ebp - 0x58]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x494]
mov dword [esp], eax
call sub.KERNEL32.DLL_WriteFile
sub esp, 0x14
mov eax, dword [ebp - 0x494]
mov dword [esp], eax
call sub.KERNEL32.DLL_CloseHandle
sub esp, 4
mov dword [esp], esi
call sub.KERNEL32.DLL_CloseHandle
sub esp, 4
mov ecx, 1
mov eax, ecx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret