|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Wed Feb 11, 2015 12:55 pm Post subject: What is wrong with code? |
|
|
I'm trying to print values from a specific address, namely 0x70EA5800
Code: | AL = getAddressList()
testaddress_hex = "0x70EA5800"
print("Address in hex "..testaddress_hex)
testaddress_dec = tonumber(testaddress_hex,16)
print("Address in dec "..testaddress_dec)
for j = 0, 4095 do
testaddress_dec = testaddress_dec + j
testaddress_hex = string.format("%x", testaddress_dec)
mr = readBytes(testaddress_hex,1)
print("Byte located at "..testaddress_hex.. " which is +h"..string.format("%x",j)..tonumber(mr))
end |
I get an error message in the last print statement--attempt to concatenate a nil value.
So what am I doing wrong?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25291 Location: The netherlands
|
Posted: Wed Feb 11, 2015 1:41 pm Post subject: |
|
|
first off, readBytes can work with decimals just fine. no need to convert it to a string
as for the error, if readBytes fails it returns nil, so try checking that first
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
bknight2602 Grandmaster Cheater Reputation: 0
Joined: 08 Oct 2012 Posts: 577
|
Posted: Wed Feb 11, 2015 2:00 pm Post subject: Hey DB come look again |
|
|
Ok for the number versus hex, the literature didn't really point that out.
I'm sure the readBytes is the error, but what needs to be done to fix it? I'm doing mechanical searches and the memory extends 0x0008EAF3 to 0x2104D071, so it isn't out of memory.
EDIT: There must be "holes" in the memory usage. I selected that address and got no value, just ??. With another value the code works fine until it apparently runs into another data hole. Thanks
EDIT 2:
Code: | AL = getAddressList()
testaddress_hex = "0x70AB941"
testaddress_dec = 118143297
print("Address in hex "..testaddress_hex)
--testaddress_dec = tonumber(testaddress_hex,16)
print("Address in dec "..testaddress_dec)
for j = 0, 4095 do
testaddress_dec = testaddress_dec + j
--testaddress_hex = string.format("%x", testaddress_dec)
--mr = readBytes(testaddress_hex,1)
mr = readBytes(testaddress_dec,1)
print("Byte located at "..string.format("%x",testaddress_dec).. " which is +h"..string.format("%x",j).." "..tonumber(mr))
end |
I took out the hex addresses and the code output(partial printout) as below.
WHY does it skip addresses?
Address in hex 0x70AB941
Address in dec 118143297
Byte located at 70ab941 which is +h0 68
Byte located at 70ab942 which is +h1 74
Byte located at 70ab944 which is +h2 49
Byte located at 70ab947 which is +h3 28
Byte located at 70ab94b which is +h4 87
Byte located at 70ab950 which is +h5 55
Byte located at 70ab956 which is +h6 67
Byte located at 70ab95d which is +h7 72
Byte located at 70ab965 which is +h8 41
Byte located at 70ab96e which is +h9 33
Byte located at 70ab978 which is +ha 69
Byte located at 70ab983 which is +hb 57
Byte located at 70ab98f which is +hc 41
Byte located at 70ab99c which is +hd 38
Byte located at 70ab9aa which is +he 24
Byte located at 70ab9b9 which is +hf 41
Byte located at 70ab9c9 which is +h10 50
Byte located at 70ab9da which is +h11 33
Byte located at 70ab9ec which is +h12 35
Byte located at 70ab9ff which is +h13 24
EDIT 3:
Never mind I finally figured why it was skipping
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|