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 


searching adsresses, help

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

Joined: 16 Oct 2019
Posts: 2

PostPosted: Wed Oct 16, 2019 8:48 am    Post subject: searching adsresses, help Reply with quote

hi folks! im totaly new in CE. i need to find float like -123.123123 but exactly i know -123. i can find what i need manually in CE but this code don't gave addresses that exist in manual scanning. what i do wring? i tried changing params for firstScan but still no needed adreesses in LUA script result.

also i dont understand in what process is searching firstScan(). should i do openProcess(processname) or something?

Code:
all_address = {}
function findDoubleValueAndReplace(findValue)

  memscan = createMemScan()
  foundlist = createFoundList(memscan)
  protectionflags = "*W*X*C"

  -- firstScan(scanoption, vartype, roundingtype, input1, input2,
  --           startAddress, stopAddress, protectionflags,
  --           alignmenttype, "alignmentparam",
  --           isHexadecimalInput, isNotABinaryString, isunicodescan, iscasesensitive)

  --    scanOption: soUnknownValue, soExactValue, soValueBetween, soBiggerThan, soSmallerThan
  --    vartype: vtByte, vtWord, vtDword, vtQword, vtSingle, vtDouble, vtString,
  --             vtByteArray, vtGrouped, vtBinary, vtAll
  --    roundingtype: rtRounded, rtTruncated, rtExtremerounded
  --    alignmenttype: fsmNotAligned, fsmAligned, fsmLastDigits
  --    protectionflags: X W C   (+ to indicate that flag MUST be set, - MUST NOT, * whatever)

  memscan.firstScan(soExactValue, vtSingle, rtRounded, findValue, nil,
               "0","7fffffff",protectionflags,
               fsmAligned,"4",
               false, false, false, false)
  memscan.waitTillDone()
  foundlist.initialize()

  for i=0, foundlist.Count-1 do
    all_address[i+1] = foundlist.Address[i]
  end

  foundlist.destroy()
  memscan.destroy()

end
findDoubleValueAndReplace(-123)
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 140

Joined: 06 Jul 2014
Posts: 4299

PostPosted: Wed Oct 16, 2019 9:28 am    Post subject: Reply with quote

  • The function is called findDoubleValueAndReplace, but you're searching for a vtSingle instead of a vtDouble. You're also not replacing anything.
  • Perhaps you should use rtExtremerounded instead.
  • findValue should be a string. What you have now should be fine if you pass in a number since Lua will automatically convert it; it's just good to be aware.
  • You should generally not pass nil values to firstScan (I've had problems in the past). Instead of using nil for input2, use an empty string ("").
  • The stop address is a little low if you're targeting a 64-bit process. Copy the stop address from CE's main window (something like "7fffffffffffffff")
  • Doubles are typically 8-byte aligned, but using a 4-byte alignment shouldn't break anything.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting 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