Beispiel #1
0
def main():
    print("hachoir version %s" % __version__)
    print()
    values, filename = parseOptions()
    configureHachoir(values)
    app = app_t(filename)
    app.MainLoop()
Beispiel #2
0
def main():
    print("%s version %s" % (PACKAGE, VERSION))
    print(WEBSITE)
    print()
    values, filename = parseOptions()
    configureHachoir(values)
    app = app_t(filename)
    app.MainLoop()
Beispiel #3
0
def main():
    try:
        values, pattern, filenames = parseOptions()
        configureHachoir(values)
        if values.bench:
            bench = Benchmark()
            bench.run(runGrep, values, pattern, filenames)
        else:
            runGrep(values, pattern, filenames)
    except KeyboardInterrupt:
        print("Program interrupted (CTRL+C).")
        sys.exit(1)
Beispiel #4
0
def main():
    # Parser options and initialize Hachoir
    values, filename = parseOptions()
    configureHachoir(values)

    # Open file and create parser
    parser, err = openParser(values.parser, filename, values.offset,
                             values.size)
    if err:
        print(err)
        sys.exit(1)

    # Explore file
    with parser:
        if values.profiler:
            profile(exploreFieldSet, parser, values)
        else:
            exploreFieldSet(
                parser, values, {
                    "display_size": values.display_size,
                    "display_value": values.display_value,
                })