Skip to content

Commit

Permalink
add ida 9.0 support
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Sep 8, 2024
1 parent 7a58008 commit b7378db
Show file tree
Hide file tree
Showing 67 changed files with 216 additions and 288 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
python-version: [3.9, "3.10", 3.11, 3.12]

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install setuptools wheel twine build
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,6 @@ venv.bak/

# config
config.ini

# setuptools-scm
fa/_version.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Pull Requests are of course more than welcome :smirk:.

## Requirements

Supported IDA 7.x.
Supported IDA 8.0+.

In your IDA's python directory, run:

Expand Down
2 changes: 1 addition & 1 deletion elf_loader.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from elftools.elf import elffile
import click
from elftools.elf import elffile

from fa import fainterp

Expand Down
1 change: 1 addition & 0 deletions fa/commands/add.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''add an hard-coded value into resultset
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/add_offset_range.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from argparse import RawTextHelpFormatter
from fa import utils

from fa import utils

DESCRIPTION = '''adds a python-range to resultset
Expand Down
1 change: 1 addition & 0 deletions fa/commands/align.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''align results to given base (round-up)
Expand Down
3 changes: 2 additions & 1 deletion fa/commands/argument.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from argparse import RawTextHelpFormatter
from fa import utils, context

from fa import context, utils

try:
import ida_typeinf
Expand Down
1 change: 1 addition & 0 deletions fa/commands/b.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''branch unconditionally to label
Expand Down
1 change: 1 addition & 0 deletions fa/commands/clear.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''clears the current result-set
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/find_bytes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from argparse import RawTextHelpFormatter
import binascii
from argparse import RawTextHelpFormatter

from fa import utils

Expand Down
2 changes: 1 addition & 1 deletion fa/commands/find_bytes_ida.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from argparse import RawTextHelpFormatter

from fa import utils, context
from fa import context, utils

DESCRIPTION = '''expands the result-set with the occurrences of the given bytes
expression in "ida bytes syntax"
Expand Down
9 changes: 4 additions & 5 deletions fa/commands/find_immediate.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from argparse import RawTextHelpFormatter

from fa import utils, context
from fa import context, utils

try:
import idc
import ida_search
import idc
except ImportError:
pass

Expand Down Expand Up @@ -34,11 +34,10 @@ def find_immediate(expression):
if isinstance(expression, str):
expression = eval(expression)

ea, imm = ida_search.find_imm(0, idc.SEARCH_DOWN, expression)
ea, imm = ida_search.find_imm(0, ida_search.SEARCH_DOWN, expression)
while ea != idc.BADADDR:
yield ea
ea, imm = idc.find_imm(ea + 1, idc.SEARCH_DOWN,
expression)
ea, imm = idc.find_imm(ea + 1, ida_search.SEARCH_DOWN, expression)


def run(segments, args, addresses, interpreter=None, **kwargs):
Expand Down
3 changes: 2 additions & 1 deletion fa/commands/find_str.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import binascii
import sys
from argparse import RawTextHelpFormatter
import binascii

import six

from fa.commands import find_bytes
Expand Down
4 changes: 2 additions & 2 deletions fa/commands/function_end.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from argparse import RawTextHelpFormatter
from fa import utils
from fa import context

from fa import context, utils

try:
import idc
Expand Down
3 changes: 2 additions & 1 deletion fa/commands/function_lines.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from argparse import RawTextHelpFormatter
from fa import utils, context

from fa import context, utils

try:
import idautils
Expand Down
3 changes: 2 additions & 1 deletion fa/commands/function_start.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from argparse import RawTextHelpFormatter
from fa import utils, context

from fa import context, utils

try:
import idc
Expand Down
3 changes: 2 additions & 1 deletion fa/commands/goto_ref.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from argparse import RawTextHelpFormatter
from fa import utils, context

from fa import context, utils

try:
import idautils
Expand Down
1 change: 1 addition & 0 deletions fa/commands/if.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''perform an 'if' statement to create conditional branches
Expand Down
1 change: 1 addition & 0 deletions fa/commands/intersect.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''intersect two or more variables
Expand Down
3 changes: 2 additions & 1 deletion fa/commands/keystone_find_opcodes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

