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

Disassembly:
sub esp, 0x814
push ebx
push ebp
push esi
mov esi, dword [esp + 0x828]
mov ebp, 0xa
push edi
test byte [esi + 0x4ee1], 0x40
mov eax, dword [esi + 0xa2]
mov dword [esp + 0x10], ebp
je 0x1000c90f
cmp eax, 0xffffffff
je 0x1000c8fe
mov ecx, dword [esp + 0x828]
xor ebx, ebx
cmp ecx, ebx
je 0x1000c8fe
cmp dword [ecx], 0xffffffff
je 0x1000c8fe
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
je 0x1000c8fe
mov eax, dword [esi + 0xa2]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x1000c8fe
mov eax, dword [esi + 0x8ae]
mov dword [esp + 0x10], ebx
cmp eax, ebx
jne 0x1000c81f
test byte [esi + 0x4ee1], 0x10
je 0x1000c7f3
cmp dword [esi + 0x4ee2], ebx
jbe 0x1000c81f
lea ecx, [esi + 0xa6]
lea edx, [esp + 0x24]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov ecx, dword [esi + 0x4ee2]
lea eax, [esp + 0x24]
push esi
push eax
inc ecx
push ebx
push ecx
push ebx
push 0xe
call fcn.1000c200
add esp, 0x18
mov edx, dword [esi + 0x8aa]
mov ecx, dword [esi + 0x4ee2]
inc edx
lea edi, [esi + 0xa6]
inc ecx
push 0x2e
push edi
mov dword [esi + 0x8aa], edx
mov dword [esi + 0x4ee2], ecx
call fcn.1000b410
cmp eax, ebx
je 0x1000c8fe
mov ecx, dword [esi + 0x4ee2]
inc eax
inc ecx
cmp ecx, 0x64
push ecx
jae 0x1000c864
push str.z_02d
jmp 0x1000c869
push 0x100429c8
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push ebx
push 0x8000080
push 2
push ebx
push ebx
push 0xc0000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi + 0xa2], eax
jne 0x1000c898
mov dword [esp + 0x10], ebp
mov eax, dword [esi + 0x4f0e]
mov dword [esi + 0x4ea8], ebx
mov dword [esi + 0x4efe], ebx
cmp eax, ebx
mov dword [esi + 0x4eac], ebx
mov dword [esi + 0x4f02], ebx
je 0x1000c8d9
mov eax, dword [esp + 0x10]
mov dword [esi + 0x8b2], 0x200000
mov dword [esi + 0x8b6], ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x814
ret
push esi
push edi
call fcn.1000aad0
add esp, 8
mov dword [esi + 0x8b2], eax
mov eax, dword [esp + 0x10]
mov dword [esi + 0x8b6], edx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x814
ret
pop edi
mov dword [esp + 0xc], ebp
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x814
ret
cmp eax, 0xffffffff
je 0x1000cad4
mov ecx, dword [esp + 0x828]
test ecx, ecx
je 0x1000cad4
cmp dword [ecx], 0xffffffff
je 0x1000cad4
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
je 0x1000cad4
mov edx, dword [esi + 0xa2]
push 2
push 0
push 0
push edx
call fcn.1000ddf0
mov ebx, edx
add esp, 0x10
test ebx, ebx
mov dword [esp + 0x14], eax
jg 0x1000c96e
jl 0x1000c964
test eax, eax
jae 0x1000c96e
mov dword [esp + 0x14], 0
xor ebx, ebx
mov eax, dword [esi + 0xa2]
push 0
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
test eax, eax
jne 0x1000ca95
push 0x7800
mov dword [esp + 0x14], eax
call sub.api_ms_win_crt_heap_l1_1_0.dll_malloc
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x1000c9a8
mov dword [esp + 0x10], 4
mov ecx, dword [esi + 0x4e7c]
push esi
push ecx
call fcn.1000aad0
add esp, 8
cmp edx, ebx
jl 0x1000ca6b
jg 0x1000c9cc
cmp eax, dword [esp + 0x14]
jb 0x1000ca6b
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x1000ca73
test ebx, ebx
jl 0x1000ca73
jg 0x1000c9ee
mov eax, dword [esp + 0x14]
test eax, eax
jbe 0x1000ca73
push esi
call fcn.10003050
add esp, 4
test eax, eax
jne 0x1000ca61
lea edx, [esp + 0x20]
push eax
mov eax, dword [esi + 0xa2]
push edx
push 0x7800
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1000ca6b
mov eax, dword [esp + 0x20]
test eax, eax
mov edi, eax
jne 0x1000ca2a
mov dword [esp + 0x14], eax
xor ebx, ebx
jmp 0x1000c9d8
mov edx, dword [esp + 0x828]
lea ecx, [esp + 0x1c]
push 0
push ecx
push eax
mov eax, dword [edx]
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1000ca6b
cmp dword [esp + 0x1c], edi
jne 0x1000ca6b
mov ecx, dword [esp + 0x14]
mov eax, edi
cdq
sub ecx, eax
mov dword [esp + 0x14], ecx
sbb ebx, edx
jmp 0x1000c9d8
mov dword [esp + 0x10], 9
jmp 0x1000ca73
mov dword [esp + 0x10], 0xa
mov ecx, dword [esp + 0x828]
mov edx, dword [ecx]
push edx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test ebp, ebp
je 0x1000ca90
push ebp
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
add esp, 4
mov ebp, 0xa
mov eax, dword [esi + 0xa2]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x1000cad0
push 0
push 0x8000080
push 2
push 0
push 0
lea ecx, [esi + 0xa6]
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi + 0xa2], eax
jne 0x1000cad4
mov dword [esp + 0x10], ebp
mov edx, dword [esi + 0x4e7c]
push esi
push edx
call fcn.1000aad0
add esp, 8
test edx, edx
jg 0x1000cb11
jl 0x1000caee
test eax, eax
ja 0x1000cb11
mov eax, dword [esp + 0x828]
push esi
push 0xffffffffffffffff
push 0xffffffffffffffff
push eax
push 0
call fcn.1000bdd0
add esp, 0x14
test eax, eax
je 0x1000cb11
mov dword [esp + 0x10], 9
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x814
ret