Function at 0x180039220
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x40
mov qword [rsp + 0x28], 0xfffffffffffffffe
mov qword [rsp + 0x90], rbx
mov rdi, rdx
mov r15, rcx
test rdx, rdx
jne 0x180039294
cmp byte [rcx + 0x50], dl
jne 0x18003928d
mov byte [rcx + 0x50], 1
mov dword [rcx + 0x54], 2
xor eax, eax
or rbx, 0xffffffffffffffff
mov rcx, rbx
mov rdx, qword [str.Failed_to_open_file]
mov rdi, rdx
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
lea rcx, [r15 + 0x58]
call fcn.180037e70
mov dword [r15 + 0x68], ebx
mov dword [r15 + 0x64], ebx
xor al, al
jmp 0x180039706
call fcn.180038780
or r14, 0xffffffffffffffff
mov dword [r15 + 0xc], r14d
mov dword [r15 + 8], r14d
xor edx, edx
lea r8d, [r14 + 3]
mov rcx, rdi
call fcn.180051050
mov rcx, rdi
call fcn.180050f34
movsxd rsi, eax
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call fcn.180051050
test esi, esi
jg 0x180039313
cmp byte [r15 + 0x50], 0
jne 0x18003930c
mov byte [r15 + 0x50], 1
mov dword [r15 + 0x54], reloc.WS2_32.dll_listen
xor eax, eax
mov rcx, r14
mov rdx, qword [str.Error_document_empty.]
mov rdi, rdx
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
lea rcx, [r15 + 0x58]
call fcn.180037e70
mov dword [r15 + 0x68], r14d
mov dword [r15 + 0x64], r14d
xor al, al
jmp 0x180039706
lea r12, [0x1800a6a08]
mov rbx, r12
mov qword [rsp + 0x98], rbx
mov rbp, rsi
cmp rsi, qword [0x1800a6a10]
jbe 0x180039349
mov rdx, rsi
lea rcx, [rsp + 0x98]
call fcn.180037dc0
mov rbx, qword [rsp + 0x98]
lea eax, [rsi + 1]
movsxd rcx, eax
call fcn.180051260
mov r13, rax
mov qword [rsp + 0x20], rax
mov byte [rax], 0
mov r9, rdi
mov r8d, 1
mov rdx, rsi
mov rcx, rax
call fcn.180051900
cmp rax, 1
je 0x1800393d2
mov rcx, r13
call fcn.180050528
cmp byte [r15 + 0x50], 0
jne 0x1800393be
mov byte [r15 + 0x50], 1
mov dword [r15 + 0x54], 2
xor eax, eax
mov rcx, r14
mov rdx, qword [str.Failed_to_open_file]
mov rdi, rdx
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
lea rcx, [r15 + 0x58]
call fcn.180037e70
mov dword [r15 + 0x68], r14d
mov dword [r15 + 0x64], r14d
cmp rbx, r12
je 0x1800393cb
mov rcx, rbx
call fcn.1800515dc
xor al, al
jmp 0x180039706
mov r12, r13
mov rsi, r13
mov byte [r13 + rbp], 0
cmp byte [r13], 0
je 0x180039696
lea r15, [0x1800a6a08]
movzx eax, byte [rsi]
cmp al, 0xa
jne 0x1800394d8
mov rbp, rsi
sub rbp, r12
inc rbp
mov r13, qword [rbx]
add r13, rbp
cmp r13, qword [rbx + 8]
jbe 0x1800394b1
mov rax, qword [rbx + 8]
lea r14, [rax + r13]
cmp r14, rax
jbe 0x1800394a7
mov qword [rsp + 0x30], r15
mov rax, qword [rbx]
mov qword [rsp + 0x88], rax
test r14, r14
je 0x180039476
lea rcx, [r14 + 0x1b]
shr rcx, 2
mov eax, 4
mul rcx
mov rcx, 0xffffffffffffffff
cmovo rax, rcx
mov rcx, rax
call fcn.180051260
mov rdi, rax
mov rax, qword [rsp + 0x88]
mov qword [rdi], rax
mov byte [rax + rdi + 0x10], 0
mov qword [rdi + 8], r14
jmp 0x180039479
mov rdi, r15
lea rdx, [rbx + 0x10]
lea rcx, [rdi + 0x10]
mov r8, qword [rbx]
call fcn.180054180
mov rcx, rbx
mov rbx, rdi
mov qword [rsp + 0x98], rbx
cmp rcx, r15
je 0x1800394ad
call fcn.1800515dc
or r14, 0xffffffffffffffff
jmp 0x1800394b1
or r14, 0xffffffffffffffff
jmp 0x1800394b1
or r14, 0xffffffffffffffff
mov rax, qword [rbx]
lea rcx, [rax + rbx + 0x10]
mov r8, rbp
mov rdx, r12
call fcn.180054180
mov qword [rbx], r13
mov byte [r13 + rbx + 0x10], 0
inc rsi
mov r12, rsi
jmp 0x180039680
cmp al, 0xd
jne 0x18003967d
mov rbp, rsi
sub rbp, r12
test rbp, rbp
jle 0x1800395b8
mov r13, qword [rbx]
add r13, rbp
cmp r13, qword [rbx + 8]
jbe 0x18003959c
mov rax, qword [rbx + 8]
lea r14, [rax + r13]
cmp r14, rax
jbe 0x180039592
mov qword [rsp + 0x30], r15
mov rax, qword [rbx]
mov qword [rsp + 0x88], rax
test r14, r14
je 0x180039561
lea rcx, [r14 + 0x1b]
shr rcx, 2
mov eax, 4
mul rcx
mov rcx, 0xffffffffffffffff
cmovo rax, rcx
mov rcx, rax
call fcn.180051260
mov rdi, rax
mov rax, qword [rsp + 0x88]
mov qword [rdi], rax
mov byte [rax + rdi + 0x10], 0
mov qword [rdi + 8], r14
jmp 0x180039564
mov rdi, r15
lea rdx, [rbx + 0x10]
lea rcx, [rdi + 0x10]
mov r8, qword [rbx]
call fcn.180054180
mov rcx, rbx
mov rbx, rdi
mov qword [rsp + 0x98], rbx
cmp rcx, r15
je 0x180039598
call fcn.1800515dc
or r14, 0xffffffffffffffff
jmp 0x18003959c
or r14, 0xffffffffffffffff
jmp 0x18003959c
or r14, 0xffffffffffffffff
mov rax, qword [rbx]
lea rcx, [rax + rbx + 0x10]
mov r8, rbp
mov rdx, r12
call fcn.180054180
mov qword [rbx], r13
mov byte [r13 + rbx + 0x10], 0
mov byte [rsp + 0x88], 0xa
mov rbp, qword [rbx]
inc rbp
cmp rbp, qword [rbx + 8]
jbe 0x180039640
mov rax, qword [rbx + 8]
lea r12, [rax + rbp]
cmp r12, rax
jbe 0x180039640
mov qword [rsp + 0x30], r15
mov r13, qword [rbx]
test r12, r12
je 0x180039615
lea rcx, [r12 + 0x1b]
shr rcx, 2
mov eax, 4
mul rcx
cmovo rax, r14
mov rcx, rax
call fcn.180051260
mov rdi, rax
mov qword [rax], r13
mov byte [r13 + rax + 0x10], 0
mov qword [rax + 8], r12
jmp 0x180039618
mov rdi, r15
lea rdx, [rbx + 0x10]
lea rcx, [rdi + 0x10]
mov r8, qword [rbx]
call fcn.180054180
mov rcx, rbx
mov rbx, rdi
mov qword [rsp + 0x98], rbx
cmp rcx, r15
je 0x180039640
call fcn.1800515dc
mov rax, qword [rbx]
lea rcx, [rax + rbx + 0x10]
mov r8d, 1
lea rdx, [rsp + 0x88]
call fcn.180054180
mov qword [rbx], rbp
mov byte [rbx + rbp + 0x10], 0
lea rax, [rsi + 1]
cmp byte [rax], 0xa
jne 0x180039675
add rsi, 2
mov r12, rsi
jmp 0x180039680
mov rsi, rax
mov r12, rax
jmp 0x180039680
inc rsi
cmp byte [rsi], 0
jne 0x1800393f0
mov r15, qword [rsp + 0x80]
mov r13, qword [rsp + 0x20]
sub rsi, r12
je 0x1800396b6
mov r8, rsi
mov rdx, r12
lea rcx, [rsp + 0x98]
call fcn.180037f50
mov rbx, qword [rsp + 0x98]
mov rcx, r13
call fcn.180050528
mov rax, qword [r15]
lea rdx, [rbx + 0x10]
xor r9d, r9d
xor r8d, r8d
mov rcx, r15
call qword [rax + reloc.WS2_32.dll_recv]
cmp byte [r15 + 0x50], 0
je 0x1800396f0
lea rax, [0x1800a6a08]
cmp rbx, rax
je 0x1800396ec
mov rcx, rbx
call fcn.1800515dc
xor al, al
jmp 0x180039706
lea rax, [0x1800a6a08]
cmp rbx, rax
je 0x180039704
mov rcx, rbx
call fcn.1800515dc
mov al, 1
mov rbx, qword [rsp + 0x90]
add rsp, 0x40
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret