Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/patch'
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmkurtz committed Jun 1, 2023
2 parents 6ae289d + adf7b18 commit 0d71657
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 51 deletions.
1 change: 1 addition & 0 deletions Ghidra/Debug/Debugger-agent-gdb/certification.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
##MODULE IP: JSch License
Module.manifest||GHIDRA||||END|
data/scripts/fallback_info_proc_mappings.gdb||GHIDRA||||END|
data/scripts/fallback_maintenance_info_sections.gdb||GHIDRA||||END|
data/scripts/getpid-linux-i386.gdb||GHIDRA||||END|
data/scripts/wine32_info_proc_mappings.gdb||GHIDRA||||END|
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
define maintenance info sections
echo Exec file: `name_of_executable', file type elf64-x86-64. \n
echo [0] 0x0->0xFFFFFFFFFFFFFFFF at 0x00000000: .text ALLOC LOAD READWRITE CODE HAS_CONTENTS
end
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class MemoryRange implements StructConverter {
public final static String NAME = "MINIDUMP_MEMORY_RANGE";

private long startOfMemoryRange;
private int dataSize;
private long dataSize;
private int RVA;

private DumpFileReader reader;
Expand All @@ -44,14 +44,15 @@ private void parse() throws IOException {
reader.setPointerIndex(index);

setStartOfMemoryRange(reader.readNextLong());
setDataSize(reader.readNextInt());
setDataSize(reader.readNextUnsignedInt());
setRVA(reader.readNextInt());

}

/**
* @see ghidra.app.util.bin.StructConverter#toDataType()
*/
@Override
public DataType toDataType() throws DuplicateNameException {
StructureDataType struct = new StructureDataType(NAME, 0);

Expand All @@ -72,11 +73,11 @@ public void setStartOfMemoryRange(long startOfMemoryRange) {
this.startOfMemoryRange = startOfMemoryRange;
}

public int getDataSize() {
public long getDataSize() {
return dataSize;
}

public void setDataSize(int dataSize) {
public void setDataSize(long dataSize) {
this.dataSize = dataSize;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Module implements StructConverter {
public final static String NAME = "MINIDUMP_MODULE";

private long baseOfImage;
private int sizeOfImage;
private long sizeOfImage;
private int checkSum;
private int timeDateStamp;
private int moduleNameRVA;
Expand Down Expand Up @@ -70,7 +70,7 @@ private void parse() throws IOException {
reader.setPointerIndex(index);

setBaseOfImage(reader.readNextLong());
setSizeOfImage(reader.readNextInt());
setSizeOfImage(reader.readNextUnsignedInt());
setCheckSum(reader.readNextInt());
setTimeDateStamp(reader.readNextInt());
setModuleNameRVA(reader.readNextInt());
Expand Down Expand Up @@ -113,6 +113,7 @@ private void getRVAs() throws IOException {
/**
* @see ghidra.app.util.bin.StructConverter#toDataType()
*/
@Override
public DataType toDataType() throws DuplicateNameException {
StructureDataType struct = new StructureDataType(NAME, 0);

Expand Down Expand Up @@ -164,11 +165,11 @@ public void setBaseOfImage(long baseOfImage) {
this.baseOfImage = baseOfImage;
}

public int getSizeOfImage() {
public long getSizeOfImage() {
return sizeOfImage;
}

public void setSizeOfImage(int sizeOfImage) {
public void setSizeOfImage(long sizeOfImage) {
this.sizeOfImage = sizeOfImage;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Thread implements StructConverter {
private int priority;
private long teb;
private long stackStartOfMemoryRange;
private int stackDataSize;
private long stackDataSize;
private int stackRVA;
private int contextDataSize;
private int contextRVA;
Expand All @@ -57,7 +57,7 @@ private void parse() throws IOException {
setPriority(reader.readNextInt());
setTeb(reader.readNextLong());
setStackStartOfMemoryRange(reader.readNextLong());
setStackDataSize(reader.readNextInt());
setStackDataSize(reader.readNextUnsignedInt());
setStackRVA(reader.readNextInt());
setContextDataSize(reader.readNextInt());
setContextRVA(reader.readNextInt());
Expand All @@ -67,6 +67,7 @@ private void parse() throws IOException {
/**
* @see ghidra.app.util.bin.StructConverter#toDataType()
*/
@Override
public DataType toDataType() throws DuplicateNameException {
StructureDataType struct = new StructureDataType(NAME, 0);

Expand Down Expand Up @@ -149,11 +150,11 @@ public void setStackStartOfMemoryRange(long stackStartOfMemoryRange) {
this.stackStartOfMemoryRange = stackStartOfMemoryRange;
}

public int getStackDataSize() {
public long getStackDataSize() {
return stackDataSize;
}

public void setStackDataSize(int stackDataSize) {
public void setStackDataSize(long stackDataSize) {
this.stackDataSize = stackDataSize;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ThreadEx implements StructConverter {
private int priority;
private long teb;
private long stackStartOfMemoryRange;
private int stackDataSize;
private long stackDataSize;
private int stackRVA;
private int contextDataSize;
private int contextRVA;
Expand All @@ -60,7 +60,7 @@ private void parse() throws IOException {
setPriority(reader.readNextInt());
setTeb(reader.readNextLong());
setStackStartOfMemoryRange(reader.readNextLong());
setStackDataSize(reader.readNextInt());
setStackDataSize(reader.readNextUnsignedInt());
setStackRVA(reader.readNextInt());
setContextDataSize(reader.readNextInt());
setContextRVA(reader.readNextInt());
Expand All @@ -73,6 +73,7 @@ private void parse() throws IOException {
/**
* @see ghidra.app.util.bin.StructConverter#toDataType()
*/
@Override
public DataType toDataType() throws DuplicateNameException {
StructureDataType struct = new StructureDataType(NAME, 0);

Expand Down Expand Up @@ -161,11 +162,11 @@ public void setStackStartOfMemoryRange(long stackStartOfMemoryRange) {
this.stackStartOfMemoryRange = stackStartOfMemoryRange;
}

public int getStackDataSize() {
public long getStackDataSize() {
return stackDataSize;
}

public void setStackDataSize(int stackDataSize) {
public void setStackDataSize(long stackDataSize) {
this.stackDataSize = stackDataSize;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class UnloadedModule implements StructConverter {
public final static String NAME = "MINIDUMP_UNLOADED_MODULE";

private long baseOfImage;
private int sizeOfImage;
private long sizeOfImage;
private int checkSum;
private int timeDateStamp;
private int moduleNameRVA;
Expand All @@ -46,7 +46,7 @@ private void parse() throws IOException {
reader.setPointerIndex(index);

setBaseOfImage(reader.readNextLong());
setSizeOfImage(reader.readNextInt());
setSizeOfImage(reader.readNextUnsignedInt());
setCheckSum(reader.readNextInt());
setTimeDateStamp(reader.readNextInt());
setModuleNameRVA(reader.readNextInt());
Expand All @@ -56,6 +56,7 @@ private void parse() throws IOException {
/**
* @see ghidra.app.util.bin.StructConverter#toDataType()
*/
@Override
public DataType toDataType() throws DuplicateNameException {
StructureDataType struct = new StructureDataType(NAME, 0);

Expand All @@ -78,11 +79,11 @@ public void setBaseOfImage(long baseOfImage) {
this.baseOfImage = baseOfImage;
}

public int getSizeOfImage() {
public long getSizeOfImage() {
return sizeOfImage;
}

public void setSizeOfImage(int sizeOfImage) {
public void setSizeOfImage(long sizeOfImage) {
this.sizeOfImage = sizeOfImage;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class KldrDataTableEntry implements StructConverter {
private long NonPagedDebugInfo;
private long DllBase;
private long EntryPoint;
private int SizeOfImage;
private long SizeOfImage;
private long FullDllName;
private long BaseDllName;
private int Flags;
Expand Down Expand Up @@ -69,7 +69,7 @@ private void parse() throws IOException {
setNonPagedDebugInfo(reader.readNextPointer());
setDllBase(reader.readNextPointer());
setEntryPoint(reader.readNextPointer());
setSizeOfImage(reader.readNextInt());
setSizeOfImage(reader.readNextUnsignedInt());
reader.readNextInt();
reader.readNextPointer();
setFullDllName(reader.readNextPointer());
Expand All @@ -89,6 +89,7 @@ private void parse() throws IOException {
/**
* @see ghidra.app.util.bin.StructConverter#toDataType()
*/
@Override
public DataType toDataType() throws DuplicateNameException {
StructureDataType struct = new StructureDataType(NAME, 0);

Expand Down Expand Up @@ -152,11 +153,11 @@ public void setEntryPoint(long entryPoint) {
EntryPoint = entryPoint;
}

public int getSizeOfImage() {
public long getSizeOfImage() {
return SizeOfImage;
}

public void setSizeOfImage(int sizeOfImage) {
public void setSizeOfImage(long sizeOfImage) {
SizeOfImage = sizeOfImage;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public Pagedump(DumpFileReader reader, ProgramBasedDataTypeManager dtm, List<Opt
is32Bit = header.is32Bit();
isPAE = header.getPaeEnabled() != 0;

int hdrLen = header.toDataType().getLength();
long hdrLen = header.toDataType().getLength();
addInteriorAddressObject("DumpHeader", 0, 0L, hdrLen);
data.add(new DumpData(0, header.toDataType()));

Expand All @@ -143,7 +143,7 @@ public Pagedump(DumpFileReader reader, ProgramBasedDataTypeManager dtm, List<Opt
case DUMP_TYPE_BITMAP_FULL:
case DUMP_TYPE_BITMAP_KERNEL:
int signature = reader.readInt(hdrLen);
int offset = hdrLen;
long offset = hdrLen;
switch (signature) {
case SIG_SUMMARY:
case SIG_FULL:
Expand Down Expand Up @@ -175,7 +175,7 @@ public Pagedump(DumpFileReader reader, ProgramBasedDataTypeManager dtm, List<Opt
addInteriorAddressObject("DumpHeader", hdrLen, hdrLen,
triage.getSizeOfDump());

int next = hdrLen + triage.getSizeOfDump();
long next = hdrLen + triage.getSizeOfDump();
addInteriorAddressObject("Unknown", next,
next, reader.length() - next);

Expand Down Expand Up @@ -424,7 +424,7 @@ private void mapPages(TaskMonitor monitor) throws IOException {
continue;
}
Long addr = pfnToVA.get(pfnx);
addInteriorAddressObject(DumpFileLoader.MEMORY, fileOffset(pfnx), addr, 0x1000);
addInteriorAddressObject(DumpFileLoader.MEMORY, fileOffset(pfnx), addr, 0x1000L);
monitor.setProgress(count++);
}
/*
Expand Down Expand Up @@ -462,6 +462,7 @@ public static String getMachineType(DumpFileReader reader) throws IOException {
return Integer.toHexString(header.getMachineImageType());
}

@Override
public void analyze(TaskMonitor monitor) {
boolean analyzeEmbeddedObjects =
OptionUtils.getBooleanOptionValue(ANALYZE_EMBEDDED_OBJECTS_OPTION_NAME,
Expand Down Expand Up @@ -611,9 +612,10 @@ private void walkPages(int page, long va, int depth, boolean lp) throws IOExcept
*/

/**
* Get default <code>Pagedump</code> loader options.
* Includes {@link #DEBUG_DATA_PATH_OPTION_NAME} plus default {@link DumpFile} options
* (see {@link DumpFile#getDefaultOptions(DumpFileReader)}).
* Get default <code>Pagedump</code> loader options. Includes
* {@link #DEBUG_DATA_PATH_OPTION_NAME} plus default {@link DumpFile} options (see
* {@link DumpFile#getDefaultOptions(DumpFileReader)}).
*
* @param reader dump file reader
* @return default collection of Pagedump loader options
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class TriageDataBlock implements StructConverter {

private long address;
private int offset;
private int size;
private long size;

private DumpFileReader reader;
private long index;
Expand All @@ -46,7 +46,7 @@ private void parse() throws IOException {

setAddress(reader.readNextPointer());
setOffset(reader.readNextInt());
setSize(reader.readNextInt());
setSize(reader.readNextUnsignedInt());

}

Expand Down Expand Up @@ -79,11 +79,11 @@ public void setOffset(int offset) {
this.offset = offset;
}

public int getSize() {
public long getSize() {
return size;
}

public void setSize(int size) {
public void setSize(long size) {
this.size = size;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class TriageDump implements StructConverter {
public final static String NAME = "PAGEDUMP_TRIAGE";

private int servicePackBuild;
private int sizeOfDump;
private long sizeOfDump;
private int validOffset;
private int contextOffset;
private int exceptionOffset;
Expand Down Expand Up @@ -75,7 +75,7 @@ private void parse() throws IOException {
reader.setPointerIndex(index);

setServicePackBuild(reader.readNextInt());
setSizeOfDump(reader.readNextInt());
setSizeOfDump(reader.readNextUnsignedInt());
setValidOffset(reader.readNextInt());
setContextOffset(reader.readNextInt());
setExceptionOffset(reader.readNextInt());
Expand Down Expand Up @@ -156,11 +156,11 @@ public void setServicePackBuild(int servicePackBuild) {
this.servicePackBuild = servicePackBuild;
}

public int getSizeOfDump() {
public long getSizeOfDump() {
return sizeOfDump;
}

public void setSizeOfDump(int sizeOfDump) {
public void setSizeOfDump(long sizeOfDump) {
this.sizeOfDump = sizeOfDump;
}

Expand Down
Loading

0 comments on commit 0d71657

Please sign in to comment.