Function at 0x401520
Capabilities:
Allocate or change rwx memory
Create thread
Execute shellcode via indirect call
Inject thread
Parse pe header
Resume thread
Spawn thread to rwx shellcode

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x820
mov eax, dword [0x409004]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, ecx
mov dword [ebp - 0x820], edx
mov dword [ebp - 0x814], edi
mov dword [ebp - 0x810], eax
test edi, edi
je 0x4017d0
test esi, esi
je 0x4017d0
test ebx, ebx
je 0x4017d0
cmp ebx, 0x40
jb 0x4017c1
mov eax, 0x5a4d
cmp word [esi], ax
je 0x401588
push str.____Failed_to_inject_library__Invalid_DOS_signature__n
jmp 0x4017c6
mov ecx, dword [esi + 0x3c]
lea eax, [ecx + 0xf8]
cmp ebx, eax
jb 0x4017c1
cmp dword [ecx + esi], 0x4550
je 0x4015ac
push str.____Failed_to_inject_library__Invalid_PE_signature__n
jmp 0x4017c6
mov eax, 0x14c
cmp word [ecx + esi + 4], ax
je 0x4015c2
push str.____Failed_to_inject_library__Invalid_platform__n
jmp 0x4017c6
mov eax, 0x10b
cmp word [ecx + esi + 0x18], ax
je 0x4015d8
push str.____Failed_to_inject_library__Invalid_optional_PE_signature__n
jmp 0x4017c6
push ecx
mov edx, ebx
mov ecx, esi
call fcn.00401340
add esp, 4
mov dword [ebp - 0x81c], eax
test eax, eax
jne 0x4015f9
push str.____Failed_to_inject_library__Loader_not_found__n
jmp 0x4017c6
push 0x40
push 0x3000
lea eax, [ebx + 0x418]
push eax
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edi, eax
mov dword [ebp - 0x818], edi
test edi, edi
jne 0x401626
push str.____Failed_to_inject_library__Unable_to_allocate_memory__n
jmp 0x4017c6
push 0
push ebx
push esi
push edi
push dword [ebp - 0x814]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x4017ba
mov esi, dword [ebp - 0x810]
lea eax, [ebp - 0x80c]
push 0x400
push 0
push eax
mov dword [esi + 0x10], edi
mov dword [esi + 0x14], ebx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [ebp - 0x80c]
push 0x400
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x4017b3
push 0x200
lea eax, [ebp - 0x40c]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0x200
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0
push 0
push 0
push 0
push 0x1ff
push eax
push 0x1ff
lea eax, [ebp - 0x40c]
push eax
lea eax, [ebp - 0x80c]
push eax
call dword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__splitpath_s]
add esp, 0x24
test eax, eax
jne 0x4017b3
push 0x400
push eax
lea eax, [ebp - 0x80c]
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x40c]
push eax
lea eax, [ebp - 0x80c]
push 0x406654
push eax
call fcn.004026b0
mov eax, dword [ebp - 0x810]
lea edi, [esi + 0x18]
add esp, 0x10
lea esi, [ebp - 0x80c]
mov ecx, pe_nt_image_headers32
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 0x818]
push 0
push 0x418
push eax
lea edi, [ebx + esi]
mov ebx, dword [ebp - 0x814]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x4017ba
mov eax, dword [ebp - 0x81c]
push 0
push 4
push edi
add eax, esi
push eax
push 0x100000
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_CreateRemoteThread]
mov edi, eax
test edi, edi
je 0x4017ac
cmp edi, 0xffffffff
je 0x4017ac
mov esi, dword [sym.imp.KERNEL32.dll_ResumeThread]
push edi
call esi
push dword [ebp - 0x820]
call esi
push 0xffffffffffffffff
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004041fe
mov esp, ebp
pop ebp
ret
push str.____Failed_to_inject_library__Invalid_thread_handle__n
jmp 0x4017c6
push str.____Failed_to_inject_library__Unknown_path__n
jmp 0x4017c6
push str.____Failed_to_inject_library__Unable_to_write_memory__n
jmp 0x4017c6
push str.____Failed_to_inject_library__File_is_too_small__n
push 0xc
call fcn.00403690
add esp, 8
mov ecx, dword [ebp - 8]
xor al, al
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004041fe
mov esp, ebp
pop ebp
ret