不知道还有没有人需要这个。
在HaplSwim.dll里有个未公开的API:HReadByte,可以读取任意地址的值。
给出代码吧(以STM8L101为例):
typedef int (*HBeforeRead)(void);
typedef int (*HReadByte)(int,int,int,BYTE*);
HBeforeRead pHBeforeRead;
HReadByte pHReadByte;
HINSTANCE dll = LoadLibrary("C:\\Program Files\\STMicroelectronics\\st_toolset\\stvp\\HaplSwim.dll");
pHBeforeRead = (HBeforeRead)GetProcAddress(dll, "HBeforeRead");
pHReadByte = (HReadByte)GetProcAddress(dll, "HReadByte");
BYTE uid[12];
if((*pHBeforeRead)() == TRUE){
for(int i=0;i<12;i++){
(*pHReadByte)(4, 0x4925+i, 1, uid+i);
}
}
|