Git Product home page Git Product logo

Comments (1)

runningnak3d avatar runningnak3d commented on September 14, 2024

You aren't putting a ! in your command. It would be -c '!MISC WRTE blah blah'

Your second problem is that you don't specify the offset OF the misc partition, you specify an offset WITHIN the misc partition. MISC WRTE and MISC READ already know the offset of misc.

So if you want to start writing at the beginning of misc:

!MISC WRTE,0,4 TEST

That will write TEST at the very start of the misc partition.

You can read it back with:

!MISC READ,0,4
And you will get TEST back. Here is output from my phone:

71° [swango:~/dev/lglaf] h932-dd-write(+1/-1)+* 8s ± ./lglaf.py --cr --debug --rawshell
LGLAF.py: DEBUG: product id in CR list: >G4<
LGLAF.py: DEBUG: Device is: 633a, G4. Enabling Challenge/Response!
LGLAF.py: DEBUG: Using endpoints 83 (IN), 02 (OUT)
LGLAF.py: DEBUG: Using Protocol version: 0x1000004
LGLAF.py: DEBUG: CR detection: 1
LGLAF.py: DEBUG: Hello done, proceeding with commands
LGLAF.py by Peter Wu (https://lekensteyn.nl/lglaf)
Type a shell command to execute or "exit" to leave.
# !MISC WRTE,0,4 TEST
LGLAF.py: DEBUG: Header: b'MISC' b'WRTE' b'\0\0\0\0' b'\x04\0\0\0' b'\0\0\0\0' b'\0\0\0\0' b';i\0\0' b'\xb2\xb6\xac\xbc'
# !MISC READ,0,4
LGLAF.py: DEBUG: Header: b'MISC' b'READ' b'\0\0\0\0' b'\x04\0\0\0' b'\0\0\0\0' b'\x04\0\0\0' b'\xc2+\0\0' b'\xb2\xb6\xac\xbc'
TEST# 

Now without all the debug output:

Type a shell command to execute or "exit" to leave.
# !MISC WRTE,0,4 1234
# !MISC READ,0,4
1234# 

Unless you have a backup of your misc partition, you NEVER want to write more than one block unless you are trying to modify values on the misc partition itself (for example serial number, or MAC address).

For eMMC devices that is 512 and for UFS devices that is 4096.

-- Brian

from lglaf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.