try:
# flake8: noqa
from keystone import *
Expand All @@ -7,8 +8,8 @@

import binascii

from fa.commands import find_bytes
from fa import utils
from fa.commands import find_bytes

DESCRIPTION = '''use keystone to search for the supplied opcodes
Expand Down
3 changes: 2 additions & 1 deletion fa/commands/keystone_verify_opcodes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

try:
# flake8: noqa
from keystone import *
Expand All @@ -8,8 +9,8 @@

import binascii

from fa.commands import verify_bytes
from fa import utils
from fa.commands import verify_bytes

DESCRIPTION = '''use keystone to verify the result-set matches the given
opcodes
Expand Down
1 change: 1 addition & 0 deletions fa/commands/load.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''go back to previous result-set saved by 'store' command.
Expand Down
3 changes: 2 additions & 1 deletion fa/commands/locate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from argparse import RawTextHelpFormatter
from fa import utils, context

from fa import context, utils

try:
import idc
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/make_code.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fa import utils, context
from fa import context, utils

try:
import idc
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/make_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
except ImportError:
pass

from fa import utils, context
from fa import context, utils

DESCRIPTION = '''add comment for given addresses
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/make_function.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fa import utils, context
from fa import context, utils

try:
import ida_funcs
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/make_literal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fa import utils, context
from fa import context, utils

try:
import idc
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/make_unknown.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fa import utils, context
from fa import context, utils

try:
import ida_bytes
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/max_xrefs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fa import utils, context
from fa import context, utils

try:
import idautils
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/min_xrefs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fa import utils, context
from fa import context, utils

try:
import idautils
Expand Down
1 change: 1 addition & 0 deletions fa/commands/most_common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''get the result appearing the most in the result-set
Expand Down
1 change: 1 addition & 0 deletions fa/commands/offset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''advance the result-set by a given offset
Expand Down
3 changes: 2 additions & 1 deletion fa/commands/operand.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from argparse import RawTextHelpFormatter
from fa import utils, context

from fa import context, utils

try:
import idc
Expand Down
1 change: 1 addition & 0 deletions fa/commands/python_if.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''perform an 'if' statement to create conditional branches
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/set_enum.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fa import utils, fa_types
from fa import fa_types, utils


def get_parser():
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/set_struct_member.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fa import utils, fa_types
from fa import fa_types, utils


def get_parser():
Expand Down
4 changes: 2 additions & 2 deletions fa/commands/set_type.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from fa import utils, fa_types, context
from fa import context, fa_types, utils

try:
import idc
import ida_auto
import idc
except ImportError:
pass

Expand Down
1 change: 1 addition & 0 deletions fa/commands/single.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''peek a single result from the result-set (zero-based)
Expand Down
1 change: 1 addition & 0 deletions fa/commands/sort.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''performs a sort on the current result-set
Expand Down
1 change: 1 addition & 0 deletions fa/commands/stop_if_empty.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''exit if current resultset is empty
Expand Down
1 change: 1 addition & 0 deletions fa/commands/store.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''save current result-set in a variable.
Expand Down
1 change: 1 addition & 0 deletions fa/commands/symdiff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''symmetric difference between two or more variables
Expand Down
1 change: 1 addition & 0 deletions fa/commands/unique.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''make the resultset unique
Expand Down
1 change: 1 addition & 0 deletions fa/commands/verify_aligned.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from argparse import RawTextHelpFormatter

from fa import utils

DESCRIPTION = '''leave only results fitting required alignment
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/verify_bytes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from argparse import RawTextHelpFormatter
import binascii
from argparse import RawTextHelpFormatter

from fa import utils

Expand Down
2 changes: 1 addition & 1 deletion fa/commands/verify_name.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fa import utils, context
from fa import context, utils
from fa.commands.locate import locate


Expand Down
3 changes: 2 additions & 1 deletion fa/commands/verify_operand.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from argparse import RawTextHelpFormatter
from fa import utils, context

from fa import context, utils

try:
import idc
Expand Down
2 changes: 1 addition & 1 deletion fa/commands/verify_ref.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from fa import context, utils
from fa.commands.locate import locate
from fa import utils, context

try:
import idautils
Expand Down
Loading

0 comments on commit b7378db

Please sign in to comment.