Function at 0x4096f9
Capabilities:
Get session user name
Get user security identifier

Disassembly:
push 0x248
mov eax, 0x42a20f
call fcn.0041132d
mov edi, dword [ebp + 8]
mov esi, 0x1000
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x244], edi
mov dword [ebp - 0x254], edi
mov dword [ebp - 0x240], eax
mov dword [ebp - 0x220], esi
call fcn.0040a6c1
push eax
lea ecx, [ebp - 0x21c]
call fcn.0040a4ec
and dword [ebp - 4], 0
xor ebx, ebx
mov dword [ebp - 0x24c], 0x80000001
mov dword [ebp - 0x248], 0x80000002
and dword [ebp - 0x230], 0
and dword [ebp - 0x22c], 0
and dword [ebp - 0x228], 0
push 0x20119
push dword [ebp - 0x240]
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x230]
push dword [ebp + ebx*4 - 0x24c]
call fcn.0040a020
test eax, eax
jne 0x4097dc
lea eax, [ebp - 0x220]
push eax
push esi
lea ecx, [ebp - 0x21c]
call fcn.0040a4a6
push eax
push str.UserSID
lea ecx, [ebp - 0x230]
call fcn.00409f49
push 0xffffffffffffffff
lea ecx, [ebp - 0x21c]
mov esi, eax
call fcn.0040a303
test esi, esi
jne 0x4097d6
mov eax, dword [ebp - 0x21c]
cmp dword [eax - 0xc], esi
jne 0x409975
mov esi, dword [ebp - 0x220]
lea ecx, [ebp - 0x21c]
call fcn.00409df9
lea ecx, [ebp - 0x230]
mov byte [ebp - 4], 0
call fcn.0040a07c
inc ebx
cmp ebx, 2
jne 0x409756
push ecx
lea eax, [ebp - 0x23c]
xor ebx, ebx
push eax
mov dword [ebp - 0x23c], ebx
call fcn.00409a89
test eax, eax
je 0x40995d
push dword [ebp - 0x23c]
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
je 0x40995d
lea eax, [ebp - 0x250]
mov dword [ebp - 0x250], 0x104
push eax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
je 0x40995d
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
test eax, eax
je 0x40995d
mov dword [ebp - 0x238], ebx
mov dword [ebp - 0x234], ebx
call fcn.0040a6c1
push eax
lea ecx, [ebp - 0x224]
call fcn.0040a4ec
lea eax, [ebp - 0x244]
mov byte [ebp - 4], 2
mov esi, dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
push eax
lea eax, [ebp - 0x234]
push eax
push ebx
lea eax, [ebp - 0x238]
push eax
push ebx
lea eax, [ebp - 0x218]
push eax
push ebx
call esi
push dword [ebp - 0x238]
call fcn.004193e9
mov ebx, eax
pop ecx
test ebx, ebx
je 0x40994a
lea eax, [ebp - 0x244]
push eax
lea eax, [ebp - 0x234]
push eax
mov eax, dword [ebp - 0x234]
lea ecx, [ebp - 0x224]
add eax, eax
push eax
call fcn.0040a4a6
push eax
lea eax, [ebp - 0x238]
push eax
push ebx
lea eax, [ebp - 0x218]
push eax
push 0
call esi
push 0xffffffffffffffff
lea ecx, [ebp - 0x224]
mov esi, eax
call fcn.0040a303
test esi, esi
je 0x409943
lea eax, [ebp - 0x220]
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_ConvertSidToStringSidW]
mov ecx, dword [ebp - 0x220]
call fcn.00409ee5
push eax
push dword [ebp - 0x220]
lea ecx, [ebp - 0x21c]
call fcn.00409e2e
push dword [ebp - 0x220]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push ebx
call fcn.00415fcb
pop ecx
xor ebx, ebx
mov byte [ebp - 4], bl
mov ecx, dword [ebp - 0x224]
lea ecx, [ecx - 0x10]
call fcn.0040a792
mov esi, dword [ebp - 0x21c]
cmp dword [esi - 0xc], ebx
jne 0x409996
lea ecx, [esi - 0x10]
call fcn.0040a285
jmp 0x409a1d
lea esi, [eax - 0x10]
mov ecx, esi
call fcn.0040a285
add eax, 0x10
lea ecx, [ebp - 0x230]
mov dword [edi], eax
call fcn.0040a07c
mov ecx, esi
jmp 0x409a25
mov edi, dword [ebp - 0x240]
push 0xf013f
xor eax, eax
lea ecx, [ebp - 0x230]
push edi
push dword [ebp + ebx*4 - 0x24c]
mov dword [ebp - 0x230], eax
mov dword [ebp - 0x22c], eax
mov dword [ebp - 0x228], eax
call fcn.0040a020
test eax, eax
je 0x4099ec
push ecx
push ecx
push 0xf013f
push ecx
push ecx
push edi
push dword [ebp + ebx*4 - 0x24c]
lea ecx, [ebp - 0x230]
call fcn.00409bd0
test eax, eax
jne 0x4099fe
push ecx
push esi
push str.UserSID
lea ecx, [ebp - 0x230]
call fcn.00409f01
lea ecx, [ebp - 0x230]
call fcn.0040a07c
inc ebx
cmp ebx, 2
jne 0x40999c
lea ecx, [esi - 0x10]
call fcn.0040a285
mov edi, dword [ebp - 0x254]
add eax, 0x10
lea ecx, [esi - 0x10]
mov dword [edi], eax
call fcn.0040a792
mov eax, edi
call fcn.004112d7
ret 8