Skip to content

Instantly share code, notes, and snippets.

@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
/*
Source for ida_patcher
Copyright (c) 2006 Chris Eagle cseagle at gmail.com
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
@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 / GroupTargetSources.cmake
Last active June 3, 2021 12:00
group_target_sources(target) - group target's source files on based on their directory.
# group_target_sources(target) - group target's source files on based on
# their directory.
function(group_target_sources target)
get_target_property(sources ${target} SOURCES)
foreach(file ${sources})
get_filename_component(path "${file}" ABSOLUTE)
get_filename_component(path "${path}" PATH)
if(file MATCHES "${PROJECT_BINARY_DIR}")
file(RELATIVE_PATH path ${PROJECT_BINARY_DIR} "${path}")