Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'One method of changing the search engine in Safari' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
One method of changing the search engine in Safari
Authored by: samsprograms on May 12, '03 09:12:26PM
In terminal I type:

strings /Applications/Safari.app/Contents/MacOS/Safari

and i get a ton of results. I do a search for "Google" and after a bit find the following lines a bit interesting:

http://%@.google.com/%@?q=%@&ie=UTF-8&oe=UTF-8
%@&cat=%@
http://%@.google.com/%@
&cat=
&cat=%@
GoogleSearchChannel
SearchChannel
GoogleSearchChannel.m

I'm 99.9% sure these bits of the source code have to do with the address of the search engine used. I know that %@ is used in Cocoa to replace bits of a string with other things...
The first line seems particularly interesting because when aI do a search for "apple" for example
http://www.google.com/search?q=apple&ie=UTF-8&oe=UTF-8
definitely is
http://%@.google.com/%@?q=%@&ie=UTF-8&oe=UTF-8
with the %@ ts replaced.....

--
Sam

[ Reply to This | # ]
One method of changing the search engine in Safari
Authored by: r0adrage on May 14, '03 01:53:32PM

Yup. I changed my "search engine" on safari by editing the binary and replacing that google url with my own. I used "vi" to edit it. First make a backup copy of the Safari executable, then open it up in vi, search for "google" until you get to the url and edit away. Make sure the new url is exactly the same length as the google url (pad it wil meaningless url parameters if needed), or else it will screw up the binary.

When I saved, the file is 1 byte longer than the original, which is puzzling, but it still works, so whatever.

(if that's not enough instructions, you probably shouldn't be messing with it ;)



[ Reply to This | # ]
One method of changing the search engine in Safari
Authored by: samsprograms on May 14, '03 03:33:53PM

I did it in HexEdit got the same results. I don't know how i would make a longer string or use less %@s though.....



[ Reply to This | # ]