M
M
Mors Clamor2020-10-25 06:13:59
Pascal
Mors Clamor, 2020-10-25 06:13:59

Union analogs in PascalABC.NET?

Hello! It is necessary to describe the structure

TIMAGE_SECTION_HEADER

In SI it looks like this
typedef struct _IMAGE_SECTION_HEADER {
  BYTE  Name[IMAGE_SIZEOF_SHORT_NAME];
  union {
    DWORD PhysicalAddress;
    DWORD VirtualSize;
  } Misc;
  DWORD VirtualAddress;
  DWORD SizeOfRawData;
  DWORD PointerToRawData;
  DWORD PointerToRelocations;
  DWORD PointerToLinenumbers;
  WORD  NumberOfRelocations;
  WORD  NumberOfLinenumbers;
  DWORD Characteristics;
} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;


And how to implement it on Pascal.net, so that everything is correctly read into variables? Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
HemulGM, 2020-10-25
@66demon666

IMAGE_SECTION_HEADER = packed record
    Name     : packed array [0..IMAGE_SIZEOF_SHORT_NAME-1] of Char;
    PhysicalAddress : DWORD; // or VirtualSize (union);
    VirtualAddress  : DWORD;
    SizeOfRawData   : DWORD;
    PointerToRawData : DWORD;
    PointerToRelocations : DWORD;
    PointerToLinenumbers : DWORD;
    NumberOfRelocations : WORD;
    NumberOfLinenumbers : WORD;
    Characteristics : DWORD;
  end;
  PIMAGE_SECTION_HEADER = ^IMAGE_SECTION_HEADER;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question