mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-28 19:18:38 +08:00
Merge remote-tracking branch 'origin/Ghidra_12.1'
This commit is contained in:
@@ -540,7 +540,7 @@
|
|||||||
<P>
|
<P>
|
||||||
<U><B>Use Encoded Anonymous Namespace</B></U> -
|
<U><B>Use Encoded Anonymous Namespace</B></U> -
|
||||||
This output option is used to create a more unique namespace node from the
|
This output option is used to create a more unique namespace node from the
|
||||||
standard output for anonymous namespaces, thus helping to prevent collisions
|
standard anonymous namespaces node output, thus helping to prevent collisions
|
||||||
between multiple types of the same name, but each in their own unique anonymous
|
between multiple types of the same name, but each in their own unique anonymous
|
||||||
namespace. When turned on, variations of the standard namespace
|
namespace. When turned on, variations of the standard namespace
|
||||||
<B>`anonymous namespace'</B> will be replaced with a more specific namespace of
|
<B>`anonymous namespace'</B> will be replaced with a more specific namespace of
|
||||||
@@ -553,7 +553,7 @@
|
|||||||
|
|
||||||
<BLOCKQUOTE>
|
<BLOCKQUOTE>
|
||||||
<P>
|
<P>
|
||||||
<U><B>Apply Argument UDT Tags</B></U> -
|
<U><B>Apply UDT Argument Type Tags</B></U> -
|
||||||
This output option controls whether user-defined type tags (e.g., class, enum,
|
This output option controls whether user-defined type tags (e.g., class, enum,
|
||||||
struct, union) are placed in front of the named type when the type is used as a
|
struct, union) are placed in front of the named type when the type is used as a
|
||||||
template or function argument. When turned on, the demangled string matches the
|
template or function argument. When turned on, the demangled string matches the
|
||||||
|
|||||||
+11
-10
@@ -4,9 +4,9 @@
|
|||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@@ -15,9 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package ghidra.app.cmd.formats;
|
package ghidra.app.cmd.formats;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import ghidra.app.plugin.core.analysis.AnalysisWorker;
|
import ghidra.app.plugin.core.analysis.AnalysisWorker;
|
||||||
import ghidra.app.plugin.core.analysis.AutoAnalysisManager;
|
import ghidra.app.plugin.core.analysis.AutoAnalysisManager;
|
||||||
@@ -27,6 +26,7 @@ import ghidra.app.util.bin.format.pe.*;
|
|||||||
import ghidra.app.util.bin.format.pe.PortableExecutable.SectionLayout;
|
import ghidra.app.util.bin.format.pe.PortableExecutable.SectionLayout;
|
||||||
import ghidra.app.util.bin.format.pe.debug.DebugCOFFSymbol;
|
import ghidra.app.util.bin.format.pe.debug.DebugCOFFSymbol;
|
||||||
import ghidra.app.util.importer.MessageLog;
|
import ghidra.app.util.importer.MessageLog;
|
||||||
|
import ghidra.app.util.opinion.BinaryLoader;
|
||||||
import ghidra.framework.cmd.BinaryAnalysisCommand;
|
import ghidra.framework.cmd.BinaryAnalysisCommand;
|
||||||
import ghidra.program.flatapi.FlatProgramAPI;
|
import ghidra.program.flatapi.FlatProgramAPI;
|
||||||
import ghidra.program.model.address.Address;
|
import ghidra.program.model.address.Address;
|
||||||
@@ -47,6 +47,9 @@ public class PortableExecutableBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canApply(Program program) {
|
public boolean canApply(Program program) {
|
||||||
|
if (!BinaryLoader.BINARY_NAME.equals(program.getExecutableFormat())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
ByteProvider provider =
|
ByteProvider provider =
|
||||||
MemoryByteProvider.createDefaultAddressSpaceByteProvider(program, false);
|
MemoryByteProvider.createDefaultAddressSpaceByteProvider(program, false);
|
||||||
@@ -55,15 +58,13 @@ public class PortableExecutableBinaryAnalysisCommand extends FlatProgramAPI
|
|||||||
DOSHeader dosHeader = new DOSHeader(reader);
|
DOSHeader dosHeader = new DOSHeader(reader);
|
||||||
|
|
||||||
if (dosHeader.isDosSignature()) {
|
if (dosHeader.isDosSignature()) {
|
||||||
|
reader.setPointerIndex(dosHeader.e_lfanew());
|
||||||
reader.setPointerIndex( dosHeader.e_lfanew( ) );
|
short peMagic = reader.readNextShort(); //we should be pointing at the PE magic value!
|
||||||
|
return (peMagic & 0x0000ffff) == Constants.IMAGE_NT_SIGNATURE;
|
||||||
short peMagic = reader.readNextShort();//we should be pointing at the PE magic value!
|
|
||||||
|
|
||||||
return ( peMagic & 0x0000ffff ) == Constants.IMAGE_NT_SIGNATURE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
// safe to assume it's not a PE
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user