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 


How to use for 2 injection points?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
rog9001
Expert Cheater
Reputation: 2

Joined: 22 Dec 2015
Posts: 214
Location: Jupiter

PostPosted: Thu Jul 28, 2016 1:58 pm    Post subject: How to use for 2 injection points? Reply with quote

I am having some issues when making a edit box set a value in a script with 2 injection points so basically
Code:

function CEToggleBox1Change(sender)
if ( blah blah blah(FORM1.CEToggleBox1) == 1) then
autoAssemble(string.format([[

alloc(mem1,1000)
label(1)
label(ret)

mem1:

1:
mov eax,%X
mov edx,eax
jmp ret

ADDRESS:
jmp 1
nop
ret:

alloc(mem2,1000)
label(1a)
label(reta)

mem2:

1a:
mov [eax+0C],%X
mov ecx,[eax+0C]
jmp reta

ADDRESS2:
jmp 1a
reta:
]],tonumber(FORM1.CEEdit1.Text)))
else
autoAssemble([[
// deallocation stuff \\
]])
end
end


but how do I make the %X work for both injection points?


Last edited by rog9001 on Thu Jul 28, 2016 2:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4706

PostPosted: Thu Jul 28, 2016 2:22 pm    Post subject: Reply with quote

rog9001 wrote:
as you know or don't know %X only work for 1 injection point

Where did you get that idea? If you have multiple format specifiers, all you need to do is include multiple arguments to string.format. Example:
Code:
print(string.format("Two hexadecimal numbers '%08X' and '%08X'.", 0x00401828, 0x1234ABCD))


I should also point out this.

_________________
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
rog9001
Expert Cheater
Reputation: 2

Joined: 22 Dec 2015
Posts: 214
Location: Jupiter

PostPosted: Thu Jul 28, 2016 2:44 pm    Post subject: Reply with quote

ParkourPenguin wrote:
rog9001 wrote:
as you know or don't know %X only work for 1 injection point

Where did you get that idea? If you have multiple format specifiers, all you need to do is include multiple arguments to string.format. Example:
Code:
print(string.format("Two hexadecimal numbers '%08X' and '%08X'.", 0x00401828, 0x1234ABCD))


I should also point out this.


Well I am not good with lua at all. I do not understand, what is this meant to be?

print(string.format("Two hexadecimal numbers '%08X' and '%08X'.", 0x00401828, 0x1234ABCD))

Also exactly what do you do with this?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4706

PostPosted: Thu Jul 28, 2016 3:30 pm    Post subject: Reply with quote

That is an example. It shows you can use multiple format specifiers (i.e. %X) in a format string as you requested. If you do not know how to gather information from that example, you should learn the basics of Lua first before you try to learn topics that build off of the basics.

For more technical information:
http://www.lua.org/manual/5.3/manual.html#pdf-string.format

_________________
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
rog9001
Expert Cheater
Reputation: 2

Joined: 22 Dec 2015
Posts: 214
Location: Jupiter

PostPosted: Thu Jul 28, 2016 3:49 pm    Post subject: Reply with quote

ParkourPenguin wrote:
That is an example. It shows you can use multiple format specifiers (i.e. %X) in a format string as you requested. If you do not know how to gather information from that example, you should learn the basics of Lua first before you try to learn topics that build off of the basics.

For more technical information:
http://www.lua.org/manual/5.3/manual.html#pdf-string.format


thanks for the help :\

last question. what if instead of the %x, %d, %c, %i and all of that other stuff all separate, what if i want to assign 1 of those things for example %d to something so for example "[Input] = %d"
and then do something like
Code:

mov eax,[Input]
mov edx,eax
jmp ret

. . .

push esi
mov esi,[Input]
mov [eax+0C],esi
mov ecx,[eax+0C]
pop esi
jmp reta


how would something like this be done?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4706

PostPosted: Thu Jul 28, 2016 3:51 pm    Post subject: Reply with quote

Code:
Input:
  dd %X

_________________
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
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Jul 28, 2016 6:19 pm    Post subject: Reply with quote

Code:
define(Input,%X)
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