The Mac OSX crypt function (which is in unistd.h, as I have determined), is not the same as on gcc/gnu in Linux. I have test programs on Linux and Mac OSX, and the crypt c-library function displays a 34-character string, if you display result using printf. The same code on the Mac. Mar 03, 2021 Enable the location icon in the Mac OS X menu bar This requires modern versions of Mac OS X, previous releases do not have a location icon: Go to the Apple menu and choose System Preferences Select “Security and Privacy” and go to the “Privacy” tab. My hard drive died and I had it replaced. I was wondering where the Lightroom 5 presets were located on Mac OS X? I use an online backup service, and I'm keeping my fingers crossed that by some small miracle that it would have backed up my Lightroom 5 presets.
Another “ultimate” guide (he-he :)) to decrypting iOS applications from AppStore. It’s based on my 2 years experience. I hope somebody finds it useful. Questions are welcome in comments.
Install the app you want to disassemble, e.g. Samsung Content Viewer, to a jailbroken iOS device and start it. Then ssh the device and use ps
command to list the running processes. Find the app in the list and note the executable location (usually /var/mobile/Applications/...
):
Use scp
in Mac console to copy the executable to a local folder:
Again, consider Samsung Content Viewer as an example of a multiple architectures executable. List the architectures:
Choose the architecture you want to disassemble, for example armv7, and remember offset
from the output above (4096
for armv7 in the output). Then use otool
to find encrypted offset/size for the architecture you want to disassemble, e.g. for armv7:
Now ssh the iOS device, connect debugserver
to the application (remember? it’s still running), then connect lldb
to debugserver
and find offset of the executable image in memory:
For the example above, the image offset is 0x0003e000
.
Warning! Two important things:
Then dump the the encrypted part of the executable. Use the following lldb command:
For Samsung Content Viewer:
Finally, backup the Samsung Content Viewer
executable
and insert decrypted.bin
into the executable
where 12288=4096+8192
is the offset for armv7 architecture (see the output of otool -fh
above) plus cryptoff
. Optionally, to make the executable suitable for some tools (e.g. class-dump-z
), you can set cryptid
to 0
(see “Setting cryptid to 0
” below).
For a single architecture with a fat header, e.g. for Kik
executable, the dump looks like
Use otool
to find encrypted offset/size
Run the application on your iOS device and ssh the device. Then connect debugserver to the application, connect lldb to debugserver and find offset of the executable image in memory:
The offset for Kik
image is 0x000f3000.
Warning! If the executable was compiled with PIE (ASLR) flag, the image offset changes every application start.
Let’s dump the encrypted part of the application with the following lldb command:
e.g. for Kik:
Finally, let’s insert decrypted.bin
into the executable:
where
arch. offset
came from otool -fh Kik
output (this is the offset
for architecture 0)cryptoff
came from otool -l Kik grep crypt
outputFor example, for Kik
we have
where 0x8000
= arch. offset
(0x4000
in hex) + cryptoff
(0x4000
in hex).
Optionally, to make the executable suitable for some tools (e.g. class-dump-z
), you can set cryptid
to 0 (see “Setting cryptid to 0
” below).
For a single architecture binary without fat header, e.g. for Instagram
, otool
output looks like
Use otool
to find encrypted offset/size:
Run the application on your iOS device and ssh the device. Then connect debugserver to the application, connect lldb to debugserver and find offset of the executable image in memory:
The offset for Instagram
image is 0x00033000
.
Warning! If the executable was compiled with PIE (ASLR) flag, the image offset changes every application start.
Let’s dump the encrypted part of the application with the following lldb command:
e.g. for Instagram:
Finally, let’s insert decrypted bytes from <path to dump>.bin
into the executable:
e.g. for Instagram
Optionally, to make the executable suitable for some tools (e.g. class-dump-z
), you can set cryptid
to 0
(see “Setting cryptid to 0
” below).
Just find the offset of cryptid
with MachOView:
Double click on Data
for Crypt ID
, set it to 0
and press CMD+S to save the binary. Or, if you don’t like to edit files in MachO View, open the executable in any hex editor, go to the offset and replace 1
with 0
.
Commenting is not available in this blog, but you can write me a letter or message. Please, note that English is not my native language. I'm sorry for mistakes/missprints, if any.
Prev: Breakpoint callbacks in LLDB Python scriptsThe ability to switch between different sets of network settings (locations) can be useful in circumstances such as these:
If you have more than one location, you can use either of these methods to switch between them:
If you're using network locations because you want each location to prefer a different network service (such as Wi-Fi or Ethernet) when connecting, follow these steps to change the service order (also known as port priority) in each location.
By default, the location named Automatic makes all available network services (also known as ports or network interfaces) active, whether or not they are being used to connect to a network. Your Mac automatically searches these services for a network or internet connection.
For example, you might use a Wi-Fi network at home but an Ethernet network at work. Your Mac automatically detects which of these network services to use when it connects.
If you want to make sure that your Mac doesn't use a particular network service, such as Wi-Fi, you can make that service inactive in any of your network locations: