Skip to content

Commit

Permalink
Dont depend on system's printf for the r2 scripts (#3070)
Browse files Browse the repository at this point in the history
* Dont depend on system's printf for the r2 scripts

* Update demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/cccrypt.r2

---------

Co-authored-by: pancake <[email protected]>
Co-authored-by: Carlos Holguera <[email protected]>
  • Loading branch information
3 people authored Nov 12, 2024
1 parent 8a886c5 commit 51dbc16
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 58 deletions.
17 changes: 8 additions & 9 deletions demos/ios/MASVS-CRYPTO/MASTG-DEMO-0011/security_keysize.r2
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
!printf "\n\n"
?e;?e

!printf "Uses of SecKeyCreateRandomKey:\n"
?e Uses of SecKeyCreateRandomKey:
afl~SecKeyCreateRandomKey

!printf "\n"
?e

!printf "xrefs to SecKeyCreateRandomKey:\n"
?e xrefs to SecKeyCreateRandomKey:
axt @ 0x1000078ac

!printf "\n"
?e

!printf "Use of reloc.kSecAttrKeySizeInBits as input for SecKeyCreateRandomKey:\n"
?e Use of reloc.kSecAttrKeySizeInBits as input for SecKeyCreateRandomKey:
pd 1 @ sym.func.1000046f8

!printf "...\n"
?e ...

pd 9 @ 0x10000484c

!printf "...\n"
?e ...

pd-- 2 @ 0x1000049a0

12 changes: 6 additions & 6 deletions demos/ios/MASVS-CRYPTO/MASTG-DEMO-0013/sec_hardcoded_rsa.r2
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
e asm.bytes = false
e asm.bytes=false
e scr.color=false
e asm.var=false

!printf "Uses of SecKeyCreateWithData:\n"
?e Uses of SecKeyCreateWithData:
afl~SecKeyCreateWithData

!printf "\n"
?e

!printf "xrefs to SecKeyCreateWithData:\n"
?e xrefs to SecKeyCreateWithData:
axt @ 0x100007904

!printf "\n"
?e

pdf @ sym.func.10000491c > function.asm

px 607 @ 0x1000100c8 > key.asm
px 607 @ 0x1000100c8 > key.asm
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
e asm.bytes = false
e asm.bytes=false
e scr.color=false
e asm.var=false

!printf "Uses of CryptoKit.P256.Signing.PrivateKey:\n"
?e Uses of CryptoKit.P256.Signing.PrivateKey:
afl~CryptoKit.P256.Signing.PrivateKey

!printf "\n"
?e

!printf "xrefs to CryptoKit.P256.Signing.PrivateKey.rawRepresentation:\n"
?e xrefs to CryptoKit.P256.Signing.PrivateKey.rawRepresentation:
axt @ 0x100007388

!printf "\n"
?e

!printf "Use of CryptoKit.P256.Signing.PrivateKey.rawRepresentation:\n"
?e Use of CryptoKit.P256.Signing.PrivateKey.rawRepresentation:

pd-- 9 @ 0x1000048d4

pdf @ sym.func.1000046dc > function.asm

px 32 @ 0x1000100c8 > key.asm
px 32 @ 0x1000100c8 > key.asm
18 changes: 9 additions & 9 deletions demos/ios/MASVS-CRYPTO/MASTG-DEMO-0015/cchash.r2
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
!printf "\n\n"
?e;?e

!printf "Uses of CommonCrypto hash function:\n"
?e Uses of CommonCrypto hash function:
afl~CC_

!printf "\n"
?e

!printf "xrefs to CC_MD5:\n"
?e xrefs to CC_MD5:
axt @ 0x1000071a8

!printf "xrefs to CC_SHA1:\n"
?e xrefs to CC_SHA1:
axt @ 0x1000071b4

!printf "\n"
?e

!printf "Use of MD5:\n"
?e Use of MD5:
pd-- 5 @ 0x1000048c4

!printf "\n"
?e

!printf "Use of SHA1:\n"
?e Use of SHA1:
pd-- 5 @ 0x10000456c
20 changes: 10 additions & 10 deletions demos/ios/MASVS-CRYPTO/MASTG-DEMO-0016/cryptokit_hash.r2
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
!printf "\n\n"
?e;?e

!printf "Uses of CryptoKit.Insecure functions:\n"
?e Uses of CryptoKit.Insecure functions:
afl~Insecure.

!printf "\n"
?e

!printf "xrefs to CryptoKit.Insecure.MD5:\n"
?e xrefs to CryptoKit.Insecure.MD5:
axt @ 0x100007280

!printf "\n"
?e

!printf "xrefs to CryptoKit.Insecure.SHA1:\n"
?e xrefs to CryptoKit.Insecure.SHA1:
axt @ 0x10000728c

!printf "\n"
?e

!printf "Use of MD5:\n"
?e Use of MD5:
pd-- 5 @ 0x1000046d8

!printf "\n"
?e

!printf "Use of SHA1:\n"
?e Use of SHA1:
pd-- 5 @ 0x100004214
12 changes: 6 additions & 6 deletions demos/ios/MASVS-CRYPTO/MASTG-DEMO-0018/cccrypt.r2
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
e asm.bytes = false
e asm.bytes=false
e scr.color=false
e asm.var=false

!printf "Uses of the CCCrypt function:\n"
?e Uses of the CCCrypt function:
afl~CCCrypt

!printf "\n"
?e

!printf "xrefs to CCCrypt:\n"
?e xrefs to CCCrypt:
axt @ 0x1000076c4

!printf "\n"
?e

!printf "Use of CCCrypt:\n"
?e Use of CCCrypt:

# Seek to the function where CCCrypt is called (Replace with the address found from axt output)
pd-- 9 @ 0x1000040e0
Expand Down
21 changes: 10 additions & 11 deletions demos/ios/MASVS-STORAGE/MASTG-DEMO-0019/isExcludedFromBackup.r2
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
e asm.bytes = false
e asm.bytes=false
e scr.color=false
e asm.var=false

!printf "Uses of isExcludedFromBackup:\n"
?e Uses of isExcludedFromBackup:
afl~isExcludedFromBackup

!printf "\n"
?e

!printf "xrefs to isExcludedFromBackup:\n"
?e xrefs to isExcludedFromBackup:
axt @ 0x10000cc28

!printf "\n"
!printf "Use of isExcludedFromBackup:\n"
?e
?e Use of isExcludedFromBackup:

pd-- 5 @ 0x100004594

!printf "\n"
!printf "Search for secret.txt:\n"
?e
?e Search for secret.txt:
/ secret.txt

!printf "\n"
!printf "Use of the string secret.txt:\n"
?e
?e Use of the string secret.txt:
pd-- 5 @ 0x10000443c


pdf @ 0x100004594 > function.asm

0 comments on commit 51dbc16

Please sign in to comment.