Commit Graph
50 Commits
Author SHA1 Message Date
pancake ae23784744 Easier python doc from make 2024-06-28 10:47:31 +02:00
pancake 6d0fbec267 Minor fixes to publish r2papi-python 2024-01-10 17:20:33 +01:00
pancake 7f10642007 Move the python CI from travis to GHA
* setup.py fails to install the module because of py3 changes
2022-12-28 21:58:02 +01:00
Quim 6aa55c7ee7 Fix function name test 2020-03-12 20:26:13 +01:00
Quim 07c09d2e8a Change _print with print2 2020-03-04 10:48:49 +01:00
Quim 7e12bac435 Fix Travis CI 2020-03-03 11:46:43 +01:00
Quim 6ea5e56225 Cleanup 'function' stuff 2020-03-02 09:56:50 +01:00
Quim 963eac590e Add agfw command, create graph images from functions 2020-02-28 17:17:07 +01:00
Quim ea82627f9a Document with-as syntax 2020-02-28 16:10:55 +01:00
Quim 44e86697a2 Add debruijn 2020-02-28 15:56:41 +01:00
Quim 35147d227d Add docs of missing Print methods 2020-02-28 14:54:27 +01:00
Quim 6bac42863b Improve docs 2020-02-27 14:52:59 +01:00
Quim dfc5dc476a Update CI dependencies 2020-02-27 12:05:31 +01:00
Quim 84f629f5c2 Fix tests 2020-02-27 11:56:51 +01:00
Quim 71a8493012 Fix newlines at the end of the commands output 2020-02-27 11:19:09 +01:00
Quim Aguado 031e336fcb Start writing docs using sphinx (#17) 2018-11-01 20:01:25 +01:00
Quim e26dd37044 Add context manager for R2Api object
As proposed in #14, now it's not necessary to do r.quit() at the end of your
script:

 with R2Api('-') as r:
     r.print.hexdump(5)

First implementation, probably it can be improved.
2018-09-12 20:21:26 +02:00
Pablo Castellano 87392fbf75 fix setuptools 2018-09-08 18:04:57 +02:00
Pablo Castellano 8b9e31cf79 travis: add basic support for running python tests 2018-09-08 18:04:57 +02:00
Pablo Castellano 9dcd8e4947 use shebang and chmod setup.py 2018-09-08 18:04:57 +02:00
Quim d2c0d0762c String rep for EsilCPU and fix tests
* Now EsilCPU have proper __str__
* registers method is more consistent
* Adapt tests to the last r2 version
2018-09-06 11:09:47 +02:00
Alex Bender f327bcc332 Refactor tests 2018-07-20 18:41:05 +03:00
Alex Bender b7c1e93a19 Reformat files with "black" 2018-07-20 12:47:35 +03:00
Quim c5b1d8ed7f Move writeBytes method to Write object. 2018-06-12 22:07:31 +02:00
Quim b6429a81d1 Makefile for tests with coverage. 2018-06-07 21:35:59 +02:00
Quim d892f09a83 Print bytes as a string/bytes object by default 2018-06-06 15:31:04 +02:00
Quim aaba2d2aa3 Debugger CPU pretty print, and change d.CPU to d.cpu 2018-05-24 22:09:17 +02:00
Quim 8aed6998fc Fixing little bugs and extend tests 2018-05-24 10:38:10 +02:00
Quim 58f0e2fc07 Fix Esil eval bug, and add Esil tests.
Still WIP
2018-05-22 22:56:42 +02:00
Quim ec038908fc First implementation of esil VM object, DO TESTS!!
There're probably broken things, we must test everything in the following
commits.
2018-05-21 19:42:56 +02:00
Quim b0ace05ac2 First implementation of the flags object.
Usage:

 from r2api import R2Api
 r = R2Api('/bin/ls')

 # Get all flags as a json python object (dict)
 r.flags.all()

 r.flags.at(0x100).new('my_flag_name')
 # OR
 r.flags.new('my_flag_name', offset=0x100)

 r.flags.rename('my_flag_name', 'foo')

 r.flags.at(0x100).delete()
 # OR
 r.flags.delete(name='foo')
 # OR
 r.flags.delete(offset=0x100)
2018-05-19 13:46:52 +02:00
Quim 7d039f06d7 Fix bug in curr_seek_addr (R2Base)
- Add test to check this case in the future
2018-05-17 15:53:09 +02:00
Quim 7aa0a79e9e Bug fixes.
- Python3 error when using iteritems in a dict.
- write was a method and also an object in r2api.
- Make and fix tests for this cases.
2018-05-16 21:08:57 +02:00
Quim 45bb503ccf First implementation of the Write class 2018-05-14 21:11:54 +02:00
Quim d7a4c73504 Return proper values type from config __getitem__
And add tests
2018-05-10 09:51:35 +02:00
Quim 5345cadf9d Fix iomap test 2018-05-04 13:18:08 +02:00
Quim 59f14dc4f0 Add Config object.
Example:
>>> from r2api import R2Api
>>> r = R2Api('-')
>>> r.config.asm.bits = 16
>>> r.config.asm.bits
'16'
2018-05-04 13:16:46 +02:00
Quim ad8c912334 Add disasmBytes to Print object
And tests
2018-04-22 12:26:45 +02:00
Quim 166dcc162e Add hexdump to Print object
* Remove redundant code
* Little improvements
* Write tests for hexdump
2018-04-22 00:04:18 +02:00
Quim 6512de7d63 First implementation of Print object
Example:
    from r2api import R2Api
    r = R2Api('/bin/ls')
    # python3 or python2 with print_function
    r.print.at('entry0').bytes(10)
    r.print.at('entry0').disassemble(2)
    # python2
    r._print.at('entry0').bytes(10)
    r._print.at('entry0').disassemble(2)
2018-04-21 00:46:13 +02:00
Quim 0bf8b3c667 Make the code python3 compatible 2018-04-21 00:46:13 +02:00
Quim f37a30a8d2 Added binary file for the tests 2018-04-21 00:46:13 +02:00
Quim 61abafeac3 File and IOMap tests
Little bug fixes in File.close() and IOMap __getattr__
2018-04-21 00:46:13 +02:00
Quim 5b6f5c7c9a First tests 2018-04-21 00:46:13 +02:00
Quim 0aa6bd8c4f Fix bug in write 2018-04-21 00:46:13 +02:00
quim0 00b08c75bb Python api (#9)
* Code refactor

* Debugger implementation

r.debugger.start()
r.debugger.at("main").setBreakpoint()
r.debugger.cont()
r.debugger.CPU.rip

* Backtrace
* Add continue until {call,unknownCall,ret}

d = r.debugger
d.start()
 Continue until ret
d.untilRet().cont()

* Add easy way to write to registers

d.CPU.rax = 0x100

* Files and IOmaps

* Create a Function class
* Create a file class, and list files in R2Api
* Create a IOMap class, and list maps in file

* Reviewed code
2018-03-19 21:15:37 +01:00
Quim 692b12fdad Cleanup
Little cleanup and add __getitem__ and __setitem__ methods for easy
binary r/w like:

r[0:10] # Read 10 bytes from address 0
r[1] # Read 1 byte from address 1
2018-03-05 09:39:18 +01:00
pancake afc236b73c Add opInfo method for py 2017-10-13 18:47:44 +02:00
pancake e3c587d823 More and better r2pipe-api 2017-10-13 13:50:49 +02:00
pancake 2c1e710ef7 Initial import 2017-07-11 11:22:47 +02:00