Function at 0x1400518c0
Capabilities:
Write file on windows

Disassembly:
push rbp
push r14
mov rbp, rsp
sub rsp, 0x68
xor edx, edx
mov r14, rcx
call fcn.140024c30
mov edx, eax
shr edx, 0x1f
test dl, dl
jne 0x140051f5f
mov rcx, qword [r14 + 0x10]
mov edx, recv
mov qword [rsp + 0x80], rbx
mov qword [rsp + 0x90], rsi
mov qword [rsp + 0x60], rdi
mov rax, qword [rcx]
mov qword [rsp + 0x58], r12
mov qword [rsp + 0x50], r15
call qword [rax + 0x40]
xor ebx, ebx
mov r12, rax
lea rdi, [rbx - 1]
test rax, rax
je 0x14005192d
mov rsi, rdi
inc rsi
cmp byte [rax + rsi], bl
jne 0x140051921
inc esi
jmp 0x14005192f
mov esi, ebx
lea eax, [rsi + 0x18]
mov dword [rbp - 0x38], 0x646e732e
mov edx, 2
mov dword [rbp - 0x34], eax
lea rcx, [r14 + 0x28]
mov dword [rbp - 0x30], ebx
mov dword [r14 + 0x308], ebx
call fcn.140025da0
lea r8, [0x14012dcb0]
mov rdx, rbx
nop
movzx ecx, word [rax + rdx*2]
cmp cx, word [r8 + rdx*2]
jne 0x14005198e
movzx ecx, word [rax + rdx*2 + 2]
cmp cx, word [r8 + rdx*2 + 2]
jne 0x14005198e
add rdx, 2
cmp rdx, 0xa
jne 0x140051960
mov dword [rbp - 0x2c], 2
jmp 0x140051d3c
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
mov r8, rax
lea r9, [0x14012bb38]
mov rdx, rdi
nop dword [rax]
movzx ecx, word [r8 + rdx*2 + 2]
cmp cx, word [r9 + rdx*2 + 2]
jne 0x1400519d8
add rdx, 2
cmp rdx, 0xb
je 0x140051b41
movzx eax, word [r8 + rdx*2]
cmp ax, word [r9 + rdx*2]
je 0x1400519b0
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
mov r8, rax
lea r9, [0x14012dc98]
mov rdx, rdi
nop dword [rax]
nop word [rax + rax]
movzx ecx, word [r8 + rdx*2 + 2]
cmp cx, word [r9 + rdx*2 + 2]
jne 0x140051a28
add rdx, 2
cmp rdx, 0xb
je 0x140051b4d
movzx eax, word [r8 + rdx*2]
cmp ax, word [r9 + rdx*2]
je 0x140051a00
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
mov r8, rax
lea r9, [0x140130280]
mov rdx, rdi
nop dword [rax]
nop word [rax + rax]
movzx ecx, word [r8 + rdx*2 + 2]
cmp cx, word [r9 + rdx*2 + 2]
jne 0x140051a78
add rdx, 2
cmp rdx, 0xb
je 0x140051b59
movzx eax, word [r8 + rdx*2]
cmp ax, word [r9 + rdx*2]
je 0x140051a50
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
mov r8, rax
lea r9, [0x14012dc78]
mov rdx, rdi
nop dword [rax]
nop word [rax + rax]
movzx ecx, word [r8 + rdx*2 + 2]
cmp cx, word [r9 + rdx*2 + 2]
jne 0x140051ac8
add rdx, 2
cmp rdx, 0xd
je 0x140051b65
movzx eax, word [r8 + rdx*2]
cmp ax, word [r9 + rdx*2]
je 0x140051aa0
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
mov rdx, rax
lea r8, [0x14012dc58]
movzx ecx, word [rdx + rdi*2 + 2]
cmp cx, word [r8 + rdi*2 + 2]
jne 0x140051b02
add rdi, 2
cmp rdi, 0xd
je 0x140051b71
movzx eax, word [rdx + rdi*2]
cmp ax, word [r8 + rdi*2]
je 0x140051ae0
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
mov rdx, rbx
lea r8, [0x140130298]
nop word [rax + rax]
movzx ecx, word [rax + rdx*2]
inc rdx
cmp cx, word [r8 + rdx*2 - 2]
jne 0x140051b7d
cmp rdx, 7
jne 0x140051b20
mov dword [rbp - 0x2c], 1
jmp 0x140051d3c
mov dword [rbp - 0x2c], 3
jmp 0x140051d3c
mov dword [rbp - 0x2c], 4
jmp 0x140051d3c
mov dword [rbp - 0x2c], 5
jmp 0x140051d3c
mov dword [rbp - 0x2c], 6
jmp 0x140051d3c
mov dword [rbp - 0x2c], 7
jmp 0x140051d3c
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
mov rdx, rbx
lea rdi, [0x1401302a8]
nop word [rax + rax]
movzx ecx, word [rax + rdx*2]
inc rdx
cmp cx, word [rdi + rdx*2 - 2]
jne 0x140051bc0
cmp rdx, 6
jne 0x140051ba0
mov dword [rbp - 0x2c], 0x1b
jmp 0x140051d3c
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
mov rdx, rbx
movzx ecx, word [rax + rdx*2]
inc rdx
cmp cx, word [rdi + rdx*2 - 2]
jne 0x140051bf1
cmp rdx, 6
jne 0x140051bd1
mov dword [rbp - 0x2c], 0x1b
jmp 0x140051d3c
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
lea r8, [0x140140a08]
mov rdx, rbx
nop dword [rax]
movzx ecx, word [rax + rdx*2]
cmp cx, word [r8 + rdx*2]
jne 0x140051c49
movzx ecx, word [rax + rdx*2 + 2]
cmp cx, word [r8 + rdx*2 + 2]
jne 0x140051c49
add rdx, 2
cmp rdx, 0x12
jne 0x140051c10
mov dword [rbp - 0x2c], 0x37323632
mov dword [r14 + 0x308], 2
jmp 0x140051d3c
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
lea r8, [0x140140a30]
mov rdx, rbx
movzx ecx, word [rax + rdx*2]
cmp cx, word [r8 + rdx*2]
jne 0x140051c9a
movzx ecx, word [rax + rdx*2 + 2]
cmp cx, word [r8 + rdx*2 + 2]
jne 0x140051c9a
add rdx, 2
cmp rdx, 0x12
jne 0x140051c61
mov dword [rbp - 0x2c], 0x19
mov dword [r14 + 0x308], 3
jmp 0x140051d3c
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
lea r8, [0x140140a58]
mov rdx, rbx
movzx ecx, word [rax + rdx*2]
cmp cx, word [r8 + rdx*2]
jne 0x140051ce8
movzx ecx, word [rax + rdx*2 + 2]
cmp cx, word [r8 + rdx*2 + 2]
jne 0x140051ce8
add rdx, 2
cmp rdx, 0x12
jne 0x140051cb2
mov dword [rbp - 0x2c], reloc.WSOCK32.dll_socket
mov dword [r14 + 0x308], 4
jmp 0x140051d3c
mov edx, 2
lea rcx, [r14 + 0x28]
call fcn.140025da0
lea r8, [0x140140a80]
mov rdx, rbx
movzx ecx, word [rax + rdx*2]
cmp cx, word [r8 + rdx*2]
jne 0x140051f3b
movzx ecx, word [rax + rdx*2 + 2]
cmp cx, word [r8 + rdx*2 + 2]
jne 0x140051f3b
add rdx, 2
cmp rdx, 0x12
jne 0x140051d00
mov dword [rbp - 0x2c], 0x1a
mov dword [r14 + 0x308], 5
mov edx, dword [r14 + 0x308]
mov rdi, rbx
test edx, edx
je 0x140051ddb
cmp dword [r14 + 0x258], 1
je 0x140051d93
mov ecx, 0x58
call fcn.1400b6058
test rax, rax
je 0x140051d77
mov edx, 1
mov rcx, rax
call fcn.14001fca0
mov rdi, rax
mov rdx, rdi
mov rcx, r14
call fcn.140025eb0
xor edx, edx
mov rcx, r14
call fcn.140024c30
mov edx, dword [r14 + 0x308]
lea rcx, [r14 + 0x298]
call fcn.14002eb90
mov r9d, dword [r14 + 0x264]
lea r8, [r14 + 0x270]
imul r9d, dword [r14 + 0x308]
lea rdx, [r14 + 0x38]
lea rcx, [r14 + 0x2e0]
add r9d, 7
shr r9d, 3
call fcn.140022bf0
test al, al
jne 0x140051df8
mov eax, 0x80040202
jmp 0x140051f40
mov rcx, r14
mov byte [r14 + 0x289], 1
call fcn.140024080
mov ecx, eax
shr ecx, 0x1f
test cl, cl
jne 0x140051f40
mov eax, dword [rbp - 0x34]
lea r9, [rbp + 0x20]
mov rcx, qword [r14 + 0x38]
lea rdx, [rbp - 0x38]
bswap eax
mov dword [rbp - 0x34], eax
mov r8d, 0x18
mov eax, dword [rbp - 0x30]
bswap eax
mov dword [rbp - 0x30], eax
mov eax, dword [rbp - 0x2c]
bswap eax
mov dword [rbp - 0x2c], eax
mov eax, dword [r14 + 0x260]
bswap eax
mov dword [rbp - 0x28], eax
mov eax, dword [r14 + 0x258]
bswap eax
mov dword [rbp - 0x24], eax
mov dword [rbp + 0x20], ebx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
test r12, r12
je 0x140051e69
mov rcx, qword [r14 + 0x38]
lea r9, [rbp + 0x20]
mov r8d, esi
mov dword [rbp + 0x20], ebx
mov rdx, r12
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, r14
call fcn.1400246e0
mov esi, eax
test rdi, rdi
je 0x140051e86
mov r8, qword [rdi]
mov edx, 1
mov rcx, rdi
call qword [r8]
mov ecx, esi
shr ecx, 0x1f
test cl, cl
je 0x140051e96
mov eax, esi
jmp 0x140051f40
cmp dword [r14 + 0x308], ebx
je 0x140051ed9
lea rcx, [r14 + 0x298]
call fcn.14002ecf0
lea rcx, [r14 + 0x2e0]
call fcn.140023c30
movsxd rax, dword [r14 + 0x308]
imul rax, qword [r14 + 0x268]
add rax, 7
cqo
and edx, 7
lea rdi, [rdx + rax]
sar rdi, 3
jmp 0x140051ef3
mov edi, dword [r14 + 0x290]
mov eax, dword [r14 + 0x258]
imul rdi, rax
imul rdi, qword [r14 + 0x268]
mov rcx, qword [r14 + 0x38]
mov eax, 0xffffffff
cmp rdi, rax
mov rdx, rbx
cmovg rdi, rax
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov rcx, qword [r14 + 0x38]
lea r9, [rbp + 0x20]
bswap edi
mov r8d, 0x18
mov dword [rbp - 0x30], edi
lea rdx, [rbp - 0x38]
mov dword [rbp + 0x20], ebx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.KERNEL32.dll_WriteFile]
xor eax, eax
jmp 0x140051f40
mov eax, 0x80040208
mov r12, qword [rsp + 0x58]
mov rdi, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x90]
mov rbx, qword [rsp + 0x80]
mov r15, qword [rsp + 0x50]
add rsp, 0x68
pop r14
pop rbp
ret