Skip to content

Instantly share code, notes, and snippets.

View ShittyCodeMan's full-sized avatar

ShittyCodeMan ShittyCodeMan

View GitHub Profile
// Parse PlayerPrefs binary data
function parsePlayerPrefsBinary(data) {
const SIGNATURE = "UnityPrf";
const view = new DataView(data.buffer);
const result = {};
const decoder = new TextDecoder();
let offset = 0;
// Read header
import sys
import struct
def datarec(filename, password):
with open(filename, "rb") as f:
filesize = struct.unpack('<I', f.read(4))[0]
data = bytearray(f.read(filesize))
vec = struct.unpack('<I', f.read(4))[0]
l = len(password.encode())
@ShittyCodeMan
ShittyCodeMan / getsumreviewletters.py
Created December 14, 2023 21:06
Get sum of review letters
import sys
import requests
import json
import time
from functools import reduce
import urllib.parse
filter_offtopic_activity = 0
num_per_page = 100
appid = sys.argv[1]
@echo off
if not exist ".\ShaderCacheD3D11.packed" exit /B
if exist ".\_ShaderCacheD3D11.packed" exit /B
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
import random
import string
def generate_word(length):
vowels = 'aeiouy'
consonants = 'bcdfghjklmnpqrstvwxz'
word = ''
for i in range(length):
if i % 2 == 0:
word += random.choice(consonants)
@ShittyCodeMan
ShittyCodeMan / making_zip.py
Last active May 30, 2024 19:17
無圧縮ZIPファイルをバイナリから生成するコード
from struct import pack
from binascii import crc32
from copy import deepcopy
from collections import defaultdict
import heapq
def encode_lz77_plain(bytes):
result = b""
buf = ""
for byte in bytes:
{
const text =
"This document defines a set of JavaScript APIs to compress and decompress streams of binary data.";
let u8_1, u8_2;
{
const cs = new CompressionStream("deflate-raw");
const w = cs.writable.getWriter();
w.write(new TextEncoder().encode(text));
w.close();
const r = cs.readable.getReader();
from sys import argv
from os import path
from PIL import Image
import struct
MAX_WEBP_RESOLUTION = 16383
def find_webp_size(x):
for i in range(1, int(x ** 0.5)):
if x % i == 0 and x // i <= MAX_WEBP_RESOLUTION:
// Hardplateシリーズ
resist = {
phys: [1030, 2080, 895, 1300, 1090],
heat: [670, 1030, 640, 820, 670],
toxi: [520, 670, 505, 595, 520],
};
n = 10;
TYPE = ["phys", "heat", "toxi"];
a = [0, .2, .4, .6, .8, 1, 1.3, 1.6, 1.9, 2.2, 2.5];
@ShittyCodeMan
ShittyCodeMan / index.js
Last active September 26, 2022 12:07
nodejsとGmail APIを使ってWarframeの二段階認証のコードを取得するやつ
const fs = require('fs');
//const readline = require('readline');
const { google } = require('googleapis');
const { setTimeout } = require('timers/promises');
// If modifying these scopes, delete token.json.
const SCOPES = ['https://www.googleapis.com/auth/gmail.readonly'];
// The file token.json stores the user's access and refresh tokens, and is
// created automatically when the authorization flow completes for the first
// time.