-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hooks the AES crypto function, which converts an Enhanced Privacy key…
… into a 59-bit XOR keystream.
- Loading branch information
1 parent
5dd5842
commit c18f6dd
Showing
5 changed files
with
45 additions
and
1 deletion.
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
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,31 @@ | ||
|
||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#include "md380.h" | ||
#include "printf.h" | ||
#include "dmesg.h" | ||
#include "version.h" | ||
#include "tooldfu.h" | ||
#include "config.h" | ||
#include "gfx.h" | ||
|
||
|
||
/* This hook intercepts calls to aes_cipher(), which is used to turn | ||
the 128-bit Enhanced Privacy Key into a 59-bit sequence that gets | ||
XORed with the audio before transmission and after reception. | ||
By changing the output to match Motorola's Basic Privacy, we can | ||
patch the MD380 to be compatible with a Motorola network. | ||
*/ | ||
|
||
int *aes_cipher_hook(int *pkt){ | ||
int *res; | ||
printf("aes_cipher(0x%08x);\nIN :",pkt); | ||
printhex((char*) pkt,16); //Print the Enhanced Privacy Key | ||
printf("\nOUT :"); | ||
res=aes_cipher(pkt); | ||
printhex((char*) res,16); //Print the keystream it produces. (First 59 bits are XOR'ed with the audio.) | ||
printf("\n"); | ||
return res; | ||
} |
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