mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
Merge remote-tracking branch 'origin/Ghidra_11.4'
This commit is contained in:
commit
8365cf0a19
1 changed files with 18 additions and 13 deletions
|
@ -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.
|
||||||
|
@ -38,6 +38,7 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
||||||
|
|
||||||
public static final String POINTER_NAME = "pointer";
|
public static final String POINTER_NAME = "pointer";
|
||||||
public static final String POINTER_LABEL_PREFIX = "PTR";
|
public static final String POINTER_LABEL_PREFIX = "PTR";
|
||||||
|
public static final String POINTER_LABEL_PREFIX_U = POINTER_LABEL_PREFIX + "_";
|
||||||
public static final String POINTER_LOOP_LABEL_PREFIX = "PTR_LOOP";
|
public static final String POINTER_LOOP_LABEL_PREFIX = "PTR_LOOP";
|
||||||
public static final String NOT_A_POINTER = "NaP";
|
public static final String NOT_A_POINTER = "NaP";
|
||||||
|
|
||||||
|
@ -203,16 +204,6 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
||||||
return POINTER_LABEL_PREFIX;
|
return POINTER_LABEL_PREFIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
PointerReferenceClassification pointerClassification =
|
|
||||||
getPointerClassification(program, ref);
|
|
||||||
if (pointerClassification == PointerReferenceClassification.DEEP) {
|
|
||||||
// pointer exceed depth limit of 2
|
|
||||||
return POINTER_LABEL_PREFIX + "_" + POINTER_LABEL_PREFIX;
|
|
||||||
}
|
|
||||||
if (pointerClassification == PointerReferenceClassification.LOOP) {
|
|
||||||
return POINTER_LOOP_LABEL_PREFIX;// pointer is self referencing
|
|
||||||
}
|
|
||||||
|
|
||||||
Symbol symbol = program.getSymbolTable().getSymbol(ref);
|
Symbol symbol = program.getSymbolTable().getSymbol(ref);
|
||||||
if (symbol == null) {
|
if (symbol == null) {
|
||||||
// unexpected
|
// unexpected
|
||||||
|
@ -222,7 +213,21 @@ public class PointerDataType extends BuiltIn implements Pointer {
|
||||||
String symName = symbol.getName();
|
String symName = symbol.getName();
|
||||||
symName = SymbolUtilities.getCleanSymbolName(symName, ref.getToAddress());
|
symName = SymbolUtilities.getCleanSymbolName(symName, ref.getToAddress());
|
||||||
symName = symName.replace(Namespace.DELIMITER, "_");
|
symName = symName.replace(Namespace.DELIMITER, "_");
|
||||||
return POINTER_LABEL_PREFIX + "_" + symName;
|
|
||||||
|
if (!symName.startsWith(POINTER_LABEL_PREFIX_U)) {
|
||||||
|
return POINTER_LABEL_PREFIX_U + symName;
|
||||||
|
}
|
||||||
|
|
||||||
|
PointerReferenceClassification pointerClassification =
|
||||||
|
getPointerClassification(program, ref);
|
||||||
|
if (pointerClassification == PointerReferenceClassification.DEEP) {
|
||||||
|
// pointer exceed depth limit of 2
|
||||||
|
return POINTER_LABEL_PREFIX_U + POINTER_LABEL_PREFIX;
|
||||||
|
}
|
||||||
|
if (pointerClassification == PointerReferenceClassification.LOOP) {
|
||||||
|
return POINTER_LOOP_LABEL_PREFIX;// pointer is self referencing
|
||||||
|
}
|
||||||
|
return POINTER_LABEL_PREFIX_U + symName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum PointerReferenceClassification {
|
private enum PointerReferenceClassification {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue