|
@@ -2155,6 +2155,7 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
var
|
|
var
|
|
|
|
+ SectionIndex: Integer = -1;
|
|
SectionId: Byte;
|
|
SectionId: Byte;
|
|
SectionSize: uint32;
|
|
SectionSize: uint32;
|
|
SectionStart: LongInt;
|
|
SectionStart: LongInt;
|
|
@@ -2172,6 +2173,9 @@ implementation
|
|
SegmentInfoSectionRead: Boolean = false;
|
|
SegmentInfoSectionRead: Boolean = false;
|
|
SymbolTableSectionRead: Boolean = false;
|
|
SymbolTableSectionRead: Boolean = false;
|
|
|
|
|
|
|
|
+ CodeSectionIndex: Integer = -1;
|
|
|
|
+ DataSectionIndex: Integer = -1;
|
|
|
|
+
|
|
FuncTypes: array of record
|
|
FuncTypes: array of record
|
|
IsImport: Boolean;
|
|
IsImport: Boolean;
|
|
ImportName: ansistring;
|
|
ImportName: ansistring;
|
|
@@ -3279,6 +3283,7 @@ implementation
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
CodeSectionRead:=True;
|
|
CodeSectionRead:=True;
|
|
|
|
+ CodeSectionIndex:=SectionIndex;
|
|
if not ReadUleb32(CodeEntriesCount) then
|
|
if not ReadUleb32(CodeEntriesCount) then
|
|
begin
|
|
begin
|
|
InputError('Error reading the code entries cound from the code section');
|
|
InputError('Error reading the code entries cound from the code section');
|
|
@@ -3352,6 +3357,7 @@ implementation
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
DataSectionRead:=True;
|
|
DataSectionRead:=True;
|
|
|
|
+ DataSectionIndex:=SectionIndex;
|
|
if not ReadUleb32(DataCount) then
|
|
if not ReadUleb32(DataCount) then
|
|
begin
|
|
begin
|
|
InputError('Error reading the data entries count from the data section');
|
|
InputError('Error reading the data entries count from the data section');
|
|
@@ -3471,6 +3477,7 @@ implementation
|
|
|
|
|
|
begin
|
|
begin
|
|
Result:=False;
|
|
Result:=False;
|
|
|
|
+ Inc(SectionIndex);
|
|
if not AReader.read(SectionId,1) then
|
|
if not AReader.read(SectionId,1) then
|
|
begin
|
|
begin
|
|
InputError('Error reading section ID');
|
|
InputError('Error reading section ID');
|