Skip to content

Instantly share code, notes, and snippets.

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

Midi12

🏴‍☠️
View GitHub Profile
@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;
}
@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 / 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 / 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 / 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: