Skip to content

Instantly share code, notes, and snippets.

#!/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
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
#include <algorithm>
#include <cstdint>
#include <fstream>
#include <iostream>
#include <memory>
#include <stdexcept>
#include <Windows.h>
char *rva_to_pointer(char *data, uint32_t rva)
{
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;
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
import math
import numpy
from numpy import int32, float64
import random
numpy.seterr(all='ignore')
SUMMONS = {
'421A': [
[["Vtuber"],4],
--------------------------------------------------------------------------------
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
_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" } ); // パターン文字列のパターン番号を事前取得 よく使うので最初に定義
#include <algorithm>
#include <type_traits>
#include <utility>
using std::size_t;
template<typename Target>
class field_list {
template<size_t N>
struct reader {
#include <cstdio>
static int abs(int n)
{
const auto mask = n << 31;
return (n ^ mask) - mask;
}
static int odd_digit_sum_base4(int n)
{