Function at 0x406381
Capabilities:
Enumerate processes
Get common file path

Disassembly:
push 0x8a4
mov eax, 0x434cc8
call fcn.0041ab20
mov edi, dword [ebp + 8]
lea ecx, [ebp - 0x84c]
mov ebx, dword [ebp + 0xc]
push str.GetTokenFromValidUserProcess...
mov dword [ebp - 0x8b0], edi
mov dword [ebp - 0x8a8], ebx
call fcn.0040200d
xor esi, esi
lea eax, [ebp - 0x84c]
push esi
push eax
push 2
mov dword [ebp - 4], esi
call fcn.004031a3
mov ecx, dword [ebp - 0x84c]
add esp, 0xc
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov eax, dword [ebx]
mov dword [ebp - 0x848], esi
mov dword [ebp - 0x89c], esi
cmp dword [eax - 0xc], esi
jne 0x4064d4
call fcn.0040be29
push eax
lea ecx, [ebp - 0x84c]
call fcn.00401320
push 0x208
lea eax, [ebp - 0x218]
inc esi
push 0
push eax
mov dword [ebp - 4], esi
call fcn.0041c040
add esp, 0xc
lea eax, [ebp - 0x218]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x40648e
lea eax, [ebp - 0x218]
push eax
call fcn.0041fcde
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x84c]
call fcn.0040353e
mov esi, str.explorer.exe
push esi
call fcn.0041fcde
pop ecx
push eax
push esi
lea ecx, [ebp - 0x84c]
call fcn.00402296
and dword [ebp - 0x854], 0
lea eax, [ebp - 0x854]
push eax
lea eax, [ebp - 0x84c]
push eax
push edi
call fcn.00405d4f
add esp, 0xc
mov edi, eax
jmp 0x4064c9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.GetWindowsDirectory_failed:
lea ecx, [ebp - 0x850]
mov edi, eax
call fcn.0040200d
push edi
lea eax, [ebp - 0x850]
mov byte [ebp - 4], 2
push eax
push esi
call fcn.004031a3
mov ecx, dword [ebp - 0x850]
add esp, 0xc
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ecx, dword [ebp - 0x84c]
jmp 0x406b71
push esi
push 2
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov edi, eax
cmp edi, 0xffffffff
jne 0x406529
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.CreateToolhelp32Snapshot_failed
lea ecx, [ebp - 0x850]
mov esi, eax
call fcn.0040200d
push esi
lea eax, [ebp - 0x850]
mov dword [ebp - 4], 3
push eax
push 1
call fcn.004031a3
mov ecx, dword [ebp - 0x850]
add esp, 0xc
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov eax, esi
jmp 0x406b7b
lea eax, [ebp - 0x844]
mov dword [ebp - 0x844], 0x22c
push eax
push edi
call sub.KERNEL32.dll_Process32FirstW
test eax, eax
jne 0x40658c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.Process32First_failed
lea ecx, [ebp - 0x850]
mov esi, eax
call fcn.0040200d
push esi
lea eax, [ebp - 0x850]
mov dword [ebp - 4], 4
push eax
push 1
call fcn.004031a3
mov ecx, dword [ebp - 0x850]
add esp, 0xc
lea ecx, [ecx - 0x10]
call fcn.00401a18
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x406522
xor esi, esi
inc esi
push dword [ebp - 0x83c]
call fcn.00406b81
mov ebx, eax
pop ecx
mov dword [ebp - 0x854], ebx
lea ecx, [ebx - 0x2000]
cmp ecx, 0xfff
ja 0x406aaa
push dword [ebp - 0x83c]
push 0
push 0x2000000
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov ebx, eax
mov dword [ebp - 0x84c], ebx
test ebx, ebx
je 0x406b19
cmp ebx, 0xffffffff
je 0x40690b
and dword [ebp - 0x848], 0
lea eax, [ebp - 0x848]
push eax
push 0xa
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x406a8c
cmp dword [ebp - 0x848], 0
jne 0x40667b
lea eax, [ebp - 0x820]
push eax
lea ecx, [ebp - 0x858]
call fcn.0040200d
push str.null_token
lea ecx, [ebp - 0x850]
mov dword [ebp - 4], 7
call fcn.0040200d
push 0
lea eax, [ebp - 0x858]
mov byte [ebp - 4], 8
push eax
lea eax, [ebp - 0x850]
push eax
push esi
call fcn.00402a61
mov ecx, dword [ebp - 0x850]
add esp, 0x10
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ecx, dword [ebp - 0x858]
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.00401a18
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x406b19
push 0x200
lea eax, [ebp - 0x418]
push 0
push eax
call fcn.0041c040
push 0x200
lea eax, [ebp - 0x618]
push 0
push eax
call fcn.0041c040
mov eax, 0x100
mov dword [ebp - 0x8a4], eax
mov dword [ebp - 0x8a0], eax
lea eax, [ebp - 0x8a0]
push eax
lea eax, [ebp - 0x618]
push eax
lea eax, [ebp - 0x8a4]
push eax
lea eax, [ebp - 0x418]
push eax
push dword [ebp - 0x848]
call fcn.00406c31
add esp, 0x2c
test eax, eax
jne 0x406758
lea eax, [ebp - 0x820]
push eax
lea ecx, [ebp - 0x860]
call fcn.0040200d
push str.GetUserNameAndDomainNameFromToken_failed
lea ecx, [ebp - 0x85c]
mov dword [ebp - 4], 9
call fcn.0040200d
push 0
lea eax, [ebp - 0x860]
mov byte [ebp - 4], 0xa
push eax
lea eax, [ebp - 0x85c]
push eax
push esi
call fcn.00402a61
mov ecx, dword [ebp - 0x85c]
add esp, 0x10
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ecx, dword [ebp - 0x860]
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.00401a18
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x848]
jmp 0x406670
lea eax, [ebp - 0x418]
push eax
lea ecx, [ebp - 0x8ac]
call fcn.0040200d
push eax
push dword [ebp - 0x8a8]
call fcn.00403f81
pop ecx
pop ecx
mov ecx, dword [ebp - 0x8ac]
mov bl, al
add ecx, 0xfffffff0
call fcn.00401a18
test bl, bl
je 0x406a20
lea eax, [ebp - 0x848]
push eax
call fcn.00406e41
test eax, eax
lea eax, [ebp - 0x820]
pop ecx
push eax
je 0x406810
lea ecx, [ebp - 0x868]
call fcn.0040200d
push str.Using_primary_token_from_elevated_process
lea ecx, [ebp - 0x864]
mov dword [ebp - 4], 0xb
call fcn.0040200d
push 0
lea eax, [ebp - 0x868]
mov byte [ebp - 4], 0xc
push eax
lea eax, [ebp - 0x864]
push eax
push 2
call fcn.00402a61
mov ecx, dword [ebp - 0x864]
add esp, 0x10
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ecx, dword [ebp - 0x868]
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ebx, dword [ebp - 0x848]
jmp 0x40687e
lea ecx, [ebp - 0x870]
call fcn.0040200d
push str.Using_linked_token_from_not_elevated_process
lea ecx, [ebp - 0x86c]
mov dword [ebp - 4], 0xd
call fcn.0040200d
push 0
lea eax, [ebp - 0x870]
mov byte [ebp - 4], 0xe
push eax
lea eax, [ebp - 0x86c]
push eax
push 2
call fcn.00402a61
mov ecx, dword [ebp - 0x86c]
add esp, 0x10
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ecx, dword [ebp - 0x870]
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.00401a18
push dword [ebp - 0x848]
call fcn.004057d5
pop ecx
mov ebx, eax
lea eax, [ebp - 0x820]
push eax
test ebx, ebx
jne 0x406917
lea ecx, [ebp - 0x878]
call fcn.0040200d
push str.GetLinkedToken_failed
lea ecx, [ebp - 0x874]
mov dword [ebp - 4], 0xf
call fcn.0040200d
mov byte [ebp - 4], 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x878]
push eax
lea eax, [ebp - 0x874]
push eax
push esi
call fcn.00402a61
mov ecx, dword [ebp - 0x874]
add esp, 0x10
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ecx, dword [ebp - 0x878]
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.00401a18
cmp dword [ebp - 0x848], ebx
je 0x406905
push dword [ebp - 0x848]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [ebp - 0x84c]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x406b10
lea ecx, [ebp - 0x880]
call fcn.0040200d
push str.Linked_token_created
lea ecx, [ebp - 0x87c]
mov dword [ebp - 4], 0x11
call fcn.0040200d
push 0
lea eax, [ebp - 0x880]
mov byte [ebp - 4], 0x12
push eax
lea eax, [ebp - 0x87c]
push eax
push 2
call fcn.00402a61
mov ecx, dword [ebp - 0x87c]
add esp, 0x10
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ecx, dword [ebp - 0x880]
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.00401a18
push dword [ebp - 0x8b0]
push esi
push esi
push 0
push 0x2000000
push ebx
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x406a05
lea eax, [ebp - 0x820]
push eax
lea ecx, [ebp - 0x888]
call fcn.0040200d
push str.User_Token_with_privileges_found
lea ecx, [ebp - 0x884]
mov dword [ebp - 4], 0x13
call fcn.0040200d
push 0
lea eax, [ebp - 0x888]
mov byte [ebp - 4], 0x14
push eax
lea eax, [ebp - 0x884]
push eax
push 2
call fcn.00402a61
mov ecx, dword [ebp - 0x884]
add esp, 0x10
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ecx, dword [ebp - 0x888]
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.00401a18
and dword [ebp - 0x854], 0
mov dword [ebp - 0x89c], esi
mov eax, dword [ebp - 0x848]
test eax, eax
je 0x406a1a
cmp eax, ebx
je 0x406a1a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
jmp 0x4068ff
lea eax, [ebp - 0x820]
push eax
lea ecx, [ebp - 0x890]
call fcn.0040200d
push str.User_did_not_match__skipping
lea ecx, [ebp - 0x88c]
mov dword [ebp - 4], 0x15
call fcn.0040200d
push 0
lea eax, [ebp - 0x890]
mov byte [ebp - 4], 0x16
push eax
lea eax, [ebp - 0x88c]
push eax
push 2
call fcn.00402a61
mov ecx, dword [ebp - 0x88c]
add esp, 0x10
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ecx, dword [ebp - 0x890]
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.00401a18
jmp 0x406905
cmp dword [ebp - 0x848], 0
je 0x40690b
push dword [ebp - 0x848]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40690b
lea eax, [ebp - 0x820]
push eax
lea ecx, [ebp - 0x898]
call fcn.0040200d
push str.skipping_disallowed_process
lea ecx, [ebp - 0x894]
mov dword [ebp - 4], 5
call fcn.0040200d
push ebx
lea eax, [ebp - 0x898]
mov byte [ebp - 4], 6
push eax
lea eax, [ebp - 0x894]
push eax
push 2
call fcn.004031ea
mov ecx, dword [ebp - 0x894]
add esp, 0x10
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov ecx, dword [ebp - 0x898]
or dword [ebp - 4], 0xffffffff
lea ecx, [ecx - 0x10]
call fcn.00401a18
cmp dword [ebp - 0x89c], 0
jne 0x406b2e
lea eax, [ebp - 0x844]
push eax
push edi
call sub.KERNEL32.dll_Process32NextW
test eax, eax
jne 0x40658f
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp - 0x854]
test edi, edi
je 0x406b79
push str.finished_without_valid_token
lea ecx, [ebp - 0x854]
call fcn.0040200d
push 0x373
lea eax, [ebp - 0x854]
mov dword [ebp - 4], 0x17
push eax
push esi
call fcn.004031a3
mov ecx, dword [ebp - 0x854]
add esp, 0xc
lea ecx, [ecx - 0x10]
call fcn.00401a18
mov eax, edi
call fcn.0041aaca
ret