-
Notifications
You must be signed in to change notification settings - Fork 29
Using PawnIO Modules
Read the Install_Dir value from HKEY_LOCAL_MACHINE\SOFTWARE\PawnIO or HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\PawnIO (whichever exists). This will provide you with the path where PawnIO is installed.
Dynamically load PawnIOLib using LoadLibrary or your language's equivalent:
lib = LoadLibrary(Install_Dir + "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.