diff --git a/src/lefile.h b/src/lefile.h index 935ad5bd..82e0954d 100644 --- a/src/lefile.h +++ b/src/lefile.h @@ -98,11 +98,11 @@ protected: LE32 non_resident_name_table_offset; LE32 non_resident_name_table_length; // 0x90 -#if 1 - char _7[52]; -#else - LE32 non_resident_names_checksum; + char _7[4]; //non_resident_names_checksum LE32 automatic_data_object; +#if 1 + char _8[44]; +#else LE32 debug_info_offset; LE32 debug_info_length; // 0xA0 diff --git a/src/p_wcle.cpp b/src/p_wcle.cpp index 746745c7..be6c6ab7 100644 --- a/src/p_wcle.cpp +++ b/src/p_wcle.cpp @@ -192,6 +192,7 @@ void PackWcle::encodeObjectTable() oh.init_eip_offset = neweip; oh.init_ss_object = 2; oh.init_esp_offset = OOT(1,virtual_size); + oh.automatic_data_object = 2; } @@ -433,6 +434,7 @@ void PackWcle::pack(OutputFile *fo) const unsigned calltrickoffset = ft.cto << 24; // attach some useful data at the end of preprocessed fixups + ifixups[sofixups++] = ih.automatic_data_object; unsigned ic = objects*sizeof(*iobject_table); memcpy(ifixups+sofixups,iobject_desc,ic); iobject_desc.free(); @@ -668,6 +670,8 @@ void PackWcle::decodeObjectTable() const unsigned extradata = ph.version == 10 ? 17 : 13; memcpy(oobject_table,oimage + ph.u_len - extradata - ic,ic); + if (ph.version >= 12) + oh.automatic_data_object = oimage[ph.u_len - ic - 14]; for (ic = jc = 0; ic < soobject_table; ic++) { diff --git a/src/p_wcle.h b/src/p_wcle.h index 5e473733..368c649f 100644 --- a/src/p_wcle.h +++ b/src/p_wcle.h @@ -38,7 +38,7 @@ class PackWcle : public Packer, public LeFile typedef Packer super; public: PackWcle(InputFile *f) : super(f), LeFile(f){}; - virtual int getVersion() const { return 11; } + virtual int getVersion() const { return 12; } virtual int getFormat() const { return UPX_F_WC_LE; } virtual const char *getName() const { return "watcom/le"; } virtual int getCompressionMethod() const;