Function at 0x491e6b
Capabilities:
Get user security identifier
Link many functions at runtime

Disassembly:
push ebp
lea ebp, [esp - 0x2268]
mov eax, 0x2268
call fcn.004d5a20
push 0xffffffffffffffff
push 0x4e10ca
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x50f130]
xor eax, ebp
mov dword [ebp + 0x2264], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x2270]
xor esi, esi
mov dword [ebp - 0x38], esi
test byte [0x5161b4], 1
push 7
mov dword [ebp - 0x2c], eax
pop ebx
jne 0x491ee6
or dword [0x5161b4], 1
xor ecx, ecx
mov eax, 0x516198
mov dword [0x5161b0], ebx
call fcn.004024d0
push 0x4e6db0
call fcn.004b9593
pop ecx
xor ecx, ecx
lea eax, [ebp + 0x1c]
mov dword [ebp - 0x14], esi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x30], esi
mov dword [ebp + 0x34], ebx
call fcn.004024d0
mov dword [ebp - 4], esi
xor ecx, ecx
lea eax, [ebp]
mov dword [ebp + 0x18], ebx
call fcn.004024d0
mov byte [ebp - 4], 1
cmp dword [0x5161ac], esi
jne 0x4921ad
lea eax, [ebp - 0x3c]
push eax
mov ecx, str.Kernel32.dll
call fcn.00409c00
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 2
call fcn.00493187
lea ecx, [ebp - 0x3c]
mov dword [ebp - 0x24], eax
mov byte [ebp - 4], 1
call fcn.004016d0
cmp dword [ebp - 0x24], esi
je 0x4921ad
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.ProcessIdToSessionId
push dword [ebp - 0x24]
mov edi, eax
call esi
test eax, eax
je 0x49218c
lea ecx, [ebp - 0x28]
push ecx
push edi
call eax
test eax, eax
je 0x49218c
lea eax, [ebp - 0x34]
push eax
mov ecx, str.Wtsapi32.dll
call fcn.00409c00
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 3
call fcn.00493187
lea ecx, [ebp - 0x34]
mov dword [ebp - 0x14], eax
mov byte [ebp - 4], 1
call fcn.004016d0
cmp dword [ebp - 0x14], 0
je 0x49218c
mov edi, str.WTSQuerySessionInformationW
push edi
push dword [ebp - 0x14]
call esi
test eax, eax
mov dword [ebp - 0x20], eax
je 0x49218c
push str.WTSFreeMemory
push dword [ebp - 0x14]
call esi
test eax, eax
mov dword [ebp - 0x18], eax
je 0x49218c
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x10]
push eax
push 5
push dword [ebp - 0x28]
push 0
call dword [ebp - 0x20]
test eax, eax
je 0x49218c
mov edx, dword [ebp - 0x10]
test edx, edx
je 0x49218c
lea eax, [ebp + 0x1c]
push eax
call fcn.00402500
push dword [ebp - 0x10]
call dword [ebp - 0x18]
and dword [ebp - 0x10], 0
push edi
push dword [ebp - 0x14]
call esi
test eax, eax
je 0x49218c
lea ecx, [ebp - 0x30]
push ecx
lea ecx, [ebp - 0x10]
push ecx
push ebx
push dword [ebp - 0x28]
push 0
call eax
test eax, eax
je 0x49218c
mov edx, dword [ebp - 0x10]
test edx, edx
je 0x49218c
lea eax, [ebp]
push eax
call fcn.00402500
push dword [ebp - 0x10]
call dword [ebp - 0x18]
xor ecx, ecx
lea eax, [ebp + 0x38]
mov dword [ebp + 0x50], ebx
call fcn.004024d0
lea eax, [ebp]
push eax
mov ebx, 0x4f09a4
lea esi, [ebp - 0x7c]
mov byte [ebp - 4], 4
call fcn.00414650
lea ecx, [ebp + 0x1c]
push ecx
push eax
lea edi, [ebp - 0x60]
mov byte [ebp - 4], 5
call fcn.0048cea0
add esp, 0xc
push 0xffffffffffffffff
xor edi, edi
push edi
lea ecx, [ebp + 0x38]
mov byte [ebp - 4], 6
call fcn.004020f0
lea esi, [ebp - 0x60]
call fcn.0040c0b0
lea esi, [ebp - 0x7c]
mov byte [ebp - 4], 4
call fcn.0040c0b0
push 0x2002
lea eax, [ebp + 0x56]
push edi
push eax
mov word [ebp + 0x54], di
call fcn.004be240
push 0x20a
lea eax, [ebp + 0x205a]
push edi
push eax
mov word [ebp + 0x2058], di
call fcn.004be240
mov eax, dword [ebp + 0x3c]
add esp, 0x18
cmp dword [ebp + 0x50], 8
mov dword [ebp - 0x38], 0x1000
mov dword [ebp - 0x40], 0x105
jae 0x4920fd
lea eax, [ebp + 0x3c]
lea ecx, [ebp - 0x44]
push ecx
lea ecx, [ebp - 0x40]
push ecx
lea ecx, [ebp + 0x2058]
push ecx
lea ecx, [ebp - 0x38]
push ecx
lea ecx, [ebp + 0x54]
push ecx
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
cmp eax, edi
je 0x492180
lea eax, [ebp - 0x18]
push eax
mov ecx, str.Advapi32.dll
call fcn.00409c00
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 7
call fcn.00493187
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x1c], eax
mov byte [ebp - 4], 4
call fcn.004016d0
cmp dword [ebp - 0x1c], edi
je 0x492180
push str.ConvertSidToStringSidW
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, edi
je 0x492180
lea ecx, [ebp - 0x20]
push ecx
lea ecx, [ebp + 0x54]
push ecx
call eax
mov edx, dword [ebp - 0x20]
push 0x516198
call fcn.00402500
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea esi, [ebp + 0x38]
mov byte [ebp - 4], 1
call fcn.0040c0b0
push dword [ebp - 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_FreeLibrary]
call esi
cmp dword [ebp - 0x14], 0
je 0x4921a2
push dword [ebp - 0x14]
call esi
cmp dword [ebp - 0x1c], 0
je 0x4921ad
push dword [ebp - 0x1c]
call esi
mov esi, dword [ebp - 0x2c]
push 0x516198
call fcn.00416a60
lea esi, [ebp]
call fcn.0040c0b0
lea esi, [ebp + 0x1c]
call fcn.0040c0b0
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x2264]
xor ecx, ebp
call fcn.004b83ee
add ebp, 0x2268
leave
ret