Skip to content

Instantly share code, notes, and snippets.

Avatar
✝️
God bless America.

Raki Saionji rakisaionji

✝️
God bless America.
View GitHub Profile
@rakisaionji
rakisaionji / get_eruda.js
Created Apr 18, 2022
Console and Inspection for Mobile Browsers. Source: https://github.com/liriliri/eruda
View get_eruda.js
javascript:(
function () {
var script = document.createElement('script');
script.src="//cdn.jsdelivr.net/npm/eruda";
document.body.appendChild(script);
script.onload = function () { eruda.init() }
}
)();
View xrd_decrypter.cpp
#include <iostream>
#include <fstream>
#include <memory>
#include <string>
#include <algorithm>
void process_crypt_table(unsigned *crypt_table)
{
for (auto i = 0; i < 227; i++)
{
@rakisaionji
rakisaionji / FileListToSfv.cs
Created Jan 10, 2022
Converting a file list with CRC32 checksum data to a SFV checksum file.
View FileListToSfv.cs
using System;
using System.IO;
class Program
{
static void Main(string[] args)
{
var listFile = "list.txt";
var hashFile = "crc32.sfv";
@rakisaionji
rakisaionji / AmazonS3Demo.cs
Created Apr 1, 2021
List all files with filename under an Amazon S3 folder using ListObjects feature. No special permissions needed, just to save cost.
View AmazonS3Demo.cs
using Amazon.S3;
using System;
class Program
{
static void Main(string[] args)
{
var bucketName = "my-bucket";
string accessKeyId = "my-access-key-id";
string secretAccessKey = "secret-access-key-id";
@rakisaionji
rakisaionji / ListInputDevices.cs
Created Mar 25, 2021
A spaghetti piece of code to list all raw input devices.
View ListInputDevices.cs
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);
@rakisaionji
rakisaionji / GetS3ETagForLocalFile.cs
Last active Mar 23, 2021
Compute Amazon S3 ETag for a local file. Converted from original PowerShell script at: https://gist.github.com/fireflycons/de3a5255b77d94292c5ad43c602b6d7d
View GetS3ETagForLocalFile.cs
using System;
partial class Program
{
/*
.SYNOPSIS
Compute Amazon S3 ETag for a local file
.DESCRIPTION
@rakisaionji
rakisaionji / CakeTest.cs
Created Mar 15, 2021
Testing a native DLL with C#.
View CakeTest.cs
using System;
using System.Runtime.InteropServices;
namespace CakeTest
{
class Program
{
[DllImport("Cake")]
private static extern IntPtr GetHttpEncryptHeader();
@rakisaionji
rakisaionji / iatextract.c
Created Feb 27, 2021
Dumps IAT table from existing PE file.
View iatextract.c
#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 / iatpecker.cs
Last active Feb 27, 2021
Building IAT table from x86dbg exported databases and idata binary.
View iatpecker.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace iatpecker
{
class Program
{
@rakisaionji
rakisaionji / checksums.c
Created Jan 7, 2021
Fast implementation of popular checksum algorithms in simple C language.
View checksums.c
#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;
}