Function at 0x406a80
Capabilities:
Create a process with modified i/o handles and window
Create process on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor eax, eax
push esi
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 8], eax
mov dword [ebp - 4], eax
mov dword [ebp - 0x28], 0xffffffff
call fcn.00405e50
add esp, 4
push eax
push str.command.com
call fcn.0040a9c0
mov ebx, dword [ebp + 0xc]
add esp, 8
test eax, eax
mov edi, 1
je 0x406adf
push esi
call fcn.00405e50
add esp, 4
push eax
push str.4nt.exe
call fcn.0040a9c0
add esp, 8
test eax, eax
jne 0x406b02
test ebx, ebx
je 0x406b02
mov eax, dword [ebx + 4]
test eax, eax
je 0x406b02
push eax
push 0x40ecac
call fcn.0040a9c0
add esp, 8
mov dword [0x414fac], edi
test eax, eax
je 0x406b0c
mov dword [0x414fac], 0
push esi
call fcn.0040aa20
add esp, 4
cmp eax, 2
mov dword [ebp - 0x24], eax
je 0x40703a
jle 0x407032
cmp eax, 4
jg 0x407032
mov eax, dword [0x40ec8c]
test eax, eax
jge 0x406b47
call dword [sym.imp.KERNEL32.dll_GetVersion]
shr eax, 0x1f
mov dword [0x40ec8c], eax
push str.COMSPEC
call fcn.00405420
mov esi, eax
add esp, 4
test esi, esi
jne 0x406b82
mov eax, dword [0x40ec8c]
test eax, eax
je 0x406b6a
mov esi, str.command.com
jmp 0x406b82
push str.ComSpec
call fcn.00405420
mov esi, eax
add esp, 4
test esi, esi
jne 0x406b82
mov esi, str.cmd.exe
push ebx
push 0x40ecac
push esi
call fcn.00407400
add esp, 0xc
mov dword [ebp + 8], eax
test eax, eax
jne 0x406ba2
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [0x40ec8c]
test eax, eax
je 0x406bb1
mov dword [0x414fac], edi
push esi
call fcn.00408240
add esp, 4
mov dword [ebp - 0xc], eax
test eax, eax
je 0x406f9f
cmp byte [eax], 0
je 0x406bda
cmp byte [eax], 0x2f
jne 0x406bd2
mov byte [eax], 0x5c
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x406bca
push 0x14
call fcn.00404c40
add esp, 4
mov dword [ebp - 0x10], eax
test eax, eax
je 0x406f9f
mov eax, dword [ebp - 0xc]
push eax
call fcn.00404e10
mov esi, dword [ebp + 8]
mov edi, eax
mov ecx, esi
add esp, 4
inc edi
xor ebx, ebx
mov eax, dword [ecx]
mov dword [ebp - 0x18], ebx
test eax, eax
je 0x406c37
mov edx, dword [esi]
push edx
push 0
call fcn.00407090
mov ecx, dword [ebp + 8]
add esp, 8
inc eax
cmp esi, ecx
je 0x406c25
add edi, eax
mov edx, dword [ebp - 0x18]
add esi, 4
add ebx, eax
inc edx
mov eax, dword [esi]
mov dword [ebp - 0x18], edx
test eax, eax
jne 0x406c0e
inc edi
push edi
call fcn.00404c40
add esp, 4
mov dword [ebp - 8], eax
test eax, eax
je 0x406f9f
lea esi, [ebx + 0x14]
push 0
push esi
push 0
lea eax, [ebp - 0x34]
push 0x8000004
push eax
push 0xffffffffffffffff
mov dword [ebp - 0x34], 0xc
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 1
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
test eax, eax
mov dword [ebp - 0x20], eax
je 0x406f9a
push esi
push 0
push 0
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
test eax, eax
mov dword [ebp - 0x1c], eax
je 0x406f9a
mov edx, dword [ebp - 0x18]
mov ecx, eax
mov eax, dword [ebp + 8]
lea ebx, [ecx + 0x10]
mov ecx, dword [ebp - 8]
mov edi, ecx
mov esi, eax
mov dword [ebx], edx
mov edx, dword [eax]
add ebx, 4
test edx, edx
je 0x406cff
jmp 0x406cc3
mov eax, dword [ebp + 8]
cmp esi, eax
je 0x406ccb
mov byte [edi], 0x20
inc edi
mov eax, dword [esi]
push eax
push edi
call fcn.00407090
mov ecx, dword [esi]
add esp, 8
add edi, eax
push ecx
push ebx
call fcn.00403010
mov edx, dword [esi]
add esp, 8
push edx
call fcn.00404e10
add esi, 4
lea ebx, [ebx + eax + 1]
add esp, 4
cmp dword [esi], 0
jne 0x406cc0
mov ecx, dword [ebp - 8]
mov byte [edi], 0
sub edi, ecx
inc edi
cmp edi, 0x7ff8
jle 0x406d14
mov byte [ecx + 0x7ff8], 0
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp + 0x10]
push eax
push ecx
call fcn.00407140
mov esi, eax
xor ebx, ebx
add esp, 8
cmp esi, ebx
mov dword [ebp - 0x14], esi
je 0x406f78
push 0x44
push ebx
push 0x4105f0
call fcn.004082b0
mov eax, dword [0x410480]
add esp, 0xc
cmp eax, ebx
jne 0x406d7f
call fcn.0040a590
mov eax, dword [0x414ff0]
mov dword [0x41061c], 0x100
mov edx, dword [eax]
mov dword [0x410628], edx
mov ecx, dword [eax + 4]
mov dword [0x41062c], ecx
mov edx, dword [eax + 8]
mov dword [0x410630], edx
jmp 0x406e36
cmp dword [0x410490], ebx
jne 0x406e2c
mov eax, dword [0x414ff0]
mov dword [0x41061c], 0x101
mov word [0x410620], bx
or edi, 0xffffffff
cmp dword [eax], edi
jne 0x406dc5
push ebx
push str._nul
mov dword [eax], ebx
call fcn.0040a730
mov eax, dword [ebp - 4]
add esp, 8
or al, 1
mov dword [ebp - 4], eax
mov eax, dword [0x414ff0]
mov ecx, dword [eax]
mov dword [0x410628], ecx
mov ecx, dword [eax + 4]
cmp ecx, edi
jne 0x406df3
push 1
push str._nul
mov dword [eax + 4], ebx
call fcn.0040a730
mov eax, dword [ebp - 4]
add esp, 8
or al, 2
mov dword [ebp - 4], eax
mov eax, dword [0x414ff0]
mov edx, dword [eax + 4]
mov dword [0x41062c], edx
mov ecx, dword [eax + 8]
cmp ecx, edi
jne 0x406e22
push 1
push str._nul
mov dword [eax + 8], ebx
call fcn.0040a730
mov eax, dword [ebp - 4]
add esp, 8
or al, 4
mov dword [ebp - 4], eax
mov eax, dword [0x414ff0]
mov eax, dword [eax + 8]
mov dword [0x410630], eax
jmp 0x406e36
mov dword [0x410634], 0x10
mov ecx, dword [ebp - 8]
mov dword [0x4105f0], 0x44
mov eax, ecx
cmp byte [ecx], 0x20
je 0x406e61
mov dl, byte [eax]
test dl, dl
je 0x406e61
cmp dl, 0x2f
jne 0x406e58
mov byte [eax], 0x5c
mov dl, byte [eax + 1]
inc eax
cmp dl, 0x20
jne 0x406e4a
mov eax, dword [ebp - 0xc]
mov edi, dword [ebp - 0x1c]
mov edx, dword [0x40ec70]
push edi
push 0x4105f0
cmp edx, 0xffffffff
push ebx
push esi
je 0x406e90
mov esi, dword [0x410634]
push esi
push 1
push ebx
push ebx
push ecx
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserA]
jmp 0x406ea3
mov edx, dword [0x410634]
push edx
push 1
push ebx
push ebx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
cmp eax, ebx
jne 0x406f0f
call fcn.00406700
cmp dword [0x414fe4], 0xea
jne 0x406f3e
mov esi, dword [ebp - 0x14]
xor ebx, ebx
cmp byte [esi], 0
je 0x406ed9
push esi
call fcn.00404e10
add esp, 4
inc eax
add esi, eax
add ebx, eax
cmp byte [esi], 0
jne 0x406ec6
test ebx, 0x7ff
jne 0x406f3e
push str._bug_x
push esi
call fcn.00403010
add esp, 8
push esi
call fcn.00404e10
mov ecx, dword [ebp - 8]
lea esi, [esi + eax + 1]
mov eax, dword [ebp - 0xc]
add esp, 4
mov byte [esi], 0
mov esi, dword [ebp - 0x14]
xor ebx, ebx
jmp 0x406e67
mov eax, dword [edi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x10]
mov ecx, dword [edi + 8]
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x10], ebx
mov dword [eax], ecx
mov ecx, dword [edi]
mov dword [eax + 4], ecx
mov byte [eax + 8], 0
mov edx, dword [0x4105e8]
mov dword [eax + 0x10], edx
mov dword [0x4105e8], eax
mov eax, dword [ebp - 4]
test eax, eax
je 0x406f7b
test al, 1
je 0x406f55
mov ecx, dword [0x414ff0]
mov dword [ecx], 0xffffffff
test al, 2
je 0x406f66
mov edx, dword [0x414ff0]
mov dword [edx + 4], 0xffffffff
test al, 4
je 0x406f7b
mov eax, dword [0x414ff0]
mov dword [eax + 8], 0xffffffff
jmp 0x406f7b
mov edi, dword [ebp - 0x1c]
mov esi, dword [0x414fe4]
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x414fe4], esi
jmp 0x406f9f
call fcn.00406700
mov eax, dword [ebp - 0x10]
mov esi, dword [0x414fe4]
xor ebx, ebx
cmp eax, ebx
je 0x406fb7
push eax
call fcn.00404d70
add esp, 4
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
cmp eax, ecx
je 0x406fca
push eax
call fcn.00404d70
add esp, 4
mov eax, dword [ebp - 0x14]
cmp eax, ebx
je 0x406fda
push eax
call fcn.00404d70
add esp, 4
mov eax, dword [ebp - 8]
cmp eax, ebx
je 0x406fea
push eax
call fcn.00404d70
add esp, 4
mov eax, dword [ebp - 0xc]
cmp eax, ebx
je 0x406ffa
push eax
call fcn.00404d70
add esp, 4
cmp esi, 0xb
mov dword [0x414fe4], esi
je 0x40700d
cmp esi, 0xc1
jne 0x407028
cmp dword [ebp - 0x24], 0xffffffff
jne 0x407028
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 8], ebx
mov ebx, dword [ebp + 0xc]
mov dword [ebp - 0x24], 2
jmp 0x40703a
mov eax, dword [ebp - 0x28]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp + 8], ebx
jmp 0x406bb1
push str.SHELL
call fcn.00405420
mov esi, eax
add esp, 4
test esi, esi
jne 0x407061
mov dword [0x414fe4], 5
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
push 0x40ec90
push esi
call fcn.00407400
add esp, 0xc
mov dword [ebp + 8], eax
test eax, eax
jne 0x406bb1
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret