Skip to content

Instantly share code, notes, and snippets.

@emoose
emoose / BSPver.cs
Last active March 28, 2017 14:39
BSPver 0.1
using System;
using System.Collections.Generic;
using System.IO;
namespace BSPver
{
class Program
{
struct BSPVersion
{
@emoose
emoose / NVNiTypes.h
Last active October 15, 2021 18:59
New Vegas structs
#pragma once
#include <nvse/NiNodes.h>
// Most definitions here taken from JIP LN NVSE:
// https://github.com/jazzisparis/JIP-LN-NVSE/blob/master/internal/netimmerse.h
// Though most lighting-related structs have had some extra things mapped out here
template <typename T_Data> struct DListNode
{
DListNode* next;
@emoose
emoose / dllmain.cpp
Last active February 19, 2022 23:30
Bloodstained RotN dialogue/menu resolution fix
// This code requires some files from my Arise-SDK project:
// https://github.com/emoose/Arise-SDK/tree/b73c7ea9fceea2c494cbb8ebc74c6b3d1d35cbf6
#include "pch.h"
#include <cstdio>
#define SDK_VERSION "0.1.25"
HMODULE DllHModule;
HMODULE GameHModule;
@emoose
emoose / main.cpp
Last active July 9, 2022 15:42
Improved Lighting Shaders Plugin for FNV (https://www.nexusmods.com/newvegas/mods/69833)
// Improved Lighting Shaders for FNV, 1.5beta4, by emoose (stoker25)
// Released under MIT License
#include "nvse/PluginAPI.h"
#include "nvse/SafeWrite.h"
#include "nvse/GameObjects.h"
#include "nvse/ParamInfos.h"
#include "NiTypes.h"
#include <string>
@emoose
emoose / xam_table_1838.inc
Created September 6, 2022 21:00
Xenia xam_table for XEX1 / 1838
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2021 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
// This is a partial file designed to be included by other files when
@emoose
emoose / ida python idc analysis pause.txt
Last active April 9, 2023 14:16
IDA stop/pause analysis, hopefully google might pick this up...
idc: Analysis(0)
idapython: idc.set_flag(INF_GENFLAGS, INFFL_AUTO, 0)
@emoose
emoose / gist:3bf4a838dbce6ad1bb267f297743dd58
Created January 3, 2025 19:46
IDA Pro shift-jis cp932 japanese encoding

Always keep forgetting this...

ida -dCULTURE=Japanese -dENCODING=cp932

@emoose
emoose / sh_sys.h
Last active March 1, 2025 20:18
SH1 things
// struct SH_SYS at 0x800BC728, size 0x5D8
// struct SYS_W at 0x800B9FC0, size 0x2768
struct SH_SYS // 0x800BC728, size 0x5D8
{
ShControllerCfg controller;
char screen_x_1C;
char screen_y_1D;
unsigned __int8 sound_type_1E;
unsigned __int8 volume_BGM_1F;
@emoose
emoose / compare.py
Last active April 10, 2025 16:00
sh1 map compare
# Save script as asm/maps/compare.py
# Then run
# python compare.py map0_s01 map0_s02 0
# This will compare line count between files in each maps nonmatchings folder
# For each pair that matches it removes comments & data/func refs and uses Levenshtein to compare them
# Last param is max distance to show, use 0 to get exact matches, but can tweak it to find others if wanted.
# (since this only works with asm files in nonmatchings folder, it can't compare map0_s00 since we've matched some of them)
import os
import re
import Levenshtein
@emoose
emoose / compare.py
Last active April 18, 2025 21:33
compare.py with symbols/includes
# Save script as asm/maps/compare.py
# Then run
# python compare.py map0_s01 map0_s02
# This compares matching funcs in first maps matchings folder against nonmatchings in the second map
# For each pair that matches it removes comments & data/func refs and uses Levenshtein to compare them
# Funcs with distance 0 Levenshtein score will then be printed, along with lines to use in symbols.txt & #include lines to add to .c
import os
import re
import Levenshtein