Skip to content

Instantly share code, notes, and snippets.

View starwing's full-sized avatar

Xavier Wang starwing

  • Chengdu
View GitHub Profile
@ChrisWills
ChrisWills / .screenrc-main-example
Created November 3, 2011 17:50
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
@starwing
starwing / .gitignore
Created May 20, 2012 19:34
a path maintain module for lua
test
tags*
*.exe
*.dll
*.obj
*.so
*.o
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 3, 2024 12:57
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Exploiting Lua 5.1 on 32-bit Windows

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
title description date categories slug
QQ协议分析
QQ协议分析
2014-04-16
protocol
qq-protocol

一. 文字聊天协议族(TCPF, Text Chatting Protocol Family)

@Oberon00
Oberon00 / funcidx.lua
Last active May 13, 2024 09:42
Lua C API function HTML reference table data & generator (http://oberon00.github.io/lua-cfuncidx/index.html)
-- Helpers {{{1
local function fail_on_missing_tbl(t, missing_name)
missing_name = missing_name or 'table entry'
return setmetatable(t, {__index = function(t, k)
error(('No %s with key "%s" (in %s).'):format(missing_name, k, t))
end
})
end
fail_on_missing_tbl(_G, 'global');
@sotex
sotex / singleflight.hpp
Last active January 11, 2024 09:36
singleflight的C++实现版本
// solym
// ymwh@foxmail.com
// 2020年3月16日 20点28分
#include <map>
#include <memory>
#include <mutex>
#include <condition_variable>