mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 09:49:23 +02:00
Merge remote-tracking branch 'origin/GP-5492_ghizard_PdbReader_modify_and_bring_method_records_into_alignment'
This commit is contained in:
commit
c187f26cfc
7 changed files with 40 additions and 25 deletions
|
@ -154,6 +154,14 @@ public abstract class AbstractMemberFunctionMsType extends AbstractMsType {
|
|||
return pdb.getTypeRecord(thisPointerRecordNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the "this" adjuster
|
||||
* @return the adjuster
|
||||
*/
|
||||
public int getThisAdjuster() {
|
||||
return thisAdjuster;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void emit(StringBuilder builder, Bind bind) {
|
||||
if (bind.ordinal() < Bind.PROC.ordinal()) {
|
||||
|
|
|
@ -75,7 +75,7 @@ public abstract class AbstractMethodRecordMs extends AbstractParsableItem {
|
|||
builder.append(attributes);
|
||||
builder.append(": ");
|
||||
builder.append(pdb.getTypeRecord(procedureRecordNumber));
|
||||
if (attributes.getProperty() == ClassFieldMsAttributes.Property.INTRO) {
|
||||
if (optionalOffset != -1) {
|
||||
builder.append(",");
|
||||
builder.append(optionalOffset);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,8 @@ public abstract class AbstractOneMethodMsType extends AbstractMsType implements
|
|||
offsetInVFTableIfIntroVirtual = reader.parseUnsignedIntVal();
|
||||
}
|
||||
else {
|
||||
offsetInVFTableIfIntroVirtual = 0;
|
||||
// 20250310: changed this from 0 to -1 to match "MethodRecord" types
|
||||
offsetInVFTableIfIntroVirtual = -1;
|
||||
}
|
||||
name = reader.parseString(pdb, strType);
|
||||
reader.skipPadding();
|
||||
|
@ -92,8 +93,10 @@ public abstract class AbstractOneMethodMsType extends AbstractMsType implements
|
|||
builder.append(attributes);
|
||||
builder.append(": ");
|
||||
builder.append(pdb.getTypeRecord(procedureTypeRecordNumber));
|
||||
if (offsetInVFTableIfIntroVirtual != -1) {
|
||||
builder.append(",");
|
||||
builder.append(offsetInVFTableIfIntroVirtual);
|
||||
}
|
||||
builder.append(">");
|
||||
}
|
||||
|
||||
|
|
|
@ -63,15 +63,16 @@ public abstract class AbstractVirtualBaseClassMsType extends AbstractMsType impl
|
|||
|
||||
/**
|
||||
* Returns the offset of the base base pointer within the class.
|
||||
* @return the offset;
|
||||
* @return the offset
|
||||
*/
|
||||
public BigInteger getBasePointerOffset() {
|
||||
return virtualBasePointerOffsetFromAddressPoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the virtual base offset from VB table.
|
||||
* @return the offset;
|
||||
* Returns the virtual base offset from VB table. This seems more like an "index" into
|
||||
* an integer array having values such as 1, 2, 3
|
||||
* @return the offset
|
||||
*/
|
||||
public BigInteger getBaseOffsetFromVbt() {
|
||||
return virtualBaseOffsetFromVBTable;
|
||||
|
|
|
@ -35,7 +35,10 @@ public class MethodRecord16Ms extends AbstractMethodRecordMs {
|
|||
super(pdb, reader);
|
||||
attributes = new ClassFieldMsAttributes(reader);
|
||||
procedureRecordNumber = RecordNumber.parse(pdb, reader, RecordCategory.TYPE, 16);
|
||||
if (attributes.getProperty() == ClassFieldMsAttributes.Property.INTRO) {
|
||||
// See comment in MethodRecordMs... we are adding INTRO_PURE as it might also occur, and
|
||||
// there should be no harm on doing this
|
||||
if (attributes.getProperty() == ClassFieldMsAttributes.Property.INTRO ||
|
||||
attributes.getProperty() == ClassFieldMsAttributes.Property.INTRO_PURE) {
|
||||
optionalOffset = reader.parseUnsignedIntVal();
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -39,8 +39,8 @@ public class MethodRecordMs extends AbstractMethodRecordMs {
|
|||
// API says optional offset "if intro virtual" but we have seen it for 6=<intro.pure>, so
|
||||
// it could be that we need to also include 2=virtual here; i.e., each 2, 4, and 6
|
||||
// (virtual, <intro>, and <intro,pure>) could have this optional field.
|
||||
if ((attributes.getProperty() == ClassFieldMsAttributes.Property.INTRO) ||
|
||||
(attributes.getProperty() == ClassFieldMsAttributes.Property.INTRO_PURE)) {
|
||||
if (attributes.getProperty() == ClassFieldMsAttributes.Property.INTRO ||
|
||||
attributes.getProperty() == ClassFieldMsAttributes.Property.INTRO_PURE) {
|
||||
optionalOffset = reader.parseUnsignedIntVal();
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -2180,7 +2180,7 @@ public class TypesTest extends AbstractGenericTest {
|
|||
AbstractMsType type = TypeParser.parse(pdb, reader);
|
||||
assertEquals(type instanceof OneMethod16MsType, true);
|
||||
String result = type.toString().trim();
|
||||
assertEquals("<public static<pseudo, noinherit, noconstruct>: DummyMsType,0>", result);
|
||||
assertEquals("<public static<pseudo, noinherit, noconstruct>: DummyMsType>", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -2204,7 +2204,7 @@ public class TypesTest extends AbstractGenericTest {
|
|||
AbstractMsType type = TypeParser.parse(pdb, reader);
|
||||
assertEquals(type instanceof OneMethodStMsType, true);
|
||||
String result = type.toString().trim();
|
||||
assertEquals("<public static<pseudo, noinherit, noconstruct>: DummyMsType,0>", result);
|
||||
assertEquals("<public static<pseudo, noinherit, noconstruct>: DummyMsType>", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -2228,7 +2228,7 @@ public class TypesTest extends AbstractGenericTest {
|
|||
AbstractMsType type = TypeParser.parse(pdb, reader);
|
||||
assertEquals(type instanceof OneMethodMsType, true);
|
||||
String result = type.toString().trim();
|
||||
assertEquals("<public static<pseudo, noinherit, noconstruct>: DummyMsType,0>", result);
|
||||
assertEquals("<public static<pseudo, noinherit, noconstruct>: DummyMsType>", result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue