Function at 0x40f140
Capabilities:
Acquire debug privileges
Check for time delay via gettickcount
Create process on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x57697f
mov eax, dword fs:[0]
push eax
sub esp, 0x2f0
mov eax, dword [0x628f58]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor esi, esi
mov dword [ebp - 4], 2
mov dword [ebp - 0x29c], esi
cmp dword [ebp + 0x30], esi
jne 0x40f188
xor edi, edi
jmp 0x40fa78
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push eax
push str.Session0ShellExecute_begin_tick:_d
call fcn.00404560
add esp, 8
cmp dword [ebp + 0x48], esi
jne 0x40f1a8
mov ecx, str.No_parameter
jmp 0x40f1b3
cmp dword [ebp + 0x4c], 8
lea ecx, [ebp + 0x38]
cmovae ecx, dword [ebp + 0x38]
push dword [ebp + 0x54]
cmp dword [ebp + 0x34], 8
lea eax, [ebp + 0x20]
push ecx
cmovae eax, dword [ebp + 0x20]
push eax
push str.Session0ShellExecute_bin:_s_parameter:_s_waitsec:_d
call fcn.00404560
lea eax, [ebp + 0x20]
mov dword [ebp - 0x270], esi
push eax
mov edx, 0x60520c
mov dword [ebp - 0x280], esi
lea ecx, [ebp - 0x240]
mov dword [ebp - 0x284], esi
mov dword [ebp - 0x274], esi
mov dword [ebp - 0x278], esi
call fcn.00410070
add esp, 0x14
push 0x60520c
mov ecx, eax
mov byte [ebp - 4], 3
call fcn.00402930
mov dword [ebp - 0x218], 0
xor ecx, ecx
mov dword [ebp - 0x214], 0
movups xmm0, xmmword [eax]
movups xmmword [ebp - 0x228], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0x218], xmm0
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 7
mov word [eax], cx
mov byte [ebp - 4], 5
mov edx, dword [ebp - 0x22c]
cmp edx, 8
jb 0x40f294
mov ecx, dword [ebp - 0x240]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40f28a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fb69
push edx
push ecx
call fcn.0054a587
add esp, 8
xor eax, eax
mov dword [ebp - 0x230], 0
mov dword [ebp - 0x22c], 7
mov word [ebp - 0x240], ax
cmp dword [ebp + 0x48], eax
je 0x40f395
lea eax, [ebp + 0x38]
mov edx, 0x60b3f8
push eax
lea ecx, [ebp - 0x268]
call fcn.00410070
add esp, 4
mov byte [ebp - 4], 6
mov edx, eax
cmp dword [eax + 0x14], 8
jb 0x40f2df
mov edx, dword [eax]
mov ecx, dword [eax + 0x10]
mov esi, dword [ebp - 0x218]
mov eax, dword [ebp - 0x214]
sub eax, esi
mov dword [ebp - 0x26c], esi
cmp ecx, eax
ja 0x40f336
cmp dword [ebp - 0x214], 8
lea edi, [ecx + esi]
lea eax, [ecx + ecx]
mov dword [ebp - 0x218], edi
push eax
mov eax, dword [ebp - 0x26c]
lea esi, [ebp - 0x228]
cmovae esi, dword [ebp - 0x228]
push edx
lea eax, [esi + eax*2]
push eax
call fcn.0054f810
add esp, 0xc
xor eax, eax
mov word [esi + edi*2], ax
jmp 0x40f351
push ecx
push edx
mov byte [ebp - 0x26c], 0
push dword [ebp - 0x26c]
push ecx
lea ecx, [ebp - 0x228]
call fcn.00402ab0
mov byte [ebp - 4], 5
mov edx, dword [ebp - 0x254]
cmp edx, 8
jb 0x40f395
mov ecx, dword [ebp - 0x268]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40f38b
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fb6e
push edx
push ecx
call fcn.0054a587
add esp, 8
mov eax, dword [ebp - 0x218]
xor ecx, ecx
inc eax
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
mov dword [ebp - 0x26c], ecx
call fcn.004107c7
mov esi, eax
mov dword [ebp - 0x27c], eax
add esp, 4
test esi, esi
je 0x40f3da
push dword [ebp - 0x26c]
push 0
push esi
call fcn.00550660
add esp, 0xc
jmp 0x40f3e2
xor esi, esi
mov dword [ebp - 0x27c], esi
mov dword [ebp - 0x2a8], esi
mov byte [ebp - 4], 7
mov eax, dword [ebp - 0x218]
lea eax, [eax*2 + 2]
push eax
push 0
push esi
call fcn.00550660
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
mov dword [ebp - 0x270], eax
cmp eax, 0xffffffff
jne 0x40f428
xor edi, edi
mov esi, str.Session0ShellExecute_WTSGetActiveConsoleSessionId_GetLastError___d
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40f9fe
push eax
push str.WTSGetActiveConsoleSessionId_success_session_id:_d
call fcn.00404560
push 0x200
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.00550660
mov ax, word [0x60b508]
add esp, 0x14
movups xmm0, xmmword [str.winlogon.exe]
mov word [ebp - 0x1f8], ax
lea eax, [ebp - 0x210]
push eax
push dword [ebp - 0x270]
movups xmmword [ebp - 0x210], xmm0
movq xmm0, qword [0x60b500]
movq qword [ebp - 0x200], xmm0
call fcn.0040f000
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x26c], eax
test eax, eax
jne 0x40f4ac
call edi
push eax
push str.Session0ShellExecute_TraverseProcessID_GetLastError___d
call fcn.00404560
mov eax, dword [ebp - 0x26c]
add esp, 8
push eax
push 0
push 0x2000000
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov dword [ebp - 0x290], eax
test eax, eax
jne 0x40f4f1
call edi
push eax
push str.Session0ShellExecute_OpenProcess_GetLastError___d_try_to_get_current_process
call fcn.00404560
add esp, 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [ebp - 0x290], eax
test eax, eax
jne 0x40f4f1
call edi
push eax
push str.Session0ShellExecute_GetCurrentProcess_GetLastError___d
jmp 0x40f972
lea eax, [ebp - 0x280]
push eax
push dword [ebp - 0x270]
call dword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
test eax, eax
jne 0x40f6bf
call edi
push eax
push str.Session0ShellExecute_WTSQueryUserToken_GetLastError___d
call fcn.00404560
add esp, 8
mov dword [ebp - 0x294], 0
lea eax, [ebp - 0x28c]
mov dword [ebp - 0x28c], 0
push eax
lea eax, [ebp - 0x294]
push eax
push 1
push 0
push 0
call dword [sym.imp.WTSAPI32.dll_WTSEnumerateSessionsW]
cmp dword [ebp - 0x28c], 0
mov dword [ebp - 0x26c], 0
jbe 0x40f683
xor ecx, ecx
mov dword [ebp - 0x288], ecx
nop dword [eax]
mov eax, dword [ebp - 0x294]
cmp dword [ecx + eax + 8], 0
movq xmm0, qword [ecx + eax]
movq qword [ebp - 0x234], xmm0
jne 0x40f624
mov esi, dword [ebp - 0x234]
push esi
push str.dwSessionId_:__d
call fcn.00404700
add esp, 8
call fcn.00411e7c
mov ecx, eax
test ecx, ecx
je 0x40fb73
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x298], eax
push esi
lea eax, [ebp - 0x298]
mov byte [ebp - 4], 8
push 0x60c100
push eax
call fcn.00410180
add esp, 0xc
lea eax, [ebp + 8]
cmp dword [ebp + 0x1c], 8
jb 0x40f5ee
mov eax, dword [ebp + 8]
test eax, eax
je 0x40fb73
mov esi, dword [ebp - 0x298]
push eax
push esi
call fcn.00554aa0
add esp, 8
test eax, eax
je 0x40f648
mov byte [ebp - 4], 7
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x40f61e
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0x288]
mov eax, dword [ebp - 0x26c]
add ecx, 0xc
inc eax
mov dword [ebp - 0x288], ecx
mov dword [ebp - 0x26c], eax
cmp eax, dword [ebp - 0x28c]
jb 0x40f570
jmp 0x40f67d
mov eax, dword [ebp - 0x234]
push str.dwSessionId__si.SessionId_
mov dword [ebp - 0x270], eax
call fcn.00404700
add esp, 4
mov byte [ebp - 4], 7
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x40f67d
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x27c]
push dword [ebp - 0x270]
push str.WTSEnumerateSessions_:__d
call fcn.00404700
add esp, 8
lea eax, [ebp - 0x280]
push eax
push dword [ebp - 0x270]
call dword [sym.imp.WTSAPI32.dll_WTSQueryUserToken]
test eax, eax
jne 0x40f6bf
call edi
push eax
push str.WTSQueryUserToken_Failed__d
call fcn.00404700
jmp 0x40f977
lea eax, [ebp - 0x284]
push eax
push 0x201eb
push dword [ebp - 0x290]
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x40f6e8
call edi
push eax
push str.Session0ShellExecute_OpenProcessToken_GetLastError___d
jmp 0x40f972
lea eax, [ebp - 0x2a4]
push eax
push str.SeDebugPrivilege
push 0
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
jne 0x40f70d
call edi
push eax
push str.Session0ShellExecute_LookupPrivilegeValue_GetLastError___d
jmp 0x40f972
mov eax, dword [ebp - 0x2a4]
mov dword [ebp - 0x24c], eax
mov eax, dword [ebp - 0x2a0]
mov dword [ebp - 0x248], eax
lea eax, [ebp - 0x274]
push eax
push 1
push 1
push 0
push 0x2000000
push dword [ebp - 0x284]
mov dword [ebp - 0x250], 1
mov dword [ebp - 0x244], 2
call dword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
jne 0x40f768
call edi
push eax
push str.Session0ShellExecute_DuplicateTokenEx_GetLastError___d
jmp 0x40f972
push 4
lea eax, [ebp - 0x270]
push eax
push 0xc
push dword [ebp - 0x274]
call dword [sym.imp.ADVAPI32.dll_SetTokenInformation]
test eax, eax
jne 0x40f790
call edi
push eax
push str.Session0ShellExecute_SetTokenInformation_GetLastError___d
jmp 0x40f972
push 0
push 0
push 0x10
lea eax, [ebp - 0x250]
push eax
push 0
push dword [ebp - 0x274]
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
jne 0x40f7bc
call edi
push eax
push str.Session0ShellExecute_AdjustTokenPrivileges_GetLastError___d
jmp 0x40f972
call edi
cmp eax, 0x514
jne 0x40f7d5
call edi
push eax
push str.Session0ShellExecute_AdjustTokenPrivileges_Token_does_not_have_the_provilege_GetLastError___d
call fcn.00404560
add esp, 8
push 1
push dword [ebp - 0x274]
lea eax, [ebp - 0x278]
mov dword [ebp - 0x26c], 0x8000020
push eax
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
test eax, eax
je 0x40f811
push str.Session0ShellExecute_CreateEnvironmentBlock_compound_unicode_flag
call fcn.00404560
add esp, 4
mov dword [ebp - 0x26c], 0x8000420
jmp 0x40f81b
mov dword [ebp - 0x278], 0
push 0x44
lea eax, [ebp - 0x2fc]
push 0
push eax
call fcn.00550660
add esp, 0xc
mov dword [ebp - 0x2fc], 0x44
cmp byte [ebp + 0x50], 0
mov dword [ebp - 0x2f4], str.winsta0default
je 0x40f85e
mov eax, 5
mov dword [ebp - 0x2d0], 1
mov word [ebp - 0x2cc], ax
cmp dword [ebp - 0x214], 8
lea ecx, [ebp - 0x228]
xorps xmm0, xmm0
mov edx, esi
cmovae ecx, dword [ebp - 0x228]
movups xmmword [ebp - 0x2b8], xmm0
sub edx, ecx
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x40f880
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40f895
sub ecx, edx
sar ecx, 1
push ecx
push esi
push str.Session0ShellExecute_CreateProcessAsUser_cmd_line:_s_size:_d
call fcn.00404560
add esp, 0xc
lea eax, [ebp - 0x2b8]
push eax
lea eax, [ebp - 0x2fc]
push eax
push 0
push dword [ebp - 0x278]
push dword [ebp - 0x26c]
push 0
push 0
push 0
push esi
push 0
push dword [ebp - 0x274]
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov esi, eax
mov dword [ebp - 0x29c], esi
call edi
test esi, esi
je 0x40f96a
cmp dword [ebp - 0x2b8], 0
je 0x40f96a
call edi
push eax
push str.Session0ShellExecute_CreateProcessAsUser_success_before_wait_GetLastError___d
call fcn.00404560
add esp, 8
push dword [ebp + 0x54]
push dword [ebp - 0x2b8]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
ja 0x40f95b
je 0x40f94c
test eax, eax
je 0x40f93d
cmp eax, 0x80
jne 0x40f97a
push str.Session0ShellExecute_WaitForSingleObject_mutex_abandoned
call fcn.00404560
add esp, 4
jmp 0x40f97a
push str.Session0ShellExecute_WaitForSingleObject_successfully
call fcn.00404560
add esp, 4
jmp 0x40f97a
push str.Session0ShellExecute_WaitForSingleObject_time_out_and_no_response
call fcn.00404560
add esp, 4
jmp 0x40f97a
cmp eax, 0xffffffff
jne 0x40f97a
call edi
push eax
push str.Session0ShellExecute_WaitForSingleObject_failure_GetLastError___d
jmp 0x40f972
call edi
push eax
push str.Session0ShellExecute_CreateProcessAsUser_GetLastError___d
call fcn.00404560
add esp, 8
mov eax, dword [ebp - 0x278]
test eax, eax
je 0x40f995
push eax
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
mov dword [ebp - 0x278], 0
mov eax, dword [ebp - 0x290]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x40f9a8
push eax
call esi
mov eax, dword [ebp - 0x280]
test eax, eax
je 0x40f9bf
push eax
call esi
mov dword [ebp - 0x280], 0
mov eax, dword [ebp - 0x274]
test eax, eax
je 0x40f9d6
push eax
call esi
mov dword [ebp - 0x274], 0
mov eax, dword [ebp - 0x284]
test eax, eax
je 0x40f9ed
push eax
call esi
mov dword [ebp - 0x284], 0
mov esi, str.Session0ShellExecute_end_tick:_d
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [ebp - 0x29c]
push eax
push esi
call fcn.00404560
mov eax, dword [ebp - 0x27c]
add esp, 8
test eax, eax
je 0x40fa1b
push eax
call fcn.004107c2
add esp, 4
mov edx, dword [ebp - 0x214]
cmp edx, 8
jb 0x40fa5b
mov ecx, dword [ebp - 0x228]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40fa51
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fb7d
push edx
push ecx
call fcn.0054a587
add esp, 8
xor eax, eax
mov dword [ebp - 0x218], 0
mov dword [ebp - 0x214], 7
mov word [ebp - 0x228], ax
mov edx, dword [ebp + 0x1c]
cmp edx, 8
jb 0x40fab2
mov ecx, dword [ebp + 8]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40faa8
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fb82
push edx
push ecx
call fcn.0054a587
add esp, 8
mov edx, dword [ebp + 0x34]
xor eax, eax
mov dword [ebp + 0x18], 0
mov dword [ebp + 0x1c], 7
mov word [ebp + 8], ax
cmp edx, 8
jb 0x40fb00
mov ecx, dword [ebp + 0x20]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40faf6
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fb87
push edx
push ecx
call fcn.0054a587
add esp, 8
mov edx, dword [ebp + 0x4c]
xor eax, eax
mov dword [ebp + 0x30], 0
mov dword [ebp + 0x34], 7
mov word [ebp + 0x20], ax
cmp edx, 8
jb 0x40fb4a
mov ecx, dword [ebp + 0x38]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40fb40
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40fb8c
push edx
push ecx
call fcn.0054a587
add esp, 8
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0054a576
mov esp, ebp
pop ebp
ret 0x50
call fcn.00554319
call fcn.00554319
push 0x80004005
call fcn.00404450
call fcn.00554319
call fcn.00554319
call fcn.00554319
call fcn.00554319
int3