PDA

View Full Version : [Desktop] Complete Customization for your Dock on Mountain Lion


unsanity77
Nov 24, 2012, 12:50 PM
UPDATE: Full-featured app for more than just black -- http://spyresoft.com


Here's something I came up with to help those who absolutely have to have a black dock. Since Apple moved from image files to CoreGraphics rendering code, the only way to customize the color of the dock is to modify the code.

So.... I've written a program that will patch the Dock's code. It performs a static decryption on the Dock binary, patches several offsets, and removes an integral part of the code signature to bypass the signing process.

This is no longer considered BETA software. It has stood the test of time, and hundreds of users have reported success, with no failures.

However, I have created an actual cocoa app in an effort to make it even easier for most people to use. This app is considered BETA for now. There is no functional difference between the command-line version and the GUI version, so if you've already modified your dock, there's no need to download the new version (unless you want to BETA test it). This app will ask for your password to install a helper app. This helper app is so that changes can be made to the Dock app (which is owned by the "root" user). If you ever want to uninstall, remove the following files:


/Library/LaunchDaemons/com.chasingsilver.dpprivilegedhelper.plist
/Library/PrivilegedHelperTools/com.chasingsilver.dpprivilegedhelper



To use the command-line dock mod,

usage:
dockmod -c <color> -r

-c, --color color to make the dock ('default' or 'black')
-r, --noreflections disable icon reflections


Keep in mind, again, this will only work for 10.8.2 so far, and will have to be updated for future versions. Success has been reported also for 10.8.3.

use it like this:

sudo dockmod -c black -r


The color options are "black" and "default" for the -c option, and the -r option will disable icon reflections.

This is what it looks like:

gumblecosby
Nov 24, 2012, 01:00 PM
Here's a guide I came up with to help those who absolutely have to have a black dock. Since Apple moved from image files to CoreGraphics rendering code, the only way to customize the color of the dock is to modify the code.

It can be quite complex as it involves some hacking of the OS, but as I wanted a black dock bad enough to do this, I figured there may be others. So here's how I did it.

The dock executable contains the mission control code also. Any chance you found any adjustable attributes? For example - decrease amount of empty space between the windows in Mission Control.


Great work on the Dock theming. Somebody is going to take your idea and sell it as an app if you are not careful :)

unsanity77
Nov 24, 2012, 01:02 PM
I didn't look for mission control code, but if it's in there I could probably find it.

And this way is fairly complicated, unportable across minor OS versions, and easily broken but if someone wants to try to sell it, I suppose there's no way to stop them!

bedifferent
Nov 24, 2012, 01:15 PM
Thanks again for all your help in the other thread.

I have the latest Xcode 4.x Beta (iOS developer), and I didn't install the command line tools.

Once done, I should be able to call 'gdb', currently it's unrecognized in Terminal, which may have been the issue (I used a work around that didn't take).

Thanks mate! :)

unsanity77
Nov 24, 2012, 01:17 PM
Ahh yes, thanks for pointing that out! Will edit the original post to reflect this.

bedifferent
Nov 24, 2012, 01:21 PM
Ahh yes, thanks for pointing that out! Will edit the original post to reflect this.

Last ?, after dumping binary, terminal claims gdb is still running and should I quit. Is it still working in the background and should I wait until it is done or just quit? Thanks!

unsanity77
Nov 24, 2012, 01:22 PM
Screenshot so I can see what you typed.

bedifferent
Nov 24, 2012, 01:23 PM
Screenshot so I can see what you typed.

There you go :)

unsanity77
Nov 24, 2012, 01:26 PM
You can just quit anyway there ;)

Remember when you paste in this dumped code in 0xED to make sure that you're pasting starting at offset 0 and that you're write mode is overwrite.

You can also just use this command to copy the dumped code from the dump file on your desktop to the Dock binary also on your desktop:
cat ~/Desktop/dump | dd of=~/Desktop/Dock bs=1 seek=0 count=`stat -f %z ~/Desktop/dump` conv=notrunc

Wich
Nov 24, 2012, 04:49 PM
Hi, I' ve just finished following the guide but I' ve got a "strange" result as you can see from the two screenshots attached. Basically the dock becomes kinda grey when I have any window open and takes the background color when I have none open so I guess that has to do with some opacity/reflection settings. I' ve checked all the values I' ve inserted in 0xED and they are correct(I guess)...any suggestions? :)

unsanity77
Nov 24, 2012, 05:51 PM
You'll remember that even the original Dock reflected windows that were above it. It's because the background of the Safari window is a bright white, and that's being reflected in the glossy black dock, and so it becomes a gray color. Try a website with a darker background color or make the window smaller and move it closer and then away from the dock to see what I mean.

With that said, your dock does seem a bit different. Are you sure you left the Dock Alpha Transparency Value unchanged?

I to would like to change this reflection type too, and I'll take a look at it again probably in the coming weekends and post my result.

LastMinuteMike
Nov 24, 2012, 07:46 PM
I didn't look for mission control code, but if it's in there I could probably find it.

Yeah, please find out what kind of tweaks one can perform to Mission Control, pleeeeeaaase! :D

----------

Hi, I' ve just finished following the guide but I' ve got a "strange" result as you can see from the two screenshots attached. Basically the dock becomes kinda grey when I have any window open and takes the background color when I have none open so I guess that has to do with some opacity/reflection settings. I' ve checked all the values I' ve inserted in 0xED and they are correct(I guess)...any suggestions? :)

The dock reflects the whatever is above it. So if you have a mostly white window open, the dock is going to look white/grey. If you close all windows it'll only reflect your desktop. Try scrolling a window and see if you can catch the movement in the dock reflection! :)

Wich
Nov 25, 2012, 03:26 AM
You'll remember that even the original Dock reflected windows that were above it. It's because the background of the Safari window is a bright white, and that's being reflected in the glossy black dock, and so it becomes a gray color. Try a website with a darker background color or make the window smaller and move it closer and then away from the dock to see what I mean.

With that said, your dock does seem a bit different. Are you sure you left the Dock Alpha Transparency Value unchanged?

I to would like to change this reflection type too, and I'll take a look at it again probably in the coming weekends and post my result.
Yeah, but with the original dock the effect was more subtle(as it stayed always kinda grey) while here I have a dock that goes from grey for example all the way to completely green/red if I put a completely green/red background when I have no windows open. I would really love a dock that stays always black regardless of any windows open/background. As for the Dock Alpha Transparency value I didn' t touch it and it has this value for me: 00 00 00 00 00 00 F0 3F...:)
edit: Btw I just noticed that the stacks on the dock are "broken"(they don' t display the correct items anymore)...

symo
Nov 25, 2012, 01:35 PM
If you pulled it from the ML installation disk, then it's the Dock.app from 10.8.0. You'll have to download the 10.8.2 combo update and get your dock back to where it's supposed to be ;)
I did as you said in the other thread, but the md5 is still different from yours.
I tried the hack ad obviously it didn't work, the dock became gray with colored reflections depending on the wallpaper (or the currently open window).
http://s15.postimage.org/bhc4s3khj/Screen_Shot_2012_11_25_at_20_39_56.jpg (http://postimage.org/image/bhc4s3khj/)
I'm afraid I'll have to give up. :(
Thank you anyway.

unsanity77
Nov 25, 2012, 02:08 PM
Actually, from the picture, it appears that you were successful in patching the dock. The dock always reflects the wallpaper or the windows directly above it. It's just more noticeable now that it's black. However, I'll still be looking for a way to "tone down" this reflective behavior, and it will most likely result in just a couple more offsets to patch.

symo
Nov 25, 2012, 03:37 PM
I thought the hack hadn't worked because in your picture the dock looked darker, but now I guess it's because of the black wallpaper.
Very well then.
Thanks!:)

unsanity77
Nov 25, 2012, 04:02 PM
EDIT: As these are the only stable patches for now, I've updated the guide in post #1 to reflect these new patches/offset.

Alright, thanks to everyone for giving this a whirl. I've realized that changing constant float values in memory has led to unintended consequences, since these values are also being used elsewhere in the program. So I have localized the changes to black to the rendering function. However, by doing this, you cannot play around with the colors. Your dock is either black, or it's the original color. For those of you who would like to give this a try, I'm including the offsets you should patch here.

These offsets are used INSTEAD OF the ones listed in the document I uploaded. So essentially, you'd need to start with the original Dock binary, and do the steps again, except this time only patch what's listed here in this post. I've included pictures for you to see what it looks like now.


Patch 0xDC0AD to 0F 57 C0
Patch 0xDC0C8 to 0F 57 C0 90 90 90 90 90
Patch 0xDC0ED to 0F 57 C0 90 90 90 90 90
Patch 0xDC19F to 0F 57 C0 90 90 90 90 90
Patch 0xDC1C7 to 0F 57 C0 90 90 90 90 90
Patch 0xDC26D to 0F 57 C0
Patch 0xDC31D to 0F 57 C0 90 90 90 90 90

Patch 0xAC to 00 (so kernel doesn't attempt to decrypt what's already decrypted)

And you can still disable the icon reflections by patching 0x12EB2 to 00 as well (though I think that looks weird now).

As you can see from the pictures, it tends to look better with the lighter or colored backgrounds. Not so distinguishable when you have a darker gray/almost black background. YMMV.

symo
Nov 26, 2012, 09:45 AM
I like it a lot. :)
http://i50.tinypic.com/2ylpoc9.jpg
Thank you so much!!!

Mal
Nov 26, 2012, 10:14 AM
I started to attempt this, but not having any programming experience, I discovered I'm not up to the task. Is there any way someone could post the Dock.app and just let me do the code signing and place it in the proper location? I can handle that part.

jW

bedifferent
Nov 26, 2012, 12:58 PM
Worked like a charm! Thanks so much for your hard work and help. :)

The developers of "Candybar" over at Panic should read this as it may benefit them in allowing OS X 10.8 Dock modification. Since the change, dock modding is no longer functional in the application, hence Candybar decided on making the application free.

unsanity77
Nov 26, 2012, 01:06 PM
Any one else reading this can refer to the original post #1 to download an automatic patcher. This should simplify things for those not comfortable with all the steps outlined in the tutorial. However, keep in mind that at this point, you will be a beta tester... muahahaha ;)

If there's anything wrong with it, I'll update what I can.

And honestly, this is an extremely hacky method that I would doubt could be incorporated into CandyBar.

bedifferent
Nov 26, 2012, 01:11 PM
Any one else reading this can refer to the original post #1 to download an automatic patcher. This should simplify things for those not comfortable with all the steps outlined in the tutorial. However, keep in mind that at this point, you will be a beta tester... muahahaha ;)

If there's anything wrong with it, I'll update what I can.

And honestly, this is an extremely hacky method that I would doubt could be incorporated into CandyBar.


After I wrote that comment I realized sandboxing and other "hacks" would be outside of the allowed parameters. Prior to 10.8, modding the Dock required replacing the frontline and s-curve png's. As the Dock is more "interactive", using Candybar's method of replacing the icons and images isn't possible and you are right, I doubt it would be in their best interest.

However, YOU could make some money! Your work is the only method I have tried since 10.8 DP2 or 3 that works. I know many who would gladly pay for an easy app.

unsanity77
Nov 26, 2012, 01:15 PM
However, YOU could make some money! Your work is the only method I have tried since 10.8 DP2 or 3 that works. I know many who would gladly pay for an easy app.

I probably could, but I'm not really interested in that. I did it because it's fun. And as many people as you know who would gladly pay for an easy app, I bet I know more who would gladly have that app for free! In any case, the "software" is now free at the top of this page. =D

But thanks, I'm sure glad you find it useful.

bedifferent
Nov 26, 2012, 01:18 PM
I probably could, but I'm not really interested in that. I did it because it's fun. And as many people as you know who would gladly pay for an easy app, I bet I know more who would gladly have that app for free! In any case, the "software" is now free at the top of this page. =D

But thanks, I'm sure glad you find it useful.

A scholar and a gentleman. I'm much the same, I enjoy the process and helping others. Thank you again.

TheAngryPenguin
Nov 26, 2012, 02:22 PM
Thanks for putting together the automatic patcher. I am, however, unable to get it to work properly. I had been using another 'hack' (outlined here (http://forums.macrumors.com/showpost.php?p=16100107&postcount=128)), but I reverted to Dock.app v.10.8.2 from a backup before attempting to run the auto-patcher. Here's the output:

$ sudo ./patch_dock
Backing up original Dock contents
Dumping memory from Dock (5263) [0x104eda000-0x105135000]
Copying Dock binary to working directory
Replacing encrypted contents with decrypted dump
Patching __TEXT segment flags
Patching offset 0xDC0AD
Patching offset 0xDC0C8
Patching offset 0xDC0ED
Patching offset 0xDC19F
Patching offset 0xDC1C7
Patching offset 0xDC26D
Patching offset 0xDC31D
Importing code signing certificates
Replacing with patched Dock
Code signing the patched Dock
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: replacing existing signature
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: object file format unrecognized, invalid, or unsuitable
Restarting the Dock process
The Dock process cannot successfully restart, and my wallpaper disappears. Reverting seems to work. Also, if I run the revert_to_original script, and then run the patch_dock script, I get the same results listed above. Any ideas?

Update: After realizing the the scripts already include the sudo command, I tried running them w/o it. Same result.

unsanity77
Nov 26, 2012, 02:41 PM
Thanks for putting together the automatic patcher. I am, however, unable to get it to work properly. I had been using another 'hack' (outlined here (http://forums.macrumors.com/showpost.php?p=16100107&postcount=128)), but I reverted to Dock.app v.10.8.2 from a backup before attempting to run the auto-patcher. Here's the output:

$ sudo ./patch_dock
Backing up original Dock contents
Dumping memory from Dock (5263) [0x104eda000-0x105135000]
Copying Dock binary to working directory
Replacing encrypted contents with decrypted dump
Patching __TEXT segment flags
Patching offset 0xDC0AD
Patching offset 0xDC0C8
Patching offset 0xDC0ED
Patching offset 0xDC19F
Patching offset 0xDC1C7
Patching offset 0xDC26D
Patching offset 0xDC31D
Importing code signing certificates
Replacing with patched Dock
Code signing the patched Dock
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: replacing existing signature
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: object file format unrecognized, invalid, or unsuitable
Restarting the Dock process
The Dock process cannot successfully restart, and my wallpaper disappears. Reverting seems to work. Also, if I run the revert_to_original script, and then run the patch_dock script, I get the same results listed above. Any ideas?

Update: After realizing the the scripts already include the sudo command, I tried running them w/o it. Same result.

Uploaded new scripts in first post. Redownload and try the new one. It should actually spit out some helpful messages. And I fixed a few glaring bugs (not including count= in the dd commands) :eek:

TheAngryPenguin
Nov 26, 2012, 03:15 PM
Still not working for me:
$ sudo ./patch_dock
Password:
Backing up original Dock contents
Dumping memory from Dock (7038) [0x10a45b000-0x10a6b6000]
Copying Dock binary to working directory
Replacing encrypted contents with decrypted dump
2469888+0 records in
2469888+0 records out
2469888 bytes transferred in 4.562045 secs (541399 bytes/sec)
Patching __TEXT segment flags
1+0 records in
1+0 records out
1 bytes transferred in 0.001120 secs (893 bytes/sec)
Patching offset 0xDC0AD
3+0 records in
3+0 records out
3 bytes transferred in 0.000019 secs (157286 bytes/sec)
Patching offset 0xDC0C8
8+0 records in
8+0 records out
8 bytes transferred in 0.000028 secs (284360 bytes/sec)
Patching offset 0xDC0ED
8+0 records in
8+0 records out
8 bytes transferred in 0.000028 secs (286790 bytes/sec)
Patching offset 0xDC19F
8+0 records in
8+0 records out
8 bytes transferred in 0.000026 secs (307839 bytes/sec)
Patching offset 0xDC1C7
8+0 records in
8+0 records out
8 bytes transferred in 0.000027 secs (296942 bytes/sec)
Patching offset 0xDC26D
3+0 records in
3+0 records out
3 bytes transferred in 0.000019 secs (157286 bytes/sec)
Patching offset 0xDC31D
8+0 records in
8+0 records out
8 bytes transferred in 0.000028 secs (284360 bytes/sec)
Importing code signing certificates
security: SecKeychainItemImport: The specified item already exists in the keychain.
security: SecKeychainItemImport: The specified item already exists in the keychain.
Replacing with patched Dock
Code signing the patched Dock
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: replacing existing signature
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: object file format unrecognized, invalid, or unsuitable
Restarting the Dock process
Same result -- Dock doesn't relanuch, and no wallpaper. Hopefully the added verbosity helps!

Mal
Nov 26, 2012, 03:26 PM
The script worked perfectly for me, thanks! Dock restarted and is black now.

jW

unsanity77
Nov 26, 2012, 03:35 PM
Still not working for me:

Same result -- Dock doesn't relanuch, and no wallpaper. Hopefully the added verbosity helps!

After running "sudo ./patch_dock" and while your wallpaper is still blank and the dock is not onscreen, run these two commands as well (before you revert)

xxd -l 4096 -g 1 /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock >> ~/Desktop/Dock_xxd.txt

xxd -l 4096 -g 1 /tmp/dump >> ~/Desktop/dump_xxd.txt

Then proceed to revert, zip the two files on your Desktop (Dock_xxd and dump_xxd) and post them here.

----------

The script worked perfectly for me, thanks! Dock restarted and is black now.

jW

Glad to hear it!!

TheAngryPenguin
Nov 26, 2012, 03:50 PM
After running "sudo ./patch_dock" and while your wallpaper is still blank and the dock is not onscreen, run these two commands as well (before you revert)

xxd -l 4096 -g 1 /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock >> ~/Desktop/Dock_xxd.txt

xxd -l 4096 -g 1 /tmp/dump >> ~/Desktop/dump_xxd.txt

Then proceed to revert, zip the two files on your Desktop (Dock_xxd and dump_xxd) and post them here.
Here ya go!

unsanity77
Nov 26, 2012, 05:18 PM
Updated patcher in first thread. This one contains sanity checks to insure that things are how the program expects them to be. It must be run as root (i.e. with sudo) though the program checks for it anyway.

Run it like this to patch:
sudo ./patch_dock patch

And like this to revert:
sudo ./patch_dock revert

And like this to revert to the original
sudo ./patch_dock revert_to_original

TheAngryPenguin
Nov 26, 2012, 05:38 PM
Updated patcher in first thread. This one contains sanity checks to insure that things are how the program expects them to be. It must be run as root (i.e. with sudo) though the program checks for it anyway.

Run it like this to patch:
sudo ./patch_dock patch

And like this to revert:
sudo ./patch_dock revert

And like this to revert to the original
sudo ./patch_dock revert_to_original
Ugh. Still not working:
$ sudo ./patch_dock patch
Password:
Checking for file locations... success
Importing code signing certificates
security: SecKeychainItemImport: The specified item already exists in the keychain.
security: SecKeychainItemImport: The specified item already exists in the keychain.
Backing up original Dock contents
Dumping memory from Dock (10239) [0x10e321000-0x10e57c000]
Replacing encrypted contents with decrypted dump
2469888+0 records in
2469888+0 records out
2469888 bytes transferred in 9.228851 secs (267627 bytes/sec)
Patching __TEXT segment flags
1+0 records in
1+0 records out
1 bytes transferred in 0.000023 secs (43240 bytes/sec)
Patching offset 0xDC0AD
3+0 records in
3+0 records out
3 bytes transferred in 0.000027 secs (111353 bytes/sec)
Patching offset 0xDC0C8
8+0 records in
8+0 records out
8 bytes transferred in 0.000042 secs (190650 bytes/sec)
Patching offset 0xDC0ED
8+0 records in
8+0 records out
8 bytes transferred in 0.000042 secs (190650 bytes/sec)
Patching offset 0xDC19F
8+0 records in
8+0 records out
8 bytes transferred in 0.000047 secs (170327 bytes/sec)
Patching offset 0xDC1C7
8+0 records in
8+0 records out
8 bytes transferred in 0.000048 secs (166937 bytes/sec)
Patching offset 0xDC26D
3+0 records in
3+0 records out
3 bytes transferred in 0.000032 secs (93902 bytes/sec)
Patching offset 0xDC31D
8+0 records in
8+0 records out
8 bytes transferred in 0.000045 secs (177537 bytes/sec)
Code signing the patched Dock
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: replacing existing signature
/System/Library/CoreServices/Dock.app/Contents/MacOS/Dock: object file format unrecognized, invalid, or unsuitable
Restarting the Dock process
$ xxd -l 4096 -g 1 /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock >> ~/Desktop/Dock_xxd.txt
$ xxd -l 4096 -g 1 /tmp/dump >> ~/Desktop/dump_xxd.txt
$ sudo ./patch_dock revert_to_original
Reverting to original copy of 10.8.2 Dock
No matching processes were found
$ sudo ./patch_dock revert
Reverting to backed up copy of Dock
No matching processes were found
This time, I wasn't able to revert or revert_to_original -- once I manually moved my backed-up Dock.app back into place, it re-spawned. I've attached the two xxd files you requested before.

unsanity77
Nov 26, 2012, 05:46 PM
Ugh. Still not working:


This time, I wasn't able to revert or revert_to_original -- once I manually moved my backed-up Dock.app back into place, it re-spawned. I've attached the two xxd files you requested before.

Ahh I think that I have found your problem. It appears that codesign is breaking because it requires the command-line tools from Xcode to be installed. I thought that by bypassing the need for gdb by coding my own app to dump the Dock's memory that we wouldn't need Xcode, but it appears that we do still need it to be installed to code sign binaries.

You can download them without having to D/L Xcode, I believe. Just go here: https://developer.apple.com/
Then go to Mac Dev Center link.
Then, near where it says download Xcode 4.5.2, you'll see Additional Downloads. Click on the link that says "View all downloads"
https://developer.apple.com/downloads/

Then download the tools for "Command Line Tools (OS X Mountain Lion) for Xcode Nov. 1st"

TheAngryPenguin
Nov 26, 2012, 05:49 PM
Ahh I think that I have found your problem. It appears that codesign is breaking because it requires the command-line tools from Xcode to be installed. I thought that by bypassing the need for gdb by coding my own app to dump the Dock's memory that we wouldn't need Xcode, but it appears that we do still need it to be installed to code sign binaries.
Makes sense. I figured I was missing some sort of dependency. I'll leave everything as-is, since I'm content with my 'other' dark Dock. If you decide to include the necessary command line tool(s) to your package, I'll be glad to do more testing for ya!

unsanity77
Nov 26, 2012, 05:52 PM
Makes sense. I figured I was missing some sort of dependency. I'll leave everything as-is, since I'm content with my 'other' dark Dock. If you decide to include the necessary command line tool(s) to your package, I'll be glad to do more testing for ya!

Too big to include. But see my previous post (just above yours) about just installing the tools you need rather than all of Xcode. Perhaps that will work.

TheAngryPenguin
Nov 26, 2012, 06:17 PM
Too big to include. But see my previous post (just above yours) about just installing the tools you need rather than all of Xcode. Perhaps that will work.
That was it. I'm not sure if other general users will want to go through all the trouble of registering for Apple Developer access just so they can install the CLI tools, which is why I was hoping that you'd be able to figure out what was specifically required from the toolkit to tie it all together. At any rate, really nice work! I appreciate what you've done with this. Of course, we'll all need to do it once again as soon as 10.8.3 RTMs.

bedifferent
Nov 26, 2012, 06:21 PM
At any rate, really nice work! I appreciate what you've done with this. Of course, we'll all need to do it once again as soon as 10.8.3 RTMs.

Ugh, I'm installing 10.8.3 now and completely forgot. Sometimes .x beta's don't impact the Dock.app, hoping this won't.

unsanity77
Nov 26, 2012, 06:21 PM
That was it. I'm not sure if other general users will want to go through all the trouble of registering for Apple Developer access just so they can install the CLI tools, which is why I was hoping that you'd be able to figure out what was specifically required from the toolkit to tie it all together. At any rate, really nice work! I appreciate what you've done with this. Of course, we'll all need to do it once again as soon as 10.8.3 RTMs.

You're quite right, and I will actually look into exactly what's required so that I can perhaps include an all-in-one package. It's probably something very minor missing...

unsanity77
Nov 29, 2012, 05:09 PM
Alright, the all-in-one solution is there in the first post, and it's all of 29kb large :)

TheAngryPenguin
Nov 29, 2012, 05:35 PM
Alright, the all-in-one solution is there in the first post, and it's all of 29kb large :)
Argh. It looks like there's no quick and easy way to remove the command line tools. I'd love to help test out the new script from the perspective of a non-developer, but unfortunately, I'm going to have wait until I come across a definitive way to remove the tools properly, or until my next OS nuke and pave.

unsanity77
Nov 29, 2012, 05:39 PM
Yeah, I tried to find a way to definitively remove them and couldn't figure it out either. Essentially, though, I've just taken the code-signing code directly from the codesign command-line tool (its source code is on opensource.apple.com) and it does what it's supposed to do so it *shouldn't* require anything else. Also, I've linked to some of Apple's private frameworks and that makes me a little iffy of whether it'll work on every machine, so I guess my biggest question for you is: does it do what it's supposed to as is?

TheAngryPenguin
Nov 29, 2012, 05:45 PM
Yeah, I tried to find a way to definitively remove them and couldn't figure it out either. Essentially, though, I've just taken the code-signing code directly from the codesign command-line tool (its source code is on opensource.apple.com) and it does what it's supposed to do so it *shouldn't* require anything else. Also, I've linked to some of Apple's private frameworks and that makes me a little iffy of whether it'll work on every machine, so I guess my biggest question for you is: does it do what it's supposed to as is?
I'll tell you what - I've been meaning to fire up a new ML virt. When I do, I'll give it a shot!

UPDATE: Fresh install of ML and all updates...

$ sudo ./dpatch patch
Checking Dock version... 1168.6, ready to patch
Checking privileges... we are root.
Importing CS_DockPatch codesign certificate... done.
Importing CS_DockPatch codesign private key... done.
Requesting task for Dock (132)... aquired - taskid: 6327
Searching memory for __TEXT segment... found @ 0x108CB9000-0x108F14000
Reading out decrypted segment (size: 0x25B000)... done.
Patching memory...
Offset 0x000000AC: 08 -> 00
Offset 0x000DC0AD: 0F 28 C1 -> 0F 57 C0
Offset 0x000DC0C8: F2 0F 10 05 20 03 0F 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC0ED: F2 0F 10 05 03 03 0F 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC19F: F2 0F 10 05 89 FC 0E 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC1C7: F2 0F 10 05 31 02 0F 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC26D: 0F 28 C1 -> 0F 57 C0
Offset 0x000DC31D: F2 0F 10 05 63 FF 0E 00 -> 0F 57 C0 90 90 90 90 90
Patches have been written to disk.
Code signing... replacing existing signature... signed.
Sent SIGKILL to Dock process.

No wallpaper, no Dock!

unsanity77
Nov 30, 2012, 10:44 AM
I'll tell you what - I've been meaning to fire up a new ML virt. When I do, I'll give it a shot!

UPDATE: Fresh install of ML and all updates...

$ sudo ./dpatch patch
Checking Dock version... 1168.6, ready to patch
Checking privileges... we are root.
Importing CS_DockPatch codesign certificate... done.
Importing CS_DockPatch codesign private key... done.
Requesting task for Dock (132)... aquired - taskid: 6327
Searching memory for __TEXT segment... found @ 0x108CB9000-0x108F14000
Reading out decrypted segment (size: 0x25B000)... done.
Patching memory...
Offset 0x000000AC: 08 -> 00
Offset 0x000DC0AD: 0F 28 C1 -> 0F 57 C0
Offset 0x000DC0C8: F2 0F 10 05 20 03 0F 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC0ED: F2 0F 10 05 03 03 0F 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC19F: F2 0F 10 05 89 FC 0E 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC1C7: F2 0F 10 05 31 02 0F 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC26D: 0F 28 C1 -> 0F 57 C0
Offset 0x000DC31D: F2 0F 10 05 63 FF 0E 00 -> 0F 57 C0 90 90 90 90 90
Patches have been written to disk.
Code signing... replacing existing signature... signed.
Sent SIGKILL to Dock process.

No wallpaper, no Dock!

See first post. The only thing it needs from the command line tools is the tool codesign_allocate. This is because the Security.framework (the framework that handles code signing) calls this tool to allocate space for the code signature in the binary. Took some digging, but I found it in the framework source code. I've included the tool in the first post, and if you copy it to /usr/bin/, then it will work.

This weekend I will code a GUI app, and in the app I can include the codesign_allocate tool (in the bundle's resources) because the Security.framework respects an environment variable that points to the location of the tool.

Thank you for helping me on this.

TheAngryPenguin
Nov 30, 2012, 08:02 PM
See first post. The only thing it needs from the command line tools is the tool codesign_allocate. This is because the Security.framework (the framework that handles code signing) calls this tool to allocate space for the code signature in the binary. Took some digging, but I found it in the framework source code. I've included the tool in the first post, and if you copy it to /usr/bin/, then it will work.

This weekend I will code a GUI app, and in the app I can include the codesign_allocate tool (in the bundle's resources) because the Security.framework respects an environment variable that points to the location of the tool.

Thank you for helping me on this.
Reverted to my VM's snapshot, copied codesign_allocate to /usr/bin and ran dpatch:

$ sudo ./dpatch patch
Checking Dock version... 1168.6, ready to patch
Checking privileges... we are root.
Importing CS_DockPatch codesign certificate... done.
Importing CS_DockPatch codesign private key... done.
Requesting task for Dock (143)... aquired - taskid: 6347
Searching memory for __TEXT segment... found @ 0x10159A000-0x1017F5000
Reading out decrypted segment (size: 0x25B000)... done.
Patching memory...
Offset 0x000000AC: 08 -> 00
Offset 0x000DC0AD: 0F 28 C1 -> 0F 57 C0
Offset 0x000DC0C8: F2 0F 10 05 20 03 0F 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC0ED: F2 0F 10 05 03 03 0F 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC19F: F2 0F 10 05 89 FC 0E 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC1C7: F2 0F 10 05 31 02 0F 00 -> 0F 57 C0 90 90 90 90 90
Offset 0x000DC26D: 0F 28 C1 -> 0F 57 C0
Offset 0x000DC31D: F2 0F 10 05 63 FF 0E 00 -> 0F 57 C0 90 90 90 90 90
Patches have been written to disk.
Code signing... replacing existing signature... signed.
Sent SIGKILL to Dock process.

The Dock process restarted successfully this time, and the wallpaper reappeared, but the Dock itself remained unchanged.

jfo43
Dec 1, 2012, 10:30 PM
381037 Looks awesome thanks!

j800r
Dec 2, 2012, 11:33 PM
I agree that looks kinda cool but what I've always wanted since upgrading to ML is the old style 3d dock back. The one used since Leopard. That, to me, was one of the most attractive things about OSX and the new dock just feels like a dull regression to me.

Has anyone figured out a way of patching the binary like this to bring back the old style dock? I don't want anyone telling me to downgrade either as that what mean the money spent on upgrading down the drain.

unsanity77
Dec 2, 2012, 11:39 PM
I agree that looks kinda cool but what I've always wanted since upgrading to ML is the old style 3d dock back. The one used since Leopard. That, to me, was one of the most attractive things about OSX and the new dock just feels like a dull regression to me.

Has anyone figured out a way of patching the binary like this to bring back the old style dock? I don't want anyone telling me to downgrade either as that what mean the money spent on upgrading down the drain.

There's no way to do what you ask. The difference in code is just too huge. Here, we're patching a few bytes to change the gradient color from light grey to black, and that's quite easy because a gradient is 3 colors over a region (and the only difference between a color is a single floating-point value). What you're asking would require the source code, or an incredibly time-consuming venture that would take incredible expertise.

fruityth1ng
Dec 3, 2012, 02:37 PM
as the title says: I could hug you right now. Thanks. I *REALLY* wanted my black dock back! :)

If I can help out in any way, let me know. Need an icon for it?

http://www.nimbling.com/temp/BlackDock.png

HoosPhotog
Dec 4, 2012, 10:05 PM
Here's something I came up with to help those who absolutely have to have a black dock. Since Apple moved from image files to CoreGraphics rendering code, the only way to customize the color of the dock is to modify the code.

It can be quite complex as it involves some hacking of the OS, but as I wanted a black dock bad enough to do this, I figured there may be others.




Automatic Method UPDATED:

Coded a program that should handle it for you without the need for any extra tools or files, except the codesign_allocate tool. Hope you enjoy.


usage: dpatch <command>
commands:
patch patch dock to render black
revert revert patches to original (code signature will still be fake)


You must also download the codesign_allocate tool and copy it to /usr/bin/
Keep in mind, again, this will only work for 10.8.2 so far, and will have to be update for future versions.

I just wanted to post my results with the default ML background (may have to find a lighter background) and say thanks! Total coding idiot (had to look up that one uses sudo to execute terminal commands as root) and this took me about a minute. I love it. :D

unsanity77
Dec 5, 2012, 01:38 AM
I just wanted to post my results with the default ML background (may have to find a lighter background) and say thanks! Total coding idiot (had to look up that one uses sudo to execute terminal commands as root) and this took me about a minute. I love it. :D


as the title says: I could hug you right now. Thanks. I *REALLY* wanted my black dock back! :)

I'm glad you like it!

jfo43
Dec 6, 2012, 02:57 PM
You should put together a program for this with multiple color options and a option to turn off and on reflections.It would probably be very difficult but worth it.

unsanity77
Dec 6, 2012, 03:01 PM
Multiple color options: impossible.
Turning off reflections: easy, should've thought of that lol.

deserter
Dec 12, 2012, 09:57 AM
Would it be too difficult for you to make 2 modifications in the program so that 1) We can have Black Dock with NO REFLECTIONS, AND
2) Default Mountain Lion Dock with NO REFLECTIONS again ?

Thank you for ALL YOUR HELP SO FAR. Without your nice thinking it would be pretty much impossible for us (With zero programming knowledge) to do any of this Dock Hacking :)

unsanity77
Dec 12, 2012, 11:15 AM
Would it be too difficult for you to make 2 modifications in the program so that 1) We can have Black Dock with NO REFLECTIONS, AND
2) Default Mountain Lion Dock with NO REFLECTIONS again ?

