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 


HELP:allocateSharedMemory failed

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
niucha9
Newbie cheater
Reputation: 0

Joined: 12 Jun 2022
Posts: 15

PostPosted: Sat Jul 09, 2022 1:11 am    Post subject: HELP:allocateSharedMemory failed Reply with quote

Code:

newmem=allocateSharedMemory("newmem",  4096)
r =  registerSymbol("newmem",  newmem)
print(newmem) -- print nil



situation: i open two games and two CE, i want to inject some code to both games.
the game need to activate cloak before injecting code.
when i activated cloak and injected code on A game (jmp newmem),B process's code will also become "jmp newmem".

but B process doesn't have "newmem".

so i think i should use allocateSharedMemory to allocate "newmem".

but allocateSharedMemory worked on tutorial,not working on my game though.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sat Jul 09, 2022 3:23 pm    Post subject: Reply with quote

Try launching the game with admin rights
_________________
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
niucha9
Newbie cheater
Reputation: 0

Joined: 12 Jun 2022
Posts: 15

PostPosted: Sat Jul 09, 2022 6:35 pm    Post subject: Reply with quote

good morning DB!
Dark Byte wrote:
Try launching the game with admin rights

i try,but still failed Embarassed


i found your reply in the topic t=615152&view=next&sid=3cd67294fab9d88632912bf21d15cbe1

you said
Quote:
But since that is tricky I recommend just doing a single
Code:

writeInteger(address,readInteger(address))

this will trigger the copy-on-write giving the selected process a unique physical address for that page but won't trigger any integrity check.
You then apply the cloak to that new physical address


this is my script
Code:

address = getAddress("00A03719") & ~(0xfff)

PA=dbk_getPhysicalAddress(address)

print(PA)

writeInteger(address,readInteger(address))

PA=dbk_getPhysicalAddress(address)

print(PA)

dbvm_cloak_activate(PA, address)

i run this script in different ce with different game process, all prints "11795660800", nothing change.
Did I do something wrong?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Jul 10, 2022 3:36 am    Post subject: Reply with quote

what are you trying to do, because this is completely different from the first question
_________________
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
niucha9
Newbie cheater
Reputation: 0

Joined: 12 Jun 2022
Posts: 15

PostPosted: Sun Jul 10, 2022 3:52 am    Post subject: Reply with quote

Dark Byte wrote:
what are you trying to do, because this is completely different from the first question


sorry, i just want to inject code to both games correctly,because they will affect each other when inject the code.

i think i could inject code to the shared memory so they can jump to this memory,or use copy-on-write to avoid affecting other games when inject code to one game.


when i inject code to one game,the other will be affected sometimes,and cause the other game crash.
i dont know how to avoid that correctly Sad
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 458

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

PostPosted: Sun Jul 10, 2022 4:14 am    Post subject: Reply with quote

ok.
Disable kernelmode read/write memory and when you write memory then, it'll only affect the target process

(Assuming you're targeting an actual process, and not an emulator like bluestacks, or physical 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
niucha9
Newbie cheater
Reputation: 0

Joined: 12 Jun 2022
Posts: 15

PostPosted: Sun Jul 10, 2022 8:11 pm    Post subject: Reply with quote

Dark Byte wrote:
ok.
Disable kernelmode read/write memory and when you write memory then, it'll only affect the target process


thanks! but how to "Disable kernelmode read/write memory"..


besides,sometimes i can inject code to both games correctly
the code looks like:
Code:

originalcode:
jmp newmem

it works fine,it actually jump to newmem.

but after a couple minutes,i found it didnt jump to newmem anymore.
it jump to a random memory(i make a breakpoint and step over) ,despite it still show "jmp newmem".

(sorry,i cant upload img,i try my best to describe my problem!) Embarassed


there is my script
Code:

    address = getAddress("00A03719") & ~(0xfff)

    writeInteger(address,readInteger(address))

    PA=dbk_getPhysicalAddress(address)
    print('PA =            '..PA)

    dbvm_cloak_activate(PA, address)

    local file = assert(io.open(codeFile,'r'))
    local code = file:read("*all")
    file.close()

    autoAssemble(code)




Quote:

most likely it's a dll being reloaded

you could use a timer that checks every few seconds if the code has been restored and then rehook


edit: so i found this topic : t=590473
it's similar to my problem.
but when the game reload the dll, all game processes will have the same physical address. what i want is different games have different PA, so they will not affect each other
what i can do to change physical address or prevent it to be changed?Embarassed [/code]
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