Since there is no official SDK example for golang, I studied it and found that it was feasible.
HWID and serial information can be successfully detected through CGO, but Marker cannot be detected by VMP.
After adding C.VMProtectBeginUltra(C.CString(“protect”) to my other project, Marker can be detected, but Marker’s name cannot be recognized, and the content that needs to be protected cannot be detected.
package main
// #include <stdbool.h>
// #include <stdlib.h>
// #include "VMProtectSDK.h"
// #cgo LDFLAGS: -L . -lVMProtectSDK
import "C"
import (
"fmt"
"unsafe"
)
func main() {
Cprotect := C.CString("protect")
defer C.free(unsafe.Pointer(Cprotect))
//it's not work
C.VMProtectBeginUltra(Cprotect)
serial := "CMQz+nTnrgqB4OUBXAwCT9k40JM5qqVCQFSD4IAqega6C3KPidYeqE3iuVNelEbYYykEl2eTrzbjU424kGAsCz+Y478jMVfco6gVWoWDd+FwZrRU06dWdhkBzvzsVxnHmtdpN9An7pKEvH4RCEyqcc19WjBgas4TlSjOBUjXNMtx9txsGVev06nmgOUhx9gELi6R/e9xDMqhnK5Ys58jh52xTjuWUtw58qtRlJyMAnE4YSC8YRH4awnnkOAOFsRqpwMJB2uRIgHjfdkhd5JFUDU1UHFFH8ASZ0w1ti464OSybPB9AmlP+2L/1+ZonvkID3bjHIHPG2Tr55BGE0nxDQ=="
nSize := C.VMProtectGetCurrentHWID(nil, 0)
hw := new(C.char)
C.VMProtectGetCurrentHWID(hw, nSize)
hwid := C.GoString(hw)
Cserial := C.CString(serial)
defer C.free(unsafe.Pointer(Cserial))
kstate := C.VMProtectSetSerialNumber(Cserial)
var sd C.VMProtectSerialNumberData
C.VMProtectGetSerialNumberData(&sd, C.sizeof_VMProtectSerialNumberData)
var user string
for _, v := range sd.wUserName {
if v != 0 {
user += string(v)
}
}
//it's work
fmt.Println("HWID: ", hwid)
//it's work
fmt.Println("Is Protected: ", C.VMProtectIsProtected())
//it's work
fmt.Println(kstate)
//it's work
fmt.Println(user)
C.VMProtectEnd()
return
}
Hello, admin, I just buy VMProtect Ultimate v3.6.0.1410 today.
After a few days of research, I solved the compatibility of some VMProtect with Golang.
Now VMProtect can recognize the addresses of VMProtectBegin and VMProtectEnd.
However, MarkerName are not recognized, and VMProtectDecryptStringA is doesn’t work .
Can solve the problem of protecting Golang?
Other functions seem to be feasible, but I’m not sure. please help me check the Virtualization and Mutation ,Has it played a protect role?
Below are unprotected programs, Mach-o and PE. NoVMP.zip (2.95 MB)
After some code modify,use some alternative methods of golang,
Now golang is basically compatible with VMP.
MarkerName and string for VMProtectDecryptString can be detected.
After tested,VMProtectDecryptString is work,string is encrypted.
The PE compiled by w64-mingw32 is work,
but mach-o compiled by apple clang 13 also can’t detect the MarkerName and string for VMProtectDecryptString.
I will try the GCC for test.