Protected app crashes when nested exception is thrown

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

Protected app crashes when nested exception is thrown

Post 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>

Спасибо!
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Protected app crashes when nested exception is thrown

Post by Admin »

Присылайте тестовый проект (сам бинарник).
dmk
Posts: 3
Joined: Thu Sep 20, 2018 4:33 am

Re: Protected app crashes when nested exception is thrown

Post by dmk »

VMTest.zip
Пример бинарника
(5.03 MiB) Downloaded 316 times
dmk
Posts: 3
Joined: Thu Sep 20, 2018 4:33 am

Re: Protected app crashes when nested exception is thrown

Post by dmk »

Добрый день.

Есть ли новости по данной проблеме?
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Protected app crashes when nested exception is thrown

Post by Admin »

Пока нет.
Post Reply