Function at 0x408970
Capabilities:
Allocate or change rwx memory
Enumerate pe sections
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2e0
mov eax, dword [0x5ac1d0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [eax + 0x3c]
push 0x40
add edi, eax
push 0x3000
mov esi, ecx
mov ecx, dword [edi + 0x34]
mov edx, dword [esi]
mov dword [ebp - 0x2e0], eax
mov eax, dword [edi + 0x50]
push eax
push ecx
push edx
mov dword [ebp - 0x2dc], esi
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov ebx, eax
test ebx, ebx
jne 0x4089da
push str.____An_error_is_occured_when_trying_to_allocate_memory_for_the_new_image._n
call fcn.0051d9a3
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b896
mov esp, ebp
pop ebp
ret
push ebx
push str.___Memory_allocate_at_:_0x_p_n
call fcn.0051d9a3
mov eax, dword [edi + 0x54]
mov ecx, dword [ebp - 0x2e0]
mov edx, dword [esi]
add esp, 8
push 0
push eax
push ecx
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x408a23
push str.____An_error_is_occured_when_trying_to_write_the_headers_of_the_new_image._n
call fcn.0051d9a3
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b896
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x34]
push eax
push str.___Headers_write_at_:_0x_p_n
call fcn.0051d9a3
xor eax, eax
xor ecx, ecx
add esp, 8
mov dword [ebp - 0x2d8], eax
cmp cx, word [edi + 6]
jae 0x408ac3
mov dword [ebp - 0x2d4], eax
lea ebx, [ebx]
movzx edx, word [edi + 0x14]
add edx, dword [ebp - 0x2d4]
mov eax, dword [edx + edi + 0x28]
mov ecx, dword [edx + edi + 0x2c]
add ecx, dword [ebp - 0x2e0]
lea esi, [edx + edi + 0x18]
mov edx, dword [esi + 0xc]
push 0
push eax
mov eax, dword [ebp - 0x2dc]
push ecx
mov ecx, dword [eax]
add edx, ebx
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x408b18
mov edx, dword [esi + 0xc]
add edx, ebx
push edx
push esi
push str.___Section__s_write_at_:_0x_p._n
call fcn.0051d9a3
mov eax, dword [ebp - 0x2d8]
movzx ecx, word [edi + 6]
add dword [ebp - 0x2d4], 0x28
inc eax
add esp, 0xc
mov dword [ebp - 0x2d8], eax
cmp eax, ecx
jl 0x408a50
mov esi, dword [ebp - 0x2dc]
push 0x2cc
lea edx, [ebp - 0x2d0]
push 0
push edx
call fcn.0051f990
mov ecx, dword [esi + 4]
add esp, 0xc
lea eax, [ebp - 0x2d0]
push eax
push ecx
mov dword [ebp - 0x2d0], 0x10007
call dword [sym.imp.KERNEL32.dll_Wow64GetThreadContext]
test eax, eax
jne 0x408b39
push str.____An_error_is_occured_when_trying_to_get_the_thread_context._n
call fcn.0051d9a3
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b896
mov esp, ebp
pop ebp
ret
push esi
push str.____An_error_is_occured_when_trying_to_write_the_section_:__s._n
call fcn.0051d9a3
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b896
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x22c]
push 0
push 4
lea eax, [edi + 0x34]
push eax
mov eax, dword [esi]
add edx, 8
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x408b78
push str.____An_error_is_occured_when_trying_to_write_the_image_base_in_the_PEB._n
call fcn.0051d9a3
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b896
mov esp, ebp
pop ebp
ret
mov ecx, dword [edi + 0x28]
mov eax, dword [esi + 4]
lea edx, [ebp - 0x2d0]
push edx
add ecx, ebx
push eax
mov dword [ebp - 0x220], ecx
call dword [sym.imp.KERNEL32.dll_Wow64SetThreadContext]
test eax, eax
jne 0x408bb8
push str.____An_error_is_occured_when_trying_to_set_the_thread_context._n
call fcn.0051d9a3
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b896
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi + 4]
push ecx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov eax, 1
pop ebx
call fcn.0051b896
mov esp, ebp
pop ebp
ret