Function at 0x401040
Capabilities:
Allocate or change rwx memory
Create thread
Enumerate processes
Execute shellcode via indirect call
Inject thread
Spawn thread to rwx shellcode

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x438
mov eax, dword [0x404004]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [ebp + 8], 3
push edi
mov edi, dword [ebp + 0xc]
jne 0x4012fa
push ebx
mov ebx, dword [edi + 4]
lea eax, [ebp - 0x430]
mov edi, dword [edi + 8]
push esi
push 0x228
push 0
push eax
mov dword [ebp - 0x438], ebx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x434], 0x22c
push 0
push 2
call dword [sym.imp.KERNEL32.dll_CreateToolhelp32Snapshot]
mov esi, eax
cmp esi, 0xffffffff
je 0x401153
lea eax, [ebp - 0x434]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_Process32FirstW]
test eax, eax
je 0x401153
push 0xff
lea eax, [ebp - 0x410]
push eax
push 0xff
lea eax, [ebp - 0x104]
push eax
push 0
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_wcstombs_s]
add esp, 0x14
lea eax, [ebp - 0x104]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x40117a
mov ebx, dword [sym.imp.KERNEL32.dll_Process32NextW]
lea eax, [ebp - 0x434]
push eax
push esi
call ebx
test eax, eax
je 0x401153
nop word [eax + eax]
push 0xff
lea eax, [ebp - 0x410]
push eax
push 0xff
lea eax, [ebp - 0x104]
push eax
push 0
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_wcstombs_s]
add esp, 0x14
lea eax, [ebp - 0x104]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x401174
lea eax, [ebp - 0x434]
push eax
push esi
call ebx
test eax, eax
jne 0x401110
push str.An_error_is_occured_when_trying_to_find_the_target_process._n
call fcn.00401010
add esp, 4
pop esi
pop ebx
or eax, 0xffffffff
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401319
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x438]
mov esi, dword [ebp - 0x42c]
cmp esi, 0xffffffff
je 0x401153
push str._DLL_Injector__n
call fcn.00401010
push edi
push str.Process_:__s_n
call fcn.00401010
push esi
push str.Process_ID_:__i_n_n
call fcn.00401010
add esp, 0x14
lea eax, [ebp - 0x208]
push 0
push eax
push 0x104
push ebx
call dword [sym.imp.KERNEL32.dll_GetFullPathNameA]
test eax, eax
jne 0x4011c8
push str.An_error_is_occured_when_trying_to_get_the_full_path_of_the_DLL._n
jmp 0x401158
push esi
push 0
push 0x1fffff
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4011e7
push str.An_error_is_occured_when_trying_to_open_the_target_process._n
jmp 0x401158
push str._PROCESS_INJECTION__n
call fcn.00401010
push str.Process_opened_successfully._n
call fcn.00401010
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea eax, [ebp - 0x208]
add esp, 8
push 0x40
push 0x3000
push eax
call edi
inc eax
push eax
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov ebx, eax
test ebx, ebx
jne 0x40122f
push str.An_error_is_occured_when_trying_to_allocate_memory_in_the_target_process._n
jmp 0x401158
push ebx
push str.Memory_allocate_at_0x_X_n
call fcn.00401010
add esp, 8
lea eax, [ebp - 0x208]
push 0
push eax
call edi
inc eax
push eax
lea eax, [ebp - 0x208]
push eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x401267
push str.An_error_is_occured_when_trying_to_write_the_DLL_path_in_the_target_process._n
jmp 0x401158
push str.DLL_path_writen_successfully._n
call fcn.00401010
add esp, 4
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
cmp eax, 0xffffffff
je 0x401160
test eax, eax
je 0x401160
push str.LoadLibraryA
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
jne 0x4012ac
push str.An_error_is_occured_when_trying_to_get__LoadLibraryA__address._n
jmp 0x401158
push edi
push str.LoadLibraryA_address_at_0x_X_n
call fcn.00401010
add esp, 8
push 0
push 0
push ebx
push edi
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateRemoteThread]
cmp eax, 0xffffffff
jne 0x4012da
push str.An_error_is_occured_when_trying_to_create_the_thread_in_the_target_process._n
jmp 0x401158
push str.DLL_Injected___n
call fcn.00401010
add esp, 4
xor eax, eax
pop esi
pop ebx
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401319
mov esp, ebp
pop ebp
ret
push str._HELP__inject.exe__dll___process__n
call fcn.00401010
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
or eax, 0xffffffff
pop edi
call fcn.00401319
mov esp, ebp
pop ebp
ret