diff --git a/outdb b/outdb index 12eae6b..c070eec 100644 Binary files a/outdb and b/outdb differ diff --git a/src/main.rs b/src/main.rs index b196bf3..ee06ae5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -473,8 +473,8 @@ fn to_bytes(xdb: XDatabase) -> 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);