Thank you for ALL YOUR HELP SO FAR. Without your nice thinking it would be pretty much impossible for us (With zero programming knowledge) to do any of this Dock Hacking :)

Yes that is possible and something that I plan to do. It's finals week this week, so I have been otherwise occupied.

Again, I'm glad it works for most of you and that you enjoy it.

unsanity77
Dec 13, 2012, 07:26 PM
New version of the program, that handles the features requested. You can find it in the first post.

Also, this version does not require codesign_allocate, Xcode, or anything else to be installed. I decided to go the route of removing the signature rather than just resigning it with a self-signed certificate. It has zero dependencies on any other code.

It will now seamlessly change between black and grey docks, with and without reflections. There is also logic that will (hopefully) prevent people from messing up their system, but as always, don't count on that.

use it like this:

sudo dockmod -c black -r

sudo dockmod -c default -r


just drop the -r if you want the icon reflections.

The color options are "black" and "default" for the -c option, and the -r option will disable icon reflections.

richardsim7
Dec 14, 2012, 05:27 AM
Richs-Mac-Pro:~ Rich$ sudo /Users/Rich/Downloads/dockmod -c black
Invalid Dock version.

:confused:

EDIT: I'm still on 10.8.1 - that could explain it

deserter
Dec 14, 2012, 06:58 AM
When I insert the command with the option "black" or "grey" it works flawlessly without the need of codesign_allocate or XCode :p Congrats unsanity77 for making it terribly simple :)

Though, for me, the option "default" gives me the output
[invalid color specified: default]

And except this, when I insert the [-r] argument at the end of the code(with either black or grey) I get :
[dockmod: option requires an argument -- r]
and the NoReflection option does not apply to the dock.

Am I missing something ?

Thank you, for all your help so far, unsanity77

Jessica Lares
Dec 14, 2012, 07:14 AM
Oh my gosh! I love this, looks so cool with my MacBook Pro's bezel. The app works perfect in Terminal.

For anyone that doesn't know how to use Terminal, just write sudo and drag the dockmod app to the Terminal, then the commands and hit enter.

unsanity77
Dec 14, 2012, 09:45 AM
Though, for me, the option "default" gives me the output
[invalid color specified: default]

And except this, when I insert the [-r] argument at the end of the code(with either black or grey) I get :
[dockmod: option requires an argument -- r]
and the NoReflection option does not apply to the dock.

If there's a problem, always try downloading the latest version in the first post. In this case, both of those problems have been fixed.

deserter
Dec 14, 2012, 10:30 AM
Now everything worked like a charm!
Thank you so much for making those modifications I asked you so quickly!

jfo43
Dec 15, 2012, 01:38 PM
It looks great but my dock looks a little wierd.
383774

unsanity77
Dec 15, 2012, 01:41 PM
It looks great but my dock looks a little wierd.
383774

That's what it looks like with no reflections.

turkington
Dec 15, 2012, 01:50 PM
unsanity77 you are THE BEST!

Thank you so much. I am a complete newbie when it comes to code and I managed to so this. Incredibly easy.

Been dying for a black dock. Was given the impression it was impossible. So much awesomeness!
Its just how it was meant to be.

Very very much appreciated and thanks again! :D

unsanity77
Dec 15, 2012, 01:54 PM
Thank you very much.

To help others out, point them here. I'll keep the program updated for as long as I can, and if there comes a time when I can no longer update it, I'll release the source code and let someone else take over.

jfo43
Dec 15, 2012, 05:53 PM
No I mean the dock has a different shape. 383801

jfo43
Dec 15, 2012, 07:21 PM
never mind i just reset the dock

Dafnos3
Dec 16, 2012, 03:04 PM
thanks unsanity77! took me a few tries but i got it to work. looks great!! :D

deserter
Dec 17, 2012, 09:18 AM
A little bit off-topic here, but I would really like to ask you something unsanity77.

In your first post u included a tutorial of making the dock black MANUALLY.

Inside the .txt file u had a screenshot attached.

What I would really want to learn is:

1) How did you manage to change the color of your menubar ?

[Before Lion I knew that you could do this with Themepark 4.1 ,(Modifying the SartFile.bin [In which the resource for the menubar color resides])). But from Lion onwards the Developer didn't update the app so you couldn't use it.

You could however use the Themepark 3.1 app (and u still can in Mountain Lion. For some reason it is surprisingly running, though it is crashing occasionaly) to modify ANY .rsrc file(Like Extras.rsrc) or the color of the LETTERS on the menubar(Which I did).

But to modify the color of the letters on the menubar,the color of the letters of the dropdown menus on the menubar OR the color of the letters of the DOCK menus is pretty useless for me if you can't modify the actual color of the menubar :p

I already know that there are themes like "levantinlynx_10_8_10_8_2_mountainlion_menu_bar_by_levantinlynx" but I am REALLY interested in a way of doing this MANUALLY so I can modify everything in photoshop (like I did before Lion) according to my liking and use it later for customization of many things including the menubar :p

2) Is the font in the dropdown menus on the menubar different in your screenshot than the default used in Mountain Lion ? (I think so) . And, if so, How did u manage to change ONLY the font of the dropdown menus on the menubar ? Is there any way that I can do this Globally ? (So that every thing on my Mac can use the e.g. Helvetica Nueue Font :p)


I don't want to eat much of your precious time so please when you find some time give me a brief answer in those 2 questions.

THANK YOU for all your help so far and sorry for my bad English :p

unsanity77
Dec 17, 2012, 04:56 PM
deserter, I honestly don't know about the menu bar. I just used the LeviantLynx installer to get it... sorry!

jfo43
Dec 17, 2012, 06:07 PM
http://levantinlynx.com/

download the menubar and install for a new menubar.Also install Istat menus (just use utorrent) for clock.

May I also recommend logonox to change logon screen and mountain tweaks to change other options.

Teakuno
Dec 22, 2012, 03:01 AM
http://levantinlynx.com/

download the menubar and install for a new menubar.Also install Istat menus (just use utorrent) for clock.

May I also recommend logonox to change logon screen and mountain tweaks to change other options.

iStat menus is an excellent app and I suggest buying it rather then "just use[ing] utorrent"...

Also thanks unsanity...

Ddyracer
Dec 22, 2012, 03:36 AM
Oh my gosh! I love this, looks so cool with my MacBook Pro's bezel. The app works perfect in Terminal.

For anyone that doesn't know how to use Terminal, just write sudo and drag the dockmod app to the Terminal, then the commands and hit enter.

Did that and terminal didn't recognize it. What you have to do is write the whole sudo command and then drag in the zip file. then hit enter. Once you do that it will say how sudo is dangerous and you know its right.

Ddyracer
Dec 22, 2012, 04:02 AM
BTW, how do i revert back to original dock if i do this?

bedifferent
Dec 22, 2012, 11:36 AM
Great work! The new version fixed the graphical issues from previous revisions such as the menubar changing/becoming inactive. Works great on 10.8.2 and the recent 10.8.3 beta release.

Jmx
Dec 24, 2012, 08:54 PM
unsanity77, Thanks for the program.

Apple should have included some options for changing the dock, at least a light and dark option.

Your black dock looks way better than the original light grey.

xxPatangTangxx
Dec 26, 2012, 11:37 PM
So I'm not really good at this whole terminal and coding stuff but I tried to use my knowledge of what you guys posted here BUT i can't figure it out... I'm on 10.8.2. Can someone give me some steps on how to do it...I hate looking at this ugly grey dock...

thanks :)

unsanity77
Dec 27, 2012, 12:28 PM
Copy dockmod to your desktop.
Open Terminal.app.
In Terminal, type the following (or copy and paste from here):
sudo ~/Desktop/dockmod -c black

Life,Death,Tech
Dec 28, 2012, 12:34 PM
Thanks for making this program! It looks fantastic and was way easier to use than I thought it would be. Still debating whether I prefer reflections on or off.

TheAngryPenguin
Dec 29, 2012, 01:34 AM
Thanks for making this program! It looks fantastic and was way easier to use than I thought it would be. Still debating whether I prefer reflections on or off.
I'm actually digging the reflections with the black Dock:

http://pavelec.net/adam/ML-Dock2.png

(Indicators are sourced from here (http://leoparddocks.com/sites/default/files/BlueLEDindicator.zip), and as I mentioned over here (http://forums.macrumors.com/showpost.php?p=16100107&postcount=128), they seem to overlap my MBP's bezel, which is really nice...)

Hermoon
Dec 30, 2012, 07:20 PM
thx!

76ShovelHead
Jan 2, 2013, 03:23 AM
Here's something I came up with to help those who absolutely have to have a black dock. Since Apple moved from image files to CoreGraphics rendering code, the only way to customize the color of the dock is to modify the code.

It can be quite complex as it involves some hacking of the OS, but as I wanted a black dock bad enough to do this, I figured there may be others.




Automatic Method UPDATED:

Coded a program that should handle it for you without the need for any extra tools or files. It performs a static decryption on the file and removes an integral part of the code signature to bypass the signing process rather than fake codesigning the binary as I did in previous versions.

Consider this BETA software, and post if you have problems, and I will try to improve it.

usage:
dockmod -c <color> -r

-c, --color color to make the dock ('default' or 'black')
-r, --noreflections disable icon reflections


Keep in mind, again, this will only work for 10.8.2 so far, and will have to be updated for future versions.

use it like this:

sudo dockmod -c black -r


The color options are "black" and "default" for the -c option, and the -r option will disable icon reflections.

This is what it looks like:

Love it! Thanks :D

1920s
Jan 5, 2013, 07:15 AM
Dear unsanity77,

I'm sorry to bother you with this, but I was wondering is there any way to make the dock display a wooden pattern?

Like for example:
http://i49.tinypic.com/161ygm0.png

Any info would be greatly appreciated!

Have a lovely day!
Michelle

unsanity77
Jan 5, 2013, 01:25 PM
Michelle, unfortunately there is not a way to have it display a pattern.

The reason for this is because what I have done is simply zero out the color value. In machine code, there is an instruction (command) that moves a floating-point value into a floating-point register in the cpu. This floating-point value is a value between zero and one with zero being black and one being white, and decimal values in between would be a shade of gray (light grays being closer to one and dark grays being closer to zero). My program simply overwrites the instruction that moves the gray value into this register with an instruction that zeroes out the register instead, therefore making it zero (black). Using this simple method there is no way to make it any other color other than gray (because the code for that does not exist already in the program) but I also cannot even make it any other color than black because the length of the instruction to do that would be longer than the instruction that is already there and would overwrite code that we needed still.

TL;DR
Because we are patching the binary we have a lot of limitations in what we can do, and so all we can do is make it black like I have done.

tigres
Jan 5, 2013, 01:30 PM
Dear unsanity77,

I'm sorry to bother you with this, but I was wondering is there any way to make the dock display a wooden pattern?

Like for example:
Image (http://i49.tinypic.com/161ygm0.png)

Any info would be greatly appreciated!

Have a lovely day!
Michelle

Scott got fired for similar wooden schemes. :D

unsanity77
Jan 5, 2013, 01:33 PM
That made me laugh out loud.

commodore-64
Jan 5, 2013, 11:12 PM
Hi unsanity:

I'd like to see your original patch scripts instead of the automatic patcher. The thing is that I'd like to learn how to patch the dock binary myself to get it to do something else (custom minimize behavior).

I don't know what is involved in patching an apple encrypted binary. I have tried reading the Dock binary with hopperapp and getting it to output the file unmodified using "Produce New Executable" menu option, but it ends up generating a broken Dock binary. If I replace the original Dock binary with the regenerated one, the Dock does not start.

I have also tried replacing the Dock binary with the output from the deprotect program, but the program generates a few warnings when it runs, so I am not comfortable using its output.

I am not sure if one has to re-encypt the binary after decrypting it. I don't understand why that would be necessary.

unsanity77
Jan 6, 2013, 01:58 AM
The original patch scripts still used a program that I wrote, except that program just attached to the Dock process and dumped the decrypted code from memory. You can do this manually by using vmmap to find the __text section and then using gdb to dump that address by using the dump binary memory command.

In dockmod, I just use the key that I reversed and calls to BF_cbc_encrypt.

BoubakAy
Jan 7, 2013, 07:39 AM
Hi everybody, I'm new to this forum ;)
Maybe it's stupid, but I don't know how use your dockmod progrm at all ^^'
When I open it in Terminal, there's nothing happen...
TIA

EDIT : Sorry, I just saw the post which explain this perfectly... It's ok, and congratulations for this little program ;)

commodore-64
Jan 8, 2013, 10:57 PM
As it turns out, if I modify the Dock myself using my own patches, then the Dock refuses to start again. I get constant crashes with the following:

Exception Type: EXC_CRASH (Code Signature Invalid)

To avoid this, I have to create a self-signed certificate and code-sign the Dock binary myself. This procedure is mentioned here:

http://forums.macnn.com/79/developer-center/355720/how-re-sign-apples-applications-once/

If I don't do this, then the Dock won't start.

I noticed that your dockmod program solves this problem by unsigning the Dock binary. How does one unsign a code-signed binary without having to resign it (like I had to do)?

Indigo:MacOS commodore_c64$ codesign -d Dock
Dock: code object is not signed at all
Indigo:MacOS commodore_c64$ codesign -d Dock.orig
Dock.orig: invalid signature (code or signature have been modified)
Indigo:MacOS commodore_c64$

urbantea
Jan 11, 2013, 01:52 AM
OKay, I cant' get this to work. I downloaded your dock program. Ran it and it takes me to this screen

usage:
dockmod -c <color> -r

-c, --color color to make the dock ('default' or 'black')
-r, --noreflections disable icon reflections


and thats it

I exit the thing and thats it. Nothing happens to my dock, it's not black.

Am I supposed to do something at those screens? It wont let me type anything. I can't press "c" or anything. Now what???

----------

and when you said this

use it like this:
Code:

sudo dockmod -c black -r

sudo dockmod -c default -r

just drop the -r if you want the icon reflections.

The color options are "black" and "default" for the -c option, and the -r option will disable icon reflections.


Where do I do that? Where do I type/post this stuff?? In terminal? I did that, nothing happens...

----------

nvemrind, go tit. haha

unsanity77
Jan 11, 2013, 04:10 AM
I noticed that your dockmod program solves this problem by unsigning the Dock binary. How does one unsign a code-signed binary without having to resign it (like I had to do)?

Think about it. When a binary gets codesigned, what does that mean? How does the OS tell the difference between a signed and an unsigned binary? Well, there's metadata in the mach-o file, information that codesign adds to the binary. All I do is remove some of this information. Specifically, I remove the LC_CODE_SIGNATURE load command, and then fix up the mach header.

turtlez
Jan 11, 2013, 09:38 PM
Thank you :)

deepsilver
Jan 13, 2013, 09:48 PM
Hello guys I have one question. How do I make my dock look like this? My dock currently looks like this but it is not permanent. I dont know how it happened. When I restart my mb it disappears. Is there anyway to set this dock as default?
Thanks in advance!

cubbie5150
Jan 13, 2013, 10:35 PM
Thanks for making this mod very easy to implement for idiots like me, very much appreciated!

Omek
Jan 21, 2013, 10:33 PM
Thank you so much for making this! I just upgraded and was blinded by that light-grey dock. And none of my customizing apps worked. Apple should really just implement a black dock feature. Not everyone wants that bright dock.

Killa Aaron
Jan 27, 2013, 06:48 AM
I can confirm that this works on 10.8.3 (12D61), beautiful work unsanity77.

M0esmac
Jan 27, 2013, 09:14 AM
I sorry if I missed it, I downloaded program from first post and it doesn't work. Once I opened it with terminal it showed as [Process Complete], dock didn't change. Do I have to restart or something? I tried killall Dock, but didn't work.

Thanks

Dafnos3
Jan 27, 2013, 01:43 PM
Here's a screen shot of my dock. I think it looks pretty good!! :D

Luis2004
Jan 28, 2013, 08:21 AM
Wow, great work! Looks awesome on my screen.

denisvj
Jan 28, 2013, 09:31 AM
I`m getting " sudo: dockmod: command not found " and don't know why.

I have the file in the right folder and running sudo inside the folder :confused:

ML 10.8.2

Update: Added ./ and worked !! ( sudo ./dockmod -c black )

Thanks for the mod !

viciousx23
Feb 1, 2013, 01:41 PM
First off, gotta give a BIG thanks unsanity77 for making this black dock happen!

However, seeing as I'm a complete noob to this, I don't exactly know to edit the following lines below so that my dock is darker. Could anyone guide me in the right direction here? :D

----
Patch 0xDC0AD to 0F 57 C0
Patch 0xDC0C8 to 0F 57 C0 90 90 90 90 90
Patch 0xDC0ED to 0F 57 C0 90 90 90 90 90
Patch 0xDC19F to 0F 57 C0 90 90 90 90 90
Patch 0xDC1C7 to 0F 57 C0 90 90 90 90 90
Patch 0xDC26D to 0F 57 C0
Patch 0xDC31D to 0F 57 C0 90 90 90 90 90

Patch 0xAC to 00 (so kernel doesn't attempt to decrypt what's already decrypted)
----

unsanity77
Feb 1, 2013, 01:48 PM
Just use the program downloaded from the first post in this thread, it automates the process so you don't have to edit the binary by hand anymore.

viciousx23
Feb 1, 2013, 04:56 PM
Oh ok, gotcha. I mistakenly thought that by editing the above code into the Dock app I could get an even darker "true" black color as opposed to the zip file that you posted in the first post. Thanks for the clarification. :p

Oh and one more thing. Is there any way I could make the reflections so that it's crisper in detail instead of being half blurred out? If so, which file(s) do I have to edit for that to happen?

fsck-y dingo
Feb 2, 2013, 09:13 PM
I like this a lot. Thanks unsanity!

snickers2k
Feb 6, 2013, 06:56 AM
thanks a lot for this script! i searched so long for this!

ps. i found this theme:
http://furby8704.deviantart.com/art/Black-OSX-Mountain-Lion-324410068
and was wondering if this docktheme really works?!

TheSacredSoul
Feb 6, 2013, 08:15 AM
Doesnt work for me. Still on this fugly dock. The dock restarts after i hit enter on the script but it comes back to this dock. On ML 10.8.2 on a MBA late 2010.

http://i.imgur.com/bqm1yDq.png

Teakuno
Feb 6, 2013, 11:12 AM
Doesnt work for me. Still on this fugly dock. The dock restarts after i hit enter on the script but it comes back to this dock. On ML 10.8.2 on a MBA late 2010.

Image (http://i.imgur.com/bqm1yDq.png)

Just guessing but I believe you have to turn off the 2d dock first. Try Mountain Tweaks app: http://tweaksapp.com/app/mountain-tweaks/

unsanity77
Feb 6, 2013, 02:26 PM
Doesnt work for me. Still on this fugly dock. The dock restarts after i hit enter on the script but it comes back to this dock. On ML 10.8.2 on a MBA late 2010.

In Terminal.app, type the following and press <enter>:
defaults write com.apple.dock no-glass -bool NO

And then:
killall Dock

TheSacredSoul
Feb 6, 2013, 06:38 PM
In Terminal.app, type the following and press <enter>:
defaults write com.apple.dock no-glass -bool NO

And then:
killall Dock

Fantastic! That worked! Thank you!

Could you please explain to me what was the problem? Was I using a different dock than the stock dock? Just for reference. :o

Teakuno
Feb 6, 2013, 07:43 PM
In the past you used a simaler terminal command or an app similar to Mountain Tweaks to change your dock to the 2d dock that is normally used only when you set the dock to appear on the side of the screen.

2Turbo
Feb 19, 2013, 05:56 PM
YAY! I never thought there'd be a black dock in ML! Thanks much!

This is my most hoped for visual tweak. We have black menubar, but I was used to black dock from Lion (CandyBar). Hopefully you keep it updated for continued compatibility.

Is it safe to use? When updating OSX in future, could it break something or would it just revert to old dock?

unsanity77
Feb 20, 2013, 04:50 PM
It would not break anything to update, you would just end up with the default dock.

Also, it is safe.

scubus
Feb 27, 2013, 05:43 PM
I don't post often, but I wanted to thank you for this nifty little app....

zambz
Mar 2, 2013, 09:13 PM
Really awesome app indeed. I'm sorry to ask, but is it possible to incorporate more colours and transparency alterations with this mod?

Keep up the great work!

unsanity77
Mar 2, 2013, 09:56 PM
Thank you. I'm sure glad people find it useful.

There might be a way to incorporate more colors and/or transparency. I looked into it a couple of weeks ago, and realized that I probably could, most likely by injecting a framework and overriding the entire functions rather than patching the code in them. It would require a fair bit of work though, but keep an eye out here over the next couple OS X updates and see how it progresses. I intend to get around to it sometime, definitely.

viciousx23
Mar 4, 2013, 07:38 AM
Everything was working perfectly until today, when for some reason I noticed that my dock reflection was misaligned once I killed the dock. Does anyone have a fix to this?

http://i.imgur.com/5m4ru9v.jpg (http://imgur.com/5m4ru9v)

***EDIT***
Never mind, I manually used TransDock X to hide the dock and undo it, and it fixed itself. Strange, but hey, whatever works! ;D


Also while I'm at it, is it possible to make my reflections less blurry by any chance? Thanks in advance. :D

moutian
Mar 14, 2013, 07:41 PM
The beautiful black dock turned white in 10.8.3. Is there an update to hack it?

unsanity77
Mar 14, 2013, 07:42 PM
There will be soon! Along with a host of other features that I'm adding.

TheAngryPenguin
Mar 14, 2013, 07:56 PM
I just ran the GUI version and didn't run into any problems.

moutian
Mar 14, 2013, 09:24 PM
Originally I used the command line method to apply the mod in 10.8.2. After updating to 10.8.3, I tried the gui method, and I can confirm it works on 10.8.3. Great job!

symo
Mar 16, 2013, 02:05 PM
I too can confirm the GUI method works like a charm. :)
Thank you so much!

jivhg
Mar 17, 2013, 12:08 PM
There will be soon! Along with a host of other features that I'm adding.

Will you open source this code ever?

2Turbo
Mar 17, 2013, 10:10 PM
There will be soon! Along with a host of other features that I'm adding.

1) Is there a way to reduce the icon reflections, but not remove them?

2) Can I change the dock color to a lighter black (dark gray) color, so that on black backgrounds it isn't so jet black?

3) Would love if you could include the white light indicators from KillaAarons release: http://killaaaron.deviantart.com/art/Nocturne-Theme-For-Mountain-Lion-326453358

Thanks!

chaplinb
Mar 18, 2013, 03:21 PM
Thanks, this looks really awesome!

I can confirm the GUI Tool works 100% on Mountain Lion 10.8.3, and was precisely what I was looking for :D.

I can't thank you enough for making this tool free.

unsanity77
Mar 24, 2013, 10:02 PM
Thanks, this looks really awesome!

I can confirm the GUI Tool works 100% on Mountain Lion 10.8.3, and was precisely what I was looking for :D.

I can't thank you enough for making this tool free.


Thank you all for your interest in the program. I have actually spent the last few weeks working really hard on adding some much-requested features here. I looked into another way of hooking into the Dock application, and it turned out to work quite nicely, and so I was able to do quite a lot with it. As it stands right now, the current form of the application will allow you to choose any color for your dock (from pink to green to purple -- and yes, black). You pick 5 different colors and it will form a gradient for your Dock. Additionally, you can choose different gradient themes for EACH SPACE in your OS X desktop, and the dock will change colors as you switch spaces.

I am planning on adding the ability to choose image files as well, as that can easily be done. Reflection opacity, icon tint overlays, etc. are all ideas in my head at the moment as well -- it just takes time to implement them. So they will be added to the program some time in the near future.

For now, my plan is to get this out there as quickly as possible, but I want it to be rock-solid stable. The problem with hooking into apps like this is it can cause stability issues and crashes, etc. and in a process like the Dock this will completely cripple your system. Which reflects badly on the developer, since it's my job to make sure it doesn't happen.

In the end, what this means is that I will be releasing a paid version of the app. I will continue to support the dockmod that is on this forum and release updates to it free of charge, but the new features I'm adding will be an entirely separate product for which I will charge a very modest fee. But, you will still be able to change your dock to black for free, forever.

1) Is there a way to reduce the icon reflections, but not remove them?

2) Can I change the dock color to a lighter black (dark gray) color, so that on black backgrounds it isn't so jet black?

3) Would love if you could include the white light indicators from KillaAarons release: http://killaaaron.deviantart.com/art/Nocturne-Theme-For-Mountain-Lion-326453358


Good feature requests. Yes, there is a way to reduce the icon reflections and I will look into adding that. I will not include the light indicators, however, as they are already available from killaaron.

Will you open source this code ever?

I've thought about this, and I mentioned before that I would if I stopped developing it. But the deal with that is that I'd only really be open-sourcing the method I use to patch, not exactly what I'm patching, and definitely not how I'm patching. It takes an incredible amount of reverse-engineering to come up with hooks such as this, and when they break on a new OS X release (which they are likely to do), it still requires intimate knowledge of how the hooked application works to know what to do and what functions to look at in order to fix it. So, basically, having the source to this app will not help you if you don't know how to go about finding where in the Dock process you need to patch.

Ontonator
Mar 25, 2013, 05:14 PM
If you can do this, then would you be able to change the Dock back to the original image rendering method? Then we could change our dock to anything we want!

kemo
Mar 29, 2013, 09:55 AM
oh, thank you for this! Finally I can have a dark dock on ML, I really get used to in on SL.

rshroff2
Mar 29, 2013, 09:55 PM
Thanks for the GUI program so it changes it without having to do anything special!

Looks really nice with Jaku icons.

2Turbo
Mar 30, 2013, 01:01 PM
Awesome! I don't mind paying a little for an awesome app. Just make sure you take PayPal. :)

I was wondering if it's possible to make it matte and remove all transparency from the dock?

tekboi
Mar 31, 2013, 01:28 PM
going to try this today. will look nice w/ my layout.

ssn637
Apr 2, 2013, 04:27 AM
Unsanity77

Is there anyway to override the default version check in the application so we can try this with 10.8.4?

Cheers!

unsanity77
Apr 2, 2013, 07:59 AM
That wouldn't be a good idea. DockMod doesn't check your OS version... instead it checks the build version of the Dock.app. If the build version is different than what it expects, then that means the offsets of functions in the binary will be different. And since the current DockMod just statically patches bytes at certain offsets, then these offsets are most certainly going to be incorrect.

With that said, if you are intent on experimenting, take a look at the patches.plist file inside the GUI dock mod resources folder. There you'll see a dictionary of patches under the key "1168.6" or something like that (going off of memory). That 1168.6 is the Dock build version that DockMod matches the patches to. You can change that number to the number found for CFBundleVersion in the Dock.app/Contents/Info.plist. Just keep in mind that if your Dock crashes, you should know how to use the command line to restore a backup (and make a backup first)!

The DockMod app that I'm just finishing up now, however, does not just statically patch. It's a smart patcher, and will likely persist through different Dock build versions. It is very close to being finished, just finishing up some code to handle adding an image to your dock instead of just colors, as well as a PSD template so you guys can make your own images.

Here's a preview of the new DockMod:

unsanity77
Apr 2, 2013, 08:06 AM
Thanks for the GUI program so it changes it without having to do anything special!

Looks really nice with Jaku icons.

I like that look. Those icons are pretty sexy.

ssn637
Apr 2, 2013, 09:01 AM
I'll pay for that. Let us know when it's ready. Great job!

iktikt
Apr 4, 2013, 06:57 PM
http://1.bp.blogspot.com/-IzbJR72Glp8/UOxoswoqbaI/AAAAAAAAMUY/CWg4-zYPLC0/s1600/frydogjpg.jpg

srsly. Sub'd.

haxrnick
Apr 10, 2013, 07:18 PM
Thanks for the GUI program so it changes it without having to do anything special!

Looks really nice with Jaku icons.

How'd you get the Jaku icons? I'm not familiar with modding OSX. Is it similar to iOS?

rshroff2
Apr 10, 2013, 07:34 PM
How'd you get the Jaku icons? I'm not familiar with modding OSX. Is it similar to iOS?

I pulled most of the icons from the Kali theme from cydia and the rest were from jakurepo.com. I then used candybar to replace the stock icons.

Duardo
Apr 14, 2013, 07:46 AM
This is great!

I was curious..some people didn't like how the background of the dock would change to whatever is above the dock, but I personally really liked it. Is there a way to either add that to the program or give a possible guide on how to do so?

haxrnick
Apr 20, 2013, 12:13 PM
Any word on the update? I'm on 10.8.4 and missing the black dock.

RubiksGuy
Apr 22, 2013, 07:49 PM
Thanks so much! It worked for me to get the dock back to it's default look

ssn637
Apr 24, 2013, 06:19 AM
Any word on the update? I'm on 10.8.4 and missing the black dock.

Sorry, Unsanity77, can't wait any longer: We're up to the 4th 10.8.4 release and it's time to move on without the black dock. I for one am going to miss it!

Salut and hope to hear from you soon

unsanity77
May 7, 2013, 02:30 PM
Just to quickly address the status. The program is complete, has been for a couple weeks now. I've added far too many features and have actually had to force myself to stop adding things, otherwise it would never get released. However, there is a lot more to it than just writing the software -- i.e. I've had to make a website, software-licensing, PayPal account integration, testing on each beta release of 10.8.4, etc... all the boring stuff that to me seems a complete waste of time, but are actually necessary. Not to mention that finals for school are coming up in a week.

In any case, where things stand now, it is being beta tested by a modest number of people and the back end of things are being put together. I'm confident the release will be in less than a week, but no more than 2 weeks at maximum. I'm excited to see what everyone thinks of the software, as it allows you to do things with your dock that hasn't been done before!

Everyone who donated for the black dock version will receive a discount coupon equal to the amount of your donation. Thank you for your early support.

It will be live here soon: www.dockmod.com

Boogsephine
May 7, 2013, 03:13 PM
Sorry, Unsanity77, can't wait any longer: We're up to the 4th 10.8.4 release and it's time to move on without the black dock. I for one am going to miss it!

I'm still on 10.7.5 on my iMac and MacBook Pro. I downloaded the .zip from the first page but apparently it only works on 10.8. If I buy the OS update from the App Store, si it going to be something too new to run the black dock feature? I've seen a lot of negative reviews about 10.8+ but I would like to have Reminders and Memo to sync with my iPhone.

Manic Harmonic
May 10, 2013, 03:09 AM
I'm still on 10.7.5 on my iMac and MacBook Pro. I downloaded the .zip from the first page but apparently it only works on 10.8. If I buy the OS update from the App Store, si it going to be something too new to run the black dock feature? I've seen a lot of negative reviews about 10.8+ but I would like to have Reminders and Memo to sync with my iPhone.

This app is not necessary in lion. Go to leoparddocks.com, download the leoparddocks app, and browse through the docks there, there's plenty of nice-looking black ones.

Boogsephine
May 12, 2013, 05:25 PM
This app is not necessary in lion. Go to leoparddocks.com, download the leoparddocks app, and browse through the docks there, there's plenty of nice-looking black ones.

Awesome! Thanks. Just downloaded it and have a really nice dock now. :)

Ddyracer
May 14, 2013, 06:20 AM
I can't get the video to play, is that something that will be fixed soon?

ssn637
May 16, 2013, 09:25 AM
Hi unsanity77

The web site looks great! Looking forward to the final release...

mileslong
May 21, 2013, 03:36 PM
this is an awesome addition, worked perfectly on 10.8.3 but alas doesn't work yet on 10.8.4 but im sure that will come. keep up the great work!

unsanity77
May 22, 2013, 10:15 AM
Thanks everyone for your patience. DockMod v1.0 is now live at www.dockmod.com OR www.spyresoft.com

Currently, DockMod supports OS 10.8.2 and 10.8.3. There will be an update for 10.8.4 soon. You can check for updates from the Action menu.

There is an FAQ page at http://spyresoft.com/faq/ that tries to answer some of the more important questions. The trial is limited to 1 hour before DockMod will restart your dock and disable itself. However, you can re-enable it to try it for another hour, and you can do this an unlimited amount of times. Obviously, I'm hoping that if you find it useful, that you pay the modest $8.

Any support questions should be directed to support@spyresoft.com because I don't want to use MacRumors as a support forum for my software and will not respond to support questions made here. I am excited for this release and will read every email, but may not respond to all of them.

I am particularly interested in bug reports and feature requests. If you find a bug, please notify bugs@spyresoft.com or use the widget at the bottom of spyresoft.com home page. I will do my best to fix every bug as fast as possible.

Please read over the FAQ and familiarize yourself with recovery options in case of instability.

Thanks to everyone who gave their support. I hope you enjoy DockMod.

Jessica Lares
May 22, 2013, 10:27 AM
Oh wow! The update looks GREAT! I'm definitely coughing up some money! Just give me a few hours to see if my payment goes through.

Ddyracer
May 22, 2013, 12:19 PM
Thanks everyone for your patience. DockMod v1.0 is now live at www.dockmod.com


Are your going to support changing the separator/indicators any time soon?

Oh also, i can't get rid of the shine unless get rid of a custom floor which sucks.

2Turbo
May 22, 2013, 07:25 PM
Are your going to support changing the separator/indicators any time soon?


This. I made some custom indicators and have manually replaced them, but I would love an integrated feature to make things easier/faster!

Otherwise, this is brilliant!

ssn637
May 23, 2013, 09:50 AM
Working just fine in the latest build of 10.8.4 and looking great! Gladly paid for this one. Perhaps a free version for those who just need a black dock, as promised earlier, could be made available to this forum?

unsanity77
May 23, 2013, 10:09 AM
Perhaps a free version for those who just need a black dock, as promised earlier, could be made available to this forum?

Of course, but only when 10.8.4 is golden master, and available for official download.

Though thank you for reminding me, I will move the black-only version to the website and update it as necessary too.

maflynn
May 23, 2013, 10:18 AM
[MOD NOTE]
Thread closed as its now more about working with an application. That is, its no longer a UI customization topic.