IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

API, COM et SDKs Delphi Discussion :

Développement d'un plugin pour OllyDBG en Delphi


Sujet :

API, COM et SDKs Delphi

  1. #1
    Membre averti
    Homme Profil pro
    Paramétreur de progiciels
    Inscrit en
    Octobre 2006
    Messages
    970
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Paramétreur de progiciels

    Informations forums :
    Inscription : Octobre 2006
    Messages : 970
    Points : 381
    Points
    381
    Par défaut Développement d'un plugin pour OllyDBG en Delphi
    Bonjour,

    Je commence à développer un petit plugin pour OllyDBG en Delphi et je rencontre déjà un petit problème.

    En effet, le plugin est correctement chargé dans OllyDBG mais seulement la première lettre de son nom est affichée dans le menu des plugins.

    Voici mon code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
     
    library MyPlugin;
     
    uses
      Classes,
      SysUtils,
      Windows;
     
    const
      PLUGIN_VERSION = 110;
     
    {$R *.res}
     
    function _ODBG_Plugindata(shortname:PWideChar):integer; cdecl;
    begin
         StrCopy(shortname,'MyPlugin');
         Result := PLUGIN_VERSION;
    end;
     
    function _ODBG_Plugininit(ollydbgversion:integer; hw:HWND; features:ulong):integer; cdecl;
    begin
         Result := 0;
    end;
     
    exports
         _ODBG_Plugindata,
         _ODBG_Plugininit;
     
    begin
    end.
    Savez-vous comment puis-je corriger ce problème ?

    Si vous avez déjà développé un plugin en delphi pour OllyDBG, comment avez-vous déclaré ces deux fonctions ?

    Voici l'aide :
    Mandatory callback function that must be present in any valid OllyDbg plugin. It must fill in plugin name and return version of plugin interface (constant PLUGIN_VERSION). If function is absent, or version is not compatible, plugin will be not installed. Short name identifies plugin in OllyDbg. This name is limited to 31 alphanumerical characters or spaces followed by terminating null character. To keep life easy for users, name should be descriptive and correlate with the name of DLL.

    int ODBG_Plugindata(char *shortname);

    Parameters:

    shortname - pointer to buffer of length at least 32 characters that receives name of plugin. This name may include spaces and punctuators but no special symbols.
    Mandatory callback function that must be present in any valid OllyDbg plugin. Here you can place all startup initializations and allocate resources. If startup was successfull, function must return 0. On error, it must free allocated resources and return -1, in this case plugin will be removed. Parameter ollydbgversion is the version of OllyDbg, use it to assure that OllyDbg is compatible with your plugin.

    int ODBG_Plugininit(int ollydbgversion,HWND hw,ulong *features);

    Parameters:

    ollydbgversion - version of OllyDbg. Check that your plugin is compatible with this version. I will try to avoid incompatible changes in the future versions of OllyDbg;

    hw - handle of main OllyDbg window, keep it if necessary;

    features - reserved for future extentions.
    Merci,
    ZiP

  2. #2
    Membre éprouvé
    Avatar de Dr.Who
    Inscrit en
    Septembre 2009
    Messages
    980
    Détails du profil
    Informations personnelles :
    Âge : 45

    Informations forums :
    Inscription : Septembre 2009
    Messages : 980
    Points : 1 294
    Points
    1 294
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    library MyPlugin;
     
     
    uses
      Windows,
      SysUtils,
      Classes;
     
    {$R *.res}
     
     
    const
      PLUGIN_VERSION = 110;
      PLUGIN_NAME    = 'MyPlugin'+#0;
     
     
    function _ODBG_Plugindata(var shortname: PChar): integer; cdecl;
    begin
      shortName := PLUGIN_NAME;
      Result    := PLUGIN_VERSION;
    end;
     
    function _ODBG_Plugininit(const ollydbgversion: integer; const hw: HWND; const features: pLongWord): integer; cdecl;
    begin
      Result := 0;
    end;
     
    exports
         _ODBG_Plugindata,
         _ODBG_Plugininit;
     
    begin
     
    end.
    [ Sources et programmes de Dr.Who | FAQ Delphi | FAQ Pascal | Règlement | Contactez l'équipe ]
    Ma messagerie n'est pas la succursale du forum... merci!

  3. #3
    Membre averti
    Homme Profil pro
    Paramétreur de progiciels
    Inscrit en
    Octobre 2006
    Messages
    970
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Paramétreur de progiciels

    Informations forums :
    Inscription : Octobre 2006
    Messages : 970
    Points : 381
    Points
    381
    Par défaut
    Bonsoir,

    J'ai résolu mon problème avec le code suivant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
     
    library MyPlugin;
     
    uses
      SysUtils,
      Classes,
      Windows;
     
    {$A1}
     
    const
      PluginVersion     = 'v0.0.1';
      PluginName        = 'MyPlugin';
      PLUGIN_VERSION    = 110;
     
    {$R *.res}
     
    function _ODBG_Plugindata(shortname:PAnsiChar):Integer; cdecl;
    begin
         StrCopy(shortname,PluginName);
         Result := PLUGIN_VERSION;
    end;
     
    function _ODBG_Plugininit(ollydbgversion:Integer; hw:HWND; features:ULONG):Integer; cdecl;
    begin
         Result := 0;
    end;
     
    exports
         _ODBG_Plugindata,
         _ODBG_Plugininit;
     
    end.
    Cordialement,
    ZiP

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. VC++ 2010 : Comment créer un plugin pour OllyDbg ?
    Par [ZiP] dans le forum Débuter
    Réponses: 0
    Dernier message: 28/03/2011, 19h08
  2. Réponses: 3
    Dernier message: 25/04/2006, 11h32
  3. Développer un plugin pour Eclipse ( piste)
    Par eRom dans le forum Eclipse Platform
    Réponses: 2
    Dernier message: 12/07/2005, 09h05
  4. Réponses: 2
    Dernier message: 20/03/2002, 23h01

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo