Page 1 of 1

Questions about VMProtect Demo

Posted: Wed Apr 22, 2020 2:10 pm
by ytttt
I try to protect a c++ executable by default setting but the vmprotect_con (same as vmprotect_gui) only outputs a smaller vmp executable, which being segmentation fault finally. Is there some steps I missing ?

Image

Re: Questions about VMProtect Demo

Posted: Wed Apr 22, 2020 2:27 pm
by Admin
Could you send us a test example (original binary + VMP files) that shows this problem?

Re: Questions about VMProtect Demo

Posted: Thu Apr 23, 2020 2:11 am
by ytttt
Admin wrote:Could you send us a test example (original binary + VMP files) that shows this problem?
Of course. I run the test example and VMProtect on Ubuntu 18.04 x64. Attachments (https://github.com/goodmorning-coder/vmprotect-example) include the test example, its vmp format and some shared libraries the test example depends on. If You like you can run the test example by './test -help'.

On Ubuntu 18.04, the shared libraries follow the soft links by

Code: Select all

libLTO.so.8 => /usr/local/llvm8r/lib/libLTO.so.8
libOptRemarks.so.8 => /usr/local/llvm8r/lib/libOptRemarks.so.8
libedit.so.0 => /lib/x86_64-linux-gnu/libedit.so.0
Please let me know what else you need to locate this issue. Thank you.

Re: Questions about VMProtect Demo

Posted: Thu Apr 23, 2020 6:58 am
by Admin
You have to switch off the option "Pack the Output File", because libstdc++.so calls some exported functions in your application while initialization.

Re: Questions about VMProtect Demo

Posted: Fri Apr 24, 2020 10:19 am
by ytttt
Admin wrote:You have to switch off the option "Pack the Output File", because libstdc++.so calls some exported functions in your application while initialization.
I have switched off that option in GUI version of VMProtect and got the executable vmp format successfully. Thank you for the solution but I still stuck in later steps. I try to follow the steps in "Stage 2: Real mode" from the document (http://vmpsoft.com/support/user-manual/ ... plication/) and protect the main function in the test example. After pasting the generated serial number to serial.txt in the same folder of test_vmp, the test_vmp still failed to recognize the serial number (Warning that "This code requires valid serial number to run", which is the same behavior as I run test_vmp without serial.txt). Was there something accidentally confused ?

Re: Questions about VMProtect Demo

Posted: Fri Apr 24, 2020 10:58 am
by Admin
and protect the main function in the test example. After pasting the generated serial number to serial.txt
It seems you forgot to call VMProtectSetSerialNumber(serial) before calling a locked function:
http://vmpsoft.com/vmprotect/user-manua ... ial-number

Re: Questions about VMProtect Demo

Posted: Mon Apr 27, 2020 12:49 pm
by ytttt
Admin wrote:
and protect the main function in the test example. After pasting the generated serial number to serial.txt
It seems you forgot to call VMProtectSetSerialNumber(serial) before calling a locked function:
http://vmpsoft.com/vmprotect/user-manua ... ial-number
Oh I see ... by adding this function to the the main() function, the program now works well. I think VMProtect is powerful but still have two little questions about it:

1. Does VMProtect (assume in demo version) locks the main() function to a serial number by default if there are more than one functions in the protected application? I try to lock the main() function itself to the serial number in VMProtect GUI but the program is terminated by the serial number requisition.

2. Does every function I want to lock to the serial number need to invoke VMProtectSetSerialNumber() (assume in the normal version of VMProtect)? I hope the answer is no so I can easily lock them only in VMProtect GUI.

Re: Questions about VMProtect Demo

Posted: Mon Apr 27, 2020 7:01 pm
by Admin
What part of our user manual is still not clear for you?

Re: Questions about VMProtect Demo

Posted: Tue Apr 28, 2020 1:43 am
by ytttt
Admin wrote:What part of our user manual is still not clear for you?
I'm not sure if I understood the contents in http://vmpsoft.com/vmprotect/user-manua ... ial-number correctly, so I hope my questions can be confirmed. By the way, is it possible to link VMProtectSDK statically instead of dynamically?

Re: Questions about VMProtect Demo

Posted: Tue Apr 28, 2020 5:32 am
by Admin
Before calling a locked function you have to use our licensing system inside your application something like this:

Code: Select all

#include "VMProtectSDK.h"

int main()
{
  char *serial = read_serial("serial.txt");
  int status = VMProtectSetSerialNumber(serial);
  if (status != SERIAL_STATE_SUCCESS) {
    printf("Serial number error: %d", status);
    return 1;
  }
  
  return main_locked_by_serial();
}

int main_locked_by_serial()
{
  // your main code here
  ...
}
By the way, is it possible to link VMProtectSDK statically instead of dynamically?
For what? Just check dependences of a protected application.