Skip to content

Instantly share code, notes, and snippets.

#include <stdio.h>
#include <dlfcn.h>
int main(int argc, char **argv)
{
void *dll = dlopen("/home/xandaros/workspace/test/test.so", RTLD_LAZY);
void *sym = dlsym(dll, "Test_someInt_closure");
if (sym == NULL)
{
printf("Symbol not found!!!\n");
--@name Downloader
--@author Xandaros
--@include lib/class.txt
--@include lib/util/LinkedList.txt
require("lib/Class.txt")
require("lib/util/LinkedList.txt")
local queue = LinkedList()
--@name Image Loader
--@author Xandaros
--@include lib/util/lowlevel.txt
--@include lib/util/Downloader.txt
--@include lib/util/LinkedList.txt
require("lib/util/lowlevel.txt")
require("lib/util/Downloader.txt")
require("lib/util/LinkedList.txt")
--@name JSON Library
--@author Xandaros
JSON = {}
local function parseString(json)
local m = json:match("^(%s*\")")
if not m then
throw("Invalid format")
end
@Xandaros
Xandaros / gist:ea8756e4c4ba00218855
Last active July 3, 2023 21:41
Unnamed class library
--@name Class
--@author Xandaros
--Class library, most recent version can be found here: https://gist.github.com/Xandaros/ea8756e4c4ba00218855
local function callConstructor(class, obj, ...)
local meta = getmetatable(class)
if meta.__super then
if class.superArgs then
callConstructor(meta.__super, obj, class.superArgs(...))
require ("von")
require ("glon")
reserialize("ev_playerinfo.txt")
reserialize("ev_userranks.txt")
reserialize("ev_globalvars.txt")
function reserialize(file)
local str = file.Read(file, "DATA")
file.Write(file, von.serialize(glon.decode(str)))