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

Disassembly:
sub esp, 0x48
mov eax, dword [0x422760]
xor eax, esp
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x50]
push ebp
mov ebp, dword [esp + 0x58]
push edi
mov edi, dword [esp + 0x54]
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], eax
test ebp, ebp
jne 0x401111
lea ebp, [esp + 0xc]
mov ecx, ebp
push ecx
call fcn.00401000
add esp, 4
test eax, eax
je 0x401111
pop edi
mov eax, 1
pop ebp
mov ecx, dword [esp + 0x44]
xor ecx, esp
call fcn.00412cdc
add esp, 0x48
ret
push ebx
push esi
push 2
push edi
push 0x41d450
call fcn.00412c36
add esp, 0xc
test eax, eax
je 0x401173
mov eax, edi
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x401130
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
sub eax, edx
sar eax, 1
lea eax, [eax + eax + 2]
push eax
push 0
mov dword [esp + 0x24], eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x4011c3
mov ecx, dword [esp + 0x1c]
push ecx
push edi
push esi
call fcn.00412760
add esp, 0xc
jmp 0x40122b
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x38]
push eax
mov dword [esp + 0x24], 0x10
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x401190
mov ecx, dword [esp + 0x1c]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
sub eax, edx
sar eax, 1
add ecx, eax
mov dword [esp + 0x1c], ecx
add ecx, ecx
push ecx
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
jne 0x40120d
push str.username_sid
push str.expanded
push 0xc00001fa
call fcn.0041257c
add eax, 0x40
push eax
call fcn.00405470
lea edx, [esp + 0x24]
add esp, 0x10
cmp ebp, edx
jne 0x4011f5
mov eax, dword [esp + 0x14]
push eax
call sub.ADVAPI32.dll_LsaClose
pop esi
pop ebx
pop edi
mov eax, 2
pop ebp
mov ecx, dword [esp + 0x44]
xor ecx, esp
call fcn.00412cdc
add esp, 0x48
ret
mov edx, dword [esp + 0x1c]
add edi, 4
push edi
lea ecx, [esp + 0x38]
push ecx
push 0x41d414
push 0xffffffffffffffff
push edx
push esi
call fcn.00412731
add esp, 0x18
mov eax, esi
mov dword [esp + 0x2c], esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x401234
sub eax, edx
sar eax, 1
add eax, eax
mov word [esp + 0x28], ax
mov ecx, dword [esp + 0x28]
add ecx, 2
lea edx, [esp + 0x10]
push edx
mov edx, dword [ebp]
lea eax, [esp + 0x1c]
push eax
mov word [esp + 0x32], cx
lea ecx, [esp + 0x30]
push ecx
push 1
push edx
call sub.ADVAPI32.dll_LsaLookupNames
push esi
push 0
mov edi, eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea eax, [esp + 0x14]
cmp ebp, eax
jne 0x401290
mov ecx, dword [esp + 0x14]
push ecx
call sub.ADVAPI32.dll_LsaClose
test edi, edi
je 0x4012eb
mov edx, dword [esp + 0x18]
push edx
call sub.ADVAPI32.dll_LsaFreeMemory
mov eax, dword [esp + 0x10]
push eax
call sub.ADVAPI32.dll_LsaFreeMemory
push edi
call sub.ADVAPI32.dll_LsaNtStatusToWinError
push eax
call fcn.004052c0
mov ecx, dword [esp + 0x24]
add esp, 4
push eax
push ecx
push 0x40000207
call fcn.0041257c
add eax, 0x40
push eax
call fcn.00405470
add esp, 0x10
pop esi
pop ebx
pop edi
mov eax, 5
pop ebp
mov ecx, dword [esp + 0x44]
xor ecx, esp
call fcn.00412cdc
add esp, 0x48
ret
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx]
cmp eax, 1
je 0x401331
cmp eax, 5
je 0x401331
mov edx, dword [esp + 0x18]
push edx
call sub.ADVAPI32.dll_LsaFreeMemory
mov eax, dword [esp + 0x10]
push eax
call sub.ADVAPI32.dll_LsaFreeMemory
mov ecx, dword [esp + 0x20]
push ecx
push 0x4000022f
call fcn.0041257c
add eax, 0x40
push eax
call fcn.00405470
mov eax, 6
jmp 0x401546
mov eax, dword [ecx + 8]
lea edx, [eax + eax*2]
mov eax, dword [esp + 0x18]
mov ecx, dword [eax + 4]
lea esi, [ecx + edx*4]
mov dword [esp + 0x30], esi
test esi, esi
je 0x401515
mov edx, dword [esi + 8]
push edx
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
je 0x401515
mov eax, dword [esi + 8]
push eax
call dword [sym.imp.ADVAPI32.dll_GetSidSubAuthorityCount]
mov edi, eax
mov cl, byte [edi]
inc cl
movzx edx, cl
push edx
call dword [sym.imp.ADVAPI32.dll_GetSidLengthRequired]
push eax
push 8
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebp, dword [esp + 0x24]
mov dword [ebp], eax
test eax, eax
jne 0x4013dc
mov eax, dword [esp + 0x18]
push eax
call sub.ADVAPI32.dll_LsaFreeMemory
mov ecx, dword [esp + 0x10]
push ecx
call sub.ADVAPI32.dll_LsaFreeMemory
push str.username_sid
push 0x41d40c
push 0xc00001fa
call fcn.0041257c
add eax, 0x40
push eax
call fcn.00405470
add esp, 0x10
pop esi
pop ebx
pop edi
mov eax, 8
pop ebp
mov ecx, dword [esp + 0x44]
xor ecx, esp
call fcn.00412cdc
add esp, 0x48
ret
mov dl, byte [edi]
mov ecx, dword [esi + 8]
inc dl
movzx eax, dl
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_GetSidIdentifierAuthority]
mov edx, dword [ebp]
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_InitializeSid]
test eax, eax
jne 0x401465
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov eax, dword [ebp]
push eax
push 0
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [esp + 0x18]
push ecx
call sub.ADVAPI32.dll_LsaFreeMemory
mov edx, dword [esp + 0x10]
push edx
call sub.ADVAPI32.dll_LsaFreeMemory
push esi
call fcn.004052c0
add esp, 4
push eax
mov eax, dword [esp + 0x24]
push eax
push 0x40000208
call fcn.0041257c
add eax, 0x40
push eax
call fcn.00405470
add esp, 0x10
pop esi
pop ebx
pop edi
mov eax, 9
pop ebp
mov ecx, dword [esp + 0x44]
xor ecx, esp
call fcn.00412cdc
add esp, 0x48
ret
xor bl, bl
jmp 0x401474
mov ebp, dword [esp + 0x24]
mov ecx, dword [ebp]
movzx esi, bl
push esi
push ecx
call dword [sym.imp.ADVAPI32.dll_GetSidSubAuthority]
mov ebp, eax
cmp bl, byte [edi]
jae 0x40149e
mov edx, dword [esp + 0x30]
mov eax, dword [edx + 8]
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_GetSidSubAuthority]
mov ecx, dword [eax]
mov dword [ebp], ecx
jmp 0x4014a8
mov edx, dword [esp + 0x10]
mov eax, dword [edx + 4]
mov dword [ebp], eax
inc bl
cmp bl, byte [edi]
jbe 0x401470
mov ecx, dword [esp + 0x10]
xor esi, esi
cmp dword [ecx], 5
jne 0x4014ec
mov edx, dword [esp + 0x24]
mov eax, dword [edx]
push eax
call fcn.00401070
add esp, 4
test eax, eax
jne 0x4014ec
mov ecx, dword [esp + 0x20]
push ecx
push 0x4000022f
call fcn.0041257c
add eax, 0x40
push eax
call fcn.00405470
add esp, 0xc
mov esi, 0xa
mov edx, dword [esp + 0x18]
push edx
call sub.ADVAPI32.dll_LsaFreeMemory
mov eax, dword [esp + 0x10]
push eax
call sub.ADVAPI32.dll_LsaFreeMemory
mov eax, esi
pop esi
pop ebx
pop edi
pop ebp
mov ecx, dword [esp + 0x44]
xor ecx, esp
call fcn.00412cdc
add esp, 0x48
ret
mov ecx, dword [esp + 0x18]
push ecx
call sub.ADVAPI32.dll_LsaFreeMemory
mov edx, dword [esp + 0x10]
push edx
call sub.ADVAPI32.dll_LsaFreeMemory
mov eax, dword [esp + 0x20]
push eax
push 0x4000022f
call fcn.0041257c
add eax, 0x40
push eax
call fcn.00405470
mov eax, 7
mov ecx, dword [esp + 0x60]
add esp, 0xc
pop esi
pop ebx
pop edi
pop ebp
xor ecx, esp
call fcn.00412cdc
add esp, 0x48
ret