memoryjs icon indicating copy to clipboard operation
memoryjs copied to clipboard

Problems when using with electron.

Open Runc2333 opened this issue 2 years ago • 1 comments

Program working fine when in 'preview' mode (I mean yarn electron:serve), but memoryjs.openProcess(process.th32ProcessID); throws Error: unable to find process after being packed by electron-builder. Here's my code:

const signature = '75 6E 61 6D 65 3D 27';
const rc_clients = memoryjs.getProcesses().filter(p => p.szExeFile === "rc3.exe");
let accounts = [];
for (let process of rc_clients) {
    const process_object = memoryjs.openProcess(process.th32ProcessID);
    let pat = memoryjs.findPattern(process_object.handle, signature, memoryjs.NORMAL, 0);
    let mem = memoryjs.readBuffer(process_object.handle, pat, 256);
    // ...
}
return accounts;

Target process is 32-bit, using vue-electron-builder, node version is 32-bit too, have tried npm run build32, requestedExecutionLevel: requireAdministrator, externals: ['memoryjs'], but none of these work. Hope to get some help from here, thanks in advance.

Runc2333 avatar May 13 '22 17:05 Runc2333

Hey, if you are still having problems it would be helpful to log some information. Can you print/log rc_clients and confirm the process ids returned by memoryjs match the process ids in Task Manager? If we know memoryjs.openProcess is being called on a valid process id, then it could be a permissions issue.

Error: unable to find process happens when memoryjs can't find the process, or if it found it but wasn't able to obtain a handle to the process. I'll add an item to the TODO list to add more granularity to the error messages, to make it clear if the process could not be found or if it's just that a handle couldn't be obtained.

Rob-- avatar Oct 16 '22 15:10 Rob--