Okay i decided to write a script to better virtualize the Entry Point. But it doesn't seem to work because P.ExtAddresses.Count is always zero is this an error? or did i do something wrong? BTW i never coded in Delphi so it could be
my fault .
Code: Select all
procedure OnBeforeCompilation;
var A, I:Integer;
Address:Int64;
EA:TExtAddresses;
P:TVMProcedure;
NewP:TVMProcedure;
Instruction:TIntelRecord;
begin
for I := 0 to VMProtector.Count - 1 do
begin
P := VMProtector.Procedures[I];
if P.Name = 'EntryPoint' then
begin
P.IncludedInCompilation := True;
P.CompilationType := ctUltra;
P.CompilationOptions := [coCheckCRC, coEncryptRegs, coEncryptValues];
EA := P.ExtAddresses;
Writeln(Format('Protecting %d additional procedures', [EA.Count]));
for A := 0 to EA.Count - 1 do
begin
Address := EA[A];
Writeln(Format('Adding address %x for protection', [Address]));
NewP := VMProtector.AddByAddress(Address, ctUltra, True);
NewP.CompilationType := ctUltra;
NewP.CompilationOptions := [coCheckCRC, coEncryptRegs, coEncryptValues];
end;
end;
end;
end;