Skip to content

Ghidra is a software reverse engineering (SRE) framework

Static, not just final, the constants

jmlagorefdc2da7f181
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliBlobCustomAttrib.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliBlobCustomAttrib.java
index 66230ab4cb..b43fe89b9f 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliBlobCustomAttrib.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/blobs/CliBlobCustomAttrib.java
@@ -41,20 +41,20 @@ public class CliBlobCustomAttrib extends CliBlob {
private short numNamed;
// Fixed constants for validating the structure
- private final short CLIBLOBCUSTOMATTRIB_PROLOG = 0x0001;
- private final byte CLIBLOBCUSTOMATTRIB_TYPE_FIELD = 0x53;
- private final byte CLIBLOBCUSTOMATTRIB_TYPE_PROPERTY = 0x54;
+ private static final short CLIBLOBCUSTOMATTRIB_PROLOG = 0x0001;
+ private static final byte CLIBLOBCUSTOMATTRIB_TYPE_FIELD = 0x53;
+ private static final byte CLIBLOBCUSTOMATTRIB_TYPE_PROPERTY = 0x54;
// SerString processing constants to validate and convert the
// length of the string
- private final int CLIBLOBCUSTOMATTRIB_STRING_BOUNDARY_64 = 0x40;
- private final int CLIBLOBCUSTOMATTRIB_STRING_BOUNDARY_128 = 0x80;
- private final int CLIBLOBCUSTOMATTRIB_STRING_BOUNDARY_192 = 0xC0;
+ private static final int CLIBLOBCUSTOMATTRIB_STRING_BOUNDARY_64 = 0x40;
+ private static final int CLIBLOBCUSTOMATTRIB_STRING_BOUNDARY_128 = 0x80;
+ private static final int CLIBLOBCUSTOMATTRIB_STRING_BOUNDARY_192 = 0xC0;
// UTF-8 boundaries that help detect the end of a string where
// lengths aren't specified in FixedArg
- private final int CLIBLOBCUSTOMATTRIB_UTF8_LOW = 0x1F;
- private final int CLIBLOBCUSTOMATTRIB_UTF8_HIGH = 0x7F;
+ private static final int CLIBLOBCUSTOMATTRIB_UTF8_LOW = 0x1F;
+ private static final int CLIBLOBCUSTOMATTRIB_UTF8_HIGH = 0x7F;
private class CliFixedArg {
private CliElementType elem;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/tables/CliTableCustomAttribute.java b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/tables/CliTableCustomAttribute.java
index 37387bdcce..34a5205564 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/tables/CliTableCustomAttribute.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/pe/cli/tables/CliTableCustomAttribute.java
@@ -44,8 +44,8 @@ public class CliTableCustomAttribute extends CliAbstractTable {
public int typeIndex;
public int valueIndex;
- private final byte CLITABLECUSTOMATTRIBUTE_TYPE_METHODDEF = 0x02;
- private final byte CLITABLECUSTOMATTRIBUTE_TYPE_METHODREF = 0x03;
+ private static final byte CLITABLECUSTOMATTRIBUTE_TYPE_METHODDEF = 0x02;
+ private static final byte CLITABLECUSTOMATTRIBUTE_TYPE_METHODREF = 0x03;
public CliCustomAttributeRow(int parentIndex, int typeIndex, int valueIndex) {
super();