Skip to content

Instantly share code, notes, and snippets.

View ProdigySim's full-sized avatar

Michael Busby ProdigySim

View GitHub Profile
@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]
@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 / 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 / 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 / addrtest.sp
Created March 11, 2012 00:49
Testing address functions of sourcemod
#include <sourcemod>
new Handle:g_hConf;
public OnPluginStart()
{
g_hConf = LoadGameConfigFile("addrtest");
RegConsoleCmd("addrtest_win", WinTest);
RegConsoleCmd("addrtest_lin", LinTest);
}
@ProdigySim
ProdigySim / Program.cs
Created October 30, 2012 18:12
example of event nulling behavior
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//Expected Output:
//
//Execute: (Status: null)
//=======
//Execute: (Status: not null)
@ProdigySim
ProdigySim / Program.cs
Created November 7, 2012 21:13
saltarelle import constructor names
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.CompilerServices;
namespace saltytest
{
class Program
{
@ProdigySim
ProdigySim / YoutubeUploadsHomepage.user.js
Created December 14, 2012 08:56
Greasemonkey script to make youtube less annoying after their homepage changes...
// ==UserScript==
// @name YoutubeUploadsHomepage
// @namespace Youtube
// @description Youtube Button goes to uploads page
// @include http*://*.youtube.com/*
// @version 1
// ==/UserScript==
document.getElementById('logo-container').href="/feed/subscriptions/u";
@ProdigySim
ProdigySim / scoring_wip.sp
Created January 24, 2013 08:16
A little project I'm working on.
#include <sourcemod>
#include <sdktools>
#include <left4downtown>
#include <l4d2_direct>
#include <l4d2util>
stock SetVersusRoundInProgress(bool:inProgress)
{
static Address:pRoundInProgress = Address_Null;
if(pRoundInProgress == Address_Null)
@ProdigySim
ProdigySim / GameRules_DataNatives.diff
Created January 27, 2013 20:58
some potential patches for sm-central
# HG changeset patch
# Parent bf0211912ba1b67fc60d80038627156bb85e2779
Gamerules GetData natives.
diff -r bf0211912ba1 -r 03044c5b5fdf extensions/sdktools/gamerulesnatives.cpp
--- a/extensions/sdktools/gamerulesnatives.cpp Sun Jan 27 12:49:25 2013 -0800
+++ b/extensions/sdktools/gamerulesnatives.cpp Sun Jan 27 12:50:49 2013 -0800
@@ -87,6 +87,18 @@
PropField_String_T, /**< Valid for Data fields. Read only! */
};