google / binexport

Export disassemblies into Protocol Buffers
Apache License 2.0
1.05k stars 206 forks source link

ERROR: value too long for type character varying(40) #34

Closed meteorlxy closed 4 years ago

meteorlxy commented 5 years ago

I have confirmed that binexport installed correctly. BinExportText() and BinExportStatistics() works well.

When executing BinExportSql(), this error occurs.

IDC>BinExportSql("xxx", 5432, "xxx", "xxx", "xxx", "xxx")
Error exporting: Executing query failed: ERROR:  value too long for type character varying(40)

          0.        0h           0o 0000000000000000000000000000000000000000000000000000000000000000b '........'

image


Other Infomation:

cblichmann commented 5 years ago

Thanks for your bug report. Do you have any additional information? Can you perhaps share the IDB or a simple test case where this happens?

meteorlxy commented 5 years ago

@cblichmann Thanks for your quick reply ❤️ .

Here I upload two IDB:

https://github.com/meteorlxy/binexport-34

In fact, I've randomly tested with some files and they all failed with the same error. I wonder if this is an issue with the version of my IDA Pro.


BTW, when I try to import an IDB (generated by 6.8) with 7.0 & binexport 10, I meet the same error in #24.

cblichmann commented 5 years ago

Thanks, I'll look into it

cblichmann commented 5 years ago

Found it: IDA 7 removed the API for obtaining SHA-1 hashes of the original file. As a replacement, BinExport now uses SHA-256, which is too long. I have prepared an internal change for this and expect this to land in a few days.

meteorlxy commented 5 years ago

Great thanks!

I noticed that the SHA1 field is varying(40) but I forgot to mention above. Sorry for that and looking forward to the new release.

cblichmann commented 4 years ago

The fix is writing all-zeroes into the SHA1 field for BinNavi (should still update it to use SHA256 at some point): https://github.com/google/binexport/blob/master/database/postgresql_writer.cc#L224