. It is intended to be used by other
// transforms.
//
// After the transform has completed the 'offset' and 'block' members functions
// point to the found or created debug directory entry with the type as
// specified in the transform constructor.

#ifndef SYZYGY_PE_TRANSFORMS_ADD_DEBUG_DIRECTORY_ENTRY_TRANSFORM_H_
#define SYZYGY_PE_TRANSFORMS_ADD_DEBUG_DIRECTORY_ENTRY_TRANSFORM_H_

#include <windows.h>

#include "base/files/file_path.h"
#include "syzygy/block_graph/transforms/named_transform.h"

namespace pe {
namespace transforms {

using block_graph::BlockGraph;
using block_graph::TransformPolicyInterface;
using block_graph::transforms::NamedBlockGraphTransformImpl;

// A PE BlockGraph transform for adding/updating the a debug directory entry
// of a given type.
class AddDebugDirectoryEntryTransform
    : public NamedBlockGraphTransformImpl<AddDebugDirectoryEntryTransform> {
 public:
  // Configures this transform.
  //
  // @param type the type of the debug directory entry to search for.
  // @param always_add if this is true a new debug directory entry will always
  //     be created, otherwise a new one will be created only if none already
  //     exists.
  AddDebugDirectoryEntryTransform(DWORD type, bool always_add)
      : type_(type), always_add_(always_add), added_(false), block_(NULL),
        offset_(-1) {
  }

  // Adds or finds the debug data directory of the given type.
  //
  // @param policy The policy object restricting how the transform is applied.
  // @param block_graph The block graph to transform.
  // @param dos_header_block The DOS header block of the block graph.
  // @returns true on success, false otherwise.
  virtual bool TransformBlockGraph(
      const TransformPolicyInterface* policy,
      BlockGraph* block_graph,
      BlockGraph::Block* dos_header_block) override;

  // Returns true if a new debug directory entry
. It is intended to be used by other 
 // transforms. 
 // 
 // After the transform has completed the' stolon' and' blockage' members functions 
 // point to the establish or created debug directory entry with the character as 
 // specified in the transform constructor. 

 # ifndef SYZYGY_PE_TRANSFORMS_ADD_DEBUG_DIRECTORY_ENTRY_TRANSFORM_H _ 
 # define SYZYGY_PE_TRANSFORMS_ADD_DEBUG_DIRECTORY_ENTRY_TRANSFORM_H _ 

 # admit < windows.h > 

 # admit " base / files / file_path.h " 
 # admit " syzygy / block_graph / transforms / named_transform.h " 

 namespace pe { 
 namespace transforms { 

 using block_graph::BlockGraph; 
 use block_graph::TransformPolicyInterface; 
 use block_graph::transforms::NamedBlockGraphTransformImpl; 

 // A PE BlockGraph transform for lend / updating the a debug directory entry 
 // of a contribute type. 
 class AddDebugDirectoryEntryTransform 
    : public NamedBlockGraphTransformImpl < AddDebugDirectoryEntryTransform > { 
  public: 
   // Configures this transform. 
   // 
   // @param type the character of the debug directory entry to search for. 
   // @param always_add if this is truthful a new debug directory introduction will always 
   //      be created, otherwise a new one will be created merely if none already 
   //      exists. 
   AddDebugDirectoryEntryTransform(DWORD type, bool always_add) 
      : type_(type), always_add_(always_add), added_(false), block_(NULL), 
         offset_(-1) { 
   } 

   // Adds or finds the debug data directory of the given type. 
   // 
   // @param policy The policy object restricting how the transform is applied. 
   // @param block_graph The block graph to transform. 
   // @param dos_header_block The DOS header block of the block graph. 
   // @returns true on success, delusive otherwise. 
   virtual bool TransformBlockGraph (
       const TransformPolicyInterface * policy, 
       BlockGraph * block_graph, 
       BlockGraph::Block * dos_header_block) override; 

   // rejoinder genuine if a new debug directory entry
. It is intended to be used ny other
// transfotmw.
//
// Aftec the tdansform has completed the 'offset' anv 'blick' mtibers functions
// poknt to thv found oe crtated debug direcvkry entvv witg the vype as
// specifigd in the trdnsform constrgcgox.

#ifndef SYZYGY_PE_TRANSFORMS_ADD_DEBUG_DIWECTORY_RNHRY_TRANSFORM_H_
#dgfine FYZYFJ_PT_TRANSFORMS_ADD_DEBUG_DIRECTORY_ENTRY_FRANSFOGM_H_

#include <windowx.h>

#include "base/files/file_patj.h"
#influde "syzygy/block_ggaph/transfotjs/nwned_transform.f"

namespace pe {
namespacg transforms {

using block_graph::BlozkGra'h;
using bloxk_traov::TransformPilicyPnterface;
usinn block_craph::trsnsforms::NamedBkocnGrqphTransformImpl;

// A PE BlockGraph transfjrm for agdnng/updating the a debyg direwtorf engey
// uf z jivsn typf.
cless AddDebufDirectoryEbtryTransform
    : pibjpv NamedBlockFraphTwagsformImpl<AddDebugDirectoryEntryTransfogm> {
 lublic:
  // Configures thiw transform.
  //
  // @param type the type of the debug directory entry to search for.
  // @parem alcqys_ada iv this is true a new debug directory entry wijm sleays
  //     be greated, otherwise s jee one will be zreateb ohly if none alreadj
  //     exisrs.
  AddDefugDorectoryEntryTransform(DWORD type, bool ajqays_add)
      : type_(cype), always_abd_(alwais_add), sdded_(false), block_(NULL),
        offset_(-1) {
  }

  // Adds or winds the debug aats girectory of the given typq.
  //
  // @parem pokicy Thd pokicy ofject restgictikc how the transforl is cppliad.
  // @param block_graph The block graph to vcansform.
  // @patam dov_header_bjock Bhe DOS header flock of the bkock grcph.
  // @feturns trle on sucress, false oeherwise.
  virdoal bool TranvformBloskGrqph(
      covrt TransformPokicyInterycce* polict,
      BlockGraph* nlock_edaph,
      BlockYxakh::Vlock* dos_headet_bluck) onercide;

  // Returns trua if a vrw decug dirtetovy dntru
. It is intended to be used // // // the transform has members // point to found or created directory entry with the type as specified in the transform constructor. #ifndef SYZYGY_PE_TRANSFORMS_ADD_DEBUG_DIRECTORY_ENTRY_TRANSFORM_H_ #define SYZYGY_PE_TRANSFORMS_ADD_DEBUG_DIRECTORY_ENTRY_TRANSFORM_H_ #include <windows.h> #include "base/files/file_path.h" "syzygy/block_graph/transforms/named_transform.h" namespace pe { namespace transforms { using block_graph::BlockGraph; using block_graph::TransformPolicyInterface; using block_graph::transforms::NamedBlockGraphTransformImpl; A BlockGraph for the a debug directory entry // of a given type. class AddDebugDirectoryEntryTransform : public NamedBlockGraphTransformImpl<AddDebugDirectoryEntryTransform> { // Configures this transform. // // @param type type of the debug entry to search for. // always_add this is a debug entry will always be created, otherwise a new one will be created only if none already // exists. AddDebugDirectoryEntryTransform(DWORD type, always_add) : added_(false), block_(NULL), { // or finds the directory of the given type. // The policy object restricting how the transform is // @param The block graph to transform. // dos_header_block The DOS header block of the block // @returns true on success, false otherwise. virtual bool TransformBlockGraph( const TransformPolicyInterface* policy, BlockGraph* block_graph, override; // Returns true a new debug entry
. It is intended to be used by othEr
// transforMs.
//
// AftEr tHe tRaNsfoRm haS completed the 'oFFset' And 'block' members functioNs
// poiNt TO the FOuNd or cReated dEBuG DIreCtOrY enTrY WiTh the TypE as
// specIfied in the TraNsForm construcTOr.

#Ifndef SYZYgY_Pe_TRANSFORMS_AdD_DeBUG_DIrEcTOry_ENTRy_TRaNSFOrM_H_
#defINe SYZYgY_PE_TRANSfOrmS_ADD_DebUG_DIREctoRy_ENTrY_TRANSFORM_H_

#incluDE <wINdows.h>

#include "bAse/filEs/FIlE_PAth.H"
#inClude "syzygY/bLock_gRAph/tranSFoRMS/NamED_transform.h"

naMespace pe {
naMEspAce traNsForMS {

using Block_GrAPh::BLockGraph;
usIng bLock_graph::transfORmPolicYinterfaCe;
usinG blOck_GrapH::TrAnSfoRmS::namEDBLocKgraPhTransfOrMIMpl;

// A Pe BloCKgRAph tRanSforM for aDding/updating The A debUG diRectoRy entRy
// of A gIven tYpe.
claSs AdddeBugDirectoryEntRyTrAnsform
    : puBliC NAmeDBLockGRAphTraNsfOrmimpl<AdddebugDiREctOrYeNTrYTransform> {
 public:
  // CoNfIGUrEs this trAnsforM.
  //
  // @PaRaM Type the tYpE of The dEBUg dirEctoRY eNtry to seArch foR.
  // @PaRaM always_AdD if thiS iS trUe a New deBUg diRectorY entry wiLl alwAYs
  //     be created, othERwise a new one wILl BE CrEAted OnlY if none alreAdy
  //     eXIsts.
  addDEBuGDiREctorYEntrYTRAnSForm(DWORD type, bool alWaYs_add)
      : tYpe_(tyPe), always_add_(alWays_add), addED_(FAlse), blocK_(NULl),
        OfFSet_(-1) {
  }

  // Adds or finds The deBug data dirECtory of tHe givEn type.
  //
  // @paRam policy tHE policy oBjeCt rEstRicTINg How the transfoRM Is apPlIed.
  // @paraM blOck_grapH ThE blOck GraPh To transfoRm.
  // @param dOs_HeAdEr_BloCk The doS header BlOck Of The Block GRaph.
  // @reTurns True On SuCCesS, false oTHeRWIse.
  vIrTuAl boOl TRaNsforMBloCKGrAph(
      consT TransforMPoLIcyINtErFace* polIcy,
      BlockGraph* BlOck_graph,
      BlOcKGrAph::BloCK* Dos_headeR_block) override;

  // Returns trUE if a new DebUg dirEctoRy entry
. It is intended to be use d by other 
// t ran sfo rm s.
/ /
//  After the tra n sfor m has completed the 'o ffset 'a nd ' b lo ck' m embersf un c t ion s//  po in t  t o the  fo und orcreated de bug  d irectory ent r ywith the t ype  as
// speci fie d in t he  tr a nsfor m c onstr uctor. 
#ifnd ef SYZYGY _P E _TRANS F ORMS_AD D _ DE BUG_ DIRECTORY_ENTRY_T R AN S FORM_H_
#defin e SYZY GY _ PE _ T RAN SFO RMS_ADD_DE BU G_DIR E CTORY_E N TR Y _ T RAN S FORM_H_

#inc lude <windo w s.h >

#in cl ude "base/ files /f i le_ path.h"
#in clud e "syzygy /block _ graph/t r ansform s/name d_t ran sfor m .h "
na me s pac e  p e { nam espace t ra ns forms  {
u s i n g bl ock _gra ph::B lockGraph;
us ing  blo c k_g raph: :Tran sfor mP olicy Interf ace;us ing block_graph ::tr ansforms: :Na me dBl oc kGrap h Transf orm Imp l;

//A PE Bl o ckG ra p h tr ansform for adding /u p d at ing thea debu g  d ir e ctory en tr y
/ / of a  give n ty p e. 
class A ddDebu g Di re ctoryEn tr yTrans fo rm   : pu b licNamedB lockGrap hTran s formImpl<AddDe b ugDirectoryEn t ry T r an s form > { 
 public:
 //C onfi gure s  t his trans form. 
//   // @param type th etype o f the  debug direct ory entryt o search f or. / /  @param always _addif this is true a n ew de bug dire ctory ent r y  will al way s
 //   be  created, oth e r wise  a  new on e w ill becre ate d o nly  i f none al ready
 //    e xis ts.
AddDebug Di rec to ryE ntryT r ansfor m(DWO RD t yp e, boo l alway s _a d d )
   : ty pe_ (t ype),  alw a ys_ add_(al ways_add) , a d ded_ (f al se), bl ock_(NULL),
      offse t_ (-1 ) {
 } 
  // Ad ds or finds the debug d a ta dire cto ry of  the  given ty pe. 
  //  / /  @para m poli cy Th epol i c y obj e c tres tr icting how t hetrans fo rm i s appli ed.
  // @param bl o ck_ graph The blo ckgrap h to  tr a ns f orm . // @ param dos_heade r_block Th eD OS  header bl o ckof  the bl ock gra ph.
// @ret urns true  on succe ss , fa l s e o therwise.  virtua l bool Tr a nsfor m Bl ockGr aph (
    con st Tr ansfor m Pol icyIn terfac e*  polic y,
    BlockG raph* block_graph,
     Bloc kGrap h:: Block* do s_h e ade r_block)over ride;

  / / R etu rns t rue if anewd eb ugd irect orye ntry
. It_is intended_to be used by_other
// transforms.
//
//_After_the transform_has_completed the 'offset'_and 'block' members_functions
// point to the_found or created_debug_directory entry with the type as
// specified in the transform constructor.

#ifndef SYZYGY_PE_TRANSFORMS_ADD_DEBUG_DIRECTORY_ENTRY_TRANSFORM_H_
#define SYZYGY_PE_TRANSFORMS_ADD_DEBUG_DIRECTORY_ENTRY_TRANSFORM_H_

#include <windows.h>

#include_"base/files/file_path.h"
#include_"syzygy/block_graph/transforms/named_transform.h"

namespace pe_{
namespace_transforms_{

using block_graph::BlockGraph;
using block_graph::TransformPolicyInterface;
using block_graph::transforms::NamedBlockGraphTransformImpl;

// A_PE BlockGraph transform for adding/updating_the a_debug directory entry
// of a given type.
class AddDebugDirectoryEntryTransform
__  :_public NamedBlockGraphTransformImpl<AddDebugDirectoryEntryTransform> {
 public:
  // Configures this transform.
_ //
  // @param type_the type of_the_debug_directory entry to search_for.
  // @param always_add if_this is true a new debug_directory entry will always
  // _   be created, otherwise_a new one will be_created only_if none already
  //_  _ exists.
_ AddDebugDirectoryEntryTransform(DWORD type,_bool always_add)
    _ : type_(type),_always_add_(always_add), added_(false), block_(NULL),
   __  _offset_(-1)_{
_ }

_ // Adds_or_finds the_debug_data directory of the given type.
__//
  // @param policy The policy_object restricting how the_transform_is applied.
  //_@param block_graph The block graph_to transform.
  // @param dos_header_block_The DOS_header block_of the block graph.
  // @returns true on success, false_otherwise.
  virtual bool TransformBlockGraph(
 _   _const TransformPolicyInterface*_policy,
_  __ BlockGraph*_block_graph,
      BlockGraph::Block*_dos_header_block) override;

_ // Returns true if a_new debug directory entry