INNER CODE UNIT · C++

magic_len

evanbowman/BPCore-Engine · source/filesystem.cpp:25

    const int magic_len = str_len(prefix_str) + str_len(magic);

    const int prefix = *(const int*)prefix_str;

    bool match = false;
    int i = 0;

    for (; i < (search_end - magic_len) - search_start; i += 4) {
        pfrm.feed_watchdog();

        int word;
        memcpy(&word, (search_start + i), 4);

        if (word == prefix) {
            match = true;
            for (int j = 4; j < magic_len; ++j) {
                if (*(search_start + i + j) not_eq magic[j - 4]) {
                    match = false;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…