Brian Blakley
2005-07-12 06:49:19 UTC
I've started hacking about in the BitPim code to see if I can discover a command to unlock a locked file to enable a locked file to be deleted or replaced.
While not a Python programmer, I am *a* programmer and I was able to get Python and the other required modules installed, and grab the BitPim code off the CVS. A little hacking and I found the sections in p_brew.py and p_brew.p that needed to be changed to start my quest.
I started by noting all of the command numbers that were presently utilized:
0x00 Make a directory
0x01 Delete a Directory
0x02 List Subdirectories
0x04 Read File
0x05 Write File
0x06 Delete a File
0x0B Get one diretory entry
0x0C Memory configure
This left me wondering what 0x03, and 0x07 - 0x0A might do.
So, I changed the code in those two files to use 0x03 instead of 0x06 when the "delete" function is used. I repeated with 0x07 - 0x0A. Below are my results (no breakthoughs yet):
0x03 -----> Something to do with directories (get a "no such directory error")
0x07 -----> No error with this one, but nothing happens either. Was hopeful this was an "unlock" so I changed "Delete" back to 0x06 and tried it, but still no joy.
0x08 -----> ValueError: The value read should be a constant of 89, but was 21 instead
0x09 -----> ValueError: The value read should be a constant of 89, but was 21 instead
0x0A -----> ValueError: The value read should be a constant of 89, but was 21 instead
Being that 0x07 didn't kick any sort of error and the others did, I'm guessing that 0x07 indeed has to do with files, and perhaps is a "set attributes" command and requires a parameter - perhaps a bitmask of the attributes to be set - to do anything useful. I don't know enough about BitPim or Python yet to take this much further.
I feel there is significant value in the possiblity of overwriting locked files since some files appear to be locked for no good technical reason (just the carrier wanting to prevent you from doing as you wish with a given feature). Case in point is that the Virgin Mobile V7 has Internet capability, but unlike other models of the same phone through other carriers, the ##BROWSER command doesn't work to let you set your proxy server. Virgin's proxy server doesn't let you go anywhere but where Virgin wants you to. A bit of hacking revealed that the Internet proxy settings are in /nvm/nvm/nvm_hei. A bit more hacking using a sacrificial eBay phone, of the same model but for another carrer, that *does* support the ##BROWSER command allowed me to map the nvm_hei file and figure out how to change the proxy server IP, username, password, etc. Of course, like most phones, everything in the /nvm/nvm directory seems to be locked. Being able to overwrite nvm_hei with my own would be very useful. I have seen posts from others indicating that they have various uses for overwriting locked files as well.
I do not think these particular files are actively locked by a process because I was able to bring up BitPim with the phone powered off but connected to a charger (in theory no apps running) and the file still could not be deleted. This makes me think that it is indeed just an attribute on the file similar to the "read only" attribute in DOS.
Any ideas or other experience on this topic would be welcome.
Thanks!
While not a Python programmer, I am *a* programmer and I was able to get Python and the other required modules installed, and grab the BitPim code off the CVS. A little hacking and I found the sections in p_brew.py and p_brew.p that needed to be changed to start my quest.
I started by noting all of the command numbers that were presently utilized:
0x00 Make a directory
0x01 Delete a Directory
0x02 List Subdirectories
0x04 Read File
0x05 Write File
0x06 Delete a File
0x0B Get one diretory entry
0x0C Memory configure
This left me wondering what 0x03, and 0x07 - 0x0A might do.
So, I changed the code in those two files to use 0x03 instead of 0x06 when the "delete" function is used. I repeated with 0x07 - 0x0A. Below are my results (no breakthoughs yet):
0x03 -----> Something to do with directories (get a "no such directory error")
0x07 -----> No error with this one, but nothing happens either. Was hopeful this was an "unlock" so I changed "Delete" back to 0x06 and tried it, but still no joy.
0x08 -----> ValueError: The value read should be a constant of 89, but was 21 instead
0x09 -----> ValueError: The value read should be a constant of 89, but was 21 instead
0x0A -----> ValueError: The value read should be a constant of 89, but was 21 instead
Being that 0x07 didn't kick any sort of error and the others did, I'm guessing that 0x07 indeed has to do with files, and perhaps is a "set attributes" command and requires a parameter - perhaps a bitmask of the attributes to be set - to do anything useful. I don't know enough about BitPim or Python yet to take this much further.
I feel there is significant value in the possiblity of overwriting locked files since some files appear to be locked for no good technical reason (just the carrier wanting to prevent you from doing as you wish with a given feature). Case in point is that the Virgin Mobile V7 has Internet capability, but unlike other models of the same phone through other carriers, the ##BROWSER command doesn't work to let you set your proxy server. Virgin's proxy server doesn't let you go anywhere but where Virgin wants you to. A bit of hacking revealed that the Internet proxy settings are in /nvm/nvm/nvm_hei. A bit more hacking using a sacrificial eBay phone, of the same model but for another carrer, that *does* support the ##BROWSER command allowed me to map the nvm_hei file and figure out how to change the proxy server IP, username, password, etc. Of course, like most phones, everything in the /nvm/nvm directory seems to be locked. Being able to overwrite nvm_hei with my own would be very useful. I have seen posts from others indicating that they have various uses for overwriting locked files as well.
I do not think these particular files are actively locked by a process because I was able to bring up BitPim with the phone powered off but connected to a charger (in theory no apps running) and the file still could not be deleted. This makes me think that it is indeed just an attribute on the file similar to the "read only" attribute in DOS.
Any ideas or other experience on this topic would be welcome.
Thanks!