Superseded by this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua | |
local arg = { ... } | |
local function read_file(filename) | |
local result = {} | |
local chunk, err | |
if setfenv then -- Lua 5.1 | |
chunk, err = loadfile(filename) | |
if chunk then |
The following Lua program generates a Lua bytecode program called ignore-unsigned-sga.fnt
, which in turn loads a DLL from within an extremely locked down Lua 5.1 sandbox in a program called RelicCOH2.exe. The remainder of this document attempts to explain how this program works by a whirlwind tour of relevent bits of the Lua 5.1 virtual machine.
if string.dump(function()end):sub(1, 12) ~= "\27Lua\81\0\1\4\4\4\8\0" then
error("This generator requires a 32-bit version of Lua 5.1")
end
local function outer()
local magic -- In bytecode, the stack slot corresponding to this local is changed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* lint64.c | |
* int64 nummbers for Lua | |
* Luiz Henrique de Figueiredo <[email protected]> | |
* Thu Aug 1 22:56:17 BRT 2013 | |
* This code is hereby placed in the public domain. | |
* Modified by Stevedonovan, Aug 3. | |
* __pow is defined by integer second arg | |
* new can be passed a hex literal string | |
* tohex will return a int64 as a hex string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------ | |
// pdbdump.c - dump symbols from .pdb and executable files (public domain). | |
// - to compile; cl.exe /Ox /Zi pdbdump.c | |
// - | |
// - Martin Ridgers, pdbdump 'at' fireproofgravy.co.uk | |
//------------------------------------------------------------------------------ | |
#include <stdio.h> | |
#include <Windows.h> | |
#include <DbgHelp.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php. | |
Example: | |
ProFi = require 'ProFi' | |
ProFi:start() | |
some_function() | |
another_function() | |
coroutine.resume( some_coroutine ) | |
ProFi:stop() |
Special thanks to Dušan Majkic (dmajkic, https://github.com/dmajkic/redis/) for his project on GitHub that gave us the opportunity to quickly learn some on the intricacies of Redis code. His project also helped us to build our prototype quickly.
First clone the Redis sources from https://github.com/antirez/redis.
- On your computer create a working folder and cd into it.
- Clone antirez/redis repository:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local select = select | |
local error = error | |
local cocreate , coresume , corunning , costatus , coyield = coroutine.create , coroutine.resume , coroutine.running , coroutine.status , coroutine.yield | |
local getinfo = debug.getinfo | |
local err_signifier = { } | |
local ec = { } | |
local function xpcall_resume ( co , hand , ok , ... ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
die() { | |
echo "$1"; | |
exit 1; | |
} | |
# Fetch and install Lua/LuaRocks/Kepler into the local directory |
NewerOlder