diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-07-07 23:36:44 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-07-07 23:36:44 -0500 |
commit | 13d1b791d14695dab43033d171bb6f161bd04fc5 (patch) | |
tree | 492cb8a25e070805ec4073f0c32a9cc593156577 /tools/hooks.py | |
parent | c6ad18e5f0cf1b627d850fa3101a8c78648ff452 (diff) | |
parent | 613e30a894cddcdc11c8da140bae35090247c8ec (diff) | |
download | kamek-13d1b791d14695dab43033d171bb6f161bd04fc5.tar.gz kamek-13d1b791d14695dab43033d171bb6f161bd04fc5.zip |
merge
Diffstat (limited to '')
-rwxr-xr-x | tools/hooks.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/hooks.py b/tools/hooks.py index 388efcb..7252489 100755 --- a/tools/hooks.py +++ b/tools/hooks.py @@ -48,10 +48,10 @@ class Hook(object): self.context.hooks.append(self)
# validate the hook's data
- current_config_name = builder.config_short_name
+ current_build_name = builder.current_build_name
for field in self.required_data:
- field = field.replace('%CONFIG%', current_config_name)
+ field = field.replace('%BUILD%', current_build_name)
if field not in data:
raise ValueError, 'hook %s : %s is missing the field %s' % (module.moduleName, data['name'], field)
@@ -63,13 +63,13 @@ class Hook(object): class BasicPatchHook(Hook):
"""Hook that simply patches data to an address"""
- required_data = ['addr_%CONFIG%', 'data']
+ required_data = ['addr_%BUILD%', 'data']
def __init__(self, builder, module, data):
Hook.__init__(self, builder, module, data)
def create_patches(self):
- addr = self.data['addr_%s' % self.builder.config_short_name]
+ addr = self.data['addr_%s' % self.builder.current_build_name]
hex_data = self.data['data']
@@ -86,7 +86,7 @@ class BasicPatchHook(Hook): class BranchInsnHook(Hook):
"""Hook that replaces the instruction at a specific address with a branch"""
- required_data = ['branch_type', 'src_addr_%CONFIG%']
+ required_data = ['branch_type', 'src_addr_%BUILD%']
def __init__(self, builder, module, data):
Hook.__init__(self, builder, module, data)
@@ -95,9 +95,9 @@ class BranchInsnHook(Hook): try:
target_func = self.data['target_func']
except KeyError:
- target_func = self.data['target_func_%s' % self.builder.config_short_name]
+ target_func = self.data['target_func_%s' % self.builder.current_build_name]
- src_addr = self.data['src_addr_%s' % self.builder.config_short_name]
+ src_addr = self.data['src_addr_%s' % self.builder.current_build_name]
is_symbol_name = isinstance(target_func, str)
if is_symbol_name:
@@ -118,7 +118,7 @@ class BranchInsnHook(Hook): class AddFunctionPointerHook(Hook):
"""Hook that places a function pointer at an address"""
- required_data = ['src_addr_%CONFIG%']
+ required_data = ['src_addr_%BUILD%']
def __init__(self, builder, module, data):
Hook.__init__(self, builder, module, data)
@@ -127,9 +127,9 @@ class AddFunctionPointerHook(Hook): try:
target_func = self.data['target_func']
except KeyError:
- target_func = self.data['target_func_%s' % self.builder.config_short_name]
+ target_func = self.data['target_func_%s' % self.builder.current_build_name]
- src_addr = self.data['src_addr_%s' % self.builder.config_short_name]
+ src_addr = self.data['src_addr_%s' % self.builder.current_build_name]
is_symbol_name = isinstance(target_func, str)
if is_symbol_name:
@@ -146,13 +146,13 @@ class AddFunctionPointerHook(Hook): class NopInsnHook(Hook):
"""Hook that NOPs out the instruction(s) at an address"""
- required_data = ['area_%CONFIG%']
+ required_data = ['area_%BUILD%']
def __init__(self, builder, module, data):
Hook.__init__(self, builder, module, data)
def create_patches(self):
- area = self.data['area_%s' % self.builder.config_short_name]
+ area = self.data['area_%s' % self.builder.current_build_name]
if isinstance(area, list):
addr, end = area
|