Function at 0x405710
Capabilities:
Compare security identifiers
Get thread local storage value
Get user security identifier
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4ee5d0
mov eax, dword fs:[0]
push eax
mov eax, 0x1450
call fcn.004c39f0
mov eax, dword [0x535a40]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
push 2
mov dword [ebp - 0x1448], esi
call fcn.004c8d7a
xor ecx, ecx
mov dword [ebp - 0x1424], eax
add esp, 4
mov word [eax], cx
lea eax, [ebp - 0x1430]
mov dword [ebp - 4], ecx
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x4057b7
lea eax, [ebp - 0x1450]
mov dword [ebp - 0x1450], 0x1000
push eax
push 0x1000
lea eax, [ebp - 0x1420]
push eax
push 1
push dword [ebp - 0x1430]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
push dword [ebp - 0x1430]
test eax, eax
jne 0x4057cc
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x405c3b
push 0x400
push 3
push esi
jmp 0x405c2e
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
lea eax, [ebp - 0x144c]
push eax
lea eax, [ebp - 0x1438]
mov dword [ebp - 0x1434], 0
push eax
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x1434]
push eax
push 0
push str.System
push 0
call esi
push dword [ebp - 0x1434]
call fcn.004c8d7a
add esp, 4
mov dword [ebp - 0x1428], eax
lea ecx, [ebp - 0x144c]
push ecx
lea ecx, [ebp - 0x1438]
push ecx
lea ecx, [ebp - 0x218]
push ecx
lea ecx, [ebp - 0x1434]
push ecx
push eax
push str.System
push 0
call esi
push 0x620
call fcn.004c8d7a
mov edx, dword [ebp - 0x1424]
mov edi, eax
add esp, 4
mov dword [ebp - 0x1440], edi
lea esi, [edi + 8]
movzx ecx, word [edx]
lea edx, [edx + 2]
mov word [esi], cx
lea esi, [esi + 2]
test cx, cx
jne 0x405861
movups xmm0, xmmword [str..Default]
push str.SYSTEM
push str.NT_AUTHORITY
movups xmmword [edi + 8], xmm0
mov ax, word [0x4ff608]
mov word [edi + 0x18], ax
mov eax, dword [0x53a6fc]
sub eax, dword [0x53a6f8]
sar eax, 2
mov dword [edi + 4], eax
lea eax, [edi + 0x210]
push 0x4ff628
push eax
call fcn.00413df0
mov eax, dword [ebp - 0x1448]
add esp, 0x10
test eax, eax
je 0x4058e9
mov esi, dword [edi + 4]
push 3
push eax
call dword [sym.imp.USER32.dll_GetMenu]
push eax
call dword [sym.imp.USER32.dll_GetSubMenu]
lea ecx, [edi + 0x210]
push ecx
push esi
push 0x400
push 0xffffffffffffffff
push eax
call dword [sym.imp.USER32.dll_InsertMenuW]
push dword [ebp - 0x1420]
push dword [ebp - 0x1428]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x40590a
mov byte [edi], 1
mov dword [0x539fa8], edi
jmp 0x40590d
mov byte [edi], 0
push str.Config
push 0x539fe0
lea eax, [edi + 0x418]
push 0x4ff628
push eax
call fcn.00413df0
mov eax, dword [0x53a6fc]
add esp, 0x10
cmp eax, dword [0x53a700]
je 0x405943
mov dword [eax], edi
add dword [0x53a6fc], 4
jmp 0x405955
lea ecx, [ebp - 0x1440]
push ecx
push eax
mov ecx, 0x53a6f8
call fcn.00404110
push dword [0x539fd0]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea ecx, [ebp - 0x142c]
or eax, 0x20019
push ecx
push eax
push 0
push str.SoftwareMicrosoftWindows_NTCurrentVersionProfileList
push dword [0x52ea0c]
call fcn.004086c0
add esp, 0x14
test eax, eax
jne 0x405c0b
lea eax, [ebp - 0x1424]
xor esi, esi
push eax
push esi
push dword [ebp - 0x142c]
mov dword [ebp - 0x1428], esi
call fcn.00415050
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
add esp, 0xc
test eax, eax
jne 0x405c03
nop word [eax + eax]
push dword [0x539fd0]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea ecx, [ebp - 0x1444]
or eax, 0x20019
push ecx
push eax
push 0
push dword [ebp - 0x1424]
push dword [ebp - 0x142c]
call fcn.004086c0
add esp, 0x14
test eax, eax
jne 0x405bde
lea eax, [ebp - 0x143c]
mov dword [ebp - 0x143c], 4
push eax
lea eax, [ebp - 0x1454]
push eax
push 0
push 0
push str.Flags
push dword [ebp - 0x1444]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x405bd6
test byte [ebp - 0x1454], 8
jne 0x405bd6
push dword [ebp - 0x1424]
call fcn.00406740
mov esi, eax
add esp, 4
mov dword [ebp - 0x145c], esi
test esi, esi
je 0x405bd0
lea eax, [ebp - 0x144c]
mov dword [ebp - 0x1458], 0x104
push eax
lea eax, [ebp - 0x1438]
mov dword [ebp - 0x1438], 0x104
push eax
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x1458]
push eax
lea eax, [ebp - 0x420]
push eax
push esi
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountSidW]
test eax, eax
je 0x405bc9
push 0x620
call fcn.004c8d7a
add esp, 4
mov dword [ebp - 0x143c], 0x208
mov edi, eax
lea eax, [ebp - 0x143c]
mov dword [ebp - 0x1440], edi
push eax
lea ecx, [edi + 0x418]
push ecx
push 0
push 0
push str.ProfileImagePath
push dword [ebp - 0x1444]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x405bba
mov ecx, dword [ebp - 0x1424]
lea edx, [edi + 8]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx], ax
lea edx, [edx + 2]
test ax, ax
jne 0x405af2
mov eax, dword [0x53a6fc]
lea ecx, [ebp - 0x420]
sub eax, dword [0x53a6f8]
push ecx
sar eax, 2
lea ecx, [ebp - 0x218]
push ecx
mov dword [edi + 4], eax
lea eax, [edi + 0x210]
push 0x4ff628
push eax
call fcn.00413df0
mov eax, dword [ebp - 0x1448]
add esp, 0x10
test eax, eax
je 0x405b6f
mov esi, dword [edi + 4]
push 3
push eax
call dword [sym.imp.USER32.dll_GetMenu]
push eax
call dword [sym.imp.USER32.dll_GetSubMenu]
lea ecx, [edi + 0x210]
push ecx
push esi
push 0x400
push 0xffffffffffffffff
push eax
call dword [sym.imp.USER32.dll_InsertMenuW]
mov esi, dword [ebp - 0x145c]
push dword [ebp - 0x1420]
push esi
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
je 0x405b8b
mov byte [edi], 1
mov dword [0x539fa8], edi
jmp 0x405b8e
mov byte [edi], 0
mov eax, dword [0x53a6fc]
cmp eax, dword [0x53a700]
je 0x405ba6
mov dword [eax], edi
add dword [0x53a6fc], 4
jmp 0x405bc3
lea ecx, [ebp - 0x1440]
push ecx
push eax
mov ecx, 0x53a6f8
call fcn.00404110
jmp 0x405bc3
push edi
call fcn.004c8d5f
add esp, 4
mov edi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push esi
call dword [sym.imp.ADVAPI32.dll_FreeSid]
mov esi, dword [ebp - 0x1428]
push dword [ebp - 0x1444]
call edi
lea eax, [ebp - 0x1424]
inc esi
push eax
push esi
push dword [ebp - 0x142c]
mov dword [ebp - 0x1428], esi
call fcn.00415050
add esp, 0xc
test eax, eax
je 0x4059c0
push dword [ebp - 0x142c]
call edi
push str.SeRestorePrivilege
call fcn.004061e0
add esp, 4
test eax, eax
jne 0x405c42
mov eax, dword [ebp - 0x1448]
test eax, eax
je 0x405c3b
push 0x400
push 3
push eax
call dword [sym.imp.USER32.dll_GetMenu]
push eax
call dword [sym.imp.USER32.dll_DeleteMenu]
mov byte [0x538aa4], 1
push dword [ebp - 0x1424]
call fcn.004c8d5f
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004c34b7
mov esp, ebp
pop ebp
ret