Page 1 of 1

madExcept Package intergrated build bug

Posted: Tue Aug 14, 2018 2:53 pm
by katar1024
:D :D in this situation and other purpuse, I have to compile All Delphi, third party Unit and MadExcept into a single Huge Package, so common bpl such as rtlxxx.bpl and vclxxx.bpl was not used in my Framework. But i was confused that madExcept wasn't worked for a long time, today i have found the reason is retrieving the handle of rtl is not correct.
in madExcept's initialize code that you compare the first entry code of FreeMem, if it equals jmp dword ptr [xxxxxxxx] ($25ff) means it was imported from rtlxxx.bpl,but in the situation of rtl, vcl and madExcept was intergated into a single huge package, the entry code just becomed push ebp and mov ebp, esp ($8b55), and after i have fixed the situation, the madExcept works nicely in my Huge Package Mode as Before, here is my modification, and I'm glad that you will intergrate it into next version.

if ((@System_InitUnits = nil) or // rtlxxx.bpl?
(Forms_TApplication_HandleException = nil) or // vclxxx.bpl?
(Qforms_TApplication_HandleException = nil) or // visualclxxx.bpl?
(FMX_TApplication_HandleException = nil) ) and // fmxxxx.bpl?
hookPackages then begin
p1 := @FreeMemory;
if word(p1^) = $25ff then begin
p1 := TPPointer({$ifdef win64} NativeInt(p1) + 6 + {$endif} TPInteger(NativeUInt(p1) + 2)^)^;
FindModuleA(p1, rtl, s1);
if rtl = HInstance then
rtl := 0;
end
else if word(p1^) = $8b55 then
rtl := FindBpl(hInstance, 'rtl', 40, '@System@FreeMem$qpv');

{$ifdef ver120}
vcl := FindBpl(rtl, 'vcl', 40, '@Forms@TApplication@HandleException$qqrp14System@TObject');
if rtl = 0 then
rtl := FindBpl(vcl, 'rtl', 40, '@System@FreeMem$qpv');
clx := 0;
fmx := 0;
{$else}

best reguards and always have a nice day (*^_^*)

Re: madExcept Package intergrated build bug

Posted: Tue Aug 14, 2018 3:11 pm
by madshi
You had already sent me this via email, and I've already integrated it into madExcept.

Re: madExcept Package intergrated build bug

Posted: Tue Aug 14, 2018 5:44 pm
by katar1024
okay, that's fine
and by the way, i have found two bugs in reading and writing .mes config file
i will post as a new topic later :wink: