Files
Cmake 195f02a41d dogprotect: VMProtect → DogProtect 全量改名 + VM 节名改 .dog
- 产品名/展示串、SDK 与运行时导出 API、.NET 命名空间全部换为 DogProtect
- 文件与目录改名: dogprotect.sln / DogProtect/ / DogProtectCon/ / sdk/DogProtect.SDK /
  sdk/DogProtectSDK.{h,pas,bas,inc} / runtime/DogProtect.Runtime/ / core/dogprotect.rc /
  app/dogprotect_gui.app
- 项目文件扩展名 .vmp → .dog(含 GUI 过滤器、默认输出名、示例工程、单测)
- VM 代码节名默认 .dog(上游为随机 ".xyz"),产物节为 .dog0/.dog1/...
- 授权数据与配置: DogProtect.dat / DogProtectLicense.ini / Global\\DogProtect.dat
- 域名占位 dogprotect.example,bundle id com.dogprotect.dogprotect
- 保留 VMP_* 内部宏与 third-party/
- BUILD-LINUX.md 增补改名说明与 SDK 兼容性提示
2026-11-23 16:15:28 +08:00

97 lines
2.2 KiB
C#

using System;
using System.IO;
namespace UnitTestProject.RefVm
{
internal static class VmPosParser // \u0006\u2006
{
// Token: 0x0600016A RID: 362 RVA: 0x00007810 File Offset: 0x00005A10
public static byte[] Parse(string pos) // dest
{
if (pos == null)
{
throw new Exception();
}
var memoryStream = new MemoryStream(pos.Length * 4 / 5);
byte[] result;
using(memoryStream)
{
var cnt = 0;
var val = 0u;
foreach (var c in pos)
{
if (c == 'z' && cnt == 0)
{
WriteDwPart(memoryStream, val, 0);
}
else
{
if (c< '!' || c> 'u')
{
throw new Exception();
}
checked
{
val += (uint)(Arr[cnt] * (ulong)checked(c - '!'));
}
cnt++;
if (cnt == 5)
{
WriteDwPart(memoryStream, val, 0);
cnt = 0;
val = 0u;
}
}
}
if (cnt == 1)
{
throw new Exception();
}
if (cnt > 1)
{
for (var j = cnt; j < 5; j++)
{
checked
{
val += 84u * Arr[j];
}
}
WriteDwPart(memoryStream, val, 5 - cnt);
}
result = memoryStream.ToArray();
}
return result;
}
// Token: 0x0600016B RID: 363 RVA: 0x00007900 File Offset: 0x00005B00
private static void WriteDwPart(Stream dest, uint val, int ignoreLow) // dest
{
dest.WriteByte((byte)(val >> 24));
if (ignoreLow == 3)
{
return;
}
dest.WriteByte((byte)(val >> 16 & 255u));
if (ignoreLow == 2)
{
return;
}
dest.WriteByte((byte)(val >> 8 & 255u));
if (ignoreLow == 1)
{
return;
}
dest.WriteByte((byte)(val & 255u));
}
// Token: 0x04000131 RID: 305
private static readonly uint[] Arr = {
52200625u,
614125u,
7225u,
85u,
1u
};
}
}