google / binexport

Export disassemblies into Protocol Buffers
Apache License 2.0
1.04k stars 202 forks source link

BinDiff6 on IDA 7.5 and windows 7 #71

Closed fatrolls closed 3 years ago

fatrolls commented 3 years ago

I know you cannot install bindiff6 on Windows 7 only Window 8.1+.

I bypassed that check and still installed it on my Windows 7 machine.. It loads the extension in IDA PRO 7.5 without any issues.

loaded plugin

All looked well until I ran BinDiff (still looks good) still looks good

Now when I do BinDiff (Diff Database (.idb)) the exporting of binexport works fine.. it takes about a minute and it does it job.. but something happens on the next step where it has to do the actual bindiffing.

error happened

see this error happens, why is this ? is this by design to not support windows 7? or is there some fix I can do to fix this issue?

The tool itself bindiff I ran in command prompt works good in Windows 7 works good bindiff comamnd line

I managed to load up the whole thing into the new graphs you see in screenshot #1 similar as it would run without the command prompt so it's fixable right? how do I do it. I really like this tool it's very handy and always exporting it to BinExports then running command line and loading up the BinDiff results into IDA is a bit too much work for me haha anyway around this?

Here is my shitty debugging attempt debug1 debug2

Here are the broken codes I believe lol idk what it means broken lines i think

if I patch those checks for both to not jump to error.. I get new error.. can't find file size something I gave up lol

Here is my BinDiff.xml file

