Skip to content

Commit e046470

Browse files
committed
wip
1 parent b10fe21 commit e046470

File tree

1 file changed

+97
-97
lines changed

1 file changed

+97
-97
lines changed

format/pe/coff.go

Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -77,37 +77,37 @@ const (
7777
MachineTypeWCEMIPSV2 = 0x169
7878
)
7979

80-
var MachineTypeNames = scalar.UintMap{
81-
MachineTypeUNKNOWN: {Sym: "unknown", Description: "The content of this field is assumed to be applicable to any machine type"},
82-
MachineTypeALPHA: {Sym: "alpha", Description: "Alpha AXP, 32-bit address space"},
83-
MachineTypeALPHA64: {Sym: "alpha64", Description: "Alpha 64, 64-bit address space"},
84-
MachineTypeAM33: {Sym: "am33", Description: "Matsushita AM33"},
85-
MachineTypeAMD64: {Sym: "amd64", Description: "x64"},
86-
MachineTypeARM: {Sym: "arm", Description: "ARM little endian"},
87-
MachineTypeARM64: {Sym: "arm64", Description: "ARM64 little endian"},
88-
MachineTypeARMNT: {Sym: "armnt", Description: "ARM Thumb-2 little endian"},
89-
//MachineTypeAXP64: {Sym: "AXP64", Description: "AXP 64 (Same as Alpha 64)"},
90-
MachineTypeEBC: {Sym: "ebc", Description: "EFI byte code"},
91-
MachineTypeI386: {Sym: "i386", Description: "Intel 386 or later processors and compatible processors"},
92-
MachineTypeIA64: {Sym: "ia64", Description: "Intel Itanium processor family"},
93-
MachineTypeLOONGARCH32: {Sym: "loongarch32", Description: "LoongArch 32-bit processor family"},
94-
MachineTypeLOONGARCH64: {Sym: "loongarch64", Description: "LoongArch 64-bit processor family"},
95-
MachineTypeM32R: {Sym: "m32r", Description: "Mitsubishi M32R little endian"},
96-
MachineTypeMIPS16: {Sym: "mips16", Description: "MIPS16"},
97-
MachineTypeMIPSFPU: {Sym: "mipsfpu", Description: "MIPS with FPU"},
98-
MachineTypeMIPSFPU16: {Sym: "mipsfpu16", Description: "MIPS16 with FPU"},
99-
MachineTypePOWERPC: {Sym: "powerpc", Description: "Power PC little endian"},
100-
MachineTypePOWERPCFP: {Sym: "powerpcfp", Description: "Power PC with floating point support"},
101-
MachineTypeR4000: {Sym: "r4000", Description: "MIPS little endian"},
102-
MachineTypeRISCV32: {Sym: "riscv32", Description: "RISC-V 32-bit address space"},
103-
MachineTypeRISCV64: {Sym: "riscv64", Description: "RISC-V 64-bit address space"},
104-
MachineTypeRISCV128: {Sym: "riscv128", Description: "RISC-V 128-bit address space"},
105-
MachineTypeSH3: {Sym: "sh3", Description: "Hitachi SH3"},
106-
MachineTypeSH3DSP: {Sym: "sh3dsp", Description: "Hitachi SH3 DSP"},
107-
MachineTypeSH4: {Sym: "sh4", Description: "Hitachi SH4"},
108-
MachineTypeSH5: {Sym: "sh5", Description: "Hitachi SH5"},
109-
MachineTypeTHUMB: {Sym: "thumb", Description: "Thumb"},
110-
MachineTypeWCEMIPSV2: {Sym: "wcemipsv2", Description: "MIPS little-endian WCE v2"},
80+
var MachineTypeNames = scalar.UintMapSymStr{
81+
MachineTypeUNKNOWN: "unknown",
82+
MachineTypeALPHA: "alpha",
83+
MachineTypeALPHA64: "alpha64",
84+
MachineTypeAM33: "am33",
85+
MachineTypeAMD64: "amd64",
86+
MachineTypeARM: "arm",
87+
MachineTypeARM64: "arm64",
88+
MachineTypeARMNT: "armnt",
89+
//MachineTypeAXP64: "AXP64",
90+
MachineTypeEBC: "ebc",
91+
MachineTypeI386: "i386",
92+
MachineTypeIA64: "ia64",
93+
MachineTypeLOONGARCH32: "loongarch32",
94+
MachineTypeLOONGARCH64: "loongarch64",
95+
MachineTypeM32R: "m32r",
96+
MachineTypeMIPS16: "mips16",
97+
MachineTypeMIPSFPU: "mipsfpu",
98+
MachineTypeMIPSFPU16: "mipsfpu16",
99+
MachineTypePOWERPC: "powerpc",
100+
MachineTypePOWERPCFP: "powerpcfp",
101+
MachineTypeR4000: "r4000",
102+
MachineTypeRISCV32: "riscv32",
103+
MachineTypeRISCV64: "riscv64",
104+
MachineTypeRISCV128: "riscv128",
105+
MachineTypeSH3: "sh3",
106+
MachineTypeSH3DSP: "sh3dsp",
107+
MachineTypeSH4: "sh4",
108+
MachineTypeSH5: "sh5",
109+
MachineTypeTHUMB: "thumb",
110+
MachineTypeWCEMIPSV2: "wcemipsv2",
111111
}
112112

113113
const (
@@ -127,29 +127,29 @@ const (
127127
SubSystemWINDOWS_BOOT_APPLICATION = 16
128128
)
129129

130-
var subSystemNames = scalar.UintMap{
131-
SubSystemUNKNOWN: {Sym: "unknown", Description: "An unknown subsystem"},
132-
SubSystemNATIVE: {Sym: "native", Description: "Device drivers and native Windows processes"},
133-
SubSystemWINDOWS_GUI: {Sym: "windows_gui", Description: "The Windows graphical user interface (GUI) subsystem"},
134-
SubSystemWINDOWS_CUI: {Sym: "windows_cui", Description: "The Windows character subsystem"},
135-
SubSystemOS2_CUI: {Sym: "os2_cui", Description: "The OS/2 character subsystem"},
136-
SubSystemPOSIX_CUI: {Sym: "posix_cui", Description: "The Posix character subsystem"},
137-
SubSystemNATIVE_WINDOWS: {Sym: "native_windows", Description: "Native Win9x driver"},
138-
SubSystemWINDOWS_CE_GUI: {Sym: "windows_ce_gui", Description: "Windows CE"},
139-
SubSystemEFI_APPLICATION: {Sym: "efi_application", Description: "An Extensible Firmware Interface (EFI) application"},
140-
SubSystemEFI_BOOT_SERVICE_DRIVER: {Sym: "efi_boot_service_driver", Description: "An EFI driver with boot services"},
141-
SubSystemEFI_RUNTIME_DRIVER: {Sym: "efi_runtime_driver", Description: "An EFI driver with run-time services"},
142-
SubSystemEFI_ROM: {Sym: "efi_rom", Description: "An EFI ROM image"},
143-
SubSystemXBOX: {Sym: "xbox", Description: "XBOX"},
144-
SubSystemWINDOWS_BOOT_APPLICATION: {Sym: "windows_boot_application", Description: "Windows boot application."},
130+
var subSystemNames = scalar.UintMapSymStr{
131+
SubSystemUNKNOWN: "unknown",
132+
SubSystemNATIVE: "native",
133+
SubSystemWINDOWS_GUI: "windows_gui",
134+
SubSystemWINDOWS_CUI: "windows_cui",
135+
SubSystemOS2_CUI: "os2_cui",
136+
SubSystemPOSIX_CUI: "posix_cui",
137+
SubSystemNATIVE_WINDOWS: "native_windows",
138+
SubSystemWINDOWS_CE_GUI: "windows_ce_gui",
139+
SubSystemEFI_APPLICATION: "efi_application",
140+
SubSystemEFI_BOOT_SERVICE_DRIVER: "efi_boot_service_driver",
141+
SubSystemEFI_RUNTIME_DRIVER: "efi_runtime_driver",
142+
SubSystemEFI_ROM: "efi_rom",
143+
SubSystemXBOX: "xbox",
144+
SubSystemWINDOWS_BOOT_APPLICATION: "windows_boot_application",
145145
}
146146

147147
const (
148148
symClassEndOfFunction = 0xff // A special symbol that represents the end of function, for debugging purposes.
149149
symClassNull = 0 // No assigned storage class.
150150
symClassAutomatic = 1 // The automatic (stack) variable. The Value field specifies the stack frame offset.
151151
symClassExternal = 2 // A value that Microsoft tools use for external symbols. The Value field indicates the size if the section number is IMAGE_SYM_UNDEFINED (0). If the section number is not zero, then the Value field specifies the offset within the section.
152-
symClassStati = 3 // The offset of the symbol within the section. If the Value field is zero, then the symbol represents a section name.
152+
symClassStatic = 3 // The offset of the symbol within the section. If the Value field is zero, then the symbol represents a section name.
153153
symClassRegister = 4 // A register variable. The Value field specifies the register number.
154154
symClassExternalDef = 5 // A symbol that is defined externally.
155155
symClassLabel = 6 // A code label that is defined within the module. The Value field specifies the offset of the symbol within the section.
@@ -174,34 +174,34 @@ const (
174174
symClassClrToken = 107 // A CLR token symbol. The name is an ASCII string that consists of the hexadecimal value of the token. For more information, see CLR Token Definition (Object Only).
175175
)
176176

177-
var symClassNames = scalar.UintMap{
178-
symClassEndOfFunction: {Sym: "end_of_function", Description: "A special symbol that represents the end of function, for debugging purposes."},
179-
symClassNull: {Sym: "null", Description: "No assigned storage class."},
180-
symClassAutomatic: {Sym: "automatic", Description: "The automatic (stack) variable. The Value field specifies the stack frame offset."},
181-
symClassExternal: {Sym: "external", Description: "A value that Microsoft tools use for external symbols. The Value field indicates the size if the section number is IMAGE_SYM_UNDEFINED (0). If the section number is not zero, then the Value field specifies the offset within the section."},
182-
symClassStati: {Sym: "stati", Description: "The offset of the symbol within the section. If the Value field is zero, then the symbol represents a section name."},
183-
symClassRegister: {Sym: "register", Description: "A register variable. The Value field specifies the register number."},
184-
symClassExternalDef: {Sym: "external_def", Description: "A symbol that is defined externally."},
185-
symClassLabel: {Sym: "label", Description: "A code label that is defined within the module. The Value field specifies the offset of the symbol within the section."},
186-
symClassUndefinedLabel: {Sym: "undefined_label", Description: "A reference to a code label that is not defined."},
187-
symClassMemberOfStruct: {Sym: "member_of_struct", Description: "The structure member. The Value field specifies the n th member."},
188-
symClassArgument: {Sym: "argument", Description: "A formal argument (parameter) of a function. The Value field specifies the n th argument."},
189-
symClassStructTag: {Sym: "struct_tag", Description: "The structure tag-name entry."},
190-
symClassMemberOfUnion: {Sym: "member_of_union", Description: "A union member. The Value field specifies the n th member."},
191-
symClassUnionTag: {Sym: "union_tag", Description: "The Union tag-name entry."},
192-
symClassTypeDefinition: {Sym: "type_definition", Description: "A Typedef entry."},
193-
symClassUndefinedStatic: {Sym: "undefined_static", Description: "A static data declaration."},
194-
symClassEnumTag: {Sym: "enum_tag", Description: "An enumerated type tagname entry."},
195-
symClassMemberOfEnum: {Sym: "member_of_enum", Description: "A member of an enumeration. The Value field specifies the n th member."},
196-
symClassRegisterParam: {Sym: "register_param", Description: "A register parameter."},
197-
symClassBitField: {Sym: "bit_field", Description: "A bit-field reference. The Value field specifies the n th bit in the bit field."},
198-
symClassBlock: {Sym: "block", Description: "A .bb (beginning of block) or .eb (end of block) record. The Value field is the relocatable address of the code location."},
199-
symClassFunction: {Sym: "function", Description: "A value that Microsoft tools use for symbol records that define the extent of a function: begin function (.bf ), end function ( .ef ), and lines in function ( .lf ). For .lf records, the Value field gives the number of source lines in the function. For .ef records, the Value field gives the size of the function code."},
200-
symClassEndOfStruct: {Sym: "end_of_struct", Description: "An end-of-structure entry."},
201-
symClassFile: {Sym: "file", Description: "A value that Microsoft tools, as well as traditional COFF format, use for the source-file symbol record. The symbol is followed by auxiliary records that name the file."},
202-
symClassSection: {Sym: "section", Description: "A definition of a section (Microsoft tools use STATIC storage class instead)."},
203-
symClassWeakExternal: {Sym: "weak_external", Description: "A weak external. For more information, see Auxiliary Format 3: Weak Externals."},
204-
symClassClrToken: {Sym: "clr_token", Description: "A CLR token symbol. The name is an ASCII string that consists of the hexadecimal value of the token. For more information, see CLR Token Definition (Object Only)."},
177+
var symClassNames = scalar.UintMapSymStr{
178+
symClassEndOfFunction: "end_of_function",
179+
symClassNull: "null",
180+
symClassAutomatic: "automatic",
181+
symClassExternal: "external",
182+
symClassStatic: "static",
183+
symClassRegister: "register",
184+
symClassExternalDef: "external_def",
185+
symClassLabel: "label",
186+
symClassUndefinedLabel: "undefined_label",
187+
symClassMemberOfStruct: "member_of_struct",
188+
symClassArgument: "argument",
189+
symClassStructTag: "struct_tag",
190+
symClassMemberOfUnion: "member_of_union",
191+
symClassUnionTag: "union_tag",
192+
symClassTypeDefinition: "type_definition",
193+
symClassUndefinedStatic: "undefined_static",
194+
symClassEnumTag: "enum_tag",
195+
symClassMemberOfEnum: "member_of_enum",
196+
symClassRegisterParam: "register_param",
197+
symClassBitField: "bit_field",
198+
symClassBlock: "block",
199+
symClassFunction: "function",
200+
symClassEndOfStruct: "end_of_struct",
201+
symClassFile: "file",
202+
symClassSection: "section",
203+
symClassWeakExternal: "weak_external",
204+
symClassClrToken: "clr_token",
205205
}
206206

207207
const (
@@ -223,23 +223,23 @@ const (
223223
symTypeDword = 15
224224
)
225225

226-
var symBaseTypeNames = scalar.UintMap{
227-
symTypeNull: {Sym: "sym_type_null", Description: "No type information or unknown base type. Microsoft tools use this setting"},
228-
symTypeVoid: {Sym: "sym_type_void", Description: "No valid type; used with void pointers and functions"},
229-
symTypeChar: {Sym: "sym_type_char", Description: "A character (signed byte)"},
230-
symTypeShort: {Sym: "sym_type_short", Description: "A 2-byte signed integer"},
231-
symTypeInt: {Sym: "sym_type_int", Description: "A natural integer type (normally 4 bytes in Windows)"},
232-
symTypeLong: {Sym: "sym_type_long", Description: "A 4-byte signed integer"},
233-
symTypeFloat: {Sym: "sym_type_float", Description: "A 4-byte floating-point number"},
234-
symTypeDouble: {Sym: "sym_type_double", Description: "An 8-byte floating-point number"},
235-
symTypeStruct: {Sym: "sym_type_struct", Description: "A structure"},
236-
symTypeUnion: {Sym: "sym_type_union", Description: "A union"},
237-
symTypeEnum: {Sym: "sym_type_enum", Description: "An enumerated type"},
238-
symTypeMoe: {Sym: "sym_type_moe", Description: "A member of enumeration (a specific value)"},
239-
symTypeByte: {Sym: "sym_type_byte", Description: "A byte; unsigned 1-byte integer"},
240-
symTypeWord: {Sym: "sym_type_word", Description: "A word; unsigned 2-byte integer"},
241-
symTypeUint: {Sym: "sym_type_uint", Description: "An unsigned integer of natural size (normally, 4 bytes)"},
242-
symTypeDword: {Sym: "sym_type_dword", Description: "An unsigned 4-byte integer"},
226+
var symBaseTypeNames = scalar.UintMapSymStr{
227+
symTypeNull: "null",
228+
symTypeVoid: "void",
229+
symTypeChar: "char",
230+
symTypeShort: "short",
231+
symTypeInt: "int",
232+
symTypeLong: "long",
233+
symTypeFloat: "float",
234+
symTypeDouble: "double",
235+
symTypeStruct: "struct",
236+
symTypeUnion: "union",
237+
symTypeEnum: "enum",
238+
symTypeMoe: "moe",
239+
symTypeByte: "byte",
240+
symTypeWord: "word",
241+
symTypeUint: "uint",
242+
symTypeDword: "dword",
243243
}
244244

245245
const (
@@ -249,11 +249,11 @@ const (
249249
symDtypeArray = 3
250250
)
251251

252-
var symBaseDTypeNames = scalar.UintMap{
253-
symDtypeNull: {Sym: "dtype_null", Description: "No derived type; the symbol is a simple scalar variable."},
254-
symDtypePointer: {Sym: "dtype_pointer", Description: "The symbol is a pointer to base type."},
255-
symDtypeFunction: {Sym: "dtype_function", Description: "The symbol is a function that returns a base type."},
256-
symDtypeArray: {Sym: "dtype_array", Description: "The symbol is an array of base type."},
252+
var symBaseDTypeNames = scalar.UintMapSymStr{
253+
symDtypeNull: "null",
254+
symDtypePointer: "pointer",
255+
symDtypeFunction: "function",
256+
symDtypeArray: "array",
257257
}
258258

259259
// type stringTable []string

0 commit comments

Comments
 (0)