Function at 0x140001220
Capabilities:
Get hostname

Disassembly:
push rbx
push r13
push r14
sub rsp, 0xb0
mov rax, qword [0x140030f90]
xor rax, rsp
mov qword [rsp + 0x80], rax
mov rbx, r8
mov r14, rdx
mov r13, rcx
test r8, r8
jne 0x14000126a
lea rcx, [rsp + 0x40]
lea rbx, [rsp + 0x40]
call fcn.140001000
test eax, eax
je 0x14000126a
mov eax, 1
jmp 0x1400015c7
lea rcx, [0x14002691c]
mov r8d, 2
mov rdx, r13
mov qword [rsp + 0xa0], rsi
mov qword [rsp + 0x98], rdi
call fcn.14001873c
test eax, eax
je 0x1400012dc
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, r13
repne scasw ax, word [rdi]
not rcx
lea eax, [rcx + rcx]
mov dword [rsp + 0x30], eax
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rdi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rsi, rax
test rax, rax
je 0x140001331
mov r8d, dword [rsp + 0x30]
mov rdx, r13
mov rcx, rax
call fcn.140018230
jmp 0x14000139a
lea rdx, [rsp + 0x30]
lea rcx, [rsp + 0x60]
mov dword [rsp + 0x30], 0x10
call qword [sym.imp.KERNEL32.dll_GetComputerNameW]
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, r13
repne scasw ax, word [rdi]
mov eax, dword [rsp + 0x30]
not rcx
dec rcx
add eax, ecx
mov edi, eax
mov dword [rsp + 0x30], eax
add rdi, rdi
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rdi
mov rcx, rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rsi, rax
test rax, rax
jne 0x140001370
call fcn.140017f4c
lea r9, str.username_sid
lea r8, str.expanded
lea rcx, [rax + 0x60]
mov edx, 0xc00001fa
call fcn.1400026b0
lea rdx, [rsp + 0x40]
cmp rbx, rdx
jne 0x140001366
mov rcx, qword [rsp + 0x40]
call sub.ADVAPI32.dll_LsaClose
mov eax, 2
jmp 0x1400015b7
mov edx, dword [rsp + 0x30]
lea rax, [r13 + 4]
lea r9, [0x1400267a0]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x60]
or r8, 0xffffffffffffffff
mov rcx, rsi
mov qword [rsp + 0x20], rax
call fcn.140018170
lea r8, [rsp + 0x50]
lea rdx, [rsp + 0x58]
mov rcx, rsi
call fcn.140017e40
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rsi
mov rcx, rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
je 0x140001405
lea rax, [rsp + 0x40]
cmp rbx, rax
jne 0x1400013da
mov rcx, qword [rsp + 0x40]
call sub.ADVAPI32.dll_LsaClose
call fcn.140017f4c
lea r9, str.username_sid__
lea r8, str.LSA_UNICODE_STRING
lea rcx, [rax + 0x60]
mov edx, 0xc00001fa
call fcn.1400026b0
mov eax, 4
jmp 0x1400015b7
movzx eax, word [rsp + 0x50]
mov rcx, qword [rbx]
lea r9, [rsp + 0x48]
add ax, ax
lea r8, [rsp + 0x50]
mov edx, 1
mov word [rsp + 0x50], ax
add ax, 2
mov word [rsp + 0x52], ax
lea rax, [rsp + 0x38]
mov qword [rsp + 0x20], rax
call sub.ADVAPI32.dll_LsaLookupNames
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x58]
mov rcx, rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
lea r11, [rsp + 0x40]
cmp rbx, r11
jne 0x140001468
mov rcx, qword [rsp + 0x40]
call sub.ADVAPI32.dll_LsaClose
test edi, edi
je 0x1400014b4
mov rcx, qword [rsp + 0x48]
call sub.ADVAPI32.dll_LsaFreeMemory
mov rcx, qword [rsp + 0x38]
call sub.ADVAPI32.dll_LsaFreeMemory
mov ecx, edi
call sub.ADVAPI32.dll_LsaNtStatusToWinError
mov ecx, eax
call fcn.140002430
mov rdi, rax
call fcn.140017f4c
mov r9, rdi
lea rcx, [rax + 0x60]
mov r8, r13
mov edx, 0x40000207
call fcn.1400026b0
mov eax, 5
jmp 0x1400015b7
mov rcx, qword [rsp + 0x38]
mov eax, dword [rcx]
cmp eax, 1
je 0x1400014ee
cmp eax, 5
je 0x1400014ee
cmp eax, 8
jne 0x1400015e4
lea r8d, [rax + 3]
lea rcx, str.NT_Service_
mov rdx, r13
call fcn.14001873c
test eax, eax
jne 0x1400015e4
mov rcx, qword [rsp + 0x38]
movsxd rax, dword [rcx + 8]
mov rdx, qword [rsp + 0x48]
mov qword [rsp + 0x90], r12
lea rcx, [rax + rax*2]
mov rax, qword [rdx + 8]
lea r12, [rax + rcx*8]
test r12, r12
je 0x140001732
mov rcx, qword [r12 + 0x10]
call qword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
je 0x14000172d
mov rcx, qword [r12 + 0x10]
mov qword [rsp + 0xa8], rbp
call qword [sym.imp.ADVAPI32.dll_GetSidSubAuthorityCount]
mov rbp, rax
movzx ecx, byte [rax]
inc cl
call qword [sym.imp.ADVAPI32.dll_GetSidLengthRequired]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rdi
mov rcx, rax
mov edx, 8
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [r14], rax
test rax, rax
jne 0x140001615
mov rcx, qword [rsp + 0x48]
call sub.ADVAPI32.dll_LsaFreeMemory
mov rcx, qword [rsp + 0x38]
call sub.ADVAPI32.dll_LsaFreeMemory
call fcn.140017f4c
lea r9, str.username_sid
lea r8, [0x140026880]
lea rcx, [rax + 0x60]
mov edx, 0xc00001fa
call fcn.1400026b0
mov eax, 8
mov rbp, qword [rsp + 0xa8]
mov r12, qword [rsp + 0x90]
mov rsi, qword [rsp + 0xa0]
mov rdi, qword [rsp + 0x98]
mov rcx, qword [rsp + 0x80]
xor rcx, rsp
call fcn.140018800
add rsp, 0xb0
pop r14
pop r13
pop rbx
ret
mov rcx, qword [rsp + 0x48]
call sub.ADVAPI32.dll_LsaFreeMemory
mov rcx, qword [rsp + 0x38]
call sub.ADVAPI32.dll_LsaFreeMemory
call fcn.140017f4c
mov r8, r13
lea rcx, [rax + 0x60]
mov edx, 0x40000232
call fcn.1400026b0
mov eax, 6
jmp 0x1400015b7
movzx edi, byte [rbp]
mov rcx, qword [r12 + 0x10]
inc dil
call qword [sym.imp.ADVAPI32.dll_GetSidIdentifierAuthority]
mov rcx, qword [r14]
mov rdx, rax
movzx r8d, dil
call qword [sym.imp.ADVAPI32.dll_InitializeSid]
test eax, eax
jne 0x140001698
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [r14]
mov rcx, rax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [rsp + 0x48]
call sub.ADVAPI32.dll_LsaFreeMemory
mov rcx, qword [rsp + 0x38]
call sub.ADVAPI32.dll_LsaFreeMemory
mov ecx, edi
call fcn.140002430
mov rdi, rax
call fcn.140017f4c
mov r9, rdi
lea rcx, [rax + 0x60]
mov r8, r13
mov edx, 0x40000208
call fcn.1400026b0
mov eax, 9
jmp 0x1400015a7
xor dil, dil
nop dword [rax + rax]
mov rcx, qword [r14]
movzx esi, dil
mov edx, esi
call qword [sym.imp.ADVAPI32.dll_GetSidSubAuthority]
mov rbx, rax
cmp dil, byte [rbp]
jae 0x1400016cb
mov rcx, qword [r12 + 0x10]
mov edx, esi
call qword [sym.imp.ADVAPI32.dll_GetSidSubAuthority]
mov ecx, dword [rax]
mov dword [rbx], ecx
jmp 0x1400016d5
mov rax, qword [rsp + 0x38]
mov ecx, dword [rax + 4]
mov dword [rbx], ecx
inc dil
cmp dil, byte [rbp]
jbe 0x1400016a0
mov rax, qword [rsp + 0x38]
xor edi, edi
cmp dword [rax], 5
jne 0x140001712
mov rcx, qword [r14]
call fcn.1400011a0
test rax, rax
jne 0x140001712
call fcn.140017f4c
mov r8, r13
mov edx, 0x40000232
lea rcx, [rax + 0x60]
call fcn.1400026b0
mov edi, 0xa
mov rcx, qword [rsp + 0x48]
call sub.ADVAPI32.dll_LsaFreeMemory
mov rcx, qword [rsp + 0x38]
call sub.ADVAPI32.dll_LsaFreeMemory
mov eax, edi
jmp 0x1400015a7
mov rdx, qword [rsp + 0x48]
mov rcx, rdx
call sub.ADVAPI32.dll_LsaFreeMemory
mov rcx, qword [rsp + 0x38]
call sub.ADVAPI32.dll_LsaFreeMemory
call fcn.140017f4c
mov r8, r13
lea rcx, [rax + 0x60]
mov edx, 0x40000232
call fcn.1400026b0
mov eax, 7
jmp 0x1400015af