Function at 0x140037140
Capabilities:
Print debug messages
Write file on windows

Disassembly:
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
mov dword [rsp + 8], ecx
push rdi
mov eax, 0x8130
call fcn.1400579e0
sub rsp, rax
mov rax, qword [0x1400010c0]
xor rax, rsp
mov qword [rsp + 0x8120], rax
mov dword [rsp + 0x40], 0
mov dword [rsp + 0x4c], 0
lea rax, [rsp + 0x3120]
mov rdi, rax
xor eax, eax
mov ecx, 0x2000
rep stosb byte [rdi], al
lea rax, [rsp + 0x1120]
mov rdi, rax
xor eax, eax
mov ecx, 0x2000
rep stosb byte [rdi], al
lea rax, [rsp + 0x120]
mov rdi, rax
xor eax, eax
mov ecx, 0x1000
rep stosb byte [rdi], al
lea rax, [rsp + 0x6120]
mov rdi, rax
xor eax, eax
mov ecx, 0x2000
rep stosb byte [rdi], al
cmp dword [rsp + 0x8140], 0
jl 0x1400371e7
cmp dword [rsp + 0x8140], 3
jl 0x1400371f1
mov eax, 0xffffffff
jmp 0x140037d29
cmp dword [rsp + 0x8140], 2
jne 0x1400372e5
lea rax, [0x140001120]
mov ecx, 1
lock xadd dword [rax], ecx
inc ecx
mov eax, ecx
test eax, eax
jle 0x1400372e5
mov r9d, 0xa
mov r8d, 0x1000
lea rdx, [rsp + 0x3120]
mov ecx, dword [rsp + 0x8158]
call fcn.1400478f0
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x1ee
lea r9, [0x140007bf0]
lea r8, [0x1400082b0]
lea rdx, [0x1400082d0]
mov ecx, eax
call fcn.1400222a0
lea rcx, [0x140008320]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
cmp qword [rsp + 0x8150], 0
je 0x140037292
mov rax, qword [rsp + 0x8150]
mov qword [rsp + 0xa0], rax
jmp 0x1400372a1
lea rax, [0x140008370]
mov qword [rsp + 0xa0], rax
mov rcx, qword [rsp + 0xa0]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea rcx, [0x140008390]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea rcx, [rsp + 0x3120]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea rcx, [0x1400083a0]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
int3
cmp qword [rsp + 0x8168], 0
je 0x140037415
mov qword [rsp + 0x108], 0x13
mov qword [rsp + 0x110], 0xfeb
mov dword [rsp + 0x44], 0
call fcn.140022ee0
mov eax, dword [rax]
mov dword [rsp + 0x78], eax
call fcn.140022ee0
mov dword [rax], 0
mov rax, qword [rsp + 0x8170]
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], 0
mov rax, qword [rsp + 0x8168]
mov qword [rsp + 0x20], rax
mov r9d, 0xfeb
mov r8d, 0x1000
lea rdx, [rsp + 0x6120]
mov ecx, 4
call fcn.140036430
mov dword [rsp + 0x44], eax
cmp dword [rsp + 0x44], 0
jge 0x1400373bd
call fcn.140022ee0
mov qword [rsp + 0x38], 0
mov dword [rsp + 0x30], 0x20d
lea rcx, [0x140007bf0]
mov qword [rsp + 0x28], rcx
lea rcx, [0x1400082b0]
mov qword [rsp + 0x20], rcx
lea r9, [0x140003620]
mov r8d, 0x22
mov edx, 0x16
mov ecx, dword [rax]
call fcn.1400222f0
call fcn.140022ee0
mov ecx, dword [rsp + 0x78]
mov dword [rax], ecx
cmp dword [rsp + 0x44], 0
jge 0x140037415
lea r8, [0x1400036e0]
mov edx, 0x1000
lea rcx, [rsp + 0x6120]
call fcn.140038390
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x210
lea r9, [0x140007bf0]
lea r8, [0x1400082b0]
lea rdx, [0x1400083b0]
mov ecx, eax
call fcn.1400222a0
cmp dword [rsp + 0x8140], 2
jne 0x140037491
cmp qword [rsp + 0x8168], 0
je 0x14003743b
lea rax, [0x140008500]
mov qword [rsp + 0xa8], rax
jmp 0x14003744a
lea rax, [0x140008528]
mov qword [rsp + 0xa8], rax
mov r8, qword [rsp + 0xa8]
mov edx, 0x1000
lea rcx, [rsp + 0x3120]
call fcn.140038390
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x215
lea r9, [0x140007bf0]
lea r8, [0x1400082b0]
lea rdx, [0x140008450]
mov ecx, eax
call fcn.1400222a0
lea r8, [rsp + 0x6120]
mov edx, 0x1000
lea rcx, [rsp + 0x3120]
call fcn.14003d030
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x217
lea r9, [0x140007bf0]
lea r8, [0x1400082b0]
lea rdx, [0x140008550]
mov ecx, eax
call fcn.1400222a0
cmp dword [rsp + 0x8140], 2
jne 0x14003758b
movsxd rax, dword [rsp + 0x8140]
lea rcx, [0x140001128]
mov eax, dword [rcx + rax*4]
and eax, 1
test eax, eax
je 0x140037545
lea r8, [0x1400085fc]
mov edx, 0x1000
lea rcx, [rsp + 0x3120]
call fcn.14003d030
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x21c
lea r9, [0x140007bf0]
lea r8, [0x1400082b0]
lea rdx, [0x1400085b0]
mov ecx, eax
call fcn.1400222a0
lea r8, [0x1400083a0]
mov edx, 0x1000
lea rcx, [rsp + 0x3120]
call fcn.14003d030
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x21e
lea r9, [0x140007bf0]
lea r8, [0x1400082b0]
lea rdx, [0x140008600]
mov ecx, eax
call fcn.1400222a0
cmp qword [rsp + 0x8150], 0
je 0x1400376a8
mov dword [rsp + 0x48], 0
call fcn.140022ee0
mov eax, dword [rax]
mov dword [rsp + 0x7c], eax
call fcn.140022ee0
mov dword [rax], 0
lea rax, [rsp + 0x3120]
mov qword [rsp + 0x30], rax
mov eax, dword [rsp + 0x8158]
mov dword [rsp + 0x28], eax
mov rax, qword [rsp + 0x8150]
mov qword [rsp + 0x20], rax
lea r9, [0x140008650]
mov r8d, 0x1000
mov edx, 0x1000
lea rcx, [rsp + 0x1120]
call fcn.140022350
mov dword [rsp + 0x48], eax
cmp dword [rsp + 0x48], 0
jge 0x14003764e
call fcn.140022ee0
mov qword [rsp + 0x38], 0
mov dword [rsp + 0x30], 0x226
lea rcx, [0x140007bf0]
mov qword [rsp + 0x28], rcx
lea rcx, [0x1400082b0]
mov qword [rsp + 0x20], rcx
lea r9, [0x140003620]
mov r8d, 0x22
mov edx, 0x16
mov ecx, dword [rax]
call fcn.1400222f0
call fcn.140022ee0
mov ecx, dword [rsp + 0x7c]
mov dword [rax], ecx
cmp dword [rsp + 0x48], 0
jge 0x1400376a6
lea r8, [0x1400036e0]
mov edx, 0x1000
lea rcx, [rsp + 0x1120]
call fcn.140038390
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x228
lea r9, [0x140007bf0]
lea r8, [0x1400082b0]
lea rdx, [0x140008670]
mov ecx, eax
call fcn.1400222a0
jmp 0x1400376ef
lea r8, [rsp + 0x3120]
mov edx, 0x1000
lea rcx, [rsp + 0x1120]
call fcn.140038390
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x22c
lea r9, [0x140007bf0]
lea r8, [0x1400082b0]
lea rdx, [0x140008710]
mov ecx, eax
call fcn.1400222a0
mov qword [rsp + 0x20], 0xffffffffffffffff
lea r9, [rsp + 0x1120]
mov r8d, 0x1000
lea rdx, [rsp + 0x120]
xor ecx, ecx
call fcn.1400492d0
mov qword [rsp + 0x38], 0
mov dword [rsp + 0x30], 0x231
lea rcx, [0x140007bf0]
mov qword [rsp + 0x28], rcx
lea rcx, [0x1400082b0]
mov qword [rsp + 0x20], rcx
lea r9, [0x140008770]
mov r8d, 0x22
mov edx, 0x16
mov ecx, eax
call fcn.1400222f0
mov dword [rsp + 0x80], eax
cmp dword [rsp + 0x80], 0
je 0x1400377ae
lea r8, [0x1400088c0]
mov edx, 0x1000
lea rcx, [rsp + 0x120]
call fcn.14002b130
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x233
lea r9, [0x140007bf0]
lea r8, [0x1400082b0]
lea rdx, [0x140008800]
mov ecx, eax
call fcn.1400222a0
cmp qword [0x14005b778], 0
jne 0x1400377c6
cmp qword [0x14005b780], 0
je 0x140037918
mov qword [rsp + 0x60], 0
mov qword [rsp + 0x68], 0
mov ecx, 1
call fcn.140024150
nop
mov rax, qword [0x14005b778]
mov qword [rsp + 0x60], rax
jmp 0x1400377ff
mov rax, qword [rsp + 0x60]
mov rax, qword [rax + 8]
mov qword [rsp + 0x60], rax
cmp qword [rsp + 0x60], 0
je 0x14003787a
mov dword [rsp + 0x50], 0
mov rax, qword [rsp + 0x60]
mov rax, qword [rax + 0x18]
mov qword [rsp + 0xc0], rax
mov rax, qword [rsp + 0xc0]
mov qword [rsp + 0xc8], rax
movabs r10, 0xafa18eae3c58d370
lea r8, [rsp + 0x50]
lea rdx, [rsp + 0x120]
mov ecx, dword [rsp + 0x8140]
mov rax, qword [rsp + 0xc8]
call qword [0x140060298]
test eax, eax
je 0x140037875
mov eax, dword [rsp + 0x50]
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x4c], 1
jmp 0x14003790e
jmp 0x1400377f1
mov rax, qword [0x14005b780]
mov qword [rsp + 0x68], rax
jmp 0x140037896
mov rax, qword [rsp + 0x68]
mov rax, qword [rax + 8]
mov qword [rsp + 0x68], rax
cmp qword [rsp + 0x68], 0
je 0x14003790e
mov dword [rsp + 0x54], 0
mov rax, qword [rsp + 0x68]
mov rax, qword [rax + 0x18]
mov qword [rsp + 0xd0], rax
mov rax, qword [rsp + 0xd0]
mov qword [rsp + 0xd8], rax
movabs r10, 0xe67887097055b870
lea r8, [rsp + 0x54]
lea rdx, [rsp + 0x1120]
mov ecx, dword [rsp + 0x8140]
mov rax, qword [rsp + 0xd8]
call qword [0x140060298]
test eax, eax
je 0x140037909
mov eax, dword [rsp + 0x54]
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x4c], 1
jmp 0x14003790e
jmp 0x140037888
mov ecx, 1
call fcn.1400241e0
cmp dword [rsp + 0x4c], 0
je 0x140037924
jmp 0x140037d11
cmp qword [0x14005b770], 0
je 0x140037992
mov dword [rsp + 0x58], 0
mov rax, qword [0x14005b770]
mov qword [rsp + 0xe0], rax
mov rax, qword [rsp + 0xe0]
mov qword [rsp + 0xe8], rax
movabs r10, 0xafa18eae3c58d370
lea r8, [rsp + 0x58]
lea rdx, [rsp + 0x120]
mov ecx, dword [rsp + 0x8140]
mov rax, qword [rsp + 0xe8]
call qword [0x140060298]
test eax, eax
je 0x140037992
mov eax, dword [rsp + 0x58]
mov dword [rsp + 0x40], eax
jmp 0x140037d11
movsxd rax, dword [rsp + 0x8140]
lea rcx, [0x140001128]
mov eax, dword [rcx + rax*4]
and eax, 1
test eax, eax
je 0x140037bc4
movsxd rax, dword [rsp + 0x8140]
lea rcx, [0x140001138]
cmp qword [rcx + rax*8], 0xffffffffffffffff
je 0x140037bc4
movsxd rax, dword [rsp + 0x8140]
lea rcx, [0x140001138]
mov rcx, qword [rcx + rax*8]
call qword [sym.imp.KERNEL32.dll_GetFileType]
mov dword [rsp + 0x84], eax
cmp dword [rsp + 0x84], 2
je 0x1400379f8
jmp 0x140037a7a
mov dword [rsp + 0x88], 0
lea rcx, [rsp + 0x1120]
call fcn.140039870
mov dword [rsp + 0x8c], eax
movsxd rax, dword [rsp + 0x8140]
lea rcx, [0x140001138]
mov rax, qword [rcx + rax*8]
mov qword [rsp + 0xf0], rax
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x88]
mov r8d, dword [rsp + 0x8c]
lea rdx, [rsp + 0x1120]
mov rcx, qword [rsp + 0xf0]
call qword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x140037a6a
jmp 0x140037bc4
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 6
je 0x140037a7a
jmp 0x140037bc4
mov qword [rsp + 0x70], 0
mov qword [rsp + 0x20], 0xffffffffffffffff
lea r9, [rsp + 0x1120]
mov r8d, 0x1000
lea rdx, [rsp + 0x5120]
lea rcx, [rsp + 0x70]
call fcn.1400492d0
mov qword [rsp + 0x38], 0
mov dword [rsp + 0x30], 0x27f
lea rcx, [0x140007bf0]
mov qword [rsp + 0x28], rcx
lea rcx, [0x1400082b0]
mov qword [rsp + 0x20], rcx
lea r9, [0x140008900]
mov r8d, 0x22
mov edx, 0x16
mov ecx, eax
call fcn.1400222f0
mov dword [rsp + 0x5c], eax
cmp dword [rsp + 0x5c], 0
je 0x140037b6d
cmp dword [rsp + 0x5c], 0x50
je 0x140037b6d
mov dword [rsp + 0x90], 0
lea rcx, [rsp + 0x1120]
call fcn.140039870
shl eax, 1
mov dword [rsp + 0x94], eax
movsxd rax, dword [rsp + 0x8140]
lea rcx, [0x140001138]
mov rax, qword [rcx + rax*8]
mov qword [rsp + 0xf8], rax
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x90]
mov r8d, dword [rsp + 0x94]
lea rdx, [rsp + 0x1120]
mov rcx, qword [rsp + 0xf8]
call qword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x140037bc4
cmp qword [rsp + 0x70], 0
jbe 0x140037b82
mov rax, qword [rsp + 0x70]
dec rax
mov qword [rsp + 0x70], rax
mov dword [rsp + 0x98], 0
movsxd rax, dword [rsp + 0x8140]
lea rcx, [0x140001138]
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x98]
mov r8d, dword [rsp + 0x70]
lea rdx, [rsp + 0x5120]
mov rcx, qword [rcx + rax*8]
call qword [sym.imp.KERNEL32.dll_WriteFile]
movsxd rax, dword [rsp + 0x8140]
lea rcx, [0x140001128]
mov eax, dword [rcx + rax*4]
and eax, 2
test eax, eax
je 0x140037beb
lea rcx, [rsp + 0x1120]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
movsxd rax, dword [rsp + 0x8140]
lea rcx, [0x140001128]
mov eax, dword [rcx + rax*4]
and eax, 4
test eax, eax
je 0x140037d11
mov eax, 2
imul rax, rax, 0
mov qword [rsp + 0xb0], rax
cmp qword [rsp + 0xb0], 0x2000
jae 0x140037c29
jmp 0x140037c2e
call fcn.140017000
xor eax, eax
mov rcx, qword [rsp + 0xb0]
mov word [rsp + rcx + 0x3120], ax
cmp dword [rsp + 0x8158], 0
je 0x140037c97
mov r9d, 0xa
mov r8d, 0x1000
lea rdx, [rsp + 0x3120]
mov ecx, dword [rsp + 0x8158]
call fcn.1400478f0
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0x29f
lea r9, [0x140007bf0]
lea r8, [0x1400082b0]
lea rdx, [0x1400082d0]
mov ecx, eax
call fcn.1400222a0
mov rax, qword [rsp + 0x8160]
mov qword [rsp + 0x100], rax
cmp dword [rsp + 0x8158], 0
je 0x140037cc3
lea rax, [rsp + 0x3120]
mov qword [rsp + 0xb8], rax
jmp 0x140037ccf
mov qword [rsp + 0xb8], 0
lea rax, [rsp + 0x6120]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x100]
mov qword [rsp + 0x20], rax
mov r9, qword [rsp + 0xb8]
mov r8, qword [rsp + 0x8150]
mov rdx, qword [rsp + 0x8148]
mov ecx, dword [rsp + 0x8140]
call fcn.140022250
mov dword [rsp + 0x40], eax
cmp dword [rsp + 0x8140], 2
jne 0x140037d25
lea rax, [0x140001120]
lock dec dword [rax]
mov eax, dword [rsp + 0x40]
mov rcx, qword [rsp + 0x8120]
xor rcx, rsp
call fcn.140016550
add rsp, 0x8130
pop rdi
ret