5268ac routers
#39
Was a bit distracted with developing keygens for ZyXEL modems. But I did gain some more experience writing C++ code. Decided to write the multiplier finding algo from scratch to see if I missed anything. Again I cannot find a multiplier. But it recovers the NVG589 and 599 multipliers flawlessly.  Oh well, over 800 passwords now.

Code:
#include <iostream>
#include <fstream>

using namespace std;
using std::ifstream;

const double precision = 0.000001;
const double precision2 = 2*precision;

bool is_integer(double input) {
    bool result;
    double fraction;

    input = input + precision; //shift .9999 to above zero, so you can floor to get the remainder
    fraction = input - (long)input;
    result=fraction<precision2;
    return result;
}

void main(int argc, char* argv[]) {
    int key1, key2, fit, max_fit;
    double integer1, integer2, integer3, multiplier, max_multi;
    ifstream file_data;
    string file_name;
    int number_of_keys;
    long double all_keys[600];

    file_name = argv[1];
    file_data.open(file_name);
    if (!file_data) {
        cerr << "file not found";
        exit(1);
    }
    number_of_keys = 0;
    while (!file_data.eof()) {
        file_data >> all_keys[number_of_keys];
        number_of_keys = number_of_keys + 1;
    }
    file_data.close();

    for (integer1 = 1; integer1 < 3e9; integer1++) {
        max_fit = 0;

        for (key1 = 0; key1 < number_of_keys; key1++) {
            fit = 0;
            multiplier = all_keys[key1] / integer1;
            for (key2 = 0; key2 < number_of_keys; key2++) {
                integer2 = all_keys[key2] / multiplier;
                if (is_integer(integer2)) {
                    fit++;
                }
            }
            if (fit > max_fit) {
                max_fit = fit;
                max_multi = multiplier;
            }
        }
        if (max_fit >= number_of_keys-2) { // allowed to miss on one key
            printf("%17.7lf\n", max_multi);
        }
    }
}
Reply


Messages In This Thread
5268ac routers - by drsnooker - 11-27-2021, 09:49 PM
RE: 5268ac routers - by calexico - 11-28-2021, 03:21 AM
RE: 5268ac routers - by drsnooker - 12-06-2021, 02:03 AM
RE: 5268ac routers - by evets97 - 12-06-2021, 08:37 PM
RE: 5268ac routers - by drsnooker - 12-13-2021, 03:03 AM
RE: 5268ac routers - by evets97 - 12-13-2021, 03:39 PM
RE: 5268ac routers - by drsnooker - 12-13-2021, 08:24 PM
RE: 5268ac routers - by drsnooker - 01-02-2022, 01:50 AM
RE: 5268ac routers - by drsnooker - 01-03-2022, 04:10 AM
RE: 5268ac routers - by drsnooker - 01-04-2022, 12:43 AM
RE: 5268ac routers - by drsnooker - 01-06-2022, 02:56 AM
RE: 5268ac routers - by soxrok2212 - 01-10-2022, 10:18 PM
RE: 5268ac routers - by drsnooker - 01-15-2022, 06:09 AM
RE: 5268ac routers - by drsnooker - 02-02-2022, 02:31 AM
RE: 5268ac routers - by drsnooker - 02-14-2022, 12:06 AM
RE: 5268ac routers - by drsnooker - 03-21-2022, 11:58 PM
RE: 5268ac routers - by drsnooker - 03-02-2022, 08:12 AM
RE: 5268ac routers - by soxrok2212 - 03-04-2022, 05:49 AM
RE: 5268ac routers - by drsnooker - 03-04-2022, 11:39 PM
RE: 5268ac routers - by drsnooker - 03-05-2022, 12:01 AM
RE: 5268ac routers - by drsnooker - 03-14-2022, 12:57 AM
RE: 5268ac routers - by drsnooker - 03-18-2022, 01:23 AM
RE: 5268ac routers - by drsnooker - 04-05-2022, 04:21 AM
RE: 5268ac routers - by fart-box - 04-07-2022, 10:59 PM
RE: 5268ac routers - by drsnooker - 04-08-2022, 12:23 AM
RE: 5268ac routers - by soxrok2212 - 04-09-2022, 10:29 AM
RE: 5268ac routers - by MrMiller - 04-09-2022, 04:08 PM
RE: 5268ac routers - by soxrok2212 - 04-10-2022, 02:35 AM
RE: 5268ac routers - by drsnooker - 04-10-2022, 04:07 AM
RE: 5268ac routers - by bentrout - 04-10-2022, 10:56 PM
RE: 5268ac routers - by MrMiller - 04-19-2022, 09:34 PM
RE: 5268ac routers - by drsnooker - 04-10-2022, 11:50 PM
RE: 5268ac routers - by soxrok2212 - 04-22-2022, 08:15 AM
RE: 5268ac routers - by MrMiller - 05-30-2022, 09:49 PM
RE: 5268ac routers - by drsnooker - 05-17-2022, 02:47 AM
RE: 5268ac routers - by drsnooker - 05-28-2022, 12:59 AM
RE: 5268ac routers - by drsnooker - 06-27-2022, 02:05 AM
RE: 5268ac routers - by drsnooker - 12-03-2022, 08:16 PM
RE: 5268ac routers - by drsnooker - 01-20-2023, 10:15 PM
RE: 5268ac routers - by slyexe - 01-21-2023, 12:25 AM
RE: 5268ac routers - by drsnooker - 01-21-2023, 01:34 AM
RE: 5268ac routers - by 90h - 02-12-2023, 04:44 AM
RE: 5268ac routers - by drsnooker - 02-12-2023, 05:22 AM
RE: 5268ac routers - by 90h - 02-12-2023, 07:19 PM
RE: 5268ac routers - by drsnooker - 02-12-2023, 08:04 PM
RE: 5268ac routers - by drsnooker - 02-14-2023, 03:55 AM
RE: 5268ac routers - by drsnooker - 03-02-2023, 07:14 AM
RE: 5268ac routers - by drsnooker - 04-29-2023, 04:33 AM
RE: 5268ac routers - by drsnooker - 07-06-2023, 10:42 AM
RE: 5268ac routers - by drsnooker - 10-01-2023, 10:28 PM
RE: 5268ac routers - by drsnooker - 12-23-2023, 09:37 PM
RE: 5268ac routers - by drsnooker - 12-29-2023, 06:47 AM