⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 g1.y

📁 c语言 一个比较好的反汇编核心代码
💻 Y
📖 第 1 页 / 共 2 页
字号:
@ word               =  byte\x  
@                       byte\y                  
@                                           {@ y*256+x @}

@ dword              =  byte\x1  
@                       byte\x2  
@                       byte\x3  
@                       byte\x4
@                                           {@ ((x4*256+x3)*256+x2)*256+x1 @}

@ adword             = )addressOveride==1( 
@                       word
@                    |  dword

@ wdword             = )operandOveride==1( 
@                       word
@                    |  dword

@ pword              =  word\x 
@                       adword\y	        
@                                           {: i_word=x; i_dword=y; :}

@ prefixes           =  op\x )opcodeTable[x]==PREFIX(   
@ {: prefixStack[i_psp++]=x; if (x==102) operandOveride=1; 
@							 if (x==103) addressOveride=1; :}

@ onebyteinstr       =  op\x  )opcodeTable[x]==0(   
@                                               {: i_opclass=0; i_opcode=x; :}
@                    |  op\x  )opcodeTable[x]==1(    
@                       byte\y
@                                               {: i_opclass=1; i_opcode=x; i_byte=y; :}
@                    |  op\x  )opcodeTable[x]==2(    
@                       word\y
@                                               {: i_opclass=2; i_opcode=x; i_word=y; :}
@                    |  op\x  )opcodeTable[x]==3(    
@                       word\y1  
@                       byte\y2
@                                     {: i_opclass=3; i_opcode=x; i_word=y1; i_byte=y2; :}
@                    |  op\x  )opcodeTable[x]==4(    
@                       wdword\y
@                                               {: i_opclass=4; i_opcode=x; i_dword=y; :}  
@                    |  op\x  )opcodeTable[x]==44(    
@                       adword\y
@                                               {: i_opclass=4; i_opcode=x; i_dword=y; :}  
@                    |  op\x  )opcodeTable[x]==5(    
@                       pword
@                                               {: i_opclass=5; i_opcode=x; :}
@                    |  op\x  )opcodeTable[x]==6(    
@                       modrm
@                                               {: i_opclass=6; i_opcode=x; :}
@                    |  op\x  )opcodeTable[x]==7(    
@                       modrm  
@                       byte\y
@                                               {: i_opclass=7; i_opcode=x; i_byte=y; :}
@                    |  onecontinue


@ onecontinue        =  op\x  )opcodeTable[x]==8(    
@                       modrm  
@                       wdword\y
@                                               {: i_opclass=8; i_opcode=x; i_dword=y; :}
@                    |  op\x  )opcodeTable[x]==9(    
@                       opext
@                                               {: i_opclass=9; i_opcode=x; :}
@                    |  op\x  )opcodeTable[x]==10(   
@                       opext  
@                       byte\y
@                                               {: i_opclass=10; i_opcode=x; i_byte=y; :}
@                    |  op\x  )opcodeTable[x]==11(   
@                       opext  
@                       wdword\y
@                                               {: i_opclass=11; i_opcode=x; i_dword=y; :}
@                    |  op\x  )opcodeTable[x]==12(   
@                       opextg
@                                               {: i_opclass=12; i_opcode=x; :}
@                    |  casejmpblk	  
@                    |  testgroup	  
@                    |  waitgroup	  
@                    |  repeatgroup	  

@ twobyteinstr       =  op\x  )opcode2Table[x]==0(
@                                               {: i_opclass=0; i_opcode=x; :}
@                    |  op\x  )opcode2Table[x]==1(  
@                       adword\y 
@                                               {: i_opclass=1; i_opcode=x; i_dword=y; :}
@                    |  op\x  )opcode2Table[x]==2(  
@                       modrm
@                                               {: i_opclass=2; i_opcode=x; :}
@                    |  op\x  )opcode2Table[x]==3(  
@                       modrm  
@                       byte\y
@                                               {: i_opclass=3; i_opcode=x; i_byte=y;  :}
@                    |  op\x  )opcode2Table[x]==4(  
@                       opext
@                                               {: i_opclass=4; i_opcode=x; :}
@                    |  op\x  )opcode2Table[x]==5(  
@                       opext  
@                       byte\y
@                                               {: i_opclass=5; i_opcode=x; i_byte=y;  :}

@ modrm              =  )addressOveride==0(
@                       modrm1
@                    |  )addressOveride==1(
@                       modrm2

@ modrm1             =	op\x  )modTable[x]==1(  
@                                               {: i_mod=x; :}
@                    |	op\x  )modTable[x]==2(  
@                       sibstar\y1  
@                       dword\y2	
@                                               {: i_mod=x; i_sib=y1; m_dword=y2; :}
@                    |	op\x  )modTable[x]==2(  
@                       sibnstar\y
@                                               {: i_mod=x; i_sib=y; :}
@                    |	op\x  )modTable[x]==3(  
@                       dword\y
@                                               {: i_mod=x; m_dword=y; :}
@                    |	op\x  )modTable[x]==4(  
@                       byte\y
@                                               {: i_mod=x; m_byte=y; :}
@                    |	op\x  )modTable[x]==5(  
@                       sib\y1   
@                       byte\y2
@                                               {: i_mod=x; i_sib=y1; m_byte=y2; :}
@                    |	op\x  )modTable[x]==6(  
@                       dword\y
@                                               {: i_mod=x; m_dword=y; :}
@                    |	op\x  )modTable[x]==7(  
@                       sib\y1   
@                       dword\y2
@                                               {: i_mod=x; i_sib=y1; m_dword=y2; :}
@                    |	op\x  )modTable[x]==8(
@                                               {: i_mod=x; :}

@ modrm2             =  op\x  )mod16Table[x]==1(
@                                               {: i_mod=x; :}
@                    |  op\x  )mod16Table[x]==2(
@                       word\y                  
@                                               {: i_mod=x; m_dword=y; :}
@                    |  op\x  )mod16Table[x]==3(
@                       byte\y
@                                               {: i_mod=x; m_byte=y;  :}
@                    |  op\x  )mod16Table[x]==4(
@                       word\y
@                                               {: i_mod=x; m_dword=y; :}
@                    |  op\x  )mod16Table[x]==5(
@                                               {: i_mod=x; :}

@ sibstar            =  op\x  )sibTable[x]==1(
@                                               {@ $x @}

@ sibnstar           =  op\x  )sibTable[x]==2(
@                                               {@ $x @}

@ sib                =  byte
  
@ casejmpblk		 =  op\x1  )x1==255(	   
@                       op\x2  )x2==36(	   
@                       op\x3  )rmTable[x3]==5(	  
@                                       {: i_opclass=13; i_opcode=x1; i_mod=x2; i_sib=x3; :} 
@                       labelstartposition   !        
@                       label1                            
@                       {: finished=1; :} 					                      
@                    |  op\x  )x==255(                       
@                       ] ?\y )regTable[y]<7( [
@                       opext
@						                                   {: i_opclass=13; i_opcode=x; :}
 
@ labelstartposition =  dword\x          
@           {: m_dword=label_start_pos=x; opclass=1; bodyprint0(); :}

@ label1             =  )cur_position==label_start_pos-7(
@                       {: addressprint(); :}
@                       dword\x {: min_label=m_dword=x; bodyprint1(); :}   !
@                       tails !
@                    |  {}

@ tails              =  {label}*

@ label				 =  )nextMode && cur_position < min_label-4( 
@                       {: addressprint(); :}
@                       dword\x  
@                       )isGoodAddress(x)(
@      {: if((m_dword=x)<min_label)min_label=x; bodyprint1(); :} ! 


@ opext              =  modrm  

@ opextg             =  opext  
 
@ testgroup          =  op\x  )x==246(          
@                       xS0  
@                       byte\y
@                                               {: i_opclass=14; i_opcode=x; i_byte=y; :}
@                    |  op\x  )x==246(                      
@                       ] ?\y )regTable[y]>1( [
@                       opext
@                                               {: i_opclass=14; i_opcode=x; :}
@                    |  op\x  )x==247(      
@                       xS0  
@                       wdword\y
@                                               {: i_opclass=14; i_opcode=x; i_dword=y; :}
@                    |	op\x  )x==247(     
@                       opext
@                                               {: i_opclass=14; i_opcode=x; :}

@ xS0                =  ] ?\x  )regTable[x]==0( [ 
@                       opext

@ xS6                =  ] ?\x  )regTable[x]==6( [ 
@                       opext

@ xS7                =  ] ?\x  )regTable[x]==7( [
@                       opext

@ waitgroup   		 =  op\x1  )x1==155(     
@					    op\x2  )x2==217(     
@                       xS6
@						            {: i_opclass=15; i_opcode=x2; prefixStack[i_psp++]=x1; :}
@                    |  op\x1  )x1==155(     
@					    op\x2  )x2==217(     
@                       xS7
@						            {: i_opclass=15; i_opcode=x2; prefixStack[i_psp++]=x1; :}
@                    |  op\x1  )x1==155(     
@					    op\x2  )x2==219(     
@                       op\x3  )x3==226(  
@						  {: i_opclass=15; i_opcode=x2; i_mod=x3; prefixStack[i_psp++]=x1; :}
@                    |  op\x1  )x1==155(     
@					    op\x2  )x2==219(     
@                       op\x3  )x3==227(  
@						  {: i_opclass=15; i_opcode=x2; i_mod=x3; prefixStack[i_psp++]=x1; :}
@                    |  op\x1  )x1==155(     
@					    op\x2  )x2==221(     
@                       xS6
@						            {: i_opclass=15; i_opcode=x2; prefixStack[i_psp++]=x1; :}
@                    |  op\x1  )x1==155(     
@					    op\x2  )x2==221(     
@                       xS7
@						            {: i_opclass=15; i_opcode=x2; prefixStack[i_psp++]=x1; :}
@                    |  op\x1  )x1==155(     
@					    op\x2  )x2==223(     
@                       op\x3  )x3==224(  
@						  {: i_opclass=15; i_opcode=x2; i_mod=x3; prefixStack[i_psp++]=x1; :}
@                    |  op\x  )x==155(  
@						                        {: i_opclass=15; i_opcode=x; :}

@ repeatgroup        =  op\x1  )x1==242(     
@                       op\x2  )repeatgroupTable[x2]==1(
@						           {: i_opclass=16; i_opcode=x2; prefixStack[i_psp++]=x1; :}
@                    |  op\x1  )x1==243(   
@                       op\x2  )repeatgroupTable[x2]==1(
@						           {: i_opclass=16; i_opcode=x2; prefixStack[i_psp++]=x1; :}
@                    |  op\x1  )x1==243(    
@                       op\x2  )repeatgroupTable[x2]==2(
@						           {: i_opclass=16; i_opcode=x2; prefixStack[i_psp++]=x1; :}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -