Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Nil Value and not recognize the address

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DGIorio
How do I cheat?
Reputation: 0

Joined: 27 Jul 2015
Posts: 3
Location: Brazil

PostPosted: Mon Jul 27, 2015 11:41 am    Post subject: Nil Value and not recognize the address Reply with quote

Hello,
I'm making a trainer for a mod for Burnout Paradse (RussianVanity.exe), I made some features, all features are working. Needed to make use of some pointers, to not static address. I generated the trainer using the generic trainer and add some things in the Lua script.
The trainer are working, but it has problems with pointers (some times go to another address) but I can fix.
The issue that I'm having is about nil values at the start the game and at the change car. Other problem is that sometimes show a message about failure in determing what the address means.

The code is below (only the adds):
Code:
getAutoAttachList().add("RussianVanity.exe")
gPlaySoundOnAction=false
CETrainer.show()
UDF1.close()
UDF2.close()
function AboutClick()
  showMessage(gAboutText)
end
gAboutText=[[This program was made by DG and P.]]

function CEButton1Click(sender)
  writeInteger("[[[[[RussianVanity.exe+00D02074]+770]+8C]+220]+148]+564", getProperty(CETrainer.CEEdit1,"Text"))
end

function CETimer1Timer(sender)
if getProcessIDFromProcessName("RussianVanity.exe") ~= nil then
  openProcess("RussianVanity.exe")
  setProperty(CETrainer.CELabel2,"Caption", readInteger("[[[[[RussianVanity.exe+00D02074]+770]+8C]+220]+148]+564"))
  setProperty(CETrainer.CELabel5,"Caption", readString("[RussianVanity.exe+00C1BCD4]+30", 64))
  setProperty(CETrainer.CELabel7,"Caption", readString("[RussianVanity.exe+00C1BCD4]+70", 32))
  setProperty(CETrainer.CELabel10,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+FE", 1))
  setProperty(CETrainer.CELabel12,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+FF"))
  setProperty(CETrainer.CELabel14,"Caption", readInteger("[RussianVanity.exe+00C1BCD4]+F8"))
  setProperty(CETrainer.CELabel16,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+FC"))
  setProperty(CETrainer.CELabel18,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+98"))
  setProperty(CETrainer.CEWheel,"Caption", readString("[RussianVanity.exe+00C1BCD4]+10", 32))
  setProperty(CETrainer.CELabel21,"Caption", readInteger("[[[[RussianVanity.exe+00D02074]+690]+6C]+130]+2C"))
  setProperty(CETrainer.CELabel23,"Caption", readInteger("[[[[RussianVanity.exe+00D02074]+690]+6C]+130]+30"))
  setProperty(CETrainer.CELabel25,"Caption", readInteger("[[[[RussianVanity.exe+00D02074]+690]+6C]+130]+34"))
end
end

function CETimer2Timer(sender)
if getProcessIDFromProcessName("RussianVanity.exe") ~= nil then
  openProcess("RussianVanity.exe")
  setProperty(UDF1.CELabel2,"Caption", readString("[RussianVanity.exe+00C1BCD4]+30", 64))
  setProperty(UDF1.CELabel4,"Caption", readString("[RussianVanity.exe+00C1BCD4]+70", 32))
  setProperty(UDF1.CEWheel,"Caption", readString("[RussianVanity.exe+00C1BCD4]+10", 32))
  setProperty(UDF1.CELabel8,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+FE", 1))
  setProperty(UDF1.CELabel10,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+FF", 1))
  setProperty(UDF1.CELabel12,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+100", 1))
  setProperty(UDF1.CELabel14,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+101", 1))
  setProperty(UDF1.CELabel16,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+9B", 1))
  setProperty(UDF1.CELabel18,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+102", 1))
  setProperty(UDF1.CELabel20,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+103", 1))
  setProperty(UDF1.CELabel22,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+FC", 1))
  setProperty(UDF1.CELabel24,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+98", 1))
  setProperty(UDF1.CELabel26,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+9A", 1))
  setProperty(UDF1.CELabel28,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+F8", 1))
  setProperty(UDF1.CELabel34,"Caption", readBytes("[RussianVanity.exe+00C1BCD4]+FD", 1))

  AoB1 = readBytes ("[RussianVanity.exe+00C1BCD4]+0", 8,true)
  for i=1,#AoB1 do
    AoB1[i] = string.sub('0'..string.format('%X',AoB1[i]),-2)
  end
  AoB2 = readBytes ("[RussianVanity.exe+00C1BCD4]+8", 8,true)
  for i=1,#AoB2 do
    AoB2[i] = string.sub('0'..string.format('%X',AoB2[i]),-2)
  end
  AoB3 = readBytes ("[RussianVanity.exe+00C1BCD4]+A0", 8,true)
  for i=1,#AoB3 do
    AoB3[i] = string.sub('0'..string.format('%X',AoB3[i]),-2)
  end
  AoB4 = readBytes ("[RussianVanity.exe+00C1BCD4]+A8", 8,true)
  for i=1,#AoB4 do
    AoB4[i] = string.sub('0'..string.format('%X',AoB4[i]),-2)
  end
  AoB5 = readBytes ("[RussianVanity.exe+00C1BCD4]+B0", 8,true)
  for i=1,#AoB5 do
    AoB5[i] = string.sub('0'..string.format('%X',AoB5[i]),-2)
  end
  AoB6 = readBytes ("[RussianVanity.exe+00C1BCD4]+B8", 8,true)
  for i=1,#AoB6 do
    AoB6[i] = string.sub('0'..string.format('%X',AoB6[i]),-2)
  end
  AoB7 = readBytes ("[RussianVanity.exe+00C1BCD4]+C0", 8,true)
  for i=1,#AoB7 do
    AoB7[i] = string.sub('0'..string.format('%X',AoB7[i]),-2)
  end

  setProperty(UDF1.CELabel30,"Caption", table.concat(AoB1))
  setProperty(UDF1.CELabel32,"Caption", table.concat(AoB2))
  setProperty(UDF1.CELabel36,"Caption", table.concat(AoB3))
  setProperty(UDF1.CELabel38,"Caption", table.concat(AoB4))
  setProperty(UDF1.CELabel40,"Caption", table.concat(AoB5))
  setProperty(UDF1.CELabel42,"Caption", table.concat(AoB6))
  setProperty(UDF1.CELabel44,"Caption", table.concat(AoB7))
end
end

function CEButton2Click(sender)
  UDF1.show()
end

function CEButton3Click(sender)
  UDF2.show()
end

function CETimer3Timer(sender)
 if getProcessIDFromProcessName("RussianVanity.exe") ~= nil then
  openProcess("RussianVanity.exe")
  setProperty(UDF2.CELabel2,"Caption", readString("[RussianVanity.exe+00C1BCD4]+10", 32))
 end
end

function CEButtonchangeClick(sender)
  writeString("[RussianVanity.exe+00C1BCD4]+10", getProperty(UDF2.CEEdit1,"Text"))
end
[/code]

Last edited by DGIorio on Thu Aug 06, 2015 7:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25806
Location: The netherlands

PostPosted: Mon Jul 27, 2015 12:13 pm    Post subject: Reply with quote

add errorOnLookupFailure(true) to the start of your script to get rid of the 'failure to determine' errors. You just have to check that the address is 0 then (not nil)

As for the length errors you'll have to check if the table/array is nil or not

e.g
Code:

  AoB1 = readBytes ("[RussianVanity.exe+00C1BCD4]+0", 8,true)
  if AoB1~=nil then
    for i=1,#AoB1 do
      AoB1[i] = string.sub('0'..string.format('%X',AoB1[i]),-2)
    end
  end


and deal with that later on as well

_________________
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
View user's profile Send private message MSN Messenger
DGIorio
How do I cheat?
Reputation: 0

Joined: 27 Jul 2015
Posts: 3
Location: Brazil

PostPosted: Mon Jul 27, 2015 1:25 pm    Post subject: Reply with quote

Thanks Dark Byte, it's working.

Another problem that I am having is with the use of ram memory (about 4 GB Shocked ), it's probably due to the timers to update the values. Is there any other way to read the data of the address and write them on the form? and yet the updating.
Or is it normal?
Back to top
View user's profile Send private message
DGIorio
How do I cheat?
Reputation: 0

Joined: 27 Jul 2015
Posts: 3
Location: Brazil

PostPosted: Thu Jul 30, 2015 9:43 am    Post subject: Reply with quote

Maybe it's normal, because of the large amount of stuff to be read from the game. I don't know.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites