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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41cbe6
mov eax, dword fs:[0]
push eax
sub esp, 0x450
mov eax, dword [0x426168]
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 0x402e0e
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov dword [ebp - 4], edi
mov eax, dword [esi]
cmp eax, edi
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
je 0x402e2a
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 0x402e3f
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 0x402e50
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [esi + 8], edi
mov eax, dword [esi + 0xc]
cmp eax, edi
je 0x402e61
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 0x40314b
lea ecx, [esi + 0x10]
call fcn.00408f00
cmp eax, edi
je 0x402ea4
cmp word [eax], di
je 0x402ea4
push edi
push eax
mov ecx, esi
call fcn.00402b10
jmp 0x402fb6
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 0x402fbe
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 0x402faa
cmp dword [ebp - 0x44c], edi
je 0x402faa
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.00402b10
mov eax, dword [ebp - 0x444]
cmp eax, edi
je 0x402f84
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 eax, dword [esi]
cmp eax, edi
mov dword [ebp - 0x44c], edi
je 0x402faa
cmp word [eax], di
je 0x402faa
push eax
lea ecx, [esi + 0x10]
call fcn.00408e60
push ebx
call sub.WTSAPI32.dll_WTSCloseServer
mov ebx, dword [ebp - 0x45c]
cmp ebx, edi
jne 0x40314b
cmp dword [ebp - 0x450], edi
jne 0x40314b
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.00401240
test eax, eax
jne 0x403114
push 0x206
lea edx, [ebp - 0x236]
push edi
push edx
mov word [ebp - 0x238], di
call fcn.0040e580
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.00408be0
test eax, eax
jne 0x403114
cmp word [ebp - 0x238], di
je 0x403114
push 0x206
lea edx, [ebp - 0x43e]
push edi
push edx
mov word [ebp - 0x440], di
call fcn.0040e580
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.00408be0
cmp word [ebp - 0x440], di
jne 0x4030ff
lea eax, [ebp - 0x238]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4030a2
sub eax, edx
sar eax, 1
mov ecx, edi
je 0x4030ff
mov edx, 0x40
lea ebx, [ebx]
cmp word [ebp + ecx*2 - 0x238], dx
je 0x4030d3
add ecx, 1
cmp ecx, eax
jb 0x4030c0
jmp 0x4030ff
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 0x4030f0
lea edx, [ebp - 0x440]
push edx
lea eax, [ebp - 0x238]
push eax
mov ecx, esi
call fcn.00402b10
mov eax, dword [esi]
cmp eax, edi
je 0x40311f
cmp word [eax], di
jne 0x403126
mov ecx, esi
call fcn.00402be0
mov eax, dword [esi]
cmp eax, edi
je 0x40313a
cmp word [eax], di
je 0x40313a
push eax
lea ecx, [esi + 0x10]
call fcn.00408e60
mov eax, dword [ebp - 0x444]
cmp eax, edi
je 0x40314b
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [esi]
cmp esi, edi
je 0x40315d
cmp word [esi], di
je 0x40315d
mov esi, 1
jmp 0x40315f
xor esi, esi
mov eax, dword [ebp - 0x454]
cmp eax, edi
je 0x40317d
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.0040d2aa
mov esp, ebp
pop ebp
ret