Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while diffing: Export of the secondary database failed #81

Open
romanholidaypancakes opened this issue Jul 23, 2021 · 12 comments
Open
Labels
bug Something isn't working

Comments

@romanholidaypancakes
Copy link

log:

Error while diffing: Export of the secondary database failed: Error executing: '"E:\tools\reverse\IDA PRO 7.5\ida64.exe" "-A" "-OBinExportAutoAction:BinExportBinary" "-OBinExportModule:C:\Users\USER~3\AppData\Local\Temp\BinDiff\secondary\test.sys1.BinExport" "-OBinExportAlsoLogToStdErr:FALSE" "-OBinExportX86NoReturnHeuristic:FALSE" "E:\testbin\test.sys1.i64"'

maybe related :#71

I noticed that the path contains the user USER~3. Now my computer does not contain this user, so the path does not exist. Is it a better solution not to use the path of a specific user?

@cblichmann
Copy link
Member

Hi there,

BinDiff uses BinExport's GetOrCreateTempDirectory() and then invokes the IdbExporter:

  auto temp_dir = GetOrCreateTempDirectory("BinDiff");
  // ...
  const std::string secondary_temp_dir = JoinPath(*temp_dir, "secondary");
  // ...
  const auto& config = config::Proto();
    auto options =
        IdbExporter::Options()
            .set_export_dir(secondary_temp_dir)
            .set_ida_dir(idadir(/*subdir=*/nullptr))
            .set_alsologtostderr(Plugin::instance()->alsologtostderr());
    // ...
    IdbExporter exporter(options);
    exporter.AddDatabase(secondary_idb_path);

    absl::Status status;
    std::thread export_thread(
        [&status, &exporter]() { status = exporter.Export(); });

Under the hood, on Windows, this calls into GetTempPathA(). This will likely return a per-user path, which may contain a shortened path based on the value of %USERPROFILE%.

I'm not sure what goes wrong here, but you can try to set the TEMP environment variable to, say, C:\TEMP (and create this dir). If the MSDN documentation for GetTempPathA() is correct, it should pick up this path first.

Are you running the new BinDiff 7? And which version of Windows?

@romanholidaypancakes
Copy link
Author

win10 and bindiff7.

@cblichmann
Copy link
Member

Did my suggestion to set the TEMP environment variable help at all?

Another thing to check: Are you using a non-US locale or non US-English settings for the user interface language?

@romanholidaypancakes
Copy link
Author

I still get an error after trying,(i forgot to reply...

@cblichmann
Copy link
Member

(back from vacation)

I still get an error after trying,(i forgot to reply...

Does that mean you set TEMP to a different value and it didn't help? Also (see above), this is sensitive to local and user interface settings. Are you on a non-US locale or non US-English interface language?

As is, I cannot reproduce (and hence fix) this issue, unfortunately.

@romanholidaypancakes
Copy link
Author

romanholidaypancakes commented Aug 18, 2021

steps: ida(load primary idb file) - file - bindiff - load secondary idb file

There is a correct path in the option BinExportModule now, but the binfile.BinExport file is not generated, here is the error log:

Error while diffing: Export of the secondary database failed: Error executing: '"E:\tools\reverse\IDA PRO 7.5\ida64.exe" "-A" "-OBinExportAutoAction:BinExportBinary" "-OBinExportModule:C:\temp\BinDiff\secondary\binfile.BinExport" "-OBinExportAlsoLogToStdErr:FALSE" "-OBinExportX86NoReturnHeuristic:FALSE" "C:\Users\user1\Desktop\test\filedir\binfile.i64"'

I'm using a non-English windows system.

@SiOuz
Copy link

SiOuz commented Sep 11, 2021

Same error here on windows version

@cblichmann
Copy link
Member

@SiOuz, what is your language locale? I'm guessing non-US also?

@cblichmann cblichmann added the bug Something isn't working label Sep 13, 2021
@babrath
Copy link

babrath commented Oct 19, 2021

I get the same issue on Kali Linux (2021.3), for IDA Free 7.6 and BinDiff 7.

@cblichmann
Copy link
Member

@babrath, what happens if you manually execute the command that is printed (try setting -OBinExportAlsoLogToStdErr:TRUE, though)?

@babrath
Copy link

babrath commented Oct 21, 2021

@cblichmann So the command was printed nowhere, but I found it using an strace. So I executed:

/home/kali/tools/idafree-7.6/ida64 -A -OBinExportAutoAction:BinExportBinary -OBinExportModule:/tmp/bindiff/secondary/patched.BinExport -OBinExportAlsoLogToStdErr:TRUE -OBinExportX86NoReturnHeuristic:FALSE /home/kali/repos/task2/patched.i64

And got the following output:

Gtk-Message: 11:09:48.254: Failed to load module "gail"

** (ida64:1638): WARNING **: 11:09:48.261: (../atk-adaptor/bridge.c:1018):atk_bridge_adaptor_init: runtime check failed: (root)
/usr/share/themes/Kali-Dark/gtk-2.0/gtkrc:39: Unable to find include file: "apps.rc"
/usr/share/themes/Kali-Dark/gtk-2.0/gtkrc:40: Unable to find include file: "hacks.rc"
/usr/share/themes/Kali-Dark/gtk-2.0/gtkrc:41: Unable to find include file: "hacks-dark.rc"
I1021 11:09:48.507509    1638 main_plugin.cc:353] BinExport 12 (@377499286, Jun  4 2021), (c)2004-2011 zynamics GmbH, (c)2011-2021 Google LLC.

None of which seem relevant? No new files appeared in /tmp/bindiff/secondary/, and the exit code is 1.

@shmily-ou
Copy link

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants