Discussion Neural Network Python hack need assistance

tel1014

New Member
Messages
4
Reaction score
1
Points
1
  1. So this was on another site and I was trying to set this up. The OP said that the aimbot kept locking onto his character and he couldnt fix it. I decided to just remove the aimbot all together and only use the glow and i was in the middle of installing everything when i realized that 1. import cv2 is a library which is exclusive to python 2.7 and 2. the code is in python 2.7 format(you can tell by the fact that there is no parenthesis around the variables). Now i would just go and install tensorflow, however tensorflow is no longer supported for python 2.7 and is only python 3.5 and 3.6. If anyone can either find a version of tensorflow for python 2.7, or cv2 for python 3.5(in which case i will revise the code to be updated to python 3) then this will be a undetectable cheat as all it does is record the frame screens and find people
also this is not 100% accurate so any improvements to the code will be extremely helpful.
Happy hacking!
  1. # USAGE
  2. # python real_time_object_detection.py --prototxt MobileNetSSD_deploy.prototxt.txt --model MobileNetSSD_deploy.caffemodel
  3. # import the necessary packages
  4. import win32api
  5. import keyboard as keyboard
  6. import pygame as pygame
  7. import pythoncom
  8. import win32con
  9. from PIL import ImageGrab
  10. from imutils.video import VideoStream
  11. from imutils.video import FPS
  12. import numpy as np
  13. import argparse
  14. import imutils
  15. import time
  16. import cv2
  17. import pyautogui
  18. # construct the argument parse and parse the arguments
  19. from keyboard._mouse_event import RIGHT
  20. ap = argparse.ArgumentParser()
  21. ap.add_argument("-p", "--prototxt", required=False,
  22. help="path to Caffe 'deploy' prototxt file")
  23. ap.add_argument("-m", "--model", required=False,
  24. help="path to Caffe pre-trained model")
  25. ap.add_argument("-c", "--confidence", type=float, default=0.6,
  26. help="minimum probability to filter weak detections")
  27. args = vars(ap.parse_args())
  28. prott1 = 'C:\Users\Saehi\PycharmProjects/testing\MobileNetSSD_deploy.prototxt.txt'
  29. prott2 = 'C:\Users\Saehi\PycharmProjects/testing\MobileNetSSD_deploy.caffemodel'
  30. # initialize the list of class labels MobileNet SSD was trained to
  31. # detect, then generate a set of bounding box colors for each class
  32. CLASSES = ["background", "aeroplane", "bicycle", "bird", "boat",
  33. "bottle", "bus", "car", "cat", "chair", "cow", "diningtable",
  34. "dog", "horse", "motorbike", "person", "pottedplant", "sheep",
  35. "sofa", "train", "tvmonitor"]
  36. COLORS = np.random.uniform(0, 255, size=(len(CLASSES), 3))
  37. # load our serialized model from disk
  38. print("[INFO] loading model...")
  39. net = cv2.dnn.readNetFromCaffe(prott1, prott2)
  40. # initialize the video stream, allow the cammera sensor to warmup,
  41. # and initialize the FPS counter
  42. print("[INFO] starting video stream...")
  43. #vs = VideoStream(src=0).start()
  44. #time.sleep(2.0)
  45. #fps = FPS().start()
  46. # loop over the frames from the video stream
  47. HSX = 100;
  48. LSX = 1000;
  49. HSY = 100;
  50. LSY = 1000;
  51. HEX = 100;
  52. LEX = 1000;
  53. HEY = 100;
  54. LEY = 1000;
  55. while True:
  56. # grab the frame from the threaded video stream and resize it
  57. # to have a maximum width of 400 pixels
  58. frame = np.array(ImageGrab.grab(bbox=(0, 40, 1820, 1240)))
  59. # frame = imutils.resize(frame, width=400)
  60. # grab the frame dimensions and convert it to a blob
  61. (h, w) = frame.shape[:2]
  62. blob = cv2.dnn.blobFromImage(cv2.resize(frame, (300, 300)),
  63. 0.007843, (300, 300), 127.5)
  64. # pass the blob through the network and obtain the detections and
  65. # predictions
  66. net.setInput(blob)
  67. detections = net.forward()
  68. # loop over the detections
  69. for i in np.arange(0, detections.shape[2]):
  70. # extract the confidence (i.e., probability) associated with
  71. # the prediction
  72. confidence = detections[0, 0, i, 2]
  73. # filter out weak detections by ensuring the `confidence` is
  74. # greater than the minimum confidence
  75. if confidence > args["confidence"]:
  76. # extract the index of the class label from the
  77. # `detections`, then compute the (x, y)-coordinates of
  78. # the bounding box for the object
  79. idx = int(detections[0, 0, i, 1])
  80. box = detections[0, 0, i, 3:7] * np.array([w, h, w, h])
  81. (startX, startY, endX, endY) = box.astype("int")
  82. # draw the prediction on the frame
  83. label = "{}: {:.2f}%".format(CLASSES[idx],
  84. confidence * 100)
  85. cv2.rectangle(frame, (startX, startY), (endX, endY),
  86. COLORS[idx], 2)
  87. y = startY - 15 if startY - 15 > 15 else startY + 15
  88. cv2.putText(frame, label, (startX, y),
  89. cv2.FONT_HERSHEY_SIMPLEX, 0.5, COLORS[idx], 2)
  90. if 'person' in label:
  91. pygame.init()
  92. pygame.event.get()
  93. if pygame.mouse.get_pressed():
  94. print 'pressing'
  95. #tried to detect my character's offset and add the best way to exclude it, failed most tests.
  96. if startX > 369 & startX < 1402 & startY > -1 & startY < 725 & endX > 339 & endX < 1805 & endY > 806 & endY < 1017:
  97. print 'found myself'
  98. else:
  99. #print 'found somebody else'
  100. nosum = int(round(startX * 1)) + int(round(startX * 0.06))
  101. nosum2 = int(round(y * 1)) + int(round(y * 0.7))
  102. halfX = (endX - startX) / 2
  103. halfY = (endY - startY) / 2
  104. finalX = startX + halfX
  105. finalY = startY + halfY
  106. pyautogui.moveTo(finalX, finalY)
  107. #win32api.SetCursorPos((finalX, finalY))
  108. win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, finalX, finalY, 0, 0)
  109. win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, finalX, finalY, 0, 0)
  110. #print 'Pressed L'
  111. if 'HSX' not in locals():
  112. HSX = startX
  113. if 'LSX' not in locals():
  114. LSX = startX
  115. if 'HSY' not in locals():
  116. HSY = startY
  117. if 'LSY' not in locals():
  118. LSY = startY
  119. if 'HEX' not in locals():
  120. HEX = endX
  121. if 'LEX' not in locals():
  122. LEX = endX
  123. if 'HEY' not in locals():
  124. HEY = endY
  125. if 'LEY' not in locals():
  126. LEY = endY
  127. if startX > HSX:
  128. HSX = startX
  129. if startX < LSX:
  130. LSX = startX
  131. if startY > HSY:
  132. HSY = startY
  133. if startY < LSY:
  134. LSY = startY
  135. if endX > HEX:
  136. HEX = endX
  137. if endX < LEX:
  138. LEX = endX
  139. if endY > HEY:
  140. HEY = endY
  141. if endY < LEY:
  142. LEY = endY
  143. print 'HStartX: ' + str(HSX)
  144. print 'LStartX: ' + str(LSX)
  145. print 'HStartY: ' + str(HSY)
  146. print 'LStartY: ' + str(LSY)
  147. print 'HendX: ' + str(HEX)
  148. print 'LendX: ' + str(LEX)
  149. print 'HendY: ' + str(HEY)
  150. print 'LendY: ' + str(LEY)
  151. #print args["confidence"]
  152. # click(10,10)
  153. # show the output frame
  154. cv2.imshow("Frame", frame)
  155. key = cv2.waitKey(1) & 0xFF
  156. # if the `q` key was pressed, break from the loop
  157. if key == ord("q"):
  158. break
  159. # update the FPS counter
  160. # stop the timer and display FPS information
  161. # do a bit of cleanup
  162. cv2.destroyAllWindows()
 

tel1014

New Member
Messages
4
Reaction score
1
Points
1
Also one more thing, you would set this up by installing python with tensorflow (most likely using pip) then install these libraries
  1. import win32api
  2. import keyboard as keyboard
  3. import pygame as pygame
  4. import pythoncom
  5. import win32con
  6. from PIL import ImageGrab
  7. from imutils.video import VideoStream
  8. from imutils.video import FPS
  9. import numpy as np
  10. import argparse
  11. import imutils
  12. import time(not this one its default library)
  13. import cv2
  14. import pyautogui
  15. and in lines 33 and 34 add r before the string as it needs to be raw input.
 

CabCon

Head Administrator
Staff member
Head Staff Team
Messages
4,998
Reaction score
2,918
Points
1,053
Could you please add a short preview of the hack? In kind of a video. :smile:
 

tel1014

New Member
Messages
4
Reaction score
1
Points
1
Could you please add a short preview of the hack? In kind of a video. :smile:
Sorry i dont have a video because i havent gotten it working yet. Thats why i need help with just setting it up as the libraries arent supported on python2.7 anymore (specifically tensorflow)
 
Top