Skip to content

Instantly share code, notes, and snippets.

@withmorten
withmorten / premake5.lua
Created August 10, 2021 17:49
AGE premake5.lua
workspace "AGE"
configurations
{
"Debug",
"Release",
}
startproject "AGE"
location "build"
@withmorten
withmorten / check_xrefs.py
Created March 7, 2021 21:59
check_xrefs.py
import idautils
import idc
import idaapi
def demangle(name):
mask = idc.get_inf_attr(idc.INF_LONG_DN)
demangled = idc.demangle_name(name, mask)
if demangled is None:
return name
return demangled
@withmorten
withmorten / ctorhack.cpp
Last active October 15, 2019 10:11
ctorhack
#include <new>
typedef uintptr_t addr;
enum
{
PATCH_CALL,
PATCH_JUMP,
PATCH_NOTHING,
HOOK_SIZE = 5,
@withmorten
withmorten / ffmpeg.patch
Last active June 7, 2018 20:39
ffmpeg toeof patch
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index f6c76bcc55..7c0b95853d 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -157,6 +157,7 @@ typedef struct OptionsContext {
int64_t recording_time;
int64_t stop_time;
+ int64_t stop_time_eof;
uint64_t limit_filesize;
@withmorten
withmorten / userDefineLang.xml
Last active March 19, 2018 04:52
SAGE INI File UDL
<NotepadPlus>
<UserLang name="SAGE INI file (Objects)" ext="ini" udlVersion="2.1">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="yes" Keywords2="no" Keywords3="no" Keywords4="yes" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00; 00// 01 02 03; 03// 04</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
@withmorten
withmorten / gcc 5 on ubuntu 14.04
Last active September 13, 2017 14:23 — forked from beci/gcc 5 on ubuntu 14.04
use gcc 5.x on ubuntu 14.04
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-5 60
@withmorten
withmorten / g2a_music.txt
Created January 23, 2017 18:34
All Gothic 2 + addon music instances, as defined in MusicInst.d
name segment description
DEF_Day_Std nw_daystd DEFAULT
DEF_Day_Thr nw_daythr DEFAULT
DEF_Day_Fgt nw_dayfgt DEFAULT
DEF_Ngt_Std nw_daystd DEFAULT
DEF_Ngt_Thr nw_daythr DEFAULT
DEF_Ngt_Fgt nw_dayfgt DEFAULT
OWD_Day_Std owd_daystd DEFAULT_OLDWORLD
OWD_Day_Thr owd_daystd DEFAULT_OLDWORLD
@withmorten
withmorten / 0createshortcuts.bat
Created November 1, 2016 01:05
c&c shortcut creator
@setlocal enableextensions enabledelayedexpansion
@echo off
set wdir="%~dp0"
set wdir=!wdir:~0,-2!
xxmklink "%USERPROFILE%\Desktop\C&C ZH Shockwave Launcher" %wdir%\1launcher_shockwave.bat" "" %wdir%" "Command & Conquer Generals: Zero Hour - Shockwave Launcher" "1" "Shockwave.ico" /q
xxmklink "%USERPROFILE%\Desktop\C&C Zero Hour Launcher" %wdir%\2launcher_vanilla.bat" "" %wdir%" "Command & Conquer Generals: Zero Hour Launcher" "1" "generals.exe" /q
echo "Shortcuts to Desktop created!"
echo.
PAUSE
@withmorten
withmorten / 2launcher_vanilla.bat
Last active November 1, 2016 02:35
custom c&c zero hour launcher
@echo off
set /P c=Do you want Superweapons? [Y/n]
if /I "%c%" NEQ "N" goto :launcher else goto :nosuperweapons
echo Launching Zero Hour ...
echo.
:nosuperweapons
move !NoSuperWeaponsVanilla.gib !NoSuperWeaponsVanilla.big
@withmorten
withmorten / 1launcher_shockwave.bat
Last active November 1, 2016 02:35
custom c&c shockwave launcher
@echo off
set /P c=Do you want Superweapons? [Y/n]
if /I "%c%" NEQ "N" goto :launcher else goto :nosuperweapons
echo Launching Shockwave ...
echo.
:nosuperweapons
move !!!NoSuperWeaponsSHW.gib !!!NoSuperWeaponsSHW.big