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;
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:
...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:
How to combine and synchronize VMProtectDecryptStringA with Jorlen Young’s EncryptString function ? When i try to use: