Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 688 Bytes

README.md

File metadata and controls

31 lines (25 loc) · 688 Bytes

bini

This library gives you a bunch of functions to read, write and manipulate binary ini-files used in windows programms like the game Freelancer.

from bini import *

def negateEmpathy(b):
    version, sections = b
    for section in sections:
        secname, entries = section
        for entry in entries:
            entryname, values = entry
            if entryname == "empathy_rate":
                values[1] *= -1
    return b

if __name__ == "__main__":
    b = readBini("empathy.ini")
    writeIni("empathy.ini.txt", b)
    writeBini("empathy2.ini", negateEmpathy(b))
    print(biniToStr(b))

Install with

pip install bini