Function at 0x4056d0
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 0x4f0030
mov eax, dword fs:[0]
push eax
mov eax, 0x1450
call fcn.004c38f0
mov eax, dword [0x53ba20]
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.004c8c9a
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 0x405777
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 0x40578c
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x405bfb
push 0x400
push 3
push esi
jmp 0x405bee
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 0x4fc9dc
push 0
call esi
push dword [ebp - 0x1434]
call fcn.004c8c9a
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 0x4fc9dc
push 0
call esi
push 0x620
call fcn.004c8c9a
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 0x405821
movups xmm0, xmmword [0x5015f8]
push 0x4fbe44
push 0x50160c
movups xmmword [edi + 8], xmm0
mov ax, word [0x501608]
mov word [edi + 0x18], ax
mov eax, dword [0x540458]
sub eax, dword [0x540454]
sar eax, 2
mov dword [edi + 4], eax
lea eax, [edi + 0x210]
push 0x501628
push eax
call fcn.00413e00
mov eax, dword [ebp - 0x1448]
add esp, 0x10
test eax, eax
je 0x4058a9
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 0x4058ca
mov byte [edi], 1
mov dword [0x53ffd8], edi
jmp 0x4058cd
mov byte [edi], 0
push 0x501634
push 0x540010
lea eax, [edi + 0x418]
push 0x501628
push eax
call fcn.00413e00
mov eax, dword [0x540458]
add esp, 0x10
cmp eax, dword [0x54045c]
je 0x405903
mov dword [eax], edi
add dword [0x540458], 4
jmp 0x405915
lea ecx, [ebp - 0x1440]
push ecx
push eax
mov ecx, 0x540454
call fcn.004040b0
push dword [0x540000]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
lea ecx, [ebp - 0x142c]
or eax, 0x20019
push ecx
push eax
push 0
push 0x501648
push dword [0x534a0c]
call fcn.00408690
add esp, 0x14
test eax, eax
jne 0x405bcb
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 0x405bc3
nop word [eax + eax]
push dword [0x540000]
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.00408690
add esp, 0x14
test eax, eax
jne 0x405b9e
lea eax, [ebp - 0x143c]
mov dword [ebp - 0x143c], 4
push eax
lea eax, [ebp - 0x1454]
push eax
push 0
push 0
push 0x5016bc
push dword [ebp - 0x1444]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x405b96
test byte [ebp - 0x1454], 8
jne 0x405b96
push dword [ebp - 0x1424]
call fcn.00406700
mov esi, eax
add esp, 4
mov dword [ebp - 0x145c], esi
test esi, esi
je 0x405b90
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 0x405b89
push 0x620
call fcn.004c8c9a
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 0x5016c8
push dword [ebp - 0x1444]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x405b7a
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 0x405ab2
mov eax, dword [0x540458]
lea ecx, [ebp - 0x420]
sub eax, dword [0x540454]
push ecx
sar eax, 2
lea ecx, [ebp - 0x218]
push ecx
mov dword [edi + 4], eax
lea eax, [edi + 0x210]
push 0x501628
push eax
call fcn.00413e00
mov eax, dword [ebp - 0x1448]
add esp, 0x10
test eax, eax
je 0x405b2f
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 0x405b4b
mov byte [edi], 1
mov dword [0x53ffd8], edi
jmp 0x405b4e
mov byte [edi], 0
mov eax, dword [0x540458]
cmp eax, dword [0x54045c]
je 0x405b66
mov dword [eax], edi
add dword [0x540458], 4
jmp 0x405b83
lea ecx, [ebp - 0x1440]
push ecx
push eax
mov ecx, 0x540454
call fcn.004040b0
jmp 0x405b83
push edi
call fcn.004c8c7f
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 0x405980
push dword [ebp - 0x142c]
call edi
push 0x4fc3f4
call fcn.004061a0
add esp, 4
test eax, eax
jne 0x405c02
mov eax, dword [ebp - 0x1448]
test eax, eax
je 0x405bfb
push 0x400
push 3
push eax
call dword [sym.imp.USER32.dll_GetMenu]
push eax
call dword [sym.imp.USER32.dll_DeleteMenu]
mov byte [0x53ead4], 1
push dword [ebp - 0x1424]
call fcn.004c8c7f
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.004c3287
mov esp, ebp
pop ebp
ret