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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x608c1c
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x6b000c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, ecx
mov dword [ebp - 0x18], eax
cmp dword [ebp + 0x14], 4
mov dword [eax + 0xc], 0
jne 0x50f124
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x50f45a
push 0x428
call fcn.00560437
add esp, 4
mov dword [ebp + 0xc], eax
mov dword [ebp - 4], 0
mov ecx, eax
call fcn.00471970
mov ebx, eax
mov dword [ebp + 0x14], ebx
mov dword [ebp - 4], 0xffffffff
mov ecx, ebx
mov edi, dword [ebp + 0x10]
push dword [edi + 0x2c]
push dword [edi + 0x28]
push dword [esi + 4]
call fcn.00471d70
jmp 0x50f165
mov esi, dword [ebp + 8]
test esi, esi
je 0x50f45a
push 0x428
call fcn.00560437
add esp, 4
mov dword [ebp + 0xc], eax
mov dword [ebp - 4], 1
mov ecx, eax
call fcn.00471970
mov ebx, eax
mov dword [ebp + 0x14], eax
mov dword [ebp - 4], 0xffffffff
mov ecx, ebx
push dword [esi]
call fcn.00471cc0
mov edi, dword [ebp + 0x10]
movzx eax, al
test ebx, ebx
je 0x50f45a
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 4], 2
test eax, eax
je 0x50f433
call fcn.0040bf10
mov ecx, eax
test ecx, ecx
je 0x50f470
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp + 0xc], esi
mov byte [ebp - 4], 4
cmp byte [ebp + 0x20], 0
jne 0x50f230
push dword [ebp + 0x18]
mov edx, dword [edi]
lea ecx, [ebp + 8]
call fcn.004df5e0
add esp, 4
mov byte [ebp - 4], 5
lea edi, [esi - 0x10]
mov edx, dword [eax]
lea ecx, [edx - 0x10]
cmp ecx, edi
je 0x50f20f
cmp dword [edi + 0xc], 0
lea esi, [edi + 0xc]
jl 0x50f200
mov eax, dword [ecx]
cmp eax, dword [edi]
jne 0x50f200
call fcn.0040c950
mov dword [ebp + 0x18], eax
or ecx, 0xffffffff
lock xadd dword [esi], ecx
dec ecx
test ecx, ecx
jg 0x50f1f8
mov ecx, dword [edi]
push edi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp + 0x18]
lea esi, [eax + 0x10]
mov dword [ebp + 0xc], esi
jmp 0x50f20f
push dword [edx - 0xc]
lea ecx, [ebp + 0xc]
push edx
call fcn.0040c9d0
mov esi, dword [ebp + 0xc]
mov byte [ebp - 4], 4
or eax, 0xffffffff
mov edx, dword [ebp + 8]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x50f25c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x50f25c
mov edx, dword [ebp + 0x18]
test edx, edx
jne 0x50f23b
xor ecx, ecx
jmp 0x50f24f
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x50f240
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp + 0xc]
call fcn.0040c9d0
mov esi, dword [ebp + 0xc]
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x10], eax
cmp eax, 0xffffffff
jne 0x50f29a
cmp byte [ebp + 0x20], 0
je 0x50f293
mov ecx, dword [ebp - 0x18]
push 0
mov ecx, dword [ecx + 8]
call fcn.004dfbe0
add esp, 4
xor edi, edi
jmp 0x50f411
mov edi, dword [ebx + 0x84]
push edi
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], edi
call fcn.00560596
push edi
push 0
push eax
mov dword [ebp - 0x24], eax
call fcn.00588800
add esp, 0x10
mov byte [ebp - 4], 8
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x14], 0
mov dword [ebp + 0x18], 0
mov ecx, dword [eax + 0x14]
lea edx, [eax + 0x5c]
mov ebx, dword [eax + 0x10]
xor eax, eax
mov dword [ebp + 0x20], ecx
mov dword [ebp + 8], edx
cmp dword [edx - 4], 0
je 0x50f3f1
cmp dword [edx], 0
mov dword [ebp + 0x10], 0
jbe 0x50f3de
nop
mov eax, dword [ebp + 0x1c]
test eax, eax
je 0x50f310
cmp dword [eax], 0
jne 0x50f42f
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax + 0x84]
mov eax, dword [edx - 4]
mul ecx
imul ecx, dword [ebp + 0x10]
add eax, ecx
mov ecx, dword [ebp + 0x14]
adc edx, 0
cmp dword [ecx + 0x10], 0
je 0x50f376
mov ecx, dword [ecx + 0x18]
add ecx, eax
mov eax, dword [ebp + 0x14]
push 0
mov dword [ebp - 0x2c], ecx
mov eax, dword [eax + 0x1c]
adc eax, edx
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x28]
push eax
mov eax, dword [ebp + 0x14]
push ecx
push dword [eax + 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x50f376
push 0
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp + 0x14]
push edi
push dword [ebp - 0x24]
push dword [eax + 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x18]
jmp 0x50f378
xor eax, eax
cmp eax, edi
jne 0x50f3f1
cmp dword [ebp + 0x20], 0
jl 0x50f3c5
jg 0x50f388
cmp ebx, edi
jbe 0x50f3c5
push 0
lea eax, [ebp - 0x14]
push eax
push edi
push dword [ebp - 0x24]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x50f42f
sub ebx, edi
sbb dword [ebp + 0x20], 0
js 0x50f3f1
jg 0x50f3b1
test ebx, ebx
je 0x50f3f1
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 8]
inc eax
mov dword [ebp + 0x10], eax
cmp eax, dword [edx]
jb 0x50f300
jmp 0x50f3db
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
push dword [ebp - 0x24]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0x18]
inc eax
add edx, 8
mov dword [ebp + 0x18], eax
mov dword [ebp + 8], edx
cmp eax, 8
jl 0x50f2e5
mov edi, 1
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 4], 4
push dword [ebp - 0x24]
call fcn.00560591
mov ebx, dword [ebp + 0x14]
add esp, 4
mov byte [ebp - 4], 2
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x50f435
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x50f435
xor edi, edi
jmp 0x50f3f6
xor edi, edi
mov dword [ebp - 4], 0xffffffff
mov ecx, ebx
mov edx, dword [ebx]
push 1
call dword [edx]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x1c
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x1c
push 0x80004005
call fcn.0040b250
int3