hasherezade / masm_shc

A helper utility for creating shellcodes. Cleans MASM file generated by MSVC, gives refactoring hints.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infinite loop in get_module_by_name

davemcincork opened this issue · comments

if (curr_module->BaseDllName.Buffer == NULL) continue;

if curr_module->BaseAddress is non-null and curr_module->BaseDllName.Buffer is null, the while loop goes infinite. Reason is that the advance to the next list item is skipped on continue. Suggest turning the while loop into a for loop, i.e.

for (
    PLDR_DATA_TABLE_ENTRY curr_module = Flink;
    curr_module && curr_module->BaseAddress;
    curr_module = (PLDR_DATA_TABLE_ENTRY)curr_module->InLoadOrderModuleList.Flink) {

Thank you, fixed!