Advertisement
nasserahmed96

crack_script

Dec 6th, 2020
1,436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.27 KB | None | 0 0
  1. #The code serial number function(getMachine_addr) belongs to https://gist.github.com/angeloped/3febaaf71ac083bc2cd5d99d775921d0
  2.  
  3. # wmic bios get serialnumber#Windows
  4. # hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.hardware.uuid#Linux
  5. # ioreg -l | grep IOPlatformSerialNumber#Mac OS X
  6. import os, sys, subprocess
  7. import getpass
  8. system_password = "$ub_Z3r0"
  9. def getMachine_addr():
  10.     os_type = sys.platform.lower()
  11.     command = None
  12.     if "win" in os_type:
  13.         command = "wmic bios get serialnumber"
  14.     elif "linux" in os_type:
  15.         command = "hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.hardware.uuid"
  16.     elif "darwin" in os_type:
  17.         command = "ioreg -l | grep IOPlatformSerialNumber"
  18.     return os.popen(command).read().replace("\n","").replace("  ","").replace(" ","")
  19.  
  20.  
  21. #Save the serial number into the file
  22. def save_serial_number(serial_number):
  23.     with open("dev_ser.txt", "w") as serial_file:
  24.         serial_file.write(serial_number)
  25.  
  26.  
  27. #Check if the program will run for the first time on the device
  28. def check_for_first_run():
  29.     with open("dev_ser.txt", "r") as serial_file:
  30.         for line in serial_file:
  31.             first_line = line.rstrip('\n')
  32.             break
  33.         print("First line is")
  34.         print(first_line)
  35.         if first_line == '':
  36.             print("Line")
  37.             return True
  38.         return False
  39.  
  40. #Get the serial number from the saved device
  41. def read_serial_number_from_file():
  42.     with open("dev_ser.txt", "r") as serial_file:
  43.         for line in serial_file:
  44.             return line
  45.  
  46. if __name__ == "__main__":
  47.     serial_number = getMachine_addr()
  48.     if check_for_first_run():
  49.         print("Please enter the system's password")
  50.         password = getpass.getpass()
  51.         if password == system_password:
  52.             save_serial_number(serial_number)
  53.             print("You can run the program now")
  54.         else:
  55.             print("Wrong password")
  56.     else:
  57.         serial_number_in_file = read_serial_number_from_file()
  58.         if serial_number == serial_number_in_file:
  59.             #Put the program path here
  60.             subprocess.call("ls")
  61.         else:
  62.             print("Error while running the program please contact Subzero")
  63.  
  64.  
  65.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement