Function at 0x4a5ec2
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2e8
push ebx
push esi
push edi
mov esi, 0x150
xor edi, edi
push esi
lea eax, [ebp - 0x2e4]
push edi
push eax
mov dword [ebp - 0x2c], edi
call sub.MSVCR80.dll_memset
add esp, 0xc
push dword [ebp + 8]
mov dword [ebp - 0x2e4], esi
call fcn.004a5e4d
pop ecx
mov esi, eax
push 0x40
lea eax, [ebp - 0x9c]
push edi
push eax
mov dword [ebp - 0x20], esi
call sub.MSVCR80.dll_memset
mov ebx, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
add esp, 0xc
push edi
push 0x40
lea eax, [ebp - 0x9c]
push eax
push esi
push dword [ebp + 8]
call ebx
test eax, eax
je 0x4a642c
push 0x40
lea eax, [ebp - 0x9c]
push eax
lea eax, [ebp - 0x2d0]
push eax
call sub.MSVCR80.dll_memcpy
add esp, 0xc
cmp word [ebp - 0x9c], 0x5a4d
mov dword [ebp - 0x2e0], esi
jne 0x4a642c
mov edi, pe_nt_image_headers32
push edi
lea eax, [ebp - 0x194]
push 0
push eax
call sub.MSVCR80.dll_memset
add esp, 0xc
push 0
push edi
lea eax, [ebp - 0x194]
push eax
mov eax, dword [ebp - 0x60]
add eax, esi
push eax
push dword [ebp + 8]
call ebx
test eax, eax
je 0x4a642c
push edi
lea eax, [ebp - 0x194]
push eax
lea eax, [ebp - 0x290]
push eax
call sub.MSVCR80.dll_memcpy
mov eax, dword [ebp - 0x60]
add esp, 0xc
cmp dword [ebp - 0x194], 0x4550
lea ecx, [eax + esi]
mov dword [ebp - 0x2dc], ecx
jne 0x4a642c
xor edi, edi
cmp dword [ebp - 0x114], edi
je 0x4a642c
cmp word [ebp - 0x18e], di
movzx ecx, word [ebp - 0x180]
mov dword [ebp - 0xc4], edi
mov dword [ebp - 0xc0], edi
mov dword [ebp - 0x18], edi
lea eax, [ecx + eax + 0x18]
mov dword [ebp - 8], edi
jbe 0x4a606f
add eax, esi
mov dword [ebp - 0xc], eax
push 0x28
lea eax, [ebp - 0x58]
push edi
push eax
call sub.MSVCR80.dll_memset
add esp, 0xc
push edi
push 0x28
lea eax, [ebp - 0x58]
push eax
push dword [ebp - 0xc]
push dword [ebp + 8]
call ebx
test eax, eax
je 0x4a642c
cmp dword [ebp - 0xbc], edi
mov eax, dword [ebp - 0x48]
jne 0x4a604f
mov ecx, dword [ebp - 0x4c]
cmp dword [ebp - 0x114], ecx
jb 0x4a604f
lea edx, [eax + ecx]
xor edi, edi
cmp dword [ebp - 0x114], edx
jae 0x4a604f
mov dword [ebp - 0xbc], ecx
mov dword [ebp - 0xb8], eax
mov ecx, dword [ebp - 0x44]
add eax, ecx
cmp dword [ebp - 0x18], eax
jae 0x4a605c
mov dword [ebp - 0x18], eax
movzx eax, word [ebp - 0x18e]
inc dword [ebp - 8]
add dword [ebp - 0xc], 0x28
cmp dword [ebp - 8], eax
jb 0x4a5ffa
push esi
push dword [ebp + 8]
lea ebx, [ebp - 0x194]
call fcn.004a5c7d
mov ebx, dword [ebp + 0x10]
mov edi, dword [ebp + 0x10]
imul ebx, ebx, 0x14
and dword [ebp - 8], 0
movzx eax, ax
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x110]
lea eax, [eax + ebx + 7]
and eax, 0xfffffff8
shl edi, 4
add edi, eax
cmp dword [ebp + 0x10], 0
pop ecx
pop ecx
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x14], edi
jbe 0x4a60d4
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
push dword [eax + ecx*4]
call sub.MSVCR80.dll_strlen
add eax, 4
and eax, 0xfffffffc
add dword [ebp - 0x14], eax
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp eax, dword [ebp + 0x10]
pop ecx
jb 0x4a60b1
push dword [ebp - 0x14]
call sub.MSVCR80.dll_void____cdecl_operator_new_unsigned_int_
test eax, eax
pop ecx
mov dword [ebp - 0xc], eax
je 0x4a642c
push dword [ebp - 0x14]
push 0
push eax
call sub.MSVCR80.dll_memset
mov eax, dword [ebp - 0x174]
mov edx, dword [ebp - 0x170]
add eax, edx
add eax, dword [ebp - 0x178]
add esp, 0xc
add eax, dword [ebp - 0x168]
mov ecx, esi
add eax, esi
cmp esi, eax
jae 0x4a611a
mov ecx, eax
push dword [ebp - 0x14]
push ecx
push dword [ebp + 8]
call fcn.004a5d0e
add esp, 0xc
test eax, eax
mov dword [ebp - 0x28], eax
je 0x4a6423
and dword [ebp - 0x10], 0
and dword [ebp - 0x2d4], 0
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x114]
push 0x40
push dword [ebp - 0x110]
add eax, esi
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x4a6423
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x2d4], eax
mov eax, dword [ebp - 0x28]
sub eax, esi
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0xc]
push 0
push dword [ebp - 0x110]
add ebx, eax
mov eax, dword [ebp - 0x114]
push ebx
add eax, esi
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x4a6423
xor ebx, ebx
cmp dword [ebp + 0x10], ebx
mov dword [ebp - 8], ebx
jbe 0x4a6242
mov ebx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0xc]
mov eax, dword [ebp - 0x24]
add esi, 4
add eax, ebx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0xc]
lea ebx, [ebx + eax + 4]
mov ecx, dword [ebp - 8]
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp - 0xc]
lea eax, [eax + ecx*4]
mov ecx, dword [ebp - 0x14]
add edx, edi
push edx
mov edx, dword [eax]
sub ecx, edi
mov dword [ebp - 0x30], eax
call fcn.004a5bb6
test eax, eax
jl 0x4a6423
mov eax, dword [ebp - 0x1c]
mov dword [esi - 4], eax
xor edx, edx
mov dword [ebx], edx
add eax, 8
mov ecx, SysReAllocStringLen
mov dword [ebx - 4], ecx
mov dword [esi + 0xc], eax
mov eax, dword [ebp - 0x24]
mov dword [ebx + 4], ecx
mov dword [ebx + 8], edx
add eax, edi
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x30]
push dword [eax]
mov dword [esi], edx
mov dword [esi + 4], edx
call sub.MSVCR80.dll_strlen
add dword [ebp - 0x1c], 0x10
add eax, 4
and eax, 0xfffffffc
add edi, eax
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
add ebx, 0x10
add esi, 0x14
cmp eax, dword [ebp + 0x10]
pop ecx
jb 0x4a61c4
mov esi, dword [ebp - 0x20]
xor ebx, ebx
mov eax, dword [ebp - 0x110]
push 0x14
xor edx, edx
pop ecx
div ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 8], ebx
add ecx, eax
cmp ecx, ebx
jbe 0x4a6272
mov eax, dword [ebp - 0xc]
cmp dword [eax], ebx
jne 0x4a6267
cmp dword [eax + 0x10], ebx
je 0x4a6272
inc dword [ebp - 8]
add eax, 0x14
cmp dword [ebp - 8], ecx
jb 0x4a625e
push ebx
push edi
push dword [ebp - 0xc]
mov edi, dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push dword [ebp - 0x28]
push dword [ebp + 8]
call edi
test eax, eax
je 0x4a6423
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x114], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x110], eax
mov eax, dword [ebp - 0xac]
cmp eax, ebx
je 0x4a6339
cmp dword [ebp - 0xa8], ebx
je 0x4a6339
push 0
lea ebx, [eax + esi]
push 0x14
lea eax, [ebp - 0x44]
push eax
push ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x4a6423
lea eax, [ebx + 0x10]
mov dword [ebp - 0x2d8], eax
mov eax, dword [ebp - 0x34]
and dword [ebp - 0x34], 0xfffffffe
mov dword [ebp - 0x198], eax
lea eax, [ebp - 0x10]
push eax
push 4
push 0x14
push ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x4a6423
push 0
push 0x14
lea eax, [ebp - 0x44]
push eax
push ebx
push dword [ebp + 8]
call edi
test eax, eax
je 0x4a6423
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x10]
push 0x14
push ebx
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x4a6423
xor ebx, ebx
lea eax, [ebp - 0x10]
push eax
push 0x40
push dword [ebp - 0x140]
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x4a6423
push ebx
push 0x40
lea eax, [ebp - 0x9c]
push eax
push esi
push dword [ebp + 8]
mov word [ebp - 0x80], bx
call edi
test eax, eax
je 0x4a6423
push ebx
push pe_nt_image_headers32
lea eax, [ebp - 0x194]
push eax
mov eax, dword [ebp - 0x60]
add eax, esi
push eax
push dword [ebp + 8]
call edi
test eax, eax
je 0x4a6423
push esi
push dword [ebp + 8]
lea ebx, [ebp - 0x194]
call fcn.004a5c7d
movzx eax, ax
cmp ax, word [ebp - 0x18]
pop ecx
pop ecx
sbb ecx, ecx
neg ecx
add cx, word [ebp - 0x18]
mov dword [ebp - 0x20], eax
sub ax, cx
cmp word [ebp - 0x80], ax
push 0
push 0x40
sbb ecx, ecx
neg ecx
add cx, ax
sub word [ebp - 0x80], cx
lea eax, [ebp - 0x9c]
push eax
push esi
push dword [ebp + 8]
call edi
test eax, eax
je 0x4a6423
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x10]
push dword [ebp - 0x140]
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x4a6423
push esi
push dword [ebp + 8]
call fcn.004a5c7d
cmp word [ebp - 0x18], ax
pop ecx
pop ecx
jne 0x4a6423
lea eax, [ebp - 0x2e4]
push eax
push dword [ebp + 8]
call fcn.004a64a2
test eax, eax
je 0x4a6423
mov dword [ebp - 0x2c], 1
push dword [ebp - 0xc]
call sub.MSVCR80.dll_void___cdecl_operator_delete_void__
pop ecx
mov eax, dword [ebp - 0x2c]
pop edi
pop esi
pop ebx
leave
ret