Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
  * change default ui term engine from pygments to rich
  * add EmuData orm object to save the emulator state
  * add save/restore commands in emul ui
  * implement callstack logic
  * add callstack frame in emul ui
  * add debug command in emul ui
  * add StructView class for structs pretty printing
  * fix x86 mmu_cache logic (flush & misses)
  * change default action from codeql to ruff
  * refactor code based on ruff checks
  • Loading branch information
Axel Tillequin committed Jun 24, 2024
1 parent 6be7bbb commit db73596
Show file tree
Hide file tree
Showing 300 changed files with 13,168 additions and 9,758 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/codeql.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: 'check --config pyproject.toml'
8 changes: 7 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,20 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.12"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py

formats:
- pdf
- epub

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- method: pip
- requirements: requirements.txt
- requirements: doc/requirements.txt
92 changes: 52 additions & 40 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=====
Amoco
amoco
=====

.. image:: http://readthedocs.org/projects/amoco/badge/?version=latest
Expand All @@ -9,17 +9,15 @@ Amoco
+-----------+--------------------------------------------------+
| Status: | Under Development |
+-----------+--------------------------------------------------+
| Location: | https://github.com/bdcht/amoco |
+-----------+--------------------------------------------------+
| Version: | 2.9 (pre-3.0) |
+-----------+--------------------------------------------------+
| Doc: | http://amoco.readthedocs.io/en/latest/index.html |
| Doc: | http://amoco.readthedocs.io/en/latest/index.html |
+-----------+--------------------------------------------------+

Description
===========

Amoco is a python (>=3.8) package dedicated to symbolic analysis of binaries.
Amoco is a python package dedicated to symbolic analysis of binaries.

It features:

Expand Down Expand Up @@ -51,8 +49,8 @@ merged from develop branch or to be more thoroughly implemented.
User documentation and API can be found at
`http://amoco.readthedocs.io/en/latest/index.html`

.. image:: https://github.com/bdcht/amoco/blob/release/doc/gui_load.png
:width: 800
.. image:: doc/amo_emu_inherit.png
:width: 100%

Todo
====
Expand Down Expand Up @@ -87,6 +85,19 @@ Please see `LICENSE`_.
Changelog
=========

- `v2.9.11`_

* change default ui term engine from pygments to rich
* add EmuData orm object to save the emulator state
* add save/restore commands in emul ui
* implement callstack logic
* add callstack frame in emul ui
* add debug command in emul ui
* add StructView class for structs pretty printing
* fix x86 mmu_cache logic (flush & misses)
* change default action from codeql to ruff
* refactor code based on ruff checks

- `v2.9.10`_

* x86: add support for real mode execution
Expand All @@ -98,7 +109,7 @@ Changelog
* add tracepoint method in emul class
* add support for PE resources
* improve amoco app load/emul commands
* add set,display,nexti,until in emul ui.
* add set,display,nexti,until in emul ui

- `v2.9.9`_

