Function at 0x407830
Capabilities:
Link many functions at runtime

Disassembly:
sub esp, 0x2c
push ebx
push ebp
push esi
push edi
push str.advapi32.dll
mov byte [esp + 0x38], 0
mov byte [esp + 0x39], 0
mov byte [esp + 0x3a], 0
mov byte [esp + 0x3b], 0
mov byte [esp + 0x3c], 0
mov byte [esp + 0x3d], 5
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
test edi, edi
je 0x407a71
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.OpenThreadToken
push edi
call esi
push str.OpenProcessToken
push edi
mov ebx, eax
call esi
push str.GetTokenInformation
push edi
mov dword [esp + 0x28], eax
call esi
push str.AllocateAndInitializeSid
push edi
mov dword [esp + 0x2c], eax
call esi
mov ebp, eax
push str.FreeSid
push edi
mov dword [esp + 0x30], ebp
call esi
push str.EqualSid
push edi
mov dword [esp + 0x24], eax
call esi
test ebx, ebx
mov dword [esp + 0x2c], eax
je 0x407a6a
mov ecx, dword [esp + 0x20]
test ecx, ecx
je 0x407a6a
mov esi, dword [esp + 0x24]
test esi, esi
je 0x407a6a
test ebp, ebp
je 0x407a6a
mov ecx, dword [esp + 0x1c]
test ecx, ecx
je 0x407a6a
test eax, eax
je 0x407a6a
lea eax, [esp + 0x14]
push eax
push 0
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40793b
call ebx
cmp eax, 0x3f0
jne 0x407a0c
lea ecx, [esp + 0x14]
push ecx
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [esp + 0x2c]
test eax, eax
jne 0x40793b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x10]
push edx
push 0
push 0
push 2
push eax
call esi
test eax, eax
je 0x40795b
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2c
ret
call ebx
cmp eax, 0x7a
je 0x40796c
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2c
ret
mov ecx, dword [esp + 0x10]
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebp, eax
test ebp, ebp
mov dword [esp + 0x20], ebp
jne 0x40798b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x10]
push edx
push eax
push ebp
push 2
push ecx
call dword [esp + 0x38]
test eax, eax
jne 0x4079ad
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
lea edx, [esp + 0x18]
mov esi, dword [esp + 0x28]
push edx
push 0
push 0
push 0
push 0
push 0
push 0
push 0x220
push 0x20
lea eax, [esp + 0x58]
push 2
push eax
call esi
test eax, eax
jne 0x4079de
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
lea ecx, [esp + 0x30]
lea edx, [esp + 0x34]
push ecx
push 0
push 0
push 0
push 0
push 0
push 0
push 0x223
push 0x20
push 2
push edx
call esi
test eax, eax
jne 0x407a16
mov eax, dword [esp + 0x18]
push eax
call dword [esp + 0x20]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2c
ret
xor esi, esi
xor ebx, ebx
add ebp, 4
mov ecx, dword [esp + 0x20]
cmp ebx, dword [ecx]
jae 0x407a3c
mov edx, dword [esp + 0x18]
mov eax, dword [ebp]
push edx
push eax
call dword [esp + 0x34]
mov esi, eax
inc ebx
add ebp, 8
test esi, esi
je 0x407a1d
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0x1c]
push ecx
call ebx
mov edx, dword [esp + 0x30]
push edx
call ebx
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x2c
ret