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 


activate script on checkbox

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

Joined: 28 Jul 2015
Posts: 1

PostPosted: Thu Jul 30, 2015 5:37 pm    Post subject: activate script on checkbox Reply with quote

Hi, I have a problem with chekbox (cheat component) in lua trainer. I watched many topicks on this forum but still can't do it. How to make this script activated on checkbox? When i use it got error "Error:Invalid class object"
I use this code:
Code:
function CECheckbox1Change(sender)
  if (checkbox_getState(CETrainer.CECheckbox1) == 1) then
    CheatEntry=addresslist_getMemoryRecordByID(addresslist,0)
    memoryrecord_freeze(CheatEntry)
  else
    CheatEntry=addresslist_getMemoryRecordByID(addresslist,0)
    memoryrecord_unfreeze(CheatEntry)
  end
end

and this script:
Code:
[ENABLE]

aobscan(INJECT,8B B6 10 03 00 00 8B) // should be unique
alloc(newmem,$1000)

label(code)
label(return)

newmem:

code:
  mov dword ptr [esi+00000310],186A0
  fild dword ptr [esi+00000310]
  jmp return

INJECT:
  jmp code
  nop
return:
registersymbol(INJECT)

[DISABLE]

INJECT:
  db 8B B6 10 03 00 00

unregistersymbol(INJECT)
dealloc(newmem)

{
// ORIGINAL CODE - INJECTION POINT: 0E4FC2D6

0E4FC29F: 89 8D E4 FD FF FF              -  mov [ebp-0000021C],ecx
0E4FC2A5: A1 88 58 39 00                 -  mov eax,[00395888]
0E4FC2AA: 05 E0 FC FF FF                 -  add eax,FFFFFCE0
0E4FC2AF: A3 BC 59 39 00                 -  mov [003959BC],eax
0E4FC2B4: C7 05 C4 59 39 00 00 00 A0 41  -  mov [003959C4],41A00000
0E4FC2BE: A1 00 3D C7 04                 -  mov eax,[04C73D00]
0E4FC2C3: 8B 15 C4 58 39 00              -  mov edx,[003958C4]
0E4FC2C9: 3B 50 04                       -  cmp edx,[eax+04]
0E4FC2CC: 0F 83 81 1B 00 00              -  jae 0E4FDE53
0E4FC2D2: 8B 74 90 0C                    -  mov esi,[eax+edx*4+0C]
// ---------- INJECTING HERE ----------
0E4FC2D6: 8B B6 10 03 00 00              -  mov esi,[esi+00000310]
// ---------- DONE INJECTING  ----------
0E4FC2DC: 8B C6                          -  mov eax,esi
0E4FC2DE: BF 14 00 00 00                 -  mov edi,00000014
0E4FC2E3: 99                             -  cdq
0E4FC2E4: F7 FF                          -  idiv edi
0E4FC2E6: 8B F8                          -  mov edi,eax
0E4FC2E8: 8D 86 70 FE FF FF              -  lea eax,[esi-00000190]
0E4FC2EE: B9 05 00 00 00                 -  mov ecx,00000005
0E4FC2F3: 99                             -  cdq
0E4FC2F4: F7 F9                          -  idiv ecx
0E4FC2F6: 89 45 F0                       -  mov [ebp-10],eax
}
- it's from terraria, working good but idk what to do with that error
p.s. sorry for my bad english Very Happy


Last edited by Hy6axa on Thu Jul 30, 2015 7:59 pm; edited 5 times in total
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 30, 2015 7:07 pm    Post subject: Reply with quote

Where did this come from?
Code:
fild dword ptr [esi+00000310]

Remove it and put the original code back.
Code:
mov esi,[esi+00000310]
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 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