Skip to content

Instantly share code, notes, and snippets.

View rakisaionji's full-sized avatar
✝️
God bless America.

Raki Saionji rakisaionji

✝️
God bless America.
View GitHub Profile
@rakisaionji
rakisaionji / vc_redist_x64.ps1
Created July 2, 2018 09:32
Download Microsoft Visual C++ 2015 Redistributable Pack
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$workingdir = (Get-Location).Path
if($PSVersiontable.PSVersion.Major -lt 3)
{
Write-Warning "Please download Microsoft Visual C++ 2015 Redistributable Pack and place it in the same folder as this script."
Write-Output "Download from: https://www.microsoft.com/en-us/download/details.aspx?id=52685"
Write-Output ("Save to this directory: $workingdir" -f (Get-Location).Path)
# iexplore.exe https://download.microsoft.com/download/0/6/4/064F84EA-D1DB-4EAA-9A5C-CC2F0FF6A638/vc_redist.x64.exe
Read-Host "Press Enter when you're done!"
}
@rakisaionji
rakisaionji / atomicflush.bat
Last active December 18, 2018 13:33
Remove unnecessary atoms out of M4A files converted by foobar2000.
@echo off
@chcp 65001 > nul
for %%f in (input\*.m4a) do (
@atomicparsley "%%f" -DeepScan --manualAtomRemove "moov.udta.meta.ilst.©too" --manualAtomRemove "moov.udta.meta.ilst.apID" --manualAtomRemove "moov.udta.meta.ilst.atID" --manualAtomRemove "moov.udta.meta.ilst.cnID" --manualAtomRemove "moov.udta.meta.ilst.geID" --manualAtomRemove "moov.udta.meta.ilst.plID" --manualAtomRemove "moov.udta.meta.ilst.sfID" --manualAtomRemove "moov.udta.meta.ilst.cprt" --manualAtomRemove "moov.udta.meta.ilst.flvr" --manualAtomRemove "moov.udta.meta.ilst.purd" --manualAtomRemove "moov.udta.meta.ilst.rtng" --manualAtomRemove "moov.udta.meta.ilst.soal" --manualAtomRemove "moov.udta.meta.ilst.stik" --manualAtomRemove "moov.udta.meta.ilst.xid" --manualAtomRemove "moov.udta.meta.ilst.----.name:[iTunSMPB]" --manualAtomRemove "moov.udta.meta.ilst.----.name:[Encoding Params]" --manualAtomRemove "moov.trak.mdia.minf.stbl.stsd.mp4a.pinf" -W > nul
)
@echo on
@rakisaionji
rakisaionji / CF-U1-BIOS.md
Created May 20, 2020 05:30 — forked from en4rab/CF-U1-BIOS.md
Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

A mess of my own making

While messing with a CF-U1 handheld PC that I bought off ebay I managed to mess up the BIOS and it seems it reverted to previous settings which included an unknown BIOS password, it would however still boot into windows. Since I could still boot windows I was able to dump the bios flash using AFUWINGUI.EXE the version I used was 3.09.03.1462 which is available here:
https://ami.com/en/?Aptio_4_AMI_Firmware_Update_Utility.zip

# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@rakisaionji
rakisaionji / checksums.c
Created January 7, 2021 12:30
Fast implementation of popular checksum algorithms in simple C language.
#include <stddef.h>
unsigned int adler32(unsigned int adler, const unsigned char* buf, size_t len)
{
unsigned int a, b;
if (adler)
{
a = adler & 0x0000ffff;
b = (adler >> 16) & 0x0000ffff;
}
@rakisaionji
rakisaionji / imgfile.h
Last active February 8, 2021 19:54
Structure declaration for a certain game image.
#pragma once
#define IMG_OPEN_NEW 1
#define IMG_OPEN_READ 2
#define IMG_OPEN_WRITE 3
#define IMG_KEYIV_SIZE 0x20
#define IMG_SIGNATURE_SIZE 0x200
#define IMG_BLOCK_SIZE 0x1000
#define IMG_BOOT_INFO_SIZE 0x2800
@rakisaionji
rakisaionji / iatpecker.cs
Last active February 27, 2021 11:02
Building IAT table from x86dbg exported databases and idata binary.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace iatpecker
{
class Program
{
@rakisaionji
rakisaionji / iatextract.c
Created February 27, 2021 11:08
Dumps IAT table from existing PE file.
#include <windows.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
if (argc < 2) goto SHOW_HELP;
char fileName[MAX_PATH] = { 0 };
memcpy_s(&fileName, MAX_PATH, argv[1], MAX_PATH);
@rakisaionji
rakisaionji / GetS3ETagForLocalFile.cs
Last active March 23, 2021 09:58
Compute Amazon S3 ETag for a local file. Converted from original PowerShell script at: https://gist.github.com/fireflycons/de3a5255b77d94292c5ad43c602b6d7d
using System;
partial class Program
{
/*
.SYNOPSIS
Compute Amazon S3 ETag for a local file
.DESCRIPTION
@rakisaionji
rakisaionji / ListInputDevices.cs
Created March 25, 2021 16:15
A spaghetti piece of code to list all raw input devices.
using System;
using System.Runtime.InteropServices;
class Program
{
[DllImport("user32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
private static extern uint GetRawInputDeviceList([In][Out] RawInputDeviceList[] RawInputDeviceList, ref uint NumDevices, uint Size);
[DllImport("user32.dll", CharSet = CharSet.Ansi, SetLastError = true)]
private static extern uint GetRawInputDeviceInfo(IntPtr hDevice, RawInputDeviceInfo command, IntPtr pData, ref uint size);