Skip to content

Instantly share code, notes, and snippets.

View ursachec's full-sized avatar

Claudiu-Vlad Ursache ursachec

View GitHub Profile
import io.shiftleft.codepropertygraph.Cpg
import io.shiftleft.semanticcpg.language._
import scala.io.Source
// joern --script hardcoded_creds.sc --params binaryIn=/home/claudiu/src/joern/artifacts/mtfwu
@main def exec(binaryIn: String) = {
importCode.ghidra(binaryIn)
val decompiledBinary = cpg.method.dumpRaw.mkString("\n")
val entry = Source.fromFile("entry.c").getLines.mkString
importCode.c.fromString(decompiledBinary + "\n\n" + entry)
class Annotator(object):
    def __init__(self, nlp, **kwargs):
        # `nlp` is a spaCy Language object
        self.nlp = nlp

    def annotate(self, agr, rules):
        """ `agr` (short for Agreement) is a tree-like data structure.
        A node of the tree (class `Element`) has a `tag` (e.g. PREAMBLE, SECTION) and may have 

Keybase proof

I hereby claim:

  • I am ursachec on github.
  • I am ursachec (https://keybase.io/ursachec) on keybase.
  • I have a public key whose fingerprint is A7FF BC47 0060 AC4A 619B 852F 37B9 05E7 113D B932

To claim this, I am signing this object:

@ursachec
ursachec / random_dev_null.sh
Created January 8, 2014 22:05
Read random bytes with dd from /dev/random and format with hexdump.
dd if=/dev/urandom bs=1 count=2 2>/dev/null | hexdump -v -e '1/1 "%u"'; echo;
@ursachec
ursachec / mrt_timer.h
Last active December 21, 2015 23:49
Macros for measuring running times in C.
#ifndef __mrt_timer_h__
#define __mrt_timer_h__
#include <sys/time.h>
#define mrt_timer_setup() \
struct timeval mrt_te; \
time_t mrt_start = 0, mrt_end = 0;
#define mrt_timer_start() \
@ursachec
ursachec / build-libevent-ios.sh
Last active June 30, 2023 07:22
libevent build script for iOS
#!/bin/bash
set -u
# Setup architectures, library name and other vars + cleanup from previous runs
ARCHS=("armv7" "armv7s" "i386")
SDKS=("iphoneos" "iphoneos" "macosx")
LIB_NAME="libevent-2.0.21-stable"
TEMP_DIR="$(pwd)/tmp"
TEMP_LIB_PATH="$(pwd)/tmp/${LIB_NAME}"
@ursachec
ursachec / build-openssl-ios-steps.sh
Created August 13, 2013 19:22
Steps for building openssl for iOS
# Make a directory in which to run the build
mkdir ~/openssl-ios
cd ~/openssl-ios
# Download the openssl source (verify the file before using it in production!)
curl -O http://www.openssl.org/source/openssl-1.0.1e.tar.gz
# Download the openssl iOS build script
curl -O https://raw.github.com/Raphaelios/raphaelios-scripts/master/openssl/build-openssl.sh
@ursachec
ursachec / build-openssl.sh
Created August 13, 2013 19:15
openssl build script for iOS
#!/bin/bash
set -u
# Setup architectures, library name and other vars + cleanup from previous runs
ARCHS=("armv7s" "armv7" "i386")
SDKS=("iphoneos" "iphoneos" "macosx")
LIB_NAME="openssl-1.0.1e"
TEMP_LIB_PATH="/tmp/${LIB_NAME}"
LIB_DEST_DIR="lib"
HEADER_DEST_DIR="include"
[NON-repeating event: r ]
{0 : 31178732, 1 : 33620352, 2 : 10, 3 : 0, 4 : 0, 5 : 0, 6 : 0, 7 : 0, 8 : 0, 9 : -2028929489, 10 : 59081, 11 : 0, 12 : 0, 13 : 9936, 14 : 162, 15 : 7471125, 16 : 16580722, 17 : 7471105, }
[repeating event: r ]
{0 : 31178732, 1 : 33620352, 2 : 10, 3 : 0, 4 : 0, 5 : 0, 6 : 0, 7 : 0, 8 : 0, 9 : -1528719789, 10 : 59081, 11 : 0, 12 : 0, 13 : 9936, 14 : 162, 15 : 7471125, 16 : 16580722, 17 : 7471105, }
[repeating event: r ]
{0 : 31178732, 1 : 33620352, 2 : 10, 3 : 0, 4 : 0, 5 : 0, 6 : 0, 7 : 0, 8 : 0, 9 : -1445174829, 10 : 59081, 11 : 0, 12 : 0, 13 : 9936, 14 : 162, 15 : 7471125, 16 : 16580722, 17 : 7471105, }
[repeating event: r ]
@ursachec
ursachec / howto_git_precommit_hook_nslog.markdown
Created April 23, 2013 14:22
How-To: git pre-commit hook for NSLog calls

How-To: git pre-commit hook for NSLog calls

  1. Download the NSLog pre-commit hook from https://gist.github.com/plu/4124580

  2. Copy the pre-commit file to YOUR_PROJECT/.git/hooks/pre-commit

  3. Make the hook executable by running

chmod +x .git/hooks/pre-commit