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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x90c
push ebx
mov ebx, ecx
push esi
push edi
mov edi, dword [ebx + 0x4c]
xor esi, esi
cmp edi, esi
mov dword [ebp - 0x14], ebx
je 0x100032eb
cmp dword [ebx + 0x54], esi
je 0x100032eb
lea eax, [edi + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, 0xa
cmp eax, 0x3e8
jae 0x100032eb
mov eax, dword [ebx + 0x60]
cmp eax, esi
je 0x100032eb
push esi
push 0x8000080
push 2
push esi
push esi
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x1c], eax
je 0x100032e5
mov eax, dword [edi + 0x3f8]
mov dword [ebp - 4], 1
cmp eax, esi
mov dword [ebp - 0xc], esi
jle 0x100032c3
cmp dword [ebp - 4], esi
je 0x100032c3
cmp eax, 1
lea ecx, [edi + 0x10]
jle 0x100031e3
push dword [ebp - 0xc]
lea eax, [ebp - 0x50c]
push ecx
push str._s__d
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea ecx, [ebp - 0x50c]
lea eax, [ebp - 0x124]
push 0x104
push eax
push esi
push esi
push 0xffffffffffffffff
push esi
push ecx
lea ecx, [ebx + 8]
call fcn.10021ec0
test eax, eax
je 0x100032b8
push esi
push 0x8000000
push 3
push esi
push 1
lea eax, [ebp - 0x124]
push SysReAllocString
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x100032bd
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, esi
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x18], esi
jbe 0x1000329a
lea eax, [ebp - 8]
push esi
push eax
lea eax, [ebp - 0x90c]
push 0x400
push eax
push ebx
mov dword [ebp - 0x10], esi
mov dword [ebp - 8], esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10003297
cmp dword [ebp - 8], esi
je 0x10003297
lea eax, [ebp - 0x10]
push esi
push eax
lea eax, [ebp - 0x90c]
push dword [ebp - 8]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10003297
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x10]
jne 0x10003297
add dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x20]
jb 0x1000323f
jmp 0x1000329a
mov dword [ebp - 4], esi
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
inc dword [ebp - 0xc]
mov eax, dword [edi + 0x3f8]
cmp dword [ebp - 0xc], eax
mov ebx, dword [ebp - 0x14]
jl 0x100031b3
jmp 0x100032c3
mov dword [ebp - 4], esi
jmp 0x100032c3
mov ebx, dword [ebp - 0x14]
mov dword [ebp - 4], esi
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push dword [ebp - 0x1c]
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 4], esi
jne 0x100032f7
mov ecx, ebx
call fcn.1000351c
mov dword [edi], 0xffffff31
push esi
call dword [sym.imp.USER32.dll_PostQuitMessage]
pop edi
pop esi
pop ebx
leave
ret
mov eax, dword [edi + 0x3fc]
cmp eax, esi
je 0x10003315
cmp dword [ebp - 0x10], eax
je 0x10003315
mov ecx, ebx
call fcn.1000351c
mov dword [edi], 0xffffff30
jmp 0x100032eb
mov eax, dword [0x10043d90]
push esi
push esi
push eax
push esi
push dword [ebx + 0x60]
call fcn.1003871f
add esp, 0x14
mov ecx, ebx
test al, al
jne 0x1000333c
call fcn.1000351c
mov dword [edi], 0xffffff2f
jmp 0x100032eb
call fcn.10003343
jmp 0x100032f2