FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» Gestion d'un système client-serveur.
2.04 du 10 Mars 2013 - correction d'un bug Emptypar Klaus Ven 17 Mai 2024 - 14:02

» item_index(résolu)
2.04 du 10 Mars 2013 - correction d'un bug Emptypar jjn4 Mar 14 Mai 2024 - 19:38

» Bataille terrestre
2.04 du 10 Mars 2013 - correction d'un bug Emptypar jjn4 Lun 13 Mai 2024 - 15:01

» SineCube
2.04 du 10 Mars 2013 - correction d'un bug Emptypar Marc Sam 11 Mai 2024 - 12:38

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
2.04 du 10 Mars 2013 - correction d'un bug Emptypar Marc Sam 11 Mai 2024 - 12:22

» Philharmusique
2.04 du 10 Mars 2013 - correction d'un bug Emptypar jjn4 Ven 10 Mai 2024 - 13:58

» PANORAMIC V 1
2.04 du 10 Mars 2013 - correction d'un bug Emptypar papydall Jeu 9 Mai 2024 - 3:22

» select intégrés [résolu]
2.04 du 10 Mars 2013 - correction d'un bug Emptypar jjn4 Mer 8 Mai 2024 - 17:00

» number_mouse_up
2.04 du 10 Mars 2013 - correction d'un bug Emptypar jjn4 Mer 8 Mai 2024 - 11:59

» Aide de PANORAMIC
2.04 du 10 Mars 2013 - correction d'un bug Emptypar jjn4 Mer 8 Mai 2024 - 11:16

» trop de fichiers en cours
2.04 du 10 Mars 2013 - correction d'un bug Emptypar lepetitmarocain Mer 8 Mai 2024 - 10:43

» Je teste PANORAMIC V 1 beta 1
2.04 du 10 Mars 2013 - correction d'un bug Emptypar papydall Mer 8 Mai 2024 - 4:17

» bouton dans autre form que 0(résolu)
2.04 du 10 Mars 2013 - correction d'un bug Emptypar leclode Lun 6 Mai 2024 - 13:59

» KGF_dll - nouvelles versions
2.04 du 10 Mars 2013 - correction d'un bug Emptypar Klaus Lun 6 Mai 2024 - 11:41

» @Jack
2.04 du 10 Mars 2013 - correction d'un bug Emptypar Jack Mar 30 Avr 2024 - 20:40

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier

 

 2.04 du 10 Mars 2013 - correction d'un bug

Aller en bas 
2 participants
AuteurMessage
Klaus

Klaus


Nombre de messages : 12301
Age : 75
Localisation : Ile de France
Date d'inscription : 29/12/2009

2.04 du 10 Mars 2013 - correction d'un bug Empty
MessageSujet: 2.04 du 10 Mars 2013 - correction d'un bug   2.04 du 10 Mars 2013 - correction d'un bug EmptyLun 11 Mar 2013 - 18:45

Nouvelle version:
KGF.dll V2.04 du 10 Mars 2013

Correction d'un bug (mineur) dans la fonction CopyBinaryStringToRecord.

Modules modifiés:
KGF.dll
KGF_SUB.bas
(pas pour cette correction, mais à cause de ceci.

Avec ces fonctions d'accès aux fichiers binaires et la nouvelle procédure select_record(), j"ai créé un "analyseur de fichiers DLL". Ce programme parcourt une partie des structures d'un fichier DLL pour finir par afficher la liste de toutes les fonctions accessibles. Les résultats de toutes les étapes intermédiaires sont affichés. Tout est visible avec des libellés clairs, dans un mémo avec scroll-bar. Les valeurs et adresses sont systématiquement affichées en décimal et hexa-décimal. Le source du programme est largement commenté.

Ceci est un exemple parlant pour l'utilisation de la notion d'enregistrement dans un fichier binaire. Le programme utilise des champs de presque tous les types (INTEGER, WORD, BYTE et STRING). Cela montre clairement comment on peut apposer un tel "masque" sur n'importe quelle portion binaire d'un fichier pour chercher facilement les informations.

Voici le source:
Code:
' analyze_DLL_files.bas
'
' Les fichiers EXE et DLL sous Windows sont encodés en format PE.
' Ce format est constitué comme suit:
'
' MS DOS Header
' en 3c:  Pointer to PE Signature
' ...
' Portable Executable Signature
' COFF File Header
' Optional Headers
'
' Standard Fields
' Windows Specific Fields
' Data Directories
' Section Header
' …
' Section 1
' Section 2
' …
' Section n
'
' MS DOS header:
' Offset  Length Name                  Comments
' 18      2      start address          adresse de démarrage de l'exécutable
' 3C      4      adresse header PE      Signature PE, puis suit l'entête PE
'
' COFF Header (20 octets)
' Offset  Length Name                  Comments
' 0      2      machine                code pour la machine d'exécution
' 2      2      number of sections    nombre de sections du fichier
' 4      4      time date stamp        date et heure
' 8      4      pointer to symbols    pointeur vers la table de symboles
' C      4      number of symbols      nombre de symboles
' 10      2      optional header size  taille de l'entête optionnelle
' 12      2      characteristics        attributs
'
' PE STD Header (28 octets)
' Offset  Length Name                  Comments
' 0      2      magic number          Nombre magique
' 2      1      major linker version  Linker version majeure
' 3      1      minor linker version  Linker version mineure
' 4      4      code size              Taille du code
' 8      4      initialized data size  Taille données initialisées
' C      4      uninit. data size      Taille données non initialisées
' 10      4      entry point address    Adresse point d'entrée
' 14      4      code base address      Adresse de base du code
' 18      4      data base address      Adresse de base des données
'
' PE OPT Header (68 octets)
' Offset  Length Name                  Comments
' 1C      4      address of image base  adresse de base de l'image
' 20      38    diverses zones
' 46      2      DLL caracteristics    flags pour une DLL
' 48      24    diverses zones
'
' PE Data Section Directory
' Offset  Length Name                  Comments
' 60      4      export table address  adresse de la table d'export
' 64      4      export table size      taille de la table d'export
' 68      120    autres tables          15 autres tables de 8 car chacune
'
' SECT section table
' autant de lignes que ce qui indique COFF_nsect, du format suivant:
' Offset  Length Name                  Comments
' 0      8      name                  nom de la section, complété par <0>
' 8      4      virtual size          taille virtuelle en mémoire
' C      4      virtual address        addresse vrtuelle en mémoire
' 10      4      size of raw data      taille sur disque
' 14      4      pointer to raw data    adresse dans le fichier
' 18      4      pointer to relocations doit être 0 pour EXE et DLL
' 1C      4      pointer to line numbers  0 si absents
' 20      2      number of relocations  doit être 0 pour EXE et DLL
' 22      2      number of line numbers  0 si absents
' 24      4      characterisics        flags
'
' EPD Export Directory Table
' Offset  Length Name                  Comments
' 0      4      export flags          réservé, devrait être zéro
' 4      4      date/heure            date et heure de création
' 8      2      major version          version majeure
' A      2      minor version          version mineure
' C      4      name address          adresse d'une chaîne du nom de l'image
' 10      4      ordinal base          premier numéro pour export par numéro
' 14      4      address table entries  nombre d'éléments dans la table d'adresse
' 18      4      number of name pointers  nombre d'éléments dans la table des adresses des noms
' 1C      4      export adress table adr  adresse le la table d'export des adresses
' 20      4      adress of name pointers  adresse de la table des pointeurs des noms
' 24      4      ordinal table address  adresse de la table des numéros
'
' NPT Name Pointer Table
' Offset  Length Name                  Comments
' 0      4      Name address          adresse d'un nom terminé par <0>

' Find the RVA for the data
' From the RVA, derive the section to which the data referenced belongs.
'    This is trivial, since sections don’t overlap. The starting addresses
'    of the various sections are available in the file header
' Find the difference between the RVA and the starting address of the section
'    to find the data offset, ie, offset of that data within a section.
' From the file header, for the same section, find the location of the same
'    section in the file.
' Add the data offset to the location of section in the file, to find the
'    address of the data in the file.


label ouvrir

' champs MS DOS Header
dim MZH_bidon1$, MZH_start%, MZH_bidon2$, MZH_PE%
' champs COFF Header
dim COFF_machine%, COFF_nsect%, COFF_date%, COFF_ptrsym%,
dim COFF_nsym%, COFF_ohs%, COFF_flags%, PE_magic%
' champs PE standart
dim STD_magic%, STD_majorLV%, STD_minorLV%, STD_soc%, STD_soid%
dim STD_soud%, STD_soep%, STD_boc%, STD_bod%
' champs PE optionnel
dim OPT_base%, OPT_bidon1$, OPT_DLL%, OPT_bidon2$
' champs PE DDIR
dim DDIR_EXP_adress%, DDIR_EXP_size%,
dim DDIR_1a%, DDIR_1s%, DDIR_2a%, DDIR_2s%, DDIR_3a%, DDIR_3s%, DDIR_4a%, DDIR_4s%
dim DDIR_5a%, DDIR_5s%, DDIR_6a%, DDIR_6s%, DDIR_7a%, DDIR_7s%, DDIR_8a%, DDIR_8s%
dim DDIR_9a%, DDIR_9s%, DDIR_10a%, DDIR_10s%, DDIR_11a%, DDIR_11s%, DDIR_12a%, DDIR_12s%
dim DDIR_13a%, DDIR_13s%, DDIR_14a%, DDIR_14s%, DDIR_15a%, DDIR_15s%
' champs d'une ligne de la table des sections
dim SECT_name$, SECT_vs%, SECT_va%, SECT_srd%, SECT_prd%
dim SECT_prel%, SECT_lin%, SECT_nrel%, SECT_nlin%, SECT_char%
' champs EPD export directory table
dim EPD_flags%, EPD_date%, EPD_major%, EPD_minor%, EPD_na%, EPD_ob%
dim EPD_ate%, EPD_nnp%, EPD_ata%, EPD_npa%, EPD_ota%
' champs NPT name pointer table
dim NPT_adr%

MZH_bidon1$ = string$(24," ")
MZH_bidon2$ = string$(34," ")
OPT_bidon1$ = string$(38," ")
OPT_bidon2$ = string$(24," ")
SECT_name$ = string$(8," ")

' variables internes
dim fichier$, buf$, i%, a%, nom$
dim a_export_sect%, a_export_virt%, a_export_delta%

KGF_initialize("KGF.dll")

enregistrement_MZH()  : ' (1) pour MS_DOS Header
enregistrement_COFF() : ' (2) pour COFF Header
enregistrement_STD()  : ' (3) pour PE STD header
enregistrement_OPT()  : ' (4) pour PE OPT header
enregistrement_DDIR() : ' (5) pour PE DDIR header
enregistrement_SECT() : ' (6) pour SECT DDIR section
enregistrement_EPD()  : ' (7) pour EPD Export Directory Table
enregistrement_NPT()  : ' (8) pour NPT Name Pointer Table

height 0,750 : width 0,600
open_dialog 1 : filter 1,"Librairies|*.dll"

button 100 : top 100,10 : left 100,10 : caption 100,"Ouvrir" : on_click 100,ouvrir
memo 101 : top 101,40 : left 101,10 : width 101,500 : height 101,600
  font_name 101,"Courier" : bar_both 101
 
end

ouvrir:
  fichier$ = file_name$(1)
  if fichier$="_" then return
  fichier$ = lower$(fichier$)
  if (right$(fichier$,4)<>".exe") and (right$(fichier$,4)<>".dll") then return

  OpenBinaryFile(fichier$)
  ReadDriveBlock(fichier$,0,512)
 
  select_record(1)
  CopyBinaryStringToRecord(ReadDriveBlock$,record$)
  item_add 101,file_extract_name$(fichier$)
  item_add 101,"=== MS-DOS Header"
  item_add 101,"Start address:    "+str$(MZH_start%)+"=0x"+hex$(MZH_start%)
  item_add 101,"PE Header address: "+str$(MZH_PE%)+"=0x"+hex$(MZH_PE%)
  item_add 101,""

  select_record(2)
  item_add 101,"=== COFF Header (offset "+str$(MZH_PE%+4)+")"+"=0x"+hex$(MZH_PE%+4)
  ' alternative 1 pour lire et interpréter le PE Header:
  ReadBlockFromBinaryFileToString(fichier$,22,MZH_PE%+4+1)
  CopyBinaryStringToRecord(ReadBlockFromBinaryFileToString$,record$)
  ' alternative 2 pour lire et interpréter le PE Header: (s'il réside dans le bloc 0)
  ' buf$ = mid$(ReadDriveBlock$,MZH_PE%+4+1,22)
  ' CopyBinaryStringToRecord(buf$,record$)
  item_add 101,"Machine:                  "+str$(COFF_machine%)+"=0x"+hex$(COFF_machine%)
  item_add 101,"Sections:                "+str$(COFF_nsect%)+"=0x"+hex$(COFF_nsect%)
  item_add 101,"Date/Heure:              "+str$(COFF_date%)+"=0x"+hex$(COFF_date%)
  item_add 101,"Adresse symboles:        "+str$(COFF_ptrsym%)+"=0x"+hex$(COFF_ptrsym%)
  item_add 101,"Nombre symboles:          "+str$(COFF_nsym%)+"=0x"+hex$(COFF_nsym%)
  item_add 101,"Taille header optionnel.: "+str$(COFF_ohs%)+"=0x"+hex$(COFF_ohs%)
  item_add 101,"Caractéristiques:        "+str$(COFF_flags%)+"=0x"+hex$(COFF_flags%)
  if PE_magic%=267
    item_add 101,"Type PE32"
  else
    item_add 101,"Type PE32+"
  end_if
  item_add 101," "

  if PE_magic%<>267
    item_add "La suite n'est pas implémentée pour ce type."
    item_add 101,""
    CloseBinaryFile(fichier$)
    return
  end_if

  select_record(3)
  item_add 101,"=== PE STD Header (offset "+str$(MZH_PE%+4+20)+")"+"=0x"+hex$(MZH_PE%+4+20)
  ReadBlockFromBinaryFileToString(fichier$,22,MZH_PE%+4+20+1)
  CopyBinaryStringToRecord(ReadBlockFromBinaryFileToString$,record$)
  item_add 101,"Nombre magique: "+str$(STD_magic%)+"=0x"+hex$(STD_magic%)
  item_add 101,"Linker version majeure:          "+str$(STD_majorLV%)+"=0x"+hex$(STD_majorLV%)
  item_add 101,"Linker version mineure:          "+str$(STD_minorLV%)+"=0x"+hex$(STD_minorLV%)
  item_add 101,"Taille du code:                  "+str$(STD_soc%)+"=0x"+hex$(STD_soc%)
  item_add 101,"Taille données initialisées:    "+str$(STD_soid%)+"=0x"+hex$(STD_soid%)
  item_add 101,"Taille données non initialisées: "+str$(STD_soud%)+"=0x"+hex$(STD_soud%)
  item_add 101,"Adresse point d'entrée:          "+str$(STD_soep%)+"=0x"+hex$(STD_soep%)
  item_add 101,"Adresse de base du code:        "+str$(STD_boc%)+"=0x"+hex$(STD_boc%)
  item_add 101,"Adresse de base des données:    "+str$(STD_bod%)+"=0x"+hex$(STD_bod%)
  item_add 101,""

  select_record(4)
  item_add 101,"=== PE OPT Header (offset "+str$(MZH_PE%+4+20+28)+")"+"=0x"+hex$(MZH_PE%+4+20+28)
  ReadBlockFromBinaryFileToString(fichier$,68,MZH_PE%+4+20+28+1)
  CopyBinaryStringToRecord(ReadBlockFromBinaryFileToString$,record$)
  item_add 101,"Nombre magique:      "+str$(STD_magic%)+"=0x"+hex$(STD_magic%)
  item_add 101,"Adresse de base:      "+str$(OPT_base%)+"=0x"+hex$(OPT_base%)
  item_add 101,"..."
  item_add 101,"Caractéristiques DLL: "+str$(OPT_DLL%)+"=0x"+hex$(OPT_DLL%)
  item_add 101,"..."
  item_add 101,""
 
  select_record(5)
  item_add 101,"=== PE DDIR Header (offset "+str$(MZH_PE%+4+20+28+68)+")"+"=0x"+hex$(MZH_PE%+4+20+28+68)
  ReadBlockFromBinaryFileToString(fichier$,128,MZH_PE%+4+20+28+68+1)
  CopyBinaryStringToRecord(ReadBlockFromBinaryFileToString$,record$)
  item_add 101,"Adresse virtuelle table export: "+str$(DDIR_EXP_adress%)+"=0x"+hex$(DDIR_EXP_adress%)
  item_add 101,"Taille virtuelle table export:  "+str$(DDIR_EXP_size%)+"=0x"+hex$(DDIR_EXP_size%)
  item_add 101,"Adresse virtuelle table 1:      "+str$(DDIR_1a%)+"=0x"+hex$(DDIR_1a%)
  item_add 101,"Taille virtuelle table 1:      "+str$(DDIR_1s%)+"=0x"+hex$(DDIR_1s%)
  item_add 101,"Adresse virtuelle table 2:      "+str$(DDIR_2a%)+"=0x"+hex$(DDIR_2a%)
  item_add 101,"Taille virtuelle table 2:      "+str$(DDIR_2s%)+"=0x"+hex$(DDIR_2s%)
  item_add 101,"Adresse virtuelle table 3:      "+str$(DDIR_3a%)+"=0x"+hex$(DDIR_3a%)
  item_add 101,"Taille virtuelle table 3:      "+str$(DDIR_3s%)+"=0x"+hex$(DDIR_3s%)
  item_add 101,"Adresse virtuelle table 4:      "+str$(DDIR_4a%)+"=0x"+hex$(DDIR_4a%)
  item_add 101,"Taille virtuelle table 4:      "+str$(DDIR_4s%)+"=0x"+hex$(DDIR_4s%)
  item_add 101,"Adresse virtuelle table 5:      "+str$(DDIR_5a%)+"=0x"+hex$(DDIR_5a%)
  item_add 101,"Taille virtuelle table 5:      "+str$(DDIR_5s%)+"=0x"+hex$(DDIR_5s%)
  item_add 101,"Adresse virtuelle table 6:      "+str$(DDIR_6a%)+"=0x"+hex$(DDIR_6a%)
  item_add 101,"Taille virtuelle table 6:      "+str$(DDIR_6s%)+"=0x"+hex$(DDIR_6s%)
  item_add 101,"Adresse virtuelle table 7:      "+str$(DDIR_7a%)+"=0x"+hex$(DDIR_7a%)
  item_add 101,"Taille virtuelle table 7:      "+str$(DDIR_7s%)+"=0x"+hex$(DDIR_7s%)
  item_add 101,"Adresse virtuelle table 8:      "+str$(DDIR_8a%)+"=0x"+hex$(DDIR_8a%)
  item_add 101,"Taille virtuelle table 8:      "+str$(DDIR_8s%)+"=0x"+hex$(DDIR_8s%)
  item_add 101,"Adresse virtuelle table 9:      "+str$(DDIR_9a%)+"=0x"+hex$(DDIR_9a%)
  item_add 101,"Taille virtuelle table 9:      "+str$(DDIR_9s%)+"=0x"+hex$(DDIR_9s%)
  item_add 101,"Adresse virtuelle table 10:    "+str$(DDIR_10a%)+"=0x"+hex$(DDIR_10a%)
  item_add 101,"Taille virtuelle table 10:      "+str$(DDIR_10s%)+"=0x"+hex$(DDIR_10s%)
  item_add 101,"Adresse virtuelle table 11:    "+str$(DDIR_11a%)+"=0x"+hex$(DDIR_11a%)
  item_add 101,"Taille virtuelle table 11:      "+str$(DDIR_11s%)+"=0x"+hex$(DDIR_11s%)
  item_add 101,"Adresse virtuelle table 12:    "+str$(DDIR_12a%)+"=0x"+hex$(DDIR_12a%)
  item_add 101,"Taille virtuelle table 12:      "+str$(DDIR_12s%)+"=0x"+hex$(DDIR_12s%)
  item_add 101,"Adresse virtuelle table 13:    "+str$(DDIR_13a%)+"=0x"+hex$(DDIR_13a%)
  item_add 101,"Taille virtuelle table 13:      "+str$(DDIR_13s%)+"=0x"+hex$(DDIR_13s%)
  item_add 101,"Adresse virtuelle table 14:    "+str$(DDIR_14a%)+"=0x"+hex$(DDIR_14a%)
  item_add 101,"Taille virtuelle table 14:      "+str$(DDIR_14s%)+"=0x"+hex$(DDIR_14s%)
  item_add 101,"Adresse virtuelle table 15:    "+str$(DDIR_15a%)+"=0x"+hex$(DDIR_15a%)
  item_add 101,"Taille virtuelle table 15:      "+str$(DDIR_15s%)+"=0x"+hex$(DDIR_15s%)
  item_add 101,""

  a% = MZH_PE%+4+20+28+68+128 : ' adresse du début de la table de sections
  for i%=1 to COFF_nsect%
    select_record(6)
    item_add 101,"=== PE DDIR Header (offset "+str$(a%)+")"+"=0x"+hex$(a%)
    ReadBlockFromBinaryFileToString(fichier$,40,a%+1)
    CopyBinaryStringToRecord(ReadBlockFromBinaryFileToString$,record$)
    if left$(SECT_name$,6)=".edata"
      a_export_sect% = SECT_prd%
      a_export_virt% = SECT_va%
    end_if
    item_add 101,"Nom de section:            "+SECT_name$
    item_add 101,"Taille virtuelle:          "+str$(SECT_vs%)+"=0x"+hex$(SECT_vs%)
    item_add 101,"Adresse virtuelle:          "+str$(SECT_va%)+"=0x"+hex$(SECT_va%)
    item_add 101,"Taille sur disque:          "+str$(SECT_srd%)+"=0x"+hex$(SECT_srd%)
    item_add 101,"Adresse sur disque:        "+str$(SECT_prd%)+"=0x"+hex$(SECT_prd%)
    item_add 101,"Adresse relocations:        "+str$(SECT_prel%)+"=0x"+hex$(SECT_prel%)
    item_add 101,"Adresse numéros de ligne:  "+str$(SECT_lin%)+"=0x"+hex$(SECT_lin%)
    item_add 101,"Nombre de relocations:      "+str$(SECT_nrel%)+"=0x"+hex$(SECT_nrel%)
    item_add 101,"Nombre de numéros de ligne: "+str$(SECT_nlin%)+"=0x"+hex$(SECT_nlin%)
    item_add 101,"Caractéristiques:          "+str$(SECT_char%)+"=0x"+hex$(SECT_char%)
    a% = a% + 40
  next i%
  item_add 101," "

  select_record(7)
  item_add 101,"=== EPD Export Directory Table (offset "+str$(a_export_sect%)+")"+"=0x"+hex$(a_export_sect%)
  ReadBlockFromBinaryFileToString(fichier$,40,a_export_sect%+1)
  CopyBinaryStringToRecord(ReadBlockFromBinaryFileToString$,record$)
  a_export_delta% = a_export_sect% - a_export_virt%
  item_add 101,"Flags:                              "+str$(EPD_flags%)+"=0x"+hex$(EPD_flags%)
  item_add 101,"Date/heure:                          "+str$(EPD_date%)+"=0x"+hex$(EPD_date%)
  item_add 101,"Version majeure:                    "+str$(EPD_major%)+"=0x"+hex$(EPD_major%)
  item_add 101,"Version mineure:                    "+str$(EPD_minor%)+"=0x"+hex$(EPD_minor%)
  item_add 101,"Adresse du nom:                      "+str$(EPD_na%+a_export_delta%)+"=0x"+hex$(EPD_na%+a_export_delta%)
  item_add 101,"Base ordinale:                      "+str$(EPD_ob%)+"=0x"+hex$(EPD_ob%)
  item_add 101,"Nombre dans table d'adresses:        "+str$(EPD_ate%)+"=0x"+hex$(EPD_ate%)
  item_add 101,"Nombre dans table des noms:          "+str$(EPD_nnp%)+"=0x"+hex$(EPD_nnp%)
  item_add 101,"Adresse table export d'adresses:    "+str$(EPD_ata%+a_export_delta%)+"=0x"+hex$(EPD_ata%+a_export_delta%)
  item_add 101,"Adresse table des adresses des noms: "+str$(EPD_npa%+a_export_delta%)+"=0x"+hex$(EPD_npa%+a_export_delta%)
  item_add 101,"Adresse table des ordinaux:          "+str$(EPD_ota%+a_export_delta%)+"=0x"+hex$(EPD_ota%+a_export_delta%)

  item_add 101," "
  ReadBlockFromBinaryFileToString(fichier$,255,EPD_na%+a_export_delta%+1)
  charger_nom()
  item_add 101,"Nom de la DLL:                      "+nom$
  if EPD_nnp%=0
    item_add 101,"Aucun nom n'est exporté de cette image."
  else
    item_add 101,str$(EPD_nnp%)+" Noms sont exportés:"
    a% = EPD_npa%+a_export_delta% : ' adresse de la table des adresses des noms
    select_record(8)
    for i%=1 to EPD_nnp%
      ReadBlockFromBinaryFileToString(fichier$,4,a%+1)
      CopyBinaryStringToRecord(ReadBlockFromBinaryFileToString$,record$)
      ReadBlockFromBinaryFileToString(fichier$,255,NPT_adr%+a_export_delta%+1)
      charger_nom()
      item_add 101,str$(i%)+": "+nom$
      a% = a% + 4
    next i%
  end_if

  CloseBinaryFile(fichier$)
  return
 
sub charger_nom()
  dim_local i%
  i% = 1
  while asc(mid$(ReadBlockFromBinaryFileToString$,i%,1))<>0
    i% = i% + 1
  end_while
  nom$ = left$(ReadBlockFromBinaryFileToString$,i%-1)
end_sub

sub enregistrement_MZH()
  define_record(4)
  add_string_field(adr(MZH_bidon1$),24)
  add_word_field(adr(MZH_start%))
  add_string_field(adr(MZH_bidon2$),34)
  add_integer_field(adr(MZH_PE%))
  build_record()
end_sub

sub enregistrement_COFF()
  define_record(8)
  add_word_field(adr(COFF_machine%))
  add_word_field(adr(COFF_nsect%))
  add_integer_field(adr(cOFF_date%))
  add_integer_field(adr(COFF_ptrsym%))
  add_integer_field(adr(COFF_nsym%))
  add_word_field(adr(COFF_ohs%))
  add_word_field(adr(COFF_flags%))
  add_word_field(adr(PE_magic%))
  build_record()
end_sub

sub enregistrement_STD()
  define_record(9)
  add_word_field(adr(STD_magic%))
  add_byte_field(adr(STD_majorLV%))
  add_byte_field(adr(STD_minorLV%))
  add_integer_field(adr(STD_soc%))
  add_integer_field(adr(STD_soid%))
  add_integer_field(adr(STD_soud%))
  add_integer_field(adr(STD_soep%))
  add_integer_field(adr(STD_boc%))
  add_integer_field(adr(STD_bod%))
  build_record()
