Skip to content

Commit 48d1b12

Browse files
committed
re-add keystone-engine, it's still needed :(
1 parent a1b82a5 commit 48d1b12

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,15 @@ If you run into permission issues, [ensure that your user is in the docker group
114114

115115
# Troubleshooting/FAQ:
116116

117-
All previous common problems have been solved 😎
117+
### Unable to install python dependency `keystone-engine` on rpi3
118+
If you are unable to install `keystone-engine` on a raspberry pi 3, try:
119+
1. Update the GPU RAM to 16MB from `raspi-config`
120+
2. Build and install keystone-engine from source (should take ~15 minutes):
121+
```
122+
git clone https://github.com/keystone-engine/keystone
123+
cd keystone/bindings/python/
124+
python3 -m pip install .
125+
```
118126

119127
# Development
120128
Main stages to developing a feature:

patches/keystone_cache.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
{
2+
"('add.w r2,r1,#0x10',){}": [1, 241, 16, 2],
3+
"('add.w r7,r0,#0x10',){}": [0, 241, 16, 7],
24
"('b 0x1c',){}": [12, 224],
5+
"('b.w #0x801b504', 134280240){}": [12, 240, 104, 184],
6+
"('ite ne; movne.w r4, #0xd2000; moveq.w r4, #0xd1000',){}": [20, 191, 79, 244, 82, 36, 79, 244, 81, 36],
7+
"('mov r0,r5',){}": [40, 70],
8+
"('mov r0,r7',){}": [56, 70],
9+
"('mov r1,r6',){}": [49, 70],
10+
"('mov r2,r7',){}": [58, 70],
11+
"('mov r5,r1',){}": [13, 70],
12+
"('mov r1,r2',){}": [17, 70],
13+
"('mov r7,r0',){}": [7, 70],
314
"('mov.w r1, #0x00000',){}": [79, 240, 0, 1],
415
"('mov.w r2, #45056',){}": [79, 244, 48, 66],
5-
"('mov.w r3, #45056',){}": [79, 244, 48, 67]
16+
"('mov.w r3, #45056',){}": [79, 244, 48, 67],
17+
"('sub sp,#0x10',){}": [132, 176],
18+
"('sub.w r1,r8,#0x10',){}": [168, 241, 16, 1],
19+
"('sub.w r6,r2,#0x10',){}": [162, 241, 16, 6]
620
}

patches/patch.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,14 @@ def twos_compliment(value, bits):
1717

1818

1919
class CachedKeystone:
20-
"""Keystone can be annoying to install; so we just cache the responses for end-users."""
21-
2220
def __init__(self, path="patches/keystone_cache.json"):
2321
self.path = Path(path)
2422

2523
self._ks = None
26-
with suppress(ImportError):
27-
from keystone import KS_ARCH_ARM, KS_MODE_THUMB, Ks
24+
from keystone import KS_ARCH_ARM, KS_MODE_THUMB, Ks
2825

29-
self._ks = Ks(KS_ARCH_ARM, KS_MODE_THUMB)
30-
self._sig = inspect.signature(self._ks.asm)
26+
self._ks = Ks(KS_ARCH_ARM, KS_MODE_THUMB)
27+
self._sig = inspect.signature(self._ks.asm)
3128

3229
self._cache = {}
3330
with suppress(FileNotFoundError):

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ colorama
33
numpy
44
pycryptodome
55
pyelftools
6+
keystone-engine

0 commit comments

Comments
 (0)