Dmitry Timoshkov wrote:
"Andrey Turkin" <pancha(a)mail.nnov.ru> wrote:
if (map_file_into_view( view, fd, 0, header_size, 0, VPROT_COMMITTED | VPROT_READ, - removable ) != STATUS_SUCCESS) goto error; + TRUE ) != STATUS_SUCCESS) goto error;
This chunk has nothin to do with the patch description and simply is wrong. I've hardcoded removevable as TRUE here to force map_file_into_view to read data and not mmap it (because mmap will map whole 4k page). Why is it wrong? Some packers depend on this. As I said in patch description, an alternative would be memset of area beyond header (which would lead to mmap, then COW a page and then memset of almost 4k).
- sec->PointerToRawData, (int)pos, file_size, map_size, + (int)start, (int)pos, file_size, map_size, ... - sec->PointerToRawData, sec->SizeOfRawData, + (int)start, sec->SizeOfRawData,
Please use a proper format specifier instead of a cast. Can do (actually I realized that SIZE_T is not so good for "start"; DWORD would be better).