Skip to content

Instantly share code, notes, and snippets.

View Andoryuuta's full-sized avatar
🛶
Canoeing across the atlantic

Andrew Gutekanst Andoryuuta

🛶
Canoeing across the atlantic
View GitHub Profile
@Andoryuuta
Andoryuuta / bad_dti_inheritance_mhw_15_20_00.md
Last active October 22, 2023 19:06
# Bad DTI inheritance (MHW 15.20.00)

Bad DTI inheritance (MHW 15.20.00)

These are all classes which have inherited from a DTI class, but which don't implement their own DTI (+don't override the ::GetDTI virtual method)

DTI name index vftable address
CoprocessorObject 0 0x14353a950
CoprocessorObject 1 0x143586060
MtArray 0 0x142f0cff8
MtArray 1 0x142f172a0
Class:MHiAIObject, Hash:0x5E6E97F0
Class:MHiAreaObject, Hash:0x13F84021
Class:MHiArrayObject, Hash:0x4A2F57B0
Class:MHiColladaObject, Hash:0x74A65A09
Class:MHiCollisionObject, Hash:0x3CD665F2
Class:MHiDevelopObject, Hash:0x3E226FCE
Class:MHiEffectObject, Hash:0x6773BC46
Class:MHiGUIObject, Hash:0x3FAF421
Class:MHiGlobalObject, Hash:0x6787E98A
Class:MHiInstancingObject, Hash:0x3EA6B848
a9c13fbe964af9d974101e36d7b82f9b
import sys
import os
# Check if we have an argument.
if(len(sys.argv) <= 1):
print('Usage: {} file.dyn'.format(sys.argv[0]))
sys.exit(1)
# File names
input_filename = sys.argv[1]
index filename unk0 unk1 unk2
0 testwave.mus 49 1148354 0
1 testpink.mus 6500 96277 0
2 ef_blank.mus 0 0 0
3 ef_a_box.mus 0 0 0
4 ef_buta0.mus 0 0 0
5 ef_buta1.mus 0 0 0
6 ef_buta2.mus 0 0 0
7 ef_get00.mus 0 0 0
8 ef_get01.mus 0 0 0

Rust Pain Points

A personal list of pain-points, rough edges, ambiguities, etc observed while trying to work on Rust projects (+adject tooling, cargo, crates.io, rust-analyzer, etc). This list is for personal reference, of personal experiences, not for "dunking" on the language or for flame wars. Multiple things in this list might be entirely incorrect / just undocumented.

- vs _ in crate names

The most common pattern for crate names is to use hypens. However, hypens are not valid identifiers in Rust. As such, these get implicitly converted to underscores. If you have a crate named foobar-rs, all references to that package in Rust code will need to use foobar_rs.

At some point in the past, this was an explicit implementation detail, requiring the syntax: extern crate "foobar-rs" as foobar_rs;

@Andoryuuta
Andoryuuta / cwb_markers.py
Created September 27, 2019 07:19
cwb_markers.py v0.3.0
import idautils
import idc
import ida_bytes
from pprint import pprint, pformat
def demangle_name(name):
return idc.Demangle(name, idc.GetLongPrm(idc.INF_SHORT_DN)) or name
def get_primary_vtables():
@Andoryuuta
Andoryuuta / launch.py
Created August 27, 2016 07:17
Example of DLL injection launcher in python
from ctypes import *
import win32event
import win32process
import win32api
import win32ui
import sys
import os.path
def panic(proc, reason):
win32ui.MessageBox(reason, 'Launcher Error!', 0)
@Andoryuuta
Andoryuuta / sedbres_parser.py
Last active October 18, 2022 04:09
Dragon Quest X - SEDBRES parser
import struct
import os
from pprint import pprint
# Terribly slow way of reading null-terminated strings. :)
def readcstr(f):
return ''.join(iter(lambda: f.read(1).decode('ascii'), '\x00'))
#with open('fa2271e63a2ba277.rps', 'rb') as f:
with open('0x1e157d10.sedbres', 'rb') as f:
@Andoryuuta
Andoryuuta / MHFZ EM CMD list.h
Created October 9, 2022 13:40
MHFZ EM CMD list
0x1: EM_CMD_KEHAI_CK
0x2: EM_CMD_NINSHIKI_CK
0x3: EM_CMD_AREA_MOVE_CK
0x4: <MISSING, sets some value to 0 then returns.>
0x5: EM_TYPE_ACT_SET
0x6: EM_CMD_TARGET_SET
0x7: EM_CMD_MAIN_JUMP
0x8: EM_CMD_STAND_CK
0x9: EM_CMD_FLY_CK
0xA: EM_CMD_BODY_STATUS_SET