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 


dissect code and mono
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Sat Jan 13, 2018 6:06 am    Post subject: dissect code and mono Reply with quote

dissect code did not give any effect in the disassembly in a mono game, so is it a bug?
_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Sat Jan 13, 2018 11:45 am    Post subject: Reply with quote

hm, perhaps disable mono (just try debugging something and it'll break the monopipe lol) and then using dissect code.

If it still doesn't work then perhaps there's a bug, though probably not a high priority one.
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: Sat Jan 13, 2018 12:05 pm    Post subject: Reply with quote

dissectcode follows modules
_________________
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
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Sat Jan 13, 2018 2:00 pm    Post subject: Reply with quote

mono features: off
dissect code: every module the game loads
result: nothing

mono features: on
dissect code: every module the game loads
result: nothing



so its probably a bug tho.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Sat Jan 13, 2018 4:21 pm    Post subject: Reply with quote

is the code you're looking at inside a module ?
_________________
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
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Sat Jan 13, 2018 5:30 pm    Post subject: Reply with quote

Dark Byte wrote:
is the code you're looking at inside a module ?

what are you saying!
where else could the cpu read and execute instructions from?

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 457

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

PostPosted: Sun Jan 14, 2018 4:07 am    Post subject: Reply with quote

code dissect doesn't follow dynamically allocated memory

and mono tends to generate code at runtime in allocated memory

_________________
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
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Sun Jan 14, 2018 4:34 am    Post subject: Reply with quote

uhm, i see.

i ran couple tests too, on enumerated dlls still not everything analyzed even the entry point.

and what you said is true, they are dynamically allocated.
first i thought these functions might be imported from another process, but it didnt make sense to me.
well, they are imported actually.

so there is nothing i can do about it?
i tried with olly, but seems olly cant handle the executable since its about 16MBs.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jan 14, 2018 10:15 am    Post subject: Reply with quote

celua.txt:
Code:
getDissectCode().dissect(base, size)

Go to "Memory View -> View -> Memory Regions" for base and size info.

_________________
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
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Sun Jan 14, 2018 10:56 am    Post subject: Reply with quote

im not sure .. what should i do with this lua code?
i know what base and size means, but its executed under lua engine? right!

plus the functions in this section 0x80000000 and mem_rgn can find this section of the executable.

im not sure if they were marked as uninitialized executable data.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jan 14, 2018 11:12 am    Post subject: Reply with quote

  1. Look at an instruction in the disassembler
  2. Look at the address that instruction is at (turn off symbols in the view menu)
  3. Open the Memory Regions window
  4. Find the memory region that address is in
  5. Open the Lua engine window (Memory View -> Tools -> Lua Engine)
  6. Copy and paste that code into the bottom part of that window (left of the "Execute" button)
  7. Replace the "base" parameter with the number under the "Address" column in the memory regions window
  8. Replace the "size" parameter with the number under the "Size" column in the memory regions window
  9. Make sure the arguments are prepended with "0x" to tell Lua they are hexadecimal literals
  10. Click on the "Execute" button

_________________
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
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Sun Jan 14, 2018 11:20 am    Post subject: Reply with quote

no way parkour, base at 7FFF0000 and the size 90000 which will be 80080000.

and the instruction located in 800E0000+

also getDissectCode().dissect(0x7FFF0000, 0x90000) didnt result anything.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Sun Jan 14, 2018 11:38 am    Post subject: Reply with quote

Then why did you choose that memory region if you know it isn't the correct one?

Say an instruction in a memory region you want to dissect is stored at the address 10002B419, and the Memory Regions window looks like this:
Code:
 address | ... | size
...
7FFE0000   ...  1000
7FFE1000   ...  F000
7FFF0000   ...  80010000
100000000  ...  1000
100001000  ...  19C000
10019D000  ...  6000
1001A3000  ...  5000
...

Is the instruction between 7FFF0000 and 100000000? No, because 10002B419 is greater than 100000000.
Is the instruction between 10019D000 and 1001A3000? No, because 10002B419 is less than 10019D000.
Is the instruction between 100001000 and 10019D000? Yes, because 10002B419 is greater than 100001000 and less than 10019D000.

The code in this example would look like this:
Code:
getDissectCode().dissect(0x100001000, 0x19C000)

_________________
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
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1586

PostPosted: Sun Jan 14, 2018 12:08 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Then why did you choose that memory region if you know it isn't the correct one?

because its the largest base available, there is nothing after 7FFF0000 in memory region window.

everything else you said is true and i understand it, i dont know whats wrong with ce really .. btw its 32-bit process.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
panraven
Grandmaster Cheater
Reputation: 54

Joined: 01 Oct 2008
Posts: 941

PostPosted: Sun Jan 14, 2018 2:06 pm    Post subject: This post has 1 review(s) Reply with quote

Try to associate the dissect function with a hotkey, but found ce will duplicate same reference with each hotkey pressed.
Work around is to add an artificial call reference to the target function starting address, the artificial call/jump is in between that function start and end.
This may affect some other extension using the dissect function references, since it is not an actual call, it may cause problem.

Hotkey is CTRL-ALT-J, may change.

Usage: Save the text to a *.lua and put in autorun directry.


Updated:
-- add one more 'already' check.

Code:

function mono_func_range(addr, bInRange)
  local addy = addr
  if type(addy)=='string' then addy = GetAddressSafe(addy)end
  if type(addy)=='number' and readInteger'mono_domain_get' and 0~=LaunchMonoDataCollector() then
    local info = mono_getJitInfo(addy)--GetAddress(na))
    if info then
      if bInRange~=true then
        return info.code_start, info.code_size
      else
        return info.code_start, info.code_size+info.code_start
      end
    end
  end
  return 0,0,'failed, addr = '..math.tointeger(addr) and
    string.format("%X",0+addr) or tostring(addr)
end

function mono_dissect_currentDisassembleAddress()
  local addr = getMemoryViewForm().DisassemblerView.SelectedAddress
  local from,size = mono_func_range(addr)
  if from and from~=0 and size>0 then
    local dsc = getDissectCode()
    local already = dsc.getReferences(from)
    if not already or already[from+size]~= jtCall then
      dsc.dissect(from,size)
      dsc.addReference(from+size,from,jtCall)
      dsc.addReference(from,from+size,jtUnconditional)
    end
  else
    speak"mono dissect address failed"
  end
end

if not _mono_dsc_hotkey then
  _mono_dsc_hotkey = createHotkey(mono_dissect_currentDisassembleAddress,
    VK_CONTROL, VK_MENU, VK_J
  )
end

_________________
- Retarded.
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
Goto page 1, 2  Next
Page 1 of 2

 
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