Function at 0x40c180
Capabilities:
Allocate or change rwx memory
Check http status code
Check if file exists
Create thread
Execute shellcode via indirect call
Get file attributes
Inject thread
Spawn thread to rwx shellcode

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47d6e3
mov eax, dword fs:[0]
push eax
sub esp, 0x7c
mov eax, dword [0x49ffb8]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, edx
mov dword [ebp - 0x70], esi
mov dword [ebp - 0x64], ecx
lea ecx, [ebp - 0x40]
call fcn.0041c500
push 0x48e064
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov edx, esi
lea ecx, [ebp - 0x28]
mov dword [ebp - 0x78], eax
call fcn.0041c500
cmp dword [eax + 0x14], 8
jb 0x40c1e2
mov eax, dword [eax]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
setne bl
cmp dword [ebp - 0x14], 8
jb 0x40c200
push dword [ebp - 0x28]
call fcn.0043d98b
add esp, 4
test bl, bl
jne 0x40c264
cmp dword [0x4a1a34], 0
jl 0x40c993
lea ecx, [ebp - 0x74]
call fcn.0041de50
mov byte [ebp - 4], 1
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 0
mov eax, dword [eax + 4]
mov eax, dword [eax + 4]
test eax, eax
je 0x40c236
add eax, 0x10
jmp 0x40c238
xor eax, eax
push esi
push ecx
push str.DetourClass::InjectDllByHandle_dll_to_inject_does_not_exist:
push eax
call fcn.00407740
add esp, 0xc
push eax
call fcn.004079f0
lea ecx, [ebp - 0x74]
add esp, 8
mov byte [ebp - 4], 0
call fcn.0041dee0
xor bl, bl
jmp 0x40c999
mov eax, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x64]
push 0x40
push 0x1000
lea eax, [eax*2 + 2]
push eax
push 0
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov edx, eax
mov dword [ebp - 0x80], edx
test edx, edx
jne 0x40c300
cmp dword [0x4a1a34], eax
jl 0x40c993
lea ecx, [ebp - 0x74]
call fcn.0041de50
mov byte [ebp - 4], 2
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 0
mov eax, dword [eax + 4]
mov esi, dword [eax + 4]
test esi, esi
je 0x40c2be
add esi, 0x10
jmp 0x40c2c0
xor esi, esi
lea ecx, [ebp - 0x28]
call fcn.00425470
push eax
push ecx
mov byte [ebp - 4], 3
push str.DetourClass::InjectDllByHandle_unable_to_allocate_library_path_memory:
push esi
call fcn.00407740
add esp, 0xc
push eax
call fcn.004079f0
add esp, 8
lea ecx, [ebp - 0x28]
call fcn.00404080
lea ecx, [ebp - 0x74]
mov byte [ebp - 4], 0
call fcn.0041dee0
xor bl, bl
jmp 0x40c999
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x2c], 8
push 0
lea eax, [eax*2 + 2]
push eax
lea ecx, [ebp - 0x40]
cmovae ecx, dword [ebp - 0x40]
push ecx
push edx
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x40c372
cmp dword [0x4a1a34], eax
jl 0x40c993
lea ecx, [ebp - 0x74]
call fcn.0041de50
mov byte [ebp - 4], 4
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 0
mov eax, dword [eax + 4]
mov esi, dword [eax + 4]
test esi, esi
je 0x40c358
add esi, 0x10
jmp 0x40c35a
xor esi, esi
lea ecx, [ebp - 0x28]
call fcn.00425470
push eax
push ecx
mov byte [ebp - 4], 5
push str.DetourClass::InjectDllByHandle_unable_to_write_process_memory:
jmp 0x40c2d3
xor edi, edi
mov dword [ebp - 0x68], 0
xor esi, esi
lea ecx, [ecx]
test edi, edi
jne 0x40c54a
lea eax, [ebp - 0x68]
push eax
push edi
push dword [ebp - 0x80]
push 0x48e140
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
push edi
push edi
push dword [ebx + 4]
call dword [sym.imp.KERNEL32.dll_CreateRemoteThread]
mov edi, eax
test edi, edi
jne 0x40c4f8
mov dword [ebp - 0x7c], eax
mov dword [ebp - 0x14], 0xf
mov dword [ebp - 0x18], eax
mov byte [ebp - 0x28], al
lea edx, [ebp - 0x28]
lea ecx, [ebp - 0x7c]
mov byte [ebp - 4], 6
call fcn.00425780
cmp dword [ebp - 0x7c], 8
je 0x40c488
cmp dword [0x4a1a34], 3
jl 0x40c4db
lea ecx, [ebp - 0x88]
call fcn.0041de50
mov byte [ebp - 4], 7
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 3
mov eax, dword [eax + 4]
mov ebx, dword [eax + 4]
test ebx, ebx
je 0x40c412
add ebx, 0x10
jmp 0x40c414
xor ebx, ebx
lea ecx, [ebp - 0x58]
call fcn.00425510
push esi
push ecx
push str.__try
push ecx
push eax
push ecx
push str.DetourClass::InjectDllByHandle_unable_to_create_remote_thread:
push ebx
mov byte [ebp - 4], 8
call fcn.00407740
add esp, 0xc
push eax
call fcn.004079f0
add esp, 0xc
push eax
call fcn.00407740
add esp, 0xc
mov ecx, eax
call fcn.0040daa0
cmp dword [ebp - 0x44], 0x10
jb 0x40c462
push dword [ebp - 0x58]
call fcn.0043d98b
add esp, 4
lea ecx, [ebp - 0x88]
mov dword [ebp - 0x44], 0xf
mov dword [ebp - 0x48], 0
mov byte [ebp - 0x58], 0
mov byte [ebp - 4], 6
call fcn.0041dee0
mov ebx, dword [ebp - 0x64]
jmp 0x40c4db
cmp dword [0x4a1a34], 3
jl 0x40c4db
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 9
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 3
mov eax, dword [eax + 4]
mov eax, dword [eax + 4]
test eax, eax
je 0x40c4b6
add eax, 0x10
jmp 0x40c4b8
xor eax, eax
push esi
push ecx
push str.DetourClass::InjectDllByHandle_unable_to_create_remote_thread____received_error_ERROR_NOT_ENOUGH_MEMORY__try
push eax
call fcn.00407740
add esp, 0xc
mov ecx, eax
call fcn.0040daa0
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 6
call fcn.0041dee0
push 0x32
call dword [sym.imp.KERNEL32.dll_Sleep]
mov byte [ebp - 4], 0
cmp dword [ebp - 0x14], 0x10
jb 0x40c4f8
push dword [ebp - 0x28]
call fcn.0043d98b
add esp, 4
inc esi
cmp esi, 0xc8
jl 0x40c380
test edi, edi
jne 0x40c54a
cmp dword [0x4a1a34], edi
jl 0x40c993
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 0xa
mov ecx, dword [eax + 4]
mov dword [ecx + 8], edi
mov eax, dword [eax + 4]
mov eax, dword [eax + 4]
test eax, eax
je 0x40c53e
add eax, 0x10
push str.DetourClass::InjectDllByHandle_unable_to_create_remote_thread____giving_up
jmp 0x40c97e
xor eax, eax
push str.DetourClass::InjectDllByHandle_unable_to_create_remote_thread____giving_up
jmp 0x40c97e
cmp dword [0x4a1a34], 2
jl 0x40c636
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 0xb
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 2
mov eax, dword [eax + 4]
mov eax, dword [eax + 4]
test eax, eax
je 0x40c57c
add eax, 0x10
jmp 0x40c57e
xor eax, eax
push dword [ebp - 0x70]
push ecx
push str.INJECT_DetourClass::InjectDllByHandle_injected
push eax
call fcn.00407740
add esp, 0xc
push eax
call fcn.004079f0
add esp, 8
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 0
call fcn.0041dee0
cmp dword [0x4a1a34], 2
jl 0x40c636
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 0xc
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 2
mov eax, dword [eax + 4]
mov eax, dword [eax + 4]
test eax, eax
je 0x40c5d7
add eax, 0x10
jmp 0x40c5d9
xor eax, eax
push 0x40c0b0
push ecx
push dword [ebx + 4]
push 0x40bf70
push str._using_process_handle
push ecx
push dword [ebp - 0x68]
push ecx
push str.INJECT_DetourClass::InjectDllByHandle_remote_thread_ID_is
push eax
call fcn.00407740
add esp, 0xc
mov ecx, eax
call fcn.00404210
add esp, 4
push eax
call fcn.00407740
add esp, 8
mov ecx, eax
call fcn.0040bf90
mov ecx, eax
call fcn.0040dc30
add esp, 4
mov ecx, eax
call fcn.0040bf90
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 0
call fcn.0041dee0
mov esi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0x3e8
push edi
call esi
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x40c852
cmp dword [0x4a1a34], 2
jl 0x40c6c1
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 0xd
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 2
mov eax, dword [eax + 4]
mov esi, dword [eax + 4]
test esi, esi
je 0x40c680
add esi, 0x10
jmp 0x40c682
xor esi, esi
lea ecx, [ebp - 0x28]
call fcn.00425470
push eax
push ecx
push str.DetourClass::InjectDllByHandle_wait_for_1st_thread_timed_out_after_1000ms
push esi
mov byte [ebp - 4], 0xe
call fcn.00407740
add esp, 0xc
push eax
call fcn.004079f0
add esp, 8
lea ecx, [ebp - 0x28]
call fcn.00404080
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 0
call fcn.0041dee0
mov esi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push edi
call ebx
lea eax, [ebp - 0x68]
push eax
push 0
push dword [ebp - 0x80]
push 0x48e140
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
mov eax, dword [ebp - 0x64]
push 0
push 0
push dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_CreateRemoteThread]
test eax, eax
jne 0x40c763
cmp dword [0x4a1a34], eax
jl 0x40c993
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 0xf
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 0
mov eax, dword [eax + 4]
mov esi, dword [eax + 4]
test esi, esi
je 0x40c721
add esi, 0x10
jmp 0x40c723
xor esi, esi
lea ecx, [ebp - 0x28]
call fcn.00425470
push eax
push ecx
mov byte [ebp - 4], 0x10
push str.DetourClass::InjectDllByHandle_unable_to_create_remote_thread_on_second_try:
push esi
call fcn.00407740
add esp, 0xc
push eax
call fcn.004079f0
add esp, 8
lea ecx, [ebp - 0x28]
call fcn.00404080
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 0
call fcn.0041dee0
xor bl, bl
jmp 0x40c999
cmp dword [0x4a1a34], 2
jl 0x40c7f7
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 0x11
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 2
mov eax, dword [eax + 4]
mov eax, dword [eax + 4]
test eax, eax
je 0x40c795
add eax, 0x10
jmp 0x40c797
xor eax, eax
push 0x40c0b0
push ecx
mov ecx, dword [ebp - 0x64]
push dword [ecx + 4]
push 0x40bf70
push str._using_process_handle
push ecx
push dword [ebp - 0x68]
push ecx
push str.DetourClass::InjectDllByHandle_2nd_remote_thread_ID_is
push eax
call fcn.00407740
add esp, 0xc
mov ecx, eax
call fcn.00404210
add esp, 4
push eax
call fcn.00407740
add esp, 8
mov ecx, eax
call fcn.0040bf90
mov ecx, eax
call fcn.0040dc30
add esp, 4
mov ecx, eax
call fcn.0040bf90
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 0
call fcn.0041dee0
push 0x2710
push edi
call esi
test eax, eax
je 0x40c852
push edi
call ebx
cmp dword [0x4a1a34], 0
jl 0x40c993
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 0x12
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 0
mov eax, dword [eax + 4]
mov esi, dword [eax + 4]
test esi, esi
je 0x40c838
add esi, 0x10
jmp 0x40c83a
xor esi, esi
lea ecx, [ebp - 0x28]
call fcn.00425470
push eax
push ecx
mov byte [ebp - 4], 0x13
push str.DetourClass::InjectDllByHandle_wait_for_second_thread_timed_out:
jmp 0x40c736
lea eax, [ebp - 0x6c]
push eax
push edi
mov dword [ebp - 0x6c], 0
call dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
test eax, eax
jne 0x40c8d0
cmp dword [0x4a1a34], eax
jl 0x40c8d0
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 0x14
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 0
mov eax, dword [eax + 4]
mov esi, dword [eax + 4]
test esi, esi
je 0x40c895
add esi, 0x10
jmp 0x40c897
xor esi, esi
lea ecx, [ebp - 0x28]
call fcn.00425470
push eax
push ecx
push str.DetourClass::InjectDll_GetExitCodeThread_failed:
push esi
mov byte [ebp - 4], 0x15
call fcn.00407740
add esp, 0xc
push eax
call fcn.004079f0
add esp, 8
lea ecx, [ebp - 0x28]
call fcn.00404080
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 0
call fcn.0041dee0
cmp dword [0x4a1a34], 3
jl 0x40c940
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 0x16
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 3
mov eax, dword [eax + 4]
mov eax, dword [eax + 4]
test eax, eax
je 0x40c8fe
add eax, 0x10
jmp 0x40c900
xor eax, eax
push 0x40c0b0
push ecx
push dword [ebp - 0x6c]
push 0x40bf70
push str.DetourClass::InjectDll_Thread_exit_code_is
push eax
call fcn.00407740
add esp, 8
mov ecx, eax
call fcn.0040bf90
mov ecx, eax
call fcn.00404210
add esp, 4
mov ecx, eax
call fcn.0040bf90
lea ecx, [ebp - 0x60]
mov byte [ebp - 4], 0
call fcn.0041dee0
push edi
call ebx
cmp dword [ebp - 0x6c], 0
jne 0x40c997
cmp dword [0x4a1a34], 0
jl 0x40c993
lea ecx, [ebp - 0x60]
call fcn.0041de50
mov byte [ebp - 4], 0x17
mov ecx, dword [eax + 4]
mov dword [ecx + 8], 0
mov eax, dword [eax + 4]
mov eax, dword [eax + 4]
test eax, eax
je 0x40c977
add eax, 0x10
jmp 0x40c979
xor eax, eax
push str.DetourClass::InjectDllByHandle_hLibModule_is_NULL
push eax
call fcn.00407740
lea ecx, [ebp - 0x60]
add esp, 8
mov byte [ebp - 4], 0
call fcn.0041dee0
xor bl, bl
jmp 0x40c999
mov bl, 1
cmp dword [ebp - 0x2c], 8
jb 0x40c9aa
push dword [ebp - 0x40]
call fcn.0043d98b
add esp, 4
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0043cee8
mov esp, ebp
pop ebp
ret