maaaaz / androwarn

Yet another static code analyzer for malicious Android applications
GNU Lesser General Public License v3.0
485 stars 159 forks source link

invalid literal for int() with base 10 #10

Open jandyle opened 9 years ago

jandyle commented 9 years ago

Traceback (most recent call last): File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn.py", line 116, in main(options, arguments) File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn.py", line 99, in main data = perform_analysis(APK_FILE, a, d, x, no_connection) File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn/analysis/analysis.py", line 115, in perform_analysis ( 'device_settings_harvesting', gather_device_settings_harvesting(x) ), File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn/search/malicious_behaviours/device_settings.py", line 96, in gather_device_settings_harvesting result.extend( detect_get_package_info(x) ) File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn/search/malicious_behaviours/device_settings.py", line 79, in detect_get_package_info flags = recover_bitwise_flag_settings(flag, PackageManager_PackageInfo) File "/TOOLS/Static/androwarn/test/androwarn-master/androwarn/util/util.py", line 257, in recover_bitwise_flag_settings if (int(flag) & option_value) == option_value : ValueError: invalid literal for int() with base 10: 'Lcom/tumblr/App;->getAppContext()Landroid/content/Context;'

im testing the tumblr app. can you help me?

xstr8edgepersianx commented 8 years ago

Hello.. has anyone figured out the solution to this error? I tested a few apks using androwarn.py and I get this same error each time? It would help if someone could reply to this thread.. its about 2 years old!

eon01 commented 8 years ago

+1 I had the same issue.

kobikal1 commented 8 years ago

+1 I had the same issue.

The-Chairman commented 8 years ago

+1 I also had this issue with some of my tests

agucova commented 7 years ago

+1 I had the same issue :P

mukila92 commented 7 years ago

Had the same issue. So modified device_settings.py file and then it worked. Under detect_get_package_info(x) method added the below set of codes flag = get_register_value(2, registers) #prev line if (flag != '0'): #start flags = flag.split() package_name = flags[0] flag = flags[1] #end

ikoun commented 6 years ago

I had to slightly modify @mukila92 's code as I encountered cases where the flag was only returning a list with one element; thus an IndexError: list index out of range was thrown again. My code addition (together with mukila92's code):

if (flag != '0'): #start
    flags = flag.split()
    if len(flags) > 1:
        package_name = flags[0]
        flag = flags[1] #end
    else:
        flag = flags[0]
rschwass commented 6 years ago

I tried this fix. Still not working

Xarlan commented 6 years ago

Hi, androwarn/androwarn/util/util.py I did the following:

def recover_bitwise_flag_settings(flag, constants_dict) :
    """
        @param flag : an integer value to be matched with bitwise OR options set
        @param constants_dict : a dictionary containing each options' integer value

        @rtype : a string summing up settings
    """
    recover = ''
    options = []

    try:
        flag_var = int(flag)

    except ValueError:
        print "ValueError, flag = ", flag

    else:
        for option_value in constants_dict :
            # if (int(flag) & option_value) == option_value :
            if (flag_var & option_value) == option_value :
                options.append(constants_dict[option_value])

        recover = ', '.join(i for i in options)

        return recover

After that, I get report about apk The error/message was: __ValueError, flag = Lcom/google/android/gms/measurement/internal/zzn;->getContext()Landroid/content/Context;

maaaaz commented 5 years ago

Hello there,

Thank you for trying to debug this, could you point me an APK leading that issue ?

Best regards.

Xarlan commented 5 years ago

Hello maaaaz The APK wich generate this "error" follow by this link: https://play.google.com/store/apps/details?id=com.gsgroup.tricoloronline&hl=ru