Remote function call


Remote function execution (server side, inside LAC) allows your to protect the program having taken out an important code to the server (which actually makes the impossibility of cracking your software).


License Activation Center supports seven types of functions:




Every function have calling restrictions:




How to implement "Call .NET function from assembly" (C# example)?

Create new managed dll and declare NOT STATIC class with NOT STATIC method:
namespace rpc_managed
{
 public class rpc_class
 {
  public byte[] rpc_method(int inUserId, int inFnId, byte[] inBuf)
  {
   return new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
  }
 }
}


Function accept 3 parameters: inUserId - user id that call this function, inFnId - function id, inBuf byte buffer from protected application. Method always return byte array, LAC doesn't check anything and returns this byte array to protected application.





How to implement "Call native function from library" (Delphi example)?

Create new dll and declare function:

library native_test;
uses Winapi.Windows;

function native_fn(inUserId:Int64; inFnId:Int64; var inBuf:Pointer; var inBufSize:Int64):Int64;stdcall;
var
 b : PByte;
begin
 Result:=1;
 inBufSize:=10;
 inBuf:= Pointer(GlobalAlloc(GMEM_FIXED, 10));
 b:=inBuf;
 b^:=0; Inc(b); b^:=1; Inc(b); b^:=2; Inc(b); b^:=3; Inc(b); b^:=4;
 Inc(b); b^:=5; Inc(b); b^:=6; Inc(b); b^:=7; Inc(b); b^:=8; Inc(b); b^:=9;
end;

exports native_fn;


Function accept 4 parameters: inUserId - user id that call this function, inFnId - function id, inBuf byte buffer from protected application, inBufSize - income buffer size. Function return byte array via inBuf and inBufSize, LAC doesn't check anything and returns this byte array to protected application. Output inBuf MUST BE ALLOCATED VIA GlobalAlloc otherwise LAC can not FREE MEMORY after function call.





How to call LAC function from protected application?

It's simple use function ppiExecFn from PPI-SDK, see details here.



Is it possible to use this call scheme: native application < -- > LAC < -- > .NET function?

Yes, it will work without problems.