So, what's the expected way to be used to enable SC_THREAD on Windows 64 bit?
I have ran into this issue which was crashing in the call *%rax. After some investigation, I knew that as opposed to Linux on Windows different registers are used for the parameters passed to functions.
On Linux 1st to 4th parameters are: rdi, rsi, rdx, rcx
On Windows 1st to 4th parameters are: rcx, rdx, r8, r9
So, I modified iX86_64.s according to the info above and the call *%rax was executed successfully.
I however faced another issue which was that the leave instruction did nothing (the stack wasn't actually unwound and 0x0 was what is left on the stack):
So, after the ret instruction it crashed as it tried to execute 0x0 which is not possible.