Function at 0x4d5cf4
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe4
push ebx
push esi
push edi
mov ebx, dword [ebp + 8]
xor eax, eax
xor edx, edx
push ebp
push 0x4d5ece
push dword fs:[edx]
mov dword fs:[edx], esp
cmp byte [ebx], 0xe9
jne 0x4d5d24
pop dword fs:[0]
add esp, 8
jmp 0x4d5eda
lea eax, [ebp - 8]
push eax
push 0x28
call sub.kernel32.dll_GetCurrentProcess
push eax
call sub.advapi32.dll_OpenProcessToken
cmp eax, 1
sbb eax, eax
inc eax
test al, al
jne 0x4d5d52
push 0
push 0x4d5ee4
push 0x4d5f00
push 0
call sub.user32.dll_MessageBoxA
lea eax, [ebp - 0x18]
push eax
push 0x4d5f1c
push 0
call sub.advapi32.dll_LookupPrivilegeValueA
cmp eax, 1
sbb eax, eax
inc eax
test al, al
jne 0x4d5d7f
push 0
push 0x4d5f30
push 0x4d5f50
push 0
call sub.user32.dll_MessageBoxA
mov dword [ebp - 0x1c], 1
mov dword [ebp - 0x10], 2
xor eax, eax
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0xc]
push eax
push 0
push 0
lea eax, [ebp - 0x1c]
push eax
push 0
mov eax, dword [ebp - 8]
push eax
call sub.advapi32.dll_AdjustTokenPrivileges
cmp eax, 1
sbb eax, eax
inc eax
test al, al
jne 0x4d5dc6
push 0
push 0x4d5f70
push 0x4d5f70
push 0
call sub.user32.dll_MessageBoxA
mov esi, ebx
mov edi, dword [ebp + 0xc]
sub edi, ebx
sub edi, 5
lea eax, [ebp - 4]
push eax
push 0x40
push 0x19
push esi
call sub.kernel32.dll_VirtualProtect
test eax, eax
je 0x4d5ebb
mov eax, dword [sym.P_Interface.bpl__Codehook_addr_data]
call sub.rtl70.bpl__System__DynArrayLength_qqrv
inc eax
push eax
mov eax, sym.P_Interface.bpl__Codehook_addr_data
mov ecx, 1
mov edx, dword [sym.P_Interface.bpl___xp_20Codehook_CodeHook__1]
call sub.rtl70.bpl__System__DynArraySetLength_qqrv
add esp, 4
mov eax, dword [sym.P_Interface.bpl__Codehook_aValue]
call sub.rtl70.bpl__System__DynArrayLength_qqrv
inc eax
push eax
mov eax, sym.P_Interface.bpl__Codehook_aValue
mov ecx, 1
mov edx, dword [sym.P_Interface.bpl___xp_20Codehook_CodeHook__2]
call sub.rtl70.bpl__System__DynArraySetLength_qqrv
add esp, 4
mov eax, dword [sym.P_Interface.bpl__Codehook_addr_data]
call sub.rtl70.bpl__System__DynArrayLength_qqrv
mov edx, dword [sym.P_Interface.bpl__Codehook_addr_data]
mov dword [edx + eax*4 - 4], esi
xor ebx, ebx
mov eax, dword [sym.P_Interface.bpl__Codehook_aValue]
call sub.rtl70.bpl__System__DynArrayLength_qqrv
imul eax, eax, 0x65
mov edx, dword [sym.P_Interface.bpl__Codehook_aValue]
lea eax, [edx + eax]
lea eax, [eax + ebx - 0x65]
push eax
mov eax, esi
xor edx, edx
push edx
push eax
mov eax, ebx
cdq
add eax, dword [esp]
adc edx, dword [esp + 4]
add esp, 8
mov al, byte [eax]
pop edx
mov byte [edx], al
inc ebx
cmp ebx, 0x65
jne 0x4d5e44
mov eax, 0xff
call sub.rtl70.bpl__System__GetMem_qqri
mov ebx, eax
mov edx, 0xff
mov eax, ebx
call fcn.004021dc
mov edx, ebx
mov eax, esi
call fcn.004d6168
mov byte [esi], 0xe9
mov eax, esi
inc eax
mov dword [eax], edi
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 4]
push eax
push 0x19
push esi
call sub.kernel32.dll_VirtualProtect
mov eax, dword [ebp + 0x10]
mov dword [eax], ebx
mov eax, dword [ebp - 8]
push eax
call sub.kernel32.dll_CloseHandle
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
jmp 0x4d5ed8
mov al, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc