Skip to content

Instantly share code, notes, and snippets.

View AndrewSav's full-sized avatar

Andrew Savinykh AndrewSav

View GitHub Profile
@AndrewSav
AndrewSav / i2cpp_ghidra.md
Created April 23, 2025 06:49 — forked from BadMagic100/i2cpp_ghidra.md
Instructions to get a useful decompilation out of an il2cpp game. Or, "I spent hours to trial and error so hopefully you won't have to"

Decompiling IL2CPP Games with Il2CppDumper and Ghidra

This guide will walk through how to decompile/reverse engineer IL2CPP games for modding usage.

Note: expect this entire process to take upwards of an hour. Have something ready to do on the side while waiting for processing to finish.

Prerequisites

  1. Download Il2CppDumper
@AndrewSav
AndrewSav / Get-GoogleServiceToken.ps1
Last active February 28, 2025 09:13
Get access token from Google Service Account credentials file
[CmdletBinding()]
Param(
# https://console.cloud.google.com/iam-admin/serviceaccounts
[Parameter(Mandatory,Position=0,HelpMessage='Enter path to Google Service Account credentials json file')][string]$serviceCredentialsJsonPath,
# https://developers.google.com/identity/protocols/oauth2/scopes
[Parameter(Mandatory,Position=1,HelpMessage='Enter required Google API scopes')][string[]]$scopes,
[Parameter(Position=3,HelpMessage='Enter token duration in seconds')][int]$duration=3540
)
Set-StrictMode -Version 3.0
<Query Kind="Program">
<NuGetReference>YamlDotNet</NuGetReference>
<Namespace>YamlDotNet.Serialization</Namespace>
<Namespace>YamlDotNet.Core</Namespace>
<Namespace>System.Security.Cryptography</Namespace>
<Namespace>System.Runtime.InteropServices</Namespace>
</Query>
void Main()
{
# First, you must get the previous commit sha, the one before the forced push:
## Hit through terminal
curl -u <username> https://api.github.com/repos/:owner/:repo/events
# Then you can create a branch from this sha:
## Hit through terminal
curl -u <github-username> -X POST -d '{"ref":"refs/heads/<new-branch-name>", "sha":"<sha-from-step-1>"}' https://api.github.com/repos/:owner/:repo/git/refs
# Testing Syncthing interaction via REST api from scratch via command line
# Make sure you have xml2 and jq:
# apt intall xml2 jq
# Create docker network for the container instances
docker network create syncthing
# Create individual directories for each instance
mkdir -p syncthing1
@AndrewSav
AndrewSav / ReadWriteLock.ps1
Last active September 4, 2019 01:09
One Writer Multiple readers locking for Powershell. Readers and Writers should agree on `$maxReaders` parameter before hand and use the same one. Call `Lock-Read` or `Lock-Write` to lock and then `Unlock-Read` or `Unlock-Write` to unlock.
function WaitAnyMutexes($mutexes, $name, $timeout) {
try {
$result = [Threading.WaitHandle]::WaitAny($mutexes,$timeout)
if ($result -ne [Threading.WaitHandle]::WaitTimeout) {
return @{clean=$true; mutex=$mutexes[$result]; index=$result};
} else {
return $null
}
} catch [System.Threading.AbandonedMutexException]{
return @{clean=$false; mutex=$_.Exception.Mutex; index=$_.Exception.MutexIndex}
@AndrewSav
AndrewSav / GetSteamGuardCode.cs
Last active September 4, 2019 01:15
Calculates SteamGuard code from your base64 shared secret
string GetSteamGuardCode(string base64SharedSecret)
{
long time = (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds + 10;
byte[] timeHash = BitConverter.GetBytes(time/30).Reverse().ToArray();
HMACSHA1 hmac = new HMACSHA1(Convert.FromBase64String(base64SharedSecret));
hmac.Initialize();
byte[] hash = hmac.ComputeHash(timeHash);
int b = hash[19] & 0xF;
int codePoint = (hash[b] & 0x7F) << 24 | (hash[b + 1] & 0xFF) << 16 | (hash[b + 2] & 0xFF) << 8 | (hash[b + 3] & 0xFF);
string steamChars = "23456789BCDFGHJKMNPQRTVWXY";
@AndrewSav
AndrewSav / clone-all-twitter-github-repos.ps1
Last active February 10, 2017 10:41
Clone all github repos in an organisation
(Invoke-WebRequest "https://api.github.com/orgs/twitter/repos?per_page=200").Content | ConvertFrom-Json | %{ $_.clone_url } | %{ git clone $_}
@AndrewSav
AndrewSav / pln.cs
Last active January 5, 2023 19:07
TCP Port Listener
// This is a very basic TCP port listener that allows you to listen on a port range
// If you run this program outside of firewall and run a port scanner inside a firewall
// pointing to the ip address where this program runs, the port scanner will be able you
// to tell which exactly ports are open on the firewall
// This code will run on Windows, but most importantly also on linux.
// DigitalOcean.com has all ports for their VMs open by default. So spin a new VM,
// copy pln.cs in your (root) home folder and then run:
// sudo apt-get update
// sudo apt-get install mono-complete -y
// mcs pln.cs