Function at 0x5981ccec
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
mov ecx, 0x23
push 0
push 0
dec ecx
jne 0x5981ccf4
push ecx
push ebx
push esi
push edi
mov byte [ebp - 0x81], al
lea eax, [ebp - 0x40]
mov edx, dword [sym.imp.madDisAsm_.bpl___xp_23Maddisasm_TFunctionInfo]
call sub.rtl120.bpl__System__InitializeRecord_qqrpvt1
lea eax, [ebp - 0x80]
mov edx, dword [sym.imp.madDisAsm_.bpl___xp_23Maddisasm_TFunctionInfo]
call sub.rtl120.bpl__System__InitializeRecord_qqrpvt1
xor eax, eax
push ebp
push 0x5981d4d2
push dword fs:[eax]
mov dword fs:[eax], esp
cmp dword [sym.madExcept_.bpl__Madexcept_BcbExceptionHandler], 0
je 0x5981cd45
mov eax, dword [sym.madExcept_.bpl__Madexcept_BcbExceptionHandler]
cmp eax, dword [sym.madExcept_.bpl__Madexcept_BcbThrowExceptionLDTC]
jne 0x5981cdb1
push 0x5981d4e0
call sub.kernel32.dll_GetModuleHandleW
mov ebx, eax
test ebx, ebx
jne 0x5981cd61
push 0x5981d4fc
call sub.kernel32.dll_GetModuleHandleW
mov ebx, eax
push 0x5981d514
push ebx
call fcn.59801964
mov dword [sym.madExcept_.bpl__Madexcept_BcbExceptionHandler], eax
push 0x5981d540
push ebx
call fcn.59801964
mov dword [sym.madExcept_.bpl__Madexcept_BcbThrowExceptionLDTC], eax
push 0x5981d594
push ebx
call fcn.59801964
mov dword [sym.madExcept_.bpl__Madexcept_BcbOrgMalloc], eax
push 0x5981d5a4
push ebx
call fcn.59801964
mov dword [sym.madExcept_.bpl__Madexcept_BcbPTerminate], eax
push 0x5981d5c4
push ebx
call fcn.59801964
mov dword [sym.madExcept_.bpl__Madexcept_BcbVclClearEH], eax
cmp dword [sym.madExcept_.bpl__Madexcept_BcbExceptionHandler], 0
je 0x5981d491
cmp dword [sym.madExcept_.bpl__Madexcept_BcbThrowExceptionLDTC], 0
je 0x5981d491
cmp dword [sym.madExcept_.bpl__Madexcept_BcbOrgMalloc], 0
je 0x5981d491
cmp dword [sym.madExcept_.bpl__Madexcept_BcbPTerminate], 0
jne 0x5981cdee
cmp dword [sym.madExcept_.bpl__Madexcept_BcbCallTerminate], 0
je 0x5981d491
mov eax, dword [sym.imp.madDisAsm_.bpl__Maddisasm_BcbInitExceptBlockLDTC]
mov edx, dword [sym.madExcept_.bpl__Madexcept_BcbInitExceptBlockLDTC]
mov dword [eax], edx
lea edx, [ebp - 0xb8]
mov eax, dword [sym.madExcept_.bpl__Madexcept_BcbExceptionHandler]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
lea edx, [ebp - 0x40]
mov eax, dword [sym.madExcept_.bpl__Madexcept_BcbExceptionHandler]
call sub.madDisAsm_.bpl__Maddisasm_ParseFunction_qqrpv
mov eax, dword [ebp - 0x20]
call sub.rtl120.bpl__System__DynArrayHigh_qqrv
mov esi, eax
dec esi
test esi, esi
jl 0x5981cebc
inc esi
xor ebx, ebx
mov edi, ebx
add edi, edi
add edi, edi
add edi, edi
sub edi, ebx
mov eax, dword [ebp - 0x20]
cmp dword [eax + edi*4 + 0xc], 0
je 0x5981ceb4
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + eax*4 + 0xc]
mov edx, dword [ebp - 0x20]
cmp eax, dword [edx + edi*4 + 0x28]
jne 0x5981ceb4
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + edi*4 + 8]
lea edx, [ebp - 0xb8]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
cmp word [ebp - 0xb6], 0x8b
jne 0x5981ceb4
movzx eax, byte [ebp - 0xb4]
sub al, 0x80
je 0x5981ce8c
sub al, 8
je 0x5981ce8c
sub al, 8
jne 0x5981ceb4
mov eax, dword [ebp - 0x9c]
add eax, 2
mov eax, dword [eax]
mov dword [0x5985724c], eax
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + eax*4 + 0xc]
mov dword [0x59857250], eax
jmp 0x5981cebc
inc ebx
dec esi
jne 0x5981ce2e
cmp dword [0x59857250], 0
je 0x5981d228
lea edx, [ebp - 0x40]
mov eax, dword [sym.madExcept_.bpl__Madexcept_BcbThrowExceptionLDTC]
call sub.madDisAsm_.bpl__Maddisasm_ParseFunction_qqrpv
mov eax, dword [ebp - 0x20]
call sub.rtl120.bpl__System__DynArrayLength_qqrv
dec eax
jne 0x5981d228
lea edx, [ebp - 0xf8]
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0xc]
call sub.madDisAsm_.bpl__Maddisasm_ParseFunction_qqrpv
lea edx, [ebp - 0xf8]
lea eax, [ebp - 0x40]
mov ecx, dword [sym.imp.madDisAsm_.bpl___xp_23Maddisasm_TFunctionInfo]
call sub.rtl120.bpl__System__CopyRecord_qqrv
mov eax, sub.kernel32.dll_RaiseException
mov dword [ebp - 0x90], eax
mov eax, dword [ebp - 0x90]
cmp word [eax], 0x25ff
jne 0x5981cf35
mov eax, dword [ebp - 0x90]
add eax, 2
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x90], eax
xor eax, eax
mov dword [ebp - 0x88], eax
mov eax, dword [ebp - 0x20]
call sub.rtl120.bpl__System__DynArrayHigh_qqrv
mov esi, eax
test esi, esi
jl 0x5981d092
inc esi
xor ebx, ebx
mov edi, ebx
add edi, edi
add edi, edi
add edi, edi
sub edi, ebx
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + edi*4 + 0xc]
cmp eax, dword [ebp - 0x90]
jne 0x5981cfd3
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + edi*4 + 4]
sub eax, 4
cmp dword [eax], 0xeefface
jne 0x5981d08a
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + edi*4 + 4]
lea edx, [ebp - 0xb8]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
cmp dword [ebp - 0xa4], 4
jne 0x5981d08a
cmp byte [ebp - 0xb1], 0
je 0x5981d08a
mov eax, dword [ebp - 0xb0]
mov dword [0x59858080], eax
mov edx, 0x5981cb0c
sub edx, dword [ebp - 0x98]
mov eax, dword [ebp - 0xac]
call sym.madExcept_.bpl__Madexcept_PatchInt_qqrpvi
jmp 0x5981d08a
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + eax*4 + 0xc]
lea edx, [ebp - 0xb8]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
jmp 0x5981d074
mov eax, dword [ebp - 0xb0]
cmp eax, dword [sym.madExcept_.bpl__Madexcept_BcbOrgMalloc]
jne 0x5981d04e
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + eax*4 + 0xc]
mov dword [ebp - 0x88], eax
cmp dword [ebp - 0xa4], 4
jne 0x5981d08a
cmp byte [ebp - 0xb1], 0
je 0x5981d08a
mov eax, dword [ebp - 0xb0]
mov dword [0x59858078], eax
mov edx, 0x5981c998
sub edx, dword [ebp - 0x98]
mov eax, dword [ebp - 0xac]
call sym.madExcept_.bpl__Madexcept_PatchInt_qqrpvi
jmp 0x5981d08a
lea edx, [ebp - 0x11c]
mov eax, dword [ebp - 0x98]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
push esi
lea esi, [ebp - 0x11c]
lea edi, [ebp - 0xb8]
mov ecx, 9
rep movsd dword es:[edi], dword [esi]
pop esi
movzx eax, word [ebp - 0xb6]
add eax, 0xffffff3e
sub ax, 2
jae 0x5981cff4
inc ebx
dec esi
jne 0x5981cf52
cmp dword [ebp - 0x88], 0
je 0x5981d228
lea edx, [ebp - 0x40]
mov eax, dword [sym.madExcept_.bpl__Madexcept_BcbExceptionHandler]
call sub.madDisAsm_.bpl__Maddisasm_ParseFunction_qqrpv
mov eax, dword [ebp - 0x20]
call sub.rtl120.bpl__System__DynArrayHigh_qqrv
mov esi, eax
test esi, esi
jl 0x5981d228
inc esi
xor ebx, ebx
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + eax*4 + 0xc]
lea edx, [ebp - 0x80]
call sub.madDisAsm_.bpl__Maddisasm_ParseFunction_qqrpv
mov eax, dword [ebp - 0x60]
call sub.rtl120.bpl__System__DynArrayHigh_qqrv
mov edi, eax
test edi, edi
jl 0x5981d220
inc edi
mov dword [ebp - 0x8c], 0
mov eax, dword [ebp - 0x8c]
mov edx, eax
add eax, eax
add eax, eax
add eax, eax
sub eax, edx
mov edx, dword [ebp - 0x60]
mov eax, dword [edx + eax*4 + 0xc]
cmp eax, dword [ebp - 0x88]
jne 0x5981d213
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + eax*4 + 8]
lea edx, [ebp - 0xb8]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
cmp word [ebp - 0xb6], 0x83
jne 0x5981d213
cmp byte [ebp - 0xb4], 0xc4
jne 0x5981d213
mov eax, dword [ebp - 0x9c]
movzx eax, byte [eax + 2]
sub al, 0x10
je 0x5981d169
sub al, 8
je 0x5981d1c2
jmp 0x5981d213
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + eax*4 + 4]
lea edx, [ebp - 0xb8]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
cmp dword [ebp - 0xa4], 4
jne 0x5981d220
cmp byte [ebp - 0xb1], 0
je 0x5981d220
mov eax, dword [ebp - 0xb0]
mov dword [0x5985807c], eax
mov edx, 0x5981ca8c
sub edx, dword [ebp - 0x98]
mov eax, dword [ebp - 0xac]
call sym.madExcept_.bpl__Madexcept_PatchInt_qqrpvi
jmp 0x5981d220
mov eax, ebx
add eax, eax
add eax, eax
add eax, eax
sub eax, ebx
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + eax*4 + 4]
lea edx, [ebp - 0xb8]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
cmp dword [ebp - 0xa4], 4
jne 0x5981d220
cmp byte [ebp - 0xb1], 0
je 0x5981d220
mov eax, dword [ebp - 0xb0]
mov dword [0x59858084], eax
mov edx, 0x5981cb94
sub edx, dword [ebp - 0x98]
mov eax, dword [ebp - 0xac]
call sym.madExcept_.bpl__Madexcept_PatchInt_qqrpvi
jmp 0x5981d220
inc dword [ebp - 0x8c]
dec edi
jne 0x5981d0f7
inc ebx
dec esi
jne 0x5981d0c1
cmp byte [ebp - 0x81], 0
je 0x5981d3b0
call fcn.5981ccd8
lea edx, [ebp - 0xb8]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
jmp 0x5981d26b
lea edx, [ebp - 0x11c]
mov eax, dword [ebp - 0x98]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
lea esi, [ebp - 0x11c]
lea edi, [ebp - 0xb8]
mov ecx, 9
rep movsd dword es:[edi], dword [esi]
cmp byte [ebp - 0xb8], 0
je 0x5981d2b1
movzx eax, word [ebp - 0xb6]
add eax, 0xffffff3e
sub ax, 2
jb 0x5981d2b1
cmp word [ebp - 0xb6], 0x89
jne 0x5981d247
mov eax, dword [ebp - 0x9c]
inc eax
cmp dword [eax], 0x24448bc2
jne 0x5981d247
mov eax, dword [ebp - 0x9c]
add eax, 5
cmp dword [eax], 0xc488b04
jne 0x5981d247
cmp byte [ebp - 0xb8], 0
je 0x5981d3b0
movzx eax, word [ebp - 0xb6]
add eax, 0xffffff3e
sub ax, 2
jb 0x5981d3b0
mov eax, dword [ebp - 0x9c]
mov dword [ebp - 0x90], eax
lea edx, [ebp - 0x11c]
mov eax, dword [ebp - 0x98]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
lea esi, [ebp - 0x11c]
lea edi, [ebp - 0xb8]
mov ecx, 9
rep movsd dword es:[edi], dword [esi]
jmp 0x5981d32a
lea edx, [ebp - 0x11c]
mov eax, dword [ebp - 0x98]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
lea esi, [ebp - 0x11c]
lea edi, [ebp - 0xb8]
mov ecx, 9
rep movsd dword es:[edi], dword [esi]
cmp byte [ebp - 0xb8], 0
je 0x5981d370
movzx eax, word [ebp - 0xb6]
add eax, 0xffffff3e
sub ax, 2
jb 0x5981d370
cmp word [ebp - 0xb6], 0x89
jne 0x5981d306
mov eax, dword [ebp - 0x9c]
inc eax
cmp dword [eax], 0x24448bc2
jne 0x5981d306
mov eax, dword [ebp - 0x9c]
add eax, 5
cmp dword [eax], 0xc488b04
jne 0x5981d306
cmp byte [ebp - 0xb8], 0
je 0x5981d397
movzx eax, word [ebp - 0xb6]
add eax, 0xffffff3e
sub ax, 2
jb 0x5981d397
mov eax, dword [ebp - 0x9c]
mov dword [ebp - 0x90], eax
cmp dword [ebp - 0x90], 0
je 0x5981d3b0
mov edx, 0x5981cc34
mov eax, dword [ebp - 0x90]
call fcn.59844e3c
cmp dword [sym.madExcept_.bpl__Madexcept_BcbPTerminate], 0
je 0x5981d3c6
mov eax, dword [sym.madExcept_.bpl__Madexcept_BcbPTerminate]
mov dword [eax], 0x5981cc58
jmp 0x5981d3d5
mov edx, 0x5981cc58
mov eax, dword [sym.madExcept_.bpl__Madexcept_BcbCallTerminate]
call sym.madExcept_.bpl__Madexcept_PatchJmp_qqrpvt1
cmp dword [sym.madExcept_.bpl__Madexcept_BcbVclClearEH], 0
je 0x5981d491
lea edx, [ebp - 0xb8]
mov eax, dword [sym.madExcept_.bpl__Madexcept_BcbVclClearEH]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
mov ebx, 5
lea edx, [ebp - 0x11c]
mov eax, dword [ebp - 0x98]
call sub.madDisAsm_.bpl__Maddisasm_ParseCode_qqrpv
lea esi, [ebp - 0x11c]
lea edi, [ebp - 0xb8]
mov ecx, 9
rep movsd dword es:[edi], dword [esi]
dec ebx
jne 0x5981d3f7
cmp byte [ebp - 0xb8], 0
je 0x5981d491
mov eax, dword [ebp - 0x9c]
cmp word [eax], 0x33ff
jne 0x5981d491
mov eax, dword [ebp - 0x98]
add eax, 6
cmp byte [eax], 0x59
jne 0x5981d491
lea eax, [ebp - 0x94]
push eax
push 0x40
mov esi, dword [ebp - 0x98]
mov edi, esi
add edi, 7
mov eax, edi
sub eax, dword [sym.madExcept_.bpl__Madexcept_BcbVclClearEH]
push eax
mov ebx, dword [ebp - 0x9c]
push ebx
call sub.kernel32.dll_VirtualProtect
mov word [ebx], 0x38b
add esi, 6
mov byte [esi], 0x90
lea eax, [ebp - 0x94]
push eax
mov eax, dword [ebp - 0x94]
push eax
sub edi, dword [sym.madExcept_.bpl__Madexcept_BcbVclClearEH]
push edi
push ebx
call sub.kernel32.dll_VirtualProtect
push 0
push 0
call sub.kernel32.dll_GetCurrentProcess
push eax
call sub.kernel32.dll_FlushInstructionCache
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5981d4d9
lea eax, [ebp - 0xf8]
mov edx, dword [sym.imp.madDisAsm_.bpl___xp_23Maddisasm_TFunctionInfo]
call sub.rtl120.bpl__System__FinalizeRecord_qqrpvt1
lea eax, [ebp - 0x80]
mov edx, dword [sym.imp.madDisAsm_.bpl___xp_23Maddisasm_TFunctionInfo]
mov ecx, 2
call sub.rtl120.bpl__System__FinalizeArray_qqrpvt1ui
ret