SECSTR doesn't detect all strings

Issues related to VMProtect
Post Reply
789qwe
Posts: 6
Joined: Thu Feb 21, 2013 7:28 am

SECSTR doesn't detect all strings

Post by 789qwe »

I have a strange problem.

My project uses SECSTR to protect some strings.
However, VMProtect stopped detecting some of these strings.

I did a test project to try to understand what is happening.
And it seems that when I use a std::map<> all strings below it are not detected by VMProtect.

I took two screenshots showing the problem.

Attached is also the example .cpp I used.

Using MSVC 2022 (v143) build x86, c++14.

Code: Select all

#include <iostream>

#include <VMProtectSDK.h>
#define SECSTR(_ShortAlphaNumeric, _RegularText)    \
const char* _ShortAlphaNumeric = VMProtectDecryptStringA(_RegularText)

#define SECWSTR(_ShortAlphaNumeric, _RegularText)    \
const wchar_t* _ShortAlphaNumeric = VMProtectDecryptStringW(_RegularText)

#define FREESEC(_ShortAlphaNumeric)   \
if(_ShortAlphaNumeric) \
{ \
	VMProtectFreeString(_ShortAlphaNumeric); \
	_ShortAlphaNumeric = NULL; \
}

SECSTR(_TEST_GLOBAL, "Global String Test");

#include <map>
#include <string>

#define ENABLE_VMP_BUG

int main()
{
	SECSTR(_TEST_LOCAL, "Local String Test");

	std::cout << "Hello World!\n";
	std::cout << _TEST_GLOBAL << std::endl;
	std::cout << _TEST_LOCAL << std::endl;

	FREESEC(_TEST_LOCAL);

	SECSTR(_TEST1, "9a0364b9e99bb480dd25e1f0284c8555");
	printf("%s\n", _TEST1);
	FREESEC(_TEST1);

	SECSTR(_TEST2, "9032e60152960343a7ca2c6b6e906dcb");
	printf("%s\n", _TEST2);
	FREESEC(_TEST2);

	SECSTR(_TEST3, "25a7f0d3a18a86a808c5545dd223b2c5");
	printf("%s\n", _TEST3);
	FREESEC(_TEST3);

#ifdef ENABLE_VMP_BUG
	std::map<std::string, int> testMap{};
	SECSTR(_WPS_LIBRARY_NAME, "sdafwrgdfbwerwrgegwer");
	testMap[_WPS_LIBRARY_NAME] = 123;
	FREESEC(_WPS_LIBRARY_NAME);
#endif // ENABLE_VMP_BUG

	SECSTR(_TEST4, "43f6db019f140e72d52fed8556bdffc0");
	printf("%s\n", _TEST4);
	FREESEC(_TEST4);

	SECSTR(_TEST5, "4f19b55800c072d2f7ad04ab9ed9c948");
	printf("%s\n", _TEST5);
	FREESEC(_TEST5);

	SECSTR(_TEST6, "4dfbe1cf4bb1af503851c1bff7f5859f");
	printf("%s\n", _TEST6);
	FREESEC(_TEST6);

	SECSTR(_TEST7, "95ea90499d7a83e70380c0986d926560");
	printf("%s\n", _TEST7);
	FREESEC(_TEST7);

	SECSTR(_TEST8, "f6860f712976ceef63c718c7e20debc9");
	printf("%s\n", _TEST8);
	FREESEC(_TEST8);


	std::cout << "finish test.\n";

	std::getchar();
}
Attachments
without_bug.png
without_bug.png (221.83 KiB) Viewed 1917 times
with_bug.png
with_bug.png (201.92 KiB) Viewed 1917 times
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: SECSTR doesn't detect all strings

Post by Admin »

Please attach compiled binaries.
789qwe
Posts: 6
Joined: Thu Feb 21, 2013 7:28 am

Re: SECSTR doesn't detect all strings

Post by 789qwe »

done.
Attachments
without_bug.zip
(151 KiB) Downloaded 96 times
with_bug.zip
(184.47 KiB) Downloaded 240 times
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: SECSTR doesn't detect all strings

Post by Admin »

Fixed in the 1408 build.
789qwe
Posts: 6
Joined: Thu Feb 21, 2013 7:28 am

Re: SECSTR doesn't detect all strings

Post by 789qwe »

I just tested the build. It's working now.

Thanks.
paituo
Posts: 15
Joined: Thu Dec 03, 2020 12:44 am

Re: SECSTR doesn't detect all strings

Post by paituo »

Admin wrote:Fixed in the 1408 build.
We also encounter similar problems. Can you also send us the repaired version.
My email address is : [deleted]
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: SECSTR doesn't detect all strings

Post by Admin »

We also encounter similar problems. Can you also send us the repaired version.
Done.
Post Reply