Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pushw imm #207

Open
fvrmatteo opened this issue Jun 27, 2016 · 5 comments
Open

pushw imm #207

fvrmatteo opened this issue Jun 27, 2016 · 5 comments

Comments

@fvrmatteo
Copy link
Contributor

Wrong output for: "push word 0x1122". Expected: "66 68 22 11". Kstool output: "68 22 11 00 00".
I then tried with: "pushw 0x1122". Excepted: "66 68 22 11". Kstool output: KS_ERR_ASM_MNEMONICFAIL.

If the mnemonic "pushw" is not going to be supported, I think parsing correctly the size specification, like "word" in "push word 0x1122" is the fix. It all depends on the first byte 0x66.

@aquynh
Copy link
Member

aquynh commented Jun 27, 2016

see related issue #10. it seems the fix for it is just partially correct.

can you send a PR to add your case to x86_issue10.py ?

pushw is an invalid mnemonic

evil-e added a commit to evil-e/keystone that referenced this issue Dec 6, 2016
@Summus-31c04089c3cd80
Copy link

Maybe I'm wrong but the only file modified to "fix" it is the regress test "x86_issue10.py" and it fails.

I have this commit :
commit 95b7212 (HEAD -> master, origin/master, origin/HEAD)

And this is the result of regress.py :

Ran 77 tests in 0.069s
FAILED (failures=7, errors=1)

This is for x86_issue10.py :

FAIL: runTest (main.TestX86)

Traceback (most recent call last):
File "./x86_issue10.py", line 23, in runTest
self.assertEqual(encoding3, [ 0x66, 0x68, 0x34, 0x12 ])
AssertionError: Lists differ: [104, 52, 18, 0, 0] != [102, 104, 52, 18]

First differing element 0:
104
102

First list contains 1 additional elements.
First extra element 4:
0

-[104, 52, 18, 0, 0]
+[102, 104, 52, 18]

@Summus-31c04089c3cd80
Copy link

Up

@Recurse-blip
Copy link

I've also encountered the issue on my side.

I'm using the latest keystone engine bindings in a python script to compile 32 bit assembly.

The issue can also be reproduced with this keystone engine online demo :
https://alexaltea.github.io/keystone.js/

For example compiling the following assembly :
push word 0x1234;

gives the following ouput :
68 34 12 00 00

but it should be :
66 68 34 12

Let me know if you guys need help for this issue.

Best regards

@xirantian
Copy link

I discovered this issue again while running my code on version 0.9.2. Has the problem been addressed in #578, and is it planned to be resolved in which version? Looking forward to your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants