Skip to content

Instantly share code, notes, and snippets.

View pypy-vrc's full-sized avatar
🚀
Harder, Better, Faster, Stronger

pypy pypy-vrc

🚀
Harder, Better, Faster, Stronger
  • 127.0.0.1
  • 13:19 (UTC +09:00)
View GitHub Profile
@pypy-vrc
pypy-vrc / tex_to_dds.js
Created February 28, 2024 07:05
riot games tex file converter
/**
* @param {Buffer} data
* @returns {Buffer}
*/
const tex_to_dds = (data) => {
if (data.byteLength < 12 || data.subarray(0, 4).toString() !== "TEX\0") {
throw new Error("invalid TEX file");
}
const width = data.readUInt16LE(4);
@pypy-vrc
pypy-vrc / 2fa.ts
Created February 26, 2024 11:13
Time-based one-time password (TOTP)
import { createHmac, randomBytes } from "crypto";
// Time-based one-time password (TOTP)
// @see https://github.com/google/google-authenticator/wiki/Key-Uri-Format
// otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example
const decodeBase32 = (str: string) => {
const buf = Buffer.allocUnsafe(64); // Math.floor(str.length * 0.625)
let len = 0;
let value = 0;
@pypy-vrc
pypy-vrc / rso.md
Created May 30, 2023 07:02 — forked from Henrik-3/rso.md
RSO

Implementing RSO

How long do i have to wait for my application being reviewed

Depends. Thats for example based on holidays in the US and other factors that could affect the review time for applications. Also there is a difference between a raw RSO apply for LOL and a full production key apply for valorant for example, the second one could potential take longer then the first option. The range can be 12 hours up to 3-4 months

What information Riot needs from you to create your RSO client?

(You have to send that information after your RSO got accepted, so make sure you have preperared the following things)

  1. Contact Emails
@pypy-vrc
pypy-vrc / UnityEngine_Random.js
Created May 3, 2023 07:52
UnityEngine.Random on JavaScript
class UnityEngine_Random {
/**
* @type {number[]}
*/
a = [1234, 3159640283, 3392860520, 3460949513];
/**
* @param {number} seed
*/
initState(seed) {
const blonix = (sName, bMaster = false) => {
const now = new Date();
// blonix needs to be run at 06:00 ~ 06:59 KST
const kst = new Date(now.getTime() + (now.getTimezoneOffset() + 540) * 60000);
// if (kst.getHours() !== 6) {
// return "----";
// }
const crypto = require("crypto");
const fs = require("fs");
//
const iv = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
function decryptAESWithKey(key, data) {
const d = crypto.createDecipheriv("aes-256-cbc", key, iv);
return Buffer.concat([
d.update(Buffer.from(data, "base64")),
git reflog expire --expire=now --all
git gc --prune=now
@pypy-vrc
pypy-vrc / gist:f347554ca31cb559aee1e7dfb6a262e2
Created November 25, 2019 07:24
IMAGE_NT_HEADERS offsets
// 0 Signature
// 0 DWORD Signature
// 4 FileHeader
// 4 WORD Machine;
// 6 WORD NumberOfSections;
// 8 DWORD TimeDateStamp;
// 12 DWORD PointerToSymbolTable;
// 16 DWORD NumberOfSymbols;
// 20 WORD SizeOfOptionalHeader;
// 22 WORD Characteristics;
<ns1:encData>
Data: "TheWorldwideSoftwareInnovation_yyyyMMddHHmmss" <- GetSystemTime()
Modulus: (BINARY/9028@ALSongResource)
0xDF, 0xBC, 0x1F, 0x3F, 0x4C, 0x10, 0xE1, 0x7E, 0x01, 0x12, 0xD7, 0x2E, 0x78, 0x91, 0x6D, 0xA5,
0x06, 0xED, 0xD5, 0x7D, 0xA0, 0x6E, 0xAC, 0x6A, 0xE4, 0xF0, 0x0D, 0xD3, 0x01, 0x06, 0x71, 0x78,
0x05, 0x7B, 0xAA, 0x9B, 0xA9, 0x4E, 0xF6, 0xE6, 0x65, 0xBF, 0xB2, 0x9C, 0xEE, 0x56, 0x7D, 0xE4,
0x08, 0x12, 0x49, 0xC0, 0xBE, 0x37, 0x6F, 0x98, 0x11, 0x38, 0x3C, 0xE6, 0xD1, 0x2B, 0xAD, 0x74,
0x4A, 0x2F, 0x12, 0xFC, 0x16, 0x18, 0x9C, 0x3D, 0x6E, 0xC0, 0x41, 0x22, 0x2B, 0x45, 0x95, 0x41,
0x84, 0x16, 0x5F, 0x37, 0xD9, 0x8D, 0x18, 0x8E, 0xD5, 0xAD, 0x15, 0x8F, 0xF8, 0xB5, 0x00, 0x4E,
0x8E, 0x71, 0x7F, 0x71, 0x4F, 0xC9, 0x62, 0xAB, 0x7E, 0xB0, 0x2D, 0x58, 0x48, 0x19, 0x60, 0xD4,
처음 128바이트 까지 암호화
key = a271730728cbe141e47fd9d677e9006d
sig = B9 32 00 00 12 0F 44 D1 85 DB B9 91 AC 27 25 0F 44 D9 85 C0 B9 14 12 8C 88