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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x310
mov eax, dword [0x5ad1d0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov esi, ecx
mov edi, dword [esi + 0x3c]
mov eax, dword [edi + esi + 0x50]
mov ecx, dword [ebx]
push 0x40
add edi, esi
push 0x3000
push eax
push 0
push ecx
mov dword [ebp - 0x2f4], esi
mov dword [ebp - 0x30c], edi
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov dword [ebp - 0x2dc], eax
test eax, eax
jne 0x408a7d
push str.____An_error_is_occured_when_trying_to_allocate_memory_for_the_new_image._n
call fcn.0051d75e
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b53a
mov esp, ebp
pop ebp
ret
push eax
push str.___Memory_allocate_at_:_0x_p_n
call fcn.0051d75e
mov ecx, dword [ebp - 0x2dc]
mov edx, dword [edi + 0x54]
add esp, 8
mov eax, ecx
sub eax, dword [edi + 0x34]
push 0
push edx
mov dword [edi + 0x34], ecx
mov ecx, dword [ebx]
mov dword [ebp - 0x308], eax
mov eax, dword [ebp - 0x2dc]
push esi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x408ada
push str.____An_error_is_occured_when_trying_to_write_the_headers_of_the_new_image._n
call fcn.0051d75e
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b53a
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x2dc]
push edx
push str.___Headers_write_at_:_0x_p_n
call fcn.0051d75e
mov eax, dword [esi + 0x3c]
xor edx, edx
add esp, 8
cmp dword [eax + esi + 0xa0], edx
je 0x408b18
mov ecx, dword [eax + esi + 0xa0]
mov eax, dword [eax + esi + 0xa4]
mov dword [ebp - 0x300], ecx
mov dword [ebp - 0x2fc], eax
jmp 0x408b2a
xor eax, eax
xor ecx, ecx
mov dword [ebp - 0x2fc], ecx
mov dword [ebp - 0x300], eax
mov ecx, eax
xor eax, eax
mov dword [ebp - 0x2e4], edx
mov dword [ebp - 0x2e0], edx
cmp ax, word [edi + 6]
jae 0x408be1
mov dword [ebp - 0x2ec], edx
jmp 0x408b56
mov ecx, dword [ebp - 0x300]
movzx edx, word [edi + 0x14]
add edx, dword [ebp - 0x2ec]
mov eax, dword [edx + edi + 0x24]
lea esi, [edx + edi + 0x18]
cmp ecx, eax
jb 0x408b7b
mov edx, dword [esi + 8]
add edx, eax
cmp ecx, edx
jae 0x408b7b
mov dword [ebp - 0x2e4], esi
mov edx, dword [esi + 0x14]
mov ecx, dword [esi + 0x10]
add edx, dword [ebp - 0x2f4]
add eax, dword [ebp - 0x2dc]
push 0
push ecx
push edx
mov edx, dword [ebx]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x408c01
mov eax, dword [esi + 0xc]
add eax, dword [ebp - 0x2dc]
push eax
push esi
push str.___Section__s_write_at_:_0x_p._n
call fcn.0051d75e
mov eax, dword [ebp - 0x2e0]
movzx ecx, word [edi + 6]
add dword [ebp - 0x2ec], 0x28
inc eax
add esp, 0xc
mov dword [ebp - 0x2e0], eax
cmp eax, ecx
jl 0x408b50
mov esi, dword [ebp - 0x2e4]
test esi, esi
jne 0x408c22
push str.____An_error_is_occured_when_trying_to_get_the_relocation_section_of_the_source_image._n
call fcn.0051d75e
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b53a
mov esp, ebp
pop ebp
ret
push esi
push str.____An_error_is_occured_when_trying_to_write_the_section_:__s._n
call fcn.0051d75e
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b53a
mov esp, ebp
pop ebp
ret
push esi
push str.___Relocation_section_:__s_n
call fcn.0051d75e
xor ecx, ecx
add esp, 8
cmp dword [ebp - 0x2fc], ecx
jbe 0x408d12
jmp 0x408c46
mov esi, dword [ebp - 0x2e4]
mov edi, dword [esi + 0x14]
add edi, dword [ebp - 0x2f4]
mov eax, dword [edi + ecx + 4]
add edi, ecx
sub eax, 8
add ecx, 8
shr eax, 1
je 0x408d00
mov dword [ebp - 0x2e0], eax
mov edx, dword [ebp - 0x2e4]
mov eax, dword [edx + 0x14]
add eax, dword [ebp - 0x2f4]
add eax, ecx
movzx eax, word [eax]
add ecx, 2
mov dword [ebp - 0x304], ecx
test eax, 0xf000
je 0x408cf4
and eax, 0xfff
cdq
mov esi, eax
xor eax, eax
add esi, dword [edi]
mov ecx, edx
adc ecx, eax
mov eax, dword [ebp - 0x2dc]
cdq
add esi, eax
adc ecx, edx
mov edx, dword [ebx]
push 0
mov dword [ebp - 0x2ec], ecx
push 4
lea ecx, [ebp - 0x2ec]
push ecx
push esi
push edx
mov dword [ebp - 0x2ec], 0
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
mov edx, dword [ebx]
mov eax, dword [ebp - 0x308]
add dword [ebp - 0x2ec], eax
push 0
push 4
lea ecx, [ebp - 0x2ec]
push ecx
push esi
push edx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov ecx, dword [ebp - 0x304]
dec dword [ebp - 0x2e0]
jne 0x408c69
cmp ecx, dword [ebp - 0x2fc]
jb 0x408c40
mov edi, dword [ebp - 0x30c]
push str.___Relocations_done._n
call fcn.0051d75e
add esp, 4
push 0x2cc
lea eax, [ebp - 0x2d8]
push 0
push eax
call fcn.0051f750
mov edx, dword [ebx + 4]
add esp, 0xc
lea ecx, [ebp - 0x2d8]
push ecx
push edx
mov dword [ebp - 0x2d8], 0x10007
call dword [sym.imp.KERNEL32.dll_Wow64GetThreadContext]
test eax, eax
jne 0x408d74
push str.____An_error_is_occured_when_trying_to_get_the_thread_context._n
call fcn.0051d75e
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b53a
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x234]
mov edx, dword [ebx]
push 0
push 4
lea eax, [ebp - 0x2dc]
push eax
add ecx, 8
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x408db6
push str.____An_error_is_occured_when_trying_to_write_the_image_base_in_the_PEB._n
call fcn.0051d75e
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b53a
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x28]
add eax, dword [ebp - 0x2dc]
mov edx, dword [ebx + 4]
lea ecx, [ebp - 0x2d8]
push ecx
push edx
mov dword [ebp - 0x228], eax
call dword [sym.imp.KERNEL32.dll_Wow64SetThreadContext]
test eax, eax
jne 0x408dfa
push str.____An_error_is_occured_when_trying_to_set_the_thread_context._n
call fcn.0051d75e
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0051b53a
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 4]
push eax
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.0051b53a
mov esp, ebp
pop ebp
ret