Remap (Rename) parameter name or local variable name using mappings file.
format:
<class> <method name> <method signature> <remap info>
source code:
package test;
public class MemoryUtils {
public void writeObject(boolean dummy, long foo, long bar) {
// write at memory address [foo] with value [bar]
// parameter [dummy] is ignored, just for example
}
}
mapping file:
test/MemoryUtils writeObject (ZJJ)V foo->address bar->value
will generate this file:
package test;
public class MemoryUtils {
public void writeObject(boolean dummy, long address, long value) {
// write at memory address [address] with value [value]
}
}
test/MemoryUtils
is classwriteObject
is method name(JJ)V
is method signaturefoo->address bar->value
is remap infofoo->address
- replace a local variable namedfoo
withaddress
bar->value
- replace a local variable namedbar
withvalue
remap info can be these values:
- find by old name:
oldName->newName
- find by param index that is starting from 0:
->newName
- skip param index:
->
so this mapping file will do exact same as above:
test/MemoryUtils writeObject (ZJJ)V -> ->address bar->value
->address ->value
is remap info->
- skips the first local variable->address
- set second local variable name toaddress
bar->value
- replace a local variable namedbar
withvalue
--help
- shows help message--debug
- enable debug log--verbose
- enable verbose log--mapping-file=path/to/mappings.txt
- specify mappings file, defaults tomappings.txt
--input-file=path/to/input.jar
- specify input file, defaults toinput.jar
--output-file=path/to/output.jar
- specify output file, defaults toremapped.jar
--threads=8
- numbers of threads to process classes
just run ./gradlew build