MCPcopy Create free account
hub / github.com/d35ha/CallObfuscator / rva_to_offset

Method rva_to_offset

src/load.cpp:347–360  ·  view source on GitHub ↗

Convert RVA to offset.

Source from the content-addressed store, hash-verified

345
346// Convert RVA to offset.
347BOOL 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.
363cobf::cobf(string pe_path) : pe_path(pe_path)

Callers 3

add_shellcode_entryMethod · 0.95
get_data_tableMethod · 0.95
rva_to_ptrMethod · 0.95

Calls 1

section_of_rvaMethod · 0.95

Tested by

no test coverage detected