View previous topic :: View next topic |
Author |
Message |
usernotfound Expert Cheater Reputation: 0
Joined: 21 Feb 2016 Posts: 115
|
Posted: Wed Jul 20, 2016 2:18 pm Post subject: Can someone help me fix my code. |
|
|
[solved]
Last edited by usernotfound on Thu Aug 18, 2016 5:44 pm; edited 2 times in total |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Jul 20, 2016 5:34 pm Post subject: |
|
|
Just need to registersymbol(StringUser)
Code: | local value = UDF1.CEEdit1.Text .. string.char(0)
writeString("StringUser", value) |
|
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4307
|
Posted: Wed Jul 20, 2016 6:26 pm Post subject: |
|
|
Trying to use dealloc like that won't work. AA scripts keep track of the memory they allocate; Lua scripts don't. Use globalalloc to only allocate it once, and all you need to change is the injection point.
Do not copy and paste code without knowing what it does.
You should use CETrainer.CEToggleBox57.Checked instead of that old function.
The ellipses are not a part of the script but are used to represent missing parts of the original script.
With regards to string.format, %X is a placeholder for representing an integer in uppercase hexadecimal and is not relevant for strings. Use the placeholder %s instead to substitute a string.
Unless the username and password are always numbers, you have no logical excuse for wrapping the text in tonumber.
As for the second Lua script, you still have the same problem of memory leak.
Use a registered symbol to change the delay. Either store it separately in memory, or directly change the immediate in the instruction.
Zanzer: unfortunately that code won't make writeString also write the null character. You'll have to write that byte manually or use the AA and string.format.
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Wed Jul 20, 2016 6:36 pm Post subject: |
|
|
You saying I have to test my scripts too?! What a bother.
Code: | local value = UDF1.CEEdit1.Text
local bytes = stringToByteTable(value)
table.insert(bytes, 0)
writeBytes("StringUser", bytes) |
|
|
Back to top |
|
|
usernotfound Expert Cheater Reputation: 0
Joined: 21 Feb 2016 Posts: 115
|
Posted: Wed Jul 20, 2016 6:37 pm Post subject: |
|
|
ParkourPenguin wrote: | Trying to use dealloc like that won't work. AA scripts keep track of the memory they allocate; Lua scripts don't. Use globalalloc to only allocate it once, and all you need to change is the injection point.
Do not copy and paste code without knowing what it does.
You should use CETrainer.CEToggleBox57.Checked instead of that old function.
The ellipses are not a part of the script but are used to represent missing parts of the original script.
With regards to string.format, %X is a placeholder for representing an integer in uppercase hexadecimal and is not relevant for strings. Use the placeholder %s instead to substitute a string.
Unless the username and password are always numbers, you have no logical excuse for wrapping the text in tonumber.
As for the second Lua script, you still have the same problem of memory leak.
Use a registered symbol to change the delay. Either store it separately in memory, or directly change the immediate in the instruction.
Zanzer: unfortunately that code won't make writeString also write the null character. You'll have to write that byte manually or use the AA and string.format. |
Hey Parkour thanks for the reply yet again, you definitely have a much better understanding of all this then I do, if it wouldn't be too much trouble would you mind giving me a small example with the code I've posted so far? So I could reference it for the future, would be very much appreciated.
Last edited by usernotfound on Thu Aug 18, 2016 5:45 pm; edited 1 time in total |
|
Back to top |
|
|
ParkourPenguin I post too much Reputation: 140
Joined: 06 Jul 2014 Posts: 4307
|
Posted: Wed Jul 20, 2016 6:59 pm Post subject: |
|
|
Fixing the memory leak:
Code: | autoAssemble([[globalalloc(mycode,1024)
globalalloc(mystring,256)
mycode:
// do whatever
jmp wherever
mystring:
db 'A string',0]])
function CEToggleBox57Change(sender)
if sender.Checked then
autoAssemble([[injectionPoint:
jmp mycode]]) -- jmp to your code
else
autoAssemble([[injectionPoint:
originalCode]]) -- restore original code
end
end |
To change the delay:
Code: | autoAssemble([[globalalloc(delay,4)
someCode:
mov eax,[delay]
delay:
dd 0]])
writeInteger("delay",5) |
_________________
I don't know where I'm going, but I'll figure it out when I get there. |
|
Back to top |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Thu Jul 21, 2016 4:49 am Post subject: |
|
|
Hey, OP, don't be rude! If someone takes the time out of their day to offer you help when you asked for it, don't just ignore them...say thanks. Even if you don't use their suggestion, at least show them some common courtesy.
|
|
Back to top |
|
|
usernotfound Expert Cheater Reputation: 0
Joined: 21 Feb 2016 Posts: 115
|
Posted: Thu Jul 21, 2016 9:58 am Post subject: |
|
|
Terribly sorry I meant to reply to this thread but have been an issue with my ISP that I just resolved, but thank you so much Parkour & Zanzer I finally have the script working the way I wanted it to. Again really sorry for the late reply, I didn't mean to ignore anyone at all.
|
|
Back to top |
|
|
++METHOS I post too much Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Thu Jul 21, 2016 10:13 am Post subject: |
|
|
I had just woken up and I am generally pretty jaded about some things.
|
|
Back to top |
|
|
|