 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
iosufdhgd Newbie cheater
Reputation: 0
Joined: 04 Jun 2022 Posts: 17
|
Posted: Tue Apr 02, 2024 9:49 am Post subject: Null Terminator after string |
|
|
Using CEServer, I'm running a script that searches for something and uses a for loop to replace everything. However, it seems that the for loop specifically kills the ceserver.
Code: | for i=0,FoundList.Count-1 do
if(readString(FoundList.Address[i]) == one) then
writeString(FoundList.Address[i],operator);
writeBytes('FoundList.Address[i]+'..len, 0);
end
if(readString(FoundList.Address[i]) == two) then
writeString(FoundList.Address[i],operator);
writeBytes('FoundList.Address[i]+'..len, 0);
end
if(readString(FoundList.Address[i]) == three) then
writeString(FoundList.Address[i],operator);
writeBytes('FoundList.Address[i]+'..len, 0);
end
if(readString(FoundList.Address[i]) == four) then
writeString(FoundList.Address[i],operator);
writeBytes('FoundList.Address[i]+'..len, 0);
end
if(readString(FoundList.Address[i]) == a) then
writeString(FoundList.Address[i],skin);
writeBytes('FoundList.Address[i]+'..len2, 0);
end
if(readString(FoundList.Address[i]) == b) then
writeString(FoundList.Address[i],skin);
writeBytes('FoundList.Address[i]+'..len2, 0);
end
if(readString(FoundList.Address[i]) == c) then
writeString(FoundList.Address[i],skin);
writeBytes('FoundList.Address[i]+'..len2, 0);
end
if(readString(FoundList.Address[i]) == d) then
writeString(FoundList.Address[i],skin);
writeBytes('FoundList.Address[i]+'..len2, 0);
end
end |
I've kinda narrowed the part that makes it crash down to where I write the null terminator within each if statement. Can't seem to figure out why it does this. If anyone has any ideas, any help is much appreciated
It does the same thing without apostrophes around the address, same thing without the plus operator. It works if i remove all the writeByte functions, but then there is no null terminator so what I'm doing doesn't end up working
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1524
|
Posted: Tue Apr 02, 2024 11:43 am Post subject: |
|
|
Code: | writeBytes('FoundList.Address[i]+'..len2, 0); |
'FoundList.Address[i]+'
Why is it in quotes?
Try this:
Code: | writeBytes(FoundList.Address[i]..'+'..len2, 0); |
_________________
|
|
Back to top |
|
 |
iosufdhgd Newbie cheater
Reputation: 0
Joined: 04 Jun 2022 Posts: 17
|
Posted: Tue Apr 02, 2024 7:14 pm Post subject: |
|
|
AylinCE wrote: | Code: | writeBytes('FoundList.Address[i]+'..len2, 0); |
'FoundList.Address[i]+'
Why is it in quotes?
Try this:
Code: | writeBytes(FoundList.Address[i]..'+'..len2, 0); |
|
Wasn't in quotes originally, was just something I tried. Didn't work either way.
ALso, unfortunately that fix doesn't do the job
|
|
Back to top |
|
 |
ParkourPenguin I post too much
Reputation: 152
Joined: 06 Jul 2014 Posts: 4703
|
Posted: Tue Apr 02, 2024 8:04 pm Post subject: |
|
|
The "Address" field of the foundlist is a stringlist IIRC. You can't add an integer to a string.
Code: | function writeStringZeroTerm(address, text, widechar)
local bt
if widechar then
bt = wideStringToByteTable(text)
else
bt = stringToByteTable(text)
end
bt[#bt+1] = 0
writeBytes(address, bt)
end
-- ...
for i=0,FoundList.Count-1 do
local addr = getAddress(FoundList.Address[i])
if addr == one or addr == two or addr == three or addr == 4 then
writeStringZeroTerm(addr, operator)
elseif addr == a or addr == b or addr == c or addr == d then
writeStringZeroTerm(addr, skin)
end
end |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
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
|
|