Skip to content

Instantly share code, notes, and snippets.

View aquynh's full-sized avatar

Nguyen Anh Quynh aquynh

View GitHub Profile
@aquynh
aquynh / convert_teegris_tas.py
Created April 1, 2024 17:15 — forked from astarasikov/convert_teegris_tas.py
Exynos9820 TEEGRIS TZAR unpack script
#!/usr/bin/env python3
# Usage: python convert_teegris_tas.py ~/Downloads/sw/pda/s10/fw/fw_G973FXXU4BTA8/AP/vendor/tee/
import os
import sys
from textwrap import wrap
def teegris_ta_to_elf(path_from, path_to):
with open(path_from, 'rb') as fin:
with open(path_to, 'wb') as fout:
from __future__ import print_function
from unicorn import *
from unicorn.arm64_const import *
from unicorn.arm_const import *
from unicorn.m68k_const import *
from unicorn.mips_const import *
from unicorn.sparc_const import *
from unicorn.unicorn_const import *
from unicorn.x86_const import *
@aquynh
aquynh / uapc_inject.py
Created March 18, 2017 21:47 — forked from dfirfpi/uapc_inject.py
QueueUserAPC injection Python demo test
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017, Francesco "dfirfpi" Picasso <francesco.picasso@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@aquynh
aquynh / cover_re.py
Created March 7, 2017 05:45 — forked from John-K/cover_re.py
Reverse Engineering a Book Cover
#!/bin/env python2
# -*- coding: utf-8 -*-
# Solution to Book Cover Crackme from "Praktyczna inżynieria wstecznia
# Edited by Gynvael Coldwind and Mateusz Jurczyk. (Applied Reverse Engineering)
# PWN Bookstore: https://ksiegarnia.pwn.pl/Praktyczna-inzynieria-wsteczna,622427233,p.html
#
# Props to @radekk for his excellent writeup and for capturing the flag. Read his
# writeup at https://vulnsec.com/2017/reverse-engineering-a-book-cover/
#
# This was a fun opportunity to learn how to use Unicorn Engine, Capstone Engine,
from keystone import *
from capstone import *
from unicorn import *
from unicorn.x86_const import *
from struct import *
from termcolor import *
import os
import sys
@aquynh
aquynh / armemu.py
Created June 27, 2016 09:40 — forked from mattypiper/armemu.py
ARM Assembly, Emulation, Disassembly using Keystone, Unicorn, and Capstone
#!/usr/bin/python
import sys
from keystone import *
from unicorn import *
from unicorn.arm_const import *
from capstone import *
from capstone.arm import *
from capstone.x86 import *
diff --git a/lib/Target/Mips/Disassembler/MipsDisassembler.cpp b/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
index 5d594f1..dd1a29b 100644
--- a/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
+++ b/lib/Target/Mips/Disassembler/MipsDisassembler.cpp
@@ -247,6 +247,11 @@ static DecodeStatus DecodeCacheOp(MCInst &Inst,
uint64_t Address,
const void *Decoder);
+static DecodeStatus DecodeSyncI(MCInst &Inst,
+ unsigned Insn,
--- ptrace/disasm.c 2014-04-10 10:30:33.000000000 +1200
+++ ptrace/disasm2.c 2014-09-04 12:52:53.425315639 +1200
@@ -4,28 +4,21 @@
try:
from ptrace.cpu_info import CPU_I386, CPU_X86_64
- try:
- from distorm3 import Decode
- if CPU_X86_64:
- from distorm3 import Decode64Bits as DecodeBits