end_sub

sub enregistrement_OPT()
  define_record(3)
  add_integer_field(adr(OPT_base%))
  add_string_field(adr(OPT_bidon1$),38)
  add_word_field(adr(OPT_DLL%))
  add_string_field(adr(OPT_bidon2$),24)
  build_record()
end_sub

sub enregistrement_DDIR()
  define_record(32)
  add_integer_field(adr(DDIR_EXP_adress%))
  add_integer_field(adr(DDIR_EXP_size%))
  add_integer_field(adr(DDIR_1a%))
  add_integer_field(adr(DDIR_1s%))
  add_integer_field(adr(DDIR_2a%))
  add_integer_field(adr(DDIR_2s%))
  add_integer_field(adr(DDIR_3a%))
  add_integer_field(adr(DDIR_3s%))
  add_integer_field(adr(DDIR_4a%))
  add_integer_field(adr(DDIR_4s%))
  add_integer_field(adr(DDIR_5a%))
  add_integer_field(adr(DDIR_5s%))
  add_integer_field(adr(DDIR_6a%))
  add_integer_field(adr(DDIR_6s%))
  add_integer_field(adr(DDIR_7a%))
  add_integer_field(adr(DDIR_7s%))
  add_integer_field(adr(DDIR_8a%))
  add_integer_field(adr(DDIR_8s%))
  add_integer_field(adr(DDIR_9a%))
  add_integer_field(adr(DDIR_9s%))
  add_integer_field(adr(DDIR_10a%))
  add_integer_field(adr(DDIR_10s%))
  add_integer_field(adr(DDIR_11a%))
  add_integer_field(adr(DDIR_11s%))
  add_integer_field(adr(DDIR_12a%))
  add_integer_field(adr(DDIR_12s%))
  add_integer_field(adr(DDIR_13a%))
  add_integer_field(adr(DDIR_13s%))
  add_integer_field(adr(DDIR_14a%))
  add_integer_field(adr(DDIR_14s%))
  add_integer_field(adr(DDIR_15a%))
  add_integer_field(adr(DDIR_15s%))
