-
Notifications
You must be signed in to change notification settings - Fork 0
/
BMZHE.py
505 lines (380 loc) · 11.5 KB
/
BMZHE.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
from time import sleep
from os import system
from os import path
# 47 Inkwood Ct. Unit A
error_cd = "Error Code: Dat_Not_Valid - 0x01"
err = "Error Code: Dat_Not_Opened - 0x0F"
ch0 = path.exists('Data0') # OS.SYSTEM CHECKS FOR FILES.
ch1 = path.exists('Data1')
ch2 = path.exists('Data2')
ch3 = path.exists('Data6')
ch4 = path.exists('Data7')
ch5 = path.exists('Data8')
check_win = path.exists("C:\Windows\SysWOW64")
if check_win == True:
clear = 'cls'
else:
clear = 'clear'
def bmzCheck0():
if ch0 == True:
file0 = open("Data0", 'rb+')
file0.seek(89)
datacheck = file0.read(1)
if datacheck >= b'\x00':
file0.close()
else:
print("Data0 Is Not Valid or Has Not Been Opened.")
print("Error Code: Dat_Not_Valid 0x0F")
with open('Log.txt', 'a') as error_file:
error_file.write(f'Data0 {err}\n')
sleep(2)
exit()
if ch1 == True:
file0 = open("Data1", 'rb+')
file0.seek(89)
datacheck = file0.read(1)
if datacheck >= b'\x00':
file0.close()
else:
print("Data1 Is Not Valid or Has Not Been Opened.")
print("Error Code: Dat_Not_Valid 0x0F")
with open('Log.txt', 'a') as error_file:
error_file.write(f'Data1 {err}\n')
sleep(2)
exit()
if ch2 == True:
file0 = open("Data2", 'rb+')
file0.seek(89)
datacheck = file0.read(1)
if datacheck >= b'\x00':
file0.close()
else:
print("Data2 Is Not Valid or Has Not Been Opened.")
print("Error Code: Dat_Not_Valid 0x0F")
with open('Log.txt', 'a') as error_file:
error_file.write(f'Data2 {err}\n')
sleep(2)
exit()
if ch3 == True:
file0 = open("Data6", 'rb+')
file0.seek(89)
datacheck = file0.read(1)
if datacheck >= b'\x00':
file0.close()
else:
print("Data6 Is Not Valid or Has Not Been Opened.")
print("Error Code: Dat_Not_Valid 0x0F")
with open('Log.txt', 'a') as error_file:
error_file.write(f'Data6 {err}\n')
sleep(2)
exit()
if ch4 == True:
file0 = open("Data7", 'rb+')
file0.seek(89)
datacheck = file0.read(1)
if datacheck >= b'\x00':
file0.close()
else:
print("Data7 Is Not Valid or Has Not Been Opened.")
print("Error Code: Dat_Not_Valid 0x0F")
with open('Log.txt', 'a') as error_file:
error_file.write(f'Data7 {err}\n')
sleep(2)
exit()
if ch5 == True:
file0 = open("Data8", 'rb+')
file0.seek(89)
datacheck = file0.read(1)
if datacheck >= b'\x00':
file0.close()
else:
print("Data8 Is Not Valid or Has Not Been Opened.")
print("Error Code: Dat_Not_Opened 0x0F")
with open('Log.txt', 'a') as error_file:
error_file.write(f'Data8 {err}\n')
sleep(2)
exit()
Health()
def HmrHealth():
system(clear)
print("WARNING: You Selected A Save-Data Editing Option!")
print("This Function Will Edit All Save-Data Files Found In The Currect Directory.")
input("Press 'Enter' To Continue. ")
system(clear)
print("This Program Only Accepts 4-Byte Answers (Or less).")
print(" ")
number = int(input("Enter An Integer for Health: "))
byte_array = bytearray(number.to_bytes(4, byteorder='big'))
reversed_array = byte_array[::-1]
if ch0 == True:
with open("Data0", 'rb+') as bin:
print(f'Wrote {number} Into Health Sector of Data0.')
sleep(1)
bin.seek(100)
bin.write(reversed_array)
bin.seek(108)
bin.write(reversed_array)
if ch1 == True:
with open("Data1", 'rb+') as bin:
print(f'Wrote {number} Into Health Sector of Data1.')
sleep(1)
bin.seek(100)
bin.write(reversed_array)
bin.seek(108)
bin.write(reversed_array)
if ch2 == True:
with open("Data2", 'rb+') as bin:
print(f'Wrote {number} Into Health Sector of Data2.')
sleep(1)
bin.seek(100)
bin.write(reversed_array)
bin.seek(108)
bin.write(reversed_array)
sleep(2)
Menu1()
def HmrEnergy():
system(clear)
print("WARNING: You Selected A Save-Data Editing Option!")
print("This Function Will Edit All Save-Data Files Found In The Currect Directory.")
input("Press 'Enter' To Continue. ")
system(clear)
print("This Program Only Accepts 4-Byte Answers (Or less).")
print(" ")
number = int(input("Enter An Integer for Energy: "))
byte_array = bytearray(number.to_bytes(4, byteorder='big'))
reversed_array = byte_array[::-1]
if ch0 == True:
with open("Data0", 'rb+') as bin:
print(f'Wrote {number} Into Energy Sector of Data0.')
sleep(1)
bin.seek(104)
bin.write(reversed_array)
bin.seek(112)
bin.write(reversed_array)
if ch1 == True:
with open("Data1", 'rb+') as bin:
print(f'Wrote {number} Into Energy Sector of Data1.')
sleep(1)
bin.seek(104)
bin.write(reversed_array)
bin.seek(112)
bin.write(reversed_array)
if ch2 == True:
with open("Data2", 'rb+') as bin:
print(f'Wrote {number} Into Energy Sector of Data2.')
sleep(1)
bin.seek(104)
bin.write(reversed_array)
bin.seek(112)
bin.write(reversed_array)
sleep(2)
Menu1()
def Health(): # Not Finished Yet...
system(clear)
print("WARNING: You Selected A Save-Data Editing Option!")
print("This Function Will Edit All Save-Data Files Found In The Currect Directory.")
input("Press 'Enter' To Continue. ")
system(clear)
print("This Program Only Accepts 4-Byte Answers (Or less).")
print(" ")
number = int(input("Enter An Integer for Health: "))
byte_array = bytearray(number.to_bytes(4, byteorder='big'))
reversed_array = byte_array[::-1]
if ch0 == True:
with open("Data0", 'rb+') as bin:
print(f'Wrote {number} Into Health Sector of Data0.')
sleep(1)
bin.seek(88)
bin.write(reversed_array)
if ch1 == True:
with open("Data1", 'rb+') as bin:
print(f'Wrote {number} Into Health Sector of Data1.')
sleep(1)
bin.seek(88)
bin.write(reversed_array)
if ch2 == True:
with open("Data2", 'rb+') as bin:
print(f'Wrote {number} Into Health Sector of Data2.')
sleep(1)
bin.seek(88)
bin.write(reversed_array)
if ch3 == True:
with open("Data6", 'rb+') as bin:
print(f'Wrote {number} Into Health Sector of Data6.')
sleep(1)
bin.seek(88)
bin.write(reversed_array)
if ch4 == True:
with open("Data7", 'rb+') as bin:
print(f'Wrote {number} Into Health Sector of Data7.')
sleep(1)
bin.seek(88)
bin.write(reversed_array)
if ch5 == True:
with open("Data8", 'rb+') as bin:
print(f'Wrote {number} Into Health Sector of Data8.')
bin.seek(88)
bin.write(reversed_array)
sleep(3)
Menu0()
def MaxLevel():
system(clear)
print("WARNING: You Selected A Save-Data Editing Option!")
print("This Function Will Edit All Save-Data Files Found In The Currect Directory.")
input("Press 'Enter' To Continue. ")
system(clear)
print("This Program Only Accepts 4-Byte Answers (Or less).")
print(" ")
number = int(input("Enter An Integer for Level: "))
byte_array = bytearray(number.to_bytes(4, byteorder='big'))
reversed_array = byte_array[::-1]
if ch0 == True:
with open("Data0", 'rb+') as bin:
print(f'Wrote {number} Into Level Sector of Data0.')
sleep(1)
bin.seek(16)
bin.write(reversed_array)
if ch1 == True:
with open("Data1", 'rb+') as bin:
print(f'Wrote {number} Into Level Sector of Data1.')
sleep(1)
bin.seek(16)
bin.write(reversed_array)
if ch2 == True:
with open("Data2", 'rb+') as bin:
print(f'Wrote {number} Into Level Sector of Data2.')
sleep(1)
bin.seek(16)
bin.write(reversed_array)
sleep(2)
Menu1()
def Menu1():
system(clear)
simplist = [0, 1, 2, 3]
print("The Magic Hammer Stats Editor (BMZHE)")
print(" ")
print("1 = Edit Max Health")
print("2 = Edit Max Energy")
print("3 = Edit Max Level")
print(" ")
print("0 = Return To Menu")
print(" ")
useri = int(input("Enter Choice: "))
if useri not in simplist:
Menu1()
if useri == 1:
HmrHealth()
if useri == 0:
Menu0()
if useri == 2:
HmrEnergy()
if useri == 3:
MaxLevel()
def Menu0():
system(clear)
simplist = [0, 1, 2, 3]
print("(BMZHE) BattleMinerZ Health Editor (v1.3)")
print(" ")
print("1 = Edit 'BattleMinerZ' Health")
print(" ")
print("2 = Edit 'BattleMiner' Health")
print("3 = Edit 'The Magic Hammer' Health/Stats")
print("0 = Exit Application")
print(" ")
useri = int(input("Enter Choice: "))
if useri not in simplist:
Menu0()
if useri == 1:
bmzCheck0()
if useri == 0:
exit()
if useri == 3:
Menu1()
if useri == 2:
system(clear)
print("This Hasn't Been Developed as of Yet.")
print("BattleMiner has a Confusing Save-Data Layout. So it might take a little while.")
print(" ")
sleep(4)
Menu0()
def Load():
sleep(1)
print("Created By: r ")
sleep(0.125)
system(clear)
print("Created By: r c ")
sleep(0.125)
system(clear)
print("Created By: Cr c ")
sleep(0.125)
system(clear)
print("Created By: Cr c 8")
sleep(0.125)
system(clear)
print("Created By: Cr c 2 8")
sleep(0.125)
system(clear)
print("Created By: Crac 2 8")
sleep(0.125)
system(clear)
print("Created By: Crac o2 8")
sleep(0.125)
system(clear)
print("Created By: Crac o298")
sleep(0.125)
system(clear)
print("Created By: Cracko298 ")
sleep(2)
system(clear)
Menu0()
if ch0 == False or ch1 == False or ch2 == False or ch3 == False or ch4 == False or ch5 == False:
if ch1 == True:
system(clear)
Load()
if ch2 == True:
system(clear)
Load()
if ch3 == True:
system(clear)
Load()
if ch4 == True:
system(clear)
Load()
if ch5 == True:
system(clear)
Load()
if ch0 == False:
print("Data0 Not Found - Slot #1 - Singleplayer Adventure.")
sleep(0.5)
if ch1 == False:
print("Data1 Not Found - Slot #2 - Singleplayer Adventure.")
sleep(0.5)
if ch2 == False:
print("Data2 Not Found - Slot #3 - Singleplayer Adventure.")
sleep(0.5)
print(" ")
if ch3 == False:
print("Data6 Not Found - Slot #1 - Multiplayer Adventure.")
sleep(0.5)
if ch4 == False:
print("Data7 Not Found - Slot #2 - Multiplayer Adventure.")
sleep(0.5)
if ch5 == False:
print("Data8 Not Found - Slot #3 - Multiplayer Adventure.")
sleep(0.5)
print(" ")
print("NOTICE: No Save-Data Was Found In Current Directory!")
sleep(0.5)
print("The Application Is Useless Unless Provided With Save-Data.")
sleep(5)
print(" ")
print("Error Code: Dat_Not_Found 0x01")
with open('Log.txt', 'a') as error_file:
error_file.write(f'Save-Data {error_cd}\n')
print("The Application Will Now Close...")
sleep(2)
exit()
print("Starting Application...")
sleep(3)
system(clear)
Load()