Защищенная программа крашится, если кидается nested exception. Пример кода:
Code: Select all
template<typename UserException>
void BOOST_NORETURN throwNestedException(UserException&& e)
{
using E = std::remove_reference_t<UserException>;
static_assert(std::is_base_of<std::exception, E>::value, "UserException must inherit from std::exception");
std::throw_with_nested(std::forward<UserException>(e));
}
void protectedFunc()
{
try
{
try
{
throwNestedException(std::exception("exception 1"));
}
catch (int)
{
printf("catch int\n");
}
catch (const std::exception& e)
{
printf("catch 1: %s\n", e.what());
printf("before crash\n");
throwNestedException(std::exception("nested exception 1")); // crash is here
}
}
catch (const std::exception& e)
{
printf("after crash\n");
printf("external catch 1: %s\n", e.what());
throwNestedException(std::exception("nested exception 2"));
}
}
Вывод защищенной программы:catch 1: exception 1
before crash
after crash
external catch 1: nested exception 1
...
Win x64 release. VMProtect Ultimate 3.2.0.1003.catch 1: exception 1
before crash
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<Document Version="2">
<Protection InputFileName="test.exe" Options="529352" LicenseDataFileName=test_exe.vmp">
<Procedures>
..............
<Procedure MapAddress="protectedFunc" Options="0" CompilationType="2" />
..............
</Procedures>
</Protection>
</Document>
Спасибо!