Comments (8)
Hi @pvthuyet ,
You're right. However this situation will never happen as a current process id is always present in a processes snapshot. Also the solution requires CloseProcessSnapshot
.
I think it's better to add a comment there instead of writing a code to handle the impossible situation.
BTW, did you find this manually or with some automatic tool?
from mhook.
Hi @SergiusTheBest ,
BTW, did you find this manually or with some automatic tool?
I met this problem with my project. Some how can't get the process info from snapshot, then access the NULL pointer.
Also the solution requires CloseProcessSnapshot
I got your point.
from mhook.
Are you able to reproduce this issue?
from mhook.
Hi @SergiusTheBest ,
Now i know the root cause.
I hooked ZwQuerySystemInformation and modified the result.
That why can't find the process from snapshot.
Therefore, we should check the NULL pointer too.
from mhook.
Oh, so that's you messed up with WinAPI. Without the check you'll know that something is wrong much faster!
from mhook.
thank you @SergiusTheBest
from mhook.
@SergiusTheBest ,
But how about this fix to void crash if someone messed up as mine
...
if (NULL == *procInfo) {
CloseProcessSnapshot(*snapshot);
return FALSE;
}
return TRUE;
from mhook.
A crash is a better indication that something is really wrong.
from mhook.
Related Issues (14)
- VirtualAlloc hooking reports anomaly HOT 6
- so many printf logs HOT 1
- How to work with it? HOT 8
- Request: Integration to Ms/vcpkg
- Breaking on unsupported RIP-addressing? HOT 11
- Supporting arm64 architecture HOT 2
- Hooking CopyFileA/W HOT 5
- Hooking at one specific address and calling the original function causes a crash. HOT 2
- 2 compiler errors when compiling with MingW on Windows and suggested fixes HOT 3
- Support Windows for Arm64
- Add AppVeyor CI
- Unable to hook DestroyCaret function from user32 module HOT 4
- Why do I need a DLL to use this? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mhook.