<?xml version="1.0"?>
<bindiff config-version="6">
  <!-- Settings not shown here are java-vm-options and max-heap-size-mb. When
       java-binary is empty or unset, BinDiff will try to auto-detect a
       suitable JVM.
    -->
  <ui server="127.0.0.1" port="2000" retries="20" directory="C:\Program Files\BinDiff\bin" java-binary="C:\Program Files\BinDiff\jre\bin\javaw.exe"/>
  <!-- The actual IDA Pro executable can be set with executable (for 32-bit
       addresses) and executable64 (for 64-bit).
    -->
  <ida directory="F:\Tools\IDA Decompilers\IDA Pro v7.5 (SP3)\"/>
  <!-- How many BinDiff threads to use when batch-diffing. Use "max-hw" for
       the number of hardware threads present in the system.
    -->
  <threads use="2"/>
  <!-- Minimum log level and settings. Levels are (in this order): "debug",
       "info", "warning", "error" and "off". Fatal errors are always logged.
    -->
  <log level="info" to-stderr="false" to-file="false" directory=""/>
  <function-matching>
    <!-- For documentation on the various algorithms, see the BinDiff manual
         at https://zynamics.com/bindiff/manual/index.html#N2038E.
      -->
    <step confidence="1.0" algorithm="function: name hash matching"/>
    <step confidence="1.0" algorithm="function: hash matching"/>
    <step confidence="1.0" algorithm="function: edges flowgraph MD index"/>
    <step confidence="0.9" algorithm="function: edges callgraph MD index"/>
    <step confidence="0.9" algorithm="function: MD index matching (flowgraph MD index, top down)"/>
    <step confidence="0.9" algorithm="function: MD index matching (flowgraph MD index, bottom up)"/>
    <step confidence="0.9" algorithm="function: prime signature matching"/>
    <step confidence="0.8" algorithm="function: MD index matching (callGraph MD index, top down)"/>
    <step confidence="0.8" algorithm="function: MD index matching (callGraph MD index, bottom up)"/>
    <!-- <step confidence="0.7" algorithm="function: edges proximity MD index" /> -->
    <step confidence="0.7" algorithm="function: relaxed MD index matching"/>
    <step confidence="0.4" algorithm="function: instruction count"/>
    <step confidence="0.4" algorithm="function: address sequence"/>
    <step confidence="0.7" algorithm="function: string references"/>
    <step confidence="0.6" algorithm="function: loop count matching"/>
    <step confidence="0.1" algorithm="function: call sequence matching(exact)"/>
    <step confidence="0.0" algorithm="function: call sequence matching(topology)"/>
    <step confidence="0.0" algorithm="function: call sequence matching(sequence)"/>
  </function-matching>
  <basic-block-matching>
    <!-- See https://zynamics.com/bindiff/manual/index.html#N20496 -->
    <step confidence="1.0" algorithm="basicBlock: edges prime product"/>
    <step confidence="1.0" algorithm="basicBlock: hash matching (4 instructions minimum)"/>
    <step confidence="0.9" algorithm="basicBlock: prime matching (4 instructions minimum)"/>
    <step confidence="0.8" algorithm="basicBlock: call reference matching"/>
    <step confidence="0.8" algorithm="basicBlock: string references matching"/>
    <step confidence="0.7" algorithm="basicBlock: edges MD index (top down)"/>
    <step confidence="0.7" algorithm="basicBlock: MD index matching (top down)"/>
    <step confidence="0.7" algorithm="basicBlock: edges MD index (bottom up)"/>
    <step confidence="0.7" algorithm="basicBlock: MD index matching (bottom up)"/>
    <step confidence="0.6" algorithm="basicBlock: relaxed MD index matching"/>
    <step confidence="0.5" algorithm="basicBlock: prime matching (0 instructions minimum)"/>
    <step confidence="0.4" algorithm="basicBlock: edges Lengauer Tarjan dominated"/>
    <step confidence="0.4" algorithm="basicBlock: loop entry matching"/>
    <step confidence="0.3" algorithm="basicBlock: self loop matching"/>
    <step confidence="0.2" algorithm="basicBlock: entry point matching"/>
    <step confidence="0.1" algorithm="basicBlock: exit point matching"/>
    <step confidence="0.0" algorithm="basicBlock: instruction count matching"/>
    <step confidence="0.0" algorithm="basicBlock: jump sequence matching"/>
  </basic-block-matching>
  <theme name="Google Material" based-on="">
    <!-- Google Material colors: Deep Orange (500) -> Google Yellow (A700) ->
         Light Green (A400)
         Generated with
         http://gka.github.io/palettes/#colors=#FF5722,#FF9E00,#84FA02|steps=256|bez=1|coL=1
      -->
    <!-- Color ramp for visualizing similarity in IDA and in the UI, exactly
         256 colors -->
    <ramp for="similarity">
      <c v="#ff5722"/><c v="#ff5722"/><c v="#ff5922"/><c v="#ff5922"/>
      <c v="#ff5a22"/><c v="#ff5b21"/><c v="#ff5b21"/><c v="#ff5c21"/>
      <c v="#ff5d21"/><c v="#ff5e21"/><c v="#ff5f21"/><c v="#ff5f21"/>
      <c v="#ff5f21"/><c v="#ff6120"/><c v="#ff6120"/><c v="#ff6220"/>
      <c v="#ff6220"/><c v="#ff6320"/><c v="#ff6420"/><c v="#ff6520"/>
      <c v="#ff661f"/><c v="#ff671f"/><c v="#ff661f"/><c v="#ff671f"/>
      <c v="#ff681f"/><c v="#ff691f"/><c v="#ff691f"/><c v="#ff6a1e"/>
      <c v="#ff6b1e"/><c v="#ff6c1e"/><c v="#fe6c1e"/><c v="#fe6d1e"/>
      <c v="#fe6f1e"/><c v="#fe6f1e"/><c v="#fe701d"/><c v="#fe711d"/>
      <c v="#fe701d"/><c v="#fe721d"/><c v="#fe721d"/><c v="#fe731d"/>
      <c v="#fe731d"/><c v="#fe741d"/><c v="#fd751c"/><c v="#fe751c"/>
      <c v="#fd761c"/><c v="#fd771c"/><c v="#fd771c"/><c v="#fd791b"/>
      <c v="#fd791b"/><c v="#fd7a1b"/><c v="#fd7a1b"/><c v="#fd7a1b"/>
      <c v="#fc7c1b"/><c v="#fc7d1b"/><c v="#fc7d1a"/><c v="#fc7e1a"/>
      <c v="#fc7f1a"/><c v="#fc7f1a"/><c v="#fc7f1a"/><c v="#fb811a"/>
      <c v="#fb8119"/><c v="#fb8119"/><c v="#fb8319"/><c v="#fb8219"/>
      <c v="#fb8419"/><c v="#fb8419"/><c v="#fa8518"/><c v="#fa8618"/>
      <c v="#fa8718"/><c v="#fa8718"/><c v="#fa8818"/><c v="#fa8718"/>
      <c v="#f98a17"/><c v="#f98917"/><c v="#f98b17"/><c v="#f98a17"/>
      <c v="#f98c17"/><c v="#f88d17"/><c v="#f88c17"/><c v="#f88d16"/>
      <c v="#f88e16"/><c v="#f78f16"/><c v="#f79016"/><c v="#f79015"/>
      <c v="#f79115"/><c v="#f79215"/><c v="#f69215"/><c v="#f69215"/>
      <c v="#f69315"/><c v="#f69415"/><c v="#f59514"/><c v="#f59514"/>
      <c v="#f59614"/><c v="#f49714"/><c v="#f49714"/><c v="#f49813"/>
      <c v="#f49813"/><c v="#f49913"/><c v="#f39a13"/><c v="#f39a13"/>
      <c v="#f39b13"/><c v="#f29c12"/><c v="#f29d12"/><c v="#f29d12"/>
      <c v="#f19e12"/><c v="#f19e11"/><c v="#f19f11"/><c v="#f0a011"/>
      <c v="#f1a011"/><c v="#f0a011"/><c v="#f0a111"/><c v="#efa210"/>
      <c v="#efa210"/><c v="#efa410"/><c v="#eea410"/><c v="#eea510"/>
      <c v="#eea50f"/><c v="#eda60f"/><c v="#eda70f"/><c v="#eda80f"/>
      <c v="#eca90e"/><c v="#eca80e"/><c v="#eca90e"/><c v="#eba90e"/>
      <c v="#ebaa0e"/><c v="#ebab0e"/><c v="#eaac0d"/><c v="#eaac0d"/>
      <c v="#e9ad0d"/><c v="#e9ad0d"/><c v="#e8ae0c"/><c v="#e8af0c"/>
      <c v="#e8af0c"/><c v="#e7b00b"/><c v="#e7b10b"/><c v="#e6b20b"/>
      <c v="#e6b20b"/><c v="#e6b20b"/><c v="#e5b30a"/><c v="#e5b30a"/>
      <c v="#e4b50a"/><c v="#e4b50a"/><c v="#e3b609"/><c v="#e3b709"/>
      <c v="#e3b709"/><c v="#e2b709"/><c v="#e1b809"/><c v="#e1b908"/>
      <c v="#e1ba08"/><c v="#e1b908"/><c v="#dfbb08"/><c v="#dfbb08"/>
      <c v="#debc07"/><c v="#debc07"/><c v="#debe07"/><c v="#debd07"/>
      <c v="#ddbe07"/><c v="#ddbe07"/><c v="#dbc006"/><c v="#dbc006"/>
      <c v="#dac206"/><c v="#dac106"/><c v="#dac206"/><c v="#d9c205"/>
      <c v="#d8c405"/><c v="#d8c405"/><c v="#d7c405"/><c v="#d7c504"/>
      <c v="#d7c504"/><c v="#d6c604"/><c v="#d5c804"/><c v="#d5c704"/>
      <c v="#d4c904"/><c v="#d3c903"/><c v="#d3ca03"/><c v="#d2cb03"/>
      <c v="#d2ca03"/><c v="#d1cc03"/><c v="#d0cd03"/><c v="#d0cc03"/>
      <c v="#d0cc03"/><c v="#cfcd02"/><c v="#cece02"/><c v="#cdcf02"/>
      <c v="#cbd002"/><c v="#cbd102"/><c v="#cbd002"/><c v="#cad202"/>
      <c v="#cad102"/><c v="#c9d301"/><c v="#c8d401"/><c v="#c7d401"/>
      <c v="#c7d501"/><c v="#c5d601"/><c v="#c5d601"/><c v="#c4d701"/>
      <c v="#c3d800"/><c v="#c3d700"/><c v="#c2d800"/><c v="#c2d800"/>
      <c v="#c0da00"/><c v="#bfda00"/><c v="#bfda00"/><c v="#bedc00"/>
      <c v="#bedb00"/><c v="#bcdd00"/><c v="#bbde00"/><c v="#bbdd00"/>
      <c v="#bade00"/><c v="#bade00"/><c v="#b8e000"/><c v="#b7e100"/>
      <c v="#b7e100"/><c v="#b5e100"/><c v="#b5e100"/><c v="#b4e300"/>
      <c v="#b4e200"/><c v="#b2e400"/><c v="#b1e400"/><c v="#b1e400"/>
      <c v="#afe600"/><c v="#aee600"/><c v="#ade600"/><c v="#ace800"/>
      <c v="#ace700"/><c v="#aae900"/><c v="#aae800"/><c v="#a8e900"/>
      <c v="#a6eb00"/><c v="#a6ea00"/><c v="#a4eb00"/><c v="#a4ec00"/>
      <c v="#a3ed00"/><c v="#a1ee00"/><c v="#a1ee00"/><c v="#a1ed00"/>
      <c v="#9fee00"/><c v="#9def00"/><c v="#9def00"/><c v="#9bf000"/>
      <c v="#98f200"/><c v="#98f200"/><c v="#96f300"/><c v="#96f300"/>
      <c v="#94f301"/><c v="#94f401"/><c v="#92f401"/><c v="#8ff601"/>
      <c v="#8ff601"/><c v="#8df601"/><c v="#8cf701"/><c v="#8bf701"/>
      <c v="#88f802"/><c v="#88f902"/><c v="#85fa02"/><c v="#84fa02"/>
    </ramp>
    <!-- Manually assigned matches. Light Blue (900) -->
    <c for="manual-match" v="#01579b"/>

    <!-- Default text color in graph nodes -->
    <c for="text" v="#000000"/>
    <c for="address" v="#000000"/>
    <c for="mnemonic" v="#000080"/>
    <c for="symbol" v="#940707"/>
    <c for="immediate" v="#8c0000"/>
    <c for="operator" v="#010101"/>
    <c for="register" v="#0067e9"/>
    <c for="size-prefix" v="#9f9e9e"/>
    <c for="dereference" v="#010101"/>
    <c for="operator-separator" v="#000000"/>
    <c for="stack-var" v="#8c0000"/>
    <c for="global-var" v="#8c0000"/>
    <c for="jump-label" v="#a000a0"/>
    <c for="function" v="#8c0000"/>
    <c for="comment" v="#646464"/>

    <!-- Background color in graph windows -->
    <c for="background" v="#ffffff"/>
    <c for="background-primary-start" v="#ffffff"/>
    <c for="background-primary-stop" v="#ffffff"/>
    <c for="background-secondary-start" v="#ffffff"/>
    <c for="background-secondary-stop" v="#ffffff"/>

    <!-- Font settings -->
    <f for="ui" v="Roboto" s="13"/>
    <f for="code" v="Roboto Mono" s="13"/>
  </theme>
  <preferences>
    <workspace default="" directory=""/>
    <history>
      <entry for="new-diff-primary-dir" v=""/>
      <entry for="new-diff-secondary-dir" v=""/>
      <entry for="directory-diff-primary-dir" v=""/>
      <entry for="directory-diff-secondary-dir" v=""/>
      <entry for="add-existing-diff-dir" v=""/>
      <list for="workspace-dir">
        <!-- List of recent workspace directories: <entry v=""/> -->
      </list>
    </history>
    <layout>
      <!-- screenWidth/screenHeight will be used to check for changed
           resolution
        -->
      <window height="900" maximized="false" width="1200" x="100" y="100"/>
      <divider-position v="300"/>
    </layout>
    <use-theme name="Google Material"/>
    <call-graph>
      <!-- animation-speed = 0 disabled, otherwise range from 1-10 -->
      <layout default="hierarchical" auto="true" draw-bends="false" animation-speed="5"/>
      <proximity-browsing enabled="true" auto-enable-threshold="300" child-depth="1" parent-depth="1" visibility-warn-threshold="400"/>
      <!-- style either "default" or "orthogonal-edge-routing" -->
      <hierarchical-layout style="default" orientation="vertical" min-layer-distance="50" min-node-distance="25"/>
      <!-- style either "default" or "tree", orientation "vertical" or
           "horizontal"
        -->
      <orthogonal-layout style="default" orientation="vertical" min-node-distance="25"/>
      <!-- style either "compact", "isolated" or "single-cycle" -->
      <circular-layout style="compact" min-node-distance="50"/>
      <!-- sensitivity steps 0-9, wheel-action either "zoom" or "scroll" -->
      <control scroll-sensitivity="4" zoom-sensitivity="4" wheel-action="scroll" show-scrollbars="false" view-synchronization="true"/>
    </call-graph>
    <flow-graph>
      <!-- Same settings as for call-graph -->
      <layout default="hierarchical" auto="true" draw-bends="false" animation-speed="5"/>
      <proximity-browsing enabled="true" auto-enable-threshold="200" child-depth="2" parent-depth="2" visibility-warn-threshold="300"/>
      <hierarchical-layout orthogonal-edge-routing="false" orientation="horizontal" min-layer-distance="50" min-node-distance="25"/>
      <orthogonal-layout style="normal" orientation="horizontal" min-node-distance="50"/>
      <circular-layout style="compact" min-node-distance="50"/>
      <control scroll-sensitivity="4" zoom-sensitivity="4" wheel-action="scroll" show-scrollbars="false" view-synchronization="true"/>
    </flow-graph>
  </preferences>
