L33TSig 2 Logo
Personal tools



Writing Plugins

From L33TSig Wiki

Jump to: navigation, search

This should eventually become an easy-to-follow guide on how to create a plugin for L33TSig 2 or L33TSig for Linux. Please bare with us while it's polished off :-)

Please note that where it says "L33TSig 2", it can also mean "L33TSig for Linux", however there is a more specific guide to writing Writing Linux Plugins.

Contents

Creating Plugins

For a plugin to be usable by L33TSig 2, it must have 3 essential functions, each returning a String (PChar in Delphi). Those functions are Desc(), ShortDesc() and GetLine(). However, you can have as many other functions as you like.

NOTICE: The construction of the GetLine() function will probably change once L33TSig 2 and L33TSig for Linux pass the user's text to them.
Desc()
This function returns a description of the plugin used in the plugin list.

ShortDesc()
This function returns the name of the plugin in the list of selectable line types.

GetLine()
This is the function that actually returns the line to be used in the signature.

GetLine(strUsersLine = "")
This is the function that actually returns the line to be used in the signature.
After the change, the function will probably be like this, rather than the above function.
You can either parse the incoming text, if you want the user to be able to enter variables and the like, or you can ignore it and simply return whatever your plugin does.


L33TSig 2 currently supports 3 types of plugins:

  • JavaScript (.js)
  • VisualBasicScript (.vbs)
  • Dynamic Link Library (.dll)
    • Note: ActiveX DLLs (Such as those created in Visual Basic 6) are NOT compatible

Example Code

VBS

Function Desc()
   Desc = "A test VB plugin"
End Function

Function ShortDesc()
   ShortDesc = "Test VB"
End Function

Function GetLine()
   GetLine = "Testing VB!"
End Function


JavaScript

function Desc() {
   return "A test JavaScript plugin!";
}

function ShortDesc() {
   return "Test JavaScript";
}

function GetLine() {
   return "A JavaScript test";
}


Delphi

library test;

uses
  SysUtils,
  Classes;

{$R *.res}

function Desc: PChar; stdcall;
begin
   Result := 'A test Delphi plugin';
end;

function ShortDesc: PChar; stdcall;
begin
   Result := 'Test Delphi';
end;

function GetLine: PChar; stdcall;
begin
   Result := 'A test plugin for L33TSig 2/Windows';
end;

exports
  Desc,
  ShortDesc,
  GetLine;
end.