-
-
Save yeongheon/76bb967544392c5c731fafaade054da5 to your computer and use it in GitHub Desktop.
KakaoTalk+: No More Search Pane (macOS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Hiding Daum search pane in the KakaoTalk | |
# rearticulated for Python 2.7.10 (/usr/bin/python) | |
# $ sudo /usr/bin/python KakaoTalk+.py | |
# $ nohup /Applications/KakaoTalk.app/Contents/MacOS/KakaoTalk+ </dev/null >/dev/null 2>&1 | |
# original(node) : https://gist.github.com/kiding/36cfbbe6ab35ab93b5fdbd67a9fa3aba | |
import subprocess, re | |
# const | |
target = 'showSearchPane' | |
bin_input = '/Applications/KakaoTalk.app/Contents/MacOS/KakaoTalk' | |
bin_output = '/Applications/KakaoTalk.app/Contents/MacOS/KakaoTalk+' | |
# get metadata from binary | |
command = 'objdump -macho -objc-meta-data'.split() | |
command.append(bin_input) | |
popen = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
dump, error = popen.communicate() | |
if popen.returncode != 0: | |
print error | |
quit() | |
# get address from dumpdata | |
regex = target + "\n.+?imp\s(0x[0-9a-f]+)" | |
matches = re.search(regex, dump, re.UNICODE | re.DOTALL) | |
if matches == None: | |
print "Failed to find the method " + target + "\n" | |
quit() | |
addr = matches.groups()[0] | |
print "Found " + target + " at " + addr + "\n" | |
# modify hex data in the given address | |
binary = bytearray(open(bin_input, 'rb').read()) | |
binary[int(addr, 16) - 0x100000000] = 0xC3 # RET | |
for i in range(16): | |
binary[int(addr, 16) - 0x100000000 + i + 1] = 0x90 # NOP | |
# save modified file | |
new_binary = open(bin_output, 'wb') | |
new_binary.write(binary) | |
new_binary.close() | |
subprocess.call(['chmod', '0755', bin_output]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment