Is VMProtectDecryptStringA/W thread-safe?

Issues related to VMProtect
Post Reply
std::runtime_error
Posts: 2
Joined: Mon May 12, 2025 9:29 am

Is VMProtectDecryptStringA/W thread-safe?

Post by std::runtime_error »

Hello,
I’m using VMProtect 3.9.4, build 2345, with MSVC C++. I have a question about the thread safety of VMProtectDecryptStringA/W, and VMProtectFreeString.

I always use VMProtectDecryptStringA/W with VMProtectFreeString to prevent runtime memory searching.

The documentation states: " If VMProtectDecryptStringA / VMProtectDecryptStringW are used with the same parameters for the second time without destroying previously decrypted string, additional memory is not allocated. "

So, I wonder if these functions are thread-safe?

For example:

Code: Select all

void func(){
    const char* a = VMProtectDecryptStringA("testA");
    //  do something  << my code block is thread-safe
    VMProtectFreeString(a);
}
Do I need a mutex to ensure thread safety for the DecryptString calls?

Thank you!
Admin
Site Admin
Posts: 2686
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Is VMProtectDecryptStringA/W thread-safe?

Post by Admin »

Yes, these API are thread-safe. You don't need to add a mutex there.
std::runtime_error
Posts: 2
Joined: Mon May 12, 2025 9:29 am

Re: Is VMProtectDecryptStringA/W thread-safe?

Post by std::runtime_error »

Admin wrote: Wed May 21, 2025 9:57 am Yes, these API are thread-safe. You don't need to add a mutex there.
Thanks you!. Btw could I have the latest build?
Post Reply