Esempio n. 1
0
def main(options, arguments):
    if options.verbose:
        set_debug()

    if options.directory:
        settings = {"my": AndroTest(options.directory), "log": AndroLog, "max_fetcher": 3}

        aa = auto.AndroAuto(settings)
        aa.go()
Esempio n. 2
0
def main(options, arguments):
    if options.verbose:
        set_debug()

    if options.directory:
        settings = {
            "my": MyAXMLAnalysis(options.directory),
            "log": AndroLog,
            "max_fetcher": 3,
        }

        aa = auto.AndroAuto(settings)
        aa.go()
Esempio n. 3
0
        if i.get_class_name(
        ) == "Lre/androguard/android/invalid/MainActivity;":
            #if i.get_name() == "testStrings":
            #    instructions = [ins for ins in i.get_instructions()]
            #    instructions[0].BBBB = 10000
            #    i.set_instructions(instructions)
            if i.get_name() == "testInstances":
                instructions = [ins for ins in i.get_instructions()]
                instructions[0].BBBB = 0x4141
                i.set_instructions(instructions)


FILENAME_INPUT = "./examples/android/Invalid/Invalid.apk"
FILENAME_OUTPUT = "./toto.apk"

androconf.set_debug()

a = apk.APK(FILENAME_INPUT)
vm = dvm.DalvikVMFormat(a.get_dex())
vmx = analysis.VMAnalysis(vm)

patch_dex(vm)

new_dex = vm.save()

a.new_zip(filename=FILENAME_OUTPUT,
          deleted_files="(META-INF/.)",
          new_files={"classes.dex": new_dex})

# Please configure your keystore !! :) follow the tutorial on android website
apk.sign_apk(FILENAME_OUTPUT, "./keystore/keystore1", "tototo")
Esempio n. 4
0
                    print "ORIG : "
                    print hexdump(b1[j - 8: j + 8], off=j-8) + "\n"
                    print "NEW : "
                    print hexdump(b2[j - 8: j + 8], off=j-8) + "\n"

                j += 1


        print "OK"


#TEST = "examples/android/TestsAndroguard/bin/TestsAndroguard.apk"
TEST = "apks/malwares/smszombie/40F3F16742CD8AC8598BF859A23AC290.apk"
FILENAME = "./toto.apk"

androconf.set_debug()

a = apk.APK( TEST )
j = dvm.DalvikVMFormat( a.get_dex() )
x = analysis.VMAnalysis( j )

m = MDalvikVMFormat(j, x)
print j, x, m

new_dex = m.test_save()

a.new_zip(  filename=FILENAME,
            deleted_files="(META-INF/.)", new_files = {
            "classes.dex" : new_dex } )
apk.sign_apk( FILENAME, "./keystore/keystore1", "tototo" )