</bindiff>

Please help me!

Thank you.

cblichmann commented 3 years ago

Hi there,

While we indeed do not support Windows 7 any longer, I agree that this does not seem to be the issue here. The code location just prior to diffing that you pointed out does the following:

  const auto filename1(FindFile(JoinPath(temp_dir, "primary"), ".BinExport"));
  const auto filename2(FindFile(JoinPath(temp_dir, "secondary"), ".BinExport"));
  if (filename1.empty() || filename2.empty()) {
    throw std::runtime_error("Export failed. Is the se...

Where temp_dir is obtained by GetTempPath() (on Windows) with "BinDiff" as a sub-directory. Inside, there should be two directories, primary and secondary each containing a .BinExport file with the same basename as the IDB. FindFile() looks for the first .BinExport file in the respective directories, returning an empty string if none was found.

Do any of the IDB directories contain a . in their names? We used to have a rather embarassing bug that would return the wrong file extension if a directory already contained a ..

Can you check that you didn't set the TMP or TEMP environment variables to something unusual? Try removing the "BinDiff" temp dir and trying again.

Other than that, I can't really explain why the IDA plugin does not find your .BinExport files.

fatrolls commented 3 years ago

Hey cblichmann thanks for replying.

Yes indeed my IDB files do indeed contain dots in them. That's probably it let me remove the .exe extension and see if it works now. z66

After I removed the .exe from .idb still doesn't work.

The problem is it doesn't Export the secondary BinExport.

I tried moving folder files to same Drive. and trying that and that didn't help I tried the moving both to the other drive and trying form there too, still no go, for my final test I tried moving them both to root of C:\ drive and still didn't work

I also tried not just renaming the files and removing the .exe but rewriting the database in IDA with the new filenames, didn't help as well.

22z

It TEMP / TMP does indeed have BinDiff folder

zzz

It seems to create a temporay.database file as it's running. (52 kb)

I tried to see whats inside the temporary.database although the functionalgorithm/basicblockalgorithm tables are populated all others are empty. qqz

qz

vz

when I get the error

az

the primary folder has the engine.BinExport file (25 mb)

Here is some of the contents of it should be okay as it works, just showing jsut in case :D b

z

but the secondary folder is always empty on all tests I did.

And here is proof of the secondary folder being empty bvvb

I also ran the Java program BinDiff which also has a problem bvba

axax

Error.. happens instantly in 1 second, Also you barely make out because it runs so quickly but it does pass the first db, and when it says something about secondary db, the error then happens similar to the IDA plugin. vbvbv

I managed to screenshot it in time. adbvb

It also detects if you open the same IDB twice for diffing properly gfdgfdg

Yes I deleted the BinDiff folder from Temp and that also didn't help, it auto deletes the folder when closing the IDA as well.

I also tried deleting from temp folder the ida folder which contained a bunch of different engine.idb folders that had no effect to the problem as well.

I wonder if this has anything to do with it, I don't even have zynamics in my Program Files ghghzz

See hghg

Added the zynamics folder to Program Files and copied BinDiff and renamed it to BinDiff 6 and hey look at that nothing happened lol that didn't fix it.

Also this looked very odd.. I see call_idc_func (BinExportBinary function) only called 1 time.. for the secondary database I can't seem to find the code could that be it? Nevermind I think it does both at once "file1", 1", "file2", 0

sdghgfh

O well haha if you figure out the problem let me know I gave up again.

Thanks again cblichmann

cblichmann commented 3 years ago

Ok, if the secondary folder is always empty, then something must go wrong during the call to the BinExport plugin. How did you generate engine2.BinExport in the first comment? Did you select Edit|Plugins|BinExport and then clicking BinExport v2 Binary Export?

There are a couple of logging options for you to try on the command-line. Using file and directory names without any extra . in them is still a good idea.

Try starting IDA from the command-line using these additional arguments:

"F:\Tools\IDA Decompilers\IDA Pro v7.5 (SP3)\ida.exe" -OBinExportLogFile:<Path\To\BinExportLogFile.log> -OBinExportAlsoLogToStdErr:TRUE <Path\To\Your\engine.idb>

As for the Java UI, I think it might actually be the same issue. In the BinDiff UI, you can use Settings|Main Settings...|Logging and enable Console logging and File logging. If you launch the UI from the command-line, use this command:

"C:\Program Files\BinDiff\jre\bin\java.exe" -jar "C:\Program Files\BinDiff\bin\bindiff.jar" -c -f <Path\To\A\BinDiff\LogDir>

(Note that I'm on macOS at the moment, so you may need to tweak the command-lines above a bit in case I got it wrong.)

As for your code snippets: call_idc_func with BinExportBinary is indeed only being called once. The rationale is simple: For the primary IDB, the BinExport plugin is loaded and the IDC function can be called to perform the export. For the secondary IDB, we launch another instance of IDA Pro to perform the export for us, but using the -OBinExportAutoAction:BinExportBinary argument, which, together with -OBinExportModule:<Path\to\IDB> will export an IDB as soon as it is loaded.

And finally, regarding the zynamics string in the binary: That is simply a last-resort fallback in case the configuration setting is unset/broken:

    ...
    SendGuiMessage(
        config->ReadInt("/bindiff/ui/@retries", 20),
        config->ReadString("/bindiff/ui/@directory",
                           // TODO(cblichmann): Use better defaults
                           "C:\\Program Files\\zynamics\\BinDiff 6\\bin"),
        config->ReadString("/bindiff/ui/@server", "127.0.0.1"),
        static_cast<uint16>(config->ReadInt("/bindiff/ui/@port", 2000)),
        message, nullptr);
   ...

BinDiff 7 will come with a new configuration file format and addresses that TODO :)

fatrolls commented 3 years ago

Hello again how are you :D thanks alot for the explanations.

about that TODO comment I did notice some bug in the BinDiff.xml it set the ui directory to BINDIFF_DIR during installation of BinDiff6.msi so I thought I had to set a Environment Variable called BINDIFF_DIR that redirects to "C\Program Files\BinDiff\bin"

To summarize again Everything I did failed even logs were empty and useless.

I found a bug that in the Java UI it specifics the path without quotes " that way it can't detect the spaces in folders etc.. probably similar bug to BinDiff call from plugin.. although I don't use BinDiff Workspace folder in User directory as I do in Java UI but instead C:\Users\User\AppData\Roaming\BinDiff which has no spaces in any folders so it shouldn't have a problem.

But the bug happens before running the bindiff command as the Exporting primary IDB / Exporting secondary IDB doesn't export anything in Java UI and it exits in about a fraction of a second. Yes the BinDiff Workspace folder creates a folder engine vs engine2 which is empty and test.BinDiffWorkspace is a sqlite database which is 28 kb similar size to the IDA plugin db when it fails.

For JAVA UI I did this to make it work.

I set in the java UI logging on and console logging on both features and it generated a bindiff_ui.log and bindiff_ui.log.lck both are empty.

Here is the most helpful error log I found when it actually generated some error logging I had to remove the -c -f <Path\To\A\BinDiff\LogDir> and it started to generate logs in Java UI I set the path instead.

JAVA UI Log:

I0119 07:57:27.330559 17 c/g/s/z/b.BinDiff::lambda$main$1] Starting BinDiff 6 (Java 11.0.2)
I0119 07:57:27.802586 17 c/g/s/z/b.socketserver.SocketServer::startListening] Starting local command server on port 2000...
I0119 07:57:36.871105 17 c/g/s/z/b.BinDiff::applyLoggingChanges] Applying logger changes...
I0119 07:57:36.873105 17 c/g/s/z/b.config.BinDiffConfig::write] Saving configuration...
W0119 07:57:51.839961 17 c/g/s/z/b.project.Workspace::newWorkspace] Created new Workspace
I0119 07:58:03.376621 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff] - Exporting primary IDB 'C:\engine.idb' to 'C:\Users\User\BinDiff Workspace2\BinDiff Workspace\engine vs engine2'
I0119 07:58:03.633635 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff] - Exporting secondary IDB 'C:\engine2.idb' to 'C:\Users\User\BinDiff Workspace2\BinDiff Workspace\engine vs engine2'
I0119 07:58:03.884650 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff] - Diffing 'engine vs engine2'
I0119 07:58:03.890650 44 c/g/s/z/b.processes.DiffProcess::startDiffProcess] C:\Program Files\BinDiff\bin\bindiff.exe --primary C:\Users\User\BinDiff Workspace2\BinDiff Workspace\engine vs engine2\engine.BinExport --secondary C:\Users\User\BinDiff Workspace2\BinDiff Workspace\engine vs engine2\engine2.BinExport --output_dir C:\Users\User\BinDiff Workspace2\BinDiff Workspace\engine vs engine2 --output_format=bin
I0119 07:58:03.923652 46 c/g/s/z/b.processes.ProcessOutputStreamReader::run] [BinDiff Process - stdout] BinDiff 6 (@297836223, Feb 28 2020), (c)2004-2011 zynamics GmbH, (c)2011-2020 Google LLC.
I0119 07:58:03.924652 46 c/g/s/z/b.processes.ProcessOutputStreamReader::run] [BinDiff Process - stdout] Error: Invalid inputs, --primary and --secondary must point to valid files/directories.
E0119 07:58:03.927652 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff] An error occurred while diffing. Exit code 1.
E0119 07:58:03.927652 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff] com.google.security.zynamics.bindiff.exceptions.DifferException: An error occurred while diffing. Exit code 1.
E0119 07:58:03.927652 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.bindiff.processes.DiffProcess.handleExitCode(Unknown Source)
E0119 07:58:03.927652 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.bindiff.processes.DiffProcess.startDiffProcess(Unknown Source)
E0119 07:58:03.927652 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.bindiff.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation.createNewDiff(Unknown Source)
E0119 07:58:03.927652 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.bindiff.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation.newDiff(Unknown Source)
E0119 07:58:03.927652 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.bindiff.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation.runExpensiveCommand(Unknown Source)
E0119 07:58:03.927652 44 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.zylib.gui.ProgressDialogs.CEndlessHelperThread.run(Unknown Source)

