frida-python icon indicating copy to clipboard operation
frida-python copied to clipboard

Frida fails attaching to a process in session 0

Open m00dy- opened this issue 5 years ago • 2 comments

Hello, I have a Windows service that spawns a new process. All of them runs under Windows Session 0. Attempting to attach to this process fails with the error: Failed to attach: unexpected error allocating memory in target process (VirtualAlloc returned 0x00000005) I think that is due mainly to the isolation of Session 0. (I'm running Frida with a system token). Any help ? correct me if I'm wrong.

m00dy- avatar Nov 07 '19 12:11 m00dy-

I did test attaching to other processes in Session 0 using Frida and it works ! I don't see the reason why I have this issue.

m00dy- avatar Nov 07 '19 13:11 m00dy-

I'm guessing you moved on a long time ago, but I had this error and couldn't see any info on it. I found that it was because I was trying to attach to a 32-bit process with a 64-bit python install. Once I installed 32-bit python and frida-tools in that instance it worked ok.

I think the VirtualAlloc error is because the address provided is being coerced (?) into a 32-bit integer which is then not valid in the target process' address space.

jdsnape avatar Jan 12 '21 16:01 jdsnape