Expand Down Expand Up @@ -408,35 +419,36 @@ Changelog
.. _ply: http://www.dabeaz.com/ply/
.. _sqlalchemy: http://www.sqlalchemy.org
.. _QDarkStyleSheet: https://github.com/ColinDuquesnoy/QDarkStyleSheet
.. _LICENSE: https://github.com/bdcht/amoco/blob/release/LICENSE
.. _v2.9.10: https://github.com/bdcht/amoco/releases/tag/v2.9.10
.. _v2.9.9: https://github.com/bdcht/amoco/releases/tag/v2.9.9
.. _v2.9.8: https://github.com/bdcht/amoco/releases/tag/v2.9.8
.. _v2.9.7: https://github.com/bdcht/amoco/releases/tag/v2.9.7
.. _v2.9.6: https://github.com/bdcht/amoco/releases/tag/v2.9.6
.. _v2.9.5: https://github.com/bdcht/amoco/releases/tag/v2.9.5
.. _v2.9.4: https://github.com/bdcht/amoco/releases/tag/v2.9.4
.. _v2.9.3: https://github.com/bdcht/amoco/releases/tag/v2.9.3
.. _v2.9.2: https://github.com/bdcht/amoco/releases/tag/v2.9.2
.. _v2.9.1: https://github.com/bdcht/amoco/releases/tag/v2.9.1
.. _v2.9.0: https://github.com/bdcht/amoco/releases/tag/v2.9.0
.. _v2.6.3: https://github.com/bdcht/amoco/releases/tag/v2.6.3
.. _v2.6.2: https://github.com/bdcht/amoco/releases/tag/v2.6.2
.. _v2.6.1: https://github.com/bdcht/amoco/releases/tag/v2.6.1
.. _v2.6.0: https://github.com/bdcht/amoco/releases/tag/v2.6.0
.. _v2.5.3: https://github.com/bdcht/amoco/releases/tag/v2.5.3
.. _v2.5.2: https://github.com/bdcht/amoco/releases/tag/v2.5.2
.. _v2.5.1: https://github.com/bdcht/amoco/releases/tag/v2.5.1
.. _v2.5.0: https://github.com/bdcht/amoco/releases/tag/v2.5.0
.. _v2.4.6: https://github.com/bdcht/amoco/releases/tag/v2.4.6
.. _v2.4.5: https://github.com/bdcht/amoco/releases/tag/v2.4.5
.. _v2.4.4: https://github.com/bdcht/amoco/releases/tag/v2.4.4
.. _v2.4.3: https://github.com/bdcht/amoco/releases/tag/v2.4.3
.. _v2.4.2: https://github.com/bdcht/amoco/releases/tag/v2.4.2
.. _v2.4.1: https://github.com/bdcht/amoco/releases/tag/v2.4.1
.. _v2.4.0: https://github.com/bdcht/amoco/releases/tag/v2.4.0
.. _v2.3.5: https://github.com/bdcht/amoco/releases/tag/v2.3.5
.. _v2.3.4: https://github.com/bdcht/amoco/releases/tag/v2.3.4
.. _v2.3.3: https://github.com/bdcht/amoco/releases/tag/v2.3.3
.. _v2.3.2: https://github.com/bdcht/amoco/releases/tag/v2.3.2
.. _v2.3.1: https://github.com/bdcht/amoco/releases/tag/v2.3.1
.. _LICENSE: /../../release/LICENSE
.. _v2.9.11: /../../releases/tag/v2.9.11
.. _v2.9.10: /../../releases/tag/v2.9.10
.. _v2.9.9: /../../releases/tag/v2.9.9
.. _v2.9.8: /../../releases/tag/v2.9.8
.. _v2.9.7: /../../releases/tag/v2.9.7
.. _v2.9.6: /../../releases/tag/v2.9.6
.. _v2.9.5: /../../releases/tag/v2.9.5
.. _v2.9.4: /../../releases/tag/v2.9.4
.. _v2.9.3: /../../releases/tag/v2.9.3
.. _v2.9.2: /../../releases/tag/v2.9.2
.. _v2.9.1: /../../releases/tag/v2.9.1
.. _v2.9.0: /../../releases/tag/v2.9.0
.. _v2.6.3: /../../releases/tag/v2.6.3
.. _v2.6.2: /../../releases/tag/v2.6.2
.. _v2.6.1: /../../releases/tag/v2.6.1
.. _v2.6.0: /../../releases/tag/v2.6.0
.. _v2.5.3: /../../releases/tag/v2.5.3
.. _v2.5.2: /../../releases/tag/v2.5.2
.. _v2.5.1: /../../releases/tag/v2.5.1
.. _v2.5.0: /../../releases/tag/v2.5.0
.. _v2.4.6: /../../releases/tag/v2.4.6
.. _v2.4.5: /../../releases/tag/v2.4.5
.. _v2.4.4: /../../releases/tag/v2.4.4
.. _v2.4.3: /../../releases/tag/v2.4.3
.. _v2.4.2: /../../releases/tag/v2.4.2
.. _v2.4.1: /../../releases/tag/v2.4.1
.. _v2.4.0: /../../releases/tag/v2.4.0
.. _v2.3.5: /../../releases/tag/v2.3.5
.. _v2.3.4: /../../releases/tag/v2.3.4
.. _v2.3.3: /../../releases/tag/v2.3.3
.. _v2.3.2: /../../releases/tag/v2.3.2
.. _v2.3.1: /../../releases/tag/v2.3.1
2 changes: 1 addition & 1 deletion amoco/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .main import *
from .main import * # noqa: F403
30 changes: 15 additions & 15 deletions amoco/arch/arm/cpu_armv7.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@
# Copyright (C) 2006-2014 Axel Tillequin ([email protected])
# published under GPLv2 license

