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 


Get an address from the opcode?

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

Joined: 08 Aug 2012
Posts: 2
Location: United States

PostPosted: Wed Aug 08, 2012 4:44 am    Post subject: Get an address from the opcode? Reply with quote

I made this little thing to help me, but it craps out at like 4000.

Code:
local Address = {
   Opcode = "push 07"; -- Not actual opcode, just an exampl
   StartPoint = 00900000; -- Start address
   EndPoint = 00901000; -- End address, both change by +1000 after every loop
};

function split(Str, Spl)
   local out = {};
   for v in Str:gmatch("([^" .. Spl .. "]+)") do
      table.insert(out, v);
   end
   return out;
end;

function getAddress(list)
   for i = 1, 100 do
      for address = list.StartPoint, list.EndPoint do
         local a = split(disassemble("00" .. tostring(address)), "-")[3];
         print("Current address: 00" .. address);
         if a:match(list.Opcode) then
            print("Noclip: " .. a);
         end
         collectgarbage('collect');
         sleep(2);
      end;
      list.StartPoint, list.EndPoint = list.StartPoint + 1000, list.EndPoint + 1000;
      sleep(2);
   end;
end;

getAddress(Address);


I just want to know if there's a less haxy, or non haxy way to do this. Thanks.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Wed Aug 08, 2012 5:07 am    Post subject: Reply with quote

Not really sure what you wish to do, but I can give some suggestions

I think
Code:

StartPoint = 00900000;
EndPoint = 00901000;

should be
Code:

StartPoint = 0x900000;
EndPoint = 0x901000;

and
Code:

"00" .. tostring(address))

can just be address

And instead of manually splitting the result you can use splitDisassembledString.

e.g:
Code:

addresstring,opcode,bytes,extra=splitDisassembledString(disassemble(address))

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Mew903
How do I cheat?
Reputation: 0

Joined: 08 Aug 2012
Posts: 2
Location: United States

PostPosted: Wed Aug 08, 2012 8:46 pm    Post subject: Reply with quote

I'm trying to find a certain opcode using CE Lua, how would I do this? Dark Byte's solution didn't work Razz.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Thu Aug 09, 2012 4:23 am    Post subject: Reply with quote

Just use AOBScan and scan for the bytes that make up that opcode
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
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