Function at 0x406454
Capabilities:
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffbc
push ebx
push esi
push edi
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.0040354c
xor eax, eax
push ebp
push 0x406679
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, 0x400
call fcn.00402494
mov dword [ebp - 8], eax
mov eax, 0x400
call fcn.00402494
mov dword [ebp - 0x10], eax
mov eax, 0x400
call fcn.00402494
mov edi, eax
mov dword [ebp - 0x18], 0x400
lea eax, [ebp - 4]
mov ecx, dword [ebp - 4]
mov edx, 0x406690
call fcn.004033a8
xor eax, eax
mov dword [0x40b824], eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x10]
push eax
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 8]
push eax
push 0x406694
mov eax, dword [ebp - 4]
call fcn.0040355c
push eax
call sub.advapi32.dll_LookupAccountNameA
test eax, eax
je 0x40664c
mov eax, dword [ebp - 8]
push eax
call sub.advapi32.dll_GetSidIdentifierAuthority
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 8]
push eax
call sub.advapi32.dll_GetSidSubAuthorityCount
movzx eax, byte [eax]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
dec eax
test eax, eax
jl 0x40652c
inc eax
mov dword [ebp - 0x24], eax
xor ebx, ebx
lea esi, [ebp - 0x44]
push ebx
mov eax, dword [ebp - 8]
push eax
call sub.advapi32.dll_GetSidSubAuthority
mov eax, dword [eax]
mov dword [esi], eax
inc ebx
add esi, 4
dec dword [ebp - 0x24]
jne 0x406515
xor ebx, ebx
mov dword [ebp - 0x18], 0x400
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x28]
push eax
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0x30]
push eax
lea eax, [ebx + 0x1f4]
push eax
mov eax, dword [ebp - 0x38]
push eax
mov eax, dword [ebp - 0x3c]
push eax
mov eax, dword [ebp - 0x40]
push eax
mov eax, dword [ebp - 0x44]
push eax
mov al, byte [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x1c]
push eax
call sub.advapi32.dll_AllocateAndInitializeSid
test eax, eax
je 0x4065bc
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x10]
push eax
lea eax, [ebp - 0x18]
push eax
push edi
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 4]
call fcn.0040355c
push eax
call sub.advapi32.dll_LookupAccountSidA
test eax, eax
jne 0x40659f
mov eax, dword [ebp - 0xc]
push eax
call sub.advapi32.dll_FreeSid
jmp 0x4065bc
mov edx, dword [ebp - 0x14]
mov eax, edi
call fcn.00406418
mov eax, dword [ebp - 0xc]
push eax
call sub.advapi32.dll_FreeSid
inc ebx
cmp ebx, 0xa
jne 0x40652e
xor ebx, ebx
mov dword [ebp - 0x18], 0x400
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x28]
push eax
mov eax, dword [ebp - 0x2c]
push eax
mov eax, dword [ebp - 0x30]
push eax
lea eax, [ebx + 0x3e8]
push eax
mov eax, dword [ebp - 0x38]
push eax
mov eax, dword [ebp - 0x3c]
push eax
mov eax, dword [ebp - 0x40]
push eax
mov eax, dword [ebp - 0x44]
push eax
mov al, byte [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x1c]
push eax
call sub.advapi32.dll_AllocateAndInitializeSid
test eax, eax
je 0x40664c
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x10]
push eax
lea eax, [ebp - 0x18]
push eax
push edi
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 4]
call fcn.0040355c
push eax
call sub.advapi32.dll_LookupAccountSidA
test eax, eax
jne 0x40662f
mov eax, dword [ebp - 0xc]
push eax
call sub.advapi32.dll_FreeSid
jmp 0x40664c
mov edx, dword [ebp - 0x14]
mov eax, edi
call fcn.00406418
mov eax, dword [ebp - 0xc]
push eax
call sub.advapi32.dll_FreeSid
inc ebx
cmp ebx, 0x64
jne 0x4065be
mov eax, dword [ebp - 8]
call fcn.004024b4
mov eax, dword [ebp - 0x10]
call fcn.004024b4
mov eax, edi
call fcn.004024b4
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x406680
lea eax, [ebp - 4]
call fcn.0040311c
ret