Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems when using with electron. #96

Open
Runc2333 opened this issue May 13, 2022 · 1 comment
Open

Problems when using with electron. #96

Runc2333 opened this issue May 13, 2022 · 1 comment

Comments

@Runc2333
Copy link

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.

@Rob--
Copy link
Owner

Rob-- commented Oct 16, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants