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 


adding a list of addresses from text file copy paste lists?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
theboy181
Advanced Cheater
Reputation: 0

Joined: 26 Jan 2018
Posts: 89

PostPosted: Sat Apr 30, 2022 6:04 pm    Post subject: adding a list of addresses from text file copy paste lists? Reply with quote

I have extracted a bunch of addresses from IDA, and I want to copy them into CE and have them added into the table.

Example
001063B4
00106DF8
00106DFC
00107EC0
00108230
00108234
00108240
00108244
00109258
00109E60
0010A1E8
0010A1EC
0010A1F0
0010A1F4
0010A1F8
0010DB6C
0010DB70

Is there a way to import these address? I would also like to change the lists offset by -0x100000 as well.
Back to top
View user's profile Send private message
mece
Newbie cheater
Reputation: 2

Joined: 29 Jun 2014
Posts: 17

PostPosted: Sat Apr 30, 2022 6:27 pm    Post subject: Reply with quote

theboy181 wrote:
Is there a way to import these address? I would also like to change the lists offset by -0x100000 as well.

1. Open lua engine (Ctrl+M then Ctrl+L)
2. Paste the following code into the edit box
3. Execute (Ctrl+Enter)
Code:

local addrTable = {
  "001063B4",
  "00106DF8",
  "00106DFC",
  "00107EC0",
  "00108230",
  "00108234",
  "00108240",
  "00108244",
  "00109258",
  "00109E60",
  "0010A1E8",
  "0010A1EC",
  "0010A1F0",
  "0010A1F4",
  "0010A1F8",
  "0010DB6C",
  "0010DB70",
}
for _,addr in ipairs(addrTable) do
  local mr = getAddressList().CreateMemoryRecord()
  mr.Address = addr .. "-100000"
end
Back to top
View user's profile Send private message
theboy181
Advanced Cheater
Reputation: 0

Joined: 26 Jan 2018
Posts: 89

PostPosted: Sat Apr 30, 2022 6:36 pm    Post subject: Reply with quote

A lot of work for a long list, but way better!

There anyway that I could just make a list in a txt file and call to it?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sat Apr 30, 2022 6:48 pm    Post subject: Reply with quote

Or from clipboard:
Code:
function paste_raw_addresses(str)
  str = str or readFromClipboard()

  for s in str:gmatch'[^\r\n]+' do
    local addr = getAddressSafe(s)
    if addr then
      local memrec = AddressList.createMemoryRecord()
      memrec.Address = getNameFromAddress(addr)
    end
  end
end

-- could put this in a menu item, call from hotkey, etc.
paste_raw_addresses()

Right click the memory records in the address list and select "Recalculate new addresses", check the "Hexadecimal" box, and put in "-100000"

If you need to read it from a file, read the file to a string (see any Lua IO tutorial) and pass the string to that function.

_________________
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
mece
Newbie cheater
Reputation: 2

Joined: 29 Jun 2014
Posts: 17

PostPosted: Sat Apr 30, 2022 6:54 pm    Post subject: Reply with quote

theboy181 wrote:
There anyway that I could just make a list in a txt file and call to it?

Code:

local file = io.open(os.getenv("USERPROFILE").."\\desktop\\addresses.txt", "r")
for line in file:lines() do
  local mr = getAddressList().CreateMemoryRecord()
  mr.Address = line .. "-100000"
end
Back to top
View user's profile Send private message
theboy181
Advanced Cheater
Reputation: 0

Joined: 26 Jan 2018
Posts: 89

PostPosted: Sat Apr 30, 2022 9:14 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Or from clipboard:
Code:
function paste_raw_addresses(str)
  str = str or readFromClipboard()

  for s in str:gmatch'[^\r\n]+' do
    local addr = getAddressSafe(s)
    if addr then
      local memrec = AddressList.createMemoryRecord()
      memrec.Address = getNameFromAddress(addr)
    end
  end
end

-- could put this in a menu item, call from hotkey, etc.
paste_raw_addresses()

Right click the memory records in the address list and select "Recalculate new addresses", check the "Hexadecimal" box, and put in "-100000"

If you need to read it from a file, read the file to a string (see any Lua IO tutorial) and pass the string to that function.


I added my offsets, and got this error
Script Error:[string "function paste_raw_addresses(str)
..."]:13: malformed number near '001063B4'
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sat Apr 30, 2022 9:38 pm    Post subject: Reply with quote

theboy181 wrote:
I added my offsets, and got this error...
I assume whatever changes you made are causing the error.
If you want useful help, post the code you're running.

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions 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