Delphi 7 - Encrypt String Constants in Variables

Issues related to VMProtect
Post Reply
Primadonal
Posts: 3
Joined: Wed Apr 01, 2015 10:52 pm

Delphi 7 - Encrypt String Constants in Variables

Post by Primadonal »

Howdy All,

When I try to mark blocks of the code containing string constants that is stored in variables, I got some errors.

I want to knwo how to use the VMProtect's Markers to do that.

My code :

Code: Select all

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;
Admin
Site Admin
Posts: 2585
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Delphi 7 - Encrypt String Constants in Variables

Post by Admin »

Code: Select all

uses VMProtectSDK;

procedure TForm1.IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
var Payload, Host, Header, Krypt1, Krypt2:String;
begin
  if (pos('CONNECT',athread.NetData)<>0) or (pos('HTTP',athread.NetData)<>0) then begin
      if host.Text = 'Host' then begin
          Payload := 'GET http://'+VMProtectDecryptStringA('website.com')+'/ HTTP/1.1'+#13#10;
          Host := AddHeader(AThread.NetData,'Host: '+VMProtectDecryptStringA('website.net')+''#13#10);
          AThread.NetData := Payload+Host;
          end;
      end;
  end;
Primadonal
Posts: 3
Joined: Wed Apr 01, 2015 10:52 pm

Re: Delphi 7 - Encrypt String Constants in Variables

Post by Primadonal »

Howdy,

It's worked, but the URLs still can be sniffed using SmartSniff, view result here.

So, to protect from sniffing I use a password-based AES encryption: Jorlen Young's AES Encryption Code v1.3, and it successfully encrypting URLs, see here and my code implementation is below:

Code: Select all

...Jorlen Young's AES Encryption v1.3 code here...

procedure TForm1.IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
var Payload, Host, Header:String;
begin
AEScrypt1 := EncryptString('website.com', 'password');
AEScrypt2 := EncryptString('website.net', 'password');
  if (pos('CONNECT',athread.NetData)<>0) or (pos('HTTP',athread.NetData)<>0) then begin
      if host.Text = 'Host' then begin
          Payload := 'GET http://'+AEScrypt1+'/ HTTP/1.1'+#13#10;
          Host := AddHeader(AThread.NetData,'Host: '+AEScrypt2+''#13#10);
          AThread.NetData := Payload+Host;
          end;
      end;
  end;
My questions:

1. How to combine and synchronize VMProtectDecryptStringA with Jorlen Young's EncryptString function ? When i try to use:

Code: Select all

Payload := 'GET http://'+AEScrypt+VMProtectDecryptStringA('website.com')+'/ HTTP/1.1'+#13#10;
It results just became:

Code: Select all

GET http://0800000000000000D36CDC9153B71B4550442DBBC0959E30website.com/ HTTP/1.1
2. Or can you tell me how to encrypt URLs from SmartSniff also through VMProtect, like Jorlen Young's code v1.3 did ?

I would appreciate any help. Thank you so much.

Cheers,
Primadonal
Admin
Site Admin
Posts: 2585
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Delphi 7 - Encrypt String Constants in Variables

Post by Admin »

VMProtect can not protect your URLs from sniffing.
Primadonal
Posts: 3
Joined: Wed Apr 01, 2015 10:52 pm

Re: Delphi 7 - Encrypt String Constants in Variables

Post by Primadonal »

Admin wrote:VMProtect can not protect your URLs from sniffing.
Can you add such feature in next update ?

Thank you.
Post Reply