from amoco.arch.arm.v7.asm import *

# expose "microarchitecture" (instructions semantics)
uarch = dict(filter(lambda kv: kv[0].startswith("i_"), locals().items()))

from amoco.arch.core import instruction, disassembler

instruction_armv7 = type("instruction_armv7", (instruction,), {})
instruction_armv7.set_uarch(uarch)
from amoco.arch.arm.v7 import env
from amoco.arch.arm.v7 import asm
from amoco.arch.core import instruction, disassembler, CPU

# define disassembler:
from amoco.arch.arm.v7 import spec_armv7
from amoco.arch.arm.v7 import spec_thumb

from amoco.arch.arm.v7.formats import ARM_V7_full

instruction_armv7 = type("instruction_armv7", (instruction,), {})
instruction_armv7.set_formatter(ARM_V7_full)


mode = lambda: internals["isetstate"]
endian = lambda: 1 if internals["ibigend"] == 0 else -1
def mode(**kargs):
return env.internals["isetstate"]


def endian(**kargs):
return 1 if env.internals["ibigend"] == 0 else -1


disassemble = disassembler([spec_armv7, spec_thumb], instruction_armv7, mode, endian)


def PC(state=None):
return pc_
class CPU_ARMv7(CPU):
def get_data_endian(self):
return 1 if env.internals["endianstate"] == 0 else -1


def get_data_endian():
return 1 if internals["endianstate"] == 0 else -1
cpu = CPU_ARMv7(env, asm, disassemble, env.pc_)
26 changes: 12 additions & 14 deletions amoco/arch/arm/cpu_armv8.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,28 @@
# Copyright (C) 2006-2014 Axel Tillequin ([email protected])
# published under GPLv2 license

from amoco.arch.arm.v8.asm64 import *

# expose "microarchitecture" (instructions semantics)
uarch = dict(filter(lambda kv: kv[0].startswith("i_"), locals().items()))

from amoco.arch.core import instruction, disassembler

instruction_armv8 = type("instruction_armv8", (instruction,), {})
instruction_armv8.set_uarch(uarch)
from amoco.arch.arm.v8 import env64 as env
from amoco.arch.arm.v8 import asm64
from amoco.arch.core import instruction, disassembler, CPU

# define disassembler:
from amoco.arch.arm.v8 import spec_armv8
from amoco.arch.arm.v8.formats import ARM_V8_full

instruction_armv8 = type("instruction_armv8", (instruction,), {})
instruction_armv8.set_formatter(ARM_V8_full)

endian = lambda: 1 if internals["ibigend"] == 0 else -1

def endian():
return 1 if env.internals["ibigend"] == 0 else -1


disassemble = disassembler([spec_armv8], endian=endian, iclass=instruction_armv8)


def PC(state=None):
return pc
class CPU_ARMv8(CPU):
def get_data_endian(self):
return 1 if env.internals["endianstate"] == 0 else -1


def get_data_endian():
return 1 if internals["endianstate"] == 0 else -1
cpu = CPU_ARMv8(env, asm64, disassemble, env.pc)
Loading

0 comments on commit db73596

Please sign in to comment.