Function at 0x180009690
Capabilities:
Write file on windows

Disassembly:
push rbx
push rdi
push r12
sub rsp, 0x30
mov rax, qword [rcx + 0xa8]
mov rdi, rcx
test rax, rax
je 0x180009768
cmp byte [rcx + 1], 0
je 0x180009768
mov byte [rax + 0x18], 0
mov rbx, qword [rcx + 0xa8]
test rbx, rbx
je 0x180009768
mov rcx, rbx
call fcn.180024310
mov rcx, qword [rbx + 0x70]
test rcx, rcx
je 0x1800096f9
mov rax, qword [0x18005f8f0]
test rax, rax
je 0x1800096ed
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov rcx, qword [rbx + 0x60]
test rcx, rcx
je 0x180009720
mov rax, qword [0x18005f8f0]
test rax, rax
je 0x180009714
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov rcx, qword [rbx + 0x50]
test rcx, rcx
je 0x180009747
mov rax, qword [0x18005f8f0]
test rax, rax
je 0x18000973b
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov rax, qword [0x18005f8f0]
test rax, rax
je 0x180009759
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
mov rcx, rbx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
xor r12d, r12d
mov qword [rdi + 0xa8], r12
cmp byte [rdi], r12b
je 0x180009f81
mov qword [rsp + 0x58], rbp
mov qword [rsp + 0x60], rsi
mov qword [rsp + 0x28], r14
cmp byte [rdi + 0x3031], r12b
je 0x180009800
mov rbx, qword [rdi + 0x20]
test rbx, rbx
je 0x180009800
mov rsi, qword [0x18005f8f0]
lea rcx, [rsp + 0x50]
mov qword [0x18005f8f0], rdi
mov dword [rdi + 0x3034], r12d
mov qword [rsp + 0x50], r12
call fcn.180016c80
lea rdx, [0x180053b78]
mov rcx, rbx
mov rbp, rax
call fcn.180004e30
mov rbx, rax
test rax, rax
je 0x1800097f9
mov r8, qword [rsp + 0x50]
lea edx, [r12 + 1]
mov r9, rax
mov rcx, rbp
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov qword [0x18005f8f0], rsi
mov ebx, r12d
cmp dword [rdi + 0x3078], r12d
jle 0x18000983d
mov rsi, r12
nop
mov rax, qword [rdi + 0x3080]
cmp dword [rsi + rax + 4], 6
jne 0x18000982f
movsxd rdx, ebx
mov rcx, rdi
shl rdx, 5
add rdx, rax
call qword [rsi + rax + reloc.WS2_32.dll_recv]
inc ebx
add rsi, 0x20
cmp ebx, dword [rdi + 0x3078]
jl 0x180009810
mov ebx, r12d
cmp dword [rdi + 0x1bb0], r12d
jle 0x18000986e
mov rsi, r12
nop dword [rax]
mov rcx, qword [rdi + 0x1bb8]
mov rcx, qword [rsi + rcx]
call fcn.180018400
inc ebx
lea rsi, [rsi + 8]
cmp ebx, dword [rdi + 0x1bb0]
jl 0x180009850
mov rcx, qword [rdi + 0x1bb8]
test rcx, rcx
je 0x1800098a6
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1bb0], r12
test rax, rax
je 0x180009893
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1bb8], r12
mov rcx, qword [rdi + 0x1bc8]
test rcx, rcx
je 0x1800098de
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1bc0], r12
test rax, rax
je 0x1800098cb
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1bc8], r12
mov rcx, qword [rdi + 0x1bd8]
test rcx, rcx
je 0x180009916
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1bd0], r12
test rax, rax
je 0x180009903
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1bd8], r12
mov qword [rdi + 0x1c10], r12
mov rcx, qword [rdi + 0x1be8]
test rcx, rcx
je 0x180009955
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1be0], r12
test rax, rax
je 0x180009942
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1be8], r12
mov rcx, qword [rdi + 0x1bf8]
test rcx, rcx
je 0x18000998d
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1bf0], r12
test rax, rax
je 0x18000997a
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1bf8], r12
mov qword [rdi + 0x1dc8], r12
mov qword [rdi + 0x1c20], r12
mov qword [rdi + 0x1c18], r12
mov qword [rdi + 0x1ca0], r12
mov qword [rdi + 0x1c88], r12
mov qword [rdi + 0x1c28], r12
mov rcx, qword [rdi + 0x1d40]
test rcx, rcx
je 0x1800099ef
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1d38], r12
test rax, rax
je 0x1800099dc
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1d40], r12
mov rcx, qword [rdi + 0x1d50]
test rcx, rcx
je 0x180009a27
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1d48], r12
test rax, rax
je 0x180009a14
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1d50], r12
mov rcx, qword [rdi + 0x1d60]
test rcx, rcx
je 0x180009a5f
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1d58], r12
test rax, rax
je 0x180009a4c
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1d60], r12
mov rcx, qword [rdi + 0x1da0]
test rcx, rcx
je 0x180009a97
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1d98], r12
test rax, rax
je 0x180009a84
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1da0], r12
mov rcx, qword [rdi + 0x1db0]
test rcx, rcx
je 0x180009acf
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1da8], r12
test rax, rax
je 0x180009abc
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1db0], r12
mov r14d, r12d
cmp dword [rdi + 0x1db8], r12d
jle 0x180009bc0
mov qword [rsp + 0x20], r15
mov r15, r12
nop word [rax + rax]
mov rax, qword [rdi + 0x1dc0]
mov rbp, qword [r15 + rax]
test rbp, rbp
je 0x180009ba7
mov rbx, qword [rbp + 0x30]
test rbx, rbx
je 0x180009b36
mov rcx, rbx
call fcn.180003480
mov rax, qword [0x18005f8f0]
test rax, rax
je 0x180009b27
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
mov rcx, rbx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov rbx, qword [rbp + 0x38]
test rbx, rbx
je 0x180009b68
mov rcx, rbx
call fcn.180003480
mov rax, qword [0x18005f8f0]
test rax, rax
je 0x180009b59
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
mov rcx, rbx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov ebx, 2
lea rsi, [rbp + 0x90]
sub rsi, 0x10
mov rcx, rsi
call fcn.180017ec0
sub rbx, 1
jne 0x180009b74
mov rax, qword [0x18005f8f0]
test rax, rax
je 0x180009b98
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
mov rcx, rbp
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
inc r14d
add r15, 8
cmp r14d, dword [rdi + 0x1db8]
jl 0x180009af0
mov r15, qword [rsp + 0x20]
mov rcx, qword [rdi + 0x1dc0]
mov r14, qword [rsp + 0x28]
test rcx, rcx
je 0x180009bfd
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x1db8], r12
test rax, rax
je 0x180009bea
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x1dc0], r12
lea rcx, [rdi + 0x2060]
call fcn.180017670
mov rcx, qword [rdi + 0x2090]
test rcx, rcx
je 0x180009c41
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x2088], r12
test rax, rax
je 0x180009c2e
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x2090], r12
mov rcx, qword [rdi + 0x20a0]
test rcx, rcx
je 0x180009c79
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x2098], r12
test rax, rax
je 0x180009c66
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x20a0], r12
lea rcx, [rdi + 0x2000]
call fcn.180017810
mov ebp, r12d
cmp dword [rdi + 0x2028], r12d
jle 0x180009d14
mov rsi, r12
nop dword [rax + rax]
mov rbx, qword [rdi + 0x2030]
mov rcx, qword [rsi + rbx + 0x40]
test rcx, rcx
je 0x180009ccf
mov rax, qword [0x18005f8f0]
test rax, rax
je 0x180009cc3
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
lea rcx, [rbx + 0x10]
add rcx, rsi
call fcn.180023870
mov rcx, qword [rbx + rsi + 0x20]
test rcx, rcx
je 0x180009d03
mov rax, qword [0x18005f8f0]
test rax, rax
je 0x180009cf7
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
inc ebp
add rsi, 0x90
cmp ebp, dword [rdi + 0x2028]
jl 0x180009ca0
mov rcx, qword [rdi + 0x2030]
mov rsi, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x58]
test rcx, rcx
je 0x180009d56
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x2028], r12
test rax, rax
je 0x180009d43
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x2030], r12
mov rcx, qword [rdi + 0x2050]
test rcx, rcx
je 0x180009d8e
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x2048], r12
test rax, rax
je 0x180009d7b
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x2050], r12
mov rcx, qword [rdi + 0x3008]
test rcx, rcx
je 0x180009dc6
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x3000], r12
test rax, rax
je 0x180009db3
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x3008], r12
mov rcx, qword [rdi + 0x3018]
test rcx, rcx
je 0x180009dfe
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x3010], r12
test rax, rax
je 0x180009deb
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x3018], r12
mov rcx, qword [rdi + 0x20c8]
test rcx, rcx
je 0x180009e36
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x20c0], r12
test rax, rax
je 0x180009e23
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x20c8], r12
mov rcx, qword [rdi + 0x20d8]
test rcx, rcx
je 0x180009e6e
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x20d0], r12
test rax, rax
je 0x180009e5b
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x20d8], r12
mov rcx, qword [rdi + 0x20e8]
test rcx, rcx
je 0x180009ea6
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x20e0], r12
test rax, rax
je 0x180009e93
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x20e8], r12
mov rcx, qword [rdi + 0x3060]
test rcx, rcx
je 0x180009ede
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x3058], r12
test rax, rax
je 0x180009ecb
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x3060], r12
mov rcx, qword [rdi + 0x3050]
test rcx, rcx
je 0x180009f16
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x3048], r12
test rax, rax
je 0x180009f03
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x3050], r12
cmp qword [rdi + 0x3098], r12
je 0x180009f46
mov rbx, qword [rdi + 0x3098]
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
cmp rbx, rax
je 0x180009f3f
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov qword [rdi + 0x3098], r12
mov rcx, qword [rdi + 0x30a8]
test rcx, rcx
je 0x180009f7e
mov rax, qword [0x18005f8f0]
mov qword [rdi + 0x30a0], r12
test rax, rax
je 0x180009f6b
dec dword [rax + 0x3b4]
mov rdx, qword [0x18005f8e0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x30a8], r12
mov byte [rdi], r12b
add rsp, 0x30
pop r12
pop rdi
pop rbx
ret