| 98 | bool PE::addVmSection() { return addSection(".binshld", 0xE0000000, vmSection.getBytes()); } |
| 99 | |
| 100 | DWORD PE::rvaToFileOffset(DWORD rva) |
| 101 | { |
| 102 | // find section rva lies within and calculate file offset |
| 103 | for (int i = 0; i < pNtHeader->FileHeader.NumberOfSections; i++) |
| 104 | { |
| 105 | if (rva >= pSectionHeader[i].VirtualAddress && |
| 106 | rva < pSectionHeader[i].VirtualAddress + (pSectionHeader[i].Misc.VirtualSize)) |
| 107 | { |
| 108 | return (rva - pSectionHeader[i].VirtualAddress) + pSectionHeader[i].PointerToRawData; |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | return 0x0; // this should never happen, throw exception here |
| 113 | } |
| 114 | |
| 115 | DWORD PE::fileOffsetToRva(DWORD offset) |
| 116 | { |
nothing calls this directly
no outgoing calls
no test coverage detected