Skip to content

判断内存是否为OCR加密包 - OcrIsEncryptedModelPackageMemory

函数简介

检测缓冲区是否为欧拉 OCR 加密包。

接口名称

OcrIsEncryptedModelPackageMemory

DLL 调用

int OcrIsEncryptedModelPackageMemory(long memoryAddr, long size);

参数说明

参数名类型说明
memoryAddr长整数型缓冲区地址。
size长整数型缓冲区字节长度。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int ret = ola.OcrIsEncryptedModelPackageMemory(0, 0);
csharp
using OLAPlug;

var ola = new OLAPlugServer();
int ret = ola.OcrIsEncryptedModelPackageMemory(0, 0);
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
ret = ola.OcrIsEncryptedModelPackageMemory(0, 0)
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
int ret = ola.OcrIsEncryptedModelPackageMemory(0, 0);
go
import "github.com/ola/olaplug/olaplug"

ola, _ := olaplug.NewOLAPlugServer("OLAPlug_x64.dll")
defer ola.ReleaseObj()
ret := ola.OcrIsEncryptedModelPackageMemory(0, 0)
rust
use olaplug::OLAPlugServer;

let ola = OLAPlugServer::new("OLAPlug_x64.dll").unwrap();
let ret = ola.ocr_is_encrypted_model_package_memory(0, 0);
cpp
var ola = com("OlaPlug.OlaSoft")
var ret = ola.OcrIsEncryptedModelPackageMemory(0, 0)
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ret = ola.OcrIsEncryptedModelPackageMemory(0, 0)
text
.局部变量 ola, OLAPlug
ola.创建 ()
ret = ola.OcrIsEncryptedModelPackageMemory(0, 0)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var ret = ola.OcrIsEncryptedModelPackageMemory(0, 0);
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
整数 ret = ola.OcrIsEncryptedModelPackageMemory(0, 0)
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int32_t ret = ola.OcrIsEncryptedModelPackageMemory(0, 0);

原生 DLL 调用

cpp
OcrIsEncryptedModelPackageMemory(instance, 0, 0);
csharp
using System.Runtime.InteropServices;
using System.Text;

[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int OcrIsEncryptedModelPackageMemory(long memoryAddr, long size);

OcrIsEncryptedModelPackageMemory(instance, 0, 0);
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
ola.OcrIsEncryptedModelPackageMemory(instance, 0, 0)

返回值

返回值说明
(返回值)- 1:可能是 OCR 包 - 0:不是或参数非法。

注意事项

项目说明
模型格式仅判断 OCR;YOLO 请用 OlaDetectEncryptedPackageTypeMemory