Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void FindFile () {
- // TODO Auto-generated method stub
- String S1;
- S1 = "4F 45 4D 5F 49 4E 46 4F 03 00 00 00 12 00 00 00";
- String S2;
- int x;
- for (x = 1; x < 2; x++) {
- try {
- File file = new File("/storage/emulated/0/oeminfo.img");
- RandomAccessFile raf = new RandomAccessFile(file, "r");
- Log.d(TAG, "Position to start: " + a);
- raf.seek(a);
- byte[] arr = new byte[16];
- raf.readFully(arr, 0, 16);
- StringBuilder sb = new StringBuilder();
- for (byte b : arr) {
- sb.append(String.format("%02X ", b));
- }
- S2 = sb.toString();
- Log.d(TAG, "We found: " + S2);
- Log.d(TAG, "NO found: " + S1);
- if (S2 != S1) {
- Log.d(TAG, "Still not found. Searching next");
- a=a+16384;
- x=x-1;
- Log.d(TAG, "---------------SEPARATOR---------------");
- }
- else {
- Log.d(TAG, "We find int! Start file Address: " + a);
- x=x+2;
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement