Hi,

NOTE: First of all, sorry for the long email XD 

I fixed the problems I have had in my local box by adding the
corresponding $DIR/plugin.o files where the symbols are, namely:

../../libr/bp/plugin.o ../../libr/io/plugin.o ../../libr/cmd/plugin.o
../../libr/bp/plugin.o ../../libr/io/plugin.o ../../libr/cmd/plugin.o

After fixing those errors radare2 is working OK, however, there is also
another error I fixed too locally. The problem is with the python
bindings. A lot of the generated C++ files throws the same error when
compiling:

g++ -fPIC -shared r_core_wrap.cxx -I/usr/include/libr
-I/usr/include/python2.5 -o _r_core.so -lr_sign -lr_syscall -lr_search
-lr_meta -lr_reg -lr_bp -lr_print -lr_parse -lr_anal -lr_io -lr_lang
-lr_bin -lr_hash -lr_debug -lr_lib -lr_asm -lr_flags -lr_util -lr_cmd
-lr_line -lr_cons -lr_config -lr_core -I/usr/include/python2.5
-lpython2.5
r_core_wrap.cxx: In function 'void init_r_core()':
r_core_wrap.cxx:48777: error: 'R_LIB_TYPE_BININFO' was not declared in
this scope
make: [r_core.so] Error 1 (ignored)

I recompiled those objects adding a -DR_LIB_TYPE_BININFO and "it seems
to work".

After having my bindings working right I tried some of the samples and
found that not all of them are working OK as, for example, test-r_hash.
It complains about missing classes/functions in libr:

$ python test-r_hash.py
Traceback (most recent call last):
  File "test-r_hash.py", line 2, in <module>
    from libr import RHash, Size_MD4
ImportError: cannot import name RHash

Anyway, my main intentions is to use radare2's python bindings for
debugging and disassembling and, when writting my code for disassembly I
noticed that there are some incongruencies between the disassembler
radare2 uses and the ones available for use inside a python script. Take
the following example: 

$ cat test-r_asm.py
def test2():
        asm = RAsm()
        asm.use("x86.olly")
        ret = asm.mdisassemble_hexstr("f3c7c033000000")
        if ret:
                print ret.buf_asm
        else:
                print "Invalid opcode?"

$ python test-r_asm.py
???
???
xor eax, [eax]
add [eax], al

The disassembly is obviously wrong due to olly's disassembler capacities
but I looks OK in radare2: 

$ radare2 -w test.buf
[0x00000000]> pd
    0x00000000    0       f3c7c033000000  rep mov eax, 0x33

...so, I decided to change the disassembler from x86.olly to the one
radare2 is using: 

[0x00000000]> e | grep x86
asm.arch = x86
asm.parser = x86.pseudo
[0x00000000]> q
$ vi test-r_asm.py
(...change the disassembler to x86.pseudo...)
$ python test-r_asm.py
error disassemble at offset 0
Invalid opcode?

So, either I can't use the disassembler or there is something I do not
understand :/ I tried too with x86.nasm but with no luck... I tried,
also, listing the availabe disassemblers but <asm obj>.list() is not
available anymore.

And, after all those errors, I have another one more question: How can I
debug one application and capture exceptions/signals/whatever using the
radare2 api? There is neither documentation nor a sample script for this
task. Any tip?

Thanks you so much and sorry for the very long email!
Joxean Koret

On Sun, 2010-06-06 at 11:46 +0200, Joxean Koret wrote:
> Hi,
> 
> I'm having linking troubles building radare2. The following are the
> components that fails at linking stage:
> 
> cc -o radiff2 -L../../libr/diff -L../../libr/debug -L../../libr/util
> -L../../libr/core -lr_diff -lr_debug -lr_util -lr_core -L../diff
> -L../debug -L../util -L../core    -fPIC radiff2.o
> ../../libr/core/libr_core.so: undefined reference to `r_bp_plugin_list'
> ../../libr/core/libr_core.so: undefined reference to `r_io_plugin_add'
> ../../libr/core/libr_core.so: undefined reference to `r_io_plugin_list'
> ../../libr/core/libr_core.so: undefined reference to `r_cmd_plugin_add'
> ../../libr/core/libr_core.so: undefined reference to `r_bp_plugin_add'
> collect2: ld returned 1 exit status
> make[1]: *** [radiff2] Error 1
> (...)
> cc -o radare2 -L../../libr/debug -L../../libr/util -L../../libr/anal
> -L../../libr/core -lr_debug -lr_util -lr_anal -lr_core -L../debug
> -L../util -L../anal -L../core    -fPIC radare2.o
> ../../libr/core/libr_core.so: undefined reference to `r_bp_plugin_list'
> ../../libr/core/libr_core.so: undefined reference to `r_io_plugin_add'
> ../../libr/core/libr_core.so: undefined reference to `r_io_plugin_list'
> ../../libr/core/libr_core.so: undefined reference to `r_cmd_plugin_add'
> ../../libr/core/libr_core.so: undefined reference to `r_bp_plugin_add'
> collect2: ld returned 1 exit status
> 
> Anybody experienced those errors?
> 
> Thanks in advance!
> Joxean Koret
> 
> _______________________________________________
> radare mailing list
> [email protected]
> http://lists.nopcode.org/listinfo.cgi/radare-nopcode.org

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
radare mailing list
[email protected]
http://lists.nopcode.org/listinfo.cgi/radare-nopcode.org

Reply via email to