Closed ghost closed 8 years ago
Hi,
Thanks for the detailed report!
The GUI exports all the functions of the module (including _start, _init_proc, etc.) into the protobuf file, so that's fine. The two first windows are here to select what are the alloc and free functions (it's useful if there are wrappers or custom allocators).
From BinNavi, can you navigate through the module and open all the functions? Sometimes I got errors during the importation of .idb files to the BinNavi database.
Best,
Oh, right. So I was looking in the wrong direction ;-)
I was loading a large binary at first with the same error, so I retried with a simple, non-optimized
#include <stdio.h>
#include <stdlib.h>
int main() {
int *p = (int *)malloc(sizeof(int));
if (p == 0) {
printf("OOM\n");
return 1;
}
*p = 42;
free(p);
return 0;
}
just so see if that works. In BinNavi, I can navigate through all functions, except imported ones.
So, just to make sure, I imported the binary as a new project in IDA, dropped the imported functions, re-imported the module to BinNavi, now the table looks like this:
But still, the export error remains :-(
hum, strange.
Could you try to replace export_protobuf.py by https://gist.github.com/montyly/3482a8feb7727e2dc936a6e7cdccfca8 ? It is exactly the same file, except for this check: https://gist.github.com/montyly/3482a8feb7727e2dc936a6e7cdccfca8#file-export_protobuf-L137 , which makes the script exporting only the main function.
Do not forget to replace again the first variables of the script (path_binnavi, path_dependency, ..) ;)
Thanks
Yep, very strange.
The same error occurs, just with main now as expected.
in the for f in mod.getFunctions() :
loop, elif f.getType() == FunctionType.Normal :
is reached, the value of f.getAddress().toLong()
is 4195702, then exportLib()
is called.
I tried some non-null checks in that def before (the last reference to export_protobuf.py in the stacktrace goes to p.addFunctions(func)
), but no success yet :-/
I just love debugging by using print
;-)
Getting somewhere:
// edit: I'm using BinNavi 6.0 with BinExport8 (had some issues with 6.1 & BinExport9 before), and I tried both 6.0 and 6.1 binnavi-all.jar in GUEB.
I just tried with both BinNavi 6.0 and BinNavi 6.1 (and so binexport 8 / 9), everything works fine on my setup (using the same database).
The strange thing is that export_probotuf.py is only using the API of BinNavi and protobuf, and getReilCode() is part of this API.
In BinNavi, could you open a function, and try this script? (menu Plugins -> New Scripting Windows)
reil_function = cg.view.reilCode
print reil_function.graph.nodes
(ctrl + E, to execute the script)
Hm, no.
Tried
func main:
>>> reil_function = cg.view.reilCode
CTRL+ENTER
java.lang.NullPointerException: java.lang.NullPointerException: IE02060: Instruction argument can not be null in <script> at line number 4
Which Version of BinNavi & BinExport are you using?
BinNavi 6.1/BinExport 9 (from github, the last commit: 356eaa8). But it's also working with BinNavi 6.0./BinExport 8. Both on Ubuntu 16.04
Have you tried to compile BinNavi from the github directly ?
From a function in BinNavi, can you translate the graph into the REIL representation ? Graph -> Transform -> Show REIL code
No, that did not work, though I "kinda" narrowed it down.
SEVERE: Reason: Could not translate instruction from unknown architecture x86-64
So, kicked binnavi6 + binexport8 completely from my system, ran a fresh binnavi6.1, put the binexport9 plugin files into IDA's plugin folder - doesn't work either. error: The specified module could not be found.
(zynamics_binexport_9.p64). Since this is some f*\ up IDA/BinNavi/BinExport problem, I'm gonna close the issue here and try to find some motivation to get this fixed tomorrow someday. :-/
aahh you are using 64bits binaries. The branch master of BinNavi does not support x86-64. You need to compile your program in 32 bits :)
They are working on the x86-64 support, more info here: https://github.com/google/binnavi/issues/76
Aww snap! I totally forgot about that, thanks for reminding me ;-)
Hi montyly,
(sorry, couldn't think of a better title)
on a fresh installed VM, I have a rather strange problem with the export GUI
Setup:
in Gueb Export:
When done, I get the following error & stack-trace:
I don't think _init_proc should be in here at all if it wasn't selected? Or did I get lost somehow interpreting this error?
Any pointer in the right direction would be greatly appreciated, thanks!