Function at 0x407340
Capabilities:
Compare security identifiers

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42bba3
mov eax, dword fs:[0]
push eax
sub esp, 0xf4
mov eax, dword [0x43c00c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0xe0], edi
mov dword [ebp - 0x100], edi
mov dword [ebp - 0xdc], 0
mov dword [edi], vtable.ATL::CAccessToken.0
mov dword [edi + 4], 0
mov dword [edi + 8], 0
mov dword [edi + 0xc], 0
mov dword [ebp - 4], 1
mov esi, dword [0x43d878]
mov ebx, dword [esi*8 + 0x43d87c]
test ebx, ebx
jne 0x4073e5
push 0x1f0
call fcn.0040c8b2
add esp, 4
mov dword [ebp - 0xe0], eax
mov byte [ebp - 4], 2
mov ecx, eax
push esi
call fcn.00406440
mov ebx, eax
mov byte [ebp - 4], 1
mov dword [esi*8 + 0x43d87c], ebx
mov dword [ebp - 0xf4], ebx
mov ecx, ebx
mov eax, dword [esi*8 + 0x43d880]
mov dword [ebp - 0xf0], eax
mov dword [ebp - 0xd8], eax
mov dword [ebp - 0xdc], 1
inc dword [eax]
lea eax, [ebp - 0xd0]
push eax
call fcn.00406750
mov dword [ebp - 0xe8], eax
mov byte [ebp - 4], 4
mov esi, dword [0x43d878]
mov eax, dword [esi*8 + 0x43d87c]
mov dword [ebp - 0xe4], eax
test eax, eax
jne 0x407469
push 0x1f0
call fcn.0040c8b2
add esp, 4
mov dword [ebp - 0xe0], eax
mov byte [ebp - 4], 5
mov ecx, eax
push esi
call fcn.00406440
mov dword [ebp - 0xe4], eax
mov byte [ebp - 4], 4
mov dword [esi*8 + 0x43d87c], eax
mov dword [ebp - 0xfc], eax
mov ecx, dword [esi*8 + 0x43d880]
mov dword [ebp - 0xf8], ecx
mov dword [ebp - 0xec], ecx
mov dword [ebp - 0xdc], 3
inc dword [ecx]
lea ecx, [ebp - 0x70]
push ecx
mov ecx, eax
call fcn.004065f0
mov ecx, eax
mov dword [ebp - 0xe0], ecx
mov byte [ebp - 4], 6
lea eax, [ecx + 4]
test eax, eax
je 0x4074fb
mov esi, dword [ebp - 0xe8]
add esi, 4
je 0x4074fb
cmp byte [ecx + 0x48], 0
je 0x4074fb
push eax
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
je 0x4074fb
mov eax, dword [ebp - 0xe8]
cmp byte [eax + 0x48], 0
je 0x4074fb
push esi
call dword [sym.imp.ADVAPI32.dll_IsValidSid]
test eax, eax
je 0x4074fb
mov eax, dword [ebp - 0xe0]
push esi
add eax, 4
push eax
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
setne byte [ebp - 0xd1]
jmp 0x407502
mov byte [ebp - 0xd1], 0
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x70]
call fcn.00401980
mov esi, 3
mov dword [ebp - 0xdc], esi
and esi, 0xfffffffd
mov dword [ebp - 0xdc], esi
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0xec]
add dword [eax], 0xffffffff
jne 0x40756f
mov eax, dword [ebp - 0xe4]
test eax, eax
je 0x40755f
mov ecx, eax
call fcn.00404b60
push 0x1f0
push dword [ebp - 0xe4]
call fcn.0040cc5d
add esp, 8
mov dword [ebp - 0xfc], 0
push 4
push dword [ebp - 0xec]
call fcn.0040cc5d
add esp, 8
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xd0]
call fcn.00401980
and esi, 0xfffffffe
mov dword [ebp - 0xdc], esi
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0xd8]
add dword [eax], 0xffffffff
jne 0x4075ca
test ebx, ebx
je 0x4075bf
mov ecx, ebx
call fcn.00404b60
push 0x1f0
push ebx
call fcn.0040cc5d
mov eax, dword [ebp - 0xd8]
add esp, 8
mov dword [ebp - 0xf4], 0
push 4
push eax
call fcn.0040cc5d
add esp, 8
cmp byte [ebp - 0xd1], 0
je 0x4075ef
push str.Process_is_already_impersonated
push 0x14c
push str.ScopedImpersonation::ScopedImpersonation
call fcn.00408e10
add esp, 0xc
jmp 0x407762
mov byte [ebp - 4], 7
mov eax, dword [0x43d878]
mov dword [ebp - 0xd8], eax
mov ebx, dword [eax*8 + 0x43d87c]
test ebx, ebx
jne 0x407640
push 0x1f0
call fcn.0040c8b2
add esp, 4
mov dword [ebp - 0xe0], eax
mov byte [ebp - 4], 8
mov ecx, eax
push dword [ebp - 0xd8]
call fcn.00406440
mov ebx, eax
mov byte [ebp - 4], 7
mov eax, dword [ebp - 0xd8]
mov dword [eax*8 + 0x43d87c], ebx
mov dword [ebp - 0xf4], ebx
or esi, 4
mov eax, dword [eax*8 + 0x43d880]
mov ecx, ebx
mov dword [ebp - 0xf0], eax
mov dword [ebp - 0xe0], eax
inc dword [eax]
mov dword [ebp - 0xdc], esi
call fcn.00406da0
and esi, 0xfffffffb
mov dword [edi + 4], eax
mov dword [ebp - 0xdc], esi
mov byte [ebp - 4], 0
mov esi, dword [ebp - 0xe0]
add dword [esi], 0xffffffff
jne 0x4076b4
test ebx, ebx
je 0x4076a9
mov ecx, ebx
call fcn.00404b60
push 0x1f0
push ebx
call fcn.0040cc5d
add esp, 8
mov dword [ebp - 0xf4], 0
push 4
push esi
call fcn.0040cc5d
add esp, 8
lea eax, [ebp - 0xd8]
mov dword [ebp - 0xd8], 0xffffffff
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenThreadToken]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4076e9
call esi
cmp eax, 0x3f0
jne 0x4076fb
mov eax, dword [ebp - 0xd8]
cmp eax, 0xffffffff
je 0x4076fb
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [edi + 4]
test eax, eax
je 0x407741
push eax
call dword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
je 0x407741
push 4
push dword [edi + 0xc]
call fcn.0040cc5d
push 0x42d44d
push 4
call fcn.0040cf57
add esp, 0x10
test eax, eax
je 0x407732
mov dword [eax], vtable.ATL::CAccessToken::CRevertToSelf.0
jmp 0x407734
xor eax, eax
mov dword [edi + 0xc], eax
test eax, eax
jne 0x407762
call dword [sym.imp.ADVAPI32.dll_RevertToSelf]
call esi
test eax, eax
jle 0x40774f
movzx eax, ax
or eax, 0x80070000
push eax
mov edx, 0x151
mov ecx, str.ScopedImpersonation::ScopedImpersonation
call fcn.00408eb0
add esp, 4
mov dword [ebp - 4], 0xffffffff
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040c5eb
mov esp, ebp
pop ebp
ret