mirror of
https://github.com/reactos/reactos.git
synced 2024-09-30 22:47:28 +00:00
[SDK] Add usage / help to gen_baseaddress.py
This commit is contained in:
parent
67d10c5b17
commit
9f6a1c9164
|
@ -4,7 +4,19 @@ LICENSE: MIT (https://spdx.org/licenses/MIT)
|
||||||
PURPOSE: Update baseaddresses of all modules
|
PURPOSE: Update baseaddresses of all modules
|
||||||
COPYRIGHT: Copyright 2017,2018 Mark Jansen (mark.jansen@reactos.org)
|
COPYRIGHT: Copyright 2017,2018 Mark Jansen (mark.jansen@reactos.org)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from __future__ import print_function, absolute_import, division
|
from __future__ import print_function, absolute_import, division
|
||||||
|
|
||||||
|
USAGE = """
|
||||||
|
This script will update the baseaddresses of all modules, based on the build output.
|
||||||
|
|
||||||
|
Specify the build output dir as commandline argument to the script:
|
||||||
|
`python gen_baseaddress.py C:\\Users\\Mark\\reactos\\output-MinGW-i386`
|
||||||
|
|
||||||
|
Multiple directories can be specified:
|
||||||
|
`python gen_baseaddress r:/build/msvc r:/build/gcc`
|
||||||
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import struct
|
import struct
|
||||||
import sys
|
import sys
|
||||||
|
@ -15,6 +27,7 @@ except ImportError:
|
||||||
print('# Please install pefile from pip or https://github.com/erocarrera/pefile')
|
print('# Please install pefile from pip or https://github.com/erocarrera/pefile')
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
|
|
||||||
ALL_EXTENSIONS = (
|
ALL_EXTENSIONS = (
|
||||||
'.dll', '.acm', '.ax', '.cpl', '.drv', '.ocx'
|
'.dll', '.acm', '.ax', '.cpl', '.drv', '.ocx'
|
||||||
)
|
)
|
||||||
|
@ -365,9 +378,13 @@ def main():
|
||||||
dirs = sys.argv[1:]
|
dirs = sys.argv[1:]
|
||||||
if len(dirs) < 1:
|
if len(dirs) < 1:
|
||||||
trydir = os.getcwd()
|
trydir = os.getcwd()
|
||||||
print('# No path specified, trying', trydir)
|
print(USAGE)
|
||||||
|
print('No path specified, trying the working directory: ', trydir)
|
||||||
dirs = [trydir]
|
dirs = [trydir]
|
||||||
for onedir in dirs:
|
for onedir in dirs:
|
||||||
|
if onedir.lower() in ['-help', '/help', '/h', '-h', '/?', '-?']:
|
||||||
|
print(USAGE)
|
||||||
|
else:
|
||||||
run_dir(onedir)
|
run_dir(onedir)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue