Re:NanoLog – a nanosecond scale logging system for C++
by bonzini on Sunday September 01, 2019 @04:18PM
(#20854599)
How do you deal with ASLR (logging from shared libraries or from position-independent executables)?
[ Parent
| on HN ]
Re:NanoLog – a nanosecond scale logging system for C++
by Const-me on Sunday September 01, 2019 @07:42PM
(#20855693)
In that particular case I’ve cheated. I’m writing out of band file which maps pointer addresses into strings. In runtime it’s CAtlMap<const char*, int> really fast because the keys are just addresses. I only have ~200 unique messages (ignoring format arguments) so the file is only written for the first few milliseconds.
I did that because it was the simplest thing to do. I could use debug symbols + crash dumps, they can resolve these pointers regardless of ASLR, just it was way more complex to implement.
BTW, the only reason I was doing that, the main executable is gta5.exe, it’s encrypted, it resists debugging, and I don’t have debug symbols. If it was my own app, I would probably do something much simpler instead.