console option to control packing

Issues related to VMProtect
Post Reply
jimman
Posts: 4
Joined: Thu Sep 18, 2025 7:58 am

console option to control packing

Post by jimman »

Hello all,

I am trying to run the vmprotect_con on the binary file without a project file. I have marked the relevant sections of my C++ code with VMProtectBeginMutation("..") and VMProtectEnd(). And in CMake I have added add_custom_command() to invoke the vmprotect_con POST_BUILD on the generated target file. It was able to generate the intended protected binary.

By default the vmprotect_con packs the generated binary.

Code: Select all

...
Compiling... 100%
Saving... 100%
Packing... 100%
Saving startup code... 100%
[Information] Output file size is 16117740 bytes (115%)

Compilation completed
And for some reason, executing this binary fails with a segmentation fault.

But, when the Pack the Output File is set to No via GUI the same generated binary runs without any issue.

I don't see any console option to turn off the packing without the project file. Is there any other way to do this?

Please guide me.
Admin
Site Admin
Posts: 2733
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: console option to control packing

Post by Admin »

Are you are registered user?
jimman
Posts: 4
Joined: Thu Sep 18, 2025 7:58 am

Re: console option to control packing

Post by jimman »

Yes, I am a professional version licensed user.
Last edited by jimman on Thu Sep 18, 2025 9:48 am, edited 1 time in total.
Admin
Site Admin
Posts: 2733
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: console option to control packing

Post by Admin »

You need to make ".VMP" with required options and use it for console version.
jimman
Posts: 4
Joined: Thu Sep 18, 2025 7:58 am

Re: console option to control packing

Post by jimman »

Admin wrote: Thu Sep 18, 2025 10:00 am You need to make ".VMP" with required options and use it for console version.
As I am integrating the vmprotect_con with the CMake build system I need to use it without a ".vmp" project file. The markers are defined in the code to protect the relevant sections and these markers will increase as new code is added. We can't have an intermediate manual step of opening the executable in vmprotect_gui and then creating a ".vmp" file.

The whole reason we purchased the professional version was to get rid of the manual step of using GUI and use the console version entirely to generate the final protected executable as the part of the build system itself.

Or is there a way to generate the ".vmp" file from the codebase on the console without using the vmprotect_gui?
Admin
Site Admin
Posts: 2733
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: console option to control packing

Post by Admin »

You need to do the following steps:
1. Open any binary with GUI version.
2. Select required options in the "Options" section
3. Delete all markers in the "Functions for Protection" section
3. Save project file as "default.vmp"
4. Use console version with real binary and use "-pf default.vmp" parameter.
jimman
Posts: 4
Joined: Thu Sep 18, 2025 7:58 am

Re: console option to control packing

Post by jimman »

Admin wrote: Thu Sep 18, 2025 10:26 am You need to do the following steps:
1. Open any binary with GUI version.
2. Select required options in the "Options" section
3. Delete all markers in the "Functions for Protection" section
3. Save project file as "default.vmp"
4. Use console version with real binary and use "-pf default.vmp" parameter.
Thanks a lot. Now, the build system generates the protected executable without packing and it has no runtime segmentation fault.

Code: Select all

Compiling... 100%
Saving... 100%
Saving startup code... 100%
sh: 1: trash: not found
[Information] Output file size is 21155540 bytes (150%)

Compilation completed

However, I see this line above sh: 1: trash: not found. Can we ignore it?
Post Reply