From 34bf44069112eebf3bef5ebe38b7d00149166bf6 Mon Sep 17 00:00:00 2001 From: "alterwain@protonmail.com" Date: Sat, 8 Feb 2025 03:53:16 +0300 Subject: [PATCH] modified: outdb modified: src/main.rs --- outdb | Bin 2592 -> 2592 bytes src/main.rs | 17 +++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/outdb b/outdb index 12eae6bcf0378c8892d3cfaee27f24b805d028b4..c070eec672ac9a2c58bbe3980209013ed6d03d61 100644 GIT binary patch delta 332 zcmZ1=vOr{l1V_5<0sAc{=DJT*(BSZ8{OamoSr@f2fQOMWZE`H5{lo-`$y*q;85t)( zV3cEIn*5(JmoaN|E)y>!uOWjegB3#*Ll{FiL)7GUW?LS%!ZVMjon75^P~*we$rqR% zSUngR7tZ;R#aCLC8hj1}bHn=)An7T?1cc{q^ hfwB;L1vz2rVmV>zCIZDEvUfS1Cl|1@z+6U|NdQHuOhNzv delta 343 zcmZ1=vOr{l1c(2Q8D^apS5hV_XmGIK+I8gi;j}9o19%u2Whcin+D~4<&ceaSz`(HD zzv%Jg6^!N+jRhxvVB}+Docy0Lmr-VOE)y>!uQ7uKgB3#*gBL?6L*V3gW?PqwcUBo7OJi~(i#}9rDqQR#TuhV|u8tM14lec(E+)zb sSH}iZSIOZHHTfY>7Gkd;Crn)|CrsT$pcq8 Vec { } let h = bincode::serialize(&ChunkHeader { chunk_type: ChunkType::StringTypes.into(), - end_of_chunk: 60, - children_count: 60 + (4 * xpl.v.len() as u32) + end_of_chunk: 72, + children_count: 72 + (4 * xpl.v.len() as u32) }).unwrap(); b = [h, b, v].concat(); return b; @@ -487,8 +487,8 @@ fn to_bytes(xdb: XDatabase) -> Vec { } let h = bincode::serialize(&ChunkHeader { chunk_type: ChunkType::StringTypes.into(), - end_of_chunk: 28, - children_count: 28 + (12 * xjump.v.len() as u32) + end_of_chunk: 40, + children_count: 40 + (12 * xjump.v.len() as u32) }).unwrap(); b = [h, b, v].concat(); return b; @@ -557,15 +557,16 @@ fn main() { .filter(None, LevelFilter::Info) .init(); - let mut f = File::open("D:\\Documents\\iTunes\\iTunesDB").unwrap(); // D:\\Documents\\iTunes\\iTunesDB + // /Users/michael/Documents/ipod/iTunes/iTunesDB + let mut f = File::open("outdb").unwrap(); // D:\\Documents\\iTunes\\iTunesDB let mut buf = Vec::new(); match f.read_to_end(&mut buf) { Ok(n) => { let data = &buf[..n]; let xdb = parse_bytes(data); - info!("XDB: {:?}", xdb); - let mut op = File::create("outdb").unwrap(); - info!("Write res: {:?}", op.write(&to_bytes(xdb))); + //info!("XDB: {:?}", xdb); + //let mut op = File::create("outdb").unwrap(); + //info!("Write res: {:?}", op.write(&to_bytes(xdb))); }, Err(e) => { error!("Error: {}",e);