Function at 0x10012460
Capabilities:
Acquire debug privileges
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10108226
mov eax, dword fs:[0]
push eax
sub esp, 0x4a0
mov eax, dword [0x10137920]
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
xor ebx, ebx
mov edi, ecx
mov eax, 0xf
mov dword [ebp - 0x4a0], edi
mov dword [ebp - 0x4a4], ebx
mov dword [ebp - 0x434], eax
mov dword [ebp - 0x438], ebx
mov byte [ebp - 0x448], bl
xor ecx, ecx
mov dword [ebp - 4], ebx
cmp ecx, str._tmp_
je 0x100127e5
push 0x3ff
lea edx, [ebp - 0x40f]
push ebx
push edx
mov byte [ebp - 0x410], bl
call fcn.10066620
add esp, 0xc
push 0xc
xor eax, eax
push str.Kernel32.dll
lea ecx, [ebp - 0x42c]
mov dword [ebp - 0x4a8], ebx
mov dword [ebp - 0x418], 7
mov dword [ebp - 0x41c], ebx
mov word [ebp - 0x42c], ax
call fcn.1000abb0
cmp dword [ebp - 0x41c], ebx
jne 0x1001251e
xor esi, esi
jmp 0x10012567
mov eax, dword [ebp - 0x42c]
mov esi, 8
cmp dword [ebp - 0x418], esi
jae 0x10012537
lea eax, [ebp - 0x42c]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
cmp eax, ebx
jne 0x10012565
mov eax, dword [ebp - 0x42c]
cmp dword [ebp - 0x418], esi
jae 0x10012556
lea eax, [ebp - 0x42c]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
jne 0x10012565
xor esi, esi
jmp 0x10012567
mov esi, eax
cmp dword [ebp - 0x418], 8
jb 0x1001257f
mov ecx, dword [ebp - 0x42c]
push ecx
call fcn.10065453
add esp, 4
xor edx, edx
mov eax, 7
mov dword [ebp - 0x418], eax
mov dword [ebp - 0x41c], ebx
mov word [ebp - 0x42c], dx
cmp esi, ebx
je 0x10012762
mov dword [ebp - 0x450], eax
push 0xc
xor eax, eax
push str.Wtsapi32.dll
lea ecx, [ebp - 0x464]
mov dword [ebp - 0x454], ebx
mov word [ebp - 0x464], ax
call fcn.1000abb0
lea ecx, [ebp - 0x464]
push ecx
call fcn.10017120
add esp, 4
cmp dword [ebp - 0x450], 8
mov edi, eax
jb 0x100125f1
mov edx, dword [ebp - 0x464]
push edx
call fcn.10065453
add esp, 4
xor eax, eax
mov dword [ebp - 0x450], 7
mov dword [ebp - 0x454], ebx
mov word [ebp - 0x464], ax
cmp edi, ebx
je 0x1001275c
push str.Userenv.dll
lea ecx, [ebp - 0x49c]
call fcn.1000aca0
lea ecx, [ebp - 0x49c]
push ecx
call fcn.10017120
add esp, 4
lea ecx, [ebp - 0x49c]
mov dword [ebp - 0x4ac], eax
call fcn.1000b180
cmp dword [ebp - 0x4ac], ebx
je 0x1001275c
push str.advapi32.dll
lea ecx, [ebp - 0x480]
call fcn.1000aca0
lea edx, [ebp - 0x480]
push edx
call fcn.10017120
add esp, 4
lea ecx, [ebp - 0x480]
mov dword [ebp - 0x4a4], eax
call fcn.1000b180
cmp dword [ebp - 0x4a4], ebx
je 0x1001275c
push str.WTSGetActiveConsoleSessionId
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
call esi
mov dword [ebp - 0x4a4], eax
cmp eax, ebx
je 0x1001275c
push str.WTSQueryUserToken
push edi
call esi
mov edi, eax
cmp edi, ebx
je 0x1001275c
mov eax, dword [ebp - 0x4ac]
push str.ExpandEnvironmentStringsForUserA
push eax
call esi
mov esi, eax
cmp esi, ebx
je 0x1001275c
push str.SeDebugPrivilege
lea ecx, [ebp - 0x480]
call fcn.1000aca0
lea ecx, [ebp - 0x480]
push ecx
mov byte [ebp - 4], 1
call fcn.10016f10
add esp, 4
lea ecx, [ebp - 0x480]
mov byte [ebp - 4], bl
call fcn.1000b180
call dword [ebp - 0x4a4]
lea edx, [ebp - 0x4a8]
push edx
push eax
call edi
test eax, eax
je 0x1001275c
mov ecx, dword [ebp - 0x4a8]
push 0x400
lea eax, [ebp - 0x410]
push eax
push str._tmp_
push ecx
call esi
test eax, eax
je 0x1001275c
lea eax, [ebp - 0x410]
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x10012740
sub eax, edx
push eax
lea edx, [ebp - 0x410]
push edx
lea ecx, [ebp - 0x448]
call fcn.10004560
mov edi, dword [ebp - 0x4a0]
cmp dword [ebp - 0x438], ebx
jne 0x100127ac
push 0x400
lea eax, [ebp - 0x410]
push eax
push str._tmp_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
test eax, eax
je 0x100127ac
lea eax, [ebp - 0x410]
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x10012790
sub eax, edx
push eax
lea ecx, [ebp - 0x410]
push ecx
lea ecx, [ebp - 0x448]
call fcn.10004560
mov edx, dword [ebp - 0x4a8]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x448]
mov dword [edi + 0x14], 0xf
mov dword [edi + 0x10], ebx
push eax
mov ecx, edi
mov byte [edi], bl
call fcn.10004040
cmp dword [ebp - 0x434], 0x10
jb 0x10012813
mov ecx, dword [ebp - 0x448]
push ecx
jmp 0x1001280b
lea edx, [ebp - 0x448]
mov dword [edi + 0x14], eax
mov dword [edi + 0x10], ebx
push edx
mov ecx, edi
mov byte [edi], bl
call fcn.10004040
cmp dword [ebp - 0x434], 0x10
jb 0x10012813
mov eax, dword [ebp - 0x448]
push eax
call fcn.10065453
add esp, 4
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.1006656c
mov esp, ebp
pop ebp
ret