Skip to content

Instantly share code, notes, and snippets.

// Example of using Incognito's streamer plugin
//
// Map: Karlip's Christmas Tree
// http://forum.sa-mp.com/showthread.php?t=58588
#include <sampgdk/a_players.h>
#include <sampgdk/a_samp.h>
#include <sampgdk/core.h>
#include <sampgdk/interop.h>
#include <sampgdk/sdk.h>
@Zeex
Zeex / pawndisasm.txt
Last active January 2, 2016 01:08
pawndisasm binaries
http://www.solidfiles.com/d/8a41e27901/ - Windows
http://www.solidfiles.com/d/2e2ba6d676/ - Linux
@Zeex
Zeex / vgdb-connect
Last active December 30, 2015 08:39
Valgrind + GDB
#!/bin/sh
gdb -f ./samp03svr -ex "target remote | vgdb"
@Zeex
Zeex / .gdbinit
Last active December 30, 2015 07:29
My GDB config
set disassembly-flavor intel
define hook-stop
list *$pc
x/5i $pc
x/8w $sp
end
@Zeex
Zeex / pawnc.dif
Created September 17, 2013 14:54
NOP out max. stack size estimation in the Pawn compiler (use this to patch pawnc.dll with ida_patcher)
This difference file is created by The Interactive Disassembler
pawnc.dll
00002B50: 51 8B
00002B51: 8B 44
00002B52: 03 24
00002B53: 33 04
00002B54: C9 C7
00002B55: 85 00
00002B56: C0 00
@Zeex
Zeex / osm.cpp
Last active December 22, 2015 02:18
OSM plugin (reproduces fixes2's OnServerMessage functionality)
// Copyright (c) 2013, Zeex
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
@Zeex
Zeex / backtrace.inc
Last active December 22, 2015 01:19
CaptureBacktraceAsync() function
// Capturing AMX backtrce printed by CrashDetect to a string.
// Requires fixes2 plugin by Y_Less: http://forum.sa-mp.com/showthread.php?t=375925
#include <a_samp>
#if !defined MAX_PUBLIC_NAME
#define MAX_PUBLIC_NAME 32 // compiler-enforced limit
#endif
#if !defined MAX_BACKTRACE_LENGTH
#define MAX_BACKTRACE_LENGTH 10240
@Zeex
Zeex / Preferences.sublime-settings
Last active December 17, 2015 06:08
Sublime Text 2 preferences
{
"rulers": [80, 100, 120],
"auto_match_enabled": false,
"font_face": "Consolas",
"font_size": 12.0,
"line_numbers": true,
"word_wrap": false,
"wrap_width": 0,
"hot_exit": false,
"remember_open_files": false,
; amxplugin.asm - a rewrite of amxplugin.cpp in asm
; Copyright (c) 2011 Zeex
global _PluginInit
global _amx_Align16
global _amx_Align32
global _amx_Align64
global _amx_Allot
global _amx_Callback
global _amx_Clone
@Zeex
Zeex / callnative.cpp
Last active December 15, 2015 06:39
CallNative()
#include <cstring>
#include <sampgdk/amx.h>
#include <sampgdk/core.h>
cell CallNative(AMX *amx, AMX_NATIVE native, int num_params) {
int params_size = num_params * sizeof(cell);
amx_Push(amx, params_size);
cell *params;
amx_GetAddr(amx, amx->stk, &params);