Function at 0x402970
Capabilities:
Accept command line arguments
Acquire debug privileges
Connect pipe
Create pipe
Create process on windows
Create thread
Schedule task via at
Set environment variable
Set registry value
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xd30
push ebx
push ebp
push esi
push edi
push 0x78
xor ebp, ebp
push ebp
push section..data
call sub.ntdll.dll_memset
mov esi, dword [sym.imp.KERNEL32.dll_GetCommandLineW]
add esp, 0xc
mov dword [0x406050], 0x96
mov dword [0x406060], 0x18
mov dword [0x406064], 4
mov dword [0x406068], 0x3e8
call esi
cmp word [eax], 0x20
jne 0x4029d9
jmp 0x4029d0
add eax, 2
cmp word [eax], 0x20
je 0x4029d0
call esi
xor ecx, ecx
xor edx, edx
call fcn.00402320
xor ecx, ecx
xor edx, edx
mov word [esp + 0x5e8], cx
mov word [esp + 0x320], dx
xor edi, edi
mov ecx, 0x100
lea edx, [esp + 0xd8]
mov dword [esp + 0x24], eax
mov dword [esp + 0x34], ebp
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], ebp
mov dword [esp + 0x14], ebp
mov byte [esp + 0x1b], 0
call fcn.00402320
cmp word [esp + 0xd8], 0x2f
mov dword [esp + 0x30], eax
jne 0x4030be
jmp 0x402a40
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0xdc]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0xda]
mov ecx, edx
and eax, 0xffdf
and ecx, 0xffdf
cmp ax, 0x50
jne 0x402b15
cmp cx, 0x4e
je 0x402a88
lea ecx, [esp + 0xdc]
call fcn.00405560
mov dword [esp + 0x34], eax
jmp case.0x402b98.66
lea ecx, [esp + 0xde]
push ecx
call fcn.004028b0
add esp, 4
mov dword [esp + 0x34], eax
cmp eax, ebp
jne case.0x402b98.66
xor eax, eax
jmp 0x402ab0
movzx ecx, word [eax + 0x401ecc]
mov word [esp + eax + 0x3a8], cx
add eax, 2
cmp cx, bp
jne 0x402ab0
xor eax, eax
lea esp, [esp]
movzx ecx, word [esp + eax*2 + 0xde]
cmp cx, bp
je 0x402aed
mov word [esp + eax*2 + 0x3dc], cx
inc eax
cmp eax, 0x105
jl 0x402ad0
push 0x10
push 0x401d98
lea edx, [esp + 0x3b0]
push edx
xor ecx, ecx
push ebp
mov word [esp + eax*2 + 0x3ec], cx
call dword [sym.imp.USER32.dll_MessageBoxW]
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
cmp ax, 0x4c
jne 0x402b43
lea edx, [esp + 0xdc]
call fcn.00405510
mov edi, eax
mov dword [esp + 0x1c], edi
cmp edi, ebp
jne case.0x402b98.66
mov edi, 0x411
mov dword [esp + 0x1c], edi
jmp case.0x402b98.66
cmp ax, 0x52
jne 0x402b6e
lea edx, [esp + 0xdc]
call fcn.00405510
mov dword [esp + 0x20], eax
cmp eax, ebp
jne case.0x402b98.66
mov dword [esp + 0x20], 0x411
jmp case.0x402b98.66
cmp ax, 0x4e
jne 0x402bf2
cmp word [esp + 0xde], bp
jne case.0x402b98.66
movzx eax, cx
add eax, 0xffffffbf
cmp eax, 0x17
ja case.0x402b98.66
movzx edx, byte [eax + 0x4035a0]
jmp dword [edx*4 + 0x403580]
or dword [esp + 0x14], 0x20
jmp case.0x402b98.66
mov byte [esp + 0x1b], 1
jmp case.0x402b98.66
mov byte [0x406074], 1
jmp case.0x402b98.66
mov byte [0x406073], 1
jmp case.0x402b98.66
or dword [esp + 0x14], 0x10
jmp case.0x402b98.66
or dword [esp + 0x14], 8
mov byte [0x406072], 1
jmp case.0x402b98.66
mov byte [0x406071], 1
jmp case.0x402b98.66
cmp ax, 0x53
jne 0x402c2d
cmp dx, bp
je case.0x402b98.66
xor eax, eax
movzx ecx, word [esp + eax*2 + 0xdc]
cmp cx, bp
je 0x402c1e
mov word [esp + eax*2 + 0x320], cx
inc eax
cmp eax, 0x40
jl 0x402c03
xor ecx, ecx
mov word [esp + eax*2 + 0x320], cx
jmp case.0x402b98.66
cmp ax, 0x56
jne 0x402c46
cmp dx, bp
jne case.0x402b98.66
or dword [esp + 0x14], 1
jmp case.0x402b98.66
cmp ax, 0x58
jne 0x402c81
lea edx, [esp + 0xdc]
mov dword [esp + 0x40], 1
call fcn.00405510
mov dword [esp + 0x60], eax
cmp eax, 1
lea eax, [esp + 0x60]
ja 0x402c71
lea eax, [esp + 0x40]
mov eax, dword [eax]
and eax, 3
add eax, eax
or dword [esp + 0x14], eax
jmp case.0x402b98.66
cmp ax, 0x48
je 0x402c8d
cmp ax, 0x1f
jne 0x402c96
cmp dx, bp
je 0x40354e
cmp ax, 0x48
jne 0x402ccc
xor eax, eax
mov edi, edi
movzx ecx, word [esp + eax*2 + 0xdc]
cmp cx, bp
je 0x402cbd
mov word [esp + eax*2 + 0x5e8], cx
inc eax
cmp eax, 0x3aa
jl 0x402ca0
xor edx, edx
mov word [esp + eax*2 + 0x5e8], dx
jmp case.0x402b98.66
cmp ax, 0x54
jne 0x402ce7
cmp dx, bp
jne case.0x402b98.66
mov byte [0x406070], 1
jmp case.0x402b98.66
cmp ax, 0x43
jne 0x402d3c
cmp dx, bp
je 0x402cff
lea eax, [edx - 0x30]
cmp ax, 9
ja case.0x402b98.66
mov byte [0x40606f], 1
cmp dx, bp
je case.0x402b98.66
lea ecx, [esp + 0xdc]
mov dword [esp + 0x48], ebp
call fcn.00405560
mov dword [esp + 0x64], eax
cmp eax, ebp
lea eax, [esp + 0x64]
jg 0x402d2f
lea eax, [esp + 0x48]
mov ecx, dword [eax]
mov dword [0x406050], ecx
jmp case.0x402b98.66
cmp ax, 0x57
jne 0x402d87
lea edx, [esp + 0xdc]
call fcn.00405510
lea edx, [esp + 0xdc]
push 0x3a
push edx
mov dword [0x406038], eax
call sub.ntdll.dll_wcschr
add esp, 8
cmp eax, ebp
je 0x402d7b
lea edx, [eax + 2]
call fcn.00405510
mov dword [0x40603c], eax
jmp case.0x402b98.66
mov byte [0x40606c], 1
jmp case.0x402b98.66
cmp ax, 0x42
jne 0x402e4a
cmp dx, 0x3a
je 0x402dc3
lea ecx, [esp + 0xdc]
mov dword [esp + 0x50], 1
call fcn.00405560
mov dword [esp + 0x58], eax
cmp eax, 1
lea eax, [esp + 0x58]
jg 0x402dbc
lea eax, [esp + 0x50]
mov eax, dword [eax]
mov dword [0x406064], eax
lea ecx, [esp + 0xdc]
push 0x3a
push ecx
call sub.ntdll.dll_wcschr
add esp, 8
cmp eax, ebp
je case.0x402b98.66
cmp word [eax + 2], 0x3a
lea esi, [eax + 2]
je 0x402e0f
mov ecx, esi
mov dword [esp + 0x44], 1
call fcn.00405560
mov dword [esp + 0x38], eax
cmp eax, 1
lea eax, [esp + 0x38]
jg 0x402e07
lea eax, [esp + 0x44]
mov edx, dword [eax]
mov dword [0x406060], edx
push 0x3a
push esi
call sub.ntdll.dll_wcschr
add esp, 8
cmp eax, ebp
je case.0x402b98.66
lea ecx, [eax + 2]
mov dword [esp + 0x54], ebp
call fcn.00405560
mov dword [esp + 0x4c], eax
cmp eax, ebp
lea eax, [esp + 0x4c]
jg 0x402e3e
lea eax, [esp + 0x54]
mov eax, dword [eax]
mov dword [0x406068], eax
jmp case.0x402b98.66
cmp ax, 0x4b
jne 0x402ef3
cmp cx, 0x53
jne 0x402e8c
lea ecx, [esp + 0xde]
mov dword [esp + 0x3c], 1
call fcn.00405560
mov dword [esp + 0x5c], eax
cmp eax, 1
lea eax, [esp + 0x5c]
jg 0x402e7f
lea eax, [esp + 0x3c]
mov ecx, dword [eax]
mov dword [0x406054], ecx
jmp case.0x402b98.66
cmp cx, 0x46
jne case.0x402b98.66
lea ecx, [esp + 0xde]
call fcn.00405560
cmp eax, ebp
mov dword [0x406058], eax
jg 0x402eb5
mov dword [0x406058], 0x20
lea edx, [esp + 0xde]
push 0x3a
push edx
call sub.ntdll.dll_wcschr
add esp, 8
cmp eax, ebp
je 0x402ed8
lea ecx, [eax + 2]
call fcn.00405560
mov dword [0x40605c], eax
cmp dword [0x40605c], ebp
jg case.0x402b98.66
mov dword [0x40605c], 0x10
jmp case.0x402b98.66
cmp ax, 0x46
jne case.0x402b98.66
xor ecx, ecx
lea esi, [esp + 0xdc]
cmp dx, bp
je 0x402f36
movzx eax, dx
mov edi, edi
mov edx, ecx
and dl, 1
movzx edx, dl
neg edx
sbb edx, edx
and edx, 0xfffffffb
movzx eax, ax
add edx, 0x40
cmp eax, edx
jne 0x402f2a
inc ecx
movzx eax, word [esi + 2]
add esi, 2
cmp ax, bp
jne 0x402f10
lea eax, [ecx + 1]
shr eax, 1
mov dword [esp + 0x28], eax
je case.0x402b98.66
mov ecx, dword [0x40604c]
add ecx, eax
mov eax, ecx
shl eax, 4
sub eax, ecx
add eax, eax
add eax, eax
push eax
cmp dword [0x406048], ebp
je 0x402f7b
mov edx, dword fs:[0x30]
mov eax, dword [0x406048]
mov ecx, dword [edx + 0x18]
push eax
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_HeapReAlloc]
jmp 0x402f8d
mov ecx, dword fs:[0x30]
mov ecx, dword [ecx + 0x18]
push ebp
push ecx
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
cmp ebx, ebp
je case.0x402b98.66
mov dword [0x406048], ebx
lea esi, [esp + 0xdc]
dec dword [esp + 0x28]
push 0x40
push esi
call sub.ntdll.dll_wcschr
xor edx, edx
mov word [eax], dx
mov ecx, dword [0x40604c]
mov edx, ecx
shl edx, 4
sub edx, ecx
lea ebp, [ebx + edx*4 + 8]
mov edi, ebp
add esp, 8
xor edx, edx
mov ecx, esi
sub edi, esi
movzx esi, word [ecx]
test si, si
je 0x402fe6
mov word [edi + ecx], si
inc edx
add ecx, 2
cmp edx, 0x17
jl 0x402fd1
lea esi, [eax + 2]
xor ecx, ecx
push 0x3b
push esi
mov word [ebp + edx*2], cx
call sub.ntdll.dll_wcschr
add esp, 8
test eax, eax
je 0x403004
xor edx, edx
mov word [eax], dx
mov edx, esi
call fcn.00405510
mov ecx, dword [0x40604c]
mov edx, ecx
shl edx, 4
sub edx, ecx
push 0x3a
push esi
mov dword [ebx + edx*4], eax
call sub.ntdll.dll_wcschr
add esp, 8
test eax, eax
je 0x403056
lea edx, [eax + 2]
call fcn.00405510
mov ecx, dword [0x40604c]
mov edx, ecx
shl edx, 4
sub edx, ecx
mov dword [ebx + edx*4 + 4], eax
mov eax, dword [0x40604c]
mov ecx, eax
shl ecx, 4
sub ecx, eax
mov byte [ebx + ecx*4 + 0x38], 0
jmp 0x403067
mov eax, dword [0x40604c]
mov edx, eax
shl edx, 4
sub edx, eax
mov byte [ebx + edx*4 + 0x38], 1
inc dword [0x40604c]
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x403072
sub eax, edx
sar eax, 1
cmp dword [esp + 0x28], 0
lea esi, [esi + eax*2 + 2]
jne 0x402fa4
mov edi, dword [esp + 0x1c]
xor ebp, ebp
mov eax, dword [esp + 0x30]
mov ecx, 0x100
lea edx, [esp + 0xd8]
call fcn.00402320
cmp word [esp + 0xd8], 0x2f
mov dword [esp + 0x30], eax
je 0x402a40
mov eax, dword [esp + 0x14]
and al, 0x26
cmp al, 0x20
jne 0x4030d7
cmp word [esp + 0x5e8], bp
jne 0x4030d7
or dword [esp + 0x14], 0x40
mov esi, dword [sym.imp.ADVAPI32.dll_OpenThreadToken]
lea ecx, [esp + 0x2c]
push ecx
push ebp
push 0x28
push 0xfffffffffffffffe
call esi
test eax, eax
jne 0x40311c
mov edx, dword fs:[0x34]
cmp edx, 0x3f0
jne 0x40316d
push 2
call dword [sym.imp.ADVAPI32.dll_ImpersonateSelf]
test eax, eax
je 0x40316d
lea eax, [esp + 0x2c]
push eax
push ebp
push 0x28
push 0xfffffffffffffffe
call esi
test eax, eax
je 0x40316d
lea ecx, [esp + 0x88]
push ecx
push 0x401f04
push ebp
call dword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
je 0x403162
mov eax, dword [esp + 0x2c]
push ebp
push ebp
push 0x10
lea edx, [esp + 0x90]
push edx
push ebp
push eax
mov dword [esp + 0x9c], 1
mov dword [esp + 0xa8], 2
call dword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
mov ecx, dword [esp + 0x2c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
and eax, 0x40
je 0x40326f
cmp dword [esp + 0x20], ebp
jne 0x40326f
mov ebx, dword [esp + 0x24]
cmp word [ebx], bp
je 0x403268
xor ecx, ecx
mov edx, edi
cmp edi, ebp
je 0x4031aa
mov eax, edi
jmp 0x4031a0
shr eax, 4
inc ecx
cmp eax, ebp
jne 0x4031a0
jmp 0x4031af
mov ecx, 1
xor eax, eax
mov word [esp + ecx*2 + 0xa8], ax
cmp ecx, ebp
je 0x4031e2
lea ecx, [ecx]
mov eax, edx
and eax, 0xf
dec ecx
cmp eax, 9
jbe 0x4031d0
add eax, 0x37
jmp 0x4031d3
add eax, 0x30
shr edx, 4
mov word [esp + ecx*2 + 0xa8], ax
cmp ecx, ebp
jne 0x4031c0
mov esi, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov ecx, edi
neg ecx
sbb ecx, ecx
and ecx, 0x401e04
push ecx
push 0x401e2c
call esi
neg edi
sbb edi, edi
lea edx, [esp + 0xa8]
and edi, edx
push edi
push 0x401e4c
call esi
push 0x44
lea eax, [esp + 0x2dc]
push ebp
push eax
call sub.ntdll.dll_memset
add esp, 0xc
lea ecx, [esp + 0x74]
push ecx
lea edx, [esp + 0x2dc]
push edx
push ebp
push ebp
push ebp
push ebp
push ebp
push ebp
xor eax, eax
push ebx
push ebp
mov dword [esp + 0x9c], eax
mov dword [esp + 0xa0], eax
mov dword [esp + 0xa4], eax
mov dword [esp + 0xa8], eax
mov dword [esp + 0x300], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
push ebp
call dword [sym.imp.KERNEL32.dll_ExitProcess]
cmp word [esp + 0x320], bp
jne 0x4032f6
cmp eax, ebp
jne 0x4032f6
cmp byte [esp + 0x1b], 0
je 0x4032d1
push 1
lea eax, [esp + 0x98]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x4032d1
push ebp
push ebp
push 1
lea ecx, [esp + 0xa0]
push ecx
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x4032d1
lea edx, [esp + 0x94]
mov dword [esp + 0x70], ebp
mov dword [esp + 0x68], 0xc
mov dword [esp + 0x6c], edx
lea ebp, [esp + 0x68]
push ebp
push 0
push 0x20000
push 0
push 0xff
push 7
push 0x80001
push 0x401f28
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov edi, eax
jmp 0x4032f9
or edi, 0xffffffff
mov eax, dword [esp + 0x34]
xor esi, esi
cmp eax, esi
jne 0x40330c
mov ecx, dword [esp + 0x24]
cmp word [ecx], si
je 0x403349
lea edx, [esp + 0x320]
push edx
mov edx, dword [esp + 0x28]
lea ecx, [esp + 0x5ec]
push ecx
mov ecx, dword [esp + 0x28]
push edx
mov edx, dword [esp + 0x28]
push eax
mov eax, dword [esp + 0x24]
call fcn.004024b0
add esp, 0x10
test al, al
jne 0x403342
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
xor byte [0x406073], 1
cmp edi, 0xffffffff
jne 0x403355
push esi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov eax, dword fs:[0x30]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0xc
mov dword [section..data], 0x400000
mov dword [0x40601c], esi
mov dword [0x406028], esi
mov eax, dword [eax + 0x18]
push esi
push eax
call ebx
mov esi, eax
test esi, esi
je 0x4033af
mov ecx, dword fs:[0x30]
push 0x10
mov dword [esi], 0
mov dword [esi + 4], 4
mov eax, dword [ecx + 0x18]
push 0
push eax
call ebx
mov dword [esi + 8], eax
mov dword [0x40602c], esi
jmp 0x4033b9
mov dword [0x40602c], 0
push 0x406004
mov dword [0x406030], 0xffffffff
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0
push 0
push 0
push 0x4045c0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
je 0x403542
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x40601c], 0
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
jne 0x40340e
push 1
call esi
cmp dword [0x40601c], 0
je 0x403401
mov ebx, dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov esi, dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
lea ebx, [ebx]
push 0
push edi
call esi
test eax, eax
jne 0x403436
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x218
jne 0x40344d
cmp dword [0x40601c], 0
je 0x4034cf
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x403420
push 0
push 0
push edi
push 0x4047f0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov esi, eax
test esi, esi
je 0x4034b2
push 1
push esi
call ebx
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
push 0
push 0x20000
push 0
push 0xff
push 7
push 1
push 0x401f28
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x403414
push 0x10
push 0x40117c
push 0x401f5c
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x4034d6
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x10
push 0x40117c
push 0x401f44
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
jmp 0x4034d6
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x406028], 0
je 0x4034f2
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
push 1
call esi
cmp dword [0x406028], 0
jne 0x4034e5
push 0x406004
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov esi, dword [0x40602c]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
mov edi, esi
test esi, esi
je 0x403524
call fcn.00402290
mov edx, dword fs:[0x30]
mov eax, dword [edx + 0x18]
push edi
push 0
push eax
call ebx
mov ecx, dword [0x406048]
mov edx, dword fs:[0x30]
mov eax, dword [edx + 0x18]
push ecx
push 0
push eax
call ebx
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
pop edi
xor eax, eax
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov esi, dword [sym.imp.USER32.dll_MessageBoxA]
push 0x41
push 0x40117c
push 0x4011b8
push ebp
call esi
cmp eax, 1
jne 0x403577
push 0x40
push 0x40117c
push 0x4018f8
push ebp
call esi
push ebp
call dword [sym.imp.KERNEL32.dll_ExitProcess]