google / binexport

Export disassemblies into Protocol Buffers
Apache License 2.0
1.03k stars 197 forks source link

binexport build fails, can't find "ins/pc.hpp" #19

Closed thurizas closed 7 years ago

thurizas commented 7 years ago

Building binexport on Windows 7, using MSVC 2015 with Ida-6.95 installed. I've copied the IDA-SDK. The build fails due to a missing file "ins/pc.hpp" which is included from "intel.hpp" (which is part of the IDASDK).

The error message is:

  C:\VStudio15\VC\bin\CL.exe /c /IC:\Users\Administrator\GNUHome\binexport /IC:\Users\Administrator\GNUHome\binexport\build_msvc /IC:\Users\Administrator\GNUHome\binexport\third_party\boost_parts /IC:\Users\Administrator\GNUHome\binexport\third_party\idasdk\include /IC:\Users\Administrator\GNUHome\b
inexport\build_msvc\OpenSSL\include /IC:\PostgreSQL\9.4\include /IC:\Users\Administrator\GNUHome\binexport\none /IC:\Users\Administrator\GNUHome\binexport\third_party\protobuf\src /nologo /W3 /WX- /O2 /Ob2 /Oy- /D WIN32 /D _WINDOWS /D NDEBUG /D __NT__ /D __IDP__ /D USE_DANGEROUS_FUNCTIONS /D USE_STA
NDARD_FILE_FUNCTIONS /D NDEBUG /D "CMAKE_INTDIR=\"Release\"" /D zynamics_binexport_9_plw_EXPORTS /D _WINDLL /D _MBCS /Gm- /EHsc /MT /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"zynamics_binexport_9.plw.dir\Release\\" /Fd"zynamics_binexport_9.plw.dir\Release\vc140.pdb" /Gd /TP /analyze
- /errorReport:queue C:\Users\Administrator\GNUHome\binexport\ida\metapc.cc
  metapc.cc
C:\Users\Administrator\GNUHome\binexport\third_party\idasdk\include\typeinf.hpp(2658): warning C4267: 'return': conversion from 'size_t' to 'type_t', possible loss of data [C:\Users\Administrator\GNUHome\binexport\build_msvc\zynamics_binexport_9.plw.vcxproj]
C:\Users\Administrator\GNUHome\binexport\third_party\idasdk\include\typeinf.hpp(2691): warning C4267: 'return': conversion from 'size_t' to 'uchar', possible loss of data [C:\Users\Administrator\GNUHome\binexport\build_msvc\zynamics_binexport_9.plw.vcxproj]
C:\Users\Administrator\GNUHome\binexport\third_party\idasdk\include\typeinf.hpp(2881): warning C4267: 'return': conversion from 'size_t' to 'cm_t', possible loss of data [C:\Users\Administrator\GNUHome\binexport\build_msvc\zynamics_binexport_9.plw.vcxproj]
C:\Users\Administrator\GNUHome\binexport\third_party\idasdk\include\typeinf.hpp(2951): warning C4267: 'return': conversion from 'size_t' to 'type_t', possible loss of data [C:\Users\Administrator\GNUHome\binexport\build_msvc\zynamics_binexport_9.plw.vcxproj]
C:\Users\Administrator\GNUHome\binexport\third_party\idasdk\include\intel.hpp(11): fatal error C1083: Cannot open include file: 'ins/pc.hpp': No such file or directory [C:\Users\Administrator\GNUHome\binexport\build_msvc\zynamics_binexport_9.plw.vcxproj]
Done Building Project "C:\Users\Administrator\GNUHome\binexport\build_msvc\zynamics_binexport_9.plw.vcxproj" (default targets) -- FAILED.
Done Building Project "C:\Users\Administrator\GNUHome\binexport\build_msvc\zynamics_binexport_9.plw.vcxproj.metaproj" (default targets) -- FAILED.
Done Building Project "C:\Users\Administrator\GNUHome\binexport\build_msvc\binexport.sln" (default targets) -- FAILED.

I can see in the Appveyor yml file that idasdk.zip.enc gets both decrypted and decompressed, but I'm not sure if that should be happening on my local system (seeing as how I already have IDA's SDK) or not. If not, I'm not sure what I missed, or where I can get the missing file.

Also, from the IDA-SDK readme it mentions:

intel.hpp header file from the ibm pc module. for information only, it will not compile because it contains references to internal files!

So I'm wondering why it is being included at all? build_log.txt

Thanks.

cblichmann commented 7 years ago

Yeah, the Hex-Rays guys changed this in the latest SDK. intel.hpp used to be a complete header, but is now supposed to be internal-only. We use it for some x86 specific code (see https://github.com/google/binexport/blob/master/ida/metapc.cc). Temporary workaround (I have some code refactoring the build system pending): Copy or symlink include/allins.hpp to include/ins/pc.hpp.

cblichmann commented 7 years ago

This is fixed in the latest commit