首页
社区
课程
招聘
[讨论]Hecvm我虚拟机编译好了。
发表于: 2007-10-1 20:36 4700

[讨论]Hecvm我虚拟机编译好了。

2007-10-1 20:36
4700
今天10-1,哪都没去.早上10点半起来弄HEC
修正它代码里的警告错误什么的.大多是类型转换问题.
下午设计与实现那本书到了.
弄到了.RUN文件测试
这个文件的格式是这样的

[文件标志]
[长度一 8字节]
[长度二 8字节]
[代码段长度三 8字节]
[代码段]

引用它自己的.RUN文件测试通过.
回头看下他的机器码识别.我日!

#define        LBI                0       
#define LWI                1
#define        LDI                2
#define        LQI                3
#define LF1I        4
#define LF2I        5
...

这不就是说.0x00 = LBI?
肯定不通用了.对吧?

也就是说.要想PE文件在HECVM里跑起来还得自己写个机器码识别放里面..
不知道我理解正确不?
大家有什么好方法?
我打算加入OD的机器码识别.然后把工作转到HECVM的V - CPU上执行.可以吗?

--------------------

如果哪位需要HECVM的编译运行版本可以留个E-mail
我太垃圾了.花了几小时才把他弄起来.闷!

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 33
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
附录.上面是RUN文件正确的原代码.下面是x86机器码识别的汇编(OD)

#allocate local storage
PUSHQ $FP
MOV $FP,$SP
LQI $R7,512
SUB $SP,$SP,$R7

#populate name of shared lib = sharedLib.dll
LAI $R10,$FP,filename
MOV $R14,$R10
LBI $R2,1

LBI $R1,'s'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'h'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'a'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'r'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'e'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'d'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'L'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'i'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'b'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'.'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'d'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'l'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'l'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,0
SB  $R1,$R10

#populate XML input <IN>proc1</IN>
LAI $R10,$FP,input
MOV $R11,$R10
LBI $R2,1

LBI $R1,'<'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'I'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'N'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'>'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'p'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'r'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'o'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'c'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'1'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'<'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'/'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'I'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'N'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,'>'
SB  $R1,$R10
ADD $R10,$R10,$R2

LBI $R1,0
SB  $R1,$R10

#load the library (put handle in $R20)
LQI $R1,0
MOV $R2,$R14
INT 9
MOV $R20,$R3

MOV $R2,$R4
LQI $R1,20
INT 0

LQI $R2,10
LQI $R1,16
INT 0
LQI $R2,13
LQI $R1,16
INT 0

#execute native call
LAI $R4,$FP,output
MOV $R3,$R11
MOV $R2,$R20
LQI $R1,1
INT 9

LAI $R2,$FP,output
LQI $R1,18
INT 0

LQI $R2,10
LQI $R1,16
INT 0
LQI $R2,13
LQI $R1,16
INT 0

#free library
MOV $R2,$R20
LQI $R1,2
INT 9

MOV $R2,$R3
LQI $R1,20
INT 0

LQI $R2,10
LQI $R1,16
INT 0
LQI $R2,13
LQI $R1,16
INT 0

#reclaim local storage
MOV $SP,$FP
POPQ $FP

HALT
.PE

---------------------OD识别

POP SS
ADD AH,[DS:EAX]
ADD AL,[DS:ECX]
ADD ECX,[DS:ESI]
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD AL,[DS:EAX]
ADD [SS:ECX],EAX
PUSH CS
POP ES
ADC [DS:EDX],EAX
???
???
???
???
???
???
PUSH EAX
AND [DS:1090011],DL
ADD [DS:EAX],CL
JNB SHORT 00400010
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:EAX+E],CH
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ECX+E],AH
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:EDX+E],DH
OR [DS:ECX],DL
XOR EAX,91111
OR [SS:EBP+E],AH
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ESI+ECX+8],AH
ADC [DS:91111],ESI
OR [DS:ESI+ECX+8],CL
ADC [DS:91111],ESI
OR [DS:ECX+E],CH
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:EDX+E],AH
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ESI],CH
PUSH CS
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ESI+ECX+8],AH
ADC [DS:91111],ESI
OR [DS:ESI+ECX+8],CH
ADC [DS:91111],ESI
OR [DS:ESI+ECX+8],CH
ADC [DS:91111],ESI
OR [DS:EAX],AL
PUSH CS
OR [DS:ECX],DL
POP ES
ADC [DS:EDX],EAX
???
???
???
???
???
???
INC [DWORD DS:EAX+111220]
OR [DS:ECX],EAX
ADD [DS:EAX],CL
CMP AL,E
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ECX+E],CL
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ESI+E],CL
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ESI],BH
PUSH CS
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:EAX+E],DH
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:EDX+E],DH
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:EDI+E],CH
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:EBX+E],AH
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ECX],DH
PUSH CS
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ESI+ECX],BH
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:EDI],CH
PUSH CS
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ECX+E],CL
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ESI+E],CL
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:ESI],BH
PUSH CS
OR [DS:ECX],DL
XOR EAX,91111
OR [DS:EAX],AL
PUSH CS
OR [DS:ECX],DL
ADD ECX,[DS:EAX]
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
AND [DS:ECX],CL
ADC EAX,1B200927
OR AH,[DS:EAX]
OR [DS:EBX],ECX
ADD ECX,[DS:EAX]
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EDI],DL
ADD [DS:EBX],AL
OR [DS:EAX],EAX
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
OR AL,[DS:EBX]
OR [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADC [DS:EDI],AH
ADD [DS:EBX],AL
OR [DS:EAX],EAX
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
OR EAX,803
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],DL
DAA
ADD [DS:EDI],AL
OR EAX,[DS:EDX]
???
???
???
???
???
???
INC [BYTE DS:EAX]
AND [DS:EDX],CL
ADC AH,[DS:EAX]
OR [DS:EBX],EBX
ADD ECX,[DS:EAX]
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:ECX],AL
DAA
OR [DS:EDI],EAX
OR [DS:EDX],EAX
???
???
???
???
???
???
INC [BYTE DS:EAX]
ADD ECX,[DS:EAX]
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EDX],DL
DAA
ADD [DS:EBX],AL
OR [DS:EAX],EAX
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
OR AL,[DS:EBX]
OR [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADC [DS:EDI],AH
ADD [DS:EBX],AL
OR [DS:EAX],EAX
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
OR EAX,803
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],DL
DAA
ADD [DS:EAX],AH
OR [DS:EBX],EBX
ADD ECX,[DS:EAX]
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EDX],AL
DAA
OR [DS:EAX],ESP
OR [DS:EDX],ECX
ADD ECX,[DS:EAX]
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EDI],DL
ADD [DS:EBX],AL
OR [DS:EAX],EAX
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
OR AL,[DS:EBX]
OR [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADC [DS:EDI],AH
ADD [DS:EBX],AL
OR [DS:EAX],EAX
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],AL
OR EAX,803
ADD [DS:EAX],AL
ADD [DS:EAX],AL
ADD [DS:EAX],DL
DAA
ADD [DS:EAX],AH
ADD [DS:EDX],EAX
2007-10-1 20:38
0
游客
登录 | 注册 方可回帖
返回
//