Skip to content

Instantly share code, notes, and snippets.

View ikonst's full-sized avatar

Ilya Priven ikonst

  • New York, NY
  • 11:56 (UTC -04:00)
View GitHub Profile
@ikonst
ikonst / libusb-1.0.9-android-log.patch
Created August 14, 2012 14:25
libusb 1.0.9 Android logging patch
--- libusb-1.0.9/libusb/core.c Fri Apr 20 09:44:27 2012
+++ libusb-1.0.9/libusb/core.c Tue Aug 14 17:29:08 2012
@@ -31,6 +31,10 @@
#include <sys/time.h>
#endif
+#ifdef __ANDROID__
+#include <android/log.h>
+#endif
+
@ikonst
ikonst / MountInfo.java
Created August 19, 2012 12:50
Java code to parse /proc/mounts.
import java.io.*;
import java.nio.charset.Charset;
import java.util.*;
/**
* Parses of /proc/mounts.
*/
public class MountInfo {
@ikonst
ikonst / ActiveDirectoryToVcf.vbs
Created August 22, 2012 00:04
Gets Active Directory user information into a VCF file of VCards you can import into your phone or contacts app
set iAdRootDSE = GetObject("LDAP://RootDSE")
namingContext = iAdRootDSE.Get("defaultNamingContext")
If WScript.Arguments.Count = 1 Then
namingContext = WScript.Arguments.Item(0)
Else
Wscript.Echo "Usage: ActiveDirectoryToVcf.vbs [Naming Context]"
Wscript.Echo "Default path is " & namingContext
End If
@ikonst
ikonst / eabi-wchar.c
Last active September 28, 2020 12:40
Patches ELF (EABI) ARM attribute Tag_ABI_PCS_wchar_t.
/*
* Patches ELF (EABI) ARM attribute Tag_ABI_PCS_wchar_t.
*
* This utility's chief purpose is to remove the flag indicating sizeof(wchar_t)
* from ARM EABI binaries -- or more precisely, setting it to 0 (= undefined).
*
* It is useful to mark libraries which don't use wchar_t at all as wchar_t-width-agnostic.
* This way, they can be linked to both sizeof(wchar_t)=2 and sizeof(wchar_t)=4 programs
* without any warnings.
*
@ikonst
ikonst / putty.iss.patch
Created November 9, 2012 15:35
PuTTY InnoSetup "Add to PATH" patch
Index: putty.iss
===================================================================
--- putty.iss (revision 9586)
+++ putty.iss (working copy)
@@ -77,6 +77,9 @@
Name: desktopicon\user; Description: "For the current user only"; GroupDescription: "Additional icons:"; Flags: exclusive unchecked
Name: quicklaunchicon; Description: "Create a &Quick Launch icon for PuTTY (current user only)"; GroupDescription: "Additional icons:"; Flags: unchecked
Name: associate; Description: "&Associate .PPK files (PuTTY Private Key) with Pageant and PuTTYgen"; GroupDescription: "Other tasks:"
+Name: path; Description: "Add PuTTY to the system &path"; GroupDescription: "Other tasks:"
+Name: path\common; Description: "For all users"; GroupDescription: "Other tasks:"; Flags: exclusive unchecked
@ikonst
ikonst / git_tfs_add_date.pl
Created March 31, 2014 16:43
git commit message filter that adds the original committer timestamp to the comment. (This is due to the fact that it's impossible to specify a timestamp during TFS checkin.)
#!/usr/bin/perl
#
# Execute with:
#
# git filter-branch -f --msg-filter 'perl /path/to/git_tfs_add_date.pl' HEAD
#
use POSIX;
open INPUT, "<-";
$ENV{'GIT_COMMITTER_DATE'} =~ /^@(.*) \+(\d\d)(\d\d)/;
@ikonst
ikonst / addsym.cpp
Last active February 19, 2020 17:06
Adds IDA symbols as WinDbg synthetic symbols
// Adds IDA symbols as WinDbg synthetic symbols
//
// Original code by 'blabb'.
//
// See:
// http://www.woodmann.com/forum/entry.php?262-addsym-windbg-extension-%28extension-to-load-names-from-ida-to-windbg%29
// http://reverseengineering.stackexchange.com/questions/3850/importing-list-of-functions-and-addresses-into-windbg
#include <engextcpp.hpp>
@ikonst
ikonst / gst.py
Last active August 29, 2015 14:14
GStreamer extensions for LLDB
# To use:
# 1) Save to $HOME
# 2) echo 'command script import ~/gst.py' >> ~/.lldbinit
# 3) From within lldb:
#
# To open pipeline graph in Graphviz:
#
# gst_dot foobar
#
# foobar: any expression of type GstObject* -- e.g. GstElement*, GstPad* or GstBin*
@ikonst
ikonst / gist:8f94b537731d8a1744cb
Created March 31, 2015 13:43
Connecting GLib g_log to NSLog
void my_log_handler(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data)
{
NSLog(@"%@", [NSString stringWithUTF8String:message]);
}
...
g_log_set_default_handler( my_log_handler, NULL);
@ikonst
ikonst / applemedia-setjmp-longjmp.patch
Created April 5, 2015 03:33
avfvideosrc: setjmp/longjmp patch
From c3199506fd03e77b61cd6fdfbd8184e1effb28ba Mon Sep 17 00:00:00 2001
From: Ilya Konstantinov <ilya.konstantinov@gmail.com>
Date: Sun, 5 Apr 2015 05:39:14 +0300
Subject: [PATCH] applemedia: setjmp/longjmp
Migrate the pipeline into the AVFoundation dispatch queue thread
to enable operation without context switching and unneeded yielding.
---
sys/applemedia/avfvideosrc.m | 101 ++++++++++++++++++++++++++++---------------
1 file changed, 66 insertions(+), 35 deletions(-)