-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated AsmParser deconstructor to restore saved diagnostic handlers …
…back to srcmgr (#419)
- Loading branch information
1 parent
34fcbe4
commit c4de98f
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import binascii | ||
|
||
from keystone import Ks, KS_ARCH_ARM, KS_MODE_ARM | ||
|
||
ks = Ks(KS_ARCH_ARM, KS_MODE_ARM) | ||
|
||
assembly_text = \ | ||
""" | ||
sub sp, sp, #8 | ||
push {sp, lr} | ||
bl #0xc6ab8 | ||
ldr lr, [sp, #4] | ||
add sp, sp, #8 | ||
pop {r2, r3} | ||
bx lr | ||
""" | ||
|
||
for i in range(100): | ||
output = ks.asm(assembly_text, 0x902c4, as_bytes=True) | ||
# print("{}: {}: {}".format(i, assembly_text, output)) | ||
output_2 = ks.asm("b #0", 0x4, as_bytes=True) | ||
# print("{}: {}: {}".format(i, "b #0", output_2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
for i in $(seq 1 100) | ||
do | ||
python test_diag_printer.py | ||
|
||
if [ $? -ne 0 ] | ||
then | ||
echo "Diagnostic Handler test failed" | ||
exit | ||
fi | ||
done | ||
echo "Diagnostic Handler test pass" |