blt4l icon indicating copy to clipboard operation
blt4l copied to clipboard

Wanted: fingerprint exact libcxx version used in PAYDAY 2

Open RomanHargrave opened this issue 8 years ago • 3 comments

It might better our ability to modify PAYDAY at the low level if we knew exactly what version of libcxx the game is compiled with, and possibly even the exact commit.

While we can (somewhat) safely make assumptions about libcxx (e.g. function signatures and memory layout for non-internal functionality, like std::string) it would be even better if we could leverage information-specific details for the purpose of understanding inlined functions in payday and the like.

RomanHargrave avatar Jul 22 '17 05:07 RomanHargrave

Not exactly this, but a closely related issue: build flags.

So far I've determined that _LIBCPP_BIG_ENDIAN is set (strange considering X86 is little-endian, though I may be misunderstanding something) - comparing the LibCXX source code for the __get_short_size method and the matching disassembly in PAYDAY 2, they match up.

Likewise, _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT is not set - checking the long struct source code and __get_long_pointer in PAYDAY 2 shows this.

ZNixian avatar Jul 23 '18 15:07 ZNixian

It's odd that PAYDAY uses libcxx in the first place. It's entirely possible that the version they are using isn't standard, which could explain the _LIBCPP_BIG_ENDIAN business, depending on how you determined it to be set.

RomanHargrave avatar Aug 01 '18 11:08 RomanHargrave

clang and g++ seem to handle templates a bit differently, and since their Lua-to-C++ binding appears to make heavy use of them, maybe g++ didn't work and clang did, and then decided to use LibCXX since they were using clang anyway?

Or maybe the game was ported by a contractor who had standardised on clang/libcxx for some other reason?

ZNixian avatar Aug 02 '18 01:08 ZNixian