Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <idc.idc>
- /*
- Author: fastman92
- Description: this script renames functions from the old names to the new names.
- Names are specified by a list.
- */
- class CListOfFunctionsNames
- {
- CListOfFunctionsNames()
- {
- this.numberOfFunctions = 0;
- this.arrayOfFunctionNames = object();
- }
- Clear()
- {
- this.numberOfFunctions = 0;
- this.arrayOfFunctionNames = object();
- }
- AddMember(currentName, newName)
- {
- auto item = object();
- item.currentName = currentName;
- item.newName = newName;
- this.arrayOfFunctionNames[this.numberOfFunctions++] = item;
- }
- }
- static RenameFunctionsInOrder(list)
- {
- auto i;
- for(i = 0; i < list.numberOfFunctions; i++)
- {
- auto functionInfo = list.arrayOfFunctionNames[i];
- auto functionEA = LocByName(functionInfo.currentName);
- if(functionEA == BADADDR)
- Message("Item with name %s does not exist!\n", functionInfo.currentName);
- else
- {
- if(MakeName(functionEA, functionInfo.newName))
- Message("Function %s renamed to %s\n", functionInfo.currentName, functionInfo.newName);
- else
- Message("Error while trying to rename a function %s with address 0x%X\n", functionInfo.currentName, functionEA);
- }
- }
- }
- static main()
- {
- Message("\n----- bStarting a function renamer by fastman92 -----\n");
- auto list = CListOfFunctionsNames();
- list.AddMember("_sub_550170", "png_set_unknown_chunks");
- list.AddMember("$CPool_CPtrNodeSingle__constructor", "png_set_unknown_chunk_location");
- // Rename functions
- RenameFunctionsInOrder(&list);
- Message("\----- Finished a function renamer by fastman92 -----\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement