Function at 0x409940
Capabilities:
Check os version
Create a process with modified i/o handles and window
Create pipe
Create process on windows
Get system information on windows
Read file on windows

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x46fe5c
push eax
mov eax, 0x1158
mov dword fs:[0], esp
call fcn.0044c000
push ebx
push esi
push edi
mov ecx, 0x3ff
xor eax, eax
lea edi, [esp + 0x165]
mov byte [esp + 0x164], 0
mov dword [esp + 0x2c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [0x48fb24]
mov dword [esp + 0xc], eax
mov ebx, 1
mov dword [esp + 0x14], eax
mov dword [esp + 0x116c], ebx
mov dword [esp + 0x24], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0x20], eax
push str.IsWow64Process
push str.kernel32
mov byte [esp + 0x1174], 5
mov dword [esp + 0x3c], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x4099e1
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call esi
lea ecx, [esp + 0x140]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov esi, dword [sym.imp.KERNEL32.dll_GetVersionExA]
lea edx, [esp + 0xa4]
push edx
mov dword [esp + 0xa8], 0x9c
call esi
lea eax, [esp + 0xa4]
push eax
call esi
test eax, eax
je 0x40a0de
lea ecx, [esp + 0x44]
push 0
lea edx, [esp + 0x34]
push ecx
lea eax, [esp + 0x30]
push edx
push eax
mov dword [esp + 0x54], 0xc
mov dword [esp + 0x58], 0
mov dword [esp + 0x5c], ebx
call dword [sym.imp.KERNEL32.dll_CreatePipe]
mov ecx, 0x11
xor eax, eax
lea edi, [esp + 0x60]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x60]
mov dword [esp + 0x60], 0x44
push ecx
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
mov eax, dword [esp + 0x30]
lea edx, [esp + 0x50]
mov dword [esp + 0xa0], eax
mov dword [esp + 0x9c], eax
lea eax, [esp + 0x60]
push edx
push eax
mov esi, dword [sym.imp.KERNEL32.dll_CreateProcessA]
push 0
push 0
push 0
push ebx
push 0
push 0
push str.reg_query__HKLMSOFTWAREMicrosoftWindows_NTCurrentVersion___v_ProductName
push 0
mov word [esp + 0xb8], 0
mov dword [esp + 0xb4], 0x101
call esi
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
test eax, eax
je 0x409bf8
push 0x1f4
call ebx
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x164]
push eax
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x2c]
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x16c]
push 0xfff
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x409bf8
lea ecx, [esp + 0x164]
lea edx, [esp + 0xc]
push ecx
push 0x48b480
push edx
call fcn.00461a66
add esp, 0xc
lea ecx, [esp + 0xc]
call fcn.00461b07
lea ecx, [esp + 0xc]
call fcn.00461abb
mov eax, dword [esp + 0xc]
push 0x491f08
push eax
call fcn.0044bf3e
add esp, 8
test eax, eax
je 0x409be9
push str.REG_SZ
lea ecx, [esp + 0x10]
call fcn.00461725
cmp eax, 0xffffffff
je 0x409be9
push str.REG_SZ
lea ecx, [esp + 0x10]
call fcn.00461725
add eax, 6
lea ecx, [esp + 0xc]
push eax
push 0
call fcn.004612e6
lea ecx, [esp + 0xc]
call fcn.00461b07
lea ecx, [esp + 0xc]
call fcn.00461abb
mov ecx, dword [esp + 0xc]
xor eax, eax
xor edx, edx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], edx
mov edi, dword [ecx - 8]
test edi, edi
jle 0x409bbc
cmp byte [eax + ecx], 0x20
jne 0x409bb0
inc edx
cmp edx, 2
mov dword [esp + 0x18], edx
jge 0x409bbc
inc eax
mov dword [esp + 0x1c], eax
mov edi, dword [ecx - 8]
cmp eax, edi
jl 0x409ba0
inc eax
lea ecx, [esp + 0xc]
push eax
push 0
call fcn.004612e6
lea ecx, [esp + 0xc]
call fcn.00461b07
lea ecx, [esp + 0xc]
call fcn.00461abb
lea ecx, [esp + 0xc]
push ecx
lea ecx, [esp + 0x24]
call fcn.004629d1
mov edx, dword [esp + 0xc]
mov eax, dword [edx - 8]
test eax, eax
je 0x409ac7
lea eax, [esp + 0x50]
lea ecx, [esp + 0x60]
push eax
push ecx
push 0
push 0
mov edi, 1
push 0
push edi
push 0
push 0
push str.cmd.exe__c_ver
push 0
call esi
test eax, eax
je 0x409d6f
push 0x1f4
call ebx
mov edx, dword [esp + 0x30]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call esi
mov edx, dword [esp + 0x28]
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x164]
rep stosd dword es:[edi], eax
push eax
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0x16c]
push 0xfff
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x409d61
lea eax, [esp + 0x164]
lea ecx, [esp + 0xc]
push eax
push 0x48b480
push ecx
call fcn.00461a66
add esp, 0xc
lea ecx, [esp + 0xc]
call fcn.00461b07
lea ecx, [esp + 0xc]
call fcn.00461abb
mov edx, dword [esp + 0xc]
push 0x491f08
push edx
call fcn.0044bf3e
add esp, 8
test eax, eax
je 0x409d52
push 0x48c374
lea ecx, [esp + 0x10]
call fcn.00461725
cmp eax, 0xffffffff
je 0x409d52
push 0x48c370
lea ecx, [esp + 0x10]
call fcn.00461725
cmp eax, 0xffffffff
je 0x409d52
mov edx, dword [esp + 0xc]
xor eax, eax
mov dword [esp + 0x1c], eax
mov ecx, dword [edx - 8]
test ecx, ecx
jle 0x409d52
mov cl, byte [eax + edx]
cmp cl, 0x30
jl 0x409cfb
cmp cl, 0x39
jle 0x409d09
inc eax
mov dword [esp + 0x1c], eax
mov ecx, dword [edx - 8]
cmp eax, ecx
jl 0x409cee
jmp 0x409d52
push 0x48c370
lea ecx, [esp + 0x10]
call fcn.00461725
mov ecx, eax
mov eax, dword [esp + 0x1c]
sub ecx, eax
lea edx, [esp + 0x3c]
push ecx
push eax
push edx
lea ecx, [esp + 0x18]
call fcn.00461579
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x1170], 6
call fcn.004629d1
lea ecx, [esp + 0x3c]
mov byte [esp + 0x116c], 5
call fcn.00462898
mov eax, dword [esp + 0x14]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x409c37
mov ecx, dword [esp + 0x28]
push ecx
call esi
mov edi, 1
jmp 0x409d83
mov edx, dword [esp + 0x30]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call esi
mov eax, dword [esp + 0x28]
push eax
call esi
mov ecx, dword [esp + 0x54]
push ecx
call esi
mov edx, dword [esp + 0x50]
push edx
call esi
mov eax, dword [esp + 0x14]
mov eax, dword [eax - 8]
test eax, eax
jne 0x409dc6
push 0x491f08
lea ecx, [esp + 0x14]
call fcn.00462a21
mov esi, dword [esp + 0x1174]
lea ecx, [esp + 0x10]
push ecx
mov ecx, esi
call fcn.0046260d
mov dword [esp + 0x2c], edi
jmp 0x40a0f5
push eax
lea ecx, [esp + 0x18]
call fcn.00462cc8
lea edx, [esp + 0x40]
lea ecx, [esp + 0x18]
push edx
lea edx, [esp + 0x20]
push ecx
push edx
push str._d._d._d
push eax
call fcn.0044c47c
mov ecx, dword [esp + 0x30]
add esp, 0x14
mov ebx, 3
lea eax, [ecx - 4]
cmp eax, 6
ja case.0x409e02.7
jmp dword [eax*4 + 0x40a168]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x409e55
cmp eax, 0xa
je 0x409e38
cmp eax, 0x5a
jne case.default.0x409f34
push str.Microsoft_Windows_Me
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], ebx
jmp case.default.0x409f34
push str.Microsoft_Windows_98
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], 2
jmp case.default.0x409f34
mov eax, dword [esp + 0xb4]
cmp eax, 2
jne 0x409e68
push str.Microsoft_Windows_NT_4.0
jmp 0x409e71
cmp eax, edi
jne 0x409e7a
push str.Microsoft_Windows_95
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], edi
jmp case.default.0x409f34
mov eax, dword [esp + 0x18]
sub eax, 0
je 0x409f0b
dec eax
je 0x409eee
dec eax
jne case.default.0x409f34
cmp byte [esp + 0x13e], 1
jne 0x409eb4
cmp word [esp + 0x140], 9
jne 0x409eb4
push str.Microsoft_Windows_XP_Professional_x64_Edition
jmp 0x409ed6
mov esi, dword [sym.imp.USER32.dll_GetSystemMetrics]
push 0x59
call esi
test eax, eax
jne 0x409ec9
push str.Microsoft_Windows_Server_2003
jmp 0x409ed6
push 0x59
call esi
test eax, eax
je 0x409edf
push str.Microsoft_Windows_Server_2003_R2
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], 6
jmp case.default.0x409f34
push str.Microsoft_Windows_XP
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], 5
jmp case.default.0x409f34
push str.Microsoft_Windows_2000
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], 4
jmp case.default.0x409f34
mov eax, dword [esp + 0x18]
cmp eax, ebx
ja case.default.0x409f34
jmp dword [eax*4 + 0x40a184]
cmp byte [esp + 0x13e], 1
jne 0x409f4c
push str.Microsoft_Windows_Vista
jmp 0x409f51
push str.Microsoft_Windows_Server_2008
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], 7
jmp case.default.0x409f34
cmp byte [esp + 0x13e], 1
jne 0x409f7a
push str.Microsoft_Windows_7
jmp 0x409f7f
push str.Microsoft_Windows_Server_2008_R2
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], 8
jmp case.default.0x409f34
cmp byte [esp + 0x13e], 1
jne 0x409fa8
push str.Microsoft_Windows_8
jmp 0x409fad
push str.Microsoft_Windows_Server_2012
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], 9
jmp case.default.0x409f34
cmp byte [esp + 0x13e], 1
jne 0x409fd3
push str.Microsoft_Windows_8.1
jmp 0x409fd8
push str.Microsoft_Windows_Server_2012_R2
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], 0xa
jmp case.default.0x409f34
mov eax, dword [esp + 0x18]
test eax, eax
jne case.default.0x409f34
cmp byte [esp + 0x13e], 1
jne 0x40a006
push str.Microsoft_Windows_10
jmp 0x40a00b
push str.Windows_Server_2016_Technical_Preview
lea ecx, [esp + 0x14]
call fcn.00462a21
mov dword [0x48c3fc], 0xb
jmp case.default.0x409f34
mov eax, dword [esp + 0x18]
push eax
push ecx
lea ecx, [esp + 0x18]
push str.Microsoft_Windows__d._d
push ecx
call fcn.00461a66
add esp, 0x10
push 0xffffffffffffffff
lea ecx, [esp + 0x18]
call fcn.00462d17
mov eax, dword [esp + 0x34]
test eax, eax
mov eax, 0x48c11c
jne 0x40a055
mov eax, str.32_bit
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
push eax
mov eax, dword [esp + 0x1c]
push edx
mov edx, dword [esp + 0x18]
push eax
push ecx
push edx
push str._s___d._d___s__s
push 0x491f2c
call fcn.00461a66
mov eax, dword [esp + 0x5c]
push eax
push str._Build__d_
push 0x491f28
call fcn.00461a66
mov ecx, dword [0x491f28]
mov edx, dword [0x491f2c]
push ecx
push edx
lea eax, [esp + 0x54]
push 0x48c0ec
push eax
call fcn.00461a66
mov esi, dword [esp + 0x11ac]
add esp, 0x38
lea ecx, [esp + 0x24]
push ecx
mov ecx, esi
call fcn.0046260d
lea ecx, [esp + 0x20]
mov dword [esp + 0x2c], edi
mov byte [esp + 0x116c], 4
call fcn.00462898
mov byte [esp + 0x116c], bl
jmp 0x40a10e
mov esi, dword [esp + 0x1174]
push 0x491f08
mov ecx, esi
call fcn.00462906
mov dword [esp + 0x2c], ebx
lea ecx, [esp + 0x20]
mov byte [esp + 0x116c], 4
call fcn.00462898
mov byte [esp + 0x116c], 3
lea ecx, [esp + 0x10]
call fcn.00462898
lea ecx, [esp + 0x24]
mov byte [esp + 0x116c], 2
call fcn.00462898
lea ecx, [esp + 0x14]
mov byte [esp + 0x116c], 1
call fcn.00462898
lea ecx, [esp + 0xc]
mov byte [esp + 0x116c], 0
call fcn.00462898
mov ecx, dword [esp + 0x1164]
mov eax, esi
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x1164
ret 4