Skip to content

Instantly share code, notes, and snippets.

View t-wy's full-sized avatar

TWY t-wy

View GitHub Profile
@t-wy
t-wy / messagepack_csharp_unpacker.py
Last active February 16, 2024 18:42
MessagePack-CSharp unpacker for Python
def messagepack_csharp_unpack(data: bytes) -> list:
"""
Redistribution Notice:
Properly attribute all entities listed below and request others to do the same.
Otherwise, DO NOT remove or modify this comment.
Base Repository License: https://github.com/MessagePack-CSharp/MessagePack-CSharp/blob/master/LICENSE
Dependency License:
Msgpack: https://github.com/msgpack/msgpack-python/blob/main/COPYING
python-lz4: https://github.com/python-lz4/python-lz4/blob/master/LICENSE
Implementation Below: @t-wy: https://github.com/t-wy
@t-wy
t-wy / fb_post_id_script.js
Created November 28, 2022 12:22
Get Facebook canonical Post ID (share URL) without pfbid parameter
javascript: fbid = /share_fbid":"(\d+)"/g.exec([...document.getElementsByTagName("script")].filter(x => x.innerHTML.includes("share_fbid"))[0].innerHTML)[1]; alert(location.href.split("/").slice(0, -1).join("/") + "/" + fbid);
// can be used in console / bookmark / address bar (remember to add back javascript if the browser strips it automatically)
@t-wy
t-wy / - GoogleCTF Write-up - Mixed.md
Last active October 6, 2022 02:26
GoogleCTF Write-up - Mixed

Challenge Name - MIXED

URL - https://capturetheflag.withgoogle.com/challenges/rev-mixed

Description - A company I interview for gave me a test to solve. I'd decompile it and get the answer that way, but they seem to use some custom Python version... At least I know it's based on commit 64113a4ba801126028505c50a7383f3e9df29573.

Attachments:

  • patch (See A1: patch)
  • x.pyc (See A2: x.pyc.b64)
@t-wy
t-wy / dis_advanced.py
Created July 3, 2022 14:31
dis_advanced.py for dis.py debug
"""Disassembler of Python byte code into mnemonics."""
import sys
import types
import collections
import io
from opcode import *
from opcode import __all__ as _opcodes_all
from opcode import _nb_ops, _inline_cache_entries, _specializations, _specialized_instructions
@t-wy
t-wy / CopyFrametoClipboard.js
Last active July 22, 2022 11:52
HTML Video Element Useful Snippets
javascript: {
let video = document.getElementsByTagName("video")[0];
let canvas = document.createElement("canvas");
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
canvas.getContext("2d").drawImage(video, 0, 0, canvas.width, canvas.height);
canvas.style.position = "fixed";
canvas.style.left = "0";
canvas.style.top = "0";
canvas.style.zIndex = "99999";
@t-wy
t-wy / Paint_turtle.py
Last active November 28, 2022 12:23
A paint application using Python Turtle
import turtle
turtle.tracer(False)
turtle.hideturtle()
"""
Paint Application using Python Turtle
by t-wy
"""
def save():
@t-wy
t-wy / _readme.md
Last active November 7, 2023 10:42
Get App Store Tiers without using Developer Account

Parts of the functionality may be broken as App Store allows more flexible pricing options than the original tiers.

@t-wy
t-wy / #kurenaifChallenge Write-up
Last active September 28, 2023 03:13
#kurenaifChallenge Write-up
ツイート Tweet:https://twitter.com/fwarashi/status/1360561289215373314
Github:https://github.com/kurenaif/kurenaif_valentine_problems
ハッシュタグ Hashtag: #kurenaifChallenge (https://twitter.com/search?q=%23kurenaifChallenge)
* GCD (Greatest common divisor・最大公約数) may also be known as HCF, GCF or HCD, GCM
H: highest
F: factor
M: measure