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

Failed to disasemble the given file #47

Closed
suryadesu opened this issue Apr 29, 2020 · 9 comments
Closed

Failed to disasemble the given file #47

suryadesu opened this issue Apr 29, 2020 · 9 comments

Comments

@suryadesu
Copy link

Hi,
I have installed the latest Kam1n0 v2.1 release along with IDA Pro 7.4 (which is the current available version of IDA Pro)
However, when I am trying to index a simple binary file (a normal helloworld object file), it throws me the following error:
c.m.s.d.k.f.d.DisassemblyFactory : Failed to parse the assembly file. The output file parts cannot be located. c.m.s.d.k.f.d.DisassemblyFactory : Failed to parse the assembly file. java.lang.Exception: Failed to disasemble the given file.
ca.mcgill.sis.dmas.kam1n0.impl.disassembly.DisassemblyFactoryIDA.loadAsMultiPart(DisassemblyFactoryIDA.java:203)
ca.mcgill.sis.dmas.kam1n0.framework.disassembly.DisassemblyFactory.loadAsMultiPart(DisassemblyFactory.java:63)
ca.mcgill.sis.dmas.kam1n0.app.clone.CloneSearchResources.disassembleIntoMultiPart(CloneSearchResources.java:150)
This is the corresponding log file is spring.log
Kindly let me know where the issue is and how I can resolve it.
Thanks!

@MilesQLi
Copy link
Contributor

I think there are two possibilities. One is that your IDAPython setting is 2.x. The disassemble python script of Kam1n0 only support Python 3. The other is that your IDAPython is not working, It seems the IDAPython 3 in IDA Pro works only with Python.org distribution and the version should be 3.7.x. If you use Anaconda distribution, IDAPython wouldn't work.

@suryadesu
Copy link
Author

I think there are two possibilities. One is that your IDAPython setting is 2.x. The disassemble python script of Kam1n0 only support Python 3. The other is that your IDAPython is not working, It seems the IDAPython 3 in IDA Pro works only with Python.org distribution and the version should be 3.7.x. If you use Anaconda distribution, IDAPython wouldn't work.

Hi,
We have changed the IDAPython setting to 3 and it is currently pointing to python3.7 of Python.org distribution. However, we are facing the same issue.
Regarding the IDAPlugin, we have unzipped the attached Kam1n0-IDAPlugin.tar.xz and moved the contents of ida-plugin directory (Kam1n0 directory and Kam1n0.py) to path_to_ida_pro/plugins/ directory. Is this right procedure to do?
How do we ensure if ida-plugin is successfully installed?

@svkeerthy
Copy link

Hi,

I am also facing the same issue while indexing the files. This walk-through asks to copy the link address. Should this be pasted somewhere? Does this have something to do with the indexing step?

@MilesQLi
Copy link
Contributor

MilesQLi commented May 1, 2020

@suryadesu @svkeerthy For me to see the problem of fail to disassemble, please find the script ExtractBinaryViaIDA.py from the Kam1n0 source code folder, and put an executable such as a.dll to the path. Then, run the command:
idat64 -A -SExtractBinaryViaIDA.py -Llog.txt a.dll in that path. And show me the content of log.txt.

@suryadesu Regarding the IDAPlugin, we have unzipped the attached Kam1n0-IDAPlugin.tar.xz and moved the contents of ida-plugin directory (Kam1n0 directory and Kam1n0.py) to path_to_ida_pro/plugins/ directory. Is this right procedure to do?
How do we ensure if ida-plugin is successfully installed?
The procedure is correct. If you use windows, it is better to build the installer using Kam1n0-Community/kam1n0-builds/windows/build-installers.bat and install the plugin with it.
If IDA Pro Plugin is correctly installed, when you launch IDA Pro and disassemble a file, you will see the following information in the output window:
Kam1n0: initializing Kam1n0 IDA-pro plugin ...
Kam1n0: Completed initialization.

--I am also facing the same issue while indexing the files. This walk-through asks to copy the link address. Should this be pasted somewhere? Does this have something to do with the indexing step?

