Function at 0x402040
Capabilities:
Accept command line arguments
Check os version
Create process on windows
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1174
call fcn.00404110
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push 0x11c
lea eax, [ebp - 0x1120]
push 0
push eax
call fcn.00404140
add esp, 0xc
mov dword [ebp - 0x1120], 0x11c
lea eax, [ebp - 0x1120]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
je 0x40263e
mov eax, dword [ebp - 0x111c]
cmp eax, 5
jb 0x40263e
jne 0x4020aa
cmp dword [ebp - 0x1118], 0
je 0x40263e
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push 0x100
push eax
lea eax, [ebp - 0x304]
push eax
call fcn.0040389f
add esp, 0xc
lea ecx, [ebp - 0x304]
cmp byte [ebp - 0x304], 0
mov eax, ecx
je 0x4020e6
mov dl, byte [eax]
cmp dl, 0x22
je 0x4020e0
mov byte [ecx], dl
inc ecx
inc eax
cmp byte [eax], 0
jne 0x4020d6
lea eax, [ebp - 0x304]
mov byte [ecx], 0
push str.usermgr
push eax
call fcn.004028f0
add esp, 8
test eax, eax
je 0x40263e
lea ecx, [ebp - 0x304]
xor edx, edx
cmp ecx, eax
je 0x402117
inc ecx
inc edx
cmp ecx, eax
jne 0x402111
lea eax, [ebp - 0x304]
add eax, edx
push 0x421414
push eax
call fcn.004028f0
add esp, 8
test eax, eax
je 0x40263e
push ebx
push esi
mov byte [eax], 0
lea eax, [ebp - 0x904]
push edi
push eax
lea eax, [ebp - 0x884]
push eax
lea eax, [ebp - 0xa04]
push eax
lea eax, [ebp - 0x804]
push eax
lea eax, [ebp - 0x304]
push eax
call fcn.004038d5
lea edx, [ebp - 0xa04]
add esp, 0x14
mov esi, edx
mov edi, edi
mov al, byte [edx]
inc edx
test al, al
jne 0x402170
lea edi, [ebp - 0x804]
sub edx, esi
dec edi
lea ebx, [edi + 1]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402183
mov ecx, edx
lea eax, [ebp - 0x704]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x100
and ecx, 3
push ebx
rep movsb byte es:[edi], byte [esi]
push eax
call fcn.004034eb
add esp, 0xc
lea eax, [ebp - 0x1004]
push 0x100
push eax
lea eax, [ebp - 0x704]
push eax
call dword [sym.imp.KERNEL32.dll_GetShortPathNameW]
push 0x100
lea eax, [ebp - 0x1004]
push eax
lea eax, [ebp - 0x404]
push eax
call fcn.0040389f
add esp, 0xc
lea eax, [ebp - 0x1174]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoW]
or dword [ebp - 0x1148], 1
xor eax, eax
mov word [ebp - 0x1144], ax
xor ecx, ecx
mov al, byte [ebp + ecx - 0x404]
lea ecx, [ecx + 1]
mov byte [ebp + ecx - 0x505], al
test al, al
jne 0x402201
lea ecx, [ebp - 0x504]
dec ecx
lea ecx, [ecx]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x402220
mov eax, dword [str.y.dat]
mov dword [ecx], eax
mov ax, word [0x42141c]
mov word [ecx + 4], ax
lea eax, [ebp - 0x504]
push 0x421420
push eax
call fcn.00403ccf
mov esi, eax
push esi
push 1
push 1
push 0x421424
call fcn.00403e82
push esi
call fcn.00403b94
movq xmm0, qword [str.cmd__C__]
lea edx, [ebp - 0x404]
mov al, byte [0x421430]
add esp, 0x1c
movq qword [ebp - 0x204], xmm0
mov esi, edx
mov byte [ebp - 0x1fc], al
lea esp, [esp]
mov al, byte [edx]
inc edx
test al, al
jne 0x402290
lea edi, [ebp - 0x204]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4022a0
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x204]
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4022c0
mov ecx, 7
lea edx, [ebp - 0x504]
mov esi, str.OverrideXPFileSecurity.cmd__
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov esi, edx
lea ecx, [ecx]
mov al, byte [edx]
inc edx
test al, al
jne 0x4022e0
lea edi, [ebp - 0x204]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4022f0
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x204]
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x402310
mov ax, word [0x421454]
mov word [edi], ax
lea eax, [ebp - 0x204]
push 0x200
push eax
lea eax, [ebp - 0xe04]
push eax
call fcn.004034eb
push 0x100
lea eax, [ebp - 0x404]
push eax
lea eax, [ebp - 0x704]
push eax
call fcn.004034eb
add esp, 0x18
lea eax, [ebp - 0x1130]
push eax
lea eax, [ebp - 0x1174]
push eax
lea eax, [ebp - 0x704]
push eax
push 0
push 0x8000030
push 0
push 0
push 0
lea eax, [ebp - 0xe04]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x4023b2
push 0x1d4c0
push dword [ebp - 0x1130]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp - 0x112c]
call ebx
push dword [ebp - 0x1130]
call ebx
movq xmm0, qword [str.cmd__C__]
lea edx, [ebp - 0x404]
mov al, byte [0x421430]
mov esi, edx
movq qword [ebp - 0x204], xmm0
mov byte [ebp - 0x1fc], al
mov al, byte [edx]
inc edx
test al, al
jne 0x4023d5
lea edi, [ebp - 0x204]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x4023e5
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x204]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402402
mov ecx, 9
lea edx, [ebp - 0x504]
mov esi, str.OverrideXPFileSecurity2.cmd_Models__
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
mov esi, edx
nop
mov al, byte [edx]
inc edx
test al, al
jne 0x402420
lea edi, [ebp - 0x204]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402430
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x204]
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x402450
mov ax, word [0x421454]
mov word [edi], ax
lea eax, [ebp - 0x204]
push 0x200
push eax
lea eax, [ebp - 0xe04]
push eax
call fcn.004034eb
push 0x100
lea eax, [ebp - 0x404]
push eax
lea eax, [ebp - 0x704]
push eax
call fcn.004034eb
add esp, 0x18
lea eax, [ebp - 0x1130]
push eax
lea eax, [ebp - 0x1174]
push eax
lea eax, [ebp - 0x704]
push eax
push 0
push 0x8000030
push 0
push 0
push 0
lea eax, [ebp - 0xe04]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x4024ec
push 0x1d4c0
push dword [ebp - 0x1130]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp - 0x112c]
call ebx
push dword [ebp - 0x1130]
call ebx
movq xmm0, qword [str.cmd__C__]
lea edx, [ebp - 0x404]
mov al, byte [0x421430]
mov esi, edx
movq qword [ebp - 0x204], xmm0
mov byte [ebp - 0x1fc], al
nop
mov al, byte [edx]
inc edx
test al, al
jne 0x402510
lea edi, [ebp - 0x204]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402520
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x204]
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402540
mov ecx, 0xa
lea edx, [ebp - 0x504]
mov esi, str.OverrideXPFileSecurity2.cmd_IOPlugins__
rep movsd dword es:[edi], dword [esi]
mov esi, edx
lea esp, [esp]
mov al, byte [edx]
inc edx
test al, al
jne 0x402560
lea edi, [ebp - 0x204]
sub edx, esi
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402570
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x204]
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x402590
mov ax, word [0x421454]
mov word [edi], ax
lea eax, [ebp - 0x204]
push 0x200
push eax
lea eax, [ebp - 0xe04]
push eax
call fcn.004034eb
push 0x100
lea eax, [ebp - 0x404]
push eax
lea eax, [ebp - 0x704]
push eax
call fcn.004034eb
add esp, 0x18
lea eax, [ebp - 0x1130]
push eax
lea eax, [ebp - 0x1174]
push eax
lea eax, [ebp - 0x704]
push eax
push 0
push 0x8000030
push 0
push 0
push 0
lea eax, [ebp - 0xe04]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x40262c
push 0x1d4c0
push dword [ebp - 0x1130]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp - 0x112c]
call ebx
push dword [ebp - 0x1130]
call ebx
lea eax, [ebp - 0x504]
push eax
call fcn.00403f04
add esp, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004040f2
mov esp, ebp
pop ebp
ret