-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.htm
57 lines (55 loc) · 2.18 KB
/
test.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html>
<head>
<title>jsx86 test</title>
<script type="text/javascript" src="core.js"></script>
<script type="text/javascript" src="Stream.js"></script>
<script type="text/javascript" src="Memory.js"></script>
<script type="text/javascript" src="StringMemory.js"></script>
<script type="text/javascript" src="MemoryStream.js"></script>
<script type="text/javascript" src="Instruction.js"></script>
<script type="text/javascript" src="instructions/base.js"></script>
<script type="text/javascript">
var data = [];
data[1] = [window.atob('ZonY'),0]; //mov eax,ebx
data[2] = [window.atob('Z4sD'),0]; //mov ax,[ebx]
data[3] = [window.atob('Z2aLAw=='),0]; //mov eax,[ebx]
data[4] = [window.atob('Z2aLBJM='),0]; //mov eax,[edx*4+ebx]
data[5] = [window.atob('Z2aJBJM='),0]; //mov [edx*4+ebx],eax
data[6] = [window.atob('iOA='),0]; //mov al,ah
data[7] = [window.atob('jMg='),0]; //mov ax,cs
data[8] = [window.atob('Z2aNBJM='),0]; //lea eax,[edx*4+ebx]
data[9] = [window.atob('sCo='),0]; //mov al,2Ah
data[10] = [window.atob('oCoA'),0]; //mov al,[2Ah]
data[11] = [window.atob('oSoA'),0]; //mov ax,[2Ah]
data[12] = [window.atob('ZqEqAA=='),0]; //mov eax,[2Ah]
data[13] = [window.atob('ZrhyebdP'),0]; //mov eax,1337424242
data[14] = [window.atob('Z2ahcnm3Tw=='),0]; //mov eax,[1337424242]
data[15] = [window.atob('Z2bHACoAAAA='),0]; //mov DWORD [eax],42
data[16] = [window.atob('Z8YAKg=='),0]; //mov BYTE [eax],42
data[17] = [window.atob('kA=='),0]; //nop
data[18] = [window.atob('Dx8FAAAAAA=='),1]; //nop DWORD [0]
data[19] = [window.atob('Dw0FAAAAAA=='),1]; //nop DWORD [0] (alternative encoding)
function testAddGen(a,b,c,len){
return jsx86.debug._addTrans({op1:[a,function (v){return 'r = '+v+';'}],op2:[b],opLen:len},c)
}
function testAdd(a,b,carry,len){
var r;
var c = {eflags:{cf:0}};
var u = jsx86.utils;
eval(testAddGen(a,b,carry,len));
return [r,c.eflags]
}
</script>
</head>
<body>
<script type="text/javascript">
document.write('<pre>');
for (i in data)
{
var ins = jsx86.instruction.decodeInstruction(new MemoryStream(new StringMemory(data[i][0])),!!data[i][1]);
document.write(i+': '+ins.info.translator(ins)+'\n');
}
document.write('</pre>');
</script>
</body>