Hello and welcome to the political walkthrough on multiprocessor control.
Let's open this project now.
We are going to build it and run it.
So first we copy the path to this project and then we open our activity for native tools command from.
And then we navigate to the folder issue of yes, copy.
And Randy Cohen basket.
Now he has finished compiling building we can run by.
Pressing internal, and you can see that in the shellcode has.
But that message box with a message.
Hello from crack militants dot com.
And you can see there's also output on the terminal showing us the handle to the lock.
64.
And the Trek creator in running.
So just open the source code and try to follow along.
See where it is coming from.
So the first message is sixty four is coming from.
From here.
Sixty four and then the second message trick creator and running is coming from here.
Trade created and rainy.
So now let us try to run the same process again a second time and see whether he succeeds, so we'll
copy the top one more time and open another access before any DevTools command prompt.
Navigate to the same folder and run the same program again.
And you see, he says, new processes.
The night is already running in memory so that it's coming from here.
So when you try to run the process, a second time is trying to create another lock.
So what happens is you come here and you start the program, you will come here, you will again call
this function is process running and pass it in a type of lock that you want to to use in this case,
mutex.
So you come here to the function is process running, and he receives the permit mutex and over here
tests.
So your control method is mutates.
So this is true.
So you would try to create another lock, but by using the same controller name as the first, yeah,
first process.
But he feels there you will get an error.
So the error here is error already exists.
And because of that, you will close a handle, so it will return true.
So the default is is process running should be followed by here because you get the error or the ax.
So this is set to true.
So this true is being written and then he returns to the caller over here.
He returns to the caller over here.
This is true.
So if it's true, he would bring a message process is denied.
It is already running in memory.
And then he will close in a main function by returning zero.
So it's how it works.
So we can also check my writing process had canal.
And you can search you can search for the handle by clicking on this, find Hindu.
And you say here we look for our name.
Have a look, which is here.
My luck.
So here we look for my luck.
Fine.
And you see the tiniest mutant also known as mutex.
And this is the name space for our luck.
So that is why second process feels to run because the logging was already in place.
And that is not true.
The second one.
So we change this to say I'm a foreigner.
Semaphore, as you will recall, Semaphore is the one off the thanks of luck you find here.
So we save our source code and we.
Close this first one, and now we're going to rebuild by Colleen screaming again.
And now running again.
And we try to open another instance.
From another time and again, he feels.
All right, this time now we check the process hacker.
Research for my blog and you find now is the time this has been changed to Semaphore.
All right.
So he's working.
Now that is try the next one, which is the event, so come back down here.
Hey, chief, these two event
safe?
Yeah, cool.
And then recompile.
And then running again.
And now go to the different am known and try to run a second time and again, he feels.
So he is working this two hour namespace, our lock files and click again and this time Typekit event.
So that is what he uses even.
Because we are using this create even API.
They aren't going to use him or create.
Maybe he wanted to create a semaphore lock.
We use create him out for API.
So now we know we're going to try new pipes.
So let us change this to name by name by save it and then.
Close the first program.
Now the rebuilt again.
Then we run it.
It is running now, and we go to our second terminal and we run again.
He tried to move again and he fears again.
So he's walking.
So we go back to our find handles and click on Find I'm.
And this time you find it.
Is this file so named fight with a kind of virtual file, which is in memory?
It is.
Purpose is to do in the process communication, but you are using it in this example as kind of lock.
So this is the how we can control how a number of processes running memory by using this lock.
So that's all for this session.
Thank you for watching.