Function at 0x401560
Capabilities:
Allocate or change rwx memory
Check if file exists
Create process on windows
Create process suspended
Execute shellcode via indirect call
Get common file path
Get file attributes
Get file size
Move file
Parse pe header
Read file on windows
Resume thread
Suspend thread
Terminate process
Use process replacement

Disassembly:
sub esp, 0x9f8
push ebx
push ebp
push esi
push edi
push 0x104
push 0x408db0
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x401620
push 0x408db0
push str.System_Directory:__s_n
call fcn.00401000
mov edi, str.drvmgt.dll
or ecx, 0xffffffff
xor eax, eax
add esp, 8
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x408db0
mov esi, edi
mov edx, ecx
mov edi, 0x408db0
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x401620
push str..disable
push 0x408db0
lea eax, [esp + 0x374]
push str._s_s
push eax
call fcn.00401e70
add esp, 0x10
lea ecx, [esp + 0x36c]
push ecx
push 0x408db0
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
jne 0x401616
push str.Unable_to_disable_SafeDiscShim__r_n
call fcn.00401080
add esp, 4
jmp 0x401620
mov dword [0x408eb8], 1
mov dword [0x408dac], 0x408039
call fcn.00401420
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x84]
xor ebx, ebx
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0xa0c]
xor ebp, ebp
cmp eax, 2
jge 0x401785
push 0x4084c0
push 0x4084ac
call fcn.00402195
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x401716
push esi
lea edx, [esp + 0x88]
push 0x104
push edx
call fcn.00402290
push esi
call fcn.00402015
lea edi, [esp + 0x94]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x401716
lea eax, [esp + 0x84]
push 0x4084a8
push eax
call fcn.00402210
add esp, 8
test eax, eax
je 0x4016cf
lea ecx, [esp + 0x84]
push 0x4084a8
push ecx
call fcn.00402210
add esp, 8
mov byte [eax], 0
lea edx, [esp + 0x84]
push 0x4084a4
push edx
call fcn.00402210
add esp, 8
test eax, eax
je 0x401700
lea eax, [esp + 0x84]
push 0x4084a4
push eax
call fcn.00402210
add esp, 8
mov byte [eax], 0
lea ecx, [esp + 0x84]
lea ebp, [esp + 0x84]
test ecx, ecx
jne 0x40189e
mov ecx, 0x12
xor eax, eax
lea edi, [esp + 0x3c]
lea edx, [esp + 0x84]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x38]
mov dword [esp + 0x38], 0x4c
push eax
mov dword [esp + 0x40], ebx
mov dword [esp + 0x58], edx
mov dword [esp + 0x5c], 0x104
mov dword [esp + 0x48], str.Executables__.exe_
mov dword [esp + 0x54], 1
mov dword [esp + 0x60], ebx
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], ebx
mov dword [esp + 0x70], 0x1800
call sub.comdlg32.dll_GetOpenFileNameA
cmp eax, 1
jne 0x40189e
lea ebp, [esp + 0x84]
jmp 0x40189e
mov ebx, 1
cmp eax, ebx
jle 0x401895
mov ecx, dword [esp + 0xa10]
lea ebp, [ecx + 4]
mov edx, dword [ebp]
push 0x40847c
push edx
call fcn.00402210
add esp, 8
lea edx, [esp + 0x84]
test eax, eax
je 0x40181d
mov edi, 0x408478
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x84]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x84]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x408478
jmp 0x401820
mov edi, dword [ebp]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0xa0c]
mov ecx, edx
and ecx, 3
dec eax
cmp ebx, eax
rep movsb byte es:[edi], byte [esi]
je 0x401882
mov edi, 0x40847c
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x84]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0xa0c]
inc ebx
add ebp, 4
cmp ebx, eax
jl 0x40179c
lea ebp, [esp + 0x84]
xor ebx, ebx
push ebp
push str.szPath:__s_n
call fcn.00401000
push 0x408464
push ebp
mov esi, ebp
call fcn.00402210
mov edi, eax
push edi
push str.szExePart:__s_n
call fcn.00401000
add esp, 0x18
cmp edi, ebx
je 0x40190e
push ebp
call fcn.00406776
mov esi, eax
push 0x408464
push esi
call fcn.00402210
mov byte [eax + 4], 0
mov al, byte [esi]
add esp, 0xc
cmp al, 0x22
jne 0x4018eb
inc esi
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [ecx + esi - 1], 0x22
jne 0x40190e
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov byte [ecx + esi - 1], al
push ebp
call fcn.00401530
add esp, 4
lea eax, [esp + 0x268]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
je 0x401943
lea ecx, [esp + 0x268]
push ecx
push str.Current_Directory:__s_n
call fcn.00401000
add esp, 8
push ebx
push 0x80
push 3
push ebx
push 3
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
push esi
push str.szExePath:__s_n
mov edi, eax
call fcn.00401000
add esp, 8
cmp edi, 0xffffffff
jne 0x401984
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.Could_not_open_file:__s_r_n_ErrCode:__d__n
call fcn.00401080
add esp, 0xc
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
push 4
push 0x1000
lea edx, [ebx + 0x10000]
and edx, 0x3fff0000
push edx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
test esi, esi
mov dword [0x408da4], esi
jne 0x4019c3
push str.Cannot_allocate_memory_n
call fcn.00401080
add esp, 4
lea eax, [esp + 0x2c]
push 0
push eax
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [esp + 0x2c], ebx
je 0x4019ed
push str.Could_not_read_entire_file_n
call fcn.00401080
add esp, 4
mov esi, dword [0x408da4]
cmp word [esi], 0x5a4d
lea edi, [esi + ebx*4 - 0x10]
je 0x401a07
push ebp
call fcn.004012e0
add esp, 4
add esi, dword [esi + 0x3c]
cmp esi, edi
jbe 0x401a17
push ebp
call fcn.004012e0
add esp, 4
cmp dword [esi], 0x4550
je 0x401a28
push ebp
call fcn.004012e0
add esp, 4
mov eax, dword [esi + 0x34]
mov ecx, 0x10
mov dword [0x408da8], eax
mov esi, dword [esi + 0x28]
add esi, eax
xor eax, eax
lea edi, [esp + 0x18c]
push ebp
rep stosd dword es:[edi], eax
xor ecx, ecx
push str.lpApplicationName:__s_n
mov dword [esp + 0x24], ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x28], ecx
mov dword [esp + 0x190], 0x44
mov dword [esp + 0x2c], ecx
call fcn.00401000
add esp, 8
lea edx, [esp + 0x18]
lea eax, [esp + 0x188]
push edx
push eax
push 0
push 0
push 4
push 0
push 0
push 0
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x401aab
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebp
push str.Failed_to_CreateProcess:__s_r_n_ErrCode:__d__n
call fcn.00401080
add esp, 0xc
mov eax, dword [esp + 0x18]
mov ebx, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
push 0
lea ecx, [esp + 0x18]
push 4
lea edx, [esi - 4]
push ecx
push edx
push eax
mov dword [0x408da0], eax
call ebx
mov eax, dword [esp + 0x14]
mov edi, dword [sym.imp.KERNEL32.dll_TerminateProcess]
cmp eax, 0x70797274
je 0x401aee
mov eax, dword [0x408da0]
push 0xffffffffffffffff
push eax
call edi
push ebp
call fcn.004012e0
add esp, 4
mov eax, dword [0x408da0]
push 0
lea ecx, [esp + 0x18]
push 4
lea edx, [esi + 0xbb]
push ecx
push edx
push eax
call ebx
mov cl, byte [esp + 0x14]
mov al, 0xe9
cmp cl, al
je 0x401b34
cmp byte [esp + 0x16], al
je 0x401b2a
mov ecx, dword [0x408da0]
push 0xffffffffffffffff
push ecx
call edi
push ebp
call fcn.004012e0
add esp, 4
mov dword [0x4080cc], 0xbd
mov dl, byte [0x4080cc]
push 1
push 1
push 0
push 0
push edx
call fcn.004013a0
mov eax, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ecx, 0x26
mov dword [0x4080c7], eax
xor eax, eax
lea edi, [esp + 0x1e1]
mov byte [esp + 0x1e0], 0
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x34]
push ecx
stosw word es:[edi], ax
call fcn.00401120
mov eax, dword [esp + 0x30]
add esp, 0x18
lea edx, [esp + 0x34]
push edx
push 0x40
push 0x9b
push esi
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x1d0]
push 0x9b
push ecx
push esi
push edx
call ebx
mov eax, dword [esp + 0x18]
mov ebp, dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push 0
push 0x9b
push 0x408030
push esi
push eax
call ebp
test eax, eax
jne 0x401bd3
push str.Unable_to_write_to_process_memory_n
call fcn.00401080
add esp, 4
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
test eax, eax
jne 0x401bef
push str.Unable_to_resume_exe_n
call fcn.00401080
add esp, 4
mov ecx, 0xb2
xor eax, eax
lea edi, [esp + 0x474]
rep stosd dword es:[edi], eax
mov dword [esp + 0x470], 0x1003f
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x470]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
jne 0x401c2e
push str.Could_not_GetThreadContext_1_n
call fcn.00401080
add esp, 4
cmp dword [esp + 0x528], esi
je 0x401c41
push 0x10
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x401c0a
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_SuspendThread]
mov ecx, dword [esp + 0x18]
push 0
lea edx, [esp + 0x34]
push 4
lea eax, [esi + 0x97]
push edx
push eax
push ecx
call ebx
mov eax, dword [esp + 0x30]
test eax, eax
je 0x401d41
mov eax, dword [0x408da0]
push 0
lea edx, [esp + 0x1d0]
push 0x9b
push edx
push esi
push eax
call ebp
mov ecx, dword [0x4080cc]
mov eax, dword [0x408da0]
push 0
lea edx, [esp + 0x2c]
add esi, ecx
push 2
push edx
push esi
push eax
mov byte [esp + 0x26], 0xeb
mov byte [esp + 0x27], 0xfe
call ebx
mov edx, dword [0x408da0]
push 0
lea ecx, [esp + 0x16]
push 2
push ecx
push esi
push edx
call ebp
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
xor ebp, ebp
mov edx, dword [esp + 0x1c]
mov ecx, 0xb2
xor eax, eax
lea edi, [esp + 0x740]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x73c]
mov dword [esp + 0x73c], 0x1003f
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
cmp dword [esp + 0x7f4], esi
je 0x401d12
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
inc ebp
cmp ebp, 0x1e
jne 0x401ccb
jmp 0x401d41
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_SuspendThread]
mov edx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x2c]
push 2
push ecx
push esi
push edx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
test eax, eax
jne 0x401d4e
push str.Failed_to_start_at_OEP__n
call fcn.00401080
add esp, 4
call fcn.00401020
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x9f8
ret