I did notice a bug.. both BinExport export to the same filename.. so the other BinExport gets overwritten I had to do it 3 times. But that's because I didn't look at the filename that you can specify when doing it and blindly clicked ok

Yes to get the engine2.BinExport I did BinExport plugin -> BinExport v2 Binary Export inside IDA twice.. opening up each engine.idb in a new IDA and running that for both idb's that loaded up. Then I ran bindiff by command line to generate a engine_vs_engine2.BinDiff then Click IDA Plugin BinDiff -> Load Results... and select the engine_vs_engine2.BinDiff BinDiff results file is 25.0 MB (26,316,800 bytes)

I got no problem using it the way I'm using it but its a little uncomfortable hehe.

First BinExport asdfg Second BinExport hgh

BinDiff command line ghghgh

Final result hghg

I tried the first command line with the correct path and I get a IDA error msgbox.. and the BinExportLogFile.log is generated empty.

"F:\Tools\IDA Decompilers\IDA Pro v7.5 (SP3)\ida.exe" -OBinExportLogFile:<Path\To\BinExportLogFile.log> -OBinExportAlsoLogToStdErr:TRUE <Path\To\Your\engine.idb>

Everytime I ran IDA.exe with the command line you shown with the correct paths of course it also generated IDA crashdmps 100 mb each which crash at location binexport11.dll

