Function at 0x40a460
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
lea ebp, [esp - 0x2644]
mov eax, 0x2644
call fcn.004226c0
push 0xffffffffffffffff
push 0x4234b0
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x430038]
xor eax, ebp
mov dword [ebp + 0x2640], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x264c]
mov ecx, dword [ebp + 0x2650]
mov dword [ebp - 0x28], ecx
lea ecx, [ebp - 0x4c]
push str.Kernel32.dll
mov dword [ebp - 0x14], eax
mov dword [eax], 0
call fcn.00406d00
mov dword [ebp - 4], 0
lea eax, [ebp - 0x4c]
push eax
call fcn.0040cfe0
mov ecx, eax
call fcn.0040d0a0
mov esi, eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x4c]
call fcn.00406c60
test esi, esi
je 0x40a8ec
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.WTSGetActiveConsoleSessionId
push esi
call ebx
test eax, eax
je 0x40a8ec
call eax
mov dword [ebp - 0x30], eax
cmp eax, 0xffffffff
je 0x40a8ec
push str.Psapi.dll
lea ecx, [ebp - 0x4c]
call fcn.00406d00
mov dword [ebp - 4], 1
lea eax, [ebp - 0x4c]
push eax
call fcn.0040cfe0
mov ecx, eax
call fcn.0040d0a0
mov edi, eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x4c]
call fcn.00406c60
push str.Advapi32.dll
lea ecx, [ebp - 0x64]
call fcn.00406d00
mov dword [ebp - 4], 2
lea eax, [ebp - 0x64]
push eax
call fcn.0040cfe0
mov ecx, eax
call fcn.0040d0a0
mov esi, eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x64]
call fcn.00406c60
push str.Wtsapi32.dll
lea ecx, [ebp - 0x7c]
call fcn.00406d00
mov dword [ebp - 4], 3
lea eax, [ebp - 0x7c]
push eax
call fcn.0040cfe0
mov ecx, eax
call fcn.0040d0a0
mov dword [ebp - 0x18], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x7c]
call fcn.00406c60
test edi, edi
je 0x40a8ec
test esi, esi
je 0x40a8ec
cmp dword [ebp - 0x18], 0
je 0x40a8ec
push str.EnumProcesses
push edi
call ebx
push str.GetModuleFileNameExA
push edi
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.GetProcessImageFileNameA
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x20], eax
call edi
push str.OpenProcessToken
push esi
mov dword [ebp - 0x1c], eax
call edi
push str.GetTokenInformation
push esi
mov dword [ebp - 0x24], eax
call edi
mov dword [ebp - 0x2c], eax
test ebx, ebx
je 0x40a8ec
cmp dword [ebp - 0x20], 0
jne 0x40a628
cmp dword [ebp - 0x1c], 0
je 0x40a8ec
cmp dword [ebp - 0x24], 0
je 0x40a8ec
test eax, eax
je 0x40a8ec
push 0x2000
lea eax, [ebp + 0x14]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp + 0xc], 0
lea eax, [ebp + 0xc]
push eax
push 0x2000
lea eax, [ebp + 0x14]
push eax
call ebx
test eax, eax
je 0x40a8ec
mov eax, dword [ebp + 0xc]
mov ecx, 0x800
shr eax, 2
cmp eax, ecx
mov dword [ebp + 0x10], 0
mov dword [ebp + 4], 0
cmovae eax, ecx
xor ebx, ebx
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x10], ebx
test eax, eax
je 0x40a8e1
mov edi, dword [ebp - 0x14]
nop dword [eax]
push 0x209
lea eax, [ebp + 0x2014]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push 0x105
lea eax, [ebp + 0x2220]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push 0x105
lea eax, [ebp + 0x2328]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push 0x105
lea eax, [ebp + 0x2538]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push 0x105
lea eax, [ebp + 0x2430]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0x3c
push dword [ebp + ebx*4 + 0x14]
push 0
push 0x410
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
test esi, esi
jne 0x40a733
push dword [ebp + ebx*4 + 0x14]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
test esi, esi
je 0x40a8b0
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x40a74d
push 0x208
lea ecx, [ebp + 0x2014]
push ecx
push esi
call eax
test eax, eax
jne 0x40a771
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x40a885
push 0x208
lea ecx, [ebp + 0x2014]
push ecx
push 0
push esi
call eax
test eax, eax
je 0x40a885
push 0x104
lea eax, [ebp + 0x2430]
push eax
push 0x104
lea eax, [ebp + 0x2538]
push eax
push 0x104
lea eax, [ebp + 0x2328]
push eax
push 0x104
lea eax, [ebp + 0x2220]
push eax
lea eax, [ebp + 0x2014]
push eax
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__splitpath_s]
lea eax, [ebp + 0x2538]
push eax
push str.explorer
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__stricmp]
add esp, 0x2c
test eax, eax
jne 0x40a885
lea eax, [ebp + 0x2430]
push eax
push str..exe
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__stricmp]
add esp, 8
test eax, eax
jne 0x40a885
push edi
push 0x2000e
push esi
call dword [ebp - 0x24]
test eax, eax
je 0x40a885
mov eax, dword [edi]
test eax, eax
je 0x40a8a5
lea ecx, [ebp + 4]
push ecx
push 4
lea ecx, [ebp + 0x10]
push ecx
push 0xc
push eax
call dword [ebp - 0x2c]
test eax, eax
je 0x40a885
mov eax, dword [ebp - 0x30]
cmp dword [ebp + 0x10], eax
je 0x40a8d2
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.WTSQuerySessionInformationW
push dword [ebp - 0x18]
call edi
push str.WTSFreeMemory
push dword [ebp - 0x18]
mov ebx, eax
call edi
mov edi, eax
test ebx, ebx
je 0x40a882
test edi, edi
je 0x40a882
lea eax, [ebp + 8]
mov dword [ebp], 0
push eax
lea eax, [ebp]
mov dword [ebp + 8], 0
push eax
push 8
push dword [ebp + 0x10]
push 0
call ebx
test eax, eax
je 0x40a882
mov eax, dword [ebp]
test eax, eax
je 0x40a882
cmp dword [ebp + 8], 4
jne 0x40a87f
cmp dword [eax], 0
je 0x40a8c8
push eax
call edi
mov ebx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x14]
mov eax, dword [eax]
test eax, eax
je 0x40a8a2
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x14]
mov edi, eax
mov dword [eax], 0
jmp 0x40a8a5
mov edi, dword [ebp - 0x14]
test esi, esi
je 0x40a8b0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
inc ebx
mov dword [ebp - 0x10], ebx
cmp ebx, dword [ebp - 0x34]
jb 0x40a6a0
mov eax, dword [ebp - 0x14]
cmp dword [eax], 0
setne al
jmp 0x40a8ee
push eax
call edi
mov dword [ebp], 0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x28]
mov eax, dword [ebp + 0x10]
mov dword [ecx], eax
mov eax, dword [ebp - 0x14]
cmp dword [eax], 0
setne al
jmp 0x40a8ee
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x2640]
xor ecx, ebp
call fcn.004210a4
lea esp, [ebp + 0x2644]
pop ebp
ret 8