Menu

#153 Integer overflow in Proxify

v1.0 (example)
open
nobody
None
5
2020-10-31
2020-08-03
No

I am using gnugettext.pas from revision 132.
I am using C++ Builder XE6.
When compiling for Win64, the call to HookedObjects.Proxify(obj); in TTP_Retranslator.Remember causes an Integer overflow exception.
There is no problem when compiling for Win32.

Discussion

  • Thomas Mueller

    Thomas Mueller - 2020-10-30

    That's probably because you are using different compiler switches for Win32 and Win64.

    Could you please provide the line number where the exception occurs? I don't have C++ Builder available for testing, but knowning the line number might enable me to spot the problem anyway.

     
  • Ivan Johansen

    Ivan Johansen - 2020-10-31

    Unfortunately I am not able to step through pas files when compiling for 64-bit but only when compiling for 32-bit.

    However it looks like the problem occur at this line in THookedObjects.Proxify(obj:TObject):
    size:=NativeUInt(objClassData.ClassName)-NativeUInt(objClassData)+hookedClassNameLength+2;

    I can see that it calculates 0x0000000000E3BC16 - 0x0000000001208360, which result in a negative value and it throws an EIntOverflow exception.

    There is a comment above the code:
    // According to Allen Bauer, we know that the ClassName is stored right after the
    // virtual method pointers.

    This doesn't seem to be the case for 64-bit on C++ Builder XE6. It looks like ClassName is stored at a completely different place.

    NB. Thanks for trying to fix this. I am glad that someone is still working on dxgettext.

     

Log in to post a comment.