Reverse Engineering for Beginners : Software cracking & Impossible shutdown practical joke (Windows7)
1.19 Software cracking

The author said at the beginning that the vast majority of programs can be cracked in this way
That you search for the place where the protection is checked,
Whether dongle, license key, serial number, etc.
And he said that it is often in this form:
So if you saw a patch (or “crack”) that cracks a program, and this patch changed the bytes 0x74 / 0x75
(JZ / JNZ instructions) to 0xEB (JMP), then this is exactly the topic.
And then it means and in short the software cracking process in the end comes to searching for this JMP instruction.
There are also cases, the program in them checks the protection from time to time,
Whether dongle, or license server asked via the internet.
Then you have to search for the function that checks the protection,
And then patch it, and put in it:
Or like this:
It is important to understand that after you patch at the beginning of the function, often there will be (garbage) coming after these instructions.
This garbage is part of one instruction, along with several instructions after it.
Real case
This is the beginning of a real function, we want to replace it with return 1;
Listing 1.153: Before
Listing 1.154: After
Here we see some wrong instructions appeared
IN، PUSH، ADC، ADD —
And after them, the disassembler adjusted itself and continued decoding the rest of the code.
And this is not important — all the instructions after RETN will never be executed,
Unless there is a direct jump coming from another place,
And this in the general case will not be possible.
There may also be a global Boolean variable,
In which there is a flag, whether the program is registered or not.
The beginning of the function
check_protection_or_license_file()
Can be patched so that it always returns 1,
Or if this is better for some reason, you can also patch all
JZ / JNZ instructions.
And there will be more information about patching later
1.20 Impossible shutdown practical joke (Windows7)

The author explained that he found the function ExitWindowsEx() in the user32.dll file of Windows 98
And then he tried to stop it by modifying its beginning and putting the byte 0xC3 (RETN instruction)
Then Windows 98 became impossible to shut down and he also tried it on Windows 7
And the function ExitWindowsEx() is still present in the user32.dll file
And it does the same purpose.
The first thing he did was disable Windows File Protection
By adding this line in the registry
(Because otherwise Windows would restore the modified system files automatically without you noticing):
After that he renamed c:\\windows\\system32\\user32.dll to user32.dll.bak.
He found the export entry of ExitWindowsEx() using Hiew
(And IDA also works), and put the byte 0xC3 in that place. And then he restarted Windows 7
And now it completely refuses to shut down. The Restart and Logoff buttons became non-functional.
