Updated bindings and fix of 'do not build parse/t'
This commit is contained in:
parent
20f8ee8091
commit
f657311823
|
@ -14,7 +14,7 @@ STATIC_OBJS=$(subst ..,p/..,$(subst parse_,p/parse_,$(STATIC_OBJ)))
|
|||
OBJS=parse.o code.o ${STATIC_OBJS}
|
||||
|
||||
bins:
|
||||
@cd t && ${MAKE} all
|
||||
# @cd t && ${MAKE} all
|
||||
|
||||
pre:
|
||||
ifeq ($(WITHNONPIC),1)
|
||||
|
|
|
@ -27,7 +27,7 @@ class PyApp():
|
|||
# Preparamos el archivo
|
||||
file = "/tmp/elf-linux-x86-64" #usr/bin/tar"
|
||||
self.core.file_open(file, 0, 0)
|
||||
self.core.bin_load(None)
|
||||
self.core.bin_load(None, 0)
|
||||
|
||||
app = PyApp()
|
||||
import time
|
||||
|
|
|
@ -2,7 +2,7 @@ from r2 import r_core
|
|||
|
||||
rc = r_core.RCore()
|
||||
rc.file_open("/bin/ls", 0, 0)
|
||||
rc.bin_load("")
|
||||
rc.bin_load("", 0)
|
||||
|
||||
rc.anal_all()
|
||||
funcs = rc.anal.get_fcns()
|
||||
|
|
|
@ -31,7 +31,7 @@ core.config.set ("asm.bits", "32");
|
|||
|
||||
f = core.file_open(path, False, 0)
|
||||
#core.bin_load (None)
|
||||
core.bin_load ("")
|
||||
core.bin_load ("", 0)
|
||||
|
||||
# show entrypoint
|
||||
print ("Entrypoint : 0x%x"%(core.num.get ("entry0")))
|
||||
|
|
|
@ -33,7 +33,7 @@ core.config.set ("cfg.debug", "true")
|
|||
|
||||
f = core.file_open(dbgpath, False, 0)
|
||||
#core.bin_load (None)
|
||||
core.bin_load (path)
|
||||
core.bin_load (path, 0)
|
||||
|
||||
# show entrypoint
|
||||
print ("Entrypoint : 0x%x"%(core.num.get ("entry0")))
|
||||
|
|
|
@ -179,11 +179,11 @@ class RagDiff2(gtk.Window):
|
|||
self.c.config.set_i("io.va", 1)
|
||||
self.c.config.set_i("anal.split", 1)
|
||||
self.c.file_open(file_l, 0, 0)
|
||||
self.c.bin_load(None)
|
||||
self.c.bin_load(None, 0)
|
||||
self.c2.config.set_i("io.va", 1)
|
||||
self.c2.config.set_i("anal.split", 1)
|
||||
self.c2.file_open(file_r, 0, 0)
|
||||
self.c2.bin_load(None)
|
||||
self.c2.bin_load(None, 0)
|
||||
# Configure bindiffing
|
||||
self.c.anal.diff_setup_i (False, -1, -1)
|
||||
self.c2.anal.diff_setup_i (False, -1, -1)
|
||||
|
|
|
@ -3,12 +3,13 @@
|
|||
/* TODO: Add simpletype instead of int so, we can use it as an object */
|
||||
|
||||
[SimpleType]
|
||||
[CCode (cname="int", cheader_filename="r_socket.h", cprefix="r_socket_")]
|
||||
public struct Radare.RSocket {
|
||||
[CCode (cname="int", cheader_filename="r_socket.h", cprefix="r_socket_", unref_function="")]
|
||||
public class Radare.RSocket {
|
||||
public RSocket (int is_ssl);
|
||||
[CCode (cname="r_socket_connect")]
|
||||
public RSocket.connect(string host, int port);
|
||||
public bool connect(string host, string port, int proto, int timeout);
|
||||
[CCode (cname="r_socket_listen")]
|
||||
public RSocket.listen(int port);
|
||||
public bool listen(string port, string? certfile);
|
||||
|
||||
public bool ready(int secs, int usecs);
|
||||
public int read(ref string buf, int len);
|
||||
|
|
|
@ -24,9 +24,9 @@ public class RAsmExample
|
|||
uint8 *buf = "\x83\xe4\xf0";
|
||||
string buf2 = "jmp _foo;nop;nop;nop;_foo:push eax";
|
||||
if (st.disassemble(out op, buf, 3) <1) {
|
||||
stderr.printf("internal error\n");
|
||||
stderr.printf ("internal error\n");
|
||||
} else {
|
||||
stdout.printf("disasm: %s\n", op.buf_asm);
|
||||
stdout.printf ("disasm: %s\n", (string)op.buf_asm);
|
||||
}
|
||||
RAsm.Code? code = st.massemble(buf2);
|
||||
if (code == null) {
|
||||
|
@ -35,10 +35,11 @@ public class RAsmExample
|
|||
stdout.printf("asm: %s\n", code.buf_hex);
|
||||
}
|
||||
|
||||
/*
|
||||
print ("arg0: %s\n", st.fastcall (0, 4));
|
||||
print ("arg1: %s\n", st.fastcall (1, 4));
|
||||
print ("arg2: %s\n", st.fastcall (2, 4));
|
||||
/*
|
||||
|
||||
stdout.printf("Enumerate fastcall arguments:\n");
|
||||
for(int i=0;i<4;i++) {
|
||||
stdout.printf(" - %s\n", st.fastcall(i, 4));
|
||||
|
|
|
@ -30,7 +30,7 @@ public static void main(string[] args) {
|
|||
c = new RCore ();
|
||||
if (c.file_open (file, 0) == null)
|
||||
error ("Error: r_core cannot open the file");
|
||||
c.bin_load (null);
|
||||
c.bin_load (null, 0);
|
||||
/* Enable va */
|
||||
c.config.set ("io.va", "true");
|
||||
/* Do search */
|
||||
|
|
|
@ -44,7 +44,7 @@ public static void main(string[] args) {
|
|||
c = new RCore ();
|
||||
if (c.file_open (file, 0) == null)
|
||||
error ("Error: r_core cannot open the file");
|
||||
c.bin_load (file);
|
||||
c.bin_load (file, 0);
|
||||
/* Enable va */
|
||||
c.config.set ("io.va", "true");
|
||||
/* Set minimal disasm */
|
||||
|
|
|
@ -4,8 +4,8 @@ void main(string[] args)
|
|||
{
|
||||
var io = new Radare.RIO ();
|
||||
|
||||
int fd = io.open ("dbg:///bin/ls", 0, 0); //Io.Flags.READ, 0);
|
||||
if (fd == -1)
|
||||
RIODesc? f = io.open ("dbg:///bin/ls", 0, 0);
|
||||
if (!f) //(io.open ("dbg:///bin/ls", 0, 0))<1)
|
||||
critical("Cannot open file\n");
|
||||
|
||||
uint8 buf[16];
|
||||
|
|
|
@ -10,13 +10,14 @@ public static void main(string[] args)
|
|||
//unowned GLib.FileStream stdin = GLib.stdin;
|
||||
//unowned GLib.FileStream stdout = GLib.stdout;
|
||||
|
||||
RSocket? fd = null;
|
||||
bool ret = false;
|
||||
RSocket? fd = new RSocket (0);
|
||||
if (args.length>2)
|
||||
fd = RSocket.connect(args[1], args[2].to_int(), 0);
|
||||
else fd = RSocket.connect("radare.org", 80, 0);
|
||||
ret = fd.connect (args[1], args[2], 0, 0);
|
||||
else ret = fd.connect ("radare.org", "80", 0, 0);
|
||||
//var ret = fd.connect ("localhost", "9999", 0, 0);
|
||||
|
||||
//var fd = RSocket.connect("localhost", 9999);
|
||||
if (fd == null) {
|
||||
if (!ret) {
|
||||
printf("Cannot connect\n");
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue