VMProtectDecryptString how to use ?

Issues related to VMProtect
Post Reply
tested05
Posts: 5
Joined: Fri Dec 15, 2017 4:14 pm

VMProtectDecryptString how to use ?

Post by tested05 »

Code: Select all

			if (aSizeEncrypted)
			{
				DWORD aSizeDataEncrypted = aSizeEncrypted;
				LPSTR aDataEncryptedString = (LPSTR)malloc(aSizeEncrypted);
				memcpy(aDataEncryptedString, (LPBYTE)aBuffer + hdrsz, aSizeEncrypted);
				CryptAES(aDataEncryptedString, aSizeEncrypted, pwd, false);
				aDataEncrypted = (BYTE*)malloc(aSizeDataEncrypted);
				CryptStringToBinaryA(aDataEncryptedString, NULL, CRYPT_STRING_BASE64, aDataEncrypted, &aSizeEncrypted, NULL, NULL);
				free(aDataEncryptedString);
				if (aSizeDeCompressed == aSizeCompressed)
				{
					memcpy(aDataBuf, aDataEncrypted, aSizeDeCompressed);
					free(aDataEncrypted);
					return aSizeDeCompressed;
				}
			}
How can I protect SizeDeCompressed variable with VMProtectDecryptString?
Admin
Site Admin
Posts: 2562
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: VMProtectDecryptString how to use ?

Post by Admin »

Please notice that VMProtectDecryptString works for string literals only:

Code: Select all

char *str = VMProtectDecryptStringA("MY SECURE STRING");
And it removes "MY SECURE STRING" from binary file while protection.
Post Reply