附代码(未经测试):
/***************************************
purpose: check the number of prefix,
report all kinds of result,
supply opecode entry point
prototype: int GetPrefix((char*));
Local: int i //i=report state
global: char* pOpcode
In: char* pInstrctn
Out: state indicator //0~5 Normal, 6 too much prefix, 7 repeated prefix
type-define: enum prefixclass_t
*****************************************/
/******* For test only**********
enum prefixclass_t{
Noprefix, Operandsizepre, Addresssizepre,
Repeatpre, Lockpre, Segmentpre,
Error_prefix_repeated, Error_prefix_too_much};
char *pOpcode;
******* For test only**********/
int GetPrefix(char* pInstrctn)
{
extern char* pOpcode;
prefixclass_t tLastprefix=Noprefix;
int i=0;
for(;;){
switch(*(pInstrctn+i)){
case 66h: //66h=Operandsizepre
if(Operandsizepre==tLastprefix)
return Error_prefix_repeated;
else
break;
case 67h: //67h=Addresssizepre
if(Addresssizepre==tLastprefix)
return Error_prefix_repeated;
else
break;
case 0xF3: //f3h, f2h=Repeatpre
case 0xF2:
if(Repeatpre==tLastprefix)
return Error_prefix_repeated;
else
break;
case 0xF0: //f0h=Lockpre
if(Lockpre==tLastprefix)
return Error_prefix_repeated;
else
break;
case 0x2E: case 0x3E: case 0x26: //all=Segmentpre
case 0x36: case 0x64: case 0x65:
if(Segmentpre==tLastprefix)
return Error_prefix_repeated;
else
break;
default:
return i;
}
i++;
pOpcode=pInstrctn+i;
if(i>5)
return Error_prefix_too_much;
}
}
1.The C++ Programming Language
2.The C Programming Language
3.Reversing_Secrets_of_Reverse_Engineering
3.Programming Windows
4.Programming Applications for Microsoft Windows
5.Platform SDK Documentation
6.Microsoft Windows Internals (前几章, 越看越不懂了, 停手)
7.The Art of Assembly Language Programming
8.The Essentials of Computer Organization and Architecture
9.Data Structures and Algorithms (粗略地看了下)
10.operating system principles---PER BRINCH HANSEN (几章)
11.Compilers - Principles, Techniques, and Tools 2e -Aho - (瞄了几眼~)
12. 其他, 比如 hamming code, Run Length Limited code, huffman code, regular expression , TCP/IP 杂七杂八什么的.