Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- """
- This Python script will switch the $kype version for the (Linux) Debian version
- from 4.2 to 4.3 allowing clients which are unable to connect to connect again.
- Real credit for this solution actually goes to Debian mailing list user Hans.
- See: https://lists.debian.org/debian-user/2014/08/msg01190.html
- Thanks Hans :-)
- This is just a script which tries to automate the steps.
- Instructions:
- - Make sure you have $kype 4.2 for Linux installed
- - Save the script in any directory (e.g. home) with any name e.g. sky.py
- - Run the script with: python sky.py
- - If everything went well you should have a binary file called zkype
- in the same directory where the script was run
- - Launch the file with ./zkype and try to log-in
- - Optional: replace the original $kype binary with the new one
- The script has been (very limitedly) tested on Debian Jessie amd64.
- Script by: Darrell Standing
- WARNING: This script is provided for educational and learning purpouses only.
- Any illegal activity is not endorsed. Author takes no responsibility for misuse
- The script is provided as is. Use at your own risk!
- M$ fk.u.!
- """
- import subprocess
- import sys
- import os
- import stat
- from distutils.spawn import find_executable
- def zkype_ver_detect(bin_path):
- """Detect zkype version and extract the version string"""
- skype_output = subprocess.check_output([bin_path, '--version'])
- ver = skype_output[:skype_output.find("\n")]
- ver = ver.replace("Skype ","")
- return ver
- # Search for skype executable in default path
- orig_zkype_bin_path = find_executable('skype')
- if find_executable == None:
- print("Error: Could not find skype executable.")
- print(("Searching in the following paths: %s") % (os.environ['PATH']))
- print('Please make sure skype is installed')
- sys.exit()
- # Detect verion and extract version string
- print("Detecting $kype version...\n")
- new_zkype_bin_path = './zkype'
- ver_string = zkype_ver_detect(orig_zkype_bin_path)
- if ver_string.find("4.2") < 0:
- print(("""$kype version seems different than 4.2
- Reported version is %s") %""") %
- (ver_string)
- )
- sys.exit()
- else:
- print(("OK. Found version %s\n") % ver_string)
- # Open and read the original zkype binary file
- print(("Opening original binary file at %s..." % orig_zkype_bin_path))
- zkype_file = open(orig_zkype_bin_path, 'rb')
- orig_content = zkype_file.read()
- zkype_file.close()
- # Replace version string, changing 4.2 to 4.3
- print("Replacing version...")
- new_version = ver_string.replace('4.2','4.3')
- new_content = orig_content.replace(ver_string, new_version)
- # Write to new binary file
- print(("Creating new binary file: %s" % new_zkype_bin_path))
- new_file = open(new_zkype_bin_path, 'wb')
- new_file.write(new_content)
- new_file.close()
- # Make the new file executable
- print("Making new file executable")
- os.chmod(new_zkype_bin_path, stat.S_IXUSR)
- # Test newly reprted version...
- print("Testing version...")
- ver_reported = zkype_ver_detect(new_zkype_bin_path)
- print(("Reported version is now %s") % ver_reported)
- if ver_reported.find('4.3') >= 0:
- print('OK. Looks good!')
- print("Try running the new binary %s and logging in") % new_zkype_bin_path
- else:
- print("Ouch.. Something went wrong?")
Advertisement
Add Comment
Please, Sign In to add comment