[docs]classCGC(ELF):""" Backend to support the CGC elf format used by the Cyber Grand Challenge competition. See : https://github.com/CyberGrandChallenge/libcgcef/blob/master/cgc_executable_format.md """is_default=True# Tell CLE to automatically consider using the CGC backend
[docs]def__init__(self,binary,binary_stream,*args,**kwargs):binary_stream=PatchedStream(binary_stream,[(0,ELF_HEADER)])super().__init__(binary,binary_stream,*args,**kwargs)self.memory.store(AT.from_raw(0,self).to_rva(),CGC_HEADER)# repair the CGC headerself.os="cgc"self.execstack=True# the stack is always executable in CGC