当前位置: 首页 > java >正文

pidgen!DecodeProdKey函数分析之iDecodedBytesMax


第一部分:
else
{
iDecodedBytes = 0;
unsigned int i = (unsigned int)iDigits;
while (iDecodedBytes <= iDecodedBytesMax)
{
i += iBase * abDecodedBytes[iDecodedBytes];
abDecodedBytes[iDecodedBytes] = (unsigned char)i;
i /= 256;
++iDecodedBytes;
}

              if (i != 0)
{

                        if (iDecodedBytes < sizeof(abDecodedBytes))
{
abDecodedBytes[iDecodedBytes] = (unsigned char)i;
iDecodedBytesMax = iDecodedBytes;
}

第二部分:

1: kd> dv iDecodedBytesMax
iDecodedBytesMax = 0n6

1: kd>  dv   abDecodedBytes
abDecodedBytes = unsigned char [64] "???"
1: kd> dx -r1 (*((PIDGen!unsigned char (*)[64])0x6fba8))
(*((PIDGen!unsigned char (*)[64])0x6fba8))                 [Type: unsigned char [64]]
[0]              : 0x12 [Type: unsigned char]
[1]              : 0x9b [Type: unsigned char]
[2]              : 0x6 [Type: unsigned char]
[3]              : 0x55 [Type: unsigned char]
[4]              : 0xdb [Type: unsigned char]
[5]              : 0xb5 [Type: unsigned char]
[6]              : 0xe1 [Type: unsigned char]
[7]              : 0x0 [Type: unsigned char]
[8]              : 0x0 [Type: unsigned char]


1: kd> p
Breakpoint 8 hit
eax=00000004 ebx=00000001 ecx=0006fbae edx=0000009c esi=00000006 edi=0006fe36
eip=0040157c esp=0006fb6c ebp=0006fbec iopl=0         nv up ei pl nz na po cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000203
PIDGen!DecodeProdKey+0x124:
001b:0040157c 46              inc     esi
1: kd> p
eax=00000004 ebx=00000001 ecx=0006fbae edx=0000009c esi=00000007 edi=0006fe36
eip=0040157d esp=0006fb6c ebp=0006fbec iopl=0         nv up ei pl nz na po cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000203
PIDGen!DecodeProdKey+0x125:
001b:0040157d 3b759c          cmp     esi,dword ptr [ebp-64h] ss:0023:0006fb88=00000006

        i /= 256;    eax=00000004

        ++iDecodedBytes;esi=00000007


1: kd> dv abDecodedBytes
abDecodedBytes = unsigned char [64] "???"
sizeof(abDecodedBytes)=64=0x40

第三部分:

1: kd> p
eax=00000004 ebx=00000001 ecx=0006fbae edx=0000009c esi=00000007 edi=0006fe36
eip=00401584 esp=0006fb6c ebp=0006fbec iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
PIDGen!DecodeProdKey+0x12c:
001b:00401584 7413            je      PIDGen!DecodeProdKey+0x141 (00401599) [br=0]
1: kd> p
eax=00000004 ebx=00000001 ecx=0006fbae edx=0000009c esi=00000007 edi=0006fe36
eip=00401586 esp=0006fb6c ebp=0006fbec iopl=0         nv up ei pl nz na po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
PIDGen!DecodeProdKey+0x12e:
001b:00401586 83fe40          cmp     esi,40h

1: kd> p
eax=00000004 ebx=00000001 ecx=0006fbae edx=0000009c esi=00000007 edi=0006fe36
eip=00401589 esp=0006fb6c ebp=0006fbec iopl=0         nv up ei ng nz na po cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000283
PIDGen!DecodeProdKey+0x131:
001b:00401589 7309            jae     PIDGen!DecodeProdKey+0x13c (00401594) [br=0]
1: kd> p
eax=00000004 ebx=00000001 ecx=0006fbae edx=0000009c esi=00000007 edi=0006fe36
eip=0040158b esp=0006fb6c ebp=0006fbec iopl=0         nv up ei ng nz na po cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000283
PIDGen!DecodeProdKey+0x133:
001b:0040158b 884435bc        mov     byte ptr [ebp+esi-44h],al ss:0023:0006fbaf=00


eax=00000004
0023:0006fbaf

1: kd> dx -r1 (*((PIDGen!unsigned char (*)[64])0x6fba8))
(*((PIDGen!unsigned char (*)[64])0x6fba8))                 [Type: unsigned char [64]]
[0]              : 0x12 [Type: unsigned char]    0x6fba8
[1]              : 0x9b [Type: unsigned char]    0x6fba9
[2]              : 0x6 [Type: unsigned char]    0x6fbaa
[3]              : 0x55 [Type: unsigned char]    0x6fbab
[4]              : 0xdb [Type: unsigned char]    0x6fbac
[5]              : 0xb5 [Type: unsigned char]    0x6fbad
[6]              : 0xe1 [Type: unsigned char]    0x6fbae
[7]              : 0x0 [Type: unsigned char]    0x6fbaf
[8]              : 0x0 [Type: unsigned char]


1: kd> dv abDecodedBytes
abDecodedBytes = unsigned char [64] "???"
1: kd> dx -r1 (*((PIDGen!unsigned char (*)[64])0x6fba8))
(*((PIDGen!unsigned char (*)[64])0x6fba8))                 [Type: unsigned char [64]]
[0]              : 0x12 [Type: unsigned char]
[1]              : 0x9b [Type: unsigned char]
[2]              : 0x6 [Type: unsigned char]
[3]              : 0x55 [Type: unsigned char]
[4]              : 0xdb [Type: unsigned char]
[5]              : 0xb5 [Type: unsigned char]
[6]              : 0xe1 [Type: unsigned char]
[7]              : 0x4 [Type: unsigned char]


第四部分:

                           iDecodedBytesMax = iDecodedBytes;

1: kd> p
eax=00000004 ebx=00000001 ecx=0006fbae edx=0000009c esi=00000007 edi=0006fe36
eip=0040158f esp=0006fb6c ebp=0006fbec iopl=0         nv up ei ng nz na po cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000283
PIDGen!DecodeProdKey+0x137:
001b:0040158f 89759c          mov     dword ptr [ebp-64h],esi ss:0023:0006fb88=00000006

1: kd> dv iDecodedBytesMax
iDecodedBytesMax = 0n6

1: kd> dd 0006fbec-64h
0006fb88  00000006


1: kd> p
eax=00000004 ebx=00000001 ecx=0006fbae edx=0000009c esi=00000007 edi=0006fe36
eip=00401592 esp=0006fb6c ebp=0006fbec iopl=0         nv up ei ng nz na po cy
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000283
PIDGen!DecodeProdKey+0x13a:
001b:00401592 eb05            jmp     PIDGen!DecodeProdKey+0x141 (00401599)


1: kd> dv iDecodedBytesMax
iDecodedBytesMax = 0n7
1: kd>  dd 0006fbec-64h
0006fb88  00000007

http://www.xdnf.cn/news/18031.html

相关文章:

  • 服务器硬件电路设计之I2C问答(七):解析 I2C 通信 “卡壳” 难题:从设备无响应与跨电压兼容之道
  • Spring AI Starter和文档解读
  • InfluxDB 数据迁移工具:跨数据库同步方案(一)
  • 超酷炫的Three.js示例
  • Java:File类、递归、字符集、IO流体系及Commons-io框架
  • 【大模型核心技术】Dify 入门教程
  • Flow-GRPO:通过在线 RL 训练 Flow matching 模型
  • PS插件整合包!内置数百款PS插件,支持PS2017-PS2025所有版本!
  • 【学习嵌入式day-26-线程间通信】
  • TypeScript快速入门
  • CPP多线程3:async和future、promise
  • ArrayList的contains问题
  • 机器学习 [白板推导](十二)[卡曼滤波、粒子滤波]
  • 第G7周:Semi-Supervised GAN 理论与实战
  • 【科研绘图系列】R语言绘制雷达图
  • 洛谷B3865 [GESP202309 二级] 小杨的 X 字矩阵(举一反三)
  • 从 MySQL 5.7 迁移到 8.0:别让 SQL 文件 “坑” 了你
  • 《从入门到高可用:2025最新MySQL 8.0全栈速通指南》
  • Linux配置Dante使用的pam验证
  • 【攻防实战】红队攻防之Goby反杀
  • 力扣(LeetCode) ——622. 设计循环队列(C语言)
  • Android Jetpack | Lifecycle
  • 6JSON格式转python并实现数据可视化
  • 储能领域大数据平台的设计中如何使用 Hadoop、Spark、Flink 等组件实现数据采集、清洗、存储及实时 / 离线计算,支持储能系统分析与预测
  • 人工智能中的(特征选择)数据过滤方法和包裹方法
  • 2-3〔O҉S҉C҉P҉ ◈ 研记〕❘ 漏洞扫描▸AppScan(WEB扫描)
  • KingbaseES主备读写分离集群安装教程
  • 计算机网络:(十五)TCP拥塞控制与拥塞控制算法深度剖析
  • C++自旋锁的后退机制简介
  • 云原生俱乐部-RH124知识点总结(3)