Skip to content

Instantly share code, notes, and snippets.

View Midi12's full-sized avatar
🏴‍☠️

Midi12

🏴‍☠️
View GitHub Profile
@Midi12
Midi12 / rsi_manifest.ksy
Created October 31, 2022 20:03
RSI Manifest file description
meta:
id: rsi_manifest
title: Roberts Space Industries Launcher Manifest file
application: RSI Launcher v1.2.1.0
file-extension:
- manifest
encoding: ascii
endian: le
types:
header:
@Midi12
Midi12 / opaque_predicates_ida.py
Created August 9, 2022 15:07
resolve opaque predicates
from idaapi import *
from idautils import *
from idc import *
from ida_funcs import *
from miasm.analysis.binary import Container
from miasm.analysis.machine import Machine
from miasm.core.locationdb import LocationDB
from miasm.ir.symbexec import SymbolicExecutionEngine
from miasm.core.bin_stream_ida import bin_stream_ida
@Midi12
Midi12 / slist_clone.c
Created March 30, 2022 13:26
slist clone for drafting on wandbox
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// LIFO Singly Linked List Windows API Clone for drafting and testing purpose
// Not taking account of memory alignment constraints of the original API
//
@Midi12
Midi12 / ffi_benchmark.dart
Created September 22, 2021 13:58
Benchmark ffi calls
import 'dart:core';
import 'dart:ffi';
final _libc = DynamicLibrary.open('libc.so.6');
typedef abs_t = Int32 Function(Int32);
typedef abs_d = int Function(int);
final _abs = _libc.lookupFunction<abs_t, abs_d>('abs');
@Midi12
Midi12 / bogosort.dart
Last active August 17, 2021 16:56
bogosort in dart
extension IsSorted<T extends Comparable> on List<T> {
bool get isSorted {
if (this.length <= 1) return true;
for (var i = 1; i < this.length; i++) {
if (this[i].compareTo(this[i - 1]) < 0) return false;
}
return true;
}
import 'dart:collection';
class A {
A();
}
class B extends A {
B() : super();
}
@Midi12
Midi12 / decipher_fishcheat.py
Last active April 28, 2021 13:31
Some string cipher resolution in some unknown fish cheat
'''
sub_180001F5C+34 mov rdx, 0C9A201E140208649h
sub_180001F5C+3E mov rcx, 213228A830CCCFFEh
sub_180001F5C+48 mov qword ptr [rbp+var_10], rdx
sub_180001F5C+4C mov qword ptr [rbp+var_10+8], rcx
sub_180001F5C+50 mov rax, 5068B50F657EF22h ; <- encrypted name
sub_180001F5C+5A movups xmm2, [rbp+var_10]
sub_180001F5C+5E mov qword ptr [rbp+ModuleName], rax
sub_180001F5C+62 mov r14, 5638B3DF636EF65h ; <- xor key
sub_180001F5C+6C mov qword ptr [rbp+var_40+8], rcx
@Midi12
Midi12 / disposable_struct.dart
Last active March 4, 2021 13:17
Simple memory manager for struct allocated in Dart using ffi
import 'dart:ffi';
// library
final DynamicLibrary _kernel32 = DynamicLibrary.open('kernel32.dll');
typedef HeapAllocNative_t = Pointer Function(Pointer, Uint32, IntPtr);
typedef HeapAlloc_d = Pointer Function(Pointer, int, int);
final HeapAlloc_d pfnHeapAlloc = _kernel32.lookupFunction<HeapAllocNative_t, HeapAlloc_d>('HeapAlloc');
typedef HeapFree_t = Int32 Function(Pointer heap, Uint32 flags, Pointer memory);
@Midi12
Midi12 / ida_name_vftable.py
Last active February 15, 2021 18:29
IDA script to rename vftable automatically
from idaapi import *
from idautils import *
from idc import *
from ida_typeinf import *
import re
IS64 = get_inf_structure().is_64bit()
print('64bit mode' if IS64 else '32bit mode')
sub_regex = re.compile(r'sub_[0-9A-F]+')
@Midi12
Midi12 / quick-postgresql-guide.md
Created February 7, 2021 11:52
Quick postgresql guide

Quick PostgreSql guide

Table of content

  • Install
  • Creating a database
  • Creating an user
  • Assigning rights
  • Creating a table
  • Inserting data into a table
  • Querying a table