mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
GP-1633 added new DataUtilities.createData method without stackPointers
param
This commit is contained in:
parent
acb07dd535
commit
14b78c1307
29 changed files with 80 additions and 65 deletions
|
@ -155,7 +155,7 @@ public class FixElfExternalOffsetDataRelocationScript extends GhidraScript {
|
||||||
|
|
||||||
if (isDefaultTypeApplied) {
|
if (isDefaultTypeApplied) {
|
||||||
// Replace undefined/default data with offset-pointer
|
// Replace undefined/default data with offset-pointer
|
||||||
DataUtilities.createData(currentProgram, address, offsetPtrDt, -1, false,
|
DataUtilities.createData(currentProgram, address, offsetPtrDt, -1,
|
||||||
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class CreateStringCmd implements Command {
|
||||||
Program program = (Program) obj;
|
Program program = (Program) obj;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DataUtilities.createData(program, addr, stringDataType, length, false, clearMode);
|
DataUtilities.createData(program, addr, stringDataType, length, clearMode);
|
||||||
}
|
}
|
||||||
catch (CodeUnitInsertionException e) {
|
catch (CodeUnitInsertionException e) {
|
||||||
msg = e.getMessage();
|
msg = e.getMessage();
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class PefDebugAnalyzer extends AbstractAnalyzer {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DataType debugDataType = debug.toDataType();
|
DataType debugDataType = debug.toDataType();
|
||||||
DataUtilities.createData(program, address, debugDataType, debugDataType.getLength(), false,
|
DataUtilities.createData(program, address, debugDataType, debugDataType.getLength(),
|
||||||
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
||||||
Address functionAddress = address.subtract(debug.getDistance());
|
Address functionAddress = address.subtract(debug.getDistance());
|
||||||
Function function = listing.getFunctionAt(functionAddress);
|
Function function = listing.getFunctionAt(functionAddress);
|
||||||
|
|
|
@ -271,7 +271,7 @@ public class AddressTable {
|
||||||
// TODO: add in the skip Length
|
// TODO: add in the skip Length
|
||||||
for (int j = 0; j < len; j++) {
|
for (int j = 0; j < len; j++) {
|
||||||
try { // make the data an address pointer
|
try { // make the data an address pointer
|
||||||
DataUtilities.createData(program, newAddress, adt, adt.getLength(), false,
|
DataUtilities.createData(program, newAddress, adt, adt.getLength(),
|
||||||
DataUtilities.ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
|
DataUtilities.ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
|
||||||
}
|
}
|
||||||
catch (CodeUnitInsertionException exc) {
|
catch (CodeUnitInsertionException exc) {
|
||||||
|
|
|
@ -143,7 +143,7 @@ public class MakeStringsTask extends ProgramTask {
|
||||||
Data stringData = null;
|
Data stringData = null;
|
||||||
try {
|
try {
|
||||||
// TODO: Clearing all conflicts might be overly aggressive
|
// TODO: Clearing all conflicts might be overly aggressive
|
||||||
stringData = DataUtilities.createData(program, address, dataTypeToCreate, length, false,
|
stringData = DataUtilities.createData(program, address, dataTypeToCreate, length,
|
||||||
DataUtilities.ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
DataUtilities.ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
||||||
events.add(new StringAddedEvent(dataTypeToCreate, address, stringData.getLength()));
|
events.add(new StringAddedEvent(dataTypeToCreate, address, stringData.getLength()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -447,7 +447,7 @@ public class StringsAnalyzer extends AbstractAnalyzer {
|
||||||
// Using the CreateDataCmd (which doesn't allow you to pass in a length)
|
// Using the CreateDataCmd (which doesn't allow you to pass in a length)
|
||||||
// creates a string at the starting address up to the length of the next
|
// creates a string at the starting address up to the length of the next
|
||||||
// "00".
|
// "00".
|
||||||
DataUtilities.createData(program, start, foundString.getDataType(), length, false,
|
DataUtilities.createData(program, start, foundString.getDataType(), length,
|
||||||
DataUtilities.ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
DataUtilities.ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
||||||
|
|
||||||
Msg.trace(this, "Created string '" + candidate.getOriginalString() + "' at " + start);
|
Msg.trace(this, "Created string '" + candidate.getOriginalString() + "' at " + start);
|
||||||
|
|
|
@ -18,11 +18,10 @@ package ghidra.app.util.bin.format.dwarf4.next;
|
||||||
import static ghidra.app.util.bin.format.dwarf4.encoding.DWARFAttribute.*;
|
import static ghidra.app.util.bin.format.dwarf4.encoding.DWARFAttribute.*;
|
||||||
import static ghidra.app.util.bin.format.dwarf4.encoding.DWARFTag.*;
|
import static ghidra.app.util.bin.format.dwarf4.encoding.DWARFTag.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import ghidra.app.cmd.comments.AppendCommentCmd;
|
import ghidra.app.cmd.comments.AppendCommentCmd;
|
||||||
import ghidra.app.cmd.label.SetLabelPrimaryCmd;
|
import ghidra.app.cmd.label.SetLabelPrimaryCmd;
|
||||||
import ghidra.app.util.bin.format.dwarf4.*;
|
import ghidra.app.util.bin.format.dwarf4.*;
|
||||||
|
@ -977,7 +976,7 @@ public class DWARFFunctionImporter {
|
||||||
"\n");
|
"\n");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Data result = DataUtilities.createData(currentProgram, address, dataType, -1, false,
|
Data result = DataUtilities.createData(currentProgram, address, dataType, -1,
|
||||||
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
||||||
variablesProcesesed.add(address);
|
variablesProcesesed.add(address);
|
||||||
if (eolComment != null) {
|
if (eolComment != null) {
|
||||||
|
|
|
@ -95,7 +95,7 @@ abstract public class ElfRelocationHandler implements ExtensionPoint {
|
||||||
PointerTypedef dt =
|
PointerTypedef dt =
|
||||||
new PointerTypedef(null, null, -1, program.getDataTypeManager(), componentOffset);
|
new PointerTypedef(null, null, -1, program.getDataTypeManager(), componentOffset);
|
||||||
try {
|
try {
|
||||||
DataUtilities.createData(program, addr, dt, -1, false,
|
DataUtilities.createData(program, addr, dt, -1,
|
||||||
ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
|
||||||
}
|
}
|
||||||
catch (CodeUnitInsertionException e) {
|
catch (CodeUnitInsertionException e) {
|
||||||
|
|
|
@ -245,7 +245,7 @@ public class DyldCacheAccelerateInfo implements StructConverter {
|
||||||
Address addr = accelerateInfoAddr.add(imagesExtrasOffset);
|
Address addr = accelerateInfoAddr.add(imagesExtrasOffset);
|
||||||
for (DyldCacheImageInfoExtra imageInfoExtra : imageInfoExtraList) {
|
for (DyldCacheImageInfoExtra imageInfoExtra : imageInfoExtraList) {
|
||||||
Data d = DataUtilities.createData(program, addr, imageInfoExtra.toDataType(), -1,
|
Data d = DataUtilities.createData(program, addr, imageInfoExtra.toDataType(), -1,
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
addr = addr.add(d.getLength());
|
addr = addr.add(d.getLength());
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
@ -265,7 +265,7 @@ public class DyldCacheAccelerateInfo implements StructConverter {
|
||||||
Address addr = accelerateInfoAddr.add(initializersOffset);
|
Address addr = accelerateInfoAddr.add(initializersOffset);
|
||||||
for (DyldCacheAcceleratorInitializer initializer : acceleratorInitializerList) {
|
for (DyldCacheAcceleratorInitializer initializer : acceleratorInitializerList) {
|
||||||
Data d = DataUtilities.createData(program, addr, initializer.toDataType(), -1,
|
Data d = DataUtilities.createData(program, addr, initializer.toDataType(), -1,
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
Address funcAddr = program.getImageBase().add(initializer.getFunctionsOffset());
|
Address funcAddr = program.getImageBase().add(initializer.getFunctionsOffset());
|
||||||
try {
|
try {
|
||||||
program.getFunctionManager().createFunction(null, funcAddr,
|
program.getFunctionManager().createFunction(null, funcAddr,
|
||||||
|
@ -292,7 +292,7 @@ public class DyldCacheAccelerateInfo implements StructConverter {
|
||||||
try {
|
try {
|
||||||
Address addr = accelerateInfoAddr.add(dofSectionsOffset);
|
Address addr = accelerateInfoAddr.add(dofSectionsOffset);
|
||||||
for (DyldCacheAcceleratorDof dof : acceleratorDofList) {
|
for (DyldCacheAcceleratorDof dof : acceleratorDofList) {
|
||||||
Data d = DataUtilities.createData(program, addr, dof.toDataType(), -1, false,
|
Data d = DataUtilities.createData(program, addr, dof.toDataType(), -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
addr = addr.add(d.getLength());
|
addr = addr.add(d.getLength());
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
|
@ -312,7 +312,7 @@ public class DyldCacheAccelerateInfo implements StructConverter {
|
||||||
try {
|
try {
|
||||||
Address addr = accelerateInfoAddr.add(reExportListOffset);
|
Address addr = accelerateInfoAddr.add(reExportListOffset);
|
||||||
DataType dt = new ArrayDataType(WORD, reExportCount, WORD.getLength());
|
DataType dt = new ArrayDataType(WORD, reExportCount, WORD.getLength());
|
||||||
DataUtilities.createData(program, addr, dt, -1, false,
|
DataUtilities.createData(program, addr, dt, -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
program.getListing().setComment(addr, CodeUnit.EOL_COMMENT, "re-exports");
|
program.getListing().setComment(addr, CodeUnit.EOL_COMMENT, "re-exports");
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
@ -330,7 +330,7 @@ public class DyldCacheAccelerateInfo implements StructConverter {
|
||||||
try {
|
try {
|
||||||
Address addr = accelerateInfoAddr.add(depListOffset);
|
Address addr = accelerateInfoAddr.add(depListOffset);
|
||||||
DataType dt = new ArrayDataType(WORD, depListCount, WORD.getLength());
|
DataType dt = new ArrayDataType(WORD, depListCount, WORD.getLength());
|
||||||
DataUtilities.createData(program, addr, dt, -1, false,
|
DataUtilities.createData(program, addr, dt, -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
program.getListing().setComment(addr, CodeUnit.EOL_COMMENT, "dependencies");
|
program.getListing().setComment(addr, CodeUnit.EOL_COMMENT, "dependencies");
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
@ -348,7 +348,7 @@ public class DyldCacheAccelerateInfo implements StructConverter {
|
||||||
try {
|
try {
|
||||||
Address addr = accelerateInfoAddr.add(rangeTableOffset);
|
Address addr = accelerateInfoAddr.add(rangeTableOffset);
|
||||||
for (DyldCacheRangeEntry rangeEntry : rangeEntryList) {
|
for (DyldCacheRangeEntry rangeEntry : rangeEntryList) {
|
||||||
Data d = DataUtilities.createData(program, addr, rangeEntry.toDataType(), -1, false,
|
Data d = DataUtilities.createData(program, addr, rangeEntry.toDataType(), -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
addr = addr.add(d.getLength());
|
addr = addr.add(d.getLength());
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
|
|
|
@ -891,7 +891,7 @@ public class DyldCacheHeader implements StructConverter {
|
||||||
monitor.initialize(1);
|
monitor.initialize(1);
|
||||||
try {
|
try {
|
||||||
DataUtilities.createData(program, space.getAddress(getBaseAddress()), toDataType(), -1,
|
DataUtilities.createData(program, space.getAddress(getBaseAddress()), toDataType(), -1,
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
}
|
}
|
||||||
catch (CodeUnitInsertionException | DuplicateNameException | IOException e) {
|
catch (CodeUnitInsertionException | DuplicateNameException | IOException e) {
|
||||||
|
@ -908,7 +908,7 @@ public class DyldCacheHeader implements StructConverter {
|
||||||
Address addr = fileOffsetToAddr(mappingOffset, program, space);
|
Address addr = fileOffsetToAddr(mappingOffset, program, space);
|
||||||
for (DyldCacheMappingInfo mappingInfo : mappingInfoList) {
|
for (DyldCacheMappingInfo mappingInfo : mappingInfoList) {
|
||||||
Data d = DataUtilities.createData(program, addr, mappingInfo.toDataType(), -1,
|
Data d = DataUtilities.createData(program, addr, mappingInfo.toDataType(), -1,
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
addr = addr.add(d.getLength());
|
addr = addr.add(d.getLength());
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
@ -928,7 +928,7 @@ public class DyldCacheHeader implements StructConverter {
|
||||||
Address addr = fileOffsetToAddr(mappingWithSlideOffset, program, space);
|
Address addr = fileOffsetToAddr(mappingWithSlideOffset, program, space);
|
||||||
for (DyldCacheMappingAndSlideInfo mappingInfo : cacheMappingAndSlideInfoList) {
|
for (DyldCacheMappingAndSlideInfo mappingInfo : cacheMappingAndSlideInfoList) {
|
||||||
Data d = DataUtilities.createData(program, addr, mappingInfo.toDataType(), -1,
|
Data d = DataUtilities.createData(program, addr, mappingInfo.toDataType(), -1,
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
addr = addr.add(d.getLength());
|
addr = addr.add(d.getLength());
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
@ -948,7 +948,7 @@ public class DyldCacheHeader implements StructConverter {
|
||||||
Address addr = fileOffsetToAddr(imagesOffset != 0 ? imagesOffset : imagesOffsetOld,
|
Address addr = fileOffsetToAddr(imagesOffset != 0 ? imagesOffset : imagesOffsetOld,
|
||||||
program, space);
|
program, space);
|
||||||
for (DyldCacheImageInfo imageInfo : imageInfoList) {
|
for (DyldCacheImageInfo imageInfo : imageInfoList) {
|
||||||
Data d = DataUtilities.createData(program, addr, imageInfo.toDataType(), -1, false,
|
Data d = DataUtilities.createData(program, addr, imageInfo.toDataType(), -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
program.getListing().setComment(addr, CodeUnit.EOL_COMMENT, imageInfo.getPath());
|
program.getListing().setComment(addr, CodeUnit.EOL_COMMENT, imageInfo.getPath());
|
||||||
addr = addr.add(d.getLength());
|
addr = addr.add(d.getLength());
|
||||||
|
@ -987,7 +987,7 @@ public class DyldCacheHeader implements StructConverter {
|
||||||
if (slideInfoList.size() > 0) {
|
if (slideInfoList.size() > 0) {
|
||||||
for (DyldCacheSlideInfoCommon info : slideInfoList) {
|
for (DyldCacheSlideInfoCommon info : slideInfoList) {
|
||||||
Address addr = fileOffsetToAddr(info.getSlideInfoOffset(), program, space);
|
Address addr = fileOffsetToAddr(info.getSlideInfoOffset(), program, space);
|
||||||
DataUtilities.createData(program, addr, info.toDataType(), -1, false,
|
DataUtilities.createData(program, addr, info.toDataType(), -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1006,7 +1006,7 @@ public class DyldCacheHeader implements StructConverter {
|
||||||
try {
|
try {
|
||||||
if (localSymbolsInfo != null) {
|
if (localSymbolsInfo != null) {
|
||||||
Address addr = fileOffsetToAddr(localSymbolsOffset, program, space);
|
Address addr = fileOffsetToAddr(localSymbolsOffset, program, space);
|
||||||
DataUtilities.createData(program, addr, localSymbolsInfo.toDataType(), -1, false,
|
DataUtilities.createData(program, addr, localSymbolsInfo.toDataType(), -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
localSymbolsInfo.markup(program, addr, monitor, log);
|
localSymbolsInfo.markup(program, addr, monitor, log);
|
||||||
}
|
}
|
||||||
|
@ -1026,7 +1026,7 @@ public class DyldCacheHeader implements StructConverter {
|
||||||
Address addr = fileOffsetToAddr(branchPoolsOffset, program, space);
|
Address addr = fileOffsetToAddr(branchPoolsOffset, program, space);
|
||||||
for (Long element : branchPoolList) {
|
for (Long element : branchPoolList) {
|
||||||
Data d = DataUtilities.createData(program, addr, Pointer64DataType.dataType,
|
Data d = DataUtilities.createData(program, addr, Pointer64DataType.dataType,
|
||||||
Pointer64DataType.dataType.getLength(), false,
|
Pointer64DataType.dataType.getLength(),
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
addr = addr.add(d.getLength());
|
addr = addr.add(d.getLength());
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
|
@ -1046,7 +1046,7 @@ public class DyldCacheHeader implements StructConverter {
|
||||||
try {
|
try {
|
||||||
if (accelerateInfo != null && headerType < 9) {
|
if (accelerateInfo != null && headerType < 9) {
|
||||||
Address addr = space.getAddress(accelerateInfoAddr);
|
Address addr = space.getAddress(accelerateInfoAddr);
|
||||||
DataUtilities.createData(program, addr, accelerateInfo.toDataType(), -1, false,
|
DataUtilities.createData(program, addr, accelerateInfo.toDataType(), -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
accelerateInfo.markup(program, addr, monitor, log);
|
accelerateInfo.markup(program, addr, monitor, log);
|
||||||
}
|
}
|
||||||
|
@ -1066,7 +1066,7 @@ public class DyldCacheHeader implements StructConverter {
|
||||||
Address addr = fileOffsetToAddr(imagesTextOffset, program, space);
|
Address addr = fileOffsetToAddr(imagesTextOffset, program, space);
|
||||||
for (DyldCacheImageTextInfo imageTextInfo : imageTextInfoList) {
|
for (DyldCacheImageTextInfo imageTextInfo : imageTextInfoList) {
|
||||||
Data d = DataUtilities.createData(program, addr, imageTextInfo.toDataType(), -1,
|
Data d = DataUtilities.createData(program, addr, imageTextInfo.toDataType(), -1,
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
program.getListing()
|
program.getListing()
|
||||||
.setComment(addr, CodeUnit.EOL_COMMENT, imageTextInfo.getPath());
|
.setComment(addr, CodeUnit.EOL_COMMENT, imageTextInfo.getPath());
|
||||||
addr = addr.add(d.getLength());
|
addr = addr.add(d.getLength());
|
||||||
|
@ -1088,7 +1088,7 @@ public class DyldCacheHeader implements StructConverter {
|
||||||
Address addr = fileOffsetToAddr(subCacheArrayOffset, program, space);
|
Address addr = fileOffsetToAddr(subCacheArrayOffset, program, space);
|
||||||
for (DyldSubcacheEntry subcacheEntry : subcacheEntryList) {
|
for (DyldSubcacheEntry subcacheEntry : subcacheEntryList) {
|
||||||
Data d = DataUtilities.createData(program, addr, subcacheEntry.toDataType(), -1,
|
Data d = DataUtilities.createData(program, addr, subcacheEntry.toDataType(), -1,
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
addr = addr.add(d.getLength());
|
addr = addr.add(d.getLength());
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
monitor.incrementProgress(1);
|
monitor.incrementProgress(1);
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class LibObjcOptimization implements StructConverter {
|
||||||
public void markup(Program program, AddressSpace space, MessageLog log, TaskMonitor monitor) {
|
public void markup(Program program, AddressSpace space, MessageLog log, TaskMonitor monitor) {
|
||||||
Address addr = space.getAddress(getAddr());
|
Address addr = space.getAddress(getAddr());
|
||||||
try {
|
try {
|
||||||
DataUtilities.createData(program, addr, toDataType(), -1, false,
|
DataUtilities.createData(program, addr, toDataType(), -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
catch (CodeUnitInsertionException | DuplicateNameException | IOException e) {
|
catch (CodeUnitInsertionException | DuplicateNameException | IOException e) {
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class ObjectiveC1_Module implements StructConverter {
|
||||||
_state.program.getAddressFactory().getDefaultAddressSpace().getAddress(_index);
|
_state.program.getAddressFactory().getDefaultAddressSpace().getAddress(_index);
|
||||||
DataType dt = toDataType();
|
DataType dt = toDataType();
|
||||||
try {
|
try {
|
||||||
DataUtilities.createData(_state.program, address, dt, -1, false,
|
DataUtilities.createData(_state.program, address, dt, -1,
|
||||||
ClearDataMode.CLEAR_ALL_DEFAULT_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_DEFAULT_CONFLICT_DATA);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
|
|
@ -131,7 +131,7 @@ public class ObjectiveC1_SymbolTable implements StructConverter {
|
||||||
_state.program.getAddressFactory().getDefaultAddressSpace().getAddress(_index);
|
_state.program.getAddressFactory().getDefaultAddressSpace().getAddress(_index);
|
||||||
DataType dt = toDataType();
|
DataType dt = toDataType();
|
||||||
try {
|
try {
|
||||||
DataUtilities.createData(_state.program, address, dt, -1, false,
|
DataUtilities.createData(_state.program, address, dt, -1,
|
||||||
ClearDataMode.CLEAR_ALL_DEFAULT_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_DEFAULT_CONFLICT_DATA);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
|
|
@ -147,7 +147,7 @@ public final class ObjectiveC1_Utilities {
|
||||||
|
|
||||||
// need to clear, as pointers could have been created on import
|
// need to clear, as pointers could have been created on import
|
||||||
// from following pointer chains
|
// from following pointer chains
|
||||||
DataUtilities.createData(program, address, dt, -1, false,
|
DataUtilities.createData(program, address, dt, -1,
|
||||||
ClearDataMode.CLEAR_ALL_DEFAULT_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_DEFAULT_CONFLICT_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2309,7 +2309,7 @@ class ElfProgramBuilder extends MemorySectionResolver implements ElfLoadHelper {
|
||||||
try {
|
try {
|
||||||
Data d = listing.getDataAt(address);
|
Data d = listing.getDataAt(address);
|
||||||
if (d == null || !dt.isEquivalent(d.getDataType())) {
|
if (d == null || !dt.isEquivalent(d.getDataType())) {
|
||||||
d = DataUtilities.createData(program, address, dt, -1, false,
|
d = DataUtilities.createData(program, address, dt, -1,
|
||||||
ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
|
||||||
}
|
}
|
||||||
return d;
|
return d;
|
||||||
|
|
|
@ -836,7 +836,7 @@ public class MachoProgramBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
DataUtilities.createData(program, headerAddr, header.toDataType(), -1, false,
|
DataUtilities.createData(program, headerAddr, header.toDataType(), -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
|
|
||||||
for (LoadCommand loadCommand : header.getLoadCommands()) {
|
for (LoadCommand loadCommand : header.getLoadCommands()) {
|
||||||
|
@ -846,7 +846,7 @@ public class MachoProgramBuilder {
|
||||||
Address loadCommandAddr =
|
Address loadCommandAddr =
|
||||||
headerAddr.add(loadCommand.getStartIndex() - header.getStartIndexInProvider());
|
headerAddr.add(loadCommand.getStartIndex() - header.getStartIndexInProvider());
|
||||||
DataType loadCommandDataType = loadCommand.toDataType();
|
DataType loadCommandDataType = loadCommand.toDataType();
|
||||||
DataUtilities.createData(program, loadCommandAddr, loadCommandDataType, -1, false,
|
DataUtilities.createData(program, loadCommandAddr, loadCommandDataType, -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
|
|
||||||
if (loadCommand instanceof SegmentCommand) {
|
if (loadCommand instanceof SegmentCommand) {
|
||||||
|
@ -858,7 +858,7 @@ public class MachoProgramBuilder {
|
||||||
for (Section section : segmentCommand.getSections()) {
|
for (Section section : segmentCommand.getSections()) {
|
||||||
DataType sectionDataType = section.toDataType();
|
DataType sectionDataType = section.toDataType();
|
||||||
Address sectionAddr = loadCommandAddr.add(sectionOffset);
|
Address sectionAddr = loadCommandAddr.add(sectionOffset);
|
||||||
DataUtilities.createData(program, sectionAddr, sectionDataType, -1, false,
|
DataUtilities.createData(program, sectionAddr, sectionDataType, -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
listing.setComment(sectionAddr, CodeUnit.EOL_COMMENT,
|
listing.setComment(sectionAddr, CodeUnit.EOL_COMMENT,
|
||||||
section.getSegmentName() + "." + section.getSectionName());
|
section.getSegmentName() + "." + section.getSectionName());
|
||||||
|
@ -870,7 +870,7 @@ public class MachoProgramBuilder {
|
||||||
LoadCommandString name = dynamicLinkerCommand.getLoadCommandString();
|
LoadCommandString name = dynamicLinkerCommand.getLoadCommandString();
|
||||||
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
||||||
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
else if (loadCommand instanceof DynamicLibraryCommand) {
|
else if (loadCommand instanceof DynamicLibraryCommand) {
|
||||||
DynamicLibraryCommand dynamicLibraryCommand =
|
DynamicLibraryCommand dynamicLibraryCommand =
|
||||||
|
@ -878,52 +878,52 @@ public class MachoProgramBuilder {
|
||||||
LoadCommandString name = dynamicLibraryCommand.getDynamicLibrary().getName();
|
LoadCommandString name = dynamicLibraryCommand.getDynamicLibrary().getName();
|
||||||
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
||||||
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
else if (loadCommand instanceof RunPathCommand) {
|
else if (loadCommand instanceof RunPathCommand) {
|
||||||
RunPathCommand runPathCommand = (RunPathCommand) loadCommand;
|
RunPathCommand runPathCommand = (RunPathCommand) loadCommand;
|
||||||
LoadCommandString path = runPathCommand.getPath();
|
LoadCommandString path = runPathCommand.getPath();
|
||||||
DataUtilities.createData(program, loadCommandAddr.add(path.getOffset()),
|
DataUtilities.createData(program, loadCommandAddr.add(path.getOffset()),
|
||||||
StructConverter.STRING, loadCommand.getCommandSize() - path.getOffset(),
|
StructConverter.STRING, loadCommand.getCommandSize() - path.getOffset(),
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
else if (loadCommand instanceof SubFrameworkCommand) {
|
else if (loadCommand instanceof SubFrameworkCommand) {
|
||||||
SubFrameworkCommand subFrameworkCommand = (SubFrameworkCommand) loadCommand;
|
SubFrameworkCommand subFrameworkCommand = (SubFrameworkCommand) loadCommand;
|
||||||
LoadCommandString name = subFrameworkCommand.getUmbrellaFrameworkName();
|
LoadCommandString name = subFrameworkCommand.getUmbrellaFrameworkName();
|
||||||
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
||||||
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
else if (loadCommand instanceof SubClientCommand) {
|
else if (loadCommand instanceof SubClientCommand) {
|
||||||
SubClientCommand subClientCommand = (SubClientCommand) loadCommand;
|
SubClientCommand subClientCommand = (SubClientCommand) loadCommand;
|
||||||
LoadCommandString name = subClientCommand.getClientName();
|
LoadCommandString name = subClientCommand.getClientName();
|
||||||
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
||||||
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
else if (loadCommand instanceof SubLibraryCommand) {
|
else if (loadCommand instanceof SubLibraryCommand) {
|
||||||
SubLibraryCommand subLibraryCommand = (SubLibraryCommand) loadCommand;
|
SubLibraryCommand subLibraryCommand = (SubLibraryCommand) loadCommand;
|
||||||
LoadCommandString name = subLibraryCommand.getSubLibraryName();
|
LoadCommandString name = subLibraryCommand.getSubLibraryName();
|
||||||
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
||||||
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
else if (loadCommand instanceof SubUmbrellaCommand) {
|
else if (loadCommand instanceof SubUmbrellaCommand) {
|
||||||
SubUmbrellaCommand subUmbrellaCommand = (SubUmbrellaCommand) loadCommand;
|
SubUmbrellaCommand subUmbrellaCommand = (SubUmbrellaCommand) loadCommand;
|
||||||
LoadCommandString name = subUmbrellaCommand.getSubUmbrellaFrameworkName();
|
LoadCommandString name = subUmbrellaCommand.getSubUmbrellaFrameworkName();
|
||||||
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
||||||
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
||||||
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
else if (loadCommand instanceof FileSetEntryCommand) {
|
else if (loadCommand instanceof FileSetEntryCommand) {
|
||||||
FileSetEntryCommand fileSetEntryCommand = (FileSetEntryCommand) loadCommand;
|
FileSetEntryCommand fileSetEntryCommand = (FileSetEntryCommand) loadCommand;
|
||||||
LoadCommandString name = fileSetEntryCommand.getFileSetEntryId();
|
LoadCommandString name = fileSetEntryCommand.getFileSetEntryId();
|
||||||
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
DataUtilities.createData(program, loadCommandAddr.add(name.getOffset()),
|
||||||
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
StructConverter.STRING, loadCommand.getCommandSize() - name.getOffset(),
|
||||||
false, DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
else if (loadCommand instanceof LinkerOptionCommand) {
|
else if (loadCommand instanceof LinkerOptionCommand) {
|
||||||
LinkerOptionCommand linkerOptionCommand = (LinkerOptionCommand) loadCommand;
|
LinkerOptionCommand linkerOptionCommand = (LinkerOptionCommand) loadCommand;
|
||||||
|
@ -936,7 +936,7 @@ public class MachoProgramBuilder {
|
||||||
len = (int) (NumericUtilities.getUnsignedAlignedValue(
|
len = (int) (NumericUtilities.getUnsignedAlignedValue(
|
||||||
addr.add(len).getOffset(), 4) - addr.getOffset());
|
addr.add(len).getOffset(), 4) - addr.getOffset());
|
||||||
}
|
}
|
||||||
DataUtilities.createData(program, addr, StructConverter.STRING, len, false,
|
DataUtilities.createData(program, addr, StructConverter.STRING, len,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
offset += len;
|
offset += len;
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class MzLoader extends AbstractLibrarySupportLoader {
|
||||||
Address addr = headerBlock.getStart();
|
Address addr = headerBlock.getStart();
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
DataUtilities.createData(program, addr, mz.getHeader().toDataType(), -1, false,
|
DataUtilities.createData(program, addr, mz.getHeader().toDataType(), -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
|
|
||||||
// Relocation Table
|
// Relocation Table
|
||||||
|
@ -157,7 +157,7 @@ public class MzLoader extends AbstractLibrarySupportLoader {
|
||||||
addr = addr.add(header.e_lfarlc());
|
addr = addr.add(header.e_lfarlc());
|
||||||
for (int i = 0; i < relocations.size(); i++) {
|
for (int i = 0; i < relocations.size(); i++) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
DataUtilities.createData(program, addr.add(i * len), relocationType, -1, false,
|
DataUtilities.createData(program, addr.add(i * len), relocationType, -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,19 +222,19 @@ public class PeLoader extends AbstractPeDebugLoader {
|
||||||
try {
|
try {
|
||||||
DataType dt = pe.getDOSHeader().toDataType();
|
DataType dt = pe.getDOSHeader().toDataType();
|
||||||
Address start = program.getImageBase();
|
Address start = program.getImageBase();
|
||||||
DataUtilities.createData(program, start, dt, -1, false,
|
DataUtilities.createData(program, start, dt, -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
|
|
||||||
dt = pe.getRichHeader().toDataType();
|
dt = pe.getRichHeader().toDataType();
|
||||||
if (dt != null) {
|
if (dt != null) {
|
||||||
start = program.getImageBase().add(pe.getRichHeader().getOffset());
|
start = program.getImageBase().add(pe.getRichHeader().getOffset());
|
||||||
DataUtilities.createData(program, start, dt, -1, false,
|
DataUtilities.createData(program, start, dt, -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
dt = ntHeader.toDataType();
|
dt = ntHeader.toDataType();
|
||||||
start = program.getImageBase().add(pe.getDOSHeader().e_lfanew());
|
start = program.getImageBase().add(pe.getDOSHeader().e_lfanew());
|
||||||
DataUtilities.createData(program, start, dt, -1, false,
|
DataUtilities.createData(program, start, dt, -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
|
|
||||||
FileHeader fh = ntHeader.getFileHeader();
|
FileHeader fh = ntHeader.getFileHeader();
|
||||||
|
@ -243,7 +243,7 @@ public class PeLoader extends AbstractPeDebugLoader {
|
||||||
start = program.getImageBase().add(index);
|
start = program.getImageBase().add(index);
|
||||||
for (SectionHeader section : sections) {
|
for (SectionHeader section : sections) {
|
||||||
dt = section.toDataType();
|
dt = section.toDataType();
|
||||||
DataUtilities.createData(program, start, dt, -1, false,
|
DataUtilities.createData(program, start, dt, -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
setComment(CodeUnit.EOL_COMMENT, start, section.getName());
|
setComment(CodeUnit.EOL_COMMENT, start, section.getName());
|
||||||
start = start.add(dt.getLength());
|
start = start.add(dt.getLength());
|
||||||
|
|
|
@ -643,7 +643,7 @@ public class ProgramBuilder {
|
||||||
|
|
||||||
public void applyFixedLengthDataType(String addressString, DataType dt, int length) {
|
public void applyFixedLengthDataType(String addressString, DataType dt, int length) {
|
||||||
tx(() -> {
|
tx(() -> {
|
||||||
DataUtilities.createData(program, addr(addressString), dt, length, false,
|
DataUtilities.createData(program, addr(addressString), dt, length,
|
||||||
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -688,7 +688,7 @@ public class ProgramBuilder {
|
||||||
int previousDataLength = 0;
|
int previousDataLength = 0;
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = 0; i < n; i++) {
|
||||||
address = address.addNoWrap(previousDataLength);
|
address = address.addNoWrap(previousDataLength);
|
||||||
Data newStringInstance = DataUtilities.createData(program, address, dt, -1, false,
|
Data newStringInstance = DataUtilities.createData(program, address, dt, -1,
|
||||||
ClearDataMode.CLEAR_SINGLE_DATA);
|
ClearDataMode.CLEAR_SINGLE_DATA);
|
||||||
previousDataLength = newStringInstance.getLength();
|
previousDataLength = newStringInstance.getLength();
|
||||||
}
|
}
|
||||||
|
@ -830,7 +830,7 @@ public class ProgramBuilder {
|
||||||
startTransaction();
|
startTransaction();
|
||||||
try {
|
try {
|
||||||
Data data = DataUtilities.createData(program, addr, dataType, stringBytes.length,
|
Data data = DataUtilities.createData(program, addr, dataType, stringBytes.length,
|
||||||
false, ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
|
||||||
CharsetSettingsDefinition.CHARSET.setCharset(data, charset.name());
|
CharsetSettingsDefinition.CHARSET.setCharset(data, charset.name());
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,7 +304,7 @@ public abstract class PCodeTestAbstractControlBlock {
|
||||||
throws InvalidControlBlockException, CodeUnitInsertionException {
|
throws InvalidControlBlockException, CodeUnitInsertionException {
|
||||||
|
|
||||||
if (applyStruct) {
|
if (applyStruct) {
|
||||||
DataUtilities.createData(program, infoStructAddr, infoProgramStruct, -1, false,
|
DataUtilities.createData(program, infoStructAddr, infoProgramStruct, -1,
|
||||||
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ public abstract class PCodeTestAbstractControlBlock {
|
||||||
|
|
||||||
if (applyStruct) {
|
if (applyStruct) {
|
||||||
DataUtilities.createData(program, functionInfoAddress, functionInfoStruct, -1,
|
DataUtilities.createData(program, functionInfoAddress, functionInfoStruct, -1,
|
||||||
false, ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
||||||
forceCodePointer(functionInfoAddress.add(funcOffset));
|
forceCodePointer(functionInfoAddress.add(funcOffset));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -374,7 +374,7 @@ public abstract class AbstractLocationReferencesTest extends AbstractProgramBase
|
||||||
int tx = program.startTransaction("Test");
|
int tx = program.startTransaction("Test");
|
||||||
try {
|
try {
|
||||||
Data data =
|
Data data =
|
||||||
DataUtilities.createData(program, a, dt, 1, false, ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.createData(program, a, dt, 1, ClearDataMode.CHECK_FOR_SPACE);
|
||||||
assertNotNull("Unable to apply data type at address: " + a, data);
|
assertNotNull("Unable to apply data type at address: " + a, data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class SettingsTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
for (int i = 0; i < 40; i++) {
|
for (int i = 0; i < 40; i++) {
|
||||||
DataUtilities.createData(program, addr(i), StringDataType.dataType, 1, false,
|
DataUtilities.createData(program, addr(i), StringDataType.dataType, 1,
|
||||||
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ public class SettingsTest extends AbstractGhidraHeadedIntegrationTest {
|
||||||
@Test
|
@Test
|
||||||
public void testInstanceSettings() throws Exception {
|
public void testInstanceSettings() throws Exception {
|
||||||
|
|
||||||
Data data = DataUtilities.createData(program, addr(10), ByteDataType.dataType, 1, false,
|
Data data = DataUtilities.createData(program, addr(10), ByteDataType.dataType, 1,
|
||||||
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_CONFLICT_DATA);
|
||||||
|
|
||||||
DataType dt = data.getDataType();
|
DataType dt = data.getDataType();
|
||||||
|
|
|
@ -288,7 +288,7 @@ public class DumpFileLoader extends AbstractProgramWrapperLoader {
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
DataUtilities.createData(program, address, dd.getDataType(), -1, false,
|
DataUtilities.createData(program, address, dd.getDataType(), -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
catch (CodeUnitInsertionException e) {
|
catch (CodeUnitInsertionException e) {
|
||||||
|
|
|
@ -238,7 +238,7 @@ public abstract class AbstractCreateDataBackgroundCmd<T extends AbstractCreateDa
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
|
|
||||||
// Create data at the address using the datatype.
|
// Create data at the address using the datatype.
|
||||||
DataUtilities.createData(program, address, dt, dt.getLength(), false, getClearDataMode());
|
DataUtilities.createData(program, address, dt, dt.getLength(), getClearDataMode());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ public class CreateTypeDescriptorBackgroundCmd
|
||||||
// Create 'name' char[0] data at the address immediately following structure
|
// Create 'name' char[0] data at the address immediately following structure
|
||||||
Program program = model.getProgram();
|
Program program = model.getProgram();
|
||||||
Data nameData = DataUtilities.createData(program, arrayAddr, charArray,
|
Data nameData = DataUtilities.createData(program, arrayAddr, charArray,
|
||||||
charArray.getLength(), false, getClearDataMode());
|
charArray.getLength(), getClearDataMode());
|
||||||
|
|
||||||
nameData.setComment(CodeUnit.EOL_COMMENT, "TypeDescriptor.name");
|
nameData.setComment(CodeUnit.EOL_COMMENT, "TypeDescriptor.name");
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ public class CreateVfTableBackgroundCmd extends AbstractCreateDataBackgroundCmd<
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Data data = DataUtilities.createData(program, terminatorAddress,
|
Data data = DataUtilities.createData(program, terminatorAddress,
|
||||||
PointerDataType.dataType, -1, false, getClearDataMode());
|
PointerDataType.dataType, -1, getClearDataMode());
|
||||||
TypeDescriptorModel rtti0Model = model.getRtti0Model();
|
TypeDescriptorModel rtti0Model = model.getRtti0Model();
|
||||||
if (rtti0Model != null) {
|
if (rtti0Model != null) {
|
||||||
monitor.checkCanceled();
|
monitor.checkCanceled();
|
||||||
|
@ -142,7 +142,7 @@ public class CreateVfTableBackgroundCmd extends AbstractCreateDataBackgroundCmd<
|
||||||
DataType metaPointer = new PointerDataType(program.getDataTypeManager());
|
DataType metaPointer = new PointerDataType(program.getDataTypeManager());
|
||||||
try {
|
try {
|
||||||
DataUtilities.createData(program, metaAddress, metaPointer, metaPointer.getLength(),
|
DataUtilities.createData(program, metaAddress, metaPointer, metaPointer.getLength(),
|
||||||
false, getClearDataMode());
|
getClearDataMode());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (CodeUnitInsertionException e) {
|
catch (CodeUnitInsertionException e) {
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class PublicSymbolApplier extends MsSymbolApplier {
|
||||||
Program program = applicator.getProgram();
|
Program program = applicator.getProgram();
|
||||||
if (GuidUtil.isGuidLabel(program, symbolAddress, name)) {
|
if (GuidUtil.isGuidLabel(program, symbolAddress, name)) {
|
||||||
try {
|
try {
|
||||||
DataUtilities.createData(program, symbolAddress, new GuidDataType(), -1, false,
|
DataUtilities.createData(program, symbolAddress, new GuidDataType(), -1,
|
||||||
ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
|
ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
|
||||||
}
|
}
|
||||||
catch (CodeUnitInsertionException e) {
|
catch (CodeUnitInsertionException e) {
|
||||||
|
|
|
@ -128,6 +128,22 @@ public final class DataUtilities {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create data where existing data may already exist. Pointer datatype stacking will not
|
||||||
|
* be performed.
|
||||||
|
* @param program the program
|
||||||
|
* @param addr data address (offcut data address only allowed if clearMode == ClearDataMode.CLEAR_ALL_CONFLICT_DATA)
|
||||||
|
* @param newType new data-type being applied
|
||||||
|
* @param length data length (used only for Dynamic newDataType which has canSpecifyLength()==true)
|
||||||
|
* @param clearMode see CreateDataMode
|
||||||
|
* @return new data created
|
||||||
|
* @throws CodeUnitInsertionException if data creation failed
|
||||||
|
*/
|
||||||
|
public static Data createData(Program program, Address addr, DataType newType, int length,
|
||||||
|
ClearDataMode clearMode) throws CodeUnitInsertionException {
|
||||||
|
return createData(program, addr, newType, length, false, clearMode);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create data where existing data may already exist.
|
* Create data where existing data may already exist.
|
||||||
* @param program the program
|
* @param program the program
|
||||||
|
|
|
@ -672,7 +672,7 @@ public class HighFunctionDBUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return DataUtilities.createData(program, addr, dt, -1, false,
|
return DataUtilities.createData(program, addr, dt, -1,
|
||||||
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
|
||||||
}
|
}
|
||||||
catch (CodeUnitInsertionException e) {
|
catch (CodeUnitInsertionException e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue