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.
Code: Select all
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
}