Skip to content

Instantly share code, notes, and snippets.

View ProdigySim's full-sized avatar

Michael Busby ProdigySim

View GitHub Profile
@ProdigySim
ProdigySim / l4d2_boss_announce.sp
Created March 10, 2012 06:14
Announce boss flow percents accurately.
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <l4d2_direct>
public Plugin:myinfo = {
name = "L4D2 Boss Flow Announce",
author = "ProdigySim",
version = "1.0",
@ProdigySim
ProdigySim / reductsumm.c
Created November 15, 2011 18:39
stupid reduction of summands simulation for cs388
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
size_t min(size_t x, size_t y) { return x < y ? x : y; }
size_t max(size_t x, size_t y) { return x > y ? x : y; }
size_t min3(size_t x, size_t y, size_t z) { return x < y ? min(x, z) : min(y, z); }
size_t max3(size_t x, size_t y, size_t z) { return x > y ? max(x, z) : max(y, z); }
@ProdigySim
ProdigySim / cvomit_updateability.asm
Created July 20, 2011 18:19
objdump of CVomit::UpdateAbility() + proposed patch
/opt/srcds/left4dead2/left4dead2/bin/server.so: file format elf32-i386
Disassembly of section .text:
002af3f2 <_ZN6CVomit13UpdateAbilityEv>:
- snip -
2af6dd: 8d 50 08 lea edx,[eax+0x8]
2af6e0: 89 95 64 fe ff ff mov DWORD PTR [ebp-0x19c],edx
2af6e6: 8b 45 b8 mov eax,DWORD PTR [ebp-0x48]
@ProdigySim
ProdigySim / cvomitupdatepatch.asm
Created July 20, 2011 14:45
CVomit::UpdateAbility patch strategy to boomer issues on high tickrate
; Boomer vomit fix
; Basically, we need to patch the 8 bytes at 002AF6F8 to load a ptr to
; 0x10 bytes before the 30tick gpGlobals->frametime
; something like mov eax, ADDR_OF_FAKE_GPGLOBALS; nop; nop;
.text:002AF6E6 loc_2AF6E6: ; CODE XREF: CVomit::UpdateAbility(void)+6A2j
.text:002AF6E6 ; CVomit::UpdateAbility(void)+6D4j
.text:002AF6E6 mov eax, [ebp+var_48]
.text:002AF6E9 mov [ebp+var_6C], eax
.text:002AF6EC mov eax, [ebp+var_44]