Using OgProtectExe from tponguard

和自甴很熟 提交于 2019-12-13 02:46:54

问题


Can anyone show me a simple example how this component is used.Thanks


回答1:


In your application (the one you want to protect by embedding a CRC), drop an OgProtectExe component. Use the Object Inspector to add a handler for it's single event (OnChecked, if I remember correctly). The handler should contain something like this:

procedure TForm1.OgProtectExe1Checked(Sender: TObject; Status: TExeStatus);
begin
  if (Status <> exeSuccess) then // CRC changed
    // Handle modified executable
end;

Possible TExeStatus values are:

exeSuccess         - CRC is OK
exeSizeError       - File size has changed
exeIntegrityError  - CRC doesn't match
exeNotStamped      - Executable not stamped

Build your application as usual. Use StampExe (from the OnGuard examples\Delphi folder) to stamp your executable with the CRC (or write your own app that calls the OgProExe unit's ProtectExe function to stamp it).

ProtectExe takes two parameters - the full path and filename of the executable to protect, and a boolean that indicates whether or not it should remove it's special marker after protecting. You should pass True unless you want to have the ability to unprotect the executable afterwards.

uses
  OgProExe;

...
if ProtectExe(YourExeName, EraseMarker) then  // executable stamped


来源:https://stackoverflow.com/questions/10261227/using-ogprotectexe-from-tponguard

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!