Guest User

Source code (v.1.26)

a guest
Jun 14th, 2020
1,047
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 57.81 KB | None | 0 0
  1. version = '1.26'
  2. name = 'Elite Not So Dangerous'
  3.  
  4. TempLabel = createLabel(TRN)
  5. TempLabel.Caption ='M'
  6. TempLabel.Left = 0
  7. TempLabel.Top = 0
  8. TempLabel.Visible = False
  9.  
  10. temp_size = TempLabel.Height
  11.  
  12. function mS(orig_size)
  13. return math.floor(temp_size/15*orig_size)
  14. end
  15.  
  16. TempLabel.destroy()
  17.  
  18. TRN.Caption = name..' '..version
  19. TRN.Height = mS(487)
  20. TRN.Width = mS(450)
  21.  
  22. TRN_Logo.Height = mS(170)
  23. TRN_Logo.Width = mS(450)
  24. TRN_Logo.Stretch = 'True'
  25.  
  26. StatusLabel1 = createLabel(TRN)
  27. StatusLabel1.Caption ='Status:'
  28. StatusLabel1.Height = mS(15)
  29. StatusLabel1.Width = mS(35)
  30. StatusLabel1.Left = mS(10)
  31. StatusLabel1.Top = mS(180)
  32.  
  33. StatusLabel2 = createLabel(TRN)
  34. StatusLabel2.Caption ='Waiting for game.'
  35. StatusLabel2.Height = mS(15)
  36. StatusLabel2.Width = mS(380)
  37. StatusLabel2.Left = mS(55)
  38. StatusLabel2.Top = mS(180)
  39.  
  40. PC = createPageControl(TRN)
  41. PC.Height = TRN.Height - mS(237)
  42. PC.Width = mS(454)
  43. PC.Left = mS(0)
  44. PC.Top = mS(205)
  45.  
  46. Tab1 = PC.addTab()
  47. Tab1.Caption = 'Damage/Others'
  48. Tab1.BorderWidth = 0
  49.  
  50. Tab2 = PC.addTab()
  51. Tab2.Caption = 'Jumps/Fuel'
  52. Tab2.BorderWidth = 0
  53.  
  54. Tab3 = PC.addTab()
  55. Tab3.Caption = 'Scanners'
  56. Tab3.BorderWidth = 0
  57.  
  58. Tab4 = PC.addTab()
  59. Tab4.Caption = 'Agility'
  60. Tab4.BorderWidth = 0
  61.  
  62. Tab5 = PC.addTab()
  63. Tab5.Caption = 'Unsafe'
  64. Tab5.BorderWidth = 0
  65.  
  66. PTab1 = createPanel(Tab1)
  67. PTab1.Color = 0xD3D3D3
  68. setProperty(PTab1, 'BorderStyle', 'bsNone')
  69. setProperty(PTab1, 'BevelOuter', 'bvNone')
  70. setProperty(PTab1, 'Align', 'alClient')
  71.  
  72. PTab2 = createPanel(Tab2)
  73. PTab2.Color = 0xD3D3D3
  74. setProperty(PTab2, 'BorderStyle', 'bsNone')
  75. setProperty(PTab2, 'BevelOuter', 'bvNone')
  76. setProperty(PTab2, 'Align', 'alClient')
  77.  
  78. PTab3 = createPanel(Tab3)
  79. PTab3.Color = 0xD3D3D3
  80. setProperty(PTab3, 'BorderStyle', 'bsNone')
  81. setProperty(PTab3, 'BevelOuter', 'bvNone')
  82. setProperty(PTab3, 'Align', 'alClient')
  83.  
  84. PTab4 = createPanel(Tab4)
  85. PTab4.Color = 0xD3D3D3
  86. setProperty(PTab4, 'BorderStyle', 'bsNone')
  87. setProperty(PTab4, 'BevelOuter', 'bvNone')
  88. setProperty(PTab4, 'Align', 'alClient')
  89.  
  90. PTab5 = createPanel(Tab5)
  91. PTab5.Color = 0xC4C0FA
  92. setProperty(PTab5, 'BorderStyle', 'bsNone')
  93. setProperty(PTab5, 'BevelOuter', 'bvNone')
  94. setProperty(PTab5, 'Align', 'alClient')
  95.  
  96. PTab5Label = createLabel(PTab5)
  97. PTab5Label.Align = 'alTop'
  98. PTab5Label.Height = mS(15)
  99. PTab5Label.Alignment = 'taCenter'
  100. setProperty(PTab5Label, 'WordWrap', 'True')
  101. PTab5Label.Caption = 'Cheats in this tab will probably get you a ban.'
  102.  
  103. -- ================ Panel 1 ================
  104.  
  105. PANPlayer1 = createPanel(PTab1)
  106. PANPlayer1.Color = 0xBFBFBF
  107. setProperty(PANPlayer1, 'BorderStyle', 'bsNone')
  108. setProperty(PANPlayer1, 'BevelOuter', 'bvNone')
  109. PANPlayer1.Height = mS(20)
  110. PANPlayer1.Width = mS(102)
  111. PANPlayer1.Top = mS(10)
  112. PANPlayer1.Left = mS(230)
  113. PANPlayer1.Caption = 'Player'
  114.  
  115. PANPlayer2 = createPanel(PTab1)
  116. PANPlayer2.Color = 0xBFBFBF
  117. setProperty(PANPlayer2, 'BorderStyle', 'bsNone')
  118. setProperty(PANPlayer2, 'BevelOuter', 'bvNone')
  119. PANPlayer2.Height = mS(75)
  120. PANPlayer2.Width = mS(102)
  121. PANPlayer2.Top = mS(30)
  122. PANPlayer2.Left = mS(230)
  123.  
  124. PANNPC1 = createPanel(PTab1)
  125. PANNPC1.Color = 0x999999
  126. setProperty(PANNPC1, 'BorderStyle', 'bsNone')
  127. setProperty(PANNPC1, 'BevelOuter', 'bvNone')
  128. PANNPC1.Height = mS(20)
  129. PANNPC1.Width = mS(102)
  130. PANNPC1.Top = mS(10)
  131. PANNPC1.Left = mS(332)
  132. PANNPC1.Caption = 'NPCs'
  133.  
  134. PANNPC2 = createPanel(PTab1)
  135. PANNPC2.Color = 0x999999
  136. setProperty(PANNPC2, 'BorderStyle', 'bsNone')
  137. setProperty(PANNPC2, 'BevelOuter', 'bvNone')
  138. PANNPC2.Height = mS(75)
  139. PANNPC2.Width = mS(102)
  140. PANNPC2.Top = mS(30)
  141. PANNPC2.Left = mS(332)
  142.  
  143. ShieldBtn = createToggleBox(PTab1)
  144. ShieldBtn.Caption ='Shield damage'
  145. ShieldBtn.Height = mS(20)
  146. ShieldBtn.Width = mS(205)
  147. ShieldBtn.Left = mS(10)
  148. ShieldBtn.Top = mS(30)
  149. ShieldBtn.Enabled = False
  150.  
  151. ShieldTB = createTrackBar(PANPlayer2)
  152. ShieldTB.Height = mS(20)
  153. ShieldTB.Width = mS(100)
  154. ShieldTB.Left = mS(1)
  155. ShieldTB.Top = mS(0)
  156. ShieldTB.Min = 0
  157. ShieldTB.Max = 20
  158. ShieldTB.Position = 10
  159. ShieldTB.Enabled = False
  160.  
  161. ShieldNPCTB = createTrackBar(PANNPC2)
  162. ShieldNPCTB.Height = mS(20)
  163. ShieldNPCTB.Width = mS(100)
  164. ShieldNPCTB.Left = mS(1)
  165. ShieldNPCTB.Top = mS(0)
  166. ShieldNPCTB.Min = 0
  167. ShieldNPCTB.Max = 20
  168. ShieldNPCTB.Position = 0
  169. ShieldNPCTB.Enabled = False
  170.  
  171. HullBtn = createToggleBox(PTab1)
  172. HullBtn.Caption ='Hull damage'
  173. HullBtn.Height = mS(20)
  174. HullBtn.Width = mS(205)
  175. HullBtn.Left = mS(10)
  176. HullBtn.Top = mS(55)
  177. HullBtn.Enabled = False
  178.  
  179. HullTB = createTrackBar(PANPlayer2)
  180. HullTB.Height = mS(20)
  181. HullTB.Width = mS(100)
  182. HullTB.Left = mS(1)
  183. HullTB.Top = mS(25)
  184. HullTB.Min = 0
  185. HullTB.Max = 20
  186. HullTB.Position = 10
  187. HullTB.Enabled = False
  188.  
  189. HullNPCTB = createTrackBar(PANNPC2)
  190. HullNPCTB.Height = mS(20)
  191. HullNPCTB.Width = mS(100)
  192. HullNPCTB.Left = mS(1)
  193. HullNPCTB.Top = mS(25)
  194. HullNPCTB.Min = 0
  195. HullNPCTB.Max = 20
  196. HullNPCTB.Position = 0
  197. HullNPCTB.Enabled = False
  198.  
  199. ModuleBtn = createToggleBox(PTab1)
  200. ModuleBtn.Caption ='Module damage'
  201. ModuleBtn.Height = mS(20)
  202. ModuleBtn.Width = mS(205)
  203. ModuleBtn.Left = mS(10)
  204. ModuleBtn.Top = mS(80)
  205. ModuleBtn.Enabled = False
  206.  
  207. ModuleTB = createTrackBar(PANPlayer2)
  208. ModuleTB.Height = mS(20)
  209. ModuleTB.Width = mS(100)
  210. ModuleTB.Left = mS(1)
  211. ModuleTB.Top = mS(50)
  212. ModuleTB.Min = 0
  213. ModuleTB.Max = 20
  214. ModuleTB.Position = 10
  215. ModuleTB.Enabled = False
  216.  
  217. ModuleNPCTB = createTrackBar(PANNPC2)
  218. ModuleNPCTB.Height = mS(20)
  219. ModuleNPCTB.Width = mS(100)
  220. ModuleNPCTB.Left = mS(1)
  221. ModuleNPCTB.Top = mS(50)
  222. ModuleNPCTB.Min = 0
  223. ModuleNPCTB.Max = 20
  224. ModuleNPCTB.Position = 0
  225. ModuleNPCTB.Enabled = False
  226.  
  227. InterdictBtn = createToggleBox(PTab1)
  228. InterdictBtn.Caption ='No interdiction'
  229. InterdictBtn.Height = mS(20)
  230. InterdictBtn.Width = mS(205)
  231. InterdictBtn.Left = mS(10)
  232. InterdictBtn.Top = mS(110)
  233. InterdictBtn.Enabled = False
  234.  
  235. HeatsinkBtn = createToggleBox(PTab1)
  236. HeatsinkBtn.Caption ='Endless heatsink'
  237. HeatsinkBtn.Height = mS(20)
  238. HeatsinkBtn.Width = mS(205)
  239. HeatsinkBtn.Left = mS(230)
  240. HeatsinkBtn.Top = mS(110)
  241. HeatsinkBtn.Enabled = False
  242.  
  243. -- ================ Panel 2 ================
  244.  
  245. FuelScoopBtn = createToggleBox(PTab2)
  246. FuelScoopBtn.Caption ='Fuel scoop multiplier'
  247. FuelScoopBtn.Height = mS(20)
  248. FuelScoopBtn.Width = mS(205)
  249. FuelScoopBtn.Left = mS(10)
  250. FuelScoopBtn.Top = mS(20)
  251. FuelScoopBtn.Enabled = False
  252.  
  253. FuelScoopTB = createTrackBar(PTab2)
  254. FuelScoopTB.Height = mS(20)
  255. FuelScoopTB.Width = mS(205)
  256. FuelScoopTB.Left = mS(230)
  257. FuelScoopTB.Top = mS(20)
  258. FuelScoopTB.Min = 0
  259. FuelScoopTB.Max = 20
  260. FuelScoopTB.Position = 4
  261. FuelScoopTB.Enabled = False
  262.  
  263. HyperAnimBtn = createToggleBox(PTab2)
  264. HyperAnimBtn.Caption ='Hyperspace animation speed'
  265. HyperAnimBtn.Height = mS(20)
  266. HyperAnimBtn.Width = mS(205)
  267. HyperAnimBtn.Left = mS(10)
  268. HyperAnimBtn.Top = mS(45)
  269. HyperAnimBtn.Enabled = False
  270.  
  271. HyperAnimTB = createTrackBar(PTab2)
  272. HyperAnimTB.Height = mS(20)
  273. HyperAnimTB.Width = mS(205)
  274. HyperAnimTB.Left = mS(230)
  275. HyperAnimTB.Top = mS(45)
  276. HyperAnimTB.Min = 0
  277. HyperAnimTB.Max = 20
  278. HyperAnimTB.Position = 4
  279. HyperAnimTB.Enabled = False
  280.  
  281. MassBtn = createToggleBox(PTab2)
  282. MassBtn.Caption ='No masslock'
  283. MassBtn.Height = mS(20)
  284. MassBtn.Width = mS(205)
  285. MassBtn.Left = mS(10)
  286. MassBtn.Top = mS(70)
  287. MassBtn.Enabled = False
  288.  
  289. CooldownBtn = createToggleBox(PTab2)
  290. CooldownBtn.Caption ='No cooldown'
  291. CooldownBtn.Height = mS(20)
  292. CooldownBtn.Width = mS(205)
  293. CooldownBtn.Left = mS(230)
  294. CooldownBtn.Top = mS(70)
  295. CooldownBtn.Enabled = False
  296.  
  297. JumpchargeBtn = createToggleBox(PTab2)
  298. JumpchargeBtn.Caption ='No jump charge'
  299. JumpchargeBtn.Height = mS(20)
  300. JumpchargeBtn.Width = mS(205)
  301. JumpchargeBtn.Left = mS(10)
  302. JumpchargeBtn.Top = mS(95)
  303. JumpchargeBtn.Enabled = False
  304.  
  305. JumpcountBtn = createToggleBox(PTab2)
  306. JumpcountBtn.Caption ='No jump countdown'
  307. JumpcountBtn.Height = mS(20)
  308. JumpcountBtn.Width = mS(205)
  309. JumpcountBtn.Left = mS(230)
  310. JumpcountBtn.Top = mS(95)
  311. JumpcountBtn.Enabled = False
  312.  
  313. OmnijumpBtn = createToggleBox(PTab2)
  314. OmnijumpBtn.Caption ='All directions jump'
  315. OmnijumpBtn.Height = mS(20)
  316. OmnijumpBtn.Width = mS(205)
  317. OmnijumpBtn.Left = mS(10)
  318. OmnijumpBtn.Top = mS(120)
  319. OmnijumpBtn.Enabled = False
  320.  
  321. DropOffBtn = createToggleBox(PTab2)
  322. DropOffBtn.Caption ='Drop off to target'
  323. DropOffBtn.Height = mS(20)
  324. DropOffBtn.Width = mS(205)
  325. DropOffBtn.Left = mS(230)
  326. DropOffBtn.Top = mS(120)
  327. DropOffBtn.Enabled = False
  328.  
  329. -- ================ Panel 3 ================
  330.  
  331. KwsSpeedBtn = createToggleBox(PTab3)
  332. KwsSpeedBtn.Caption ='KWS speed multiplier'
  333. KwsSpeedBtn.Height = mS(20)
  334. KwsSpeedBtn.Width = mS(205)
  335. KwsSpeedBtn.Left = mS(10)
  336. KwsSpeedBtn.Top = mS(20)
  337. KwsSpeedBtn.Enabled = False
  338.  
  339. KwsSpeedTB = createTrackBar(PTab3)
  340. KwsSpeedTB.Height = mS(20)
  341. KwsSpeedTB.Width = mS(205)
  342. KwsSpeedTB.Left = mS(230)
  343. KwsSpeedTB.Top = mS(20)
  344. KwsSpeedTB.Min = 0
  345. KwsSpeedTB.Max = 20
  346. KwsSpeedTB.Position = 4
  347. KwsSpeedTB.Enabled = False
  348.  
  349. KwsomniBtn = createToggleBox(PTab3)
  350. KwsomniBtn.Caption ='All directions KWS scan'
  351. KwsomniBtn.Height = mS(20)
  352. KwsomniBtn.Width = mS(205)
  353. KwsomniBtn.Left = mS(10)
  354. KwsomniBtn.Top = mS(45)
  355. KwsomniBtn.Enabled = False
  356.  
  357. KwslongBtn = createToggleBox(PTab3)
  358. KwslongBtn.Caption ='Distant KWS scan'
  359. KwslongBtn.Height = mS(20)
  360. KwslongBtn.Width = mS(205)
  361. KwslongBtn.Left = mS(230)
  362. KwslongBtn.Top = mS(45)
  363. KwslongBtn.Enabled = False
  364.  
  365. NormalscanSpeedBtn = createToggleBox(PTab3)
  366. NormalscanSpeedBtn.Caption ='Ship scan speed multiplier'
  367. NormalscanSpeedBtn.Height = mS(20)
  368. NormalscanSpeedBtn.Width = mS(205)
  369. NormalscanSpeedBtn.Left = mS(10)
  370. NormalscanSpeedBtn.Top = mS(70)
  371. NormalscanSpeedBtn.Enabled = False
  372.  
  373. NormalscanSpeedTB = createTrackBar(PTab3)
  374. NormalscanSpeedTB.Height = mS(20)
  375. NormalscanSpeedTB.Width = mS(205)
  376. NormalscanSpeedTB.Left = mS(230)
  377. NormalscanSpeedTB.Top = mS(70)
  378. NormalscanSpeedTB.Min = 0
  379. NormalscanSpeedTB.Max = 20
  380. NormalscanSpeedTB.Position = 4
  381. NormalscanSpeedTB.Enabled = False
  382.  
  383. NormalscanBtn = createToggleBox(PTab3)
  384. NormalscanBtn.Caption ='All directions ship scan'
  385. NormalscanBtn.Height = mS(20)
  386. NormalscanBtn.Width = mS(205)
  387. NormalscanBtn.Left = mS(10)
  388. NormalscanBtn.Top = mS(95)
  389. NormalscanBtn.Enabled = False
  390.  
  391. PlanetomniBtn = createToggleBox(PTab3)
  392. PlanetomniBtn.Caption ='All directions planet scan'
  393. PlanetomniBtn.Height = mS(20)
  394. PlanetomniBtn.Width = mS(205)
  395. PlanetomniBtn.Left = mS(10)
  396. PlanetomniBtn.Top = mS(120)
  397. PlanetomniBtn.Enabled = False
  398.  
  399. PlanetlongBtn = createToggleBox(PTab3)
  400. PlanetlongBtn.Caption ='Distant planet scan'
  401. PlanetlongBtn.Height = mS(20)
  402. PlanetlongBtn.Width = mS(205)
  403. PlanetlongBtn.Left = mS(230)
  404. PlanetlongBtn.Top = mS(120)
  405. PlanetlongBtn.Enabled = False
  406.  
  407. PlanetScanSpeedBtn = createToggleBox(PTab3)
  408. PlanetScanSpeedBtn.Caption ='Planet scan speed multiplier'
  409. PlanetScanSpeedBtn.Height = mS(20)
  410. PlanetScanSpeedBtn.Width = mS(205)
  411. PlanetScanSpeedBtn.Left = mS(10)
  412. PlanetScanSpeedBtn.Top = mS(145)
  413. PlanetScanSpeedBtn.Enabled = False
  414.  
  415. PlanetScanSpeedTB = createTrackBar(PTab3)
  416. PlanetScanSpeedTB.Height = mS(20)
  417. PlanetScanSpeedTB.Width = mS(205)
  418. PlanetScanSpeedTB.Left = mS(230)
  419. PlanetScanSpeedTB.Top = mS(145)
  420. PlanetScanSpeedTB.Min = 0
  421. PlanetScanSpeedTB.Max = 20
  422. PlanetScanSpeedTB.Position = 4
  423. PlanetScanSpeedTB.Enabled = False
  424.  
  425. DiscoveryScanSpeedBtn = createToggleBox(PTab3)
  426. DiscoveryScanSpeedBtn.Caption ='Discovery scan speed multiplier'
  427. DiscoveryScanSpeedBtn.Height = mS(20)
  428. DiscoveryScanSpeedBtn.Width = mS(205)
  429. DiscoveryScanSpeedBtn.Left = mS(10)
  430. DiscoveryScanSpeedBtn.Top = mS(170)
  431. DiscoveryScanSpeedBtn.Enabled = False
  432.  
  433. DiscoveryScanSpeedTB = createTrackBar(PTab3)
  434. DiscoveryScanSpeedTB.Height = mS(20)
  435. DiscoveryScanSpeedTB.Width = mS(205)
  436. DiscoveryScanSpeedTB.Left = mS(230)
  437. DiscoveryScanSpeedTB.Top = mS(170)
  438. DiscoveryScanSpeedTB.Min = 0
  439. DiscoveryScanSpeedTB.Max = 20
  440. DiscoveryScanSpeedTB.Position = 4
  441. DiscoveryScanSpeedTB.Enabled = False
  442.  
  443. -- ================ Panel 4 ================
  444.  
  445. NfAgilityBtn = createToggleBox(PTab4)
  446. NfAgilityBtn.Caption ='Normal flight agility'
  447. NfAgilityBtn.Height = mS(20)
  448. NfAgilityBtn.Width = mS(205)
  449. NfAgilityBtn.Left = mS(10)
  450. NfAgilityBtn.Top = mS(20)
  451. NfAgilityBtn.Enabled = False
  452.  
  453. NfAgilityNpcBtn = createToggleBox(PTab4)
  454. NfAgilityNpcBtn.Caption ='Paralyze NPCs'
  455. NfAgilityNpcBtn.Height = mS(20)
  456. NfAgilityNpcBtn.Width = mS(205)
  457. NfAgilityNpcBtn.Left = mS(230)
  458. NfAgilityNpcBtn.Top = mS(20)
  459. NfAgilityNpcBtn.Enabled = False
  460.  
  461. SpeedLabel = createLabel(PTab4)
  462. SpeedLabel.Caption ='Normal flight max speed'
  463. SpeedLabel.Height = mS(20)
  464. SpeedLabel.Width = mS(205)
  465. SpeedLabel.Left = mS(10)
  466. SpeedLabel.Top = mS(45)
  467.  
  468. SpeedTB = createTrackBar(PTab4)
  469. SpeedTB.Height = mS(20)
  470. SpeedTB.Width = mS(205)
  471. SpeedTB.Left = mS(230)
  472. SpeedTB.Top = mS(45)
  473. SpeedTB.Min = 0
  474. SpeedTB.Max = 20
  475. SpeedTB.Position = 0
  476. SpeedTB.Enabled = False
  477.  
  478. NfPitchLabel = createLabel(PTab4)
  479. NfPitchLabel.Caption ='Normal flight pitch'
  480. NfPitchLabel.Height = mS(20)
  481. NfPitchLabel.Width = mS(205)
  482. NfPitchLabel.Left = mS(10)
  483. NfPitchLabel.Top = mS(60)
  484.  
  485. NfPitchTB = createTrackBar(PTab4)
  486. NfPitchTB.Height = mS(20)
  487. NfPitchTB.Width = mS(205)
  488. NfPitchTB.Left = mS(230)
  489. NfPitchTB.Top = mS(60)
  490. NfPitchTB.Min = 0
  491. NfPitchTB.Max = 20
  492. NfPitchTB.Position = 4
  493. NfPitchTB.Enabled = False
  494.  
  495. NfRollLabel = createLabel(PTab4)
  496. NfRollLabel.Caption ='Normal flight roll'
  497. NfRollLabel.Height = mS(20)
  498. NfRollLabel.Width = mS(205)
  499. NfRollLabel.Left = mS(10)
  500. NfRollLabel.Top = mS(75)
  501.  
  502. NfRollTB = createTrackBar(PTab4)
  503. NfRollTB.Height = mS(20)
  504. NfRollTB.Width = mS(205)
  505. NfRollTB.Left = mS(230)
  506. NfRollTB.Top = mS(75)
  507. NfRollTB.Min = 0
  508. NfRollTB.Max = 20
  509. NfRollTB.Position = 4
  510. NfRollTB.Enabled = False
  511.  
  512. NfYawLabel = createLabel(PTab4)
  513. NfYawLabel.Caption ='Normal flight yaw'
  514. NfYawLabel.Height = mS(20)
  515. NfYawLabel.Width = mS(205)
  516. NfYawLabel.Left = mS(10)
  517. NfYawLabel.Top = mS(90)
  518.  
  519. NfYawTB = createTrackBar(PTab4)
  520. NfYawTB.Height = mS(20)
  521. NfYawTB.Width = mS(205)
  522. NfYawTB.Left = mS(230)
  523. NfYawTB.Top = mS(90)
  524. NfYawTB.Min = 0
  525. NfYawTB.Max = 20
  526. NfYawTB.Position = 4
  527. NfYawTB.Enabled = False
  528.  
  529. ScAgilityBtn = createToggleBox(PTab4)
  530. ScAgilityBtn.Caption ='Supercruise flight agility'
  531. ScAgilityBtn.Height = mS(20)
  532. ScAgilityBtn.Width = mS(205)
  533. ScAgilityBtn.Left = mS(10)
  534. ScAgilityBtn.Top = mS(115)
  535. ScAgilityBtn.Enabled = False
  536.  
  537. ScPitchLabel = createLabel(PTab4)
  538. ScPitchLabel.Caption ='Supercruise flight pitch'
  539. ScPitchLabel.Height = mS(20)
  540. ScPitchLabel.Width = mS(205)
  541. ScPitchLabel.Left = mS(10)
  542. ScPitchLabel.Top = mS(140)
  543.  
  544. ScPitchTB = createTrackBar(PTab4)
  545. ScPitchTB.Height = mS(20)
  546. ScPitchTB.Width = mS(205)
  547. ScPitchTB.Left = mS(230)
  548. ScPitchTB.Top = mS(140)
  549. ScPitchTB.Min = 0
  550. ScPitchTB.Max = 20
  551. ScPitchTB.Position = 4
  552. ScPitchTB.Enabled = False
  553.  
  554. ScRollLabel = createLabel(PTab4)
  555. ScRollLabel.Caption ='Supercruise flight roll'
  556. ScRollLabel.Height = mS(20)
  557. ScRollLabel.Width = mS(205)
  558. ScRollLabel.Left = mS(10)
  559. ScRollLabel.Top = mS(155)
  560.  
  561. ScRollTB = createTrackBar(PTab4)
  562. ScRollTB.Height = mS(20)
  563. ScRollTB.Width = mS(205)
  564. ScRollTB.Left = mS(230)
  565. ScRollTB.Top = mS(155)
  566. ScRollTB.Min = 0
  567. ScRollTB.Max = 20
  568. ScRollTB.Position = 4
  569. ScRollTB.Enabled = False
  570.  
  571. ScYawLabel = createLabel(PTab4)
  572. ScYawLabel.Caption ='Supercruise flight yaw'
  573. ScYawLabel.Height = mS(20)
  574. ScYawLabel.Width = mS(205)
  575. ScYawLabel.Left = mS(10)
  576. ScYawLabel.Top = mS(170)
  577.  
  578. ScYawTB = createTrackBar(PTab4)
  579. ScYawTB.Height = mS(20)
  580. ScYawTB.Width = mS(205)
  581. ScYawTB.Left = mS(230)
  582. ScYawTB.Top = mS(170)
  583. ScYawTB.Min = 0
  584. ScYawTB.Max = 20
  585. ScYawTB.Position = 4
  586. ScYawTB.Enabled = False
  587.  
  588. -- ================ Panel 5 ================
  589.  
  590. JumpFuelBtn = createToggleBox(PTab5)
  591. JumpFuelBtn.Caption ='Jump fuel consumption'
  592. JumpFuelBtn.Height = mS(20)
  593. JumpFuelBtn.Width = mS(205)
  594. JumpFuelBtn.Left = mS(10)
  595. JumpFuelBtn.Top = mS(20)
  596. JumpFuelBtn.Enabled = False
  597.  
  598. JumpFuelTB = createTrackBar(PTab5)
  599. JumpFuelTB.Height = mS(20)
  600. JumpFuelTB.Width = mS(205)
  601. JumpFuelTB.Left = mS(230)
  602. JumpFuelTB.Top = mS(20)
  603. JumpFuelTB.Min = 0
  604. JumpFuelTB.Max = 20
  605. JumpFuelTB.Position = 10
  606. JumpFuelTB.Enabled = False
  607.  
  608. FlightFuelBtn = createToggleBox(PTab5)
  609. FlightFuelBtn.Caption ='Flight fuel consumption'
  610. FlightFuelBtn.Height = mS(20)
  611. FlightFuelBtn.Width = mS(205)
  612. FlightFuelBtn.Left = mS(10)
  613. FlightFuelBtn.Top = mS(45)
  614. FlightFuelBtn.Enabled = False
  615.  
  616. FlightFuelTB = createTrackBar(PTab5)
  617. FlightFuelTB.Height = mS(20)
  618. FlightFuelTB.Width = mS(205)
  619. FlightFuelTB.Left = mS(230)
  620. FlightFuelTB.Top = mS(45)
  621. FlightFuelTB.Min = 0
  622. FlightFuelTB.Max = 20
  623. FlightFuelTB.Position = 10
  624. FlightFuelTB.Enabled = False
  625.  
  626. EnergyBtn = createToggleBox(PTab5)
  627. EnergyBtn.Caption ='Energy consumption'
  628. EnergyBtn.Height = mS(20)
  629. EnergyBtn.Width = mS(205)
  630. EnergyBtn.Left = mS(10)
  631. EnergyBtn.Top = mS(70)
  632. EnergyBtn.Enabled = False
  633.  
  634. EnergyTB = createTrackBar(PTab5)
  635. EnergyTB.Height = mS(20)
  636. EnergyTB.Width = mS(205)
  637. EnergyTB.Left = mS(230)
  638. EnergyTB.Top = mS(70)
  639. EnergyTB.Min = 0
  640. EnergyTB.Max = 20
  641. EnergyTB.Position = 10
  642. EnergyTB.Enabled = False
  643.  
  644. AmmoBtn = createToggleBox(PTab5)
  645. AmmoBtn.Caption ='Freeze ammo'
  646. AmmoBtn.Height = mS(20)
  647. AmmoBtn.Width = mS(205)
  648. AmmoBtn.Left = mS(10)
  649. AmmoBtn.Top = mS(95)
  650. AmmoBtn.Enabled = False
  651.  
  652. NoscoopBtn = createToggleBox(PTab5)
  653. NoscoopBtn.Caption ='No scoop'
  654. NoscoopBtn.Height = mS(20)
  655. NoscoopBtn.Width = mS(205)
  656. NoscoopBtn.Left = mS(230)
  657. NoscoopBtn.Top = mS(95)
  658. NoscoopBtn.Enabled = False
  659.  
  660. SuperchargeBtn = createToggleBox(PTab5)
  661. SuperchargeBtn.Caption ='Supercharge FSD'
  662. SuperchargeBtn.Height = mS(20)
  663. SuperchargeBtn.Width = mS(205)
  664. SuperchargeBtn.Left = mS(10)
  665. SuperchargeBtn.Top = mS(120)
  666. SuperchargeBtn.Enabled = False
  667.  
  668. -- ================ Under panels ================
  669.  
  670. PAN1 = createPanel(TRN)
  671. PAN1.Color = 0xBFBFBF
  672. setProperty(PAN1, 'BorderStyle', 'bsNone')
  673. setProperty(PAN1, 'BevelOuter', 'bvNone')
  674. setProperty(PAN1, 'Align', 'alBottom')
  675. PAN1.Height = mS(57)
  676. PAN1.Width = mS(450)
  677.  
  678. DisAllBtn = createButton(PAN1)
  679. DisAllBtn.Caption ='Suspend active cheats'
  680. DisAllBtn.Height = mS(20)
  681. DisAllBtn.Width = mS(205)
  682. DisAllBtn.Left = mS(14)
  683. DisAllBtn.Top = mS(5)
  684. DisAllBtn.Enabled = False
  685.  
  686. ReactivBtn = createButton(PAN1)
  687. ReactivBtn.Caption ='Resume suspended cheats'
  688. ReactivBtn.Height = mS(20)
  689. ReactivBtn.Width = mS(205)
  690. ReactivBtn.Left = mS(234)
  691. ReactivBtn.Top = mS(5)
  692. ReactivBtn.Enabled = False
  693.  
  694. PAN1Label = createLabel(PAN1)
  695. PAN1Label.Align = 'alBottom'
  696. PAN1Label.Height = mS(32)
  697. PAN1Label.Alignment = 'taCenter'
  698. setProperty(PAN1Label, 'WordWrap', 'True')
  699. PAN1Label.Caption = 'Credits: Made upon hard work of Randshot, NU199, lorddoggy, Apeman, kabachi, laji, djdoom32, hasoon, Hans211, hoki, Jamesc00ls, Dark Byte and many others.'
  700.  
  701. TRN.show()
  702.  
  703. TRN.onClose = function()
  704. closeCE()
  705. return caFree
  706. end
  707.  
  708. ShieldBtn.onChange = function()
  709. if state['shield'] then status_upd('Shield damage is OFF') else status_upd('Shield damage is ON') end
  710. toggle('shield')
  711. end
  712.  
  713. ShieldTB.onChange = function()
  714. local val = ShieldTB.Position * 5
  715. status_upd(string.format('Player shield damage changed to %d %%', val))
  716. writeFloat(getAddress('shieldmul'), val/100)
  717. end
  718.  
  719. ShieldNPCTB.onChange = function()
  720. local val = ShieldNPCTB.Position * 50
  721. status_upd(string.format('NPCs shield damage changed to +%d %%', val))
  722. writeFloat(getAddress('shieldnpcmul'), 1.0+(val/100))
  723. end
  724.  
  725. HullBtn.onChange = function()
  726. if state['hull'] then status_upd('Hull damage is OFF') else status_upd('Hull damage is ON') end
  727. toggle('hull')
  728. end
  729.  
  730. HullTB.onChange = function()
  731. local val = HullTB.Position * 5
  732. status_upd(string.format('Player hull damage changed to %d %%', val))
  733. writeFloat(getAddress('hullmul'), val/100)
  734. end
  735.  
  736. HullNPCTB.onChange = function()
  737. local val = HullNPCTB.Position * 50
  738. status_upd(string.format('NPCs hull damage changed to +%d %%', val))
  739. writeFloat(getAddress('hullnpcmul'), 1.0+(val/100))
  740. end
  741.  
  742. ModuleBtn.onChange = function()
  743. if state['module'] then status_upd('Modules damage is OFF') else status_upd('Modules damage is ON') end
  744. toggle('module')
  745. end
  746.  
  747. ModuleTB.onChange = function()
  748. local val = ModuleTB.Position * 5
  749. status_upd(string.format('Player modules damage changed to %d %%', val))
  750. writeFloat(getAddress('modulemul'), val/100)
  751. end
  752.  
  753. ModuleNPCTB.onChange = function()
  754. local val = ModuleNPCTB.Position * 50
  755. status_upd(string.format('NPCs modules damage changed to +%d %%', val))
  756. writeFloat(getAddress('modulenpcmul'), 1.0+(val/100))
  757. end
  758.  
  759. EnergyBtn.onChange = function()
  760. if state['energy'] then status_upd('Energy consumption is OFF') else status_upd('Energy consumption is ON') end
  761. toggle('energy')
  762. end
  763.  
  764. EnergyTB.onChange = function()
  765. local val = EnergyTB.Position * 5
  766. status_upd(string.format('Energy consumption changed to %d %%', val))
  767. if val == 0 then val = 0.1 end
  768. writeFloat(getAddress('energymul'), val/100)
  769. end
  770.  
  771. InterdictBtn.onChange = function()
  772. if state['interdict'] then status_upd('No interdiction is OFF') else status_upd('No interdiction is ON') end
  773. toggle('interdict')
  774. end
  775.  
  776. AmmoBtn.onChange = function()
  777. if state['ammo'] then status_upd('Freeze ammo is OFF') else status_upd('Freeze ammo is ON') end
  778. toggle('ammo')
  779. end
  780.  
  781. HeatsinkBtn.onChange = function()
  782. if state['heatsink'] then status_upd('Endless heatsink is OFF') else status_upd('Endless heatsink is ON') end
  783. toggle('heatsink')
  784. end
  785.  
  786. NoscoopBtn.onChange = function()
  787. if state['noscoop'] then status_upd('No scoop is OFF') else status_upd('No scoop is ON') end
  788. toggle('noscoop')
  789. end
  790.  
  791. JumpFuelBtn.onChange = function()
  792. if state['jumpfuel'] then status_upd('Jump fuel consumption is OFF') else status_upd('Jump fuel consumption is ON') end
  793. toggle('jumpfuel')
  794. end
  795.  
  796. JumpFuelTB.onChange = function()
  797. local val = JumpFuelTB.Position * 5
  798. status_upd(string.format('Jump fuel consumption changed to %d %%', val))
  799. writeFloat(getAddress('jumpfuelmul'), val/100)
  800. end
  801.  
  802. FlightFuelBtn.onChange = function()
  803. if state['flightfuel'] then status_upd('Normal flight fuel consumption is OFF') else status_upd('Normal flight fuel consumption is ON') end
  804. toggle('flightfuel')
  805. end
  806.  
  807. FlightFuelTB.onChange = function()
  808. local val = FlightFuelTB.Position * 5
  809. status_upd(string.format('Normal flight fuel consumption changed to %d %%', val))
  810. writeDouble(getAddress('flightfuelmul'), val/100)
  811. end
  812.  
  813. FuelScoopBtn.onChange = function()
  814. if state['fuelscoop'] then status_upd('Fuel scoop multiplier is OFF') else status_upd('Fuel scoop multiplier is ON') end
  815. toggle('fuelscoop')
  816. end
  817.  
  818. FuelScoopTB.onChange = function()
  819. local val = FuelScoopTB.Position * 50
  820. status_upd(string.format('Fuel scoop multiplier changed to +%d %%', val))
  821. writeFloat(getAddress('fuelscoopmul'), 1.0+(val/100))
  822. end
  823.  
  824. HyperAnimBtn.onChange = function()
  825. if state['hyperanim'] then status_upd('Hyperspace animation speed is OFF') else status_upd('Hyperspace animation speed is ON') end
  826. toggle('hyperanim')
  827. end
  828.  
  829. HyperAnimTB.onChange = function()
  830. local val = HyperAnimTB.Position * 50
  831. status_upd(string.format('Hyperspace animation speed changed to +%d %%', val))
  832. writeFloat(getAddress('hyperanimmul'), 1.0+(val/100))
  833. end
  834.  
  835. MassBtn.onChange = function()
  836. if state['masslock'] then status_upd('No masslock is OFF') else status_upd('No masslock is ON') end
  837. toggle('masslock')
  838. end
  839.  
  840. CooldownBtn.onChange = function()
  841. if state['cooldown'] then status_upd('No cooldown is OFF') else status_upd('No cooldown is ON') end
  842. toggle('cooldown')
  843. end
  844.  
  845. JumpchargeBtn.onChange = function()
  846. if state['jumpcharge'] then status_upd('No jump charge is OFF') else status_upd('No jump charge is ON') end
  847. toggle('jumpcharge')
  848. end
  849.  
  850. JumpcountBtn.onChange = function()
  851. if state['jumpcount'] then status_upd('No jump countdown is OFF') else status_upd('No jump countdown is ON') end
  852. toggle('jumpcount')
  853. end
  854.  
  855. OmnijumpBtn.onChange = function()
  856. if state['omnijump'] then status_upd('All directions jump is OFF') else status_upd('All directions jump is ON') end
  857. toggle('omnijump')
  858. end
  859.  
  860. DropOffBtn.onChange = function()
  861. if state['dropoff'] then status_upd('Drop off to target is OFF') else status_upd('Drop off to target is ON') end
  862. toggle('dropoff')
  863. end
  864.  
  865. SuperchargeBtn.onChange = function()
  866. if state['supercharge'] then status_upd('FSD supercharge is OFF') else status_upd('FSD supercharge is ON') end
  867. toggle('supercharge')
  868. end
  869.  
  870. KwsSpeedBtn.onChange = function()
  871. if state['kwsspeed'] then status_upd('KWS speed multiplier is OFF') else status_upd('KWS speed multiplier is ON') end
  872. toggle('kwsspeed')
  873. end
  874.  
  875. KwsSpeedTB.onChange = function()
  876. local val = KwsSpeedTB.Position * 50
  877. status_upd(string.format('KWS speed multiplier changed to +%d %%', val))
  878. writeFloat(getAddress('kwsspeedmul'), 1.0+(val/100))
  879. end
  880.  
  881. KwsomniBtn.onChange = function()
  882. if state['kwsomni'] then status_upd('All directions KWS scan is OFF') else status_upd('All directions KWS scan is ON') end
  883. toggle('kwsomni')
  884. end
  885.  
  886. KwslongBtn.onChange = function()
  887. if state['kwslong'] then status_upd('Distant KWS scan is OFF') else status_upd('Distant KWS scan is ON') end
  888. toggle('kwslong')
  889. end
  890.  
  891. NormalscanSpeedBtn.onChange = function()
  892. if state['normalscanspeed'] then status_upd('Ship scan speed multiplier is OFF') else status_upd('Ship scan speed multiplier is ON') end
  893. toggle('normalscanspeed')
  894. end
  895.  
  896. NormalscanSpeedTB.onChange = function()
  897. local val = NormalscanSpeedTB.Position * 50
  898. status_upd(string.format('Ship scan speed multiplier changed to +%d %%', val))
  899. writeFloat(getAddress('normalscanspeedmul'), 1.0+(val/100))
  900. end
  901.  
  902. NormalscanBtn.onChange = function()
  903. if state['normalscan'] then status_upd('All directions ship scan is OFF') else status_upd('All directions ship scan is ON') end
  904. toggle('normalscan')
  905. end
  906.  
  907. PlanetomniBtn.onChange = function()
  908. if state['planetomni'] then status_upd('All directions planet scan is OFF') else status_upd('All directions planet scan is ON') end
  909. toggle('planetomni')
  910. end
  911.  
  912. PlanetlongBtn.onChange = function()
  913. if state['planetlong'] then status_upd('Distant planet scan is OFF') else status_upd('Distant planet scan is ON') end
  914. toggle('planetlong')
  915. end
  916.  
  917. PlanetScanSpeedBtn.onChange = function()
  918. if state['planetscanspeed'] then status_upd('Planet scan speed multiplier is OFF') else status_upd('Planet scan speed multiplier is ON') end
  919. toggle('planetscanspeed')
  920. end
  921.  
  922. PlanetScanSpeedTB.onChange = function()
  923. local val = PlanetScanSpeedTB.Position * 50
  924. status_upd(string.format('Planet scan speed multiplier changed to +%d %%', val))
  925. writeFloat(getAddress('planetscanspeedmul'), 1.0+(val/100))
  926. end
  927.  
  928. DiscoveryScanSpeedBtn.onChange = function()
  929. if state['discoveryscanspeed'] then status_upd('Discovery scan speed multiplier is OFF') else status_upd('Discovery scan speed multiplier is ON') end
  930. toggle('discoveryscanspeed')
  931. end
  932.  
  933. DiscoveryScanSpeedTB.onChange = function()
  934. local val = DiscoveryScanSpeedTB.Position * 50
  935. status_upd(string.format('Discovery scan speed multiplier changed to +%d %%', val))
  936. writeFloat(getAddress('discoveryscanspeedmul'), 1.0+(val/100))
  937. end
  938.  
  939. NfAgilityBtn.onChange = function()
  940. if state['nfagility'] then
  941. status_upd('Normal flight agility is OFF')
  942. NfAgilityNpcBtn.Enabled = false
  943. NfAgilityNpcBtn.Checked = false
  944. writeFloat(getAddress('nfnpcmul'), 1.0)
  945. else
  946. status_upd('Normal flight agility is ON')
  947. NfAgilityNpcBtn.Enabled = true
  948. end
  949. toggle('nfagility')
  950. end
  951.  
  952. NfAgilityNpcBtn.onChange = function()
  953. if NfAgilityNpcBtn.Checked then
  954. status_upd('Normal flight NPCs paralyze is ON')
  955. writeFloat(getAddress('nfnpcmul'), 0.0)
  956. else
  957. status_upd('Normal flight NPCs paralyze is OFF')
  958. writeFloat(getAddress('nfnpcmul'), 1.0)
  959. end
  960. end
  961.  
  962. SpeedTB.onChange = function()
  963. local val = SpeedTB.Position * 20
  964. status_upd(string.format('Normal flight max speed multiplier changed to +%d %%', val))
  965. writeFloat(getAddress('nfspeedmul'), 1.0+(val/100))
  966. end
  967.  
  968. NfPitchTB.onChange = function()
  969. local val = NfPitchTB.Position * 25
  970. status_upd(string.format('Normal flight pitch multiplier changed to +%d %%', val))
  971. writeFloat(getAddress('nfpitchmul'), 1.0+(val/100))
  972. end
  973.  
  974. NfRollTB.onChange = function()
  975. local val = NfRollTB.Position * 25
  976. status_upd(string.format('Normal flight roll multiplier changed to +%d %%', val))
  977. writeFloat(getAddress('nfrollmul'), 1.0+(val/100))
  978. end
  979.  
  980. NfYawTB.onChange = function()
  981. local val = NfYawTB.Position * 50
  982. status_upd(string.format('Normal flight yaw multiplier changed to +%d %%', val))
  983. writeFloat(getAddress('nfyawmul'), 1.0+(val/100))
  984. end
  985.  
  986. ScAgilityBtn.onChange = function()
  987. if state['scagility'] then status_upd('Supercruise flight agility is OFF') else status_upd('Supercruise flight agility is ON') end
  988. toggle('scagility')
  989. end
  990.  
  991. ScPitchTB.onChange = function()
  992. local val = ScPitchTB.Position * 50
  993. status_upd(string.format('Supercruise flight pitch multiplier changed to +%d %%', val))
  994. writeFloat(getAddress('scpitchmul'), 1.0+(val/100))
  995. end
  996.  
  997. ScRollTB.onChange = function()
  998. local val = ScRollTB.Position * 25
  999. status_upd(string.format('Supercruise flight roll multiplier changed to +%d %%', val))
  1000. writeFloat(getAddress('scrollmul'), 1.0+(val/100))
  1001. end
  1002.  
  1003. ScYawTB.onChange = function()
  1004. local val = ScYawTB.Position * 50
  1005. status_upd(string.format('Supercruise flight yaw multiplier changed to +%d %%', val))
  1006. writeFloat(getAddress('scyawmul'), 1.0+(val/100))
  1007. end
  1008.  
  1009. DisAllBtn.onClick = function()
  1010. suspend_cheats()
  1011. end
  1012.  
  1013. ReactivBtn.onClick = function()
  1014. resume_cheats()
  1015. end
  1016.  
  1017. function kill_game()
  1018. os.execute([[TASKKILL /F /IM ]] .. process_name ..[[ /T]])
  1019. status_upd('Something went wrong! Game process terminated.', 255)
  1020. showMessage('Fatal error. Trainer terminated.\nContact author for newer version.')
  1021. closeCE()
  1022. return caFree
  1023. end
  1024.  
  1025. function B2S(bytes)
  1026. local s = ''
  1027. for i = 1, #bytes do
  1028. s = s..string.format('%02X', bytes[i])
  1029. if i < #bytes then s = s..' ' end
  1030. end
  1031. return s
  1032. end
  1033.  
  1034. function status_upd(msg, cvalue)
  1035. local msg = msg or ''
  1036. local cvalue = cvalue or 0
  1037. StatusLabel2.Caption = msg
  1038. setProperty(StatusLabel2.Font, 'Color', cvalue)
  1039. end
  1040.  
  1041. function dissectPEHeader(module)
  1042. local base = getAddress(module)
  1043. local msdosSize = byteTableToDword(readBytes(base + 0x3C, 2, true))
  1044. local headerBase = base + msdosSize
  1045. local numOfSections = byteTableToDword(readBytes(headerBase + 6, 2, true))
  1046. local optionalHeaderSize = byteTableToDword(readBytes(headerBase + 20, 2, true))
  1047. local sectionArrayBase = headerBase + 24 + optionalHeaderSize
  1048. local pe_header = {
  1049. base = base;
  1050. msdosSize = msdosSize;
  1051. headerBase = headerBase;
  1052. numOfSections = numOfSections;
  1053. optionalHeaderSize = optionalHeaderSize;
  1054. sectionArrayBase = sectionArrayBase;
  1055. }
  1056. for i = 0, numOfSections - 1 do
  1057. local sectionBase = sectionArrayBase + i * 40
  1058. local sectionName = readString(sectionBase, 8)
  1059. pe_header[sectionName] = {
  1060. name = sectionName;
  1061. base = sectionBase;
  1062. size = byteTableToDword(readBytes(sectionBase + 8, 4, true));
  1063. address = byteTableToDword(readBytes(sectionBase + 12, 4, true));
  1064. sizeOfRawData = byteTableToDword(readBytes(sectionBase + 16, 4, true));
  1065. pointerToRawData = byteTableToDword(readBytes(sectionBase + 20, 4, true));
  1066. pointerToRawRelocations = byteTableToDword(readBytes(sectionBase + 24, 4, true));
  1067. pointerToLineNumbers = byteTableToDword(readBytes(sectionBase + 28, 4, true));
  1068. numOfRelocations = byteTableToDword(readBytes(sectionBase + 32, 2, true));
  1069. numOfLineNumbers = byteTableToDword(readBytes(sectionBase + 34, 2, true));
  1070. characteristics = byteTableToDword(readBytes(sectionBase + 36, 4, true));
  1071. }
  1072. end
  1073.  
  1074. return pe_header
  1075. end
  1076.  
  1077. function AOBScan2(pattern, startaddr, module)
  1078. local result = nil
  1079. local module = module or process_name
  1080. local endaddr = getAddress(module) + getModuleSize(module)
  1081. local scan = createMemScan(true)
  1082. scan.OnlyOneResult = true
  1083. scan.firstScan(soExactValue, vtByteArray, 0, pattern, "", startaddr, endaddr, "*X*W*C", 0, "", true, true, false, false)
  1084. scan.waitTillDone()
  1085.  
  1086. result = scan.Result
  1087.  
  1088. if result == nil then
  1089. kill_game()
  1090. end
  1091.  
  1092. scan.destroy()
  1093. scan=nil
  1094.  
  1095. return result
  1096. end
  1097.  
  1098. function doPatch(name, patch_bytes)
  1099. local size = 0
  1100. for str in string.gmatch(patch_bytes, "([^%s]+)") do
  1101. size = size + 1
  1102. end
  1103.  
  1104. local orig_bytes = readBytes(offset[name], size, true)
  1105.  
  1106. enable[name] = string.format('%x:\ndb %s', offset[name], patch_bytes)
  1107. disable[name] = string.format('%x:\ndb %s', offset[name], B2S(orig_bytes))
  1108.  
  1109. state[name] = false
  1110. if item[name] ~= nil then
  1111. setProperty(item[name], 'Enabled', 'True')
  1112. end
  1113. end
  1114.  
  1115. function doHook(name)
  1116. local address = offset[name]
  1117. local hooksize = 5
  1118.  
  1119. -- Calculating hook size
  1120. local size = 0
  1121. repeat
  1122. size = size + getInstructionSize(address + size)
  1123. until size >= hooksize
  1124. local returnaddress = address + size
  1125.  
  1126. -- Adding nops to the patch string
  1127. local nops = ''
  1128. if (size > hooksize) then
  1129. for i = 1, size - hooksize do
  1130. nops = string.format('%s %s', nops, '90')
  1131. end
  1132. nops = string.format('%s%s', 'db', nops)
  1133. end
  1134.  
  1135. local aainit = string.format([==[
  1136. alloc(jmp%s,128,%x) //address
  1137. alloc(new%s,2048)
  1138. alloc(old%s,1016)
  1139. alloc(ret%s,8)
  1140. alloc(bk%s,%i) //size
  1141.  
  1142. registersymbol(jmp%s)
  1143. registersymbol(new%s)
  1144. registersymbol(old%s)
  1145. registersymbol(ret%s)
  1146. registersymbol(bk%s)
  1147.  
  1148. ret%s:
  1149. dq %x //returnaddress
  1150.  
  1151. bk%s:
  1152. readmem(%x,%i) //address,size
  1153. ]==],
  1154. name, address, name, name, name, name, size,
  1155. name, name, name, name, name,
  1156. name, returnaddress,
  1157. name, address, size)
  1158.  
  1159. local aainit2 = string.format([==[
  1160. label(jmpaddress)
  1161.  
  1162. old%s:
  1163. readmem(bk%s,%i) //size
  1164. jmp [ret%s]
  1165.  
  1166. new%s:
  1167. jmp old%s
  1168.  
  1169. jmp%s:
  1170. jmp [jmpaddress]
  1171. jmpaddress:
  1172. dq new%s
  1173. ]==],name, name, size, name,
  1174. name, name,
  1175. name, name)
  1176.  
  1177. enable[name] = string.format([==[
  1178. %x: //address
  1179. jmp jmp%s
  1180. %s //nops
  1181. ]==], address, name, nops)
  1182.  
  1183. disable[name] = string.format([==[
  1184. %x: //address
  1185. readmem(bk%s,%i) //size
  1186. ]==],address, name, size)
  1187.  
  1188. autoAssemble(aainit)
  1189. autoAssemble(aainit2)
  1190.  
  1191. state[name] = false
  1192. if item[name] ~= nil then
  1193. setProperty(item[name], 'Enabled', 'True')
  1194. end
  1195. end
  1196.  
  1197. function toggle(name)
  1198. if state[name] then
  1199. autoAssemble(disable[name])
  1200. state[name] = false
  1201. else
  1202. autoAssemble(enable[name])
  1203. state[name] = true
  1204. end
  1205. end
  1206.  
  1207. function init()
  1208. pause()
  1209.  
  1210. for i=1,#sorted do
  1211. local startaddr = 0
  1212. if i==1 then startaddr = getAddress(process_name) else startaddr = offset[sorted[i-1]] end
  1213. offset[sorted[i]] = AOBScan2(aob[sorted[i]], startaddr)
  1214. end
  1215.  
  1216. -- ==================================
  1217.  
  1218. shift_text = readInteger(offset['textshift']+2)
  1219. random_bytes = {}
  1220. math.randomseed(os.time())
  1221. for i=1,shift_text do
  1222. random_bytes[i] = math.random(0,255)
  1223. end
  1224.  
  1225. local header = dissectPEHeader(process_name)
  1226.  
  1227. PtrToRawData = header['.text'].pointerToRawData
  1228. tstart = header.base + PtrToRawData
  1229. tlength = header['.text'].sizeOfRawData + 0x1000
  1230. tend = tstart + tlength
  1231. local copycode = string.format([[
  1232. alloc(_textcopy,%i,0x%x)
  1233. registersymbol(_textcopy)
  1234. _textcopy:
  1235. db %s
  1236. readmem(0x%x,%i)
  1237. ]], tlength + shift_text, tend, B2S(random_bytes), tstart, tlength)
  1238. autoAssemble(copycode)
  1239.  
  1240. tcopy = getAddress('_textcopy') + shift_text
  1241.  
  1242. doHook('check1')
  1243. local check1code = string.format([[
  1244. newcheck1:
  1245. push rax
  1246. mov rax,0x%x
  1247. cmp rdx,rax
  1248. pop rax
  1249. jb oldcheck1
  1250. push rax
  1251. mov rax,0x%x
  1252. cmp rdx,rax
  1253. pop rax
  1254. jge oldcheck1
  1255. push rax
  1256. mov rax,0x%x
  1257. sub rdx,rax
  1258. mov rax,0x%x
  1259. add rdx,rax
  1260. pop rax
  1261. jmp oldcheck1
  1262. ]], tstart, tend, tstart, tcopy)
  1263. autoAssemble(check1code)
  1264. toggle('check1')
  1265.  
  1266. doHook('check2')
  1267. local check2code = string.format([[
  1268. newcheck2:
  1269. push rax
  1270. push rbx
  1271. mov rax,[rsp+48]
  1272. mov rbx,0x%x
  1273. cmp rax,rbx
  1274. pop rbx
  1275. pop rax
  1276. jne oldcheck2
  1277. push rax
  1278. mov rax,0x%x
  1279. sub rax,0x%x
  1280. mov [rsi+0x8],rax
  1281. pop rax
  1282. jmp oldcheck2
  1283. ]], offset['check2caller'], tcopy, PtrToRawData)
  1284. autoAssemble(check2code)
  1285. toggle('check2')
  1286.  
  1287. doHook('check3')
  1288. local check3code = string.format([[
  1289. newcheck3:
  1290. push rax
  1291. mov rax,0x%x
  1292. cmp rcx,rax
  1293. pop rax
  1294. jb oldcheck3
  1295. push rax
  1296. mov rax,0x%x
  1297. cmp rcx,rax
  1298. pop rax
  1299. jge oldcheck3
  1300. push rax
  1301. mov rax,0x%x
  1302. sub rcx,rax
  1303. mov rax,0x%x
  1304. add rcx,rax
  1305. pop rax
  1306. jmp oldcheck3
  1307. ]], tstart, tend, tstart, tcopy)
  1308. autoAssemble(check3code)
  1309. toggle('check3')
  1310.  
  1311. doHook('check4')
  1312. local check4code = string.format([[
  1313. newcheck4:
  1314. push rax
  1315. mov rax,0x%x
  1316. cmp rdx,rax
  1317. pop rax
  1318. jb oldcheck4
  1319. push rax
  1320. mov rax,0x%x
  1321. cmp rdx,rax
  1322. pop rax
  1323. jge oldcheck4
  1324. push rax
  1325. mov rax,0x%x
  1326. sub rdx,rax
  1327. mov rax,0x%x
  1328. add rdx,rax
  1329. pop rax
  1330. jmp oldcheck4
  1331. ]], tstart, tend, tstart, tcopy)
  1332. autoAssemble(check4code)
  1333. toggle('check4')
  1334.  
  1335. doPatch('energycheck', 'EB')
  1336. toggle('energycheck')
  1337.  
  1338. doPatch('shieldcheck1', 'EB')
  1339. toggle('shieldcheck1')
  1340.  
  1341. doPatch('shieldcheck2', 'F3 0F 58 C4 F3 0F 10 C6')
  1342. toggle('shieldcheck2')
  1343.  
  1344. doPatch('searchcheck', '31 C0')
  1345. toggle('searchcheck')
  1346.  
  1347. doPatch('jumpcheck1', 'EB')
  1348. toggle('jumpcheck1')
  1349.  
  1350. doPatch('jumpcheck2', 'EB')
  1351. toggle('jumpcheck2')
  1352.  
  1353. doPatch('jumpcheck3', 'EB')
  1354. toggle('jumpcheck3')
  1355.  
  1356. -- ==================================
  1357.  
  1358. hullPtr_shield = readInteger(offset['hullinshield']+3)
  1359. hullPtr_module = readInteger(offset['hullinmodule']+3)
  1360. shipObjPtr_hull = readInteger(offset['shipinhull']+3)
  1361. shipObjPtr = shipObjPtr_hull - readInteger(offset['hulloffsetshift']+3)
  1362. isNpcPtr = 0x220
  1363.  
  1364. doHook('shield')
  1365. local shieldmulcode = string.format([[
  1366. alloc(shieldmul,8,%x)
  1367. alloc(shieldnpcmul,8,%x)
  1368. registersymbol(shieldmul)
  1369. registersymbol(shieldnpcmul)
  1370. shieldmul:
  1371. dd (float)0.5
  1372. shieldnpcmul:
  1373. dd (float)1.0
  1374. ]],offset['shield'], offset['shield'])
  1375. autoAssemble(shieldmulcode)
  1376. setProperty(ShieldTB, 'Enabled', 'True')
  1377. setProperty(ShieldNPCTB, 'Enabled', 'True')
  1378.  
  1379. local shieldcode = string.format([[
  1380. label(shield_npc)
  1381. newshield:
  1382. push rax
  1383. mov rax,[rdi+0x%x] //hullPtr_shield
  1384. mov rax,[rax+0x%x] //shipObjPtr
  1385. test rax,rax
  1386. pop rax
  1387. jz shield_npc
  1388. push rax
  1389. push rbx
  1390. mov rax,[rdi+0x%x] //hullPtr_shield
  1391. mov rax,[rax+0x%x] //shipObjPtr
  1392. mov bh,BYTE PTR [rax+0x%x] //isNpcPtr
  1393. mov bl,BYTE PTR [rax+0x%x] //+1
  1394. cmp bh,bl
  1395. pop rbx
  1396. pop rax
  1397. jne shield_npc
  1398. mulss xmm6,DWORD PTR [shieldmul]
  1399. jmp oldshield
  1400. shield_npc:
  1401. mulss xmm6,DWORD PTR [shieldnpcmul]
  1402. jmp oldshield
  1403. ]], hullPtr_shield, shipObjPtr, hullPtr_shield, shipObjPtr, isNpcPtr, isNpcPtr+1)
  1404. autoAssemble(shieldcode)
  1405.  
  1406. doHook('hull')
  1407. local hullmulcode = string.format([[
  1408. alloc(hullmul,8,%x)
  1409. alloc(hullnpcmul,8,%x)
  1410. registersymbol(hullmul)
  1411. registersymbol(hullnpcmul)
  1412. hullmul:
  1413. dd (float)0.5
  1414. hullnpcmul:
  1415. dd (float)1.0
  1416. ]],offset['hull'], offset['hull'])
  1417. autoAssemble(hullmulcode)
  1418. setProperty(HullTB, 'Enabled', 'True')
  1419. setProperty(HullNPCTB, 'Enabled', 'True')
  1420.  
  1421. local hullcode = string.format([[
  1422. label(hull_npc)
  1423. newhull:
  1424. push rax
  1425. mov rax,[r14+0x%x] //shipObjPtr_hull
  1426. test rax,rax
  1427. pop rax
  1428. jz hull_npc
  1429. push rax
  1430. push rbx
  1431. mov rax,[r14+0x%x] //shipObjPtr_hull
  1432. mov bh,BYTE PTR [rax+0x%x] //isNpcPtr
  1433. mov bl,BYTE PTR [rax+0x%x] //+1
  1434. cmp bh,bl
  1435. pop rbx
  1436. pop rax
  1437. jne hull_npc
  1438. mulss xmm7,DWORD PTR [hullmul]
  1439. jmp oldhull
  1440. hull_npc:
  1441. mulss xmm7,DWORD PTR [hullnpcmul]
  1442. jmp oldhull
  1443. ]], shipObjPtr_hull, shipObjPtr_hull, isNpcPtr, isNpcPtr+1)
  1444. autoAssemble(hullcode)
  1445.  
  1446. doHook('module')
  1447. local modulemulcode = string.format([[
  1448. alloc(modulemul,8,%x)
  1449. alloc(modulenpcmul,8,%x)
  1450. registersymbol(modulemul)
  1451. registersymbol(modulenpcmul)
  1452. modulemul:
  1453. dd (float)0.5
  1454. modulenpcmul:
  1455. dd (float)1.0
  1456. ]],offset['module'], offset['module'])
  1457. autoAssemble(modulemulcode)
  1458. setProperty(ModuleTB, 'Enabled', 'True')
  1459. setProperty(ModuleNPCTB, 'Enabled', 'True')
  1460.  
  1461. local modulecode = string.format([[
  1462. label(module_npc)
  1463. newmodule:
  1464. push rax
  1465. mov rax,[rdi+0x%x] //hullPtr_module
  1466. mov rax,[rax+0x%x] //shipObjPtr
  1467. test rax,rax
  1468. pop rax
  1469. jz module_npc
  1470. push rax
  1471. push rbx
  1472. mov rax,[rdi+0x%x] //hullPtr_module
  1473. mov rax,[rax+0x%x] //shipObjPtr
  1474. mov bh,BYTE PTR [rax+0x%x] //isNpcPtr
  1475. mov bl,BYTE PTR [rax+0x%x] //+1
  1476. cmp bh,bl
  1477. pop rbx
  1478. pop rax
  1479. jne module_npc
  1480. mulss xmm6,DWORD PTR [modulemul]
  1481. jmp oldmodule
  1482. module_npc:
  1483. mulss xmm6,DWORD PTR [modulenpcmul]
  1484. jmp oldmodule
  1485. ]], hullPtr_module, shipObjPtr, hullPtr_module, shipObjPtr, isNpcPtr, isNpcPtr+1)
  1486. autoAssemble(modulecode)
  1487.  
  1488. doHook('energy')
  1489. local energymulcode = string.format([[
  1490. alloc(energymul,8,%x)
  1491. registersymbol(energymul)
  1492. energymul:
  1493. dd (float)0.5
  1494. ]],offset['energy'])
  1495. autoAssemble(energymulcode)
  1496. setProperty(EnergyTB, 'Enabled', 'True')
  1497.  
  1498. local energycode = [[
  1499. newenergy:
  1500. mulss xmm6,DWORD PTR [energymul]
  1501. jmp oldenergy
  1502. ]]
  1503. autoAssemble(energycode)
  1504.  
  1505. doHook('jumpfuel')
  1506. local jumpfuelmulcode = string.format([[
  1507. alloc(jumpfuelmul,8,%x)
  1508. registersymbol(jumpfuelmul)
  1509. jumpfuelmul:
  1510. dd (float)0.5
  1511. ]],offset['jumpfuel'])
  1512. autoAssemble(jumpfuelmulcode)
  1513. setProperty(JumpFuelTB, 'Enabled', 'True')
  1514.  
  1515. local jumpfuelcode = [[
  1516. newjumpfuel:
  1517. mulss xmm7,DWORD PTR [jumpfuelmul]
  1518. jmp oldjumpfuel
  1519. ]]
  1520. autoAssemble(jumpfuelcode)
  1521.  
  1522. doHook('flightfuel')
  1523. local flightfuelmulcode = string.format([[
  1524. alloc(flightfuelmul,8,%x)
  1525. registersymbol(flightfuelmul)
  1526. flightfuelmul:
  1527. dq (double)0.5
  1528. ]],offset['flightfuel'])
  1529. autoAssemble(flightfuelmulcode)
  1530. setProperty(FlightFuelTB, 'Enabled', 'True')
  1531.  
  1532. local flightfuelcode = [[
  1533. newflightfuel:
  1534. movsd xmm6,[flightfuelmul]
  1535. mulsd xmm1,xmm6
  1536. jmp oldflightfuel
  1537. ]]
  1538. autoAssemble(flightfuelcode)
  1539.  
  1540. doHook('fuelscoop')
  1541. local fuelscoopmulcode = string.format([[
  1542. alloc(fuelscoopmul,8,%x)
  1543. registersymbol(fuelscoopmul)
  1544. fuelscoopmul:
  1545. dd (float)3.0
  1546. ]],offset['fuelscoop'])
  1547. autoAssemble(fuelscoopmulcode)
  1548. setProperty(FuelScoopTB, 'Enabled', 'True')
  1549.  
  1550. local fuelscoopcode = [[
  1551. newfuelscoop:
  1552. mulss xmm8,DWORD PTR [fuelscoopmul]
  1553. jmp oldfuelscoop
  1554. ]]
  1555. autoAssemble(fuelscoopcode)
  1556.  
  1557. doHook('hyperanim')
  1558. local hyperanimmulcode = string.format([[
  1559. alloc(hyperanimmul,8,%x)
  1560. registersymbol(hyperanimmul)
  1561. hyperanimmul:
  1562. dd (float)3.0
  1563. ]],offset['hyperanim'])
  1564. autoAssemble(hyperanimmulcode)
  1565. setProperty(HyperAnimTB, 'Enabled', 'True')
  1566.  
  1567. local hyperanimcode = [[
  1568. newhyperanim:
  1569. mulss xmm2,DWORD PTR [hyperanimmul]
  1570. jmp oldhyperanim
  1571. ]]
  1572. autoAssemble(hyperanimcode)
  1573.  
  1574. doHook('kwsspeed')
  1575. local kwsspeedmulcode = string.format([[
  1576. alloc(kwsspeedmul,8,%x)
  1577. registersymbol(kwsspeedmul)
  1578. kwsspeedmul:
  1579. dd (float)3.0
  1580. ]],offset['kwsspeed'])
  1581. autoAssemble(kwsspeedmulcode)
  1582. setProperty(KwsSpeedTB, 'Enabled', 'True')
  1583.  
  1584. local kwsspeedcode = [[
  1585. newkwsspeed:
  1586. mulss xmm8,DWORD PTR [kwsspeedmul]
  1587. jmp oldkwsspeed
  1588. ]]
  1589. autoAssemble(kwsspeedcode)
  1590.  
  1591. doHook('normalscanspeed')
  1592. local normalscanspeedmulcode = string.format([[
  1593. alloc(normalscanspeedmul,8,%x)
  1594. registersymbol(normalscanspeedmul)
  1595. normalscanspeedmul:
  1596. dd (float)3.0
  1597. ]],offset['normalscanspeed'])
  1598. autoAssemble(normalscanspeedmulcode)
  1599. setProperty(NormalscanSpeedTB, 'Enabled', 'True')
  1600.  
  1601. local normalscanspeedcode = [[
  1602. newnormalscanspeed:
  1603. mulss xmm6,[normalscanspeedmul]
  1604. jmp oldnormalscanspeed
  1605. ]]
  1606. autoAssemble(normalscanspeedcode)
  1607.  
  1608. doHook('planetscanspeed')
  1609. local planetscanspeedmulcode = string.format([[
  1610. alloc(planetscanspeedmul,8,%x)
  1611. registersymbol(planetscanspeedmul)
  1612. planetscanspeedmul:
  1613. dd (float)3.0
  1614. ]],offset['planetscanspeed'])
  1615. autoAssemble(planetscanspeedmulcode)
  1616. setProperty(PlanetScanSpeedTB, 'Enabled', 'True')
  1617.  
  1618. local planetscanspeedcode = [[
  1619. newplanetscanspeed:
  1620. mulss xmm0,[planetscanspeedmul]
  1621. jmp oldplanetscanspeed
  1622. ]]
  1623. autoAssemble(planetscanspeedcode)
  1624.  
  1625. doHook('discoveryscanspeed')
  1626. local discoveryscanspeedmulcode = string.format([[
  1627. alloc(discoveryscanspeedmul,8,%x)
  1628. registersymbol(discoveryscanspeedmul)
  1629. discoveryscanspeedmul:
  1630. dd (float)3.0
  1631. ]],offset['discoveryscanspeed'])
  1632. autoAssemble(discoveryscanspeedmulcode)
  1633. setProperty(DiscoveryScanSpeedTB, 'Enabled', 'True')
  1634.  
  1635. local discoveryscanspeedcode = [[
  1636. newdiscoveryscanspeed:
  1637. mulss xmm0,[discoveryscanspeedmul]
  1638. jmp olddiscoveryscanspeed
  1639. ]]
  1640. autoAssemble(discoveryscanspeedcode)
  1641.  
  1642. doHook('masslock')
  1643. local masscode = [[
  1644. alloc(masslockconst,8)
  1645. masslockconst:
  1646. dd (float)1.0
  1647. newmasslock:
  1648. push eax
  1649. mov eax,[masslockconst]
  1650. mov [r14+0x68c],eax
  1651. pop eax
  1652. jmp oldmasslock
  1653. ]]
  1654. autoAssemble(masscode)
  1655.  
  1656. doPatch('cooldown', '90 90')
  1657.  
  1658. doPatch('ammo', '90 90 90')
  1659.  
  1660. doPatch('noscoop', 'B0 01 90 90 90 90 90 90 90 90')
  1661.  
  1662. doHook('heatsink')
  1663. local heatsinkcode = string.format([[
  1664. label(heatsink_npc)
  1665. alloc(heatsinkconst,8)
  1666. alloc(npcheatsinkconst,8)
  1667. heatsinkconst:
  1668. dd (float)0.0
  1669. npcheatsinkconst:
  1670. dd (float)10.2
  1671. newheatsink:
  1672. push rax
  1673. mov rax,[rbx+0x178] //shipObjPtr
  1674. test rax,rax
  1675. pop rax
  1676. jz heatsink_npc
  1677. push rax
  1678. push rcx
  1679. mov rax,[rbx+0x178] //shipObjPtr
  1680. mov ch,BYTE PTR [rax+0x%x] //isNpcPtr
  1681. mov cl,BYTE PTR [rax+0x%x] //+1
  1682. cmp ch,cl
  1683. pop rcx
  1684. pop rax
  1685. jne heatsink_npc
  1686. push eax
  1687. mov eax,[heatsinkconst]
  1688. mov [rbx+0x280],eax
  1689. pop eax
  1690. jmp oldheatsink
  1691. heatsink_npc:
  1692. push eax
  1693. mov eax,[npcheatsinkconst]
  1694. mov [rbx+0x280],eax
  1695. pop eax
  1696. jmp oldheatsink
  1697. ]], isNpcPtr, isNpcPtr+1)
  1698. autoAssemble(heatsinkcode)
  1699.  
  1700. doHook('jumpcharge')
  1701. local jumpchargecode = [[
  1702. alloc(hdflnul,8)
  1703. hdflnul:
  1704. dd (float)0.0
  1705. newjumpcharge:
  1706. push eax
  1707. mov eax,[hdflnul]
  1708. mov [r14+0x698],eax
  1709. pop eax
  1710. jmp oldjumpcharge
  1711. ]]
  1712. autoAssemble(jumpchargecode)
  1713.  
  1714. doPatch('interdict', '90 E9')
  1715.  
  1716. doPatch('omnijump', 'B3 01 90')
  1717.  
  1718. doPatch('jumpcount', '41 C7 86 9C 06 00 00 00 00 80 3F 90 90 90 90 90 90 90')
  1719.  
  1720. doHook('supercharge')
  1721. local superchargecode = [[
  1722. newsupercharge:
  1723. mov dword ptr [rbx+0x118],0x40800000
  1724. mov dword ptr [rbx+0x10C],0x2
  1725. jmp oldsupercharge
  1726. ]]
  1727. autoAssemble(superchargecode)
  1728.  
  1729. doPatch('kwsomni', 'B3 01 90')
  1730.  
  1731. doPatch('kwslong', 'B8 01 00 00 00 90 90 90')
  1732.  
  1733. doPatch('normalscan', '90 90')
  1734.  
  1735. doPatch('planetomni', 'B8 01 00 00 00')
  1736.  
  1737. doPatch('planetlong', 'B8 01 00 00 00 90 90 90')
  1738.  
  1739. doHook('scagility')
  1740. local scagilitycode = string.format([[
  1741. alloc(scpitchmul,8,%x)
  1742. alloc(scrollmul,8,%x)
  1743. alloc(scyawmul,8,%x)
  1744. registersymbol(scpitchmul)
  1745. registersymbol(scrollmul)
  1746. registersymbol(scyawmul)
  1747. scpitchmul:
  1748. dd (float)3.0
  1749. scrollmul:
  1750. dd (float)2.0
  1751. scyawmul:
  1752. dd (float)3.0
  1753. scnpcmul:
  1754. dd (float)1.0
  1755. newscagility:
  1756. push rax
  1757. mov rax,[rbx+0x3A0] //shipObjPtr
  1758. test rax,rax
  1759. pop rax
  1760. jz oldscagility
  1761. push rax
  1762. push rdx
  1763. mov rax,[rbx+0x3A0] //shipObjPtr
  1764. mov dh,BYTE PTR [rax+0x%x] //isNpcPtr
  1765. mov dl,BYTE PTR [rax+0x%x] //+1
  1766. cmp dh,dl
  1767. pop rdx
  1768. pop rax
  1769. jne oldscagility
  1770. movss xmm0,DWORD PTR [rbp+0x2c] //pitch
  1771. mulss xmm0,DWORD PTR [scpitchmul]
  1772. movss DWORD PTR [rbp+0x2c],xmm0
  1773. movss xmm0,DWORD PTR [rbp+0x30] //roll
  1774. mulss xmm0,DWORD PTR [scrollmul]
  1775. movss DWORD PTR [rbp+0x30],xmm0
  1776. movss xmm0,DWORD PTR [rbp+0x34] //yaw
  1777. mulss xmm0,DWORD PTR [scyawmul]
  1778. movss DWORD PTR [rbp+0x34],xmm0
  1779. jmp oldscagility
  1780. ]], offset['scagility'], offset['scagility'], offset['scagility'], isNpcPtr, isNpcPtr+1)
  1781. autoAssemble(scagilitycode)
  1782. setProperty(ScPitchTB, 'Enabled', 'True')
  1783. setProperty(ScRollTB, 'Enabled', 'True')
  1784. setProperty(ScYawTB, 'Enabled', 'True')
  1785.  
  1786. doHook('nfagility')
  1787. local nfagilitycode = string.format([[
  1788. alloc(nfspeedmul,8,%x)
  1789. alloc(nfpitchmul,8,%x)
  1790. alloc(nfrollmul,8,%x)
  1791. alloc(nfyawmul,8,%x)
  1792. alloc(nfnpcmul,8,%x)
  1793. registersymbol(nfspeedmul)
  1794. registersymbol(nfpitchmul)
  1795. registersymbol(nfrollmul)
  1796. registersymbol(nfyawmul)
  1797. registersymbol(nfnpcmul)
  1798. registersymbol(nf_npc)
  1799. nfspeedmul:
  1800. dd (float)1.0
  1801. nfpitchmul:
  1802. dd (float)2.0
  1803. nfrollmul:
  1804. dd (float)2.0
  1805. nfyawmul:
  1806. dd (float)3.0
  1807. nfnpcmul:
  1808. dd (float)1.0
  1809. newnfagility:
  1810. push rax
  1811. push rdx
  1812. mov rdx,[rsp+0x50]
  1813. mov rax,[rdx+0x3A0] //shipObjPtr
  1814. test rax,rax
  1815. pop rdx
  1816. pop rax
  1817. jz nf_npc
  1818. push rax
  1819. push rdx
  1820. mov rdx,[rsp+0x50]
  1821. mov rax,[rdx+0x3A0] //shipObjPtr
  1822. mov dh,BYTE PTR [rax+0x%x] //isNpcPtr
  1823. mov dl,BYTE PTR [rax+0x%x] //+1
  1824. cmp dh,dl
  1825. pop rdx
  1826. pop rax
  1827. jne nf_npc
  1828. movss xmm2,DWORD PTR [rdi+0x0] //max speed
  1829. mulss xmm2,DWORD PTR [nfspeedmul]
  1830. movss DWORD PTR [rdi+0x0],xmm2
  1831. movss xmm2,DWORD PTR [rdi+0xc] //max boost speed
  1832. mulss xmm2,DWORD PTR [nfspeedmul]
  1833. movss DWORD PTR [rdi+0xc],xmm2
  1834. movss xmm2,DWORD PTR [rdi+0x2c] //pitch
  1835. mulss xmm2,DWORD PTR [nfpitchmul]
  1836. movss DWORD PTR [rdi+0x2c],xmm2
  1837. movss xmm2,DWORD PTR [rdi+0x18] //drives acceleration
  1838. mulss xmm2,DWORD PTR [nfspeedmul]
  1839. movss DWORD PTR [rdi+0x18],xmm2
  1840. movss xmm2,DWORD PTR [rdi+0x1c] //drives deceleration
  1841. mulss xmm2,DWORD PTR [nfspeedmul]
  1842. movss DWORD PTR [rdi+0x1c],xmm2
  1843. movss xmm2,DWORD PTR [rdi+0x20] //thrusters output
  1844. mulss xmm2,DWORD PTR [nfspeedmul]
  1845. movss DWORD PTR [rdi+0x20],xmm2
  1846. movss xmm2,DWORD PTR [rdi+0x30] //roll
  1847. mulss xmm2,DWORD PTR [nfrollmul]
  1848. movss DWORD PTR [rdi+0x30],xmm2
  1849. movss xmm2,DWORD PTR [rdi+0x34] //yaw
  1850. mulss xmm2,DWORD PTR [nfyawmul]
  1851. movss DWORD PTR [rdi+0x34],xmm2
  1852. jmp oldnfagility
  1853. nf_npc:
  1854. movss xmm2,DWORD PTR [rdi+0x0] //max speed
  1855. mulss xmm2,DWORD PTR [nfnpcmul]
  1856. movss DWORD PTR [rdi+0x0],xmm2
  1857. movss xmm2,DWORD PTR [rdi+0xc] //max boost speed
  1858. mulss xmm2,DWORD PTR [nfnpcmul]
  1859. movss DWORD PTR [rdi+0xc],xmm2
  1860. movss xmm2,DWORD PTR [rdi+0x2c] //pitch
  1861. mulss xmm2,DWORD PTR [nfnpcmul]
  1862. movss DWORD PTR [rdi+0x2c],xmm2
  1863. movss xmm2,DWORD PTR [rdi+0x30] //roll
  1864. mulss xmm2,DWORD PTR [nfnpcmul]
  1865. movss DWORD PTR [rdi+0x30],xmm2
  1866. movss xmm2,DWORD PTR [rdi+0x34] //yaw
  1867. mulss xmm2,DWORD PTR [nfnpcmul]
  1868. movss DWORD PTR [rdi+0x34],xmm2
  1869. jmp oldnfagility
  1870. ]], offset['nfagility'], offset['nfagility'], offset['nfagility'], offset['nfagility'], offset['nfagility'], isNpcPtr, isNpcPtr+1)
  1871. autoAssemble(nfagilitycode)
  1872. setProperty(SpeedTB, 'Enabled', 'True')
  1873. setProperty(NfPitchTB, 'Enabled', 'True')
  1874. setProperty(NfRollTB, 'Enabled', 'True')
  1875. setProperty(NfYawTB, 'Enabled', 'True')
  1876.  
  1877. doPatch('dropoff', '90 90')
  1878.  
  1879. unpause()
  1880. setProperty(DisAllBtn, 'Enabled', 'True')
  1881. status_upd('All OK. Hacks are ready.', 52480)
  1882. end
  1883.  
  1884. function wait_to_init()
  1885. if t_to_init >= 25 then
  1886. t.destroy()
  1887. init()
  1888. end
  1889. t_to_init = t_to_init + 1
  1890. end
  1891.  
  1892. function find_process()
  1893. local tmp = readInteger(process_name)
  1894. if tmp ~= nil then
  1895. status_upd('Game process found. Initializing trainer.')
  1896. if before_game then t_to_init = 0 else t_to_init = 14 end
  1897. t:setOnTimer(wait_to_init)
  1898. else
  1899. before_game = true
  1900. end
  1901. end
  1902.  
  1903. function suspend_cheats()
  1904. if DisAllBtn.Enabled then
  1905. for k,v in pairs(item) do
  1906. suspended[k] = state[k]
  1907. if state[k] then
  1908. toggle(k)
  1909. v.Checked = False
  1910. end
  1911. end
  1912.  
  1913. DisAllBtn.Enabled = False
  1914. setProperty(ReactivBtn, 'Enabled', 'True')
  1915. status_upd('Cheats are suspended.', 255)
  1916. end
  1917. end
  1918.  
  1919. function resume_cheats()
  1920. if ReactivBtn.Enabled then
  1921. for k,v in pairs(suspended) do
  1922. if suspended[k] then
  1923. toggle(k)
  1924. setProperty(item[k], 'Checked', 1)
  1925. end
  1926. end
  1927.  
  1928. ReactivBtn.Enabled = False
  1929. setProperty(DisAllBtn, 'Enabled', 'True')
  1930. status_upd('Cheats are resumed.', 52480)
  1931. end
  1932. end
  1933.  
  1934. -- ============================================================================
  1935.  
  1936. aob = {}
  1937. offset = {}
  1938. state = {}
  1939. enable = {}
  1940. disable = {}
  1941. item = {}
  1942. sorted = {}
  1943. suspended = {}
  1944.  
  1945. sorted[1] = 'check3'
  1946. sorted[2] = 'check1'
  1947. sorted[3] = 'nfagility'
  1948. sorted[4] = 'hyperanim'
  1949. sorted[5] = 'masslock'
  1950. sorted[6] = 'cooldown'
  1951. sorted[7] = 'jumpfuel'
  1952. sorted[8] = 'jumpcharge'
  1953. sorted[9] = 'jumpcount'
  1954. sorted[10] = 'omnijump'
  1955. sorted[11] = 'normalscan'
  1956. sorted[12] = 'normalscanspeed'
  1957. sorted[13] = 'fuelscoop'
  1958. sorted[14] = 'hulloffsetshift'
  1959. sorted[15] = 'hull'
  1960. sorted[16] = 'shipinhull'
  1961. sorted[17] = 'scagility'
  1962. sorted[18] = 'dropoff'
  1963. sorted[19] = 'noscoop'
  1964. sorted[20] = 'interdict'
  1965. sorted[21] = 'kwslong'
  1966. sorted[22] = 'kwsomni'
  1967. sorted[23] = 'kwsspeed'
  1968. sorted[24] = 'heatsink'
  1969. sorted[25] = 'ammo'
  1970. sorted[26] = 'textshift'
  1971. sorted[27] = 'searchcheck'
  1972. sorted[28] = 'jumpcheck1'
  1973. sorted[29] = 'jumpcheck2'
  1974. sorted[30] = 'jumpcheck3'
  1975. sorted[31] = 'check2caller'
  1976. sorted[32] = 'check2'
  1977. sorted[33] = 'planetscanspeed'
  1978. sorted[34] = 'discoveryscanspeed'
  1979. sorted[35] = 'planetlong'
  1980. sorted[36] = 'planetomni'
  1981. sorted[37] = 'flightfuel'
  1982. sorted[38] = 'energy'
  1983. sorted[39] = 'shield'
  1984. sorted[40] = 'shieldcheck2'
  1985. sorted[41] = 'shieldcheck1'
  1986. sorted[42] = 'hullinshield'
  1987. sorted[43] = 'hullinmodule'
  1988. sorted[44] = 'module'
  1989. sorted[45] = 'energycheck'
  1990. sorted[46] = 'supercharge'
  1991. sorted[47] = 'check4'
  1992.  
  1993. item.shield = ShieldBtn
  1994. item.hull = HullBtn
  1995. item.module = ModuleBtn
  1996. item.energy = EnergyBtn
  1997. item.jumpfuel = JumpFuelBtn
  1998. item.flightfuel = FlightFuelBtn
  1999. item.fuelscoop = FuelScoopBtn
  2000. item.hyperanim = HyperAnimBtn
  2001. item.masslock = MassBtn
  2002. item.cooldown = CooldownBtn
  2003. item.jumpcharge = JumpchargeBtn
  2004. item.interdict = InterdictBtn
  2005. item.ammo = AmmoBtn
  2006. item.heatsink = HeatsinkBtn
  2007. item.noscoop = NoscoopBtn
  2008. item.jumpcount = JumpcountBtn
  2009. item.omnijump = OmnijumpBtn
  2010. item.supercharge = SuperchargeBtn
  2011. item.kwsspeed = KwsSpeedBtn
  2012. item.kwsomni = KwsomniBtn
  2013. item.kwslong = KwslongBtn
  2014. item.normalscanspeed = NormalscanSpeedBtn
  2015. item.normalscan = NormalscanBtn
  2016. item.planetomni = PlanetomniBtn
  2017. item.planetlong = PlanetlongBtn
  2018. item.nfagility = NfAgilityBtn
  2019. item.scagility = ScAgilityBtn
  2020. item.dropoff = DropOffBtn
  2021. item.discoveryscanspeed = DiscoveryScanSpeedBtn
  2022. item.planetscanspeed = PlanetScanSpeedBtn
  2023.  
  2024. aob.check1 = '48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 56 41 57 48 81 EC ? ? ? ? 41 8B D8'
  2025. aob.check2 = '8B 43 14 48 03 46 20'
  2026. aob.check2caller = '84 C0 74 1D 4C 8B 44 24'
  2027. aob.check3 = '44 0F B6 09 48 8D 49 01'
  2028. aob.check4 = '4C 8B D9 4C 8B D2 49 83 F8 10'
  2029. aob.energycheck = '74 54 48 83 BE ? ? ? ? ? 74 4A'
  2030. aob.shieldcheck1 = '76 4F 48 83 BF'
  2031. aob.shieldcheck2 = 'F3 0F 58 C4 F3 0F 58 C5'
  2032. aob.searchcheck = '8B C7 48 8B 5C 24 ?? 5F'
  2033. aob.jumpcheck1 = '75 0C 8B 4A 01'
  2034. aob.jumpcheck2 = '75 78 8B 4A 01'
  2035. aob.jumpcheck3 = '75 72 8B 4A 01'
  2036. aob.shield = '48 39 B7 ? ? ? ? 0F 84 ? ? ? ? 40 38 B7'
  2037. aob.hull = '33 C0 F0 4D 0F B1 BE ? ? ? ? 48 8B C8 48 C1 E9 20 33 C8 49 83 BE ? ? ? ? ? 89 4C 24 44'
  2038. aob.module = '4C 39 B7 ? ? ? ? 0F 84 ? ? ? ? 48 8B 8F ? ? ? ? 48 8B 01 FF 50 68'
  2039. aob.energy = 'F3 0F 5C C6 48 C1 E9 20 F3 0F 11 44 24 ? 48 85 C0 74 08 49 33 C0 74 03 29 48 08 44 8B 4C 24 ? 8B 0D ? ? ? ? 41 8B C1 0D ? ? ? ? 83 F8 FF 8B C1'
  2040. aob.jumpfuel = '49 8B 46 58 49 8D 4E 58 FF 90 ? ? ? ? 84 C0 74 37'
  2041. aob.flightfuel = 'F2 0F 59 C1 66 0F 2F C7 0F 82'
  2042. aob.fuelscoop = 'F3 45 0F 59 C4 44 0F 28 A4 24'
  2043. aob.hyperanim = '48 83 EC 28 33 C0 48 8D 4A E0 48 85 D2 48 0F 44 C8 F3 0F 58 51'
  2044. aob.masslock = '41 C7 86 ? ? ? ? ? ? ? ? 0F B6 45 04'
  2045. aob.cooldown = '77 ? 33 C0 48 89 7C 24 ? 41 89 86'
  2046. aob.jumpcharge = '48 83 7D ? ? 74 12 49 8B 8E'
  2047. aob.interdict = '0F 84 ? ? ? ? 0F 57 F6 0F 2F B6'
  2048. aob.ammo = '44 2B C5 48 85 C0'
  2049. aob.heatsink = 'F3 0F 58 83 ? ? ? ? F3 0F 11 83 ? ? ? ? 0F 2F 06'
  2050. aob.noscoop = '32 C0 84 D2 74 0D 84 C9 74 09 C6 87'
  2051. aob.jumpcount = 'F3 41 0F 58 86 ? ? ? ? F3 41 0F 11 86 ? ? ? ? F3 0F 10 4A'
  2052. aob.omnijump = '80 E3 01 EB 02'
  2053. aob.supercharge = 'C6 41 30 01 48 8B 49 10 48 8B 5C 24 ? 48 83 C4 20 5F E9 ? ? ? ? 48 89 5C 24 ? 48 89 74 24'
  2054. aob.kwsspeed = '48 8B 8E ? ? ? ? F3 44 0F 5E C0'
  2055. aob.kwsomni = '80 E3 01 89 5C 24 ? 40 84 FF'
  2056. aob.kwslong = 'F3 0F C2 C1 ? 0F 50 C0 A8 01 75 5A'
  2057. aob.normalscanspeed = '49 8B CC 48 8B D8 F3 0F 58 70'
  2058. aob.normalscan = '74 21 45 33 C0 48 8D 95'
  2059. aob.planetomni = '0F 50 C1 24 01 48 85 C9'
  2060. aob.planetlong = 'F3 0F C2 D3 ? 0F 50 C2 A8 01 0F 84 ? ? ? ? 48 8B AC 24'
  2061. aob.planetscanspeed = 'F3 41 0F 59 C0 F3 0F 58 86'
  2062. aob.nfagility = 'F3 0F 11 8F ? ? ? ? F3 0F 10 96'
  2063. aob.scagility = '8B 82 ? ? ? ? 89 85 ? ? ? ? 0F 10 02'
  2064. aob.dropoff = '76 4A 33 C0 F0 49 0F B1 B6'
  2065. aob.discoveryscanspeed = '49 8B CE F3 41 0F 58 86'
  2066. --aob.isnpc = '8B 91 ? ? ? ? 8B C2 C1 E8 08 32 C2 C3 CC CC 40 53 48 81 EC'
  2067. aob.hulloffsetshift = '49 8D 8E ? ? ? ? FF 90'
  2068. aob.shipinhull = '49 8B 8E ? ? ? ? 48 8B 01 FF 50 ? 84 C0 74 60 33 C0'
  2069. aob.hullinshield = '48 8B 9F ? ? ? ? 48 8B 01 FF 50 20 48 8B 03 48 8D 55 B0'
  2070. aob.hullinmodule = '48 8B BF ? ? ? ? 44 8B 85'
  2071. aob.textshift = '41 B9 ? ? ? ? 4C 89 6C 24 ? 49 8B CC'
  2072.  
  2073. before_game = false
  2074.  
  2075. process_name = 'EliteDangerous64.exe'
  2076.  
  2077. getAutoAttachList().add(process_name)
  2078.  
  2079. t = createTimer()
  2080. t:setInterval(1000)
  2081. t:setOnTimer(find_process)
Add Comment
Please, Sign In to add comment