Skip to content

Instantly share code, notes, and snippets.

View Nukem9's full-sized avatar

Nukem Nukem9

  • Charlotte, North Carolina
View GitHub Profile
@Nukem9
Nukem9 / MurmurHash3.cs
Created September 17, 2020 09:46
MurmurHash3 ported to C# (https://github.com/aappleby/smhasher)
//-----------------------------------------------------------------------------
// MurmurHash3 was written by Austin Appleby, and is placed in the public
// domain. The author hereby disclaims copyright to this source code.
// Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
// Note - This C# translation is placed in the public domain. It has been ported from
@Nukem9
Nukem9 / OodleLZ.cs
Created September 17, 2020 09:46
OodleLZ wrapper in C#
using System;
using System.Runtime.InteropServices;
namespace Utility
{
public static class OodleLZ
{
private enum OodleLZ_Compressor : int
{
LZH = 0,
@Nukem9
Nukem9 / random_idapython_scripts.py
Created May 1, 2020 07:32
Random IDA Pro python scripts I've made
#
# Export all functions to an array in a header file
#
ftable = open(idc.AskFile(1, "func_list.h", "Save output file"), "w")
ftable.write("struct FunctionEntry\n{\n")
ftable.write("\tuintptr_t StartAddr;\n")
ftable.write("\tuintptr_t EndAddr;\n")
ftable.write("} const FunctionEntries[] =\n")
ftable.write("{\n")
#include "stdafx.h"
#include <stdio.h>
#include <vector>
#include <string>
#include <unordered_set>
#include <unordered_map>
class igBaseMeta
{
public:
#include <idc.idc>
static get_str_length(ea)
{
auto startEA = ea;
while (Byte(ea) != 0)
ea = ea + 1;
return ea - startEA;
@Nukem9
Nukem9 / main.cs
Created November 19, 2019 06:01
C# code to download & stitch together the Submarine Cable Map 2019 from Telegeography
using System;
using System.Drawing;
using System.Net;
namespace ImageBuilder
{
class Program
{
static Image[,] m_Images;
netsh advfirewall firewall add rule name="D2MatchmakingBlock" protocol=UDP dir=in localport=0-52,54-1899,1901-3073,3075-65535 action=block program="E:\Program Files (x86)\Steam\steamapps\common\Destiny 2\destiny2.exe" enable=yes
netsh advfirewall firewall add rule name="D2MatchmakingBlock" protocol=UDP dir=out remoteport=0-52,54-1899,1901-3073,3075-65535 action=block program="E:\Program Files (x86)\Steam\steamapps\common\Destiny 2\destiny2.exe" enable=yes
REM remove "REM" from the next 2 lines to delete the rules
REM netsh advfirewall firewall delete rule name="D2MatchmakingBlock" dir=in
REM netsh advfirewall firewall delete rule name="D2MatchmakingBlock" dir=out
const uintptr_t TESForm_Vtables[] =
{
0x010939EC,
0x0103195C,
0x0103168C,
0x0103140C,
0x0104D5B4,
0x0104D19C,
0x01044FFC,
0x0104CC0C,
std::unordered_map<uint32_t, const char *> g_EditorNameMap;
std::mutex g_NameMapLock;
// TESForm::GetName() is the vfunc at +0x130
// TESForm::GetId() returns the form id
class TESForm : public BaseFormComponent
{
public:
uint32_t GetId() const
EntryPointEnum stru_144409090[188] =
{
{ "Mod Breath Timer", { 0i64, 0i64, 0i64 } },
{ "Mod My Critical Hit Chance", { 0i64, 0i64, 0i64 } },
{ "Mod My Critical Hit Damage Mult", { 0i64, 0i64, 0i64 } },
{ "Mod Mine Explode Chance", { 0i64, 0i64, 0i64 } },
{ "Mod Incoming Limb Damage", { 0i64, 0i64, 0i64 } },
{ "Mod Book Actor Value Bonus", { 0i64, 0i64, 0i64 } },
{ "Mod Recovered Health", { 0i64, 0i64, 0i64 } },
{ "Set Should Attack", { 0i64, 0i64, 0i64 } },