This unit has been coded to facilitate simple use of the otherwise advanced "Func In" technique. Functions can be written normally. This version also supports: + Static strings + Functions calls + Parameters Client Example: program Client; //Voik uses Windows, VoikClientFuncIn; function IsDebuggerPresent(): Boolean; stdcall; external kernel32 name 'IsDebuggerPresent'; procedure AntiDebugger1(Parameters: Pointer); stdcall; begin if IsDebuggerPresent() then ExitProcess(0); end; procedure AntiDebugger2(Parameters: Pointer); stdcall; begin OutputDebugString('%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s'); end; procedure ShowMessage(Parameters: Pointer); stdcall; begin MessageBox(0, pChar(Parameters), 'Voik', MB_OK); end; const MSG = 'No debbuger!'; var FuncIn: TVoikFuncIn; begin FuncIn := TVoikFuncIn.Create('Stub.exe'); FuncIn.AddFunction(AntiDebugger1); FuncIn.AddFunction(AntiDebugger2); FuncIn.AddFunction(ShowMessage, pChar(MSG), Length(MSG) + 1); FuncIn.SaveFunctions(); end. Respective Server Example: program Stub; //Voik uses VoikServerFuncIn; begin VoikFuncIn(); end. Only delphi source code is included in the archive. |
Delphi Basics - Free Delphi Source Code - Ultimate Programming Resource > Delphi Basics Snippets >