Skip to content

Instantly share code, notes, and snippets.

Nir nirizr

Block or report user

Report or block nirizr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nirizr
nirizr / idatag.py
Last active Nov 29, 2018
Force IDA's G (goto) dialog to ignore the backtick/tag marker used in windbg when one copies and pastes
View idatag.py
try:
from PyQt5.QtWidgets import qApp, QTextEdit, QLineEdit, QComboBox, QPushButton
except ImportError:
from PySide.QtGui import qApp, QTextEdit, QLineEdit, QComboBox, QPushButton
def handle_tags(text):
# text handling is actually done here.
# we could improve this by doing something more clever than just a replace
# say, extend when ` are present without the full 8 bytes following, or
@nirizr
nirizr / full_upsert.py
Last active Sep 5, 2019
sqlalchemy upsert supporting delayed ORM insertion and duplicate removal (inside a single query)
View full_upsert.py
def upsert(session, model, rows):
table = model.__table__
stmt = postgresql.insert(table)
primary_keys = [key.name for key in inspect(table).primary_key]
update_dict = {c.name: c for c in stmt.excluded if not c.primary_key}
if not update_dict:
raise ValueError("insert_or_update resulted in an empty update_dict")
stmt = stmt.on_conflict_do_update(index_elements=primary_keys,
@nirizr
nirizr / idapython_get_stack_refs.py
Last active Aug 21, 2017
IDAPYTHON: List all references to all stack variables of a function
View idapython_get_stack_refs.py
import idc, idaapi, idautils, ida_xref
def find_stack_members(func_ea):
members = {}
base = None
frame = idc.GetFrame(func_ea)
for frame_member in idautils.StructMembers(frame):
member_offset, member_name, _ = frame_member
members[member_offset] = member_name
if member_name == ' r':
You can’t perform that action at this time.