Function at 0x409980
Capabilities:
Get user security identifier

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4beb6f
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x50
push esi
push edi
mov eax, dword [0x507074]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x30], edi
mov eax, dword [ebx + 0xc]
mov dword [ebp - 0x5c], eax
xor eax, eax
cmp dword [edi + 0x2c], 1
mov dword [ebp - 0x50], 0
sete al
mov dword [ebp - 0x4c], 0
cmp byte [ebx + 0x10], 0
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x1c], 5
lea eax, [eax*2 + 2]
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x58], eax
mov eax, dword [edi + 0x28]
mov dword [ebp - 0x54], eax
je 0x409c0a
push str.Advapi32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
mov dword [ebp - 0x2c], 0x4e1504
mov dword [ebp - 0x34], esi
mov dword [ebp - 0x28], esi
mov dword [ebp - 4], 0
test esi, esi
jne 0x409a4f
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x2c], 0x4e1504
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi + 0x24], eax
xor al, al
jmp 0x409ea0
push str.ConvertStringSidToSidW
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
jne 0x409a8b
mov dword [ebp - 4], 0xffffffff
push esi
mov dword [ebp - 0x2c], 0x4e1504
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [ebp - 0x28], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi + 0x24], eax
xor al, al
jmp 0x409ea0
lea ecx, [ebp - 0x20]
push ecx
push dword [ebx + 8]
call eax
mov esi, eax
mov dword [ebp - 4], 0xffffffff
push dword [ebp - 0x34]
mov dword [ebp - 0x2c], 0x4e1504
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [ebp - 0x28], 0
test esi, esi
jne 0x409ac8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi + 0x24], eax
xor al, al
jmp 0x409ea0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x24], 0x104
mov dword [ebp - 0x18], 0
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x18]
push 0x104
call fcn.00409590
mov dword [ebp - 0x14], 0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x14]
push 0x104
call fcn.00409590
mov esi, dword [ebp - 0x18]
lea eax, [ebp - 0x1c]
mov edi, dword [ebp - 0x14]
push eax
lea eax, [ebp - 0x24]
mov dword [ebp - 0x28], 0x104
push eax
push esi
lea eax, [ebp - 0x28]
push eax
push edi
push dword [ebp - 0x34]
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountSidW]
test eax, eax
jne 0x409bd8
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x409ba0
push edi
call fcn.004969fe
add esp, 4
mov dword [ebp - 0x14], 0
lea ecx, [ebp - 0x14]
push dword [ebp - 0x28]
call fcn.00409590
push esi
call fcn.004969fe
add esp, 4
mov dword [ebp - 0x18], 0
lea ecx, [ebp - 0x18]
push dword [ebp - 0x24]
call fcn.00409590
mov esi, dword [ebp - 0x18]
lea eax, [ebp - 0x1c]
mov edi, dword [ebp - 0x14]
push eax
lea eax, [ebp - 0x24]
push eax
push esi
lea eax, [ebp - 0x28]
push eax
push edi
push dword [ebp - 0x34]
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountSidW]
test eax, eax
jne 0x409bd8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 0x30]
mov dword [ecx + 0x24], eax
mov byte [ebp - 4], 1
push edi
call fcn.004969fe
add esp, 4
mov dword [ebp - 0x14], 0
mov dword [ebp - 4], 0xffffffff
push esi
call fcn.004969fe
add esp, 4
mov dword [ebp - 0x18], 0
xor al, al
jmp 0x409ea0
mov byte [ebp - 4], 1
push edi
call fcn.004969fe
add esp, 4
mov dword [ebp - 0x14], 0
mov dword [ebp - 4], 0xffffffff
push esi
call fcn.004969fe
mov edx, dword [ebp - 0x20]
add esp, 4
mov edi, dword [ebp - 0x30]
mov dword [ebp - 0x14], edx
jmp 0x409d14
push 0x104
call fcn.00496a03
add esp, 4
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x28], 0x104
mov dword [ebp - 0x30], 0x104
mov dword [ebp - 0x18], 0
mov dword [ebp - 4], 3
lea ecx, [ebp - 0x18]
push 0x104
call fcn.00409590
mov esi, dword [ebp - 0x18]
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x30]
push eax
push esi
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x14]
push dword [ebx + 8]
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
jne 0x409cfe
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x409cf9
push dword [ebp - 0x14]
call fcn.004969fe
add esp, 4
push dword [ebp - 0x28]
call fcn.00496a03
add esp, 4
mov dword [ebp - 0x14], eax
push esi
call fcn.004969fe
add esp, 4
mov dword [ebp - 0x18], 0
lea ecx, [ebp - 0x18]
push dword [ebp - 0x30]
call fcn.00409590
mov esi, dword [ebp - 0x18]
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x30]
push eax
push esi
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x14]
push dword [ebx + 8]
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
test eax, eax
jne 0x409cfe
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x14]
mov dword [edi + 0x24], eax
call fcn.004969fe
add esp, 4
mov dword [ebp - 4], 0xffffffff
push esi
call fcn.004969fe
add esp, 4
xor edx, edx
mov dword [ebp - 0x14], edx
jmp 0x409d11
mov dword [edi + 0x24], eax
jmp 0x409ce2
mov dword [ebp - 4], 0xffffffff
push esi
call fcn.004969fe
mov edx, dword [ebp - 0x14]
add esp, 4
mov dword [ebp - 0x20], edx
mov dword [ebp - 0x18], 0
test edx, edx
je 0x409ac1
mov eax, dword [ebp - 0x1c]
dec eax
cmp eax, 8
ja case.0x409d2c.8
jmp dword [eax*4 + 0x409ecc]
mov dword [ebp - 0x44], 1
jmp 0x409d82
mov dword [ebp - 0x44], 2
jmp 0x409d82
mov dword [ebp - 0x44], 3
jmp 0x409d82
mov dword [ebp - 0x44], 4
jmp 0x409d82
mov dword [ebp - 0x44], 5
jmp 0x409d82
mov dword [ebp - 0x44], 6
jmp 0x409d82
mov dword [ebp - 0x44], 7
jmp 0x409d82
mov dword [ebp - 0x44], 8
jmp 0x409d82
mov dword [ebp - 0x44], 0
mov esi, dword [edi + 8]
xor al, al
cmp byte [ebx + 0x10], 0
mov ecx, 1
movzx eax, al
cmovne eax, ecx
mov dword [ebp - 0x40], edx
mov byte [ebp - 0x38], al
mov eax, dword [edi + 4]
mov dword [ebp - 0x34], edi
cmp eax, esi
jne 0x409def
mov ecx, dword [edi]
lea edx, [ebp - 0x3c]
cmp edx, ecx
jb 0x409dbd
lea eax, [ecx + esi*8]
cmp edx, eax
jb 0x409eb6
mov eax, dword [edi + 4]
test esi, esi
jne 0x409dc8
mov esi, 1
jmp 0x409dd7
lea esi, [eax + eax]
test esi, esi
js 0x409e1a
cmp esi, 0xfffffff
ja 0x409e1a
push 8
push esi
push ecx
call fcn.004a048c
add esp, 0xc
test eax, eax
je 0x409e1a
mov edx, dword [ebp - 0x14]
mov dword [edi + 8], esi
mov dword [edi], eax
mov ecx, dword [edi + 4]
mov dword [ebp - 0x24], ecx
mov eax, dword [edi]
lea ecx, [eax + ecx*8]
mov dword [ebp - 0x18], ecx
mov dword [ebp - 4], 4
test ecx, ecx
je 0x409e10
mov eax, dword [ebp - 0x38]
mov dword [ecx], edx
mov dword [ecx + 4], eax
mov dword [ebp - 4], 0xffffffff
inc dword [edi + 4]
mov esi, dword [edi + 0x10]
add edi, 0xc
mov dword [ebp - 0x34], edi
mov edx, dword [edi + 8]
cmp esi, edx
jne 0x409e6e
mov ecx, dword [edi]
lea eax, [ebp - 0x5c]
cmp eax, ecx
jb 0x409e44
mov eax, edx
lea esi, [ebp - 0x5c]
shl eax, 5
add eax, ecx
cmp esi, eax
mov esi, dword [edi + 4]
jb 0x409ec0
test edx, edx
jne 0x409e4d
lea esi, [edx + 1]
jmp 0x409e59
add esi, esi
js 0x409e9e
cmp esi, 0x3ffffff
ja 0x409e9e
push 0x20
push esi
push ecx
call fcn.004a048c
add esp, 0xc
test eax, eax
je 0x409e9e
mov dword [edi + 8], esi
mov dword [edi], eax
mov eax, dword [edi + 4]
mov dword [ebp - 0x30], eax
shl eax, 5
add eax, dword [edi]
mov dword [ebp - 0x28], eax
mov dword [ebp - 4], 5
je 0x409e94
movups xmm0, xmmword [ebp - 0x5c]
movups xmmword [eax], xmm0
movups xmm0, xmmword [ebp - 0x4c]
movups xmmword [eax + 0x10], xmm0
mov dword [ebp - 4], 0xffffffff
inc dword [edi + 4]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 0xc
push 0x80004005
call fcn.00402570
push 0x80004005
call fcn.00402570
nop
xor ebx, dword [ebp - 0x62c3ffc0]
inc eax
add byte [ebp - 0x63], al
inc eax
add byte [esi - 0x63], cl
inc eax
add byte [edi - 0x63], dl
inc eax
add byte [eax - 0x63], ah
inc eax
add byte [ecx - 0x63], ch
inc eax
add byte [ebx - 0x63], bh
inc eax
add byte [edx - 0x63], dh
inc eax
add byte [ebx + 0x56530cec], al
sub esp, 0xc
push ebx
push esi
mov esi, ecx
mov eax, dword [esi + 0x20]
lea ebx, [esi + 0x20]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_LocalFree]
test eax, eax
je 0x409f11
push eax
call edi
mov dword [ebx], 0
mov eax, dword [esi + 0x1c]
test eax, eax
je 0x409f22
push eax
call edi
mov dword [esi + 0x1c], 0
cmp dword [esi + 0x10], 0
jle 0x409f60
mov ecx, dword [esi + 0x18]
xor eax, eax
mov dword [esp + 0xc], eax
test ecx, ecx
je 0x409f7c
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], eax
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x10]
push eax
lea eax, [esp + 0x18]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
jne 0x409f69
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x24], eax
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0xc
ret
cmp dword [esp + 0x10], 0
jne 0x409f78
xor eax, eax
mov dword [esp + 0xc], eax
jmp 0x409f7c
mov eax, dword [esp + 0xc]
cmp dword [esi + 0x10], 0
jle 0x409ff2
push ebx
push eax
push dword [esi + 0xc]
push dword [esi + 0x10]
call dword [sym.imp.ADVAPI32.dll_SetEntriesInAclW]
test eax, eax
jne 0x409f5d
push 0x14
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [esi + 0x1c], eax
test eax, eax
je 0x409f57
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
jne 0x409fd5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x24], eax
mov eax, dword [esi + 0x1c]
test eax, eax
je 0x409f60
push eax
call edi
pop edi
mov dword [esi + 0x1c], 0
xor eax, eax
pop esi
pop ebx
add esp, 0xc
ret
push 0
push dword [ebx]
push 1
push dword [esi + 0x1c]
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x409fb2
mov eax, dword [esi + 0x1c]
pop edi
pop esi
pop ebx
add esp, 0xc
ret
push 0x8000000b
call fcn.00402570
int3