Function at 0x10004240
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Get file size
Parse pe header
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0xc], edi
test edi, edi
jne 0x10004259
xor eax, eax
jmp 0x10004347
cmp byte [edi + 0xc], 0
je 0x100042a9
mov ecx, dword [edi + 0x10]
mov eax, 0x5a4d
mov dword [edi + 4], ecx
cmp word [ecx], ax
je 0x1000428e
push str.___DOS_Signature_invalid_n
push 2
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
add esp, 8
xor eax, eax
jmp 0x10004347
mov eax, dword [ecx + 0x3c]
add eax, ecx
mov dword [edi + 8], eax
cmp dword [eax], 0x4550
je 0x10004342
push str.___NT_Signature_mismatch_n
jmp 0x10004274
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push dword [edi]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x100042ce
push str.___Failed_to_open_PE_File_n
jmp 0x10004274
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
push 0
push 0
push 2
push 0
push ebx
mov dword [edi + 0x14], eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov esi, eax
test esi, esi
jne 0x10004314
push str.___Failed_to_create_file_mapping_for_PE_File_n
push 2
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x10004347
push 0
push 0
push 0
push 4
push esi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 0x10], eax
call esi
push ebx
call esi
cmp dword [edi + 0x10], 0
jne 0x10004342
push str.___Failed_to_obtain_a_map_view_of_PE_File_n
jmp 0x10004274
mov eax, 1
test eax, eax
je 0x1000440b
push str.___Checking_for_self_relocation_n
push 2
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
add esp, 8
push 0
call ebx
mov esi, eax
test esi, esi
jne 0x10004391
push str.____Failed_to_get_our_loaded_address_n
push 2
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
add esp, 8
jmp 0x100043bb
mov ebx, dword [esi + 0x3c]
cmp dword [ebx + esi], 0x4550
je 0x10004414
push str.____Failed_to_find_our_own_headers_n
push 2
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
add esp, 8
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
xor eax, eax
test eax, eax
je 0x10004538
push fcn.10004110
push str.___Relocating_loader_image__Continue_Function:_0x_08x__n
push 2
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
add esp, 0xc
push 0
call ebx
mov esi, eax
mov dword [ebp - 8], esi
test esi, esi
jne 0x10004475
push str.____Failed_to_get_our_loaded_address_n
push 2
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push dword [ebx + esi + 0x50]
push esi
push str.___MyBase:_0x_08x_MySize:__d_n
push 2
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
mov eax, dword [edi + 8]
add esp, 0x10
mov ecx, dword [eax + 0x34]
cmp ecx, esi
jb 0x100043b5
mov eax, dword [ebx + esi + 0x50]
add eax, esi
cmp ecx, eax
jae 0x100043b5
push str.___Self_relocation_required_n
push 2
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
mov ebx, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
add esp, 8
mov eax, 1
jmp 0x100043bd
mov eax, dword [esi + 0x3c]
add eax, esi
mov dword [ebp - 4], eax
push 0x40
push 0x3000
mov eax, dword [eax + 0x50]
inc eax
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
test ebx, ebx
jne 0x100044a1
push str.____Failed_to_allocate_memory_for_self_relocation_n
jmp 0x100043f8
push ebx
push str.___New_Loader_Base:_0x_08x_n
push 2
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
mov eax, dword [ebp - 4]
add esp, 0xc
mov dword [edi + 0x1c], ebx
push dword [eax + 0x50]
push esi
push ebx
call fcn.10007d20
add esp, 0xc
mov ecx, ebx
call fcn.10003c90
test eax, eax
jne 0x100044e2
push str.____Failed_to_process_IAT_for_relocated_image_n
jmp 0x100043f8
mov esi, ebx
mov ecx, ebx
sub esi, dword [ebp - 8]
mov edx, esi
call fcn.10003b70
test eax, eax
jne 0x100044fe
push str.____Failed_to_apply_relocations_on_relocated_image_n
jmp 0x100043f8
add esi, fcn.10004110
mov dword [edi + 0x18], ebx
push esi
push str.___Jumping_to_relocated_image__Relocated_Continue_Function:_0x_08x__n
push 2
mov dword [ebp - 8], esi
call fcn.1000b4e3
add esp, 4
push eax
call fcn.10003b50
add esp, 0xc
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
call eax
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
call fcn.10004110
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret