Function at 0x10016050
Capabilities:
Get hostname
Get session information
Get session user name

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1006bd06
mov eax, dword fs:[0]
push eax
sub esp, 0x450
mov eax, dword [0x10086e84]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
lea eax, [ebp - 0x454]
push eax
push 1
xor edi, edi
push 0xc
mov esi, ecx
mov dword [ebp - 0x454], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenThreadToken]
cmp dword [ebp - 0x454], edi
je 0x100160ae
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov eax, dword [esi]
cmp eax, edi
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [ebp - 4], edi
je 0x100160ca
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebx
mov dword [esi], edi
mov eax, dword [esi + 4]
cmp eax, edi
je 0x100160df
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebx
mov dword [esi + 4], edi
mov eax, dword [esi + 8]
cmp eax, edi
je 0x100160f0
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [esi + 8], edi
mov eax, dword [esi + 0xc]
cmp eax, edi
je 0x10016101
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 0xc], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea ecx, [ebp - 0x450]
push ecx
push eax
mov dword [ebp - 0x450], edi
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
mov ebx, eax
cmp ebx, edi
je 0x100163db
lea ecx, [esi + 0x10]
call fcn.100107a0
cmp eax, edi
je 0x10016144
cmp word [eax], di
je 0x10016144
push edi
push eax
mov ecx, esi
call fcn.100135f0
jmp 0x10016245
xor eax, eax
lea edx, [ebp - 0x458]
mov dword [ebp - 0x2e], eax
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x26], eax
mov dword [ebp - 0x22], eax
mov dword [ebp - 0x1e], eax
mov dword [ebp - 0x1a], eax
mov dword [ebp - 0x16], eax
mov word [ebp - 0x12], ax
push edx
lea eax, [ebp - 0x30]
push eax
mov word [ebp - 0x30], di
mov dword [ebp - 0x458], 0x10
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
lea ecx, [ebp - 0x30]
push ecx
call sub.WTSAPI32.dll_WTSOpenServerW
mov ebx, eax
cmp ebx, edi
je 0x1001624d
mov ecx, dword [ebp - 0x450]
lea edx, [ebp - 0x448]
push edx
lea eax, [ebp - 0x44c]
push eax
push 5
push ecx
push ebx
mov dword [ebp - 0x44c], edi
mov dword [ebp - 0x448], edi
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
cmp eax, edi
mov dword [ebp - 0x45c], eax
je 0x10016239
cmp dword [ebp - 0x44c], edi
je 0x10016239
mov ecx, dword [ebp - 0x450]
lea edx, [ebp - 0x448]
push edx
lea eax, [ebp - 0x444]
push eax
push 7
push ecx
push ebx
mov dword [ebp - 0x444], edi
mov dword [ebp - 0x448], edi
call sub.WTSAPI32.dll_WTSQuerySessionInformationW
mov edx, dword [ebp - 0x444]
mov eax, dword [ebp - 0x44c]
push edx
push eax
mov ecx, esi
call fcn.100135f0
mov eax, dword [ebp - 0x444]
cmp eax, edi
je 0x10016220
push eax
call sub.WTSAPI32.dll_WTSFreeMemory
mov dword [ebp - 0x444], edi
mov ecx, dword [ebp - 0x44c]
push ecx
call sub.WTSAPI32.dll_WTSFreeMemory
mov ecx, esi
mov dword [ebp - 0x44c], edi
call fcn.10013750
push ebx
call sub.WTSAPI32.dll_WTSCloseServer
mov ebx, dword [ebp - 0x45c]
cmp ebx, edi
jne 0x100163db
cmp dword [ebp - 0x450], edi
jne 0x100163db
mov dword [ebp - 0x444], edi
push 0x2001f
push str.SoftwareMicrosoftWindows_NTCurrentVersionWinlogon
push reloc.OLEAUT32.dll_SysReAllocString
lea ecx, [ebp - 0x444]
mov byte [ebp - 4], 1
call fcn.100020c0
test eax, eax
jne 0x100163a4
push 0x206
lea edx, [ebp - 0x236]
push edi
push edx
mov word [ebp - 0x238], di
call fcn.10042010
add esp, 0xc
lea eax, [ebp - 0x448]
push eax
lea ecx, [ebp - 0x238]
push ecx
mov ebx, 0x104
push str.AltDefaultUserName
lea ecx, [ebp - 0x444]
mov dword [ebp - 0x448], ebx
call fcn.100126f0
test eax, eax
jne 0x100163a4
cmp word [ebp - 0x238], di
je 0x100163a4
push 0x206
lea edx, [ebp - 0x43e]
push edi
push edx
mov word [ebp - 0x440], di
call fcn.10042010
add esp, 0xc
lea eax, [ebp - 0x448]
push eax
lea ecx, [ebp - 0x440]
push ecx
push str.AltDefaultDomainName
lea ecx, [ebp - 0x444]
mov dword [ebp - 0x448], ebx
call fcn.100126f0
cmp word [ebp - 0x440], di
jne 0x1001638f
lea eax, [ebp - 0x238]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x10016331
sub eax, edx
sar eax, 1
mov ecx, edi
je 0x1001638f
mov edx, 0x40
lea esp, [esp]
cmp word [ebp + ecx*2 - 0x238], dx
je 0x10016363
add ecx, 1
cmp ecx, eax
jb 0x10016350
jmp 0x1001638f
lea eax, [ebp + ecx*2 - 0x236]
lea edx, [ebp - 0x440]
mov word [ebp + ecx*2 - 0x238], di
sub edx, eax
lea ebx, [ebx]
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
cmp cx, di
jne 0x10016380
lea edx, [ebp - 0x440]
push edx
lea eax, [ebp - 0x238]
push eax
mov ecx, esi
call fcn.100135f0
mov eax, dword [esi]
cmp eax, edi
je 0x100163af
cmp word [eax], di
jne 0x100163b6
mov ecx, esi
call fcn.100136c0
mov eax, dword [esi]
cmp eax, edi
je 0x100163ca
cmp word [eax], di
je 0x100163ca
push eax
lea ecx, [esi + 0x10]
call fcn.10010700
mov eax, dword [ebp - 0x444]
cmp eax, edi
je 0x100163db
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [esi]
cmp esi, edi
je 0x100163ed
cmp word [esi], di
je 0x100163ed
mov esi, 1
jmp 0x100163ef
xor esi, esi
mov eax, dword [ebp - 0x454]
cmp eax, edi
je 0x1001640d
push eax
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
mov ecx, dword [ebp - 0x454]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.10041ffa
mov esp, ebp
pop ebp
ret