@svkeerthy This is not relevant. Kam1n0 Server does not require Kam1n0 IDA Pro Plugin to be installed.

@suryadesu
Copy link
Author

@suryadesu @svkeerthy For me to see the problem of fail to disassemble, please find the script ExtractBinaryViaIDA.py from the Kam1n0 source code folder, and put an executable such as a.dll to the path. Then, run the command:
idat64 -A -SExtractBinaryViaIDA.py -Llog.txt a.dll in that path. And show me the content of log.txt.

@suryadesu Regarding the IDAPlugin, we have unzipped the attached Kam1n0-IDAPlugin.tar.xz and moved the contents of ida-plugin directory (Kam1n0 directory and Kam1n0.py) to path_to_ida_pro/plugins/ directory. Is this right procedure to do?
How do we ensure if ida-plugin is successfully installed?
The procedure is correct. If you use windows, it is better to build the installer using Kam1n0-Community/kam1n0-builds/windows/build-installers.bat and install the plugin with it.
If IDA Pro Plugin is correctly installed, when you launch IDA Pro and disassemble a file, you will see the following information in the output window:
Kam1n0: initializing Kam1n0 IDA-pro plugin ...
Kam1n0: Completed initialization.

--I am also facing the same issue while indexing the files. This walk-through asks to copy the link address. Should this be pasted somewhere? Does this have something to do with the indexing step?

@svkeerthy This is not relevant. Kam1n0 Server does not require Kam1n0 IDA Pro Plugin to be installed.

Hi @MilesQLi
This is the log.txt generated while executing idat64 -A -SExtractBinaryViaIDA.py -Llog.txt helloworld in the path.
It states an attribute error in idaapi module.
Do let us know what's the issue and how to fix it.
Thanks

@MilesQLi
Copy link
Contributor

MilesQLi commented May 1, 2020

@suryadesu The reason is that your Kam1n0 is not upda-to-date. The code of ExtractBinaryViaIDA.py in the up-to-date version is not idaapi.autoWait() but idaapi.auto_wait().

@suryadesu
Copy link
Author

@suryadesu The reason is that your Kam1n0 is not upda-to-date. The code of ExtractBinaryViaIDA.py in the up-to-date version is not idaapi.autoWait() but idaapi.auto_wait().

Hi @MilesQLi ,
Thanks for the reply. Seems like the latest build (Kam1n0 v2.1) from the release page doesn't reflect the changes. Can the latest binaries be found somewhere else? Or how can we include the changes in the current version we have?
Thanks

@MilesQLi
Copy link
Contributor

MilesQLi commented May 2, 2020

Yes, that release was not updated. We will update it later. Now, you can simply compile the project by yourself to update the code. The procedure is given in README.md. You need to install Maven. After you download the up-to-date code, simply running the following commands would compile the jars of Kam1n0 Server:

cd /kam1n0/kam1n0
mvn -DskipTests clean package
mvn -DskipTests package

This gives you the jar files in kam1n0\build-bins .

To update Kam1n0 IDA Pro Plugin, you just need to overwrite the Kam1n0 plugin files in path_to_ida_pro/plugins/ with the current version which you can find in Kam1n0-Community/kam1n0-clients/ida-plugin/ .

@suryadesu
Copy link
Author

Yes, that release was not updated. We will update it later. Now, you can simply compile the project by yourself to update the code. The procedure is given in README.md. You need to install Maven. After you download the up-to-date code, simply running the following commands would compile the jars of Kam1n0 Server:

cd /kam1n0/kam1n0
mvn -DskipTests clean package
mvn -DskipTests package

This gives you the jar files in kam1n0\build-bins .

To update Kam1n0 IDA Pro Plugin, you just need to overwrite the Kam1n0 plugin files in path_to_ida_pro/plugins/ with the current version which you can find in Kam1n0-Community/kam1n0-clients/ida-plugin/ .

Hi @MilesQLi
Building from the source solved the issues.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants