Function at 0x140002040
Capabilities:
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 0x20], rbx
push rbp
push rsi
push r12
push r13
push r15
lea rbp, [rax - 0x48]
sub rsp, 0x120
xor r13d, r13d
mov qword [rax + 0x10], rdi
mov dword [rbp + 0x50], r13d
mov r8, rdx
mov rsi, rcx
mov qword [rax + 0x18], r14
movzx eax, byte [rcx + 0x31]
cmp byte [rcx + 0x30], r13b
je 0x140002289
test al, al
mov byte [rcx + 0x30], r13b
lea rax, [rbp + 0x50]
mov qword [rbp + 0x50], rdx
lea r9, [rbp + 0x58]
lea r8, [rbp + 0x50]
je 0x14000218a
mov byte [rsp + 0x70], r13b
cmp rax, r9
je 0x1400020e6
lea rdx, [rsp + 0x70]
nop dword [rax + rax]
movzx eax, byte [r8]
movzx ecx, al
and cl, 0xf
or cl, 0x30
mov byte [rdx - 1], cl
cmp cl, 0x39
jbe 0x1400020cb
add cl, 7
mov byte [rdx - 1], cl
sub rdx, 2
shr al, 4
or al, 0x30
mov byte [rdx], al
cmp al, 0x39
jbe 0x1400020de
add al, 7
mov byte [rdx], al
inc r8
cmp r8, r9
jne 0x1400020b0
mov rax, qword [0x1400b5948]
mov ebx, reloc.WS2_32.dll_recv
mov qword [rsp + 0x38], rbx
test rax, rax
jne 0x140002114
xor r8d, r8d
lea ecx, [rbx - 0xf]
mov edx, 0x100000
call qword [sym.imp.KERNEL32.dll_HeapCreate]
mov qword [0x1400b5948], rax
xor edx, edx
mov qword [rsp + 0x30], reloc.WS2_32.dll_recvfrom
mov rcx, rax
lea r8d, [rdx + 0x11]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
mov qword [rsp + 0x40], rax
lea rax, [rsp + 0x60]
cmp rdi, rax
je 0x14000216c
lea r8, [rsp + 0x60]
mov rcx, rdi
sub r8, rdi
mov edx, 2
nop
mov rax, qword [rcx + r8]
mov qword [rcx], rax
lea rcx, [rcx + 8]
sub rdx, 1
jne 0x140002150
lea rcx, [rdi + rbx]
movzx eax, byte [rcx + r8]
mov byte [rcx], al
lea r8, [rsp + 0x30]
mov rcx, rsi
lea rdx, [rbp + 8]
call fcn.1400047c0
mov rcx, rax
mov ebx, listen
jmp 0x14000226b
mov byte [rbp - 0x78], r13b
cmp rax, r9
je 0x1400021d6
lea rdx, [rbp - 0x78]
nop word [rax + rax]
movzx eax, byte [r8]
movzx ecx, al
and cl, 0xf
or cl, 0x30
mov byte [rdx - 1], cl
cmp cl, 0x39
jbe 0x1400021bb
add cl, 7
mov byte [rdx - 1], cl
sub rdx, 2
shr al, 4
or al, 0x30
mov byte [rdx], al
cmp al, 0x39
jbe 0x1400021ce
add al, 7
mov byte [rdx], al
inc r8
cmp r8, r9
jne 0x1400021a0
mov rax, qword [0x1400b5948]
mov ebx, reloc.WS2_32.dll_recv
mov qword [rsp + 0x50], rbx
test rax, rax
jne 0x140002204
xor r8d, r8d
lea ecx, [rbx - 0xf]
mov edx, 0x100000
call qword [sym.imp.KERNEL32.dll_HeapCreate]
mov qword [0x1400b5948], rax
xor edx, edx
mov qword [rsp + 0x48], reloc.WS2_32.dll_recvfrom
mov rcx, rax
lea r8d, [rdx + 0x11]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r9, rax
mov qword [rsp + 0x58], rax
lea rax, [rsp + 0x78]
cmp r9, rax
je 0x14000225c
lea r8, [rsp + 0x78]
mov rcx, r9
sub r8, r9
mov edx, 2
nop
mov rax, qword [rcx + r8]
mov qword [rcx], rax
lea rcx, [rcx + 8]
sub rdx, 1
jne 0x140002240
lea rcx, [r9 + rbx]
movzx eax, byte [rcx + r8]
mov byte [rcx], al
mov rdi, qword [rsp + 0x40]
lea rcx, [rsp + 0x48]
mov ebx, recv
mov rax, qword [rcx + 8]
mov r14, qword [rsp + 0x40]
mov qword [rbp - 0x50], rax
mov rax, qword [rcx + 0x10]
mov qword [rbp - 0x48], rax
lea rax, [rbp - 0x58]
jmp 0x1400024c8
mov ebx, reloc.WS2_32.dll_sendto
movabs r10, 0xcccccccccccccccd
mov r9d, ebx
test al, al
je 0x1400023ae
mov byte [rbp - 0x14], r13b
nop word [rax + rax]
dec r9
lea rdi, [rbp - 0x28]
add rdi, r9
mov rax, r10
mul r8
shr rdx, 3
movzx eax, dl
shl al, 2
lea ecx, [rax + rdx]
add cl, cl
sub r8b, cl
or r8b, 0x30
mov byte [rdi], r8b
mov r8, rdx
test rdx, rdx
jne 0x1400022b0
mov rax, qword [0x1400b5948]
sub rbx, r9
mov qword [rsp + 0x38], rbx
test rax, rax
jne 0x14000230a
mov edx, 0x100000
lea ecx, [rax + 1]
call qword [sym.imp.KERNEL32.dll_HeapCreate]
mov qword [0x1400b5948], rax
inc rbx
xor edx, edx
mov r8, rbx
mov qword [rsp + 0x30], rbx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x40], rax
mov r14, rax
cmp rax, rdi
je 0x140002390
test rbx, rbx
je 0x140002390
mov rdx, rbx
mov r9, r13
shr rdx, 3
test rdx, rdx
je 0x140002361
mov r8, rdi
mov rcx, rax
sub r8, rax
mov r9, rdx
nop dword [rax]
mov rax, qword [rcx + r8]
mov qword [rcx], rax
lea rcx, [rcx + 8]
sub rdx, 1
jne 0x140002350
lea rax, [r9*8]
cmp rax, rbx
jae 0x140002390
sub rdi, r14
lea rcx, [r14 + rax]
sub rbx, rax
nop dword [rax + rax]
movzx eax, byte [rdi + rcx]
mov byte [rcx], al
lea rcx, [rcx + 1]
sub rbx, 1
jne 0x140002380
lea r8, [rsp + 0x30]
mov rcx, rsi
lea rdx, [rbp - 0x10]
call fcn.140004670
mov rcx, rax
mov ebx, 0xb0
jmp 0x1400024af
mov byte [rsp + 0x44], r13b
nop dword [rax]
nop word [rax + rax]
dec r9
lea rdi, [rsp + 0x30]
add rdi, r9
mov rax, r10
mul r8
shr rdx, 3
movzx eax, dl
shl al, 2
lea ecx, [rax + rdx]
add cl, cl
sub r8b, cl
or r8b, 0x30
mov byte [rdi], r8b
mov r8, rdx
test rdx, rdx
jne 0x1400023c0
mov rax, qword [0x1400b5948]
sub rbx, r9
mov qword [rsp + 0x50], rbx
test rax, rax
jne 0x14000241b
mov edx, 0x100000
lea ecx, [rax + 1]
call qword [sym.imp.KERNEL32.dll_HeapCreate]
mov qword [0x1400b5948], rax
inc rbx
xor edx, edx
mov r8, rbx
mov qword [rsp + 0x48], rbx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x58], rax
mov r9, rax
cmp rax, rdi
je 0x1400024a0
test rbx, rbx
je 0x1400024a0
mov rdx, rbx
mov r10, r13
shr rdx, 3
test rdx, rdx
je 0x140002471
mov r8, rdi
mov rcx, rax
sub r8, rax
mov r10, rdx
nop
mov rax, qword [rcx + r8]
mov qword [rcx], rax
lea rcx, [rcx + 8]
sub rdx, 1
jne 0x140002460
lea rax, [r10*8]
cmp rax, rbx
jae 0x1400024a0
sub rdi, r9
lea rcx, [r9 + rax]
sub rbx, rax
nop dword [rax + rax]
movzx eax, byte [rdi + rcx]
mov byte [rcx], al
lea rcx, [rcx + 1]
sub rbx, 1
jne 0x140002490
mov r14, qword [rsp + 0x40]
lea rcx, [rsp + 0x48]
mov ebx, 0xc0
mov rax, qword [rcx + 8]
mov rdi, qword [rsp + 0x40]
mov qword [rbp - 0x68], rax
mov rax, qword [rcx + 0x10]
mov qword [rbp - 0x60], rax
lea rax, [rbp - 0x70]
mov rdx, qword [rcx]
mov r15, qword [rax + 8]
mov r12, qword [rax + 0x10]
mov qword [rcx + 0x10], r13
mov qword [rcx + 8], r13
mov qword [rcx], r13
mov qword [rbp - 0x40], rdx
mov qword [rbp - 0x38], r15
mov qword [rbp - 0x30], r12
mov qword [rax], r13
mov qword [rax + 8], r13
mov qword [rax + 0x10], r13
test bl, bl
jns 0x140002510
mov r8, qword [rbp - 0x60]
btr ebx, 7
mov rcx, qword [0x1400b5948]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
test bl, 0x40
je 0x14000252c
mov r8, qword [rsp + 0x58]
and ebx, 0xffffffbf
mov rcx, qword [0x1400b5948]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
test bl, 0x20
je 0x140002547
mov r8, qword [rbp]
and ebx, 0xffffffdf
mov rcx, qword [0x1400b5948]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
test bl, 0x10
je 0x140002561
mov rcx, qword [0x1400b5948]
and ebx, 0xffffffef
mov r8, r14
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r14, qword [rsp + 0x160]
test bl, 8
je 0x140002584
mov r8, qword [rbp - 0x48]
and ebx, 0xfffffff7
mov rcx, qword [0x1400b5948]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
test bl, 4
je 0x14000259d
mov r8, qword [rsp + 0x58]
xor edx, edx
mov rcx, qword [0x1400b5948]
call qword [sym.imp.KERNEL32.dll_HeapFree]
test bl, 2
je 0x1400025b5
mov r8, qword [rbp + 0x18]
xor edx, edx
mov rcx, qword [0x1400b5948]
call qword [sym.imp.KERNEL32.dll_HeapFree]
test bl, 1
je 0x1400025cc
mov rcx, qword [0x1400b5948]
mov r8, rdi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rdi, qword [rsp + 0x158]
cmp byte [rsi + 0x40], r13b
je 0x1400025eb
lea rdx, [rbp - 0x40]
mov rcx, rsi
call fcn.14000f9e0
jmp 0x14000268b
mov rax, qword [rsi + 0x18]
cmp rax, 1
jne 0x14000261d
mov rcx, qword [rsi]
lea r9, [0x1400b5958]
mov r8d, r15d
mov qword [rsp + 0x20], r13
mov rdx, r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rdx, r15
mov rcx, rsi
call fcn.140004900
jmp 0x14000268b
mov rcx, rsi
test rax, rax
jne 0x14000264a
mov rdx, r15
call fcn.140004900
mov rcx, qword [rsi]
lea r9, [0x1400b5958]
mov r8d, r15d
mov qword [rsp + 0x20], r13
mov rdx, r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x14000268b
mov rbx, qword [rsi + 0x10]
xor r8d, r8d
shr rbx, 1
mov rdx, rbx
call fcn.140004b20
mov rcx, qword [rsi]
lea r9, [0x1400b5958]
mov r8d, r15d
mov qword [rsp + 0x20], r13
mov rdx, r12
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [rsi + 0x10]
mov r8b, 1
and edx, 1
mov rcx, rsi
add rdx, rbx
call fcn.140004b20
mov rcx, qword [0x1400b5948]
mov r8, r12
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rbx, qword [rsp + 0x168]
mov rax, rsi
add rsp, 0x120
pop r15
pop r13
pop r12
pop rsi
pop rbp
ret