Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7755931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:41:22+00:00 2026-06-01T12:41:22+00:00

With this code I guess the scan was faster, but the scan always return

  • 0

With this code I guess the scan was faster, but the scan always return the SAME address.

E.G.:

00123456
00124567
00135478
00145893
00123456 //start repeat 
00124567
00135478
00145893
00123456 //start repeat 
00124567
00135478
00145893

This is my procedure:

procedure SCANBYTE(value: integer);
var
 lpflOldProtect: dword;
 s: size_t;
 mbi: MEMORY_BASIC_INFORMATION;
 SI: SYSTEM_INFO;
 lpStartAddress, lpStopAddress: dword;
 addr: dword;
 i: dword;
begin
 GetSystemInfo(si);
 lpStartAddress := dword(SI.lpMinimumApplicationAddress);
 lpStopAddress := dword(SI.lpMaximumApplicationAddress);
 for addr := lpStartAddress to lpStopAddress do begin
  S:= VirtualQuery(Pointer(addr), MBI, SizeOf(MEMORY_BASIC_INFORMATION));
  if (S=SizeOf(MEMORY_BASIC_INFORMATION)) and (MBI.State = MEM_COMMIT) and (MBI.Type_9 = MEM_PRIVATE) and (MBI.RegionSize>0) and (MBI.Protect = PAGE_READWRITE) then begin
   for i := dword(MBI.BaseAddress) to (dword(MBI.BaseAddress) + dword(MBI.RegionSize)) - 4096 do begin
     if value = PBYTE(i)^ then ListBox1.Items.Add(IntToHex(i,8));
   end;
  end;
 end;
end;

I guess the problem is at the last FOR loop:

(...)
for i := dword(MBI.BaseAddress) to (dword(MBI.BaseAddress) + dword(MBI.RegionSize)) - 4096 do begin
(...)

But I really don’t know..
How can I solve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T12:41:23+00:00Added an answer on June 1, 2026 at 12:41 pm

    You run your code in a loop from the start address to the end address. The address addr increases by 1 each time around the loop. VirtualQuery gives you information about entire pages. All the addresses in a page have the same base address. The documentation tells you, “This value is rounded down to the next page boundary.”

    Look more closely, and you should see that mbi.BaseAddress remains the same for 4096 iterations of your outer loop (assuming 4096 is the page size). Thus, you’re re-scanning the same block of memory over and over again. (That might also explain why your code is slow.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code used to return my local ip address as 192.xxx.x.xxx but now it
My Problem is the following. I got this code and i guess a corrupt
I wrote this piece of code to scan a directory for files newer than
I guess I'm not understanding something about C++: I have this code: #include window.h
Can anyone explain what this code extract is doing? My first guess was that
I can't quite understand why the output of this code is '1'. My guess
Consider this code snippet and try to guess what y1 and y2 evaluate to
This code works on Linux but fails to match on Windows: if ( preg_match
I have seen this code to create a Login control, I guess instead of
How to determine time complexity of this code ? I guess that modPow method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.