AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi Basisadresse der kernel32.dll unter Windows 9x (ohne API)
Thema durchsuchen
Ansicht
Themen-Optionen

Basisadresse der kernel32.dll unter Windows 9x (ohne API)

Ein Thema von NicoDE · begonnen am 30. Jul 2004 · letzter Beitrag vom 1. Aug 2004
Antwort Antwort
NicoDE
(Gast)

n/a Beiträge
 
#1

Re: Basisadresse der kernel32.dll unter Windows 9x (ohne API

  Alt 1. Aug 2004, 21:30
Nur falls jemand auf die Idee kommen sollte die im oben angehängten Testprojekt enthaltene GetObsfucatorPid() zu verwenden,
der sollte besser folgenden Code verwenden:
Delphi-Quellcode:
////////////////////////////////////////////////////////////////////////////////
//
// GetObsfucator
//
// Returns the value of kernel32.dwObsfucator on Consumer Windows (win9x).
//
// Note that this version does *NOT* read kernel32 memory (as often seen).
// Therefore, it can be called without the risk of raising any exceptions.
// Furthermore, the function validates if the calculated value works, and
// returns 0 if the Obsfucator isn't working (not Win9x | no obfuscation).
//

function GetObsfucator: DWORD;
{$IFDEF WIN32}
asm
        {                                                                }
        { Wellknown, methods to get the 'Obsfucator':                    }
        {                                                                }
        {   'Obsfucator' = Pid xor [TEB.PDB]                             }
        {   'Obsfucator' = Tid xor ( [TEB.Self] - TDB.TEB )              }
        {                                                                }
        { Therefore the TDB's offset from the TEB is:                    }
        {                                                                }
        {   -TDB.TEB = ( Tid xor Pid xor [TEB.PDB] ) - TEB.Self          }
        {                                                                }
        { If the offset is neither -8h (new Win9x) nor -10h (old Win9x), }
        { (the offset has changed through changes in the object header)  }
        { then the current system isn't Win9x or obfuscation isn't used. }
        {                                                                }
        call GetCurrentThreadId
        push eax
        call GetCurrentProcessId
        xor edx, edx
        xor eax, fs:[edx + 30h] { [TEB.PDB]  }
        pop ecx
        xor ecx, eax
        sub ecx, fs:[edx + 18h] { [TEB.Self] }
        add ecx, 08h
        jecxz @@done
        add ecx, 08h
        jecxz @@done
        xor eax, eax
@@done:
end;
{$ELSE}
begin
  Result := 0;
end;
{$ENDIF}
Gruss Nico
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:05 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz