https://bitbucket.org/daniel_fort/magic-lantern
Revision bc46669fd403a18fd05f21949e9fcb5d1cf489ee authored by alex@thinkpad on 03 December 2017, 20:18:40 UTC, committed by alex@thinkpad on 03 December 2017, 20:18:40 UTC
- always install ML-SETUP.FIR (zip, install, install_qemu)
- build_fir for regular ML (not installer) now gives AUTOEXEC.FIR
- to recompile ML-SETUP.FIR: "make ML-SETUP.FIR -B" from platform directory
- "make zip" will also compile the installer from source, without replacing the precompiled ML-SETUP.FIR
  (just to make sure the source code changes do not interfere with building the installer)
1 parent 5e69462
Raw File
Tip revision: bc46669fd403a18fd05f21949e9fcb5d1cf489ee authored by alex@thinkpad on 03 December 2017, 20:18:40 UTC
Makefile: FIR building updates
Tip revision: bc46669
module_strings_dump.py
# print the module_strings section from a ML module (*.mo)
# sorry, not compatible with Python 3 (patches welcome)
import os, sys
from struct import unpack

def getLongLE(d, a):
   return unpack('<L',(d)[a:a+4])[0]

def getString(d, a):
    return d[a : d.index('\0',a)]

strings = open(sys.argv[1], "rb").read()

# iterate through all module strings
a = 0
while getLongLE(strings, a):
    key = getString(strings, getLongLE(strings, a))
    val = getString(strings, getLongLE(strings, a+4)).strip("\n")
    # display max 3 lines, indented to match the other strings
    val = "\n              ".join(val.split("\n")[0:3]) \
        + (" [...]" if val.count("\n") > 3 else "")
    print("%-12s: %s" % (key, val))
    a += 8
back to top