mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-2166: Adding label for _tls_index
This commit is contained in:
@@ -69,9 +69,9 @@ public class TLSDataDirectory extends DataDirectory {
|
|||||||
createDirectoryBookmark(program, addr);
|
createDirectoryBookmark(program, addr);
|
||||||
PeUtils.createData(program, addr, tls.toDataType(), log);
|
PeUtils.createData(program, addr, tls.toDataType(), log);
|
||||||
|
|
||||||
// Markup TLS callback functions
|
// Markup TLS callback functions and index
|
||||||
|
AddressSpace space = program.getImageBase().getAddressSpace();
|
||||||
if (tls.getAddressOfCallBacks() != 0) {
|
if (tls.getAddressOfCallBacks() != 0) {
|
||||||
AddressSpace space = program.getImageBase().getAddressSpace();
|
|
||||||
DataType pointerDataType = PointerDataType.dataType.clone(program.getDataTypeManager());
|
DataType pointerDataType = PointerDataType.dataType.clone(program.getDataTypeManager());
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < 20; i++) { // cap # of TLS callbacks as a precaution (1 is the norm)
|
for (int i = 0; i < 20; i++) { // cap # of TLS callbacks as a precaution (1 is the norm)
|
||||||
@@ -93,6 +93,16 @@ public class TLSDataDirectory extends DataDirectory {
|
|||||||
log.appendMsg("TLS", "Failed to markup TLS callback functions: " + e.getMessage());
|
log.appendMsg("TLS", "Failed to markup TLS callback functions: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (tls.getAddressOfIndex() != 0) {
|
||||||
|
try {
|
||||||
|
Address indexPtrAddr = space.getAddress(tls.getAddressOfIndex());
|
||||||
|
program.getSymbolTable()
|
||||||
|
.createLabel(indexPtrAddr, "_tls_index", SourceType.IMPORTED);
|
||||||
|
}
|
||||||
|
catch (InvalidInputException e) {
|
||||||
|
log.appendMsg("TLS", "Failed to markup TLS index: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user