Protected app crashes when nested exception is thrown

Issues related to VMProtect
dmk
Posts: 3
Joined: Thu Sep 20, 2018 4:33 am

Protected app crashes when nested exception is thrown

Postby dmk » Thu Sep 20, 2018 4:48 am

Добрый день.

Защищенная программа крашится, если кидается 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>



Спасибо!

Admin
Site Admin
Posts: 1504
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Protected app crashes when nested exception is thrown

Postby Admin » Thu Sep 20, 2018 6:37 am

Присылайте тестовый проект (сам бинарник).

dmk
Posts: 3
Joined: Thu Sep 20, 2018 4:33 am

Re: Protected app crashes when nested exception is thrown

Postby dmk » Fri Sep 28, 2018 11:02 am

VMTest.zip
Пример бинарника
(5.03 MiB) Downloaded 10 times

dmk
Posts: 3
Joined: Thu Sep 20, 2018 4:33 am

Re: Protected app crashes when nested exception is thrown

Postby dmk » Wed Oct 17, 2018 12:04 pm

Добрый день.

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

Admin
Site Admin
Posts: 1504
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Protected app crashes when nested exception is thrown

Postby Admin » Sun Oct 28, 2018 8:45 am

Пока нет.