View pls.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import z3 | |
a = z3.BitVec("a", 8) | |
b = z3.BitVec("b", 8) | |
c = z3.BitVec("c", 8) | |
d = z3.BitVec("d", 8) | |
e = z3.BitVec("e", 8) | |
solver = z3.SolverFor("QF_BV") |
View tokenize_line.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ida_lines | |
import ida_kernwin | |
from enum import Enum | |
def tokenize_line(line): | |
COLOR_ON = "\x01" | |
COLOR_OFF = "\x02" | |
blacklist = ["SCOLOR_ON", "SCOLOR_OFF", "SCOLOR_ESC", "SCOLOR_INV", "SCOLOR_UTF8", "SCOLOR_FG_MAX"] | |
tag_mapping = Enum("TagMapping", {x: getattr(ida_lines, x) for x in dir(ida_lines) if (x.startswith("SCOLOR_") and x not in blacklist)}) |
View get_prob_ida.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ida_ida | |
import ida_problems | |
import ida_idaapi | |
from enum import IntEnum | |
PrType = IntEnum("PrType", {x: getattr(ida_problems, x) for x in dir(ida_problems) if x.startswith("PR_") and x!="PR_END"}) | |
problems = {} |
View ida_snapshot_iter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ida_kernwin | |
import ida_loader | |
ss = ida_loader.snapshot_t() | |
ida_loader.build_snapshot_tree(ss) | |
ccs = list(ss.children) | |
def callback(param1, param2): |
View deadline_exec.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing import Process, Queue | |
def deadline(timeout, f, *args): | |
queue = Queue() #using to get the result | |
def subproc_function(queue, f, *args): | |
res = f(*args) | |
queue.put(res) | |
proc = Process(target=subproc_function, args=(queue, f) +args) #creation of a process calling longfunction with the specified arguments | |
proc.start() #lauching the processus on another thread | |
try: | |
res = queue.get(timeout=timeout) #getting the resultat under 1 second or stop |
View connect_kernel_client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = "/run/user/1000/jupyter/kernel-7365.json" | |
from jupyter_client.blocking import BlockingKernelClient | |
client = BlockingKernelClient(connection_file=file) | |
client.load_connection_file() | |
client.start_channels() |
View wiki_first_image.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import lxml.html | |
from path import Path | |
import wikipedia | |
import requests | |
def dl_image(search_str): | |
page = wikipedia.page(search_str) | |
html = lxml.html.fromstring(page.html()) | |
imgs = html.xpath("//img") |
View screenshot_webpage.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import webdriver | |
import sys | |
url_input = ("file://" if not sys.argv[1].startswith("http") else "") + sys.argv[1] | |
image_output = sys.argv[2] | |
driver = webdriver.Chrome() # or PhantomJS() not to open a windows (require phantomjs) | |
driver.get(url_input) | |
if driver.save_screenshot(image_output): | |
print("Save ok !") |
View bin_diff.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
#require zsh and colordiff (credits: https://superuser.com/questions/125376/how-do-i-compare-binary-files-in-linux) | |
diff -y <(xxd $1) <(xxd $2) | colordiff |
NewerOlder