Re: Hacking BitPim to delete locked files

"Brian Blakley" <[email protected]>
Newsgroups gmane.comp.mobile.bitpim.devel
Message-ID <003301c5872e$67b50890$6701fe0a@tcswks003>
Oops, I would swear that I was set to plain text for that message
submission, but obviously not - sorry about that.  This message is
definitely in plain text.

I have an update to my analysis:

I tested changing the 0x01 function in BitPim (delete directory) to 0x03
(unknown function) and got no error, but no apparent changes either.  It is
now my opinion that the 0x03 function does whatever 0x07 does, it just does
it for subdirectories whereas 0x07 does it (whatever "it" is) for files.
I'm hoping that "it" is a way to set the attributes of a file/subdirectory,
and make it writable.  I've been looking at the BitPim code a bit more in
Python and trying to deduce how to properly pass a second parameter (other
than the filename) to experiment with seeing if it does anything - so far
I'm still a little in the dark on Python.

My original post (in plain text) was:
---

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!



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.