~ubuntu-branches/ubuntu/maverick/radare/maverick

« back to all changes in this revision

Viewing changes to api/python/standalone.py

  • Committer: Bazaar Package Importer
  • Author(s): SevenMachines
  • Date: 2010-09-07 15:44:27 UTC
  • mfrom: (1.1.3 upstream) (2.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100907154427-37u92vu12tqabqqz
Tags: 1:1.5.2-3ubuntu1
* Merge from debian testing (LP: #621016)
* debian/control:
     + libvala-dev transition to libval-0.10-dev (LP: #618809) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
hijack=1
 
2
 
 
3
import radare
 
4
import ranal
 
5
import radapy
 
6
 
 
7
# r.cmd() hijacking
 
8
if hijack:
 
9
        class Food:
 
10
                def cmd(str):
 
11
                        global c
 
12
                        print "Command to run is (%s)"%str
 
13
                        return c.cmd(str)
 
14
                cmd = staticmethod(cmd)
 
15
        global r
 
16
        radare.r = Food
 
17
 
 
18
 
 
19
c = radapy.RapClient("localhost", 9999)
 
20
 
 
21
fd = c.open("/bin/ls", 0)
 
22
print c.cmd("px")
 
23
#r = Food
 
24
#r.cmd("#test")
 
25
print radare.r.cmd("pd 20")
 
26
radare.seek(33)
 
27
print radare.disasm(0, 10)
 
28
 
 
29
# close
 
30
c.close(fd)
 
31
c.disconnect()