Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Keystone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Third Party Mirrors
Keystone
Commits
173ba956
Commit
173ba956
authored
8 years ago
by
Nguyen Anh Quynh
Browse files
Options
Downloads
Patches
Plain Diff
regress: add x86_issue9.py
parent
270fa89e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
suite/regress/x86_issue9.py
+31
-0
31 additions, 0 deletions
suite/regress/x86_issue9.py
with
31 additions
and
0 deletions
suite/regress/x86_issue9.py
0 → 100755
+
31
−
0
View file @
173ba956
#!/usr/bin/python
# Tests if the SS segment override prefix is not explicitly produced when unnecessary
# Github issue: #9
# Author: Duncan (mrexodia)
from
keystone
import
*
import
regress
class
TestX86
(
regress
.
RegressTest
):
def
runTest
(
self
):
# Initialize Keystone engine
ks
=
Ks
(
KS_ARCH_X86
,
KS_MODE_32
)
encoding
,
_
=
ks
.
asm
(
b
"
MOVZX ECX,WORD PTR SS:[EAX*2+EBP-0x68]
"
)
self
.
assertEqual
(
encoding
,
[
0x0F
,
0xB7
,
0x4C
,
0x45
,
0x98
])
encoding
,
_
=
ks
.
asm
(
b
"
AND DWORD PTR DS:[EAX+0x70],0xFFFFFFFD
"
)
self
.
assertEqual
(
encoding
,
[
0x83
,
0x60
,
0x70
,
0xFD
])
encoding
,
_
=
ks
.
asm
(
b
"
MOV DWORD PTR [EBP-0x218],0x2080000
"
)
self
.
assertEqual
(
encoding
,
[
0xC7
,
0x85
,
0xE8
,
0xFD
,
0xFF
,
0xFF
,
0x00
,
0x00
,
0x08
,
0x02
])
encoding
,
_
=
ks
.
asm
(
b
"
MOV DWORD PTR [ESP-0x218],0x2080000
"
)
self
.
assertEqual
(
encoding
,
[
0xC7
,
0x84
,
0x24
,
0xE8
,
0xFD
,
0xFF
,
0xFF
,
0x00
,
0x00
,
0x08
,
0x02
])
if
__name__
==
'
__main__
'
:
regress
.
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment