» blackbox sdk
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

blackbox sdk

acl(admin devvvv vvvvgroup)

the blackbox SDK allows developers to load encrypted patches.
vvvv looks on startup if a certain 'Decrypt.dll' is in the '/bin' directory. if so, it loads the dll and links 4 methods the dll must provide:

begin
 
 //assign dll handle
 DLLHandle := LoadLibrary('..\Decrypt.dll');
 
 if DLLHandle <> 0 then
 begin
   @Init    := GetProcAddress(DLLHandle, 'Init');
   @Decrypt := GetProcAddress(DLLHandle, 'Decrypt');
   @Tick    := GetProcAddress(DLLHandle, 'Tick');
   @GetErrorString := GetProcAddress(DLLHandle, 'GetErrorString');
 end;
end;

the dll has to declare the functions as follows:

function Init: Integer; stdcall;
 
begin
  //init decrytion system, called by vvvv only once on startup
 
  Result := 0; //tell vvvv everything is ok
end;
 
 
// check if still valid
 
function Tick: Integer; stdcall;
begin
  //this method is called every frame, so be very careful what you do here
 
  Result := 0; //the result of this method is the output of the Blackbox node
end;
 
// get the decrypted patch from file
function Decrypt(const PFileName: Pointer; const FileNameLength: LongWord; PFileContent: Pointer): Integer; stdcall;
 
var
  PDecrypted: PWidestring;
  filename: String;
 
begin
 
  //cast the pointer content to a string
  filename := PString(PFilename)^;
 
  // try to open the file:
 
  // point to the mem location from the caller
  PDecrypted := PFileContent;
 
  //fill the memory location with a decrypted patch xml string
  PDecrypted^ := DecyptFile(filename);
 
  Result := 0; //values below 0 will cause an error and vvvv will display an error message
end;
 
// get the error string whenever Init or Decrypt return values below 0
function GetErrorString(PErrorString: Pointer): Integer; stdcall;
 
var
  PString: PWidestring;
 
begin
 
  Result := 0;
  try
    // point to the mem location from the caller
    PString := PErrorString;
 
    // assign memory
    PString^ := "your human readable error string";
 
  except on E: Exception do
    Result := -100;
  end;
 
end;
 
//dont forget to export the methods
exports Init, Decrypt, Tick, GetErrorString;

anonymous user login

Shoutbox

~2h ago

joreg: The summer season of vvvv workshops at The NODE Institute is out: https://thenodeinstitute.org/ss24-vvvv-intermediates/

~3h ago

domj: If you happen to be in Prague, come join us at the Schema workshop on Thursday 25.4. :) https://www.facebook.com/events/395516526614988/?ti=ls

~12d ago

joreg: Postponed: Next vvvv beginner course starting April 29: https://thenodeinstitute.org/courses/vvvv-beginner-class-summer-2024/

~1mth ago

~1mth ago

joreg: The Winter Season of vvvv workshops is now over but all recordings are still available for purchase: https://thenodeinstitute.org/ws23-vvvv-intermediates/