MCPcopy Create free account
hub / github.com/cinit/TMoe / attachFileMemMapping

Method attachFileMemMapping

app/src/main/cpp/utils/elfsym/ElfView.cpp:14–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12using namespace elfsym;
13
14void ElfView::attachFileMemMapping(const Rva &rva) {
15 mRva = rva;
16 if (mRva.address != nullptr && mRva.length > 64 && *mRva.at<char>(0) == 0x7F
17 && *mRva.at<char>(1) == 'E' && *mRva.at<char>(1) == 'L' && *mRva.at<char>(1) == 'F') {
18 mPointerSize = 0;
19 mArchitecture = 0;
20 } else {
21 char type = *mRva.at<char>(4);
22 if (type == 1) {
23 mPointerSize = 4;
24 mArchitecture = static_cast<const Elf32_Ehdr *>(mRva.address)->e_machine;
25 } else if (type == 2) {
26 mPointerSize = 8;
27 mArchitecture = static_cast<const Elf64_Ehdr *>(mRva.address)->e_machine;
28 } else {
29 mPointerSize = 0;
30 mArchitecture = 0;
31 }
32 }
33}
34
35// SysV hash
36static inline uint32_t elf_sysv_hash(const char *name) {

Callers 1

lookupFileLogLogsEnabledFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected