combsjy / iphone-dataprotection

Automatically exported from code.google.com/p/iphone-dataprotection
0 stars 0 forks source link

redsn0w commands in windows causing crashing of cmd prompt #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.open command promt as an administrative user

2.aim the directory to my redsnow path, and copy all required files
  to the working folder " myramdisk, kernelcache.release.n90.patched , iphoneipsw file

3. run the command redsn0w -i path\iphone3,1_5.0_9A334_Restore.ipsw -r 
myramdisk.dmg -k kernelcach.release.n90.patched

What is the expected output? What do you see instead?
the expected output is the iphone4 booting with the ok and progress bar.

the actual result is redsn0w crashing in command prompt.

What version of the product are you using? On what operating system?
using iphone 4 with ios 4.3.3 8j2 

Please provide any additional information below.

these are the results generated in terminal from the VMware OSX 10.6.8

Last login: Fri Jan 20 23:33:18 on console
Snow-Leopard-Users-Mac:~ User$ cd iphone-dataprotection
Snow-Leopard-Users-Mac:iphone-dataprotection User$ make -C img3fs
make: `img3fs' is up to date.
Snow-Leopard-Users-Mac:iphone-dataprotection User$ cp 
redsn0w_mac_0.9.9b8/redsn0w.app/Contents//MacOS/keys.plist .
Snow-Leopard-Users-Mac:iphone-dataprotection User$ python 
python_scripts/kernel_patcher.py 
users/user/downloads/iphone3,1_5.0_9a334_restore.ipsw
Traceback (most recent call last):
  File "python_scripts/kernel_patcher.py", line 175, in <module>
    main(args[0], options)
  File "python_scripts/kernel_patcher.py", line 82, in main
    ipsw = zipfile.ZipFile(ipswname)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/zipfile.py", line 685, in __init__
    self.fp = open(file, modeDict[mode])
IOError: [Errno 2] No such file or directory: 
'users/user/downloads/iphone3,1_5.0_9a334_restore.ipsw'
Snow-Leopard-Users-Mac:iphone-dataprotection User$ python 
python_scripts/kernel_patcher.py 
/users/user/downloads/iphone3,1_5.0_9a334_restore.ipsw
Decrypting kernelcache.release.n90
Unpacking ...
Doing CSED patch
Doing getxattr system patch
Doing _PE_i_can_has_debugger patch
Doing IOAESAccelerator enable UID patch
Doing AMFI patch
Patched kernel written to kernelcache.release.n90.patched
Created script make_ramdisk_n90ap.sh, you can use it to (re)build the ramdisk
Snow-Leopard-Users-Mac:iphone-dataprotection User$ sh ./make_ramdisk_n90ap.sh
Found iOS SDK 4.3
make: Nothing to be done for `all'.
Archive:  /users/user/downloads/iphone3,1_5.0_9a334_restore.ipsw
  inflating: 018-7923-347.dmg        
TAG: TYPE OFFSET 14 data_length:4
TAG: DATA OFFSET 34 data_length:104b000
TAG: SEPO OFFSET 104b040 data_length:4
TAG: KBAG OFFSET 104b05c data_length:38
KBAG cryptState=1 aesType=100
TAG: KBAG OFFSET 104b0a8 data_length:38
TAG: SHSH OFFSET 104b10c data_length:80
TAG: CERT OFFSET 104b198 data_length:794
Decrypting DATA section
Decrypted data seems OK : ramdisk
/dev/disk3                                              /Volumes/ramdisk
"disk3" unmounted.
"disk3" ejected.
myramdisk.dmg created
You can boot the ramdisk using the following command (fix paths)
redsn0w -i /users/user/downloads/iphone3,1_5.0_9a334_restore.ipsw -r 
myramdisk.dmg -k kernelcache.release.n90.patched
Snow-Leopard-Users-Mac:iphone-dataprotection User$ 

Original issue reported on code.google.com by spen...@robselectric.ca on 21 Jan 2012 at 8:45

GoogleCodeExporter commented 9 years ago
solved my own issue on this.

i rebooted the computer and went back to command prompt as administrator

i then entered full paths to file location rather than just file names even 
though they are all in the working directory.

i am now past this stage i get the OK but i am also getting a 

"error, no succesful firmware download after 6000ms!! giving up..."

at this point do i need usbmux in order to ssh or will it work without it?
i have tried to connect several times with no success..

greatfull for the help.

Original comment by spen...@robselectric.ca on 22 Jan 2012 at 5:26

GoogleCodeExporter commented 9 years ago
The error message "error, no succesful firmware download after 6000ms!! giving 
up..." is normal. If you see the OK on the screen, then you can run tcprelay.sh 
in a separate terminal window (under os x), or usbmuxd-python-client\relay.bat 
under windows.
Then you should be able to ssh into localhost:2222 (root/alpine).

Original comment by jean.sig...@gmail.com on 22 Jan 2012 at 10:45

GoogleCodeExporter commented 9 years ago
well i have tried everything i can think of doing to get this usbmuxd to work 
and i cannot for any reason get this relay.bat to run
or even get the tcprelay to run in python

i have downloaded everything i can think of needing but must be missing a step 
somewhere

Original comment by spen...@robselectric.ca on 23 Jan 2012 at 1:00

GoogleCodeExporter commented 9 years ago
i run relay.bat in command prompt and get this result

c:\Python32\python.exe tcprelay.py -t 22:2222 5900:5900 1999:1999 1234:1234  
  file "tcprelay.py" , line 71
  print "incoming connectio to %d"%self.server.server_address[1]
                                 ^
SyntaxError: invalid syntax

i copied the text directly from your relay.bat
http://code.google.com/p/iphone-dataprotection/source/browse/usbmuxd-python-clie
nt/relay.bat?r=3e6e6f047d7314e41dcc143ad52c67d3ee8c0859

into notepad and did a save as
and change name to relay.bat and changed filetype to allfiles.

i have also tried running tcprelay -t 22:2222 in python gui but it get 

SyntaxError: invalid syntax

Original comment by spen...@robselectric.ca on 23 Jan 2012 at 1:23

GoogleCodeExporter commented 9 years ago
Ok, try installing python 2.6 instead of 3.2, looks like tcprelay is not 
compatible with python 3.

Original comment by jean.sig...@gmail.com on 23 Jan 2012 at 9:18

GoogleCodeExporter commented 9 years ago
this is my result from command prompt after running the relay.bat file

--------------------------------------------------------------------------------
-
c:\Python26\python-client>relay.bat

c:\Python26\python-client>tcprelay.py -t 22:2222 5900:5900 1999:1999 1234:1234
Forwarding local port 2222 to remote port 22
Forwarding local port 5900 to remote port 5900
Forwarding local port 1999 to remote port 1999
Forwarding local port 1234 to remote port 1234
Incoming connection to 2222
Waiting for devices...
No device found

--------------------------------------------------------------------------

i then try using winscp to connect
i use 
hostname    : localhost    
port number : 22     , have tried 2222 , 5900, 1999, 1234
user name   : root   , have tried blank and Root 
password    : alpine , have tried blank and Alpine

(i have tried all cominations of username and password)
i had no issues jailbreaking my ATV2 using root and alpine
which is the default apple set values from what i gathered.

and i keep getting

No Device found on all trials

is there something else i need to do that i have missed?

Original comment by spen...@robselectric.ca on 23 Jan 2012 at 11:36

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
i have an after result question 

when i make a connection
what would be the ssh command to retrieve

- pictures
- contacts
- video's
- notes

i could care less about anything else i have.
 i had my main computer hard drive crap out which held all my everyting regarding my children and any outlook contact files
sadly for me i never made a backup of the contents.

i truely do appreciate your help.

Original comment by spen...@robselectric.ca on 23 Jan 2012 at 11:49

GoogleCodeExporter commented 9 years ago
for the "no device found error", is the ramdisk started with the OK displayed 
on screen ? you mentionned you use vmware, make sure that the usb device is not 
connected to the virtual machine instead of the host computer.
to recover files, once you have ssh access, you can run ./mount_partitions.sh 
and then you can access the data partition in /mnt2

Original comment by jean.sig...@gmail.com on 24 Jan 2012 at 9:38

GoogleCodeExporter commented 9 years ago
yes. the OK on the iphone is displayed.
and the vmware is off and disabled.

i am able to see the phone in recovery mode in Itunes,
and the ramdisk loading runs fine to it.

do i need libusb? or is there anything else that i may need to configure?
should i run itunes when trying to connect to it?

possibility of a driver needed?

Original comment by spen...@robselectric.ca on 25 Jan 2012 at 3:05

GoogleCodeExporter commented 9 years ago
did you made any progress ? i don't know why the USB device would not show up 
once the ramdisk booted OK, maybe try using a different computer ? also, are 
there any error messages related to USB on the device screen ?

Original comment by jean.sig...@gmail.com on 29 Jan 2012 at 12:03

GoogleCodeExporter commented 9 years ago
i am still having issues with getting into the phone 
i am able to get it to make a connection on port 1999 but it just hangs when it 
connects
i cannot get it to connect under port 22 or any other port.
i'm not sure why but i get this when it tries

--------------------------------------------------------------------------------
----
c:\Python26\python-client>tcprelay.py -t 2222:22 5900:5900 1999:1999 1234:1234
Forwarding local port 22 to remote port 2222
Forwarding local port 5900 to remote port 5900
Forwarding local port 1999 to remote port 1999
Forwarding local port 1234 to remote port 1234
Incoming connection to 22
Waiting for devices...
Connecting to device <MuxDevice: ID 1 ProdID 0x1297 Serial 'ramdisk tool Jan 19
2012 02:57:03' Location 0x0>
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 49306)
Traceback (most recent call last):
  File "C:\Python26\lib\SocketServer.py", line 558, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Python26\lib\SocketServer.py", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Python26\lib\SocketServer.py", line 615, in __init__
    self.handle()
  File "C:\Python26\python-client\tcprelay.py", line 82, in handle
    dsock = mux.connect(dev, self.server.rport)
  File "C:\Python26\python-client\usbmux.py", line 235, in connect
    return connector.connect(device, port)
  File "C:\Python26\python-client\usbmux.py", line 206, in connect
    raise MuxError("Connect failed: error %d"%ret)
MuxError: Connect failed: error 3
----------------------------------------

--------------------------------------------------------------------------------
-----

i enter localhost and try different ports on the winscp and in putty and i get 
the same results no matter what in command prompt.

win scp tells me the 'server unexpectedly closed network connection.'

Original comment by spen...@robselectric.ca on 29 Jan 2012 at 7:52

GoogleCodeExporter commented 9 years ago
Looks like you inverted the ports for ssh, try changing 2222:22 to 22:2222 and 
connect with winscp to localhost:2222

Original comment by jean.sig...@gmail.com on 29 Jan 2012 at 7:58

GoogleCodeExporter commented 9 years ago
that did it. i am in now :D 
thank you a million

i now get a permision denied when i run 
./mount_partitions.sh in putty

and i cannot see any files when i try to look in the mnt2 directry is winscp

Original comment by spen...@robselectric.ca on 29 Jan 2012 at 8:26

GoogleCodeExporter commented 9 years ago
is there a manual method to mounting partitions and then doing a entire folder 
copy in the command window for putty.

Original comment by spen...@robselectric.ca on 29 Jan 2012 at 8:28

GoogleCodeExporter commented 9 years ago
to fix the permission error run "chmod +x mount_partitions.sh", then retry 
"./mount_partitions.sh"
you should then be able to copy stuff from /mnt2 in winscp

Original comment by jean.sig...@gmail.com on 29 Jan 2012 at 8:36

GoogleCodeExporter commented 9 years ago
i opened putty alongside of winscp and typed teh commands that were listed under
the mount_partitions.sh file individually into the ssh command window
and it seemed to have unlocked them, or made them accessible.

aside of a few of the files having copying issues  " statement that they do not 
exsist." it seems like everything is copying smoothly from the partition files.

thank you again for all the help.

i have and will recommend this to everyone i know for similar issues.

is there a donations system for paypal?

Original comment by spen...@robselectric.ca on 30 Jan 2012 at 12:11

GoogleCodeExporter commented 9 years ago
i am getting issues when trying to copy files still.
i get a permisions denied.
i ran the command you gave me in putty but i still get access
denied for files in hte mnt1 and mnt2 partitions

Original comment by spen...@robselectric.ca on 30 Jan 2012 at 12:35

GoogleCodeExporter commented 9 years ago
how can i get the demo_bruteforce.py to work on windows i copied the  scripts 
folder to the python26 dir and tried running it inside of that but i get

--------------------------------------------------------------------------------
----

C:\Python26>cd c:\Python26\python_scripts\

c:\Python26\python_scripts>demo_bruteforce.py
Traceback (most recent call last):
  File "C:\Python26\python_scripts\demo_bruteforce.py", line 3, in <module>
    from keystore.keybag import Keybag
  File "C:\Python26\python_scripts\keystore\keybag.py", line 5, in <module>
    from crypto.aeswrap import AESUnwrap
  File "C:\Python26\python_scripts\crypto\aeswrap.py", line 2, in <module>
    from Crypto.Cipher import AES
ImportError: No module named Crypto.Cipher

c:\Python26\python_scripts>

--------------------------------------------------------------------------------
-----
is this normal ? i do not have a passcode set on my phone
so do i need to actually do a bruteforce?

Original comment by spen...@robselectric.ca on 30 Jan 2012 at 2:33