Unhandled exception at 0x000007FEEA3C1178 (binexport11.dll) in ida-20210119-074835-11880.dmp: 0xC0000005: Access violation reading location 0x0000000000000000.

Stack trace

STACK_TEXT:  
00000000`0061e720 000007fe`ea3c19a3 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : binexport11+0x61178
00000000`0061eaa0 00000001`3f836624 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : binexport11+0x619a3
00000000`0061ead0 00000001`3f832cad : 00000000`00000000 00000000`0061ec00 000007fe`ea5dcf00 00000000`00000000 : ida+0x56624
00000000`0061eb00 000007fe`ea3c0fca : 00000000`00000056 00000000`0061f010 00000000`00000000 00000001`3f832c10 : ida+0x52cad
00000000`0061ef70 000007fe`ea42c77a : 00000000`0061f230 000007fe`ea5dcf5c 00000000`0312c820 00000000`0061f218 : binexport11+0x60fca
00000000`0061f090 000007fe`ea3a0bf2 : 00000000`00000002 00000000`03145300 000007fe`ea5dcf5c 00000000`00000000 : binexport11+0xcc77a
00000000`0061f160 00000000`68fa230c : 00000000`6914acf0 00000000`03145380 00000000`00000000 00000000`007d8c10 : binexport11+0x40bf2
00000000`0061f2a0 00000000`68fa346e : 00000000`03145380 00000000`00000000 00000000`00000000 000007fe`ea67f260 : ida_68de0000!user2bin+0x51dc
00000000`0061f320 00000000`68fa1330 : 00000000`00000000 00000000`007ea490 00000000`02f948a0 00000000`00000000 : ida_68de0000!user2bin+0x633e
00000000`0061f4f0 00000001`3f95acf0 : 00000001`3fa265d3 00000000`0061f5e0 00000000`00000008 00000000`00000000 : ida_68de0000!user2bin+0x4200
00000000`0061f570 00000001`3f95ae82 : 00000000`00000000 00000000`00000000 00000000`0061f6d0 00000000`00000000 : ida+0x17acf0
00000000`0061f620 00000001`3f95aeac : 00000000`0000001f 00000001`3f872fbe 00000000`5fc04cb0 00000000`0061f6d0 : ida+0x17ae82
00000000`0061f660 00000001`3f95bbfd : 00000000`0061f738 00000000`02e74a30 00000000`02de4610 00000000`02dce7b0 : ida+0x17aeac
00000000`0061f6a0 00000001`3f95bd8f : 00000000`00000004 00000000`00000020 00000000`00857160 00000000`0286fb10 : ida+0x17bbfd
00000000`0061f930 00000001`3fa08452 : 00000000`0000000a 00000000`00000000 00000000`00000000 00000000`00000000 : ida+0x17bd8f
00000000`0061f980 00000000`76d6570d : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ida+0x228452
00000000`0061f9c0 00000000`76ec385d : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0xd
00000000`0061f9f0 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x1d

Here is a zipped up crashdump of IDA when I ran the BinExport commandline https://www.mediafire.com/file/sx7bbmur7o74fyx/ida-20210119-074814-11900.7z/file

Tried also these same red error

"F:\Tools\IDA Decompilers\IDA Pro v7.5 (SP3)\ida.exe" -OBinExportLogFile:C:\Users\User\Desktop\test.log -OBinExportAlsoLogToStdErr:TRUE C:\engine.idb
"F:\Tools\IDA Decompilers\IDA Pro v7.5 (SP3)\ida.exe" -OBinExportLogFile:"C:\Users\User\Desktop\test.log" -OBinExportAlsoLogToStdErr:TRUE "C:\engine.idb"

aasd

Ran the Java command line

C:\Users\User>"C:\Program Files\BinDiff\jre\bin\java.exe" -jar "C:\Program Files
\BinDiff\bin\bindiff.jar" -c -f "C:\"
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine] Could not create l
og file handler
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine] java.io.FileNotFou
ndException: C:\Users\User\AppData\Roaming\BinDiff\logs (Access is denied)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.base/jav
a.io.FileOutputStream.open0(Native Method)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.base/jav
a.io.FileOutputStream.open(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.base/jav
a.io.FileOutputStream.<init>(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.base/jav
a.io.FileOutputStream.<init>(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.logging/
java.util.logging.FileHandler.open(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.logging/
java.util.logging.FileHandler.rotate(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.logging/
java.util.logging.FileHandler.openFiles(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.logging/
java.util.logging.FileHandler.<init>(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at com.google.se
curity.zynamics.bindiff.BinDiff.parseCommandLine(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at com.google.se
curity.zynamics.bindiff.BinDiff.lambda$main$1(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.event.InvocationEvent.dispatch(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.EventQueue.dispatchEventImpl(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.EventQueue$4.run(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.EventQueue$4.run(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.base/jav
a.security.AccessController.doPrivileged(Native Method)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.base/jav
a.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unkno
wn Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.EventQueue.dispatchEvent(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
W0119 07:17:35.943779 17 c/g/s/z/b.BinDiff::parseCommandLine]   at java.desktop/
java.awt.EventDispatchThread.run(Unknown Source)
E0119 07:17:36.249797 17 c/g/s/z/b.gui.tabpanels.projecttabpanel.WorkspaceTabPan
elFunctions::loadWorkspace] Load workspace failed. Workspace folder does not exi
st.
I0119 07:17:36.344802 17 c/g/s/z/b.socketserver.SocketServer::startListening] St
arting local command server on port 2000...
W0119 07:19:09.713143 17 c/g/s/z/b.project.Workspace::newWorkspace] Created new
Workspace
I0119 07:19:18.590650 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff] - Exporting primary IDB 'C:\engine.idb' t
o 'C:\Users\User\BinDiff Workspace2\engine vs engine2'
I0119 07:19:18.845665 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff] - Exporting secondary IDB 'C:\engine2.idb
' to 'C:\Users\User\BinDiff Workspace2\engine vs engine2'
I0119 07:19:19.088679 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff] - Diffing 'engine vs engine2'
I0119 07:19:19.094679 41 c/g/s/z/b.processes.DiffProcess::startDiffProcess] C:\P
rogram Files\BinDiff\bin\bindiff.exe --primary C:\Users\User\BinDiff Workspace2\
engine vs engine2\engine.BinExport --secondary C:\Users\User\BinDiff Workspace2\
engine vs engine2\engine2.BinExport --output_dir C:\Users\User\BinDiff Workspace
2\engine vs engine2 --output_format=bin
I0119 07:19:19.172684 43 c/g/s/z/b.processes.ProcessOutputStreamReader::run] [Bi
nDiff Process - stdout] BinDiff 6 (@297836223, Feb 28 2020), (c)2004-2011 zynami
cs GmbH, (c)2011-2020 Google LLC.
E0119 07:19:19.175684 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff] An error occurred while diffing. Exit cod
e 1.
E0119 07:19:19.175684 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff] com.google.security.zynamics.bindiff.exce
ptions.DifferException: An error occurred while diffing. Exit code 1.
E0119 07:19:19.175684 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.bindiff.
processes.DiffProcess.handleExitCode(Unknown Source)
E0119 07:19:19.175684 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.bindiff.
processes.DiffProcess.startDiffProcess(Unknown Source)
E0119 07:19:19.175684 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.bindiff.
gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation.createNewDif
f(Unknown Source)
E0119 07:19:19.175684 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.bindiff.
gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation.newDiff(Unkn
own Source)
E0119 07:19:19.175684 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.bindiff.
gui.tabpanels.projecttabpanel.implementations.NewDiffImplementation.runExpensive
Command(Unknown Source)
E0119 07:19:19.175684 41 c/g/s/z/b.gui.tabpanels.projecttabpanel.implementations
.NewDiffImplementation::createNewDiff]  at com.google.security.zynamics.zylib.gu
i.ProgressDialogs.CEndlessHelperThread.run(Unknown Source)

The logs folder the logs are all empty C:\Users\User\AppData\Roaming\BinDiff\logs

I tried also deleteing the BinfDiff folder because I notice it's getting a access denied violation in java output, same problem , also tried making the folder non-read-only and still same errors.

cblichmann commented 3 years ago

Closing. It's clearly difficult to debug or even reproduce this in the current state. I hope you were able to complete your task regardless.

I will send you a beta of BinDiff 7 once it's available.