We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76f0ce3 commit 19e80e5Copy full SHA for 19e80e5
android/oat2dex.sh
@@ -7,14 +7,14 @@ if [ -z "${OAT}" ]; then
7
echo "Usage: $0 <file.oat>"
8
exit 0
9
fi
10
-HIT=$(r2 -q -c '/ dex\n035' "${OAT}" 2>/dev/null |grep hit0_0 |awk '{print $1}')
+HIT=$(r2 -n -q -c '/ dex\n035' "${OAT}" 2>/dev/null |grep hit0_0 |awk '{print $1}')
11
if [ -z "${HIT}" ]; then
12
echo "[-] ERROR: Can't find dex header"
13
exit 1
14
else
15
echo "[+] DEX header found at address: ${HIT}"
16
17
-SIZE=$(r2 -e scr.color=false -q -c "px 4 @$HIT+32" ${OAT} 2>/dev/null |tail -n 1 |awk '{print $2 $3}' |sed -e "s/^/0x/" |rax2 -e)
+SIZE=$(r2 -n -q -c "pf i @${HIT}+32 ~[2]" "${OAT}" 2>/dev/null)
18
echo "[+] Dex file size: ${SIZE} bytes"
19
r2 -q -c "pr ${SIZE} @${HIT} > ${OAT}.dex" "${OAT}" 2>/dev/null
20
if [ $? -eq 0 ]; then
0 commit comments