1
0
mirror of https://github.com/angr/pyvex synced 2026-06-21 13:47:01 +00:00
Commit Graph

45 Commits

Author SHA1 Message Date
Kevin Phoenix 5f952aff37 Use pre-commit 2023-01-17 14:47:17 -07:00
Kevin Phoenix 23503e7919 Use black (#291)
* Use black

* Fix the lint error
2023-01-13 14:23:57 -07:00
Eric Gustafson 46049a1498 Add generalized aam and aad instructions for x86 (#178)
* Add spotters for generalized versions of aam/aad

* lint

Co-authored-by: Audrey Dutcher <audrey@rhelmot.io>
2022-05-26 14:47:25 -07:00
Kevin Phoenix a9f4e876e6 Remove future dependency (#270)
* Remove future dependency

* Fix syntax error

* Make linter happy

* Change ignore to disable for pylint
2022-04-05 13:54:32 -07:00
Adersh 20c97ff8b9 remove nose dependencies (#250)
* remove nose dependencies

* resolve lint error

* fix lint errors

* fix lint errors

* fix lint error
2021-12-21 11:55:51 -07:00
Mohit Patil 8cf6a994c3 Diabled auto_load_libs in test_spotter.py (#244) 2021-11-09 20:44:09 -07:00
degrigis 2422f8244f added spotter for tMRS/tMSR (#232)
* added spotter for tMRS/tMSR

* added tmsr/tmrs test case

Signed-off-by: degrigis <degrigis@ucsb.edu>
2021-05-28 18:07:23 -07:00
Audrey Dutcher 372f808843 Fix test_spotter 2021-04-29 14:52:28 -07:00
mephi42 045f7d05c8 s390x: test lifting of vector instructions 2020-01-24 14:48:42 -07:00
mephi42 e7cf6e73d9 Adapt to s390x valgrind update
https://github.com/angr/vex/pull/25
2020-01-24 14:48:42 -07:00
Saullo Carvalho Castelo Branco f2bcfc4025 Remove __future__.print_function 2019-06-08 14:30:49 -07:00
Saullo Carvalho Castelo Branco 48852a6a5c Replace xrange for range 2019-06-08 14:30:49 -07:00
Eric Gustafson 2d81b07b86 Fix another broken CM binary test. 2019-03-29 14:50:37 -07:00
Fish 2f2aa7567a ARM: Add a test case for treating LDMFD SP, {xxx, SP, PC} as ret. (#184) 2019-03-29 14:50:30 -07:00
Audrey Dutcher 67fb4f7c5e Rewire s390x test to not rely on exact output of vex 2018-10-24 00:12:15 -07:00
mephi42 ca1a4b694c Add test/test_s390x_exrl.py
Testcase for https://github.com/angr/vex/pull/20
2018-10-23 20:41:17 -07:00
Audrey Dutcher cb441dcc5b Add test/fixes for max_bytes behavior 2018-10-15 15:14:55 -07:00
Eric Gustafson 98dfa56c77 Purge IRCallee's addr attribute from existence. (#168)
* Purge IRCallee's addr attribute from existence.  It's a pointer into your stack. Why was this even here?

* lint

* burn it to the grouuuuuuuund

* god.
2018-10-10 11:06:21 -07:00
Fish 047ce34638 Fix a corner case in arm_post_processor_determine_calls(). 2018-09-26 20:43:08 -07:00
Eric Gustafson b11a997618 Merge branch 'py3k' into wip/arm_spotter
do the mergey-merge
2018-09-25 14:46:13 -07:00
Audrey Dutcher 479426e9d2 fish. 2018-09-24 12:01:03 -07:00
Fish 18f5e5d754 Fix test cases. 2018-09-24 00:59:51 -07:00
Eric Gustafson f1eaa839e4 Merge branch 'py3k' into wip/arm_spotter
merge latest
2018-09-16 20:22:53 -07:00
Audrey Dutcher e6ae8ec725 *snaps fingers angrily* 2018-09-13 19:16:35 -07:00
Eric Gustafson 7c481187a4 Add a test for some nasty junk from ARMC 2018-08-29 09:53:30 -04:00
Fish 16bca4a915 Implement fallback logic for IRSB.exit_statements. Closes #153. (#154)
.
2018-08-23 23:26:21 -04:00
Fish c9818d9e61 Fix a bug in gymrat where blocks of maximum size are always marked as NoDecode. (#151)
* Fix a bug in gymrat where blocks of maximum size are always marked as NoDecode.

* Fix the test case.
2018-08-17 17:24:20 -07:00
Audrey Dutcher 7a5d7a27bc Fix py3k regressions 2018-07-30 17:17:44 -07:00
Fish 51a4121953 Make lifting faster. (#141)
See https://github.com/angr/angr/pull/1092 for more details.

* The initial commit.

* Redo the lifting logic to avoid redundant IRSB copying.

* Move get_defaultexit_target() from Python to C to speed things up.

* Add a check to make sure LibVEX_Lift() does not return NULL.

* Implement IRSB.instruction_addresses.

* Implement IRSB.has_statements.

* Fix IRSB.addr.

* Fix a NULL-deref in pyvex.c.

* Postprocessor: Do not remove NoOp statements.

Otherwise it will cause a mismatch between statement indices and the
indices in IRSB.exit_statements (which are generated in PyVEX C).

* FixesPostProcessor: Get the IRSB address correctly.

* Remove NoOp statements in the C world.

* Restore the IRSB size calculation.

* Make sure exit_statements is not None before accessing.

* Enable tests for PyVEX itself.

* Implement ARM call jumpkind fixer in C for a better performance.

* Implement MIPS32 post-processing in C world.

* Add a missing undefine.

* Fix test.py.

* Add stddef.h to pyvex.c.

* Implement data reference collection in pyvex_c.

* Lint the code.

* Expose PyVEXError.

* More linting.

* oops

* Expose get_type_size and get_type_spec_size.

* Expose IRTypeEnv.

* Postprocessor: Support NeedStatementsNotification.

* Reorganize lifting/__init__.py.

* Remove the IRSB.addr property, replace with raw attribute

* Make check against MAX_DATA_REFS more explicit

* Move from data ref tuples to a DataRef class

* Lint block.py: Define data_refs and _instruction_addresses in __init__

* Make pyvex.lift positional arguments match pyvex.IRSB

* The kosher way to do this is .lift()

* Split pyvex.c into several smaller C files

(committing as fish to preserve authorship)
2018-07-27 05:45:12 +08:00
Fish a0a5a35edf Lifter: Do not extend a basic block if the lifter intentionally ends it with a NoDecode. (#146)
* Lifter: Do not extend a basic block if the lifter intentionally ends it with a NoDecode.

The rationale behind is that we want to differentiate between NoDecode
that are caused by unsupported instructions and NoDecode caused by
decodeable instructions. For example, `ud2` is a valid instruction on X86
and AMD64, but it means "undefined instruction". On AMD64, VEX will create
a basic block that has an instruction of two bytes (which is the size of
the ud2 instruction), but with the `next` of the basic block pointing to
that instruction. In our existing implementation, we will ignore ud2 and
keep lifting, which is an incorrect behavior.

This commit will detect these intentional NoDecode cases. In such cases,
the Lifter will return a basic block that terminates after the
"undecodeable" instruction, with NoDecode as the jumpkind.

* Add a test case.
2018-07-14 02:01:23 +08:00
Fish 34167b7989 Add {RdTmp,Const}.get_instance(). (#139) 2018-06-30 22:20:36 -07:00
Fish 51f9a8386d ARM post-processing: Mark ldmdb r11, {xxx, pc} as a ret. (#134) 2018-06-23 13:02:36 -07:00
Audrey Dutcher 1a2be78cd8 Swap endians on cortex-m spotter tests 2018-04-26 13:37:02 -07:00
lockshaw 9af0380014 Fix pyvex tests breaking due to ARMEL endness fix 2018-04-21 01:30:40 -07:00
tyb0807 562ccbfc14 Py3k compatible 2018-03-26 18:22:44 -07:00
Fish 9a8fcf21e5 Rename .lift to .lifting to avoid the lift() method shadowing the lift module. (#127)
* Rename .lift to .lifting to avoid the lift() method shadowing the lift module.

* Tidy the code and make future development easier.

- Remove all absolute import of pyvex.
- Remove all absolute import of Python modules that should be relative
  imports.
- Split lifting.__init__.py into separate files.
- Delay an import from angr to avoid circular import.
2018-03-19 23:20:20 -07:00
Nilocunger d44d1f9b20 Fix IRSB property caching (#125)
* Fix IRSB size caching for block extension

* Update to use slots and add test

* Speed up extension cache change
2018-02-27 05:03:43 -08:00
lockshaw 8489511902 Remove unused variable in test 2018-02-25 15:13:46 -08:00
lockshaw a398d63857 Improve performance and remove libvex block concat 2018-02-25 15:13:46 -08:00
Benno Fünfstück fec57bb6a4 Disable logging for memory test to avoid log buffer blowup
Nose logs messages into a buffer which affected the memory test.
2018-02-17 16:24:07 +01:00
Benno Fünfstück daeed00c90 Fix tests
This removes a few tests that don't make sense anymore (deepCopy tests, tests
for removed functions).
2018-02-17 15:31:47 +01:00
Benno Fünfstück c4e9c9e813 lifter_helper: catch bitstring.ReadError
This avoids an exception when we are passed an incomplete block that is not a
multiple of all instruction sizes.
2018-02-05 15:22:55 +01:00
lockshaw bccdf13b41 Change per-arch lifter registration 2018-01-18 17:15:56 -08:00
lockshaw b989f8a9cf Add spotter tests 2017-12-18 20:53:07 -08:00
tyb0807 72ce8c600a Fix ARM post-processing function to determine jumpkind (#77)
* Fix ARM post-processing function to determine jumpkind when 'lr' is affected

* Improve code readability in block.py

* Test case for ARM post-processing
2017-06-20 00:14:20 -07:00