Convert RVA to offset.
| 345 | |
| 346 | // Convert RVA to offset. |
| 347 | BOOL cobf::rva_to_offset(DWORD rva, DWORD& offset) |
| 348 | { |
| 349 | // Get the section. |
| 350 | PIMAGE_SECTION_HEADER sec; |
| 351 | if (this->section_of_rva(rva, sec)) |
| 352 | { |
| 353 | // Convert. |
| 354 | offset = sec->PointerToRawData + (rva - sec->VirtualAddress); |
| 355 | return TRUE; |
| 356 | }; |
| 357 | |
| 358 | // Not Converted. |
| 359 | return FALSE; |
| 360 | }; |
| 361 | |
| 362 | // Constructor for the obfuscation module. |
| 363 | cobf::cobf(string pe_path) : pe_path(pe_path) |
no test coverage detected