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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x874
mov ecx, dword [ebp + 0x18]
mov eax, dword [0x101348c]
push ebx
push esi
mov esi, dword [ebp + 0x14]
xor ebx, ebx
mov dword [ebp - 0x874], ecx
xor ecx, ecx
cmp dword [0x1034874], ebx
push edi
push 2
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
setne cl
push ebx
mov dword [ebp - 0x864], eax
mov eax, dword [ebp + 0x10]
push ebx
push eax
mov dword [ebp - 0x870], eax
mov dword [ebp - 0x868], ecx
mov dword [ebp - 0x860], ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [0x1033928], ebx
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 0x85c], ebx
mov dword [ebp - 0x858], ebx
jbe 0x1005601
mov dword [ebp - 0x850], esi
jmp 0x10053f6
mov esi, dword [ebp - 0x850]
push ebx
push ebx
push dword [esi + 0x1c]
push dword [ebp - 0x864]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
movzx eax, word [esi + 0x1a]
shl eax, 1
shr eax, 1
movzx esi, ax
push ebx
mov dword [ebp - 0x86c], eax
lea eax, [ebp - 0x854]
push eax
shl esi, 1
push esi
lea eax, [ebp - 0x84c]
push eax
push dword [ebp - 0x864]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x850]
lea eax, [ebp - 0x30]
push eax
mov word [ebp + esi - 0x84c], bx
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push dword [ebp - 0x850]
call edi
cmp word [ebp - 0x86c], 1
jne 0x10054c3
lea eax, [ebp - 0x84c]
push eax
call fcn.0100bd2b
cmp eax, ebx
jl 0x10054c3
cmp eax, 0x6f70
jae 0x10054c3
mov ecx, dword [ebp - 0x874]
lea eax, [eax + eax*2]
lea eax, [ecx + eax*8]
push eax
push 0xc
lea eax, [ebp - 0x4c]
push eax
call fcn.0100b7db
lea eax, [ebp - 0x4c]
push eax
mov word [ebp - 0x34], bx
call edi
test eax, eax
je 0x10054c3
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x84c]
push eax
lea eax, [ebp - 0x44c]
push 0x10013cc
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x14
jmp 0x10054e3
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x84c]
push eax
lea eax, [ebp - 0x44c]
push 0x10013bc
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push ebx
lea eax, [ebp - 0x854]
push eax
lea eax, [ebp - 0x44c]
push eax
call edi
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
shl eax, 1
push eax
lea eax, [ebp - 0x44c]
push eax
push dword [ebp - 0x870]
call esi
cmp dword [ebp - 0x868], ebx
je 0x10055e2
mov eax, dword [0x1033928]
dec eax
cmp dword [ebp - 0x858], eax
je 0x1005591
mov eax, dword [ebp - 0x850]
lea ecx, [eax + 0x20]
push ecx
push eax
call fcn.0100e299
test eax, eax
pop ecx
pop ecx
jne 0x1005591
lea eax, [ebp - 0x84c]
push eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x44c]
push 0x10013bc
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push ebx
lea eax, [ebp - 0x854]
push eax
lea eax, [ebp - 0x44c]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x44c]
push eax
push dword [0x1034874]
call esi
inc dword [ebp - 0x85c]
mov dword [ebp - 0x860], 1
jmp 0x10055e2
cmp dword [ebp - 0x860], ebx
je 0x10055dc
lea eax, [ebp - 0x84c]
push eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x44c]
push 0x10013bc
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push ebx
lea eax, [ebp - 0x854]
push eax
lea eax, [ebp - 0x44c]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x44c]
push eax
push dword [0x1034874]
call esi
mov dword [ebp - 0x860], ebx
inc dword [ebp - 0x858]
mov eax, dword [ebp - 0x858]
add dword [ebp - 0x850], 0x20
cmp eax, dword [0x1033928]
jb 0x10053f0
cmp dword [ebp - 0x868], ebx
je 0x100567d
push dword [ebp - 0x85c]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x44c]
push 0x10013a8
push eax
mov word [ebp - 0x14], 0x5171
mov word [ebp - 0x12], 0x8ba1
mov word [ebp - 0x10], 0x91cd
mov word [ebp - 0xe], 0x7801
mov word [ebp - 0xc], 0x8bcd
mov word [ebp - 0xa], 0x6761
mov word [ebp - 8], 0x6570
mov word [ebp - 6], bx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
push ebx
lea eax, [ebp - 0x854]
push eax
lea eax, [ebp - 0x44c]
push eax
call edi
shl eax, 1
push eax
lea eax, [ebp - 0x44c]
push eax
push dword [0x1034874]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 4]
pop edi
xor eax, eax
pop esi
inc eax
pop ebx
call fcn.0100dd00
leave
ret 0x14