From b03d5627968614bcbd4e176373d95a9380ce6e3a Mon Sep 17 00:00:00 2001 From: rosenfield Date: Tue, 9 Oct 2007 10:41:35 +0000 Subject: [PATCH] Another minor fix for the search algo, avoiding adding an extra byte after finding the correct value.. --- extra/EnvPipe/EnvPipe.dpr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/EnvPipe/EnvPipe.dpr b/extra/EnvPipe/EnvPipe.dpr index 2bf331b2..b8142aa7 100644 --- a/extra/EnvPipe/EnvPipe.dpr +++ b/extra/EnvPipe/EnvPipe.dpr @@ -372,7 +372,7 @@ begin OutputDebugString(PChar(Format('ReadProcessMemory read %d out of %d attempted bytes of environment.', [retLenU, size]))); last := last shr 1; if last = 0 then last := 1; - if res then size := size + last; + if res and (last > 1) then size := size + last; if (not res) and (err = 299) then size := size - last; until ((not res) and (err <> 299)) or ((last = 1) and res); if err <> 299 then begin