Skip to content

Instantly share code, notes, and snippets.

@yoavst
yoavst / DPropagation.py
Created January 20, 2023 18:42
Const and variable propagation optimizer for JEB decompiler
#?type=dexdec-ir
from com.pnfsoftware.jeb.core.units.code.android.ir import AbstractDOptimizer, IDVisitor
class DPropagation(AbstractDOptimizer):
def perform(self):
cnt = 0
self.insns_to_delete = []
scan_result = list(self.scan())
if scan_result:
@yoavst
yoavst / radio.lua
Created June 6, 2020 15:07
Radio recorder
function descriptor()
return {
title = "Radio recorder",
version = "0.1",
author = "Yoav",
url = "",
shortdesc = "Radio recorder",
description = "Helps record the radio",
capabilities = { "input-listener" }
}
@yoavst
yoavst / dragonblood.md
Created May 30, 2020 16:13
Implementing Dragonblood

Implementing Dragonblood CVE-2019-9494 - Review

Background

As part of the Advance Workshop in Implementation of Cryptographic Attacks, we were instructed to implement a cache side channel attack library. As a demonstration, we attempted to implement the exploit in CVE-2019-9494[0], using our Cache side channel attack library "Artik" [1].

While we were able to implement the procedure as specified in the paper[2], we were unable to recreate the results described there. In the following review, we are to go over our attempt.

Setup

@yoavst
yoavst / readme.md
Last active December 20, 2021 13:09
Software 1

Java Cheatsheet

General concepts you've got to understand so everything could possibly make sense to you.

How a method is called

In java we have 2 concept of calling methods[1]:

  • Static dispatching - The Java compiler knows in compile time which function code block to call

  • Dynamic dispatching - The Java compilers inserts a code, that on runtime decides which function code block to call

@yoavst
yoavst / AlufWinner.kt
Created November 11, 2019 09:43
Aluf Hamikraot bot
package com.yoavst.testing.project
import android.content.Intent
import android.widget.ImageView
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.*
import org.hamcrest.MatcherAssert
import org.hamcrest.Matchers
import org.junit.Before
@yoavst
yoavst / timetableDownloader.py
Last active September 20, 2021 19:55
Timetable downloader
# -*- coding: utf-8 -*-
import io
import itertools
import json
from pyquery import PyQuery as pq
from selenium import webdriver
from selenium.webdriver.chrome.webdriver import WebDriver
SEMESTER = {
@yoavst
yoavst / WAVLInnerNode.java
Last active May 17, 2018 15:35
WAVL Tree
package il.ac.tau.cs.ds.hw1;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represent an inner (non-virtual) node in a {@link WAVLTree}.
*/
class WAVLInnerNode extends WAVLNode {
private int key;
@yoavst
yoavst / WAVLTreePrinter.java
Last active May 14, 2018 09:05
Print WAVLTree
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* Credit to Amitai Cohen, the creator of the original code in python.
* Ported by Yoav Sternberg
*/
class WAVLTreePrinter {
private WAVLTreePrinter(){}
@yoavst
yoavst / copy.kt
Created March 23, 2018 12:50
Code for hashcode2018
package com.yoavst.testing
import java.io.File
import java.util.*
import kotlin.math.absoluteValue
import kotlin.math.max
interface Locatable {
val x: Int
val y: Int
@yoavst
yoavst / bankDownloader.py
Last active February 12, 2019 12:03
Download tests from TAU tests storage
"""
Download tests from the tests bank, run with -help for parameters
Dependencies:
pip install pyquery
pip install requests
Usage: python3 Downloader.py -username USERNAME -id USER_ID -password PASS_IN_BASE64 -faculty FACULTY -department DEPARTMENT -filters FILTERS_FILE.txt
GUI usage: python3 Downloader.py gui
Use it only for downloading tests for self-usage. Do not use it for piracy.
Do Follow the site's terms of service: https://tinyurl.com/ya3qjbbn
TAU-Downloader Copyright (C) 2018 Yoav Sternberg