Skip to content

Fixing minor bugs#2

Closed
rhaym-tech wants to merge 2 commits intock0i:mainfrom
rhaym-tech:main
Closed

Fixing minor bugs#2
rhaym-tech wants to merge 2 commits intock0i:mainfrom
rhaym-tech:main

Conversation

@rhaym-tech
Copy link
Copy Markdown

@rhaym-tech rhaym-tech commented Mar 26, 2026

Bug 1:

the bug description and solution was mistaken in this Pull request, please check newer pull request:
Fixed few bugs #3

Bug 2:

on integrity.h,

        // fallback: first section with IMAGE_SCN_MEM_EXECUTE
        constexpr uint32_t IMAGE_SCN_MEM_EXECUTE = 0x20000000;
        for (uint16_t i = 0; i < nt->FileHeader.NumberOfSections; ++i) {
            if (section[i].Characteristics & IMAGE_SCN_MEM_EXECUTE) {
                text_va = reinterpret_cast<uintptr_t>(base) + section[i].VirtualAddress;
                text_size = section[i].VirtualSize;
                return true;
            }
        }
    } __except (1) {}

IMAGE_SCN_MEM_EXECUTE is a macro that is predefined in ntimage.h, if that header is imported somewhere else in project.
attempting to declare and initialize a constant with same name will make variable name expand to a constant value after preprocessing.

**Fix: ** i have wrapped it in an #ifndef IMAGE_SCN_MEM_EXECUTE block

@rhaym-tech rhaym-tech closed this Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant