This file contains 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
#include <lua.h> | |
#include <lualib.h> | |
#include <lauxlib.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
static const char *getF(lua_State *L, void *ud, size_t *size) | |
{ | |
FILE *f=(FILE *)ud; |
This file contains 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 bcnames = "ISLT ISGE ISLE ISGT ISEQV ISNEV ISEQS ISNES ISEQN ISNEN ISEQP ISNEP ISTC ISFC IST ISF MOV NOT UNM LEN ADDVN SUBVN MULVN DIVVN MODVN ADDNV SUBNV MULNV DIVNV MODNV ADDVV SUBVV MULVV DIVVV MODVV POW CAT KSTR KCDATAKSHORTKNUM KPRI KNIL UGET USETV USETS USETN USETP UCLO FNEW TNEW TDUP GGET GSET TGETV TGETS TGETB TSETV TSETS TSETB TSETM CALLM CALL CALLMTCALLT ITERC ITERN VARG ISNEXTRETM RET RET0 RET1 FORI JFORI FORL IFORL JFORL ITERL IITERLJITERLLOOP ILOOP JLOOP JMP FUNCF IFUNCFJFUNCFFUNCV IFUNCVJFUNCVFUNCC FUNCCW" | |
local jit = jit or require("jit") | |
assert(jit.version_num == 20003, "LuaJIT version mismatch") | |
local jutil = jit.util or require'jit.util' | |
local band = bit.band | |
local t = {} |
This file contains 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
--setfenv(1,_G) | |
local meta={} | |
local co=setmetatable({},meta) | |
_G.co=co | |
-- todo | |
-- error handler wrapper? | |
-- select() polling support (epoll() please :c) | |
-- co.make steal parameters | |
-- ? |
This file contains 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
import json | |
import os | |
import sys | |
import re | |
parse_steamid = re.compile(r"^STEAM_(?P<X>\d+):(?P<Y>\d+):(?P<Z>\d+)$") | |
import struct | |
json_data=open("hac_db_all.json").read() |
This file contains 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
--do return print(util.SteamIDTo64("STEAM_0:1:1")) end | |
local fSid=file.Open("hac_sids.dat",'rb','DATA') | |
local fReasons=file.Read("hac_reason.dat",'DATA') | |
local reasons = {} | |
local lastpos=1 | |
require'vstruct' |
This file contains 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 strchar=string.char | |
local strfind=string.find | |
local gsub=string.gsub | |
local strsub=string.sub | |
local strlen=string.len | |
local tinsert=table.insert | |
local strlower=string.lower | |
local tremove=table.remove | |
local format=string.format | |
local getn=function(x) return #x end |
This file contains 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 luadata = {} | |
local encode_table | |
local typex=type | |
function table.isarray(t) | |
local i = 0 | |
for _ in pairs(t) do | |
i = i + 1 | |
if t[i] == nil then return false end |
This file contains 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
-- http://www.sqlite.org/lang_corefunc.html#last_insert_rowid | |
function sql.LastRowID() | |
local ret = sql.Query("SELECT last_insert_rowid() as x")[1].x | |
return ret | |
end | |
-- http://www.tutorialspoint.com/sqlite/sqlite_date_time.htm | |
local escape=sql.SQLStr | |
local function gen_datefunc(fname) |
This file contains 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
H=NewChain( | |
function(chain,...) | |
if not chain[2] then | |
return hook.Run(chain[1],...) -- call hook | |
elseif chain[2] then | |
return hook.GetTable()[chain[1]][chain[2]](...) -- call single hook?? | |
end | |
end, | |
function(chain,val) | |
if isfunction(val) then |
OlderNewer