This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from ghidra.app.script import * | |
from ghidra.app.services import DataTypeManagerService | |
from ghidra.app.util.bin import BinaryReader, ByteArrayProvider, \ | |
MemoryByteProvider | |
from ghidra.program.model.address import Address, AddressOutOfBoundsException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce | |
def fnv(data: bytes, prime: int, basis: int, mod: int): | |
return reduce(lambda hash, b: ((hash * prime) ^ b) % mod, data, basis) | |
def fnv_a(data: bytes, prime: int, basis: int, mod: int): | |
return reduce(lambda hash, b: ((hash ^ b) * prime) % mod, data, basis) | |
def find_basis_a(hash: int, data: bytes, prime: int, mod: int): | |
# reverse the operations using the prime's modular multiplicative inverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <cstdint> | |
#include <fstream> | |
#include <iostream> | |
#include <memory> | |
#include <stdexcept> | |
#include <Windows.h> | |
char *rva_to_pointer(char *data, uint32_t rva) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Physics_UpdateECBBones(Physics *phys,ECBUpdateFlag flags) | |
{ | |
float min_asymmetrical_width; | |
float min_asymmetrical_height; | |
float width; | |
float height; | |
float max_x; | |
float min_x; | |
float max_y; | |
float min_y; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
import os | |
import os.path | |
import struct | |
import sys | |
class NcdFile(): | |
def __init__(self, name, compressed, offset, size): | |
self.name = name | |
self.compressed = compressed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import numpy | |
from numpy import int32, float64 | |
import random | |
numpy.seterr(all='ignore') | |
SUMMONS = { | |
'421A': [ | |
[["Vtuber"],4], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------- | |
Luck 0 421A | |
Net luck (average +0.7407): | |
74.07%: +1 | |
25.93%: +0 | |
Summons: | |
37.04%: Lv0 Luck+1 - Light | |
37.04%: Lv0 Luck+1 - Train | |
18.52%: Lv1 Luck+0 - SOS | |
7.41%: Lv2 Luck+0 - Necocan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_dp("\n[chr019_mv_0.txt]"); | |
// 行動リストテーブル | |
// Param2 : 1 前転振り向き処理をやらない | |
local t = {}; | |
const def_ObjID_chat = 1; // チャット欄のコメントに割り振るオブジェクトID | |
local pat_num_NecoFukitobi = BMvEff.GetPatternNum( { datatype=0, pat="NecoFukitobi" } ); // パターン文字列のパターン番号を事前取得 よく使うので最初に定義 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <type_traits> | |
#include <utility> | |
using std::size_t; | |
template<typename Target> | |
class field_list { | |
template<size_t N> | |
struct reader { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
static int abs(int n) | |
{ | |
const auto mask = n << 31; | |
return (n ^ mask) - mask; | |
} | |
static int odd_digit_sum_base4(int n) | |
{ |