Function at 0x40cac0
Capabilities:
Access peb ldr_data
Acquire debug privileges
Enumerate processes
Get common file path
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x4d848c
mov eax, dword fs:[0]
push eax
sub esp, 0x488
mov eax, dword [0x54d158]
xor eax, esp
mov dword [esp + 0x480], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x54d158]
xor eax, esp
push eax
lea eax, [esp + 0x49c]
mov dword fs:[0], eax
mov esi, ecx
mov dword [esp + 0x30], esi
xor ebp, ebp
mov dword [esp + 0x4a4], ebp
mov eax, dword [esp + 0x4ac]
add eax, 0xfffffff0
push eax
mov dword [esp + 0x4c], eax
call fcn.0040ff10
add eax, 0x10
add esp, 4
mov dword [esi], eax
mov byte [esp + 0x4a4], 1
push ebp
mov dword [esi + 0x10], ebp
call fcn.004ad7bb
or ebx, 0xffffffff
add esp, 4
mov dword [esi + 8], eax
mov dword [esi + 0xc], edx
mov dword [esp + 0x20], ebx
call fcn.004a08e6
xor ecx, ecx
cmp eax, ebp
setne cl
cmp ecx, ebp
jne 0x40cb61
push 0x80004005
call fcn.004103e0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x2c], eax
mov byte [esp + 0x4a4], 2
call fcn.004a08e6
xor ecx, ecx
cmp eax, ebp
setne cl
cmp ecx, ebp
jne 0x40cb93
push 0x80004005
call fcn.004103e0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x34], eax
push ebp
mov byte [esp + 0x4a8], 3
push 2
mov dword [esp + 0x44], ebx
mov dword [esp + 0x2c], ebx
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov edi, eax
cmp edi, ebx
mov dword [esp + 0x40], edi
je 0x40cfa1
push 0x228
lea ecx, [esp + 0x6c]
push ebp
push ecx
call fcn.004b0770
add esp, 0xc
lea edx, [esp + 0x64]
push edx
push edi
mov dword [esp + 0x6c], 0x22c
call sub.KERNEL32.dll_Process32FirstW
test eax, eax
jne 0x40cbff
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40cfa1
call dword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
push str.explorer.exe
lea ecx, [esp + 0x3c]
mov esi, eax
mov dword [esp + 0x1c], ebp
xor ebx, ebx
call fcn.00410140
mov byte [esp + 0x4a4], 4
jmp 0x40cc30
mov eax, dword [esp + 0x38]
lea ecx, [esp + 0x88]
jmp 0x40cc40
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40cc66
cmp dx, bp
je 0x40cc62
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40cc66
add eax, 4
add ecx, 4
cmp dx, bp
jne 0x40cc40
xor eax, eax
jmp 0x40cc6b
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebp
sete al
test al, al
je 0x40cc96
mov ecx, dword [esp + 0x6c]
lea eax, [esp + 0x1c]
push eax
push ecx
mov dword [esp + 0x24], ebp
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
je 0x40cc96
cmp dword [esp + 0x1c], esi
je 0x40cd21
lea edx, [esp + 0x64]
push edx
push edi
call sub.KERNEL32.dll_Process32NextW
test eax, eax
jne 0x40cc30
lea eax, [esp + 0x64]
push eax
push edi
call sub.KERNEL32.dll_Process32FirstW
mov eax, dword [esp + 0x38]
lea ecx, [esp + 0x88]
jmp 0x40ccc0
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x40cce6
cmp dx, bp
je 0x40cce2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x40cce6
add eax, 4
add ecx, 4
cmp dx, bp
jne 0x40ccc0
xor eax, eax
jmp 0x40cceb
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebp
sete al
test al, al
je 0x40cd0c
mov edx, dword [esp + 0x6c]
lea ecx, [esp + 0x1c]
push ecx
push edx
mov dword [esp + 0x24], ebp
call dword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
test eax, eax
jne 0x40cd1d
lea eax, [esp + 0x64]
push eax
push edi
call sub.KERNEL32.dll_Process32NextW
test eax, eax
jne 0x40ccb0
jmp 0x40cd2d
mov esi, dword [esp + 0x1c]
mov ebx, dword [esp + 0x6c]
mov dword [esp + 0x18], 1
lea ecx, [esp + 0x3c]
push ecx
push esi
call sub.WTSAPI32.dll_WTSQueryUserToken
cmp dword [esp + 0x18], ebp
jne 0x40cd4d
mov edx, dword [esp + 0x3c]
push edx
push ebx
push esi
call fcn.004014f0
add esp, 0xc
push ebx
push ebp
push 0x2000000
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov ebx, eax
lea eax, [esp + 0x24]
push eax
push 0x201eb
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x40cd78
push str.Failed_to_OpenProcessToken
jmp 0x40cd92
lea ecx, [esp + 0x4c]
push ecx
push str.SeDebugPrivilege
push ebp
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
jne 0x40cda8
push str.Failed_to_LookupPrivilegeValue
call fcn.004accd0
add eax, 0x40
push eax
call fcn.004acc3c
add esp, 8
call fcn.004014f0
mov edx, dword [esp + 0x4c]
mov eax, dword [esp + 0x50]
lea ecx, [esp + 0x20]
push ecx
push 1
push 1
push ebp
mov dword [esp + 0x68], edx
mov edx, dword [esp + 0x34]
push 0x2000000
push edx
mov dword [esp + 0x6c], 1
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], 2
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [esp + 0x20]
push 4
push esi
push 0xc
push eax
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
mov edx, dword [esp + 0x20]
push ebp
push ebp
push 0x10
lea ecx, [esp + 0x60]
push ecx
push ebp
push edx
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
jne 0x40ce2c
push str.Failed_to_AdjustTokenPrivileges
call fcn.004accd0
add eax, 0x40
push eax
call fcn.004acc3c
add esp, 8
call fcn.004014f0
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x294]
push eax
push ebp
push ecx
push 0x28
push ebp
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
jne 0x40cee1
lea edx, [esp + 0x294]
push edx
lea ecx, [esp + 0x1c]
call fcn.00410140
mov byte [esp + 0x4a4], 5
mov eax, dword [esp + 0x18]
push 0x5c
push eax
call fcn.004adb61
add esp, 8
cmp eax, ebp
je 0x40ceb7
mov edx, dword [esp + 0x18]
sub eax, edx
sar eax, 1
mov ecx, eax
cmp ecx, ebp
jle 0x40ceb7
mov eax, dword [edx - 0xc]
sub eax, ecx
sub eax, 1
push eax
lea ecx, [esp + 0x20]
push ecx
lea ecx, [esp + 0x20]
call fcn.0040dbf0
push eax
lea ecx, [esp + 0x30]
mov byte [esp + 0x4a8], 6
call fcn.0040fdf0
lea ecx, [esp + 0x1c]
call fcn.00410230
mov byte [esp + 0x4a4], 4
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40cee6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x40cee6
call fcn.004014f0
mov edx, dword [esp + 0x24]
mov edi, dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
lea ecx, [esp + 0x28]
push ecx
push ebp
push ebp
push 1
push edx
mov dword [esp + 0x3c], ebp
call edi
mov eax, dword [esp + 0x28]
push eax
call fcn.004acec0
mov edx, dword [esp + 0x2c]
add esp, 4
lea ecx, [esp + 0x28]
push ecx
push edx
mov esi, eax
mov eax, dword [esp + 0x2c]
push esi
push 1
push eax
call edi
test eax, eax
je 0x40cf4e
mov edx, dword [esi]
lea ecx, [esp + 0x1c]
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_ConvertSidToStringSidW]
mov eax, dword [esp + 0x1c]
push eax
lea ecx, [esp + 0x38]
call fcn.00410090
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
push esi
call fcn.004ad032
mov edx, dword [esp + 0x44]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 4
push edx
call esi
push ebx
call esi
mov eax, dword [esp + 0x3c]
push eax
call esi
mov ecx, dword [esp + 0x24]
push ecx
call esi
mov byte [esp + 0x4a4], 3
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40cf9d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, dword [esp + 0x30]
lea ecx, [esp + 0x2c]
push ecx
mov eax, 0x55489c
call fcn.0040ddc0
add esp, 4
test al, al
je 0x40cff1
lea edx, [esp + 0x2c]
push edx
mov ecx, 0x55489c
call fcn.0040fdf0
lea eax, [esp + 0x34]
push eax
mov ecx, 0x5548a0
call fcn.0040fdf0
mov eax, dword [0x54fa4c]
cmp eax, dword [esp + 0x20]
je 0x40cff1
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x20]
mov dword [0x54fa4c], ecx
push 0x51c5d4
push esi
call fcn.0040dcf0
add esp, 8
test al, al
je 0x40d08a
push 0xc8
call fcn.004a08b1
mov edi, eax
add esp, 4
mov dword [esp + 0x40], edi
cmp edi, ebp
mov bl, 7
mov byte [esp + 0x4a4], bl
je 0x40d11b
mov eax, dword [0x5548a0]
push ecx
add eax, 0xfffffff0
mov dword [esp + 0x1c], esp
mov esi, esp
push eax
call fcn.0040ff10
add eax, 0x10
add esp, 4
mov dword [esi], eax
mov byte [esp + 0x4a8], 8
mov edx, dword [0x54fa4c]
mov eax, dword [0x55489c]
push edx
push ecx
add eax, 0xfffffff0
mov dword [esp + 0x50], esp
mov esi, esp
push eax
call fcn.0040ff10
add esp, 4
add eax, 0x10
mov dword [esi], eax
push edi
mov byte [esp + 0x4b4], bl
call fcn.0040d290
mov esi, dword [esp + 0x30]
jmp 0x40d11d
push str.miplatform
push esi
call fcn.0040dcf0
add esp, 8
test al, al
je 0x40d120
push 0x2f8
call fcn.004a08b1
mov edi, eax
add esp, 4
mov dword [esp + 0x44], edi
cmp edi, ebp
mov bl, 9
mov byte [esp + 0x4a4], bl
je 0x40d11b
mov eax, dword [0x5548a0]
push ecx
add eax, 0xfffffff0
mov dword [esp + 0x44], esp
mov esi, esp
push eax
call fcn.0040ff10
add eax, 0x10
add esp, 4
mov dword [esi], eax
mov byte [esp + 0x4a8], 0xa
mov eax, dword [0x54fa4c]
push eax
mov eax, dword [0x55489c]
push ecx
add eax, 0xfffffff0
mov dword [esp + 0x24], esp
mov esi, esp
push eax
call fcn.0040ff10
add esp, 4
add eax, 0x10
mov dword [esi], eax
push edi
mov byte [esp + 0x4b4], bl
call fcn.0040d650
mov esi, dword [esp + 0x30]
jmp 0x40d11d
xor eax, eax
mov dword [esi + 0x10], eax
mov byte [esp + 0x4a4], 2
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d148
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x4a4], 1
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d170
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x4a4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d198
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [esp + 0x49c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x480]
xor ecx, esp
call fcn.004ac89d
add esp, 0x494
ret 4