Function at 0x40bd50
Capabilities:
Compare security identifiers

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x426004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
xor esi, esi
push str.SW2_TRACE_LEVEL_INFO
push str.__23s::SW2_IsAdmin__
mov eax, 0x40000
mov dword [ebp - 0xc], 0
mov word [ebp - 8], 0x500
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x18], esi
call fcn.0040b690
add esp, 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov ebx, eax
mov dword [ebp - 0x24], ebx
cmp ebx, esi
je 0x40bfa9
lea eax, [ebp - 0x14]
push eax
push 8
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x40bf82
mov edx, dword [ebp - 0x14]
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
lea ecx, [ebp - 0x10]
push ecx
push esi
push esi
push 2
push edx
call edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp esi, 0x7a
jne 0x40bf49
mov eax, dword [ebp - 0x10]
push eax
lea esi, [ebp - 0x20]
call fcn.0040bae0
add esp, 4
test eax, eax
jne 0x40bf1b
mov edx, dword [ebp - 0x10]
mov ebx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x14]
lea ecx, [ebp - 0x10]
push ecx
push edx
push ebx
push 2
push eax
call edi
test eax, eax
je 0x40bed8
xor esi, esi
lea ecx, [ebp - 0x1c]
push ecx
push esi
push esi
push esi
push esi
push esi
push esi
push 0x220
push 0x20
push 2
lea edx, [ebp - 0xc]
push edx
call dword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
test eax, eax
je 0x40bec5
mov dword [ebp - 0x18], esi
cmp dword [ebx], esi
jle 0x40be96
lea edi, [ebx + 4]
mov eax, dword [edi]
mov ecx, dword [ebp - 0x1c]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x40be8f
inc esi
add edi, 8
cmp esi, dword [ebx]
jl 0x40be47
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_FreeSid]
lea eax, [ebp - 0x20]
call fcn.0040bb70
mov ecx, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x18]
pop edi
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40bfc7
mov dword [ebp - 0x18], 1
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.ADVAPI32.dll_FreeSid]
lea eax, [ebp - 0x20]
call fcn.0040bb70
mov ecx, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x18]
pop edi
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40bfc7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2_IsAdmin__::AllocateAndInitializeSid___FAILED__ld
jmp 0x40bee9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2_IsAdmin__::GetTokenInformation2___FAILED__ld
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
lea eax, [ebp - 0x20]
call fcn.0040bb70
mov ecx, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x18]
pop edi
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40bfc7
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2_IsAdmin__::could_not_allocate_memory_for_pTokenGroups
mov eax, 0x10000
call fcn.0040b690
mov ecx, dword [ebp - 0x14]
add esp, 8
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x18]
pop edi
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40bfc7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [ebp - 0x10]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2_IsAdmin__::GetTokenInformation____d_FAILED__d
mov eax, 0x10000
call fcn.0040b690
mov ecx, dword [ebp - 0x14]
add esp, 0x10
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 0x18]
pop edi
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40bfc7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2_IsAdmin__::OpenThreadToken_FAILED:__d
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40bfc7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SW2_TRACE_LEVEL_ERROR
push str.__23s::SW2_IsAdmin__::GetCurrentThread___FAILED:__d
mov eax, 0x10000
call fcn.0040b690
add esp, 0xc
push esi
push str.SW2_TRACE_LEVEL_INFO
push str.__23s::SW2_IsAdmin__::returning__ld
mov eax, 0x40000
call fcn.0040b690
mov ecx, dword [ebp - 4]
add esp, 0xc
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040f43d
mov esp, ebp
pop ebp
ret