|
![]() |
|
Welcome to the GSM-Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| Register | FAQ | Donate | Forum Rules | ★. iPhone Unlock .★ | -= JTAG BOOM =- | Search | Today's Posts | Mark Forums Read |
| GSM Programming & Reverse Engineering Here you can post all Kind of GSM Programming and Reverse Engineering tools and Secrets. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| Freak Poster ![]() ![]() ![]() ![]() Join Date: Mar 2007
Posts: 199
Member: 460280 Status: Offline Thanks: 148
Thanked 78 Times in 41 Posts
| Read BB5 Full PM via USB Sample I am a GSM enthusiast not a programmer, but I like programming my own tool. This forum have helped me a lot. My progress: 1. Read BB5 phone info (detailed) via USB 2. Make Pm120 and 308 backup 3. SIM Lock counter reset 4. Read/write Product code, BPN, Hardware version, Order Number (alpha-numeric) 5. Read/write lock code 6. Reset Lock code counter All sources was based on the tutorials I learned from here: 1. by fr3nsis 2. by shadab_a4u 3. by orbita 4. by angel25dz 5. by others I can't remember now Now, my dear tutors, once again I needed your help. I wanted to know/learn how to READ FULL PM from a BB5 phone via USB in VB.NET 1. How will I know the number of fields of PM of one BB5 phone? 2. What USB Frame will I use? 3. How will I loop so what my code will not so lengthy? Please if you could provide sample source code that will help me a lot and will be highly appreciated. I know that there is or are sources posted already but they are in delphi, and I don't understand much of delphi. VB.net is the easiest language for me. Thank a lot. I'll be waiting. BR, John P.S. If it is not possible to post code here, please do it in PM. Thanks. Last edited by John Q.; 08-06-2012 at 01:19. |
|
| | #2 (permalink) | |
| No Life Poster ![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2007 Location: Guangzhou-China
Posts: 1,270
Member: 468587 Status: Offline Sonork: 100.1612429 Thanks: 318
Thanked 677 Times in 404 Posts
| Quote:
You can find all this in BEST.rar Best Regard | |
|
| The Following 2 Users Say Thank You to MOURAD™ For This Useful Post: |
| | #6 (permalink) | |
| Freak Poster ![]() ![]() ![]() ![]() Join Date: Jul 2011 Location: Australia/Melbourne
Posts: 100
Member: 1610809 Status: Offline Sonork: 100.1616347 Thanks: 90
Thanked 20 Times in 18 Posts
| this just a little exemple delphi , u can transleet to VB.net look like this Quote:
| |
|
| The Following User Says Thank You to GTunlocker For This Useful Post: |
| | #7 (permalink) |
| Freak Poster ![]() ![]() ![]() ![]() Join Date: Dec 2002 Location: Poland
Posts: 157
Member: 18642 Status: Offline Thanks: 2
Thanked 17 Times in 15 Posts
| Based on the following working code, I would like to upload a fixed value of the unsecured filed 356 (like below). For example, by clicking a Button5_Click. [356] 0=0100 1=F22A000000000100 How is the easiest way to do this? Could someone give an example of how to realize this in VB? Code: Imports Microsoft.Win32.SafeHandles
Imports System.Runtime.InteropServices
Imports System.Threading
Public Class Form1
Dim success As Boolean
Dim numberOfBytesWritten, numberOfBytesRead As Integer
Dim unManagedBuffer As IntPtr
Dim unManagedOverlapped As IntPtr
Dim deviceHandle As SafeFileHandle
Dim str As String
Friend Const FILE_ATTRIBUTE_NORMAL As Int32 = &H80
Friend Const FILE_FLAG_OVERLAPPED As Int32 = &H40000000
Friend Const FILE_SHARE_READ As Int32 = 1
Friend Const FILE_SHARE_WRITE As Int32 = 2
Friend Const GENERIC_READ As UInt32 = &H80000000UL
Friend Const GENERIC_WRITE As UInt32 = &H40000000
Friend Const OPEN_EXISTING As Int32 = 3
Public Structure SP_DEVICE_INTERFACE_DATA
Dim cbSize As Int32
Dim InterfaceClassGuid As Guid
Dim Flags As Int32
Dim Reserved As IntPtr
End Structure
<DllImport("setupapi.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Shared Function SetupDiGetClassDevs _
(ByRef ClassGuid As System.Guid, _
ByVal Enumerator As IntPtr, _
ByVal hwndParent As IntPtr, _
ByVal Flags As Int32) _
As IntPtr
End Function
Public Structure SP_DEVICE_INTERFACE_DETAIL_DATA
Dim cbSize As Int32
Dim DevicePath As String
End Structure
<DllImport("setupapi.dll", SetLastError:=True)> _
Shared Function SetupDiEnumDeviceInterfaces _
(ByVal DeviceInfoSet As IntPtr, _
ByVal DeviceInfoData As IntPtr, _
ByRef InterfaceClassGuid As System.Guid, _
ByVal MemberIndex As Int32, _
ByRef DeviceInterfaceData As SP_DEVICE_INTERFACE_DATA) _
As Boolean
End Function
<DllImport("setupapi.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Shared Function SetupDiGetDeviceInterfaceDetail _
(ByVal DeviceInfoSet As IntPtr, _
ByRef DeviceInterfaceData As SP_DEVICE_INTERFACE_DATA, _
ByVal DeviceInterfaceDetailData As IntPtr, _
ByVal DeviceInterfaceDetailDataSize As Int32, _
ByRef RequiredSize As Int32, _
ByVal DeviceInfoData As IntPtr) _
As Boolean
End Function
<DllImport("setupapi.dll", SetLastError:=True)> _
Shared Function SetupDiDestroyDeviceInfoList _
(ByVal DeviceInfoSet As IntPtr) _
As Int32
End Function
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Shared Function CreateFile _
(ByVal lpFileName As String, _
ByVal dwDesiredAccess As UInt32, _
ByVal dwShareMode As Int32, _
ByVal lpSecurityAttributes As IntPtr, _
ByVal dwCreationDisposition As Int32, _
ByVal dwFlagsAndAttributes As Int32, _
ByVal hTemplateFile As Int32) _
As SafeFileHandle
End Function
<DllImport("kernel32.dll", SetLastError:=True)> _
Shared Function WriteFile _
(ByVal hFile As SafeFileHandle, _
ByVal lpBuffer() As Byte, _
ByVal nNumberOfBytesToWrite As Int32, _
ByRef lpNumberOfBytesWritten As Int32, _
ByVal lpOverlapped As IntPtr) _
As Boolean
End Function
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Shared Function GetOverlappedResult _
(ByVal hFile As SafeFileHandle, _
ByVal lpOverlapped As IntPtr, _
ByRef lpNumberOfBytesTransferred As Int32, _
ByVal bWait As Boolean) _
As Boolean
End Function
<DllImport("kernel32.dll", SetLastError:=True)> _
Shared Function ReadFile _
(ByVal hFile As SafeFileHandle, _
ByVal lpBuffer As IntPtr, _
ByVal nNumberOfBytesToRead As Int32, _
ByRef lpNumberOfBytesRead As Int32, _
ByVal lpOverlapped As IntPtr) _
As Boolean
End Function
Public Function find_device() As String
Dim guid As String = "{4f919102-4adf-11d5-882d-00b0d02fe381}"
Dim myGuid As New System.Guid(guid)
Dim DIGCF_PRESENT As Int32 = 2
Dim DIGCF_DEVICEINTERFACE As Int32 = &H10
Dim deviceInfoSet As IntPtr
Dim memberIndex As Int32 = 0
Dim MyDeviceInterfaceData As SP_DEVICE_INTERFACE_DATA
Dim success As Boolean
Dim bufferSize As Int32
Dim detailDataBuffer As IntPtr
deviceInfoSet = SetupDiGetClassDevs _
(myGuid, _
IntPtr.Zero, _
IntPtr.Zero, _
DIGCF_PRESENT Or DIGCF_DEVICEINTERFACE)
MyDeviceInterfaceData.cbSize = Marshal.SizeOf(MyDeviceInterfaceData)
success = SetupDiEnumDeviceInterfaces _
(deviceInfoSet, _
IntPtr.Zero, _
myGuid, _
memberIndex, _
MyDeviceInterfaceData)
success = SetupDiGetDeviceInterfaceDetail _
(deviceInfoSet, _
MyDeviceInterfaceData, _
IntPtr.Zero, _
0, _
bufferSize, _
IntPtr.Zero)
detailDataBuffer = Marshal.AllocHGlobal(bufferSize)
Marshal.WriteInt32 _
(detailDataBuffer, _
Convert.ToInt32(IIf((IntPtr.Size = 4), 4 + Marshal.SystemDefaultCharSize, 8)))
success = SetupDiGetDeviceInterfaceDetail _
(deviceInfoSet, _
MyDeviceInterfaceData, _
detailDataBuffer, _
bufferSize, _
bufferSize, _
IntPtr.Zero)
Dim devicePathName As String = ""
Dim pDevicePathName As IntPtr = New IntPtr(detailDataBuffer.ToInt32 + 4)
devicePathName = Marshal.PtrToStringAuto(pDevicePathName)
Marshal.FreeHGlobal(detailDataBuffer)
SetupDiDestroyDeviceInfoList(deviceInfoSet)
Return devicePathName
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
ListBox1.Items.Clear()
If Me.Button1.Text = "Scan" Then
Dim devicePathName As String = find_device()
deviceHandle = CreateFile _
(devicePathName, _
GENERIC_READ Or GENERIC_WRITE, _
FILE_SHARE_READ, _
IntPtr.Zero, _
OPEN_EXISTING, _
FILE_ATTRIBUTE_NORMAL, _
0)
If deviceHandle.IsInvalid = True Then
ListBox1.Items.Add("Phone not detected :(")
Me.Button2.Enabled = False
Me.Button4.Enabled = False
Me.ComboBox1.Enabled = False
Else
ListBox1.Items.Add("Phone detected! :)")
Me.Button1.Enabled = False
Me.Button2.Enabled = True
Call Button2_Click(sender, e)
Me.Button4.Enabled = True
Me.ComboBox1.Enabled = True
Me.Button1.Text = "Discon."
End If
Else
Me.Button1.Text = "Scan"
deviceHandle.Close()
Me.ComboBox1.Enabled = False
Me.Button4.Enabled = False
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim sw_version() As Byte = {&H1B, &H0, &H10, &HD1, &H0, _
&H5, &H0, &H9, &H0, &H3, &H0}
Dim imei() As Byte = {&H1B, &H0, &H10, &H1B, &H0, _
&H8, &H0, &H6, &H23, &H0, &H41, &H0, &H0, &H0}
ListBox1.Items.Add("")
ListBox1.Items.Add("Sw. : " & read_write_str(deviceHandle, sw_version, sw_version.Length))
Thread.Sleep(100)
ListBox1.Items.Add("IMEI : " & read_write_str(deviceHandle, imei, imei.Length))
Thread.Sleep(100)
ListBox1.Items.Add("")
Button1.Enabled = True
Button2.Enabled = False
End Sub
Public Function read_write_str(ByVal devicehandle, ByVal command, ByVal commandlenght) As String
Dim inputReportBuffer(100) As Byte
unManagedBuffer = Marshal.AllocHGlobal(inputReportBuffer.Length)
numberOfBytesRead = 0
numberOfBytesWritten = 0
success = WriteFile _
(devicehandle, _
command, _
commandlenght, _
numberOfBytesWritten, _
IntPtr.Zero)
Thread.Sleep(50)
success = ReadFile _
(devicehandle, _
unManagedBuffer, _
inputReportBuffer.Length, _
numberOfBytesRead, _
unManagedOverlapped)
Marshal.Copy _
(unManagedBuffer, inputReportBuffer, 0, numberOfBytesRead)
ReDim Preserve inputReportBuffer(numberOfBytesRead - 1)
Dim inputReportBuffer_element As Byte
Dim rest As String = ""
Dim n As Integer = 0
For Each inputReportBuffer_element In inputReportBuffer
If n > commandlenght - 1 Then
Select Case inputReportBuffer_element
Case Is < &H20
rest = rest & " "
Case Is = &H20
rest = rest & " "
Case Is > &H20
rest = rest & Chr(Val("&h" & inputReportBuffer_element.ToString("X2")))
End Select
End If
n += 1
Next
Return rest.Trim
End Function
Public Function SetMode(ByVal devicehandle, ByVal Mode) As String
Dim inputReportBuffer(100) As Byte
unManagedBuffer = Marshal.AllocHGlobal(inputReportBuffer.Length)
numberOfBytesRead = 0
numberOfBytesWritten = 0
Dim pmsec() As Byte = {&H1B, &H0, &H10, &H15, &H0, &H6, &H0, &H6, &H0, &H1, &H1, &H0}
Dim CmdNormal() As Byte = {&H1B, &H0, &H10, &H15, &H0, &H6, &H0, &H6, &H0, &H1, &H1, &H0}
Dim CmdLocal() As Byte = {&H1B, &H0, &H10, &H15, &H0, &H6, &H0, &H6, &H0, &H1, &H5, &H0}
Dim CmdTest() As Byte = {&H1B, &H0, &H10, &H15, &H0, &H6, &H0, &H6, &H0, &H1, &H4, &H0}
Select Case Mode
Case 0 'Normal Mode
pmsec = CmdNormal
Case 1 'Local Mode
pmsec = CmdLocal
Case 2 'Test mode
pmsec = CmdTest
End Select
success = WriteFile _
(devicehandle, _
pmsec, _
pmsec.Length, _
numberOfBytesWritten, _
IntPtr.Zero)
Thread.Sleep(50)
success = ReadFile _
(devicehandle, _
unManagedBuffer, _
inputReportBuffer.Length, _
numberOfBytesRead, _
unManagedOverlapped)
Marshal.Copy _
(unManagedBuffer, inputReportBuffer, 0, numberOfBytesRead)
ReDim Preserve inputReportBuffer(numberOfBytesRead - 1)
Dim inputReportBuffer_element As Byte
Dim rest As String = ""
For Each inputReportBuffer_element In inputReportBuffer
rest = rest & "" & inputReportBuffer_element.ToString("X2")
Next
If numberOfBytesRead <= 11 Then
Return "Failed!"
Exit Function
End If
rest = rest.Trim
If rest = "1B1000150006063A00640000" Then
Return "OK"
Else
Return "Failed!"
End If
End Function
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
End Sub
Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
If deviceHandle.IsInvalid = False Then
ListBox1.Items.Add("Setting " & ComboBox1.Text & "..." & SetMode(deviceHandle, ComboBox1.SelectedIndex))
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.SelectedIndex = 1
End Sub
End Class |
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| thread | Thread Starter | Forum | Replies | Last Post |
| Eeprom reading | KLImax | Nokia Legacy Phones ( DCT-1 , DCT-2 , DCT-3 , DCT-L ) | 2 | 09-22-2011 15:55 |
| read eeprom write eeprom, what do i need? | jonthe | Nokia Legacy Phones ( DCT-1 , DCT-2 , DCT-3 , DCT-L ) | 5 | 12-08-2010 05:24 |
| SMS via system connector | pasisoft | Nokia Legacy Phones ( DCT-1 , DCT-2 , DCT-3 , DCT-L ) | 1 | 10-21-1999 11:05 |
| Silly question!! Why is it impossible to read out the mastercode of Nokia phones???? | MyKe | Nokia Legacy Phones ( DCT-1 , DCT-2 , DCT-3 , DCT-L ) | 0 | 09-26-1999 14:31 |