The Sims 4 - How to Enable advanced debug (cheat) interactions forever (or, until next update)

In this tutorial I'll describe, how to enable advanced debug (cheat) interactions forever (or, until next update).
 
Warning! Important!
This tutotial made just for educational purposes and has been written with The Sims 4 version 1.46.18.1020. File structure of another versions of TS4 could be different. If you see, that file structure of these files:
python33.dll
python33_x64.dll
is different, than on screenshots in this tutorial, you can ask me by email [email protected] , how to change them.
The process of The Sims 4 should be closed before these changes. Exit your game before it.

This tutorial not for ordinary gamer and users. Follow this tutorial only if you are self-confident person and you are ready to repeat this tutorial several times, if you will do something wrong.

You will need some instruments for it:
Open folder where TS4.exe is located. In my case it's C:\Games\The Sims 4\Game\Bin and create backup (!!!) of python33.dll and python33_x64.dll to another directory. It should be better, if you will create a full backup of C:\Games\The Sims 4\Game\Bin directory, not only those *.dll files.
 
Download and unpack x64dbg. Open 
snapshot_2018-08-12_23-07\release\x96dbg.exe .
Select version - x32 or x64 - depends on your Windows version. If your Windows is x64, use only x64 version of the programm.
 


I'll use x64 in this tutorial.
Open File - Open or press F3.
Locate to directory where TS4.exe is located. In my case it's C:\Games\The Sims 4\Game\Bin and select python33_x64.dll (or python33.dll if you have x32 Windows) in it.

 
Press Run to load DLL:

 
Right click on selected area and select Search for - All Modules - Constant

In the first text box enter (case sensitive!)
 
Py_OptimizeFlag
 

In the search results select line with 
cmp dword ptr ds:[0x000000001E3A7AC0], ecx




and double click on it



Double check, that before 
cmp dword ptr ds:[0x000000001E3A7AC0], ecx
there should be line 
xor ecx, ecx
It's important! If there is no 
xor ecx, ecx
contact me for consultations.
 
Change line
cmp dword ptr ds:[0x000000001E3A7AC0], ecx
by double click on it and set it to
cmp ecx, 0

As result you will see something like


Press File - Patch file (or Ctrl+P):

 
Press Patch File button:


Enter file name python33_x64_MODIFIED.dll (or python33_MODIFIED.dll, if you opened it in x64dbg) and press Save.
 
You will see something like


Close Patches window.
Close x64dbg main window.
Cancel debug process.


Open directory, where TS4.exe is located (in my case, it's C:\Games\The Sims 4\Game\Bin ).
Rename python33_x64_MODIFIED.dll (or python33_MODIFIED.dll, if you opened it in x64dbg) to python33_x64.dll (or to python33.dll) and place it to directory, where TS4.exe is located (in my case, it's C:\Games\The Sims 4\Game\Bin ). Overwrite existing *.dll file with modified one.

Start The Sims 4.
Load any family/household. Press Shift on your keyboard and hold it. Left click on sim and you will see pie menu debug options:

 
That's all, my friends.