Skip to content

Instantly share code, notes, and snippets.

@iamgreaser
iamgreaser / infix-mode.cl
Last active March 1, 2022 20:23
infix notation for common lisp - first reader macro attempt
;; vim: set sts=2 sw=2 et sm lisp :
(defvar *reading-a-list* nil)
(defun read-terminator (stream char)
(declare (ignore stream))
(error (format nil "unexpected ~S" char)))
(defun get-infix-precedence (symbol)
(case symbol
@iamgreaser
iamgreaser / crc32-gm.asm
Last active October 25, 2021 09:25
self-CRC32, x86 asm, 81 bytes, 0x7FC6582F
bits 16
org 0x0100
cpu 8086
code_start:
; SI = start, CX = length, DX:BX = initial CRC
mov si, code_start
mov cx, code_end - code_start
xor bx, bx
dec bx
@iamgreaser
iamgreaser / aimblock.py
Created October 18, 2011 09:27
aimblock for pyspades - an aimbot detector
# AImBlock - aimbot detection script
#
# The point of this script is to detect aimbots
# WITHOUT resorting to a hit-to-miss ratio.
#
# Current detection methods:
# - if one changes target, determine how accurate the gun is with respect to the head
# - if one gets a lot of kills quickly it will warn the admins over IRC
#
# There are more possible methods that can be used, but for now, this should work.
@iamgreaser
iamgreaser / hello.asm
Created October 28, 2011 23:11
My First Assembly Program
; nasm hello.asm -o hello.com
; dosbox hello.com
bits 16
org 0x0100
mov ah,0x09
mov dx,str_hello
int 0x21
int 0x20
@iamgreaser
iamgreaser / gist:b1ebe6debc439b45c5fba074c3e34052
Last active April 15, 2021 19:30
THUG2 LZSS compression scheme (as used by the *.prx files)
THUG2 LZSS compression scheme (as used by the *.prx files)
Documented by GreaseMonkey in 2017
Document version V1
I release this document into the public domain.
AWWW YEAAAAH! Datz RIGHT b0!Z! We got a ... yeah whatever I'm not doing the
ASCII art required for that kind of introduction.
Well, they could've packed it a bit better, but hey, it took 50 minutes to
crack so I'm not complaining, and it is at least a decent compression scheme.
@iamgreaser
iamgreaser / log2_ceil_hifive1_revb.c
Created February 20, 2020 05:54
ceil(log2(x)) implementation for HiFive1 RevB
int log2_ceil(uint32_t v)
{
if ( v == 0 ) {
return -1;
} else if ( v == 1 ) {
return 0;
} else if (((int32_t)(v-1)) < 0) {
return 32;
} else {
for ( ;; ) {
# vxl2tga.py: renders a vxl map isometrically
# by GreaseMonkey, 2013 - public domain
import sys, struct
WIDTH, HEIGHT = 2048, 1024+128
g = [[None for i in xrange(WIDTH)] for j in xrange(HEIGHT)]
def pp(x,y,z,col):
rx = (z-x)*2+1024
@iamgreaser
iamgreaser / malsa076.py
Created November 30, 2019 20:43
malsa076.py
"""
MALSA 0.76: Make AoS Less Shit Again
Instantly turns a 0.75 server into a 0.76 server.
Version 4
Author: GreaseMonkey
Changelog:
Version 4: 2019-12-01
- Updated so that it works on this year's piqueserver.
@iamgreaser
iamgreaser / superz-map.txt
Created September 28, 2019 03:34
preliminary zzt + superz memory maps
// 0C7B: ZZT (?purpose?)
// 0C7B:2085: find_stat_index_at
//
// 14D3: Pascal runtime?
// 14D3:0244: _TMP__ENSURE_STACK_FASTCALL
// 14D3:0329: AllocMem
// 14D3:0341: Freemem
// data+bss:
@iamgreaser
iamgreaser / gist:cb893be7a6b658fd0fd1
Created July 12, 2014 00:10
NASM port of the Reality ADlib Tracker PLAYER.ASM playroutine + added standalone player
; 2014-07-12: Ported to NASM by @fanzyflani. Also contains a player!
; Stick a filename in here if you insist (or %define it elsewhere)
; (50Hz and 18.2Hz modules are detected and the IRQ0 timer adjusted accordingly)
%ifndef RAD_NO_DEFAULT_PLAYER
%ifndef RAD_MODULE_NAME
%define RAD_MODULE_NAME "ALLOYRUN.RAD"
%endif
%endif
; Or %define RAD_NO_DEFAULT_PLAYER in your code.
;