|
|
@ -47,11 +47,11 @@ namespace drv
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto& obj : objs)
|
|
|
|
for (auto& obj : objs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto symbol : lnk::sym::get_all(obj))
|
|
|
|
for (auto& symbol : lnk::sym::get_all(obj))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// dont map obfuscated routines into memory as they
|
|
|
|
// dont map obfuscated routines into memory as they
|
|
|
|
// get mapped differently...
|
|
|
|
// get mapped differently...
|
|
|
|
if (symbol.obfuscate_routine)
|
|
|
|
if (symbol.obfuscate_type)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
const auto symbol_mapped =
|
|
|
|
const auto symbol_mapped =
|
|
|
@ -77,7 +77,7 @@ namespace drv
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto& obj : objs)
|
|
|
|
for (auto& obj : objs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto reloc : lnk::sym::get_relocs(obj))
|
|
|
|
for (auto& reloc : lnk::sym::get_relocs(obj))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (reloc.type != IMAGE_REL_AMD64_ADDR64)
|
|
|
|
if (reloc.type != IMAGE_REL_AMD64_ADDR64)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -130,9 +130,9 @@ namespace drv
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto& obj : objs)
|
|
|
|
for (auto& obj : objs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto symbol : lnk::sym::get_all(obj))
|
|
|
|
for (auto& symbol : lnk::sym::get_all(obj))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!symbol.obfuscate_routine)
|
|
|
|
if (!symbol.obfuscate_type)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
std::printf("> resolving obfuscated relocations for routine = %s\n", symbol.symbol_name.c_str());
|
|
|
|
std::printf("> resolving obfuscated relocations for routine = %s\n", symbol.symbol_name.c_str());
|
|
|
@ -361,10 +361,10 @@ namespace drv
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto& obj : objs)
|
|
|
|
for (auto& obj : objs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto symbol : lnk::sym::get_all(obj))
|
|
|
|
for (auto& symbol : lnk::sym::get_all(obj))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// skip obfuscated routines for now... those get scattered...
|
|
|
|
// skip obfuscated routines for now... those get scattered...
|
|
|
|
if (!symbol.obfuscate_routine)
|
|
|
|
if (!symbol.obfuscate_type)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
ZydisDecoder decoder;
|
|
|
|
ZydisDecoder decoder;
|
|
|
@ -453,10 +453,10 @@ namespace drv
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto& obj : objs)
|
|
|
|
for (auto& obj : objs)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (auto symbol : lnk::sym::get_all(obj))
|
|
|
|
for (auto& symbol : lnk::sym::get_all(obj))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// skip obfuscated routines for now... those get scattered...
|
|
|
|
// skip obfuscated routines for now... those get scattered...
|
|
|
|
if (symbol.obfuscate_routine)
|
|
|
|
if (symbol.obfuscate_type)
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
mapped_symbols[symbol.symbol_name] =
|
|
|
|
mapped_symbols[symbol.symbol_name] =
|
|
|
@ -466,5 +466,6 @@ namespace drv
|
|
|
|
symbol.symbol_name.c_str(), mapped_symbols[symbol.symbol_name], symbol.size);
|
|
|
|
symbol.symbol_name.c_str(), mapped_symbols[symbol.symbol_name], symbol.size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|