Howdy All,
I want to use
VMProtect's Markers to mark blocks of the code containing string constants that should be protected.
uses VMProtectSDK;
VMProtectBegin(MARKER_NAME);
...
VMProtectEnd;
procedure TForm1.Button1Click(Sender: TObject);
begin
VMProtectBegin('Test marker');
if StrToIntDef(Edit1.Text, 0) mod 17=13 then
MessageDlg(VMProtectDecryptStringA('Correct password'), mtInformation, [mbOK], 0)
else
begin
MessageDlg(VMProtectDecryptStringA('Incorrect password'), mtError, [mbOK], 0);
Edit1.SetFocus;
end;
VMProtectEnd;
end;
I tried to implement it :
procedure TForm1.IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
var Payload, Host, Header, Krypt1, Krypt2:String;
begin
VMProtectBegin
('Krypt1 := EncryptString('website.com', 'pwd');'+sLineBreak+
'Krypt2 := EncryptString('website.net', 'pwd');');
VMProtectEnd;
if (pos('CONNECT',athread.NetData)<>0) or (pos('HTTP',athread.NetData)<>0) then begin
if host.Text = 'Host' then begin
Payload := 'GET http://'+Krypt1+'/ HTTP/1.1'+#13#10;
Host := AddHeader(AThread.NetData,'Host: '+Krypt2+''#13#10);
AThread.NetData := Payload+Host;
end;
end;
end;
But I got some errors:
[Error] Unit1.pas(xxx): ')' expected but identifier 'website' found
[Error] Unit1.pas(xxx): Missing operator or semicolon
[Error] Unit1.pas(xxx): Missing operator or semicolon
[Error] Unit1.pas(xxx): Missing operator or semicolon
[Error] Unit1.pas(xxx): Statement expected, but expression of type 'String' found
[Error] Unit1.pas(xxx): ';' expected but 'IF' found
[Error] Unit1.pas(xxx): Undeclared identifier: 'host'
[Error] Unit1.pas(xxx): Undeclared identifier: 'Payload'
[Error] Unit1.pas(xxx): Undeclared identifier: 'Krypt2'
[Error] Unit1.pas(xxx): Undeclared identifier: 'Host'
[Error] Unit1.pas(xxx): Undeclared identifier: 'AThread'
[Error] Unit1.pas(xxx): 'END' expected but ',' found
[Error] Unit1.pas(xxx): '.' expected but ';' found
[Error] Unit1.pas(xxx): Identifier redeclared: 'Finalization'
[Error] Unit1.pas(xxx): Incompatible types: 'String' and 'Integer'
[Error] Unit1.pas(xxx): Not enough actual parameters
[Warning] Unit1.pas(xxx): Text after final 'END.' - ignored by compiler
[Fatal Error] Project1.dpr(5): Could not compile used unit 'Unit1.pas'
Also, tried :
VMProtectBegin(nil);
Krypt1 := EncryptString('website.com', 'pwd');
Krypt2 := EncryptString('website.net', 'pwd');
VMProtectEnd;
Althought, no error found, but VMProtect unable to hide and protect my string.
How to resolve this problem ? and I asking you to teach me how to write the line of code.
I would appreciate any help.
Cheers,
J