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 importing json data in Ghidra #2

Open
Daniels118 opened this issue Jul 20, 2024 · 2 comments
Open

Error importing json data in Ghidra #2

Daniels118 opened this issue Jul 20, 2024 · 2 comments

Comments

@Daniels118
Copy link

When I run the following command from the Ghidra Python console:

__import__("imp").load_source('analysis', r'xxxxx/extracted_reversing_data_bw_141.json').main(currentProgram, state)

I get the following error:

Traceback (most recent call last):
  File "python", line 1, in <module>

Please provide a CPython 2.7 bytecode file (.pyc), e.g. run
    python -m py_compile xxxxx/extracted_reversing_data_bw_141.json

Alternatively, specify a CPython 2.7 command via the python.cpython2 property, e.g.:
    jython -Dpython.cpython2=python
or (e.g. for pip) through the environment variable JYTHON_OPTS:
    export JYTHON_OPTS="-Dpython.cpython2=python"

	at org.python.compiler.Module.loadPyBytecode(Module.java:837)
	at org.python.compiler.Module.compile(Module.java:1001)
	at org.python.core.imp.compileSource(imp.java:549)
	at org.python.core.imp.createFromSource(imp.java:577)
	at org.python.core.imp.createFromSource(imp.java:562)
	at org.python.modules._imp.load_source(_imp.java:161)
	at org.python.modules._imp.load_source(_imp.java:146)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)

java.lang.RuntimeException: java.lang.RuntimeException: Module or method too large in `xxxxx/extracted_reversing_data_bw_141.json`.

Please provide a CPython 2.7 bytecode file (.pyc), e.g. run
    python -m py_compile D:/Archivio/Giochi/Black_and_White/extracted_reversing_data_bw_141.json

Alternatively, specify a CPython 2.7 command via the python.cpython2 property, e.g.:
    jython -Dpython.cpython2=python
or (e.g. for pip) through the environment variable JYTHON_OPTS:
    export JYTHON_OPTS="-Dpython.cpython2=python"

I've tried to set Python 2.7 as suggested by executing these 2 lines:

from java.lang import System
System.setProperty('python.cpython2', 'E:/Python27/python.exe')

then the command has produced a file named extracted_reversing_data_bw_141.jsonc but it still failed with the following error:

Traceback (most recent call last):
  File "python", line 1, in <module>
AttributeError: 'module' object has no attribute 'main'

which sounds fair (why compiling data should solve the problem, if the problem is in the code?)

Am I missing something?

@bwrsandman
Copy link
Member

Can you post the about info for your runblack.
image

@Daniels118
Copy link
Author

image

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

2 participants