I think you can't get base and offset pointers from c++.
instead, use inline assembly to get them.
$ sign is the offset from executable entry. I don't know how to get base pointer, cuz bp may change over program.
IMPORTANT NOTE: c/c++ compilers don't create flat binary file, so base and offset pointers may be wrong and was not what you expect.