Пример #1
0
def main():
    packageMap, classMap, fieldMap, methodMap, methodSigMap = srglib.readSrg(sys.argv[1])
    
    oldNames = {}

    for oldFull, newFull in fieldMap.iteritems():
        oldName = srglib.splitBaseName(oldFull)
        newName = srglib.splitBaseName(newFull)

        if oldName == newName: continue  # skip un-renamed

        #print oldName,newName,oldFull,newFull

        if not oldNames.has_key(oldName):
            oldNames[oldName] = []
        oldNames[oldName].append((newName,oldFull,newFull))

    print
    for oldName, newNames in oldNames.iteritems():
        obfNames = uniq([x for x,y,z in newNames])
        print len(obfNames),oldName,[newNames]
Пример #2
0
def main():
    packageMap, classMap, fieldMap, methodMap, methodSigMap = srglib.readSrg(
        sys.argv[1])

    oldNames = {}

    for oldFull, newFull in fieldMap.iteritems():
        oldName = srglib.splitBaseName(oldFull)
        newName = srglib.splitBaseName(newFull)

        if oldName == newName: continue  # skip un-renamed

        #print oldName,newName,oldFull,newFull

        if not oldNames.has_key(oldName):
            oldNames[oldName] = []
        oldNames[oldName].append((newName, oldFull, newFull))

    print
    for oldName, newNames in oldNames.iteritems():
        obfNames = uniq([x for x, y, z in newNames])
        print len(obfNames), oldName, [newNames]
Пример #3
0
#!/usr/bin/python

# Remap an inheritance map through a mapping

import srglib

import pprint
import sys

srg = srglib.readSrg("1.5.1/pkgmcp2obf.srg")
classMap = srg[1]

for line in sys.stdin.readlines():
    line = line.replace("\n", "")
    clss = line.split(" ")
    outs = []

    for cls in clss:
        outs.append(classMap[cls])

    print " ".join(outs)