'  add_string_field(adr(DDIR_bidon$),120)
  build_record()
end_sub

sub enregistrement_SECT()
  define_record(10)
  add_string_field(adr(SECT_name$),8)
  add_integer_field(adr(SECT_vs%))
  add_integer_field(adr(SECT_va%))
  add_integer_field(adr(SECT_srd%))
  add_integer_field(adr(SECT_prd%))
  add_integer_field(adr(SECT_prel%))
  add_integer_field(adr(SECT_lin%))
  add_word_field(adr(SECT_nrel%))
  add_word_field(adr(SECT_nlin%))
  add_integer_field(adr(SECT_char%))
  build_record()
end_sub

sub enregistrement_EPD()
  define_record(11)
  add_integer_field(adr(EPD_flags%))
  add_integer_field(adr(EPD_date%))
  add_word_field(adr(EPD_major%))
  add_word_field(adr(EPD_minor%))
  add_integer_field(adr(EPD_na%))
  add_integer_field(adr(EPD_ob%))
  add_integer_field(adr(EPD_ate%))
  add_integer_field(adr(EPD_nnp%))
  add_integer_field(adr(EPD_ata%))
  add_integer_field(adr(EPD_npa%))
  add_integer_field(adr(EPD_ota%))
  build_record()
end_sub

