Function at 0x401070
Capabilities:
Get hostname
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x4c
mov eax, dword [0x424284]
xor eax, esp
mov dword [esp + 0x48], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [esp + 0x20], eax
mov eax, dword [ebp + 0xc]
push esi
mov ebx, ecx
push edi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x4010cd
lea ecx, [esp + 0x14]
mov edx, ecx
push edx
mov dword [esp + 0x20], ecx
call fcn.00401000
add esp, 4
test eax, eax
je 0x4010cd
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0041427b
mov esp, ebp
pop ebp
ret
push 2
push ebx
push 0x41fbe0
call fcn.0041475d
add esp, 0xc
test eax, eax
je 0x40117c
mov eax, ebx
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4010f0
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
sub eax, edx
sar eax, 1
lea eax, [eax + eax + 2]
push eax
push 0
mov dword [esp + 0x28], eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
jne 0x40116b
push str.username_sid
push str.expanded
push 0xc00001fa
call fcn.004147fb
add eax, 0x40
push eax
call fcn.00402220
lea eax, [esp + 0x24]
add esp, 0x10
cmp dword [esp + 0x1c], eax
jne 0x401154
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_LsaClose]
mov eax, 2
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0041427b
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0x20]
push edx
push ebx
push edi
call fcn.00414290
add esp, 0xc
jmp 0x4011f6
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x38]
push ecx
mov dword [esp + 0x28], 0x10
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
mov eax, ebx
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4011a0
mov ecx, dword [esp + 0x20]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
sub eax, edx
sar eax, 1
add ecx, eax
lea edx, [ecx + ecx]
push edx
push 0
mov dword [esp + 0x28], ecx
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
test edi, edi
je 0x40111f
mov eax, dword [esp + 0x20]
add ebx, 4
push ebx
lea edx, [esp + 0x38]
push edx
push 0x41fc18
push 0xffffffffffffffff
push eax
push edi
call fcn.004149b0
add esp, 0x18
lea ecx, [esp + 0x2c]
push ecx
push edi
lea ebx, [esp + 0x38]
call fcn.004141e0
add esp, 8
push edi
push 0
mov ebx, eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
test ebx, ebx
je 0x401266
lea edx, [esp + 0x14]
cmp dword [esp + 0x1c], edx
jne 0x40122f
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_LsaClose]
push str.username_sid__
push str.LSA_UNICODE_STRING
push 0xc00001fa
call fcn.004147fb
add eax, 0x40
push eax
call fcn.00402220
add esp, 0x10
mov eax, 4
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0041427b
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x2c]
mov ebx, dword [esp + 0x1c]
lea edx, [ecx + ecx]
mov word [esp + 0x2c], dx
mov eax, dword [esp + 0x2c]
add eax, 2
lea ecx, [esp + 0x10]
push ecx
mov ecx, dword [ebx]
lea edx, [esp + 0x1c]
push edx
mov word [esp + 0x36], ax
lea eax, [esp + 0x34]
push eax
push 1
push ecx
call dword [sym.imp.ADVAPI32.dll_LsaLookupNames]
mov edx, dword [esp + 0x30]
push edx
push 0
mov edi, eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea eax, [esp + 0x14]
cmp ebx, eax
jne 0x4012c1
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_LsaClose]
test edi, edi
je 0x40131a
mov edx, dword [esp + 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_LsaFreeMemory]
push edx
call esi
mov eax, dword [esp + 0x10]
push eax
call esi
push edi
call dword [sym.imp.ADVAPI32.dll_LsaNtStatusToWinError]
mov edi, eax
call fcn.00402080
mov ecx, dword [esp + 0x24]
push eax
push ecx
push 0x40000207
call fcn.004147fb
add eax, 0x40
push eax
call fcn.00402220
add esp, 0x10
mov eax, 5
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0041427b
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0x10]
mov eax, dword [edx]
cmp eax, 1
je 0x40138d
cmp eax, 5
je 0x40138d
cmp eax, 8
jne 0x401347
mov eax, dword [esp + 0x24]
push 0xb
push eax
push str.NT_Service_
call fcn.0041475d
add esp, 0xc
test eax, eax
je 0x40138d
mov ecx, dword [esp + 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_LsaFreeMemory]
push ecx
call esi
mov edx, dword [esp + 0x10]
push edx
call esi
mov eax, dword [esp + 0x24]
push eax
push 0x40000232
call fcn.004147fb
add eax, 0x40
push eax
call fcn.00402220
mov eax, 6
add esp, 0xc
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0041427b
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx + 8]
lea edx, [eax + eax*2]
mov eax, dword [esp + 0x18]
mov ecx, dword [eax + 4]
lea edi, [ecx + edx*4]
mov dword [esp + 0x1c], edi
test edi, edi
je 0x401572
mov edx, dword [edi + 8]
push edx
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
je 0x401572
mov eax, dword [edi + 8]
push eax
call dword [sym.imp.ADVAPI32.dll_GetSidSubAuthorityCount]
mov ebx, eax
mov cl, byte [ebx]
inc cl
movzx edx, cl
push edx
call dword [sym.imp.ADVAPI32.dll_GetSidLengthRequired]
push eax
push 8
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [esp + 0x28]
mov dword [ecx], eax
test eax, eax
jne 0x40143a
mov edx, dword [esp + 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_LsaFreeMemory]
push edx
call esi
mov eax, dword [esp + 0x10]
push eax
call esi
push str.username_sid
push 0x41fc9c
push 0xc00001fa
call fcn.004147fb
add eax, 0x40
push eax
call fcn.00402220
add esp, 0x10
mov eax, 8
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0041427b
mov esp, ebp
pop ebp
ret
mov cl, byte [ebx]
mov eax, dword [edi + 8]
inc cl
movzx edx, cl
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_GetSidIdentifierAuthority]
mov edi, dword [esp + 0x2c]
mov ecx, dword [edi]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_InitializeSid]
test eax, eax
jne 0x4014c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [edi]
push edx
push 0
mov ebx, eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_LsaFreeMemory]
push eax
call esi
mov ecx, dword [esp + 0x10]
push ecx
call esi
mov edi, ebx
call fcn.00402080
mov edx, dword [esp + 0x24]
push eax
push edx
push 0x40000208
call fcn.004147fb
add eax, 0x40
push eax
call fcn.00402220
add esp, 0x10
mov eax, 9
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0041427b
mov esp, ebp
pop ebp
ret
mov byte [esp + 0xf], 0
movzx edi, byte [esp + 0xf]
mov eax, dword [esp + 0x28]
mov ecx, dword [eax]
push edi
push ecx
call dword [sym.imp.ADVAPI32.dll_GetSidSubAuthority]
mov dl, byte [esp + 0xf]
mov esi, eax
cmp dl, byte [ebx]
jae 0x4014f9
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + 8]
push edi
push ecx
call dword [sym.imp.ADVAPI32.dll_GetSidSubAuthority]
mov edx, dword [eax]
mov dword [esi], edx
jmp 0x401502
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 4]
mov dword [esi], ecx
mov al, byte [esp + 0xf]
inc al
mov byte [esp + 0xf], al
cmp al, byte [ebx]
jbe 0x4014c7
mov edx, dword [esp + 0x10]
xor edi, edi
cmp dword [edx], 5
jne 0x40154a
mov eax, dword [esp + 0x28]
mov esi, dword [eax]
call fcn.00401900
test eax, eax
jne 0x40154a
mov ecx, dword [esp + 0x24]
push ecx
push 0x40000232
call fcn.004147fb
add eax, 0x40
push eax
call fcn.00402220
add esp, 0xc
mov edi, 0xa
mov edx, dword [esp + 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_LsaFreeMemory]
push edx
call esi
mov eax, dword [esp + 0x10]
push eax
call esi
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.0041427b
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x18]
mov esi, dword [sym.imp.ADVAPI32.dll_LsaFreeMemory]
push ecx
call esi
mov edx, dword [esp + 0x10]
push edx
call esi
mov eax, dword [esp + 0x24]
push eax
push 0x40000232
call fcn.004147fb
add eax, 0x40
push eax
call fcn.00402220
mov ecx, dword [esp + 0x60]
add esp, 0xc
pop edi
pop esi
pop ebx
xor ecx, esp
mov eax, 7
call fcn.0041427b
mov esp, ebp
pop ebp
ret