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

class file has wrong version 58.0, should be 55.0 #9

Closed
aoprea1982 opened this issue Jul 27, 2020 · 3 comments
Closed

class file has wrong version 58.0, should be 55.0 #9

aoprea1982 opened this issue Jul 27, 2020 · 3 comments

Comments

@aoprea1982
Copy link

aoprea1982 commented Jul 27, 2020

Got the following when running the script in ghidra 9.1.2

JNIAnalyzer.java:24: error: cannot access JNIUtils
import me.ayrx.jnianalyzer.JNIUtils;
                          ^
  bad class file: ghidra_9.1.2_PUBLIC_20200212\ghidra_9.1.2_PUBLIC\Ghidra\Extensions\JNIAnalyzer\lib\JNIAnalyzer.jar(/me/ayrx/jnianalyzer/JNIUtils.class)
    class file has wrong version 58.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
JNIAnalyzer.java:25: error: cannot access MethodInformation
import me.ayrx.jnianalyzer.MethodInformation;

Attaching the built extension.

ghidra_9.1.2_PUBLIC_20200727_JNIAnalyzer.zip

@aoprea1982
Copy link
Author

aoprea1982 commented Jul 27, 2020

wholeOutput

JNIAnalyzer.java:24: error: cannot access JNIUtils
import me.ayrx.jnianalyzer.JNIUtils;
                          ^
  bad class file: \ghidra_9.1.2_PUBLIC_20200212\ghidra_9.1.2_PUBLIC\Ghidra\Extensions\JNIAnalyzer\lib\JNIAnalyzer.jar(/me/ayrx/jnianalyzer/JNIUtils.class)
    class file has wrong version 58.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
JNIAnalyzer.java:25: error: cannot access MethodInformation
import me.ayrx.jnianalyzer.MethodInformation;
                          ^
  bad class file: ghidra_9.1.2_PUBLIC_20200212\ghidra_9.1.2_PUBLIC\Ghidra\Extensions\JNIAnalyzer\lib\JNIAnalyzer.jar(/me/ayrx/jnianalyzer/MethodInformation.class)
    class file has wrong version 58.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
JNIAnalyzer.java:26: error: cannot access ParseJNIMethods
import me.ayrx.jnianalyzer.ParseJNIMethods;
                          ^
  bad class file: \ghidra_9.1.2_PUBLIC_20200212\ghidra_9.1.2_PUBLIC\Ghidra\Extensions\JNIAnalyzer\lib\JNIAnalyzer.jar(/me/ayrx/jnianalyzer/ParseJNIMethods.class)
    class file has wrong version 58.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
JNIAnalyzer.java:31: error: cannot find symbol
	JNIUtils jniUtils;
	^
  symbol:   class JNIUtils
  location: class JNIAnalyzer
JNIAnalyzer.java:115: error: cannot find symbol
	private void applyFunctionSignature(String methodName, MethodInformation method, Function f)
	                                                       ^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:168: error: cannot find symbol
	private String generateNativeMethodName(MethodInformation methodInfo, boolean isOverloaded) {
	                                        ^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:35: error: cannot find symbol
		this.jniUtils = new JNIUtils(state, this);
		                    ^
  symbol:   class JNIUtils
  location: class JNIAnalyzer
JNIAnalyzer.java:41: error: cannot find symbol
		ArrayList<MethodInformation> methodsList = ParseJNIMethods.parse(apkFile);
		          ^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:41: error: cannot find symbol
		ArrayList<MethodInformation> methodsList = ParseJNIMethods.parse(apkFile);
		                                           ^
  symbol:   variable ParseJNIMethods
  location: class JNIAnalyzer
JNIAnalyzer.java:79: error: cannot find symbol
		HashMap<String, ArrayList<MethodInformation>> methodMap = new HashMap<String, ArrayList<MethodInformation>>();
		                          ^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:79: error: cannot find symbol
		HashMap<String, ArrayList<MethodInformation>> methodMap = new HashMap<String, ArrayList<MethodInformation>>();
		                                                                                        ^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:81: error: cannot find symbol
		for (MethodInformation method : methodsList) {
		     ^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:85: error: cannot find symbol
				ArrayList<MethodInformation> t = new ArrayList<MethodInformation>();
				          ^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:85: error: cannot find symbol
				ArrayList<MethodInformation> t = new ArrayList<MethodInformation>();
				                                               ^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:93: error: cannot find symbol
			ArrayList<MethodInformation> methodList = methodMap.get(m);
			          ^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:96: error: cannot find symbol
				MethodInformation method = methodList.get(0);
				^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:104: error: cannot find symbol
				for (MethodInformation method : methodList) {
				     ^
  symbol:   class MethodInformation
  location: class JNIAnalyzer
JNIAnalyzer.java:123: error: illegal parenthesized expression
		if (method.isStatic) {
		   ^
18 errors
> Unable to locate script class: Unable to compile class: JNIAnalyzer.java

@Ayrx
Copy link
Owner

Ayrx commented Jul 27, 2020

You might need to compile the extension with the same version of Java that you are using to run Ghidra.

@Ayrx
Copy link
Owner

Ayrx commented Aug 3, 2020

I don't think this is a problem with the code, will close this issue.

Do let me know in this issue if there are still problems after recompiling the extension with the same version of Java used to run Ghidra.

@Ayrx Ayrx closed this as completed Aug 3, 2020
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