├── .gitattributes ├── .gitignore ├── Android Forensic Toolkit-SetupFiles └── Android Forensic Toolkit.msi ├── Android Forensic Toolkit-cache ├── cacheIndex.txt └── part1 │ ├── disk1.cab │ └── output-info.ini ├── Android Forensic Toolkit.aip ├── README.txt ├── build.xml ├── manifest.mf ├── nbproject ├── build-impl.xml ├── genfiles.properties ├── private │ ├── config.properties │ ├── private.properties │ ├── private.xml │ └── profiler │ │ └── configurations.xml ├── project.properties └── project.xml └── src ├── JHexEditor ├── JHexEditor.java ├── JHexEditorASCII.java ├── JHexEditorHEX.java └── Test.java ├── android └── forensic │ └── toolkit │ ├── CustomCellRenderer.java │ ├── FAT12.java │ ├── FAT16.java │ ├── FAT32.java │ ├── FileList.java │ ├── FileRecord.java │ ├── MFT.java │ ├── MainJFrame.form │ ├── MainJFrame.java │ ├── NTFS.java │ ├── Utils.java │ ├── refresh.png │ └── yaffs_obj_hdr.java ├── cache └── res │ ├── Thumbs.db │ ├── deleted_file.png │ ├── deleted_folder.png │ ├── deleted_hidden_file.png │ ├── deleted_hidden_folder.png │ ├── file.png │ ├── folder.png │ ├── hidden_file.png │ └── hidden_folder.png └── res ├── Thumbs.db ├── cache_template.html ├── camera.ico ├── deleted_file.ico ├── deleted_file.png ├── deleted_file2.ico ├── deleted_file2.png ├── deleted_folder.ico ├── deleted_folder.png ├── deleted_hidden_file.png ├── deleted_hidden_folder.png ├── disk.ico ├── file.ico ├── file.png ├── folder.ico ├── folder.png ├── folder2.ico ├── help.ico ├── hidden_file.png ├── hidden_folder.png ├── mem_card.ico ├── mobile.ico ├── off.ico ├── ram.ico └── stop.ico /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /dist/ 2 | /build/ 3 | /src/cache/ -------------------------------------------------------------------------------- /Android Forensic Toolkit-SetupFiles/Android Forensic Toolkit.msi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ResleyR/Android_Forensic_Toolkit/e48e27083f4454d21b70e1fb1c49a9e850a1650a/Android Forensic Toolkit-SetupFiles/Android Forensic Toolkit.msi -------------------------------------------------------------------------------- /Android Forensic Toolkit-cache/cacheIndex.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ResleyR/Android_Forensic_Toolkit/e48e27083f4454d21b70e1fb1c49a9e850a1650a/Android Forensic Toolkit-cache/cacheIndex.txt -------------------------------------------------------------------------------- /Android Forensic Toolkit-cache/part1/disk1.cab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ResleyR/Android_Forensic_Toolkit/e48e27083f4454d21b70e1fb1c49a9e850a1650a/Android Forensic Toolkit-cache/part1/disk1.cab -------------------------------------------------------------------------------- /Android Forensic Toolkit-cache/part1/output-info.ini: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ResleyR/Android_Forensic_Toolkit/e48e27083f4454d21b70e1fb1c49a9e850a1650a/Android Forensic Toolkit-cache/part1/output-info.ini -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | Android Forensic Toolkit - Version 1.0 18/12/2013 2 | 3 | --------------------- 4 | GENERAL USAGE NOTES 5 | --------------------- 6 | All operations in Android Forensic Toolkit (AFTK, henceforth the software) can be done in the following steps. 7 | - Connect the device/drive and refresh drive list in the software. 8 | - Select desired drive from the drop down menu. 9 | - Click the button for the desired operation. 10 | - Sit back and relax as the software does the work. 11 | 12 | Clone Disk 13 | This option allows you to make an exact replica of a disk/drive onto another disk/drive. There must be enough space on the destination disk/drive for cloning to take place. 14 | 15 | Compute Hash 16 | This option allows you to choose from a variety of options to compute the hash value of the entire disk/drive. This value can also be compared with the value stored in another file. 17 | 18 | Get Details 19 | This option lets you view and recover all the deleted files that still exist on the disk/drive. It also displays additional details about the drive and hex data of important parts of the drive. 20 | 21 | ------------- 22 | INSTALLATION 23 | ------------- 24 | This software requires the Java Runtime Environment (JRE) to be installed on the machine in order to run. Although the software package comes with a setup for JRE, you may wish to download and install it separately from http://java.com/en/download/index.jsp 25 | Additionally in order access certain devices, such as Android phones and Tablets, it is necessary to have the required drivers present on the system. The software will install necessary drivers to your System32\Drivers folder and/or to a \Drivers folder in the installation folder. 26 | The software will always need to run as administrator in order to properly access the system files. 27 | 28 | -------------------- 29 | SYSTEM REQUIREMENTS 30 | -------------------- 31 | - Windows XP or above 32 | - Java Runtime Environment 7 or above 33 | - 1 GHz Processor or better 34 | - 32 MB Hard disk space 35 | 36 | -------------------- 37 | CONTACT INFORMATION 38 | -------------------- 39 | Resley Rodrigues 40 | resley.rodrigues@yahoo.com 41 | +91 976-525-4154 42 | On behalf of Intelligent Quotient Security Systems 43 | -------------------------------------------------------------------------------- /build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Builds, tests, and runs the project Android_Forensic_Toolkit. 12 | 13 | 74 | 75 | -------------------------------------------------------------------------------- /manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | X-COMMENT: Main-Class will be added automatically by build 3 | 4 | -------------------------------------------------------------------------------- /nbproject/genfiles.properties: -------------------------------------------------------------------------------- 1 | build.xml.data.CRC32=975e57a0 2 | build.xml.script.CRC32=0851b116 3 | build.xml.stylesheet.CRC32=28e38971@1.56.1.46 4 | # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. 5 | # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. 6 | nbproject/build-impl.xml.data.CRC32=975e57a0 7 | nbproject/build-impl.xml.script.CRC32=7a58791d 8 | nbproject/build-impl.xml.stylesheet.CRC32=c6d2a60f@1.56.1.46 9 | -------------------------------------------------------------------------------- /nbproject/private/config.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ResleyR/Android_Forensic_Toolkit/e48e27083f4454d21b70e1fb1c49a9e850a1650a/nbproject/private/config.properties -------------------------------------------------------------------------------- /nbproject/private/private.properties: -------------------------------------------------------------------------------- 1 | compile.on.save=true 2 | do.depend=true 3 | do.jar=true 4 | javac.debug=true 5 | javadoc.preview=true 6 | user.properties.file=C:\\Users\\Resley\\AppData\\Roaming\\NetBeans\\7.3.1\\build.properties 7 | -------------------------------------------------------------------------------- /nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /nbproject/private/profiler/configurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1000 5 | false 6 | profiler.simple.filter 7 | false 8 | 9 | 64 10 | true 11 | 12 | 10 13 | true 14 | 0 15 | false 16 | true 17 | 1 18 | false 19 | false 20 | false 21 | profiler.simple.filter 22 | 32 23 | false 24 | 1 25 | true 26 | 1 27 | 10 28 | 1 29 | true 30 | Analyze Memory 31 | false 32 | 10 33 | 1 34 | true 35 | 10 36 | 0 37 | profiler.simple.filter 38 | 0 39 | false 40 | true 41 | 42 | 1 43 | 44 | true 45 | 46 | 47 | false 48 | 10 49 | false 50 | true 51 | false 52 | false 53 | 32 54 | Quick filter... 55 | 0 56 | false 57 | 0 58 | 59 | 10 60 | 0 61 | true 62 | true 63 | 64 | true 65 | 10 66 | 67 | 1000 68 | 0 69 | profiler.simple.filter 70 | false 71 | Analyze Performance 72 | 73 | 1 74 | 2 75 | 76 | false 77 | 0 78 | profiler.simple.filter 79 | Quick filter... 80 | false 81 | true 82 | 0 83 | true 84 | 85 | 2 86 | 87 | 32 88 | 0 89 | false 90 | Profile only project classes 91 | 0 92 | 0 93 | true 94 | profiler.simple.filter 95 | 1 96 | 10 97 | false 98 | 10 99 | false 100 | false 101 | true 102 | false 103 | false 104 | 0 105 | Quick filter... 106 | false 107 | 108 | Monitor Application 109 | 128 110 | 1000 111 | true 112 | false 113 | 114 | -------------------------------------------------------------------------------- /nbproject/project.properties: -------------------------------------------------------------------------------- 1 | annotation.processing.enabled=true 2 | annotation.processing.enabled.in.editor=false 3 | annotation.processing.processors.list= 4 | annotation.processing.run.all.processors=true 5 | annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output 6 | application.title=Android Forensic Toolkit 7 | application.vendor=Resley Rodrigues 8 | build.classes.dir=${build.dir}/classes 9 | build.classes.excludes=**/*.java,**/*.form 10 | # This directory is removed when the project is cleaned: 11 | build.dir=build 12 | build.generated.dir=${build.dir}/generated 13 | build.generated.sources.dir=${build.dir}/generated-sources 14 | # Only compile against the classpath explicitly listed here: 15 | build.sysclasspath=ignore 16 | build.test.classes.dir=${build.dir}/test/classes 17 | build.test.results.dir=${build.dir}/test/results 18 | # Uncomment to specify the preferred debugger connection transport: 19 | #debug.transport=dt_socket 20 | debug.classpath=\ 21 | ${run.classpath} 22 | debug.test.classpath=\ 23 | ${run.test.classpath} 24 | # This directory is removed when the project is cleaned: 25 | dist.dir=dist 26 | dist.jar=${dist.dir}/Android_Forensic_Toolkit.jar 27 | dist.javadoc.dir=${dist.dir}/javadoc 28 | endorsed.classpath= 29 | excludes= 30 | includes=** 31 | jar.archive.disabled=${jnlp.enabled} 32 | jar.compress=false 33 | jar.index=${jnlp.enabled} 34 | javac.classpath= 35 | # Space-separated list of extra javac options 36 | javac.compilerargs= 37 | javac.deprecation=true 38 | javac.processorpath=\ 39 | ${javac.classpath} 40 | javac.source=1.7 41 | javac.target=1.7 42 | javac.test.classpath=\ 43 | ${javac.classpath}:\ 44 | ${build.classes.dir} 45 | javac.test.processorpath=\ 46 | ${javac.test.classpath} 47 | javadoc.additionalparam= 48 | javadoc.author=false 49 | javadoc.encoding=${source.encoding} 50 | javadoc.noindex=false 51 | javadoc.nonavbar=false 52 | javadoc.notree=false 53 | javadoc.private=false 54 | javadoc.splitindex=true 55 | javadoc.use=true 56 | javadoc.version=false 57 | javadoc.windowtitle= 58 | jnlp.codebase.type=no.codebase 59 | jnlp.descriptor=application 60 | jnlp.enabled=false 61 | jnlp.mixed.code=default 62 | jnlp.offline-allowed=false 63 | jnlp.signed=false 64 | jnlp.signing= 65 | jnlp.signing.alias= 66 | jnlp.signing.keystore= 67 | main.class=android.forensic.toolkit.MainJFrame 68 | manifest.file=manifest.mf 69 | meta.inf.dir=${src.dir}/META-INF 70 | mkdist.disabled=false 71 | platform.active=default_platform 72 | run.classpath=\ 73 | ${javac.classpath}:\ 74 | ${build.classes.dir} 75 | # Space-separated list of JVM arguments used when running the project. 76 | # You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. 77 | # To set system properties for unit tests define test-sys-prop.name=value: 78 | run.jvmargs= 79 | run.test.classpath=\ 80 | ${javac.test.classpath}:\ 81 | ${build.test.classes.dir} 82 | source.encoding=UTF-8 83 | src.dir=src 84 | test.src.dir=test 85 | -------------------------------------------------------------------------------- /nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.java.j2seproject 4 | 5 | 6 | Android_Forensic_Toolkit 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/JHexEditor/JHexEditor.java: -------------------------------------------------------------------------------- 1 | package JHexEditor; 2 | 3 | import javax.swing.*; 4 | import java.awt.*; 5 | import java.awt.event.*; 6 | 7 | /** 8 | * Created by IntelliJ IDEA. 9 | * User: laullon 10 | * Date: 08-abr-2003 11 | * Time: 13:21:09 12 | */ 13 | public class JHexEditor extends JPanel implements FocusListener,AdjustmentListener,MouseWheelListener 14 | { 15 | byte[] buff; 16 | public int cursor; 17 | protected static Font font=new Font("Monospaced",0,12); 18 | protected int border=2; 19 | public boolean DEBUG=false; 20 | private JPanel panel; 21 | private JScrollBar sb; 22 | private int inicio=0; 23 | private int lineas=10; 24 | private int address = 0x000000; 25 | 26 | public JHexEditor(byte[] buff, int a) 27 | { 28 | super(); 29 | this.buff=buff; 30 | address = a; 31 | this.addMouseWheelListener(this); 32 | 33 | sb=new JScrollBar(JScrollBar.VERTICAL); 34 | sb.addAdjustmentListener(this); 35 | sb.setMinimum(0); 36 | sb.setMaximum(buff.length/getLineas()); 37 | 38 | JPanel p1,p2,p3; 39 | //centro 40 | p1=new JPanel(new BorderLayout(1,1)); 41 | p1.add(new JHexEditorHEX(this),BorderLayout.CENTER); 42 | p1.add(new Columnas(),BorderLayout.NORTH); 43 | 44 | // izq. 45 | p2=new JPanel(new BorderLayout(1,1)); 46 | p2.add(new Filas(),BorderLayout.CENTER); 47 | p2.add(new Caja(),BorderLayout.NORTH); 48 | 49 | // der 50 | p3=new JPanel(new BorderLayout(1,1)); 51 | p3.add(sb,BorderLayout.EAST); 52 | p3.add(new JHexEditorASCII(this),BorderLayout.CENTER); 53 | p3.add(new Caja(),BorderLayout.NORTH); 54 | 55 | panel=new JPanel(); 56 | panel.setLayout(new BorderLayout(1,1)); 57 | panel.add(p1,BorderLayout.CENTER); 58 | panel.add(p2,BorderLayout.WEST); 59 | panel.add(p3,BorderLayout.EAST); 60 | 61 | this.setLayout(new BorderLayout(1,1)); 62 | this.add(panel,BorderLayout.CENTER); 63 | } 64 | 65 | public void paint(Graphics g) 66 | { 67 | FontMetrics fn=getFontMetrics(font); 68 | Rectangle rec=this.getBounds(); 69 | lineas=(rec.height/fn.getHeight())-1; 70 | int n=(buff.length/16)-1; 71 | if(lineas>n) { lineas=n; inicio=0; } 72 | 73 | sb.setValues(getInicio(),+getLineas(),0,buff.length/16); 74 | sb.setValueIsAdjusting(true); 75 | super.paint(g); 76 | } 77 | 78 | protected void actualizaCursor() 79 | { 80 | int n=(cursor/16); 81 | 82 | System.out.print("- "+inicio+"<"+n+"<"+(lineas+inicio)+"("+lineas+")"); 83 | 84 | if(n=inicio+lineas) inicio=n-(lineas-1); 86 | 87 | System.out.println(" - "+inicio+"<"+n+"<"+(lineas+inicio)+"("+lineas+")"); 88 | 89 | repaint(); 90 | } 91 | 92 | protected int getInicio() 93 | { 94 | return inicio; 95 | } 96 | 97 | protected int getLineas() 98 | { 99 | return lineas; 100 | } 101 | 102 | protected void fondo(Graphics g,int x,int y,int s) 103 | { 104 | FontMetrics fn=getFontMetrics(font); 105 | g.fillRect(((fn.stringWidth(" ")+1)*x)+border,(fn.getHeight()*y)+border,((fn.stringWidth(" ")+1)*s),fn.getHeight()+1); 106 | } 107 | 108 | protected void cuadro(Graphics g,int x,int y,int s) 109 | { 110 | FontMetrics fn=getFontMetrics(font); 111 | g.drawRect(((fn.stringWidth(" ")+1)*x)+border,(fn.getHeight()*y)+border,((fn.stringWidth(" ")+1)*s),fn.getHeight()+1); 112 | } 113 | 114 | protected void printString(Graphics g,String s,int x,int y) 115 | { 116 | FontMetrics fn=getFontMetrics(font); 117 | g.drawString(s,((fn.stringWidth(" ")+1)*x)+border,((fn.getHeight()*(y+1))-fn.getMaxDescent())+border); 118 | } 119 | 120 | public void focusGained(FocusEvent e) 121 | { 122 | this.repaint(); 123 | } 124 | 125 | public void focusLost(FocusEvent e) 126 | { 127 | this.repaint(); 128 | } 129 | 130 | public void adjustmentValueChanged(AdjustmentEvent e) 131 | { 132 | inicio=e.getValue(); 133 | if(inicio<0) inicio=0; 134 | repaint(); 135 | } 136 | 137 | public void mouseWheelMoved(MouseWheelEvent e) 138 | { 139 | inicio+=(e.getUnitsToScroll()); 140 | if((inicio+lineas)>=buff.length/16) inicio=(buff.length/16)-lineas; 141 | if(inicio<0) inicio=0; 142 | repaint(); 143 | } 144 | 145 | public void keyPressed(KeyEvent e) 146 | { 147 | switch(e.getKeyCode()) 148 | { 149 | case 33: // rep 150 | if(cursor>=(16*lineas)) cursor-=(16*lineas); 151 | actualizaCursor(); 152 | break; 153 | case 34: // fin 154 | if(cursor<(buff.length-(16*lineas))) cursor+=(16*lineas); 155 | actualizaCursor(); 156 | break; 157 | case 35: // fin 158 | cursor=buff.length-1; 159 | actualizaCursor(); 160 | break; 161 | case 36: // ini 162 | cursor=0; 163 | actualizaCursor(); 164 | break; 165 | case 37: // <-- 166 | if(cursor!=0) cursor--; 167 | actualizaCursor(); 168 | break; 169 | case 38: // <-- 170 | if(cursor>15) cursor-=16; 171 | actualizaCursor(); 172 | break; 173 | case 39: // --> 174 | if(cursor!=(buff.length-1)) cursor++; 175 | actualizaCursor(); 176 | break; 177 | case 40: // --> 178 | if(cursor<(buff.length-16)) cursor+=16; 179 | actualizaCursor(); 180 | break; 181 | } 182 | } 183 | 184 | private class Columnas extends JPanel 185 | { 186 | public Columnas() 187 | { 188 | this.setLayout(new BorderLayout(1,1)); 189 | } 190 | public Dimension getPreferredSize() 191 | { 192 | return getMinimumSize(); 193 | } 194 | 195 | public Dimension getMinimumSize() 196 | { 197 | Dimension d=new Dimension(); 198 | FontMetrics fn=getFontMetrics(font); 199 | int h=fn.getHeight(); 200 | int nl=1; 201 | d.setSize(((fn.stringWidth(" ")+1)*+((16*3)-1))+(border*2)+1,h*nl+(border*2)+1); 202 | return d; 203 | } 204 | 205 | public void paint(Graphics g) 206 | { 207 | Dimension d=getMinimumSize(); 208 | g.setColor(Color.white); 209 | g.fillRect(0,0,d.width,d.height); 210 | g.setColor(Color.black); 211 | g.setFont(font); 212 | 213 | for(int n=0;n<16;n++) 214 | { 215 | if(n==(cursor%16)) cuadro(g,n*3,0,2); 216 | String s="00"+Integer.toHexString(n); 217 | s=s.substring(s.length()-2); 218 | printString(g,s,n*3,0); 219 | } 220 | } 221 | } 222 | 223 | private class Caja extends JPanel 224 | { 225 | public Dimension getPreferredSize() 226 | { 227 | return getMinimumSize(); 228 | } 229 | 230 | public Dimension getMinimumSize() 231 | { 232 | Dimension d=new Dimension(); 233 | FontMetrics fn=getFontMetrics(font); 234 | int h=fn.getHeight(); 235 | d.setSize((fn.stringWidth(" ")+1)+(border*2)+1,h+(border*2)+1); 236 | return d; 237 | } 238 | 239 | } 240 | 241 | private class Filas extends JPanel 242 | { 243 | public Filas() 244 | { 245 | this.setLayout(new BorderLayout(1,1)); 246 | } 247 | public Dimension getPreferredSize() 248 | { 249 | return getMinimumSize(); 250 | } 251 | 252 | public Dimension getMinimumSize() 253 | { 254 | Dimension d=new Dimension(); 255 | FontMetrics fn=getFontMetrics(font); 256 | int h=fn.getHeight(); 257 | int nl=getLineas(); 258 | d.setSize((fn.stringWidth(" ")+1)*(8)+(border*2)+1,h*nl+(border*2)+1); 259 | return d; 260 | } 261 | 262 | public void paint(Graphics g) 263 | { 264 | Dimension d=getMinimumSize(); 265 | g.setColor(Color.white); 266 | g.fillRect(0,0,d.width,d.height); 267 | g.setColor(Color.black); 268 | g.setFont(font); 269 | 270 | int ini=getInicio(); 271 | int fin=ini+getLineas(); 272 | int y=0; 273 | for(int n=ini;n126)) s=""+(char)16; 75 | he.printString(g,s,(x++),y); 76 | if(x==16) 77 | { 78 | x=0; 79 | y++; 80 | } 81 | } 82 | 83 | } 84 | 85 | private void debug(String s) 86 | { 87 | if(he.DEBUG) System.out.println("JHexEditorASCII ==> "+s); 88 | } 89 | 90 | // calcular la posicion del raton 91 | public int calcularPosicionRaton(int x,int y) 92 | { 93 | FontMetrics fn=getFontMetrics(he.font); 94 | x=x/(fn.stringWidth(" ")+1); 95 | y=y/fn.getHeight(); 96 | debug("x="+x+" ,y="+y); 97 | return x+((y+he.getInicio())*16); 98 | } 99 | 100 | // mouselistener 101 | public void mouseClicked(MouseEvent e) 102 | { 103 | debug("mouseClicked("+e+")"); 104 | he.cursor=calcularPosicionRaton(e.getX(),e.getY()); 105 | this.requestFocus(); 106 | he.repaint(); 107 | } 108 | 109 | public void mousePressed(MouseEvent e) 110 | { 111 | } 112 | 113 | public void mouseReleased(MouseEvent e) 114 | { 115 | } 116 | 117 | public void mouseEntered(MouseEvent e) 118 | { 119 | } 120 | 121 | public void mouseExited(MouseEvent e) 122 | { 123 | } 124 | 125 | //KeyListener 126 | public void keyTyped(KeyEvent e) 127 | { 128 | debug("keyTyped("+e+")"); 129 | 130 | he.buff[he.cursor]=(byte)e.getKeyChar(); 131 | 132 | if(he.cursor!=(he.buff.length-1)) he.cursor++; 133 | he.repaint(); 134 | } 135 | 136 | public void keyPressed(KeyEvent e) 137 | { 138 | debug("keyPressed("+e+")"); 139 | he.keyPressed(e); 140 | } 141 | 142 | public void keyReleased(KeyEvent e) 143 | { 144 | debug("keyReleased("+e+")"); 145 | } 146 | 147 | public boolean isFocusTraversable() 148 | { 149 | return true; 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /src/JHexEditor/JHexEditorHEX.java: -------------------------------------------------------------------------------- 1 | package JHexEditor; 2 | 3 | import javax.swing.*; 4 | import java.awt.*; 5 | import java.awt.event.*; 6 | 7 | /** 8 | * Created by IntelliJ IDEA. 9 | * User: laullon 10 | * Date: 09-abr-2003 11 | * Time: 12:47:32 12 | */ 13 | public class JHexEditorHEX extends JComponent implements MouseListener,KeyListener 14 | { 15 | private JHexEditor he; 16 | private int cursor=0; 17 | 18 | public JHexEditorHEX(JHexEditor he) 19 | { 20 | this.he=he; 21 | addMouseListener(this); 22 | addKeyListener(this); 23 | addFocusListener(he); 24 | } 25 | 26 | public Dimension getPreferredSize() 27 | { 28 | debug("getPreferredSize()"); 29 | return getMinimumSize(); 30 | } 31 | 32 | public Dimension getMaximumSize() 33 | { 34 | debug("getMaximumSize()"); 35 | return getMinimumSize(); 36 | } 37 | 38 | public Dimension getMinimumSize() 39 | { 40 | debug("getMinimumSize()"); 41 | 42 | Dimension d=new Dimension(); 43 | FontMetrics fn=getFontMetrics(he.font); 44 | int h=fn.getHeight(); 45 | int nl=he.getLineas(); 46 | d.setSize(((fn.stringWidth(" ")+1)*+((16*3)-1))+(he.border*2)+1,h*nl+(he.border*2)+1); 47 | return d; 48 | } 49 | 50 | public void paint(Graphics g) 51 | { 52 | debug("paint("+g+")"); 53 | debug("cursor="+he.cursor+" buff.length="+he.buff.length); 54 | Dimension d=getMinimumSize(); 55 | g.setColor(Color.white); 56 | g.fillRect(0,0,d.width,d.height); 57 | g.setColor(Color.black); 58 | 59 | g.setFont(he.font); 60 | 61 | int ini=he.getInicio()*16; 62 | int fin=ini+(he.getLineas()*16); 63 | if(fin>he.buff.length) fin=he.buff.length; 64 | 65 | //datos hex 66 | int x=0; 67 | int y=0; 68 | for(int n=ini;n "+s); 104 | } 105 | 106 | // calcular la posicion del raton 107 | public int calcularPosicionRaton(int x,int y) 108 | { 109 | FontMetrics fn=getFontMetrics(he.font); 110 | x=x/((fn.stringWidth(" ")+1)*3); 111 | y=y/fn.getHeight(); 112 | debug("x="+x+" ,y="+y); 113 | return x+((y+he.getInicio())*16); 114 | } 115 | 116 | // mouselistener 117 | public void mouseClicked(MouseEvent e) 118 | { 119 | debug("mouseClicked("+e+")"); 120 | he.cursor=calcularPosicionRaton(e.getX(),e.getY()); 121 | this.requestFocus(); 122 | he.repaint(); 123 | } 124 | 125 | public void mousePressed(MouseEvent e) 126 | { 127 | } 128 | 129 | public void mouseReleased(MouseEvent e) 130 | { 131 | } 132 | 133 | public void mouseEntered(MouseEvent e) 134 | { 135 | } 136 | 137 | public void mouseExited(MouseEvent e) 138 | { 139 | } 140 | 141 | //KeyListener 142 | public void keyTyped(KeyEvent e) 143 | { 144 | debug("keyTyped("+e+")"); 145 | 146 | char c=e.getKeyChar(); 147 | if(((c>='0')&&(c<='9'))||((c>='A')&&(c<='F'))||((c>='a')&&(c<='f'))) 148 | { 149 | char[] str=new char[2]; 150 | String n="00"+Integer.toHexString((int)he.buff[he.cursor]); 151 | if(n.length()>2) n=n.substring(n.length()-2); 152 | str[1-cursor]=n.charAt(1-cursor); 153 | str[cursor]=e.getKeyChar(); 154 | he.buff[he.cursor]=(byte)Integer.parseInt(new String(str),16); 155 | 156 | if(cursor!=1) cursor=1; 157 | else if(he.cursor!=(he.buff.length-1)){ he.cursor++; cursor=0;} 158 | he.actualizaCursor(); 159 | } 160 | } 161 | 162 | public void keyPressed(KeyEvent e) 163 | { 164 | debug("keyPressed("+e+")"); 165 | he.keyPressed(e); 166 | } 167 | 168 | public void keyReleased(KeyEvent e) 169 | { 170 | debug("keyReleased("+e+")"); 171 | } 172 | 173 | public boolean isFocusTraversable() 174 | { 175 | return true; 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /src/JHexEditor/Test.java: -------------------------------------------------------------------------------- 1 | package JHexEditor; 2 | 3 | import javax.swing.*; 4 | import java.util.*; 5 | import java.awt.*; 6 | import java.awt.event.*; 7 | import java.io.*; 8 | 9 | /** 10 | * Created by IntelliJ IDEA. 11 | * User: laullon 12 | * Date: 08-abr-2003 13 | * Time: 13:16:06 14 | */ 15 | public class Test extends WindowAdapter 16 | { 17 | private JFrame win; 18 | 19 | public Test() throws IOException 20 | { 21 | byte[] ar; 22 | ar=new byte[16*16*100]; 23 | Arrays.fill(ar,(byte)0); 24 | 25 | //ByteArrayOutputStream bos=new ByteArrayOutputStream(); 26 | //ObjectOutputStream oos=new ObjectOutputStream(bos); 27 | //oos.writeObject("dfasnvcxnz.,mvnmc,xznvmcxzmnvcmxzcccbnxz cz hajk vc jbcvj xbnzvc sbj cvxz,bcxjnzbcvjhs avcjz cxmzncvxz "); 28 | //ar=bos.toByteArray(); 29 | 30 | win=new JFrame(); 31 | win.getContentPane().add(new JHexEditor(ar,0)); 32 | win.addWindowListener(this); 33 | win.pack(); 34 | win.show(); 35 | } 36 | 37 | public void windowClosing(WindowEvent e) 38 | { 39 | System.exit(0); 40 | } 41 | 42 | // 43 | // 44 | // public static void main(String arg[]) throws IOException 45 | // { 46 | // new Test(); 47 | // } 48 | } 49 | -------------------------------------------------------------------------------- /src/android/forensic/toolkit/CustomCellRenderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package android.forensic.toolkit; 6 | 7 | import java.awt.Component; 8 | import javax.swing.ImageIcon; 9 | import javax.swing.JLabel; 10 | import javax.swing.JList; 11 | import javax.swing.ListCellRenderer; 12 | 13 | /** 14 | * 15 | * @author Resley Rodrigues 16 | */ 17 | public class CustomCellRenderer extends JLabel implements ListCellRenderer { 18 | public CustomCellRenderer() { 19 | setOpaque(true); 20 | setHorizontalAlignment(LEFT); 21 | setVerticalAlignment(CENTER); 22 | } 23 | 24 | /* 25 | * This method finds the image and text corresponding 26 | * to the selected value and returns the label, set up 27 | * to display the text and image. 28 | */ 29 | @Override 30 | public Component getListCellRendererComponent( 31 | JList list, 32 | Object value, 33 | int index, 34 | boolean isSelected, 35 | boolean cellHasFocus) { 36 | //Get the selected index. (The index param isn't 37 | //always valid, so just use the value.) 38 | // int selectedIndex = list.getSelectedIndex(); 39 | Component component = (Component)value; 40 | 41 | if (isSelected) { 42 | component.setBackground(list.getSelectionBackground()); 43 | component.setForeground(list.getSelectionForeground()); 44 | } else { 45 | component.setBackground(list.getBackground()); 46 | component.setForeground(list.getForeground()); 47 | } 48 | 49 | //Set the icon and text. If icon was null, say so. 50 | // ImageIcon icon = createImageIcon("images/" + value. + ".gif"); 51 | // String pet = petStrings[selectedIndex]; 52 | // setIcon(icon); 53 | return component; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/android/forensic/toolkit/FAT12.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this template, choose Tools | Templates 3 | * and open the template in the editor. 4 | */ 5 | package android.forensic.toolkit; 6 | 7 | import static android.forensic.toolkit.FAT32.jumpto; 8 | import java.awt.Color; 9 | import java.awt.FlowLayout; 10 | import java.io.BufferedWriter; 11 | import java.io.File; 12 | import java.io.FileNotFoundException; 13 | import java.io.FileReader; 14 | import java.io.FileWriter; 15 | import java.io.IOException; 16 | import java.io.RandomAccessFile; 17 | import java.nio.ByteBuffer; 18 | import java.nio.channels.FileChannel; 19 | import java.util.ArrayList; 20 | import java.util.Arrays; 21 | import java.util.logging.Level; 22 | import java.util.logging.Logger; 23 | import javax.swing.DefaultListModel; 24 | import javax.swing.ImageIcon; 25 | import javax.swing.JLabel; 26 | import javax.swing.JPanel; 27 | import javax.swing.ListSelectionModel; 28 | import javax.swing.event.ListSelectionEvent; 29 | import javax.swing.event.ListSelectionListener; 30 | import javax.xml.bind.JAXBContext; 31 | import javax.xml.bind.JAXBException; 32 | import javax.xml.bind.Marshaller; 33 | import javax.xml.bind.Unmarshaller; 34 | 35 | /** 36 | * 37 | * @author Resley Rodrigues 38 | */ 39 | public class FAT12 { 40 | //Default FAT values 41 | String jump_instruction = ""; //0-2 42 | String OEM_name = ""; //3-10 43 | int bytes_per_Sector; //11-12 44 | int sectors_per_cluster; //13 45 | int reserved_sectors; //14-15 46 | int number_of_FAT_copies; //16 47 | int number_of_root_directory_entries; //17-18 0 for FAT32 48 | int total_sectors; //19-20 for smaller than 32 MB 49 | String media_descriptor; //21 50 | int sectors_per_FAT; //22-23 0 for FAT32 51 | int sectors_per_track; //24-25 52 | int number_of_heads; //26-27 53 | int hidden_sectors; //28-29 54 | long hidden_sectorsL; //28-31 55 | long total_sectorsL; //32-35 56 | int logical_drive_number; //36 for use with INT 13, e.g. 0 or 0x80 57 | //37 Reserved 58 | int extened_signature; //38 Extended signature (0x29) 59 | // Indicates that the three following fields are present. 60 | long serial_number; //39-42 61 | String label = ""; //43-53 62 | String type = ""; //54-61 63 | //62-509 Bootstrap 64 | //510-511 Signature (imported) 65 | //30-509 Bootstrap 66 | String signature = ""; //510-511 67 | int i=0; 68 | RandomAccessFile diskAccess; 69 | byte[] content = new byte[512]; 70 | int address = 0x000000; 71 | File diskRoot; 72 | static int jumpto; //root directory location 73 | long first_data_sector; 74 | //Additional variables 75 | private static final String src_file = "/res/file.png"; 76 | private static final String deleted_file = "/res/deleted_file.png"; 77 | // private static final String folder = "/res/folder.png"; 78 | // private static final String deleted_folder = "/res/deleted_folder.png"; 79 | private static final String hidden_file = "/res/hidden_file.png"; 80 | private static final String hidden_deleted_file = "/res/deleted_hidden_file.png"; 81 | // private static final String hidden_folder = "/res/hidden_folder.png"; 82 | // private static final String hidden_deleted_folder = "/res/deleted_hidden_folder.png"; 83 | String title = ""; 84 | String body = ""; 85 | Boolean deleted = null; 86 | String Image = ""; 87 | static ArrayList files = new ArrayList<>(); 88 | 89 | 90 | public void getBPB(String path) throws FileNotFoundException, IOException { 91 | diskRoot = new File("\\\\.\\" + path); 92 | diskAccess = new RandomAccessFile(diskRoot, "r"); 93 | diskAccess.readFully(content); 94 | 95 | jump_instruction = Utils.hex(content[i++]) +Utils.hex(content[i++]) + Utils.hex(content[i++]); //0-2 96 | for (i = 3; i <= 10; i++) { 97 | OEM_name = OEM_name.concat(String.valueOf(Utils.hexToText(Utils.hex(content[i])))); //3-10 98 | } 99 | bytes_per_Sector = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++])); //11-12 100 | sectors_per_cluster = Utils.hexToInt(Utils.hex(content[i++]), "00"); //13 101 | reserved_sectors = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++])); //14-15 102 | number_of_FAT_copies = Utils.hexToInt(Utils.hex(content[i++]), "00"); //16 103 | number_of_root_directory_entries = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++])); //17-18 104 | total_sectors = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++])); //19-20 105 | media_descriptor = Utils.hex(content[i++]); //21 106 | sectors_per_FAT = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++])); //22-23 107 | sectors_per_track = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++])); //24-25 108 | number_of_heads = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++])); //26-27 109 | hidden_sectors = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++])); //28-29 110 | i=28; 111 | hidden_sectorsL = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++]), Utils.hex(content[i++]), Utils.hex(content[i++])); //28-31 112 | total_sectorsL = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++]), Utils.hex(content[i++]), Utils.hex(content[i++])); //32-35 113 | logical_drive_number = Utils.hexToInt(Utils.hex(content[i++]), "00"); //36 114 | i++; //37 Reserved - used to be Current Head (used by Windows NT) 115 | extened_signature = Utils.hexToInt(Utils.hex(content[i++]), "00"); //38 Extended signature (0x29) Indicates that the three following fields are present. 116 | serial_number = Utils.hexToInt(Utils.hex(content[i++]), Utils.hex(content[i++]), Utils.hex(content[i++]), Utils.hex(content[i++])); //39-42 Serial number of partition 117 | for(i=43;i<=53;i++) 118 | label = label.concat(String.valueOf(Utils.hexToText(Utils.hex(content[i])))); //71-81 Volume label 119 | for(i=54;i<=61;i++) 120 | type = type.concat(String.valueOf(Utils.hexToText(Utils.hex(content[i])))); //82-89 Filesystem type ("FAT32 ") 121 | signature = Utils.hex(content[i=510]) + Utils.hex(content[i=511]); 122 | } 123 | 124 | public void printBPB(javax.swing.JTextArea a,javax.swing.JTextArea b) { 125 | b.append("\t\t 0\t 1\t 2\t 3\t 4\t 5\t 6\t 7\t\t 8\t 9\t A\t B\t C\t D\t E\t F"); 126 | for (i=0; i