有任何疑问,请联系我们:china@enigmaprotector.com

帮助

使用手册
附加信息
使用手册

环境变量

Environment

自定义环境变量将在被保护程序运行时可以被调用,这是一个很好的隐藏/加密字符串的方法。请注意,变量名称/值限制在255字符内。

更多环境变量使用方法参看下面例子

几种语言使用自定义环境变量的例子

Delphi

uses 
  Windows;

function GetEnvVar(Name : string) : String;
var 
  buf : array[0..255] of char;
begin
  Result := '';
  if (GetEnvironmentVariable(pansichar(name), @buf, sizeof(buf)) <> 0) then
    Result := string(buf);
End; 

// another way

uses 
  SysUtils;

 
function GetEnvVar(Name : string) : string;
begin
  Result := GetEnvironmentVariable(Name);
end;


C++

#include <windows.h>

{
   char variable[256]="";
   if (!GetEnvironmentVariable("my variable", variable, sizeof(variable))) {
       MessageBox(0, "Variable found!", "Application", MB_OK);
   };
}


Visual Basic

Public Declare Function GetEnvironmentVariable Lib "kernel32.dll" Alias "GetEnvironmentVariableA" (ByVal Name) As String

C# (.NET)

public class Enigma_EnvironmentVariables
{
  [DllImport("kernel32")] public static extern int GetEnvironmentVariable(string lpName, string lpBuffer, int nSize);
}