sub enregistrement_NPT()
  define_record(1)
  add_integer_field(adr(NPT_adr%))
  build_record()
end_sub


#INCLUDE "KGF_SUB.bas"

Je pense que des fonctionnalités de ce genre (lecture/écriture de fichiers binaires, la notion d'enregistrements etc) pourraient avoir une place dans les fonctionnalités de Panoramic.

Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Severin




Nombre de messages : 547
Localisation : Braunschweig / Germany
Date d'inscription : 13/12/2010

2.04 du 10 Mars 2013 - correction d'un bug Empty
MessageSujet: Re: 2.04 du 10 Mars 2013 - correction d'un bug   2.04 du 10 Mars 2013 - correction d'un bug EmptyLun 11 Mar 2013 - 21:50

Hallo Klaus,

ich würde gern einige Funktionen von deiner super DLL verwenden.
Leider komme ich mit dem Übersetzen nicht nach. Leider.
Du bist zu schnell.

Aber gute Arbeit.
Revenir en haut Aller en bas
Klaus

Klaus


Nombre de messages : 12301
Age : 75
Localisation : Ile de France
Date d'inscription : 29/12/2009

2.04 du 10 Mars 2013 - correction d'un bug Empty
MessageSujet: Re: 2.04 du 10 Mars 2013 - correction d'un bug   2.04 du 10 Mars 2013 - correction d'un bug EmptyMar 12 Mar 2013 - 8:28

Si l'on applique ce programme d'analyse à KGF.dll, on voit que cette DLL exporte actuellement 259 fonctions !

Pour pouvoir le faire, il faut copier KGF.dll sous un autre nom quelconque (control/C puis control/V suffit) et ouvrir la copie pour analyse.

Mes projets dans les prochains jours: reprendre les fonctions d'accès aux fichiers binaires et les "blinder" un peu plus contre des erreurs d'utilisation, en interceptant les anomalies et en vérifiant systématiquement tous les paramètres en amont.
Revenir en haut Aller en bas
http://klauspanoramic.comxa.com/index.html
Contenu sponsorisé





2.04 du 10 Mars 2013 - correction d'un bug Empty
MessageSujet: Re: 2.04 du 10 Mars 2013 - correction d'un bug   2.04 du 10 Mars 2013 - correction d'un bug Empty

Revenir en haut Aller en bas
 
2.04 du 10 Mars 2013 - correction d'un bug
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» V2.63 du 02/12/2013 - correction bug dans AddButtonToToolbar
» 2.20 du 26 avril 2013: correction de SerachStringList
» V2.48 du 9 Novembre 2013 - correction d'un bug
» V2.64 du 03/12/2013: correction bug dans AddButtonToToolbar
» 2.21 du 26 avril 2013: correction de SerachStringList

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: Activité des sites créés par les Panoramiciens. :: Le site de Klaus-
Sauter vers: