Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. #import the tkinter module
  2. from tkinter import *
  3. from tkinter.filedialog import askopenfilename
  4. import bsdiff4
  5. from patches import *
  6.  
  7. #bsdiff4.file_patch(dst, dst, patch)
  8.  
  9. #create a new class
  10. class Application(Frame):
  11. def __init__(self, master):
  12. super(Application, self).__init__(master)
  13. self.grid(row = 2, sticky = W+E+N+S)
  14. #,padx=300
  15. cmexecutable = askopenfilename()
  16. print(cmexecutable)
  17. self.mainmenu()
  18.  
  19. def mainmenu(self):
  20.  
  21. self.logo = PhotoImage(file='logo.gif')
  22. self.image = Label(self, image=self.logo)
  23. self.image.grid(columnspan = 2)
  24. self.image.configure(background='black')
  25.  
  26. #self.bttn1 = Button(self, text = 'Country Specific')
  27. self.bttn1 = Button(self, text = 'Disable Remove CD Message')
  28. self.bttn1['command'] = disable_removecd(self)
  29. self.bttn1.grid(columnspan = 2 ,sticky = W+E+N+S)
  30.  
  31. from patcher import *
  32.  
  33. def disable_removecd():
  34.  
  35. offset1 = 0x42a98b
  36. offset2 = 0x42a98c
  37. offset3 = 0x42a98d
  38. offset4 = 0x42a98e
  39. offset5 = 0x42a98f
  40. offset6 = 0x42e400
  41. offset7 = 0x42e401
  42. offset8 = 0x42e402
  43. offset9 = 0x42e403
  44. offset10 = 0x42e404
  45.  
  46. newvalue1 = b'x90'
  47. newvalue2 = b'x90'
  48. newvalue3 = b'x90'
  49. newvalue4 = b'x90'
  50. newvalue5 = b'x90'
  51. newvalue6 = b'x90'
  52. newvalue7 = b'x90'
  53. newvalue8 = b'x90'
  54. newvalue9 = b'x90'
  55. newvalue10 = b'x90'
  56.  
  57. with open(cmexecutable, 'r+b') as victim:
  58. victim.seek(offset1)
  59. victim.write(newvalue1)
  60. victim.seek(offset2)
  61. victim.write(newvalue2)
  62. victim.seek(offset3)
  63. victim.write(newvalue3)
  64. victim.seek(offset4)
  65. victim.write(newvalue4)
  66. victim.seek(offset5)
  67. victim.write(newvalue5)
  68. victim.seek(offset6)
  69. victim.write(newvalue6)
  70. victim.seek(offset7)
  71. victim.write(newvalue7)
  72. victim.seek(offset8)
  73. victim.write(newvalue8)
  74. victim.seek(offset9)
  75. victim.write(newvalue9)
  76. victim.seek(offset10)
  77. victim.write(newvalue10)
  78.  
  79. self.bttn1['command'] = disable_removecd(self)
  80. NameError: name 'disable_removecd' is not defined
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement