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

Disassembly:
push rbx
sub rsp, 0x20
cmp dword [rcx + 0x28], 0
mov rbx, rcx
je 0x180057f16
cmp dword [rcx + 0x24], 0
jne 0x180057f16
mov rax, qword [rcx + 0x98]
cmp qword [rcx + 0x90], rax
jne 0x180057eb4
mov eax, 0x80004005
add rsp, 0x20
pop rbx
ret
xor ecx, ecx
mov qword [rsp + 0x30], rdi
call fcn.18009adc4
mov rcx, rax
call fcn.18009ae30
call fcn.18009ae04
mov edi, eax
call fcn.18009ae04
add edi, eax
call fcn.18009ae04
imul edi, eax
call fcn.18009ae04
mov rcx, qword [rbx + 0x90]
add edi, eax
mov edx, edi
mov rcx, qword [rcx]
cmp qword [rcx + 0x30], 0
jne 0x180057f07
mov rdi, qword [rsp + 0x30]
add rsp, 0x20
pop rbx
jmp 0x18005a3b0
mov rdi, qword [rsp + 0x30]
add rsp, 0x20
pop rbx
jmp 0x18005a170
xor eax, eax
add rsp, 0x20
pop rbx
ret
push rbp
push rsi
push rdi
push r14
push r15
lea rbp, [rsp - 0x37]
sub rsp, 0x90
mov qword [rbp + 7], 0xfffffffffffffffe
mov qword [rsp + 0xd0], rbx
mov rax, qword [0x1800eb008]
xor rax, rsp
mov qword [rbp + 0x2f], rax
mov r15d, edx
mov rdi, rcx
add rcx, 0x20
cmp qword [rcx + 0x18], 8
jb 0x18005a1b6
mov rcx, qword [rcx]
xor ebx, ebx
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x20], 4
xor r9d, r9d
mov edx, 0xc0000000
lea r8d, [rbx + 1]
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r14, rax
mov qword [rbp - 9], rax
cmp rax, 0xffffffffffffffff
jne 0x18005a1f4
call fcn.180002050
mov edi, eax
jmp 0x18005a371
mov qword [rbp - 0x11], rbx
lea rdx, [rbp - 0x11]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x18005a215
call fcn.180002050
mov edi, eax
jmp 0x18005a371
mov rax, qword [rbp - 0x11]
cmp rax, 0x100000
jle 0x18005a22b
mov edi, 0x80004005
jmp 0x18005a371
lea ecx, [rax + 0x200]
lea rdx, [0x1800ece24]
call fcn.180072944
mov rsi, rax
mov qword [rbp - 1], rax
test rax, rax
jne 0x18005a253
mov edi, 0x8007000e
jmp 0x18005a360
mov r8d, dword [rbp - 0x11]
add r8d, 0x200
xor edx, edx
mov rcx, rsi
call fcn.18008c000
mov dword [rbp - 0x19], ebx
mov qword [rsp + 0x20], rbx
lea r9, [rbp - 0x19]
mov r8d, dword [rbp - 0x11]
mov rdx, rsi
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x18005a294
call fcn.180002050
mov edi, eax
jmp 0x18005a360
cmp dword [rbp - 0x19], 0
jne 0x18005a2a4
mov edi, 0x80004005
jmp 0x18005a360
mov qword [rbp + 0x1f], rbx
mov qword [rbp + 0x27], rbx
mov qword [rbp + 0x27], send
mov qword [rbp + 0x1f], rbx
mov byte [rbp + 0xf], 0
cmp byte [rsi], 0
jne 0x18005a2c6
mov r8, rbx
jmp 0x18005a2da
or r8, 0xffffffffffffffff
nop word [rax + rax]
inc r8
cmp byte [rsi + r8], 0
jne 0x18005a2d0
mov rdx, rsi
lea rcx, [rbp + 0xf]
call fcn.180004a00
nop
mov r8d, r15d
lea rdx, [rbp + 0xf]
mov rcx, rdi
call fcn.18005a5c0
mov edi, eax
test eax, eax
js 0x18005a356
cmp eax, 1
je 0x18005a356
xor r9d, r9d
xor r8d, r8d
mov rdx, rbx
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x18005a320
call fcn.180002050
mov edi, eax
jmp 0x18005a356
mov dword [rbp - 0x19], ebx
lea rdx, [rbp + 0xf]
cmp qword [rbp + 0x27], 0x10
cmovae rdx, qword [rbp + 0xf]
mov qword [rsp + 0x20], rbx
lea r9, [rbp - 0x19]
mov r8d, dword [rbp + 0x1f]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x18005a354
call fcn.180002050
mov edi, eax
jmp 0x18005a356
mov edi, ebx
lea rcx, [rbp + 0xf]
call fcn.180004cb0
nop
test rsi, rsi
je 0x18005a371
mov rcx, rsi
call fcn.18007294c
mov qword [rbp - 1], rbx
cmp r14, 0xffffffffffffffff
je 0x18005a380
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov qword [rbp - 9], 0xffffffffffffffff
mov rcx, qword [rbp + 0x2f]
xor rcx, rsp
call fcn.180072920
mov rbx, qword [rsp + 0xd0]
add rsp, 0x90
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret
mov rax, rsp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x80
mov qword [rax - 0x60], 0xfffffffffffffffe
mov qword [rax + 0x18], rbx
mov qword [rax + 0x20], rbp
mov rax, qword [0x1800eb008]
xor rax, rsp
mov qword [rsp + 0x78], rax
mov r12d, edx
mov r15, rcx
mov rax, qword [rcx]
mov rsi, qword [rax]
cmp dword [rsi + 0x54], 0
je 0x18005a58e
cmp qword [rsi + 0x10], 0xffffffffffffffff
je 0x18005a58e
mov r14d, dword [rsi + 0x58]
lea rdx, [0x1800ece24]
mov ecx, r14d
call fcn.180072944
mov rbx, rax
mov qword [rsp + 0x50], rax
test rax, rax
jne 0x18005a42c
mov edi, 0x8007000e
jmp 0x18005a57d
mov r8, r14
xor edx, edx
mov rcx, rbx
call fcn.18008c000
mov eax, dword [rsi + 0x54]
test eax, eax
je 0x18005a578
mov rdx, qword [rsi + 0x10]
cmp rdx, 0xffffffffffffffff
je 0x18005a578
mov ecx, dword [rsi + 0x58]
cmp r14d, ecx
jb 0x18005a578
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], rbx
mov dword [rsp + 0x20], ecx
lea r9, [rsp + 0x40]
mov r8d, 1
mov rcx, rsi
call fcn.1800019b0
mov edi, eax
test eax, eax
js 0x18005a57d
cmp eax, 1
je 0x18005a57d
mov qword [rsp + 0x70], socket
mov qword [rsp + 0x68], 0
mov byte [rsp + 0x58], 0
cmp byte [rbx], 0
jne 0x18005a4bc
xor r8d, r8d
jmp 0x18005a4ca
or r8, 0xffffffffffffffff
inc r8
cmp byte [rbx + r8], 0
jne 0x18005a4c0
mov rdx, rbx
lea rcx, [rsp + 0x58]
call fcn.180004a00
nop
mov r8d, r12d
lea rdx, [rsp + 0x58]
mov rcx, r15
call fcn.18005a5c0
mov edi, eax
test eax, eax
js 0x18005a56c
cmp eax, 1
je 0x18005a56c
mov r8, r14
xor edx, edx
mov rcx, rbx
call fcn.18008c000
mov r8, qword [rsp + 0x68]
cmp r8, r14
jbe 0x18005a511
mov edi, 0x80004005
jmp 0x18005a56c
lea rdx, [rsp + 0x58]
cmp qword [rsp + 0x70], 0x10
cmovae rdx, qword [rsp + 0x58]
mov rcx, rbx
call fcn.18008b7d0
mov ecx, dword [rsi + 0x58]
cmp r14d, ecx
jb 0x18005a567
mov eax, dword [rsi + 0x54]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], rbx
mov dword [rsp + 0x20], ecx
lea r9, [rsp + 0x40]
mov r8d, 1
mov rdx, qword [rsi + 0x10]
mov rcx, rsi
call fcn.180001b20
mov edi, eax
jmp 0x18005a56c
mov edi, 0x80070057
lea rcx, [rsp + 0x58]
call fcn.180004cb0
jmp 0x18005a57d
mov edi, 0x80004005
test rbx, rbx
je 0x18005a58a
mov rcx, rbx
call fcn.18007294c
mov eax, edi
jmp 0x18005a593
mov eax, 0x80004005
mov rcx, qword [rsp + 0x78]
xor rcx, rsp
call fcn.180072920
lea r11, [rsp + 0x80]
mov rbx, qword [r11 + 0x40]
mov rbp, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret