g100s_3360 original code from https://gist.github.com/qsxcv/53c52e2bf6ed1f0b6c2a8a0d21219476 and https://www.overclock.net/threads/reverse-engineering-3366.1561041/post-28068670