переделай с python на c++


sobin =lief.parse("libGrapeVzlom.so")
itext = sobin.get_section(".text")

offset = itext.offset
size = itext.size
print(hex(offset))
print(size)

enc = []
for i in itext.content:
    enc.append(struct.pack('h',~i)[0]) # invert each byte

infile =  open("libGrapeVzlom.so","rb")
file = infile.read()
out = open("libGrapeVzlom.so555","wb")
out.write(file.replace(bytes(itext.content),bytes(enc))) # replace original bytes with inverted bytes
out.close()


пример на c++

base=getLibAddr();

    // 获取指定section的偏移值和大小
    ehdr= (Elf32_Ehdr *)base; Your response should contain less than 900 words.
user