Saturday, February 11, 2012

My steps for rooting a toshiba thrive hmj 37.31.5.011

Toshiba thrive version HMJ 37.31.5.0011.

I got all the information from thriveforums.org threads.

1. Downgrade to HMJ37.01.5.0032
http://www.thriveforums.org/forum/dalepl-development/4359-downgrade-official-toshiba-hmj37-31-5-0011-hmj37-01-5-0032-rollback.html

2.) Boot into recovery mode ( power off -> hold power + volume up)
3.) Select white package, select 'install update from external card'
4.) Reboot - thrive is downgraded
5.) Turn on usb debugging in settings -> applications -> development
6.) Download dalenet easy flash tool http://www.thriveforums.org/forum/dalepl-development/1974-root-tool-dalenet-thrive-10-1-easy-flash-tool.html
7.) Download a rooted ROM
8.) Extract easy flash tool
9.) Plug in thrive, install adb drivers (they were part of easy flash tool zip) (takes a while)
10.) PS C:\Users\youri\Downloads\DaleNet-Thrive_10-Easy_Flash_Tool-v1.5\tools> .\adb.exe devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
280400643406517 device
11.) shutdown, boot into recovery mode
12.) select fast boot (usb icon)
13.) Device looks like hangs at 'starting usb download protocol'
14.) PS C:\Users\youri\Downloads\DaleNet-Thrive_10-Easy_Flash_Tool-v1.5\tools> .\fastboot.exe devices
?       fastboot
15.) Reboot it
16.)PS C:\Users\youri\Downloads\DaleNet-Thrive_10-Easy_Flash_Tool-v1.5\tools> .\fastboot.exe reboot
rebooting...

finished. total time: -0.000s

17.) Steps 9-16 confirm that the usb connection is good
18.) Reboot into fastboot again
19.) Run  thrive_easy_flash_tool.bat
20.) Select #1
21.) extract update.zip from rom image onto the sd card
22.) go to applications -> super user and update it
23.) root has been obtained
24. safe boot again
25.) thrive easy flash tool
26.) 3 - install  flash recovery
27.) Install clockwork
28.) thrive will hang at installing mrb image
29.) reboot into recovery, select the package icon
30.) should be in CWM mode, install zip from sdcard
31.) reboot from the cwm menu
32.) Should be on the right image now & rooted

Wednesday, February 8, 2012

VB.net defeat simple padding obfuscation

There is an applicationthat obfuscates a serial number by padding each character. Here is a de-obfuscator I made.

First: define the array with all the characters the algorithm uses:






    Public charArray() As Char = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", _
                           "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", _
                           "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", _
                           "V", "W", "X", "Y", "Z"}

Function that will deobfuscate it.

    Private Function OffsetAChar(ByVal chartooffset As Char, ByVal offset As Integer)
        Dim posInArray As Integer = Array.IndexOf(charArray, chartooffset)
        Dim ArrayLength As Integer = charArray.Length

        If posInArray + offset = ArrayLength Then
            Return "0"
        End If

        If (posInArray + offset) <= ArrayLength And (posInArray + offset) > 0 Then
            Return charArray(posInArray + offset)
        End If

        If posInArray + offset = 0 Then
            Return 0
        End If

        If (posInArray + offset) < 0 Then
            Return charArray(ArrayLength + posInArray + offset)
        End If

        If (posInArray + offset) > ArrayLength Then
            Return charArray(Math.Abs(ArrayLength - (posInArray + offset)))
        End If

    End Function


Usage is simple:

        Dim charArray2() As Char

        Dim ArraySTring As String = txtDecode.Text
        ArraySTring = ArraySTring.Replace("-", "")
        charArray2 = ArraySTring


       txtCodeDecoded.Text += OffsetAChar(charArray2(0), -19).ToString.ToUpper


Figuring out the offset of two letters


    Public Function OffsetFinder(ByVal letter1 As Char, ByVal letter2 As Char)

        Dim CharPos1 = Array.IndexOf(charArray, letter1)
        Dim CharPos2 = Array.IndexOf(charArray, letter2)
        Return CharPos2 - CharPos1

    End Function

VB.net 2010 run an app, activate it, and send keys.

This isn't an elegant way to do it, but it works for me. It runs a program, sends alt+h, a, tab, then ctrl+c to copy text to a clipboard and puts the contents of the clipboard into a textbox.

In sendkeys:
 % = alt
vbTab = tab
^ = crl
{escape} = ESC

Imports System.Diagnostics.Process
Imports System.Threading

Public Class Form1


Public Sub GetSerials()
Dim pInfo As ProcessStartInfo = New ProcessStartInfo("C:\Program Files (x86)\CustomApp\Bin\customapp.exe")

      pInfo.WindowStyle = ProcessWindowStyle.Maximized
        Process.Start(pInfo)
        Thread.Sleep(3000)

AppActivate("CustomApp 1.1.5")


        System.Windows.Forms.SendKeys.SendWait("%")
        System.Windows.Forms.SendKeys.SendWait("h")
        System.Windows.Forms.SendKeys.SendWait("a")
        System.Windows.Forms.SendKeys.SendWait(vbTab)
        System.Windows.Forms.SendKeys.SendWait("^c")
        TextBox2.Text = (TextBox1.Text & " : " & Clipboard.GetText & vbCr)

        System.Windows.Forms.SendKeys.SendWait("{escape}")
        System.Windows.Forms.SendKeys.SendWait("%")
        System.Windows.Forms.SendKeys.SendWait("f")
        System.Windows.Forms.SendKeys.SendWait("q")



    End Sub


End Class