X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Floader%2FObjectFile.h;h=98aff02918aaef733737fd2cc23765fd8f2d0ebc;hb=0e7b9eca67383e45e04aa419cb783c92722f7801;hp=b497e344b500ea45ba9fa4e80cbbbda1946c9629;hpb=7b3710c47f24e64e0d01378a4564730bcb2f6ef2;p=l2e.git diff --git a/src/loader/ObjectFile.h b/src/loader/ObjectFile.h index b497e34..98aff02 100644 --- a/src/loader/ObjectFile.h +++ b/src/loader/ObjectFile.h @@ -27,6 +27,14 @@ struct External { unsigned int inlined; }; +struct Image { + /// File-relative offset to the image's path string. + unsigned int pathOffset; + /// File-relative offset of the target position of the + /// image's reference. + unsigned int destOffset; +}; + struct Object { unsigned int typeId; unsigned int size; @@ -69,6 +77,12 @@ struct ObjectFileHeader { unsigned int externalsBegin; unsigned int externalsEnd; + /// File-relative offsets of the image section's begin and + /// end respectively. + /// Denotes an array of Image structs. + unsigned int imagesBegin; + unsigned int imagesEnd; + /// File-relative offsets of the objet section's begin /// and end respectively. /// Each object begins with its type ID followed by its @@ -100,10 +114,18 @@ struct ObjectFileHeader { Export *ExportsEnd(); External *ExternalsBegin(); External *ExternalsEnd(); + Image *ImagesBegin(); + Image *ImagesEnd(); Object *ObjectsBegin(); Object *ObjectsEnd(); Array *ArraysBegin(); Array *ArraysEnd(); + +private: + bool CheckSection( + unsigned int begin, + unsigned int end, + unsigned int fsize) const; }; struct LoadedExport {