Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
Not open for further replies.

unsanity77

macrumors member
Original poster
Nov 22, 2012
67
0
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:

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


To use the command-line dock mod,
Code:
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:
Code:
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:
 

Attachments

  • Screen Shot 2012-12-05 at 1.33.11 AM.png
    Screen Shot 2012-12-05 at 1.33.11 AM.png
    929.4 KB · Views: 5,330
  • dockmod.zip
    4.8 KB · Views: 4,545
  • dockmod (GUI).zip
    633.2 KB · Views: 4,099
Last edited:

gumblecosby

macrumors 6502
Jun 22, 2010
298
6
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

macrumors member
Original poster
Nov 22, 2012
67
0
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!
 

3282868

macrumors 603
Jan 8, 2009
5,281
0
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

macrumors member
Original poster
Nov 22, 2012
67
0
Ahh yes, thanks for pointing that out! Will edit the original post to reflect this.
 

3282868

macrumors 603
Jan 8, 2009
5,281
0
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

macrumors member
Original poster
Nov 22, 2012
67
0
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
 
Last edited:

Wich

macrumors newbie
Nov 24, 2012
7
0
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? :)
 

Attachments

  • Screen Shot 2012-11-24 at 11.35.45 PM.png
    Screen Shot 2012-11-24 at 11.35.45 PM.png
    527.4 KB · Views: 1,659
  • Screen Shot 2012-11-24 at 11.35.48 PM.png
    Screen Shot 2012-11-24 at 11.35.48 PM.png
    1.3 MB · Views: 1,992

unsanity77

macrumors member
Original poster
Nov 22, 2012
67
0
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

macrumors member
Jun 4, 2012
58
0
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

macrumors newbie
Nov 24, 2012
7
0
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)...
 
Last edited:

symo

macrumors newbie
Nov 7, 2008
10
0
Italy
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).

I'm afraid I'll have to give up. :(
Thank you anyway.
 
Last edited:

unsanity77

macrumors member
Original poster
Nov 22, 2012
67
0
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

macrumors newbie
Nov 7, 2008
10
0
Italy
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

macrumors member
Original poster
Nov 22, 2012
67
0
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.
 

Attachments

  • Screen Shot 2012-11-25 at 3.45.55 PM.png
    Screen Shot 2012-11-25 at 3.45.55 PM.png
    687.8 KB · Views: 773
  • Screen Shot 2012-11-25 at 3.45.11 PM.png
    Screen Shot 2012-11-25 at 3.45.11 PM.png
    1 MB · Views: 704
  • Screen Shot 2012-11-25 at 3.44.55 PM.png
    Screen Shot 2012-11-25 at 3.44.55 PM.png
    967.3 KB · Views: 720
  • Screen Shot 2012-11-25 at 3.48.58 PM.png
    Screen Shot 2012-11-25 at 3.48.58 PM.png
    547.2 KB · Views: 735
Last edited:

Mal

macrumors 603
Jan 6, 2002
6,252
18
Orlando
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
 

3282868

macrumors 603
Jan 8, 2009
5,281
0
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

macrumors member
Original poster
Nov 22, 2012
67
0
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.
 

3282868

macrumors 603
Jan 8, 2009
5,281
0
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

macrumors member
Original poster
Nov 22, 2012
67
0
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.
 

3282868

macrumors 603
Jan 8, 2009
5,281
0
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

macrumors member
Oct 1, 2012
39
0
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), but I reverted to Dock.app v.10.8.2 from a backup before attempting to run the auto-patcher. Here's the output:

Code:
$ 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.
 
Last edited:
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.