Function at 0x14001c550
Capabilities:
Check if file exists
Create directory
Get common file path
Get file attributes
Get file size
Get geographical location
Write file on windows

Disassembly:
push rdi
sub rsp, 0x430
mov rax, qword [0x140033060]
xor rax, rsp
mov qword [rsp + 0x420], rax
lea rdx, [rsp + 0x70]
lea rcx, [0x140019000]
mov r8d, 0x104
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov ecx, eax
cmp byte [rsp + rcx + 0x70], 0x5c
je 0x14001c59a
nop dword [rax]
dec rcx
cmp byte [rsp + rcx + 0x70], 0x5c
jne 0x14001c590
mov edi, 0x103
lea r8, str.TerNoLog.ter
mov rdx, rdi
sub rdx, rcx
lea rcx, [rsp + rcx + 0x71]
call fcn.14001d97c
lea rcx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x14001c5cd
xor eax, eax
jmp 0x14001ca45
lea r8, [rsp + 0x3b0]
mov r9d, 0x64
mov edx, 0x1001
mov ecx, 0x400
mov qword [rsp + 0x448], rbp
call qword [sym.imp.KERNEL32.dll_GetLocaleInfoA]
lea rdx, [rsp + 0x3b0]
xor ecx, ecx
call fcn.14001fd00
mov rcx, qword [0x1400345e0]
cmp rcx, 0xffffffffffffffff
je 0x14001c620
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [0x1400345e0], 0xffffffffffffffff
lea rdx, [0x140030628]
lea rcx, str.WebCubeAgent.log
call fcn.14001df38
test rax, rax
jne 0x14001c683
lea rdx, [rsp + 0x70]
lea rcx, [0x140019000]
mov r8d, 0x104
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov ecx, eax
cmp byte [rsp + rcx + 0x70], 0x5c
je 0x14001c66a
nop dword [rax]
dec rcx
cmp byte [rsp + rcx + 0x70], 0x5c
jne 0x14001c660
sub rdi, rcx
lea r8, str.WebCubeAgent.log
lea rcx, [rsp + rcx + 0x71]
mov rdx, rdi
call fcn.14001d97c
jmp 0x14001c699
lea r8, str.WebCubeAgent.log
lea rcx, [rsp + 0x70]
mov edx, 0x104
call fcn.14001d97c
xor ebp, ebp
lea rcx, [rsp + 0x70]
xor r9d, r9d
mov qword [rsp + 0x30], rbp
lea r8d, [rbp + 3]
mov edx, 0xc0000000
mov dword [rsp + 0x28], ebp
mov qword [rsp + 0x440], rbx
mov dword [rsp + 0x20], 4
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [0x1400345e0], rax
cmp rax, 0xffffffffffffffff
jne 0x14001c7f6
lea rdx, [rsp + 0x180]
mov ecx, 0x104
call qword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x14001ca20
or rcx, 0xffffffffffffffff
xor eax, eax
lea rdi, [rsp + 0x180]
repne scasb al, byte [rdi]
mov qword [rsp + 0x450], rsi
not rcx
cmp byte [rsp + rcx + 0x17e], 0x5c
lea rsi, [rcx - 1]
je 0x14001c72b
mov byte [rsp + rcx + 0x17e], 0x5c
inc rsi
or rcx, 0xffffffffffffffff
lea rdi, [rsp + 0x70]
repne scasb al, byte [rdi]
not rcx
lea rdi, [rcx - 1]
nop dword [rax]
cmp byte [rsp + rdi + 0x70], 0x5c
je 0x14001c74c
dec rdi
jmp 0x14001c740
lea rbx, [rdi - 1]
movzx eax, byte [rsp + rbx + 0x70]
cmp al, 0x5c
je 0x14001c762
cmp al, 0x3a
je 0x14001c762
dec rbx
jmp 0x14001c750
lea rax, [rbx + 1]
mov edx, 0x104
lea rcx, [rsp + rsi + 0x180]
cmp rax, rdi
cmove rbx, rax
sub rdx, rsi
lea r8, [rsp + rbx + 0x71]
call fcn.14001d97c
cmp rdi, rbx
je 0x14001c7b2
sub rdi, rbx
lea rcx, [rsp + 0x180]
xor edx, edx
add rdi, rsi
mov byte [rsp + rdi + 0x17f], bpl
call qword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov byte [rsp + rdi + 0x17f], 0x5c
xor r9d, r9d
mov qword [rsp + 0x30], rbp
lea rcx, [rsp + 0x180]
lea r8d, [r9 + 3]
mov edx, 0xc0000000
mov dword [rsp + 0x28], ebp
mov dword [rsp + 0x20], 4
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rsi, qword [rsp + 0x450]
mov qword [0x1400345e0], rax
cmp rax, 0xffffffffffffffff
je 0x14001ca20
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0x4c4b40
jbe 0x14001c839
xor r9d, r9d
mov qword [rsp + 0x30], rbp
lea rcx, [rsp + 0x70]
lea r8d, [r9 + 3]
mov edx, 0xc0000000
mov dword [rsp + 0x28], ebp
mov dword [rsp + 0x20], 5
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [0x1400345e0]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_GetFileSize]
lea rbx, [0x140019000]
test eax, eax
jne 0x14001c8c7
mov rax, qword [rbx + 0x17630]
lea rcx, [rsp + 0x48]
lea rdi, [rsp + 0x48]
mov qword [rcx], rax
mov rax, qword [rbx + 0x17638]
lea r9, [rsp + 0x40]
mov qword [rcx + 8], rax
mov rax, qword [rbx + 0x17640]
lea rdx, [rsp + 0x48]
mov qword [rcx + 0x10], rax
mov rax, qword [rbx + 0x17648]
mov qword [rsp + 0x20], rbp
mov qword [rcx + 0x18], rax
mov eax, dword [rbx + 0x17650]
mov dword [rcx + 0x20], eax
movzx eax, word [rbx + 0x17654]
mov word [rcx + 0x24], ax
or rcx, 0xffffffffffffffff
xor eax, eax
repne scasb al, byte [rdi]
not rcx
lea r8, [rcx - 1]
mov rcx, qword [0x1400345e0]
call qword [sym.imp.KERNEL32.dll_WriteFile]
lea rdx, [0x140034610]
mov r8d, 0x104
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov eax, eax
cmp byte [rax + rbx + 0x1b610], 0x5c
je 0x14001c8fd
nop dword [rax + rax]
dec rax
cmp byte [rax + rbx + 0x1b610], 0x5c
jne 0x14001c8f0
test rax, rax
je 0x14001c91b
lea r8, [rax + rbx + 0x1b611]
lea rcx, [0x140034610]
mov edx, 0x104
call fcn.14001d97c
lea rcx, [rsp + 0x70]
mov edx, 0x104
call fcn.14001dc50
lea r8, str.Global_
lea rcx, [rsp + 0x290]
mov edx, 0x118
call fcn.14001d97c
lea r8, [rsp + 0x70]
lea rcx, [rsp + 0x290]
mov edx, 0x118
call fcn.14001d9f8
lea r8, str.__HisLog
lea rcx, [rsp + 0x290]
mov edx, 0x118
call fcn.14001d9f8
cmp byte [rsp + 0x290], bpl
je 0x14001c995
lea rax, [rsp + 0x290]
cmp byte [rax], 0x5c
jne 0x14001c98d
mov byte [rax], 0x2f
inc rax
cmp byte [rax], bpl
jne 0x14001c985
mov edx, 1
lea r9, [rsp + 0x290]
xor ecx, ecx
mov r8d, edx
call qword [sym.imp.KERNEL32.dll_CreateSemaphoreA]
mov qword [0x1400345e8], rax
test rax, rax
jne 0x14001c9d8
mov rcx, qword [0x1400345e0]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [0x1400345e0], 0xffffffffffffffff
mov eax, 1
jmp 0x14001ca35
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventA]
mov qword [0x140034608], rax
test rax, rax
jne 0x14001ca27
mov rcx, qword [0x1400345e0]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [0x1400345e8]
mov qword [0x1400345e0], 0xffffffffffffffff
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [0x1400345e8], rbp
mov eax, 1
jmp 0x14001ca35
mov dword [0x140034600], ebp
mov dword [0x140034604], ebp
xor eax, eax
mov rbx, qword [rsp + 0x440]
mov rbp, qword [rsp + 0x448]
mov rcx, qword [rsp + 0x420]
xor rcx, rsp
call fcn.14001d3f0
add rsp, 0x430
pop rdi
ret