Page 1 of 1

Protected app crashes when nested exception is thrown

Posted: Thu Sep 20, 2018 4:48 am
by dmk
Добрый день.

Защищенная программа крашится, если кидается 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
...
Вывод защищенной программы:
catch 1: exception 1
before crash
Win x64 release. VMProtect Ultimate 3.2.0.1003.

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>

Спасибо!

Re: Protected app crashes when nested exception is thrown

Posted: Thu Sep 20, 2018 6:37 am
by Admin
Присылайте тестовый проект (сам бинарник).

Re: Protected app crashes when nested exception is thrown

Posted: Fri Sep 28, 2018 11:02 am
by dmk
VMTest.zip
Пример бинарника
(5.03 MiB) Downloaded 320 times

Re: Protected app crashes when nested exception is thrown

Posted: Wed Oct 17, 2018 12:04 pm
by dmk
Добрый день.

Есть ли новости по данной проблеме?

Re: Protected app crashes when nested exception is thrown

Posted: Sun Oct 28, 2018 8:45 am
by Admin
Пока нет.