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

"Windows x86 PE RTTI Analyzer" OOB #2153

Closed
Arcnor opened this issue Jul 31, 2020 · 4 comments
Closed

"Windows x86 PE RTTI Analyzer" OOB #2153

Arcnor opened this issue Jul 31, 2020 · 4 comments
Assignees
Labels
Feature: Analysis Type: Bug Something isn't working
Milestone

Comments

@Arcnor
Copy link

Arcnor commented Jul 31, 2020

Describe the bug
While running the "Windows x86 PE RTTI Analyzer" I'm getting an OOB exception on Ghidra 9.2 (today's master, a77dcf7), tried with many different PE files. This works fine on 9.1.2 PUBLIC.

Analysis Task: Windows x86 PE RTTI Analyzer - Index 0 out of bounds for length 0
java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:458)
	at ghidra.app.cmd.data.rtti.CreateRtti4BackgroundCmd.<init>(CreateRtti4BackgroundCmd.java:67)
	at ghidra.app.plugin.prototype.MicrosoftCodeAnalyzerPlugin.RttiAnalyzer.processRtti4sForRtti0(RttiAnalyzer.java:182)
	at ghidra.app.plugin.prototype.MicrosoftCodeAnalyzerPlugin.RttiAnalyzer.processRtti0(RttiAnalyzer.java:166)
	at ghidra.app.plugin.prototype.MicrosoftCodeAnalyzerPlugin.RttiAnalyzer.added(RttiAnalyzer.java:120)
	at ghidra.app.plugin.core.analysis.AnalysisScheduler.runAnalyzer(AnalysisScheduler.java:190)
	at ghidra.app.plugin.core.analysis.AnalysisTask.applyTo(AnalysisTask.java:39)
	at ghidra.app.plugin.core.analysis.AutoAnalysisManager$AnalysisTaskWrapper.run(AutoAnalysisManager.java:685)
	at ghidra.app.plugin.core.analysis.AutoAnalysisManager.startAnalysis(AutoAnalysisManager.java:785)
	at ghidra.app.plugin.core.analysis.AutoAnalysisManager.startAnalysis(AutoAnalysisManager.java:664)
	at ghidra.app.plugin.core.analysis.AutoAnalysisManager.startAnalysis(AutoAnalysisManager.java:629)
	at ghidra.app.plugin.core.analysis.AnalysisBackgroundCommand.applyTo(AnalysisBackgroundCommand.java:58)
	at ghidra.framework.plugintool.mgr.BackgroundCommandTask.run(BackgroundCommandTask.java:101)
	at ghidra.framework.plugintool.mgr.ToolTaskManager.run(ToolTaskManager.java:315)
	at java.base/java.lang.Thread.run(Thread.java:834)

---------------------------------------------------
Build Date: 2020-Jul-31 1051 WEST
Ghidra Version: 9.2
Java Home: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
JVM Version: AdoptOpenJDK 11.0.7
OS: Mac OS X 10.14.6 x86_64
@emteere
Copy link
Contributor

emteere commented Aug 5, 2020

Is this on a from scratch import, or a file you had previously imported in 9.1.2?

@Arcnor
Copy link
Author

Arcnor commented Aug 5, 2020

The DB existed, but there was no analysis on it. I also tried on a file already analyzed, but same result.

@emteere
Copy link
Contributor

emteere commented Aug 5, 2020

I've fixed the issue in a branch, it may take a day or so to make it to the github repository.
Is there a binary perhaps in windows that exhibited this problem?

In the meantime, you can replace the following lines in the RttiAnalyzer:181

		// create all found RTTI4 tables at once
		if (rtti4Addresses.size() > 0) {
			CreateRtti4BackgroundCmd cmd = new CreateRtti4BackgroundCmd(rtti4Addresses, dataBlocks,
				validationOptions, applyOptions);
			cmd.applyTo(program, monitor);
	}

@emteere emteere self-assigned this Aug 5, 2020
@ghizard
Copy link
Contributor

ghizard commented Oct 7, 2020

Should be addressed by c6d3a7d
If not, please reopen.

@ghizard ghizard closed this as completed Oct 7, 2020
@ryanmkurtz ryanmkurtz added this to the 9.2 milestone Feb 1, 2021
@ryanmkurtz ryanmkurtz added Feature: Analysis Type: Bug Something isn't working labels Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Analysis Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants