├── README.md └── attest.py /README.md: -------------------------------------------------------------------------------- 1 | # scgdp 2 | SC games documentation project 3 | * You can find any info in wiki: https://github.com/OpegitStudio/scgdp/wiki 4 | -------------------------------------------------------------------------------- /attest.py: -------------------------------------------------------------------------------- 1 | # attest.py: some Python code to generate some 80 bytes based on some other 32 bytes to show you have outstanding byte generation skills 2 | # or to put it simply, Hot Garbage Generator 3 | # Usage: attest(request) -> bytes, where request is 32 bytes 4 | 5 | 6 | import hashlib 7 | import hmac 8 | import struct 9 | import secrets 10 | import time 11 | 12 | # REPLACE THIS VALUE WITH THE ACTUAL COMPANY NAME, FIRST LETTER IS CAPITALIZED 13 | COMPANY_NAME = b"AcmeCorporation" 14 | 15 | 16 | def HASH_INTERNAL(REQUEST_PART1, SERVER_TIME, SERVER_MASK_FOR_HASH, SERVER_RANDOM): 17 | # I haven't followed chain of dependent values for this key, because it's content looks very much constant in nature 18 | SOME_KEY = COMPANY_NAME + b"APIkey0" 19 | 20 | # NOT COVERED BY TRACING: this was done but never used later. There is a chance it was just not covered, for example look at SERVER_MASK_FOR_HASH note below 21 | HINPUT_PARTIAL = hmac.new(SOME_KEY, struct.pack(" 0xe: 24 | print("UNEXPECTED") 25 | 26 | SOME_WEIRD_HASH1 = None 27 | SOME_WEIRD_HASH2 = None 28 | SOME_WEIRD_HASH3 = None 29 | SOME_WEIRD_HASH4 = None 30 | 31 | if (SERVER_MASK_FOR_HASH & 0x1): 32 | SOME_WEIRD_HASH1 = hashlib.sha256(struct.pack("