Skip to content

Instantly share code, notes, and snippets.

View BOOtak's full-sized avatar

Kirill Leyfer BOOtak

View GitHub Profile
@BOOtak
BOOtak / deinterleave.py
Created August 16, 2022 15:48
MFM disk drive deinterleave script
#!/usr/bin/env python3
import sys
block_size = 512
interleave = [14, 15, 16, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
deinterleave = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 1, 2]
def arr_split(data, split_size):
res = []
@BOOtak
BOOtak / main.c
Created February 11, 2021 14:10
Exit status parser
#include <sys/types.h>
#include <sys/wait.h>
#include <iostream>
int main() {
int status = 0x137f;
if (WIFEXITED(status)) {
std::cout << "Finished successfully" << std::endl;
@BOOtak
BOOtak / main.cpp
Last active August 22, 2018 11:44
Bind template wrapper for __thiscall
#include <iostream>
#include <functional>
class BaseCmd
{
public:
virtual ~BaseCmd() {}
virtual void call() = 0;
};
@BOOtak
BOOtak / call.log
Created July 10, 2018 07:25
qemu call & sms logcat
07-10 10:23:22.982 1864 1864 I InCall : CallCardPresenter - Disconnecting call: [Call_1, ACTIVE, [Capabilities: CAPABILITY_HOLD CAPABILITY_SUPPORT_HOLD CAPABILITY_MUTE CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO], [Properties:], children:[], parent:null, conferenceable:[], videoState:Audio Only, mSessionModificationState:0, VideoSettings:(CameraDir:-1)]
07-10 10:23:22.982 1864 1864 I InCall : CallList - onUpdate - [Call_1, DISCONNECTING, [Capabilities: CAPABILITY_HOLD CAPABILITY_SUPPORT_HOLD CAPABILITY_MUTE CAPABILITY_CANNOT_DOWNGRADE_VIDEO_TO_AUDIO], [Properties:], children:[], parent:null, conferenceable:[], videoState:Audio Only, mSessionModificationState:0, VideoSettings:(CameraDir:-1)]
07-10 10:23:22.982 1864 1864 I InCall : InCallPresenter - Phone switching state: INCALL -> INCALL
07-10 10:23:22.982 1864 1864 D AccelerometerListener: enable(false)
07-10 10:23:22.982 1864 1864 I InCall : ProximitySensor - ProximitySensor{keybrd=0, dpad=0, offhook=0, hor=0, ui=1, aud=EARPIECE}
07-10 10:23:22.
#include <ncurses.h>
#include <thread>
#define CURSOR_INVISIBLE 0
int main() {
keypad(stdscr, true);
nodelay(stdscr, true);
initscr();
curs_set(CURSOR_INVISIBLE);
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <unistd.h>
#define TIMEOUT 1
#define EXIT_STATUS_SUCCESS 0
#include <stdio.h>
typedef void (*greet_name)(char* name);
void greet_gracefully(char* name) {
printf("Hello, good sir %s\n", name);
}
void greet_ilya(greet_name callback) {
callback("Ilya");
int __fastcall sub_B000(char *a1)
{
int i; // r3@1
int v2; // r3@2
char *v3; // r0@9
int v4; // r1@9
int v5; // t1@9
int v6; // r3@9
int v7; // t1@11
int v8; // t1@14
public static void hackyLog(String msg) {
try {
throw new Exception("hack :-)");
}
catch(Exception exception0) {
String[] array_string = exception0.getStackTrace()[1].getClassName().split("\\.");
Log.d("paranoid.me_" + array_string[array_string.length - 1], "[" + exception0.getStackTrace()[
1].getMethodName() + ":" + exception0.getStackTrace()[1].getLineNumber() + "] " +
msg);
return;
#!/bin/sh
# get your audio device name by
# pactl list | grep -A2 'Source' | grep input
# command
gst-launch-1.0 -e \
ximagesrc startx=0 use-damage=0\
! 'video/x-raw,framerate=30/1'\
! queue\
! mix. \