I have been studying shellcode decoders and found lots of articles on line about it, e.g., https://www.rcesecurity.com/2015/01/slae-custom-rbix-shellcode-encoder-decoder/