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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffd8
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0x15], ecx
mov byte [ebp - 0xd], dl
mov dword [ebp - 0xc], eax
xor eax, eax
push ebp
push 0x160913
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 0x15]
xor ecx, ecx
mov edx, 0x18
call fcn.0001487c
mov eax, dword [ebp - 0x15]
mov byte [eax], 0
mov eax, dword [ebp - 0x15]
xor edx, edx
mov dword [eax + 4], edx
cmp dword [ebp + 0xc], 0
jne 0x160563
cmp dword [ebp + 8], 0
ja 0x160574
mov eax, dword [ebp - 0x15]
mov dword [eax + 4], 4
jmp 0x1608ef
movzx eax, byte [ebp - 0xd]
sub al, 2
jb 0x16058b
mov eax, dword [ebp - 0x15]
mov dword [eax + 4], 5
jmp 0x1608ef
mov eax, dword [ebp - 0xc]
cmp dword [eax + 0x18], 0
ja 0x1605a3
mov eax, dword [ebp - 0x15]
mov dword [eax + 4], 7
jmp 0x1608ef
xor eax, eax
mov dword [ebp - 0x24], eax
xor ebx, ebx
xor eax, eax
mov dword [ebp - 0x20], eax
xor eax, eax
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0xc]
mov esi, dword [eax + 0x18]
mov eax, esi
xor edx, edx
cmp edx, dword [ebp + 0xc]
jne 0x1605c6
cmp eax, dword [ebp + 8]
jae 0x1605e1
push esi
lea eax, [ebp - 8]
mov ecx, 1
mov edx, dword [0x1e530]
call fcn.00018878
add esp, 4
jmp 0x1605fb
mov eax, dword [ebp + 8]
push eax
lea eax, [ebp - 8]
mov ecx, 1
mov edx, dword [0x1e530]
call fcn.00018878
add esp, 4
mov eax, dword [ebp - 8]
call fcn.000186b8
mov esi, eax
test esi, esi
jb 0x160622
inc esi
xor edi, edi
mov edx, 0xff
xor eax, eax
call fcn.0001e3b0
mov edx, dword [ebp - 8]
mov byte [edx + edi], al
inc edi
dec esi
jne 0x16060c
lea edx, [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.00160134
mov eax, dword [ebp - 4]
call fcn.000248ec
test al, al
je 0x160648
mov eax, dword [ebp - 0x15]
mov dword [eax + 4], 6
jmp 0x1608ef
movzx eax, byte [ebp - 0xd]
sub al, 1
jb 0x160654
je 0x160680
jmp 0x160687
push dword [ebp + 0xc]
push dword [ebp + 8]
mov eax, dword [ebp - 0x15]
add eax, 4
push eax
lea ecx, [ebp - 8]
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0xc]
call fcn.00160924
test al, al
je 0x1608ef
mov dword [ebp - 0x28], 3
jmp 0x160687
mov dword [ebp - 0x28], 2
xor edx, edx
push ebp
push 0x1608e8
push dword fs:[edx]
mov dword fs:[edx], esp
mov dl, 1
mov eax, dword [0x15e69c]
call fcn.0015ed58
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x24]
call fcn.0015f0b4
push 0
push 0x20000000
mov eax, dword [ebp - 0x28]
push eax
push 0
push 2
push 0xc0000000
mov eax, dword [ebp - 4]
call fcn.00016ce8
push eax
call sub.kernel32.dll_CreateFileW
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x1606eb
mov eax, dword [ebp - 0x15]
mov dword [eax + 4], 0xb
call fcn.00015adc
jmp 0x1608ef
xor edx, edx
push ebp
push 0x16087e
push dword fs:[edx]
mov dword fs:[edx], esp
movzx eax, byte [ebp - 0xd]
sub al, 1
jb 0x16070c
je 0x1607b9
jmp 0x160861
mov eax, dword [ebp - 8]
call fcn.000186b0
cdq
push edx
push eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
push edx
push eax
mov eax, ebx
xor edx, edx
sub dword [esp], eax
sbb dword [esp + 4], edx
pop eax
pop edx
cmp edx, dword [esp + 4]
jne 0x160735
cmp eax, dword [esp]
pop edx
pop eax
jbe 0x160745
mov eax, dword [ebp - 8]
call fcn.000186b0
mov esi, eax
jmp 0x16074a
mov esi, dword [ebp + 8]
sub esi, ebx
push 0
lea eax, [ebp - 0x20]
push eax
push esi
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 0x1c]
push eax
call sub.kernel32.dll_ReadFile
cmp eax, 1
sbb eax, eax
inc eax
test al, al
jne 0x160781
mov eax, dword [ebp - 0x15]
mov dword [eax + 4], 1
call fcn.00015adc
call fcn.00015adc
jmp 0x1608ef
cmp esi, dword [ebp - 0x20]
je 0x16079f
mov eax, dword [ebp - 0x15]
mov dword [eax + 4], 2
call fcn.00015adc
call fcn.00015adc
jmp 0x1608ef
add ebx, dword [ebp - 0x20]
mov eax, ebx
xor edx, edx
cmp edx, dword [ebp + 0xc]
jne 0x1607ae
cmp eax, dword [ebp + 8]
jb 0x16070c
jmp 0x160861
mov eax, dword [ebp - 8]
call fcn.000186b0
cdq
push edx
push eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
push edx
push eax
mov eax, ebx
xor edx, edx
sub dword [esp], eax
sbb dword [esp + 4], edx
pop eax
pop edx
cmp edx, dword [esp + 4]
jne 0x1607e2
cmp eax, dword [esp]
pop edx
pop eax
jbe 0x1607f2
mov eax, dword [ebp - 8]
call fcn.000186b0
mov esi, eax
jmp 0x1607f7
mov esi, dword [ebp + 8]
sub esi, ebx
push 0
lea eax, [ebp - 0x20]
push eax
push esi
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 0x1c]
push eax
call sub.kernel32.dll_WriteFile_1
cmp eax, 1
sbb eax, eax
inc eax
test al, al
jne 0x16082e
mov eax, dword [ebp - 0x15]
mov dword [eax + 4], 1
call fcn.00015adc
call fcn.00015adc
jmp 0x1608ef
cmp esi, dword [ebp - 0x20]
je 0x16084c
mov eax, dword [ebp - 0x15]
mov dword [eax + 4], 2
call fcn.00015adc
call fcn.00015adc
jmp 0x1608ef
add ebx, dword [ebp - 0x20]
mov eax, ebx
xor edx, edx
cmp edx, dword [ebp + 0xc]
jne 0x16085b
cmp eax, dword [ebp + 8]
jb 0x1607b9
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x160885
cmp dword [ebp - 0x1c], 0xffffffff
je 0x16087d
mov eax, dword [ebp - 0x1c]
push eax
call sub.kernel32.dll_CloseHandle_1
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x16091a
lea eax, [ebp - 8]
mov edx, dword [0x1e530]
call fcn.00018998
lea eax, [ebp - 4]
call fcn.00016c4c
ret