Minimal version of the LTE downgrade analyzer

This also renames the lte_parser crate to telcom_parser, since it'll
handle any 2G or 3G parsing going forward.
This commit is contained in:
Will Greenberg
2024-02-08 15:38:36 -08:00
parent d570ad3cb1
commit 5d7caba1a6
19 changed files with 150 additions and 52 deletions

View File

@@ -0,0 +1,17 @@
use telcom_parser::lte_rrc::BCCH_DL_SCH_Message;
use asn1_codecs::{uper::UperCodec, PerCodecData};
fn hex_to_bin(hex: &str) -> Vec<u8> {
(0..hex.len())
.step_by(2)
.map(|i| u8::from_str_radix(&hex[i..i+2], 16).unwrap())
.collect()
}
#[test]
fn test() {
let data = hex_to_bin("484c469010600018fd1a9207e22103108ac21bdc09802292cdd20000");
let mut asn_data = PerCodecData::from_slice_uper(&data);
let sib1 = BCCH_DL_SCH_Message::uper_decode(&mut asn_data);
dbg!(&sib1);
}