|
1 using System; |
|
2 using System.Collections.Generic; |
|
3 using System.Text; |
|
4 using System.IO; |
|
5 using SymbianUtils; |
|
6 using SymbianUtils.Tracer; |
|
7 using SymbianImageLib.E32Image; |
|
8 using SymbianImageLib.ROFS.Image; |
|
9 using SymbianImageLib.ROFS.File; |
|
10 |
|
11 namespace ROFSTest |
|
12 { |
|
13 class Program : ITracer |
|
14 { |
|
15 static void Main( string[] args ) |
|
16 { |
|
17 Program p = new Program(); |
|
18 } |
|
19 |
|
20 #region Constructor |
|
21 public Program() |
|
22 { |
|
23 SymbianE32Image memSpyDeflated = new SymbianE32Image( new FileInfo( @"C:\Tool Demo Files\2. Crash Data\IvaloImage\MemSpyDriverClient.epoc32_include.dll" ), this ); |
|
24 memSpyDeflated.Decompress( TSynchronicity.ESynchronous ); |
|
25 byte[] deflateCode = memSpyDeflated.GetAllData(); |
|
26 |
|
27 using ( FileStream stream = new FileStream( @"C:\Tool Demo Files\2. Crash Data\IvaloImage\ivalo\CoreImage\sp_rnd_image.rofs1.img", FileMode.Open ) ) |
|
28 { |
|
29 SymbianImageROFS rofsImage = new SymbianImageROFS( this, stream ); |
|
30 |
|
31 ISymbianFileROFS trkRofsFile = rofsImage[ @"\Trk.ini" ]; |
|
32 System.Diagnostics.Debug.Assert( trkRofsFile != null ); |
|
33 byte[] trkData = trkRofsFile.GetAllData(); |
|
34 string trkIniText = SymbianUtils.Strings.StringParsingUtils.BytesToString( trkData ); |
|
35 |
|
36 ISymbianFileROFS memSpyRofsFile = rofsImage[ @"\Sys\Bin\MemSpyDriverClient.dll" ]; |
|
37 System.Diagnostics.Debug.Assert( memSpyRofsFile != null ); |
|
38 memSpyRofsFile.PrepareContent( TSynchronicity.ESynchronous ); |
|
39 |
|
40 byte[] bytePairCode = memSpyRofsFile.GetAllData(); |
|
41 |
|
42 System.Diagnostics.Debug.Assert( bytePairCode.Length == deflateCode.Length ); |
|
43 for ( int i = 0; i < bytePairCode.Length; i++ ) |
|
44 { |
|
45 System.Diagnostics.Debug.Assert( bytePairCode[ i ] == deflateCode[ i ] ); |
|
46 } |
|
47 } |
|
48 } |
|
49 #endregion |
|
50 |
|
51 #region ITracer Members |
|
52 public void Trace( string aMessage ) |
|
53 { |
|
54 System.Diagnostics.Debug.WriteLine( aMessage ); |
|
55 System.Console.WriteLine( aMessage ); |
|
56 } |
|
57 |
|
58 public void Trace( string aFormat, params object[] aParams ) |
|
59 { |
|
60 string text = string.Format( aFormat, aParams ); |
|
61 Trace( text ); |
|
62 } |
|
63 #endregion |
|
64 } |
|
65 } |