-
Notifications
You must be signed in to change notification settings - Fork 21
Using PawnIO Modules
Read the InstallLocation value from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PawnIO. This will provide you with the path where PawnIO is installed. As a fallback, %ProgramFiles%\PawnIO can be used, as the installer does not allow changing the install path.
Dynamically load PawnIOLib using LoadLibrary or your language's equivalent:
lib = LoadLibrary(InstallLocation + "PawnIOLib");Using GetProcAddress or your language's equivalent, you can resolve the functions exposed by the library:
pawnio_open = GetProcAddress(lib, "pawnio_open");For available functions and their documentation, please refer to `PawnIOLib.h" from the installation.
Head over to Releases and grab the latest one. Select the module binary you wish to use, and include its contents in your software.
Open a new PawnIO handle, and load a new module blob:
HANDLE handle;
pawnio_open(&handle);
pawnio_load(handle, blob, blob_size);Now that a module is loaded into this PawnIO handle, you can call an ioctl from the module:
SIZE_T ret_size;
pawnio_execute(handle, "ioctl_hello", NULL, 0, NULL, 0, &ret_size);Congratulations on integrating PawnIO! Please keep in mind that the example snippets here are pseudocode and lack error handling. Production use should include error handling and provide a more convenient wrapper both for PawnIO interfaces and interfaces of the modules.
PawnIO comes with a variety of licenses for the available versions, even though the code is identical:
- Official and unrestricted binary editions: Proprietary, however redistribution of installer is allowed.
- Open source edition (source code only): GPL 2 with exception (PawnIO), LGPL 2.1 (PawnIOLib)
- Custom licensing
It is recommended that users are simply redirected to pawnio.eu for obtaining a copy . This allows any software from proprietary to GPL to implement PawnIO while end-users can opt to locally combine that software with the official PawnIO builds, as the builds are interface-compatible.