LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::PE::ResourceDialogExtended Class Reference

Implementation for the new extended dialogbox format. More...

#include <ResourceDialogExtended.hpp>

Inheritance diagram for LIEF::PE::ResourceDialogExtended:
Collaboration diagram for LIEF::PE::ResourceDialogExtended:

Classes

struct  font_t
 Font information for the font to use for the text in the dialog box and its controls. More...
 
class  Item
 This class represents a DLGTEMPLATEEX item (DLGITEMTEMPLATEEX). More...
 

Public Types

using items_t = std::vector<Item>
 
using it_items = ref_iterator<items_t&>
 
using it_const_items = const_ref_iterator<const items_t&>
 
- Public Types inherited from LIEF::PE::ResourceDialog
enum class  TYPE { UNKNOWN = 0 , REGULAR , EXTENDED }
 Enum for discriminating the kind of the Dialog (regular vs extended) More...
 
enum class  DIALOG_STYLES : uint32_t {
  ABSALIGN = 0x0001 , SYSMODAL = 0x0002 , LOCALEDIT = 0x0020 , SETFONT = 0x0040 ,
  MODALFRAME = 0x0080 , NOIDLEMSG = 0x0100 , SETFOREGROUND = 0x0200 , S3DLOOK = 0x0004 ,
  FIXEDSYS = 0x0008 , NOFAILCREATE = 0x0010 , CONTROL = 0x0400 , CENTER = 0x0800 ,
  CENTERMOUSE = 0x1000 , CONTEXTHELP = 0x2000 , SHELLFONT = SETFONT | FIXEDSYS
}
 From: https://learn.microsoft.com/en-us/windows/win32/dlgbox/dialog-box-styles. More...
 
enum class  WINDOW_STYLES : uint32_t {
  OVERLAPPED = 0x00000000 , POPUP = 0x80000000 , CHILD = 0x40000000 , MINIMIZE = 0x20000000 ,
  VISIBLE = 0x10000000 , DISABLED = 0x08000000 , CLIPSIBLINGS = 0x04000000 , CLIPCHILDREN = 0x02000000 ,
  MAXIMIZE = 0x01000000 , CAPTION = 0x00C00000 , BORDER = 0x00800000 , DLGFRAME = 0x00400000 ,
  VSCROLL = 0x00200000 , HSCROLL = 0x00100000 , SYSMENU = 0x00080000 , THICKFRAME = 0x00040000 ,
  GROUP = 0x00020000 , TABSTOP = 0x00010000
}
 From: https://docs.microsoft.com/en-us/windows/win32/winmsg/window-styles. More...
 
enum class  WINDOW_EXTENDED_STYLES : uint32_t {
  DLGMODALFRAME = 0x00000001 , NOPARENTNOTIFY = 0x00000004 , TOPMOST = 0x00000008 , ACCEPTFILES = 0x00000010 ,
  TRANSPARENT_STY = 0x00000020 , MDICHILD = 0x00000040 , TOOLWINDOW = 0x00000080 , WINDOWEDGE = 0x00000100 ,
  CLIENTEDGE = 0x00000200 , CONTEXTHELP = 0x00000400 , RIGHT = 0x00001000 , LEFT = 0x00000000 ,
  RTLREADING = 0x00002000 , LEFTSCROLLBAR = 0x00004000 , CONTROLPARENT = 0x00010000 , STATICEDGE = 0x00020000 ,
  APPWINDOW = 0x00040000
}
 From https://docs.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles. More...
 
enum class  CONTROL_STYLES : uint32_t {
  TOP = 0x00000001 , NOMOVEY = 0x00000002 , BOTTOM = 0x00000003 , NORESIZE = 0x00000004 ,
  NOPARENTALIGN = 0x00000008 , ADJUSTABLE = 0x00000020 , NODIVIDER = 0x00000040 , VERT = 0x00000080 ,
  LEFT = VERT | TOP , RIGHT = VERT | BOTTOM , NOMOVEX = VERT | NOMOVEY
}
 From: https://learn.microsoft.com/en-us/windows/win32/controls/common-control-styles. More...
 
using dialogs_t = std::vector<std::unique_ptr<ResourceDialog>>
 
- Public Types inherited from LIEF::Object
template<class T >
using output_t = add_pointer_t<decay_t<T>>
 
template<class T >
using output_const_t = add_pointer_t<add_const_t<decay_t<T>>>
 

Public Member Functions

 ResourceDialogExtended ()
 
 ResourceDialogExtended (const ResourceDialogExtended &)=default
 
ResourceDialogExtendedoperator= (const ResourceDialogExtended &)=default
 
 ResourceDialogExtended (ResourceDialogExtended &&)=default
 
ResourceDialogExtendedoperator= (ResourceDialogExtended &&)=default
 
std::unique_ptr< ResourceDialogclone () const override
 
void accept (Visitor &visitor) const override
 
std::string to_string () const override
 
 ~ResourceDialogExtended () override=default
 
uint16_t version () const
 The version number of the extended dialog box template. This member must be set to 1.
 
uint16_t signature () const
 Indicates whether a template is an extended dialog box template. If signature is 0xFFFF, this is an extended dialog box template. In this case, the dlgVer member specifies the template version number.
 
uint32_t help_id () const
 The help context identifier for the dialog box window. When the system sends a WM_HELP message, it passes the helpID value in the dwContextId member of the HELPINFO structure.
 
it_items items ()
 Iterator over the control items of this dialog box.
 
it_const_items items () const
 
void add_item (const Item &item)
 Add a new control item to the dialog.
 
ResourceDialogExtendedversion (uint16_t value)
 
ResourceDialogExtendedsignature (uint16_t value)
 
ResourceDialogExtendedhelp_id (uint32_t value)
 
const font_tfont () const
 Additional font information.
 
ResourceDialogExtendedfont (uint16_t point_size, uint16_t weight, bool italic, uint8_t charset, std::u16string typeface)
 
ResourceDialogExtendedfont (font_t f)
 
- Public Member Functions inherited from LIEF::PE::ResourceDialog
 ResourceDialog ()=default
 
 ResourceDialog (const ResourceDialog &)=default
 
ResourceDialogoperator= (const ResourceDialog &)=default
 
 ResourceDialog (ResourceDialog &&)=default
 
ResourceDialogoperator= (ResourceDialog &&)=default
 
 ResourceDialog (TYPE ty)
 
TYPE type () const
 
uint32_t style () const
 The style of the dialog box. This member can be a combination of window style values (such as WINDOW_STYLES::CAPTION and WINDOW_STYLES::SYSMENU) and dialog box style values (such as DIALOG_STYLES::CENTER).
 
uint32_t extended_style () const
 The extended styles for a window. This member is not used to create dialog boxes, but applications that use dialog box templates can use it to create other types of windows. For a list of values, see WINDOW_EXTENDED_STYLES.
 
int16_t x () const
 The x-coordinate, in dialog box units, of the upper-left corner of the dialog box.
 
int16_t y () const
 The y-coordinate, in dialog box units, of the upper-left corner of the dialog box.
 
int16_t cx () const
 The width, in dialog box units, of the dialog box.
 
int16_t cy () const
 The height, in dialog box units, of the dialog box.
 
ResourceDialogstyle (uint32_t value)
 
ResourceDialogextended_style (uint32_t value)
 
ResourceDialogx (int16_t value)
 
ResourceDialogy (int16_t value)
 
ResourceDialogcx (int16_t value)
 
ResourceDialogcy (int16_t value)
 
ResourceDialogmenu (std::u16string title)
 
ResourceDialogmenu (uint16_t ord)
 
ResourceDialogwindow_class (std::u16string title)
 
ResourceDialogwindow_class (uint16_t ord)
 
ResourceDialogtitle (std::u16string value)
 
ResourceDialogtitle (const std::string &title)
 
bool has (DIALOG_STYLES style) const
 Check if the dialog used to given dialog style.
 
bool has (WINDOW_STYLES style) const
 Check if the dialog used to given window style.
 
bool has (WINDOW_EXTENDED_STYLES style) const
 Check if the dialog used to given extended window style.
 
std::vector< DIALOG_STYLESstyles_list () const
 List of DIALOG_STYLES used by this dialog.
 
std::vector< WINDOW_STYLESwindows_styles_list () const
 List of WINDOW_STYLES used by this dialog.
 
std::vector< WINDOW_EXTENDED_STYLESwindows_ext_styles_list () const
 List of WINDOW_EXTENDED_STYLES used by this dialog.
 
const std::u16string & title () const
 title of the dialog box
 
std::string title_utf8 () const
 title of the dialog box
 
const ordinal_or_str_tmenu () const
 ordinal or name value of a menu resource.
 
const ordinal_or_str_twindow_class () const
 ordinal of a predefined system window class or name of a registered window class
 
virtual ~ResourceDialog ()=default
 
template<class T >
const Tas () const
 Helper to downcast a ResourceDialog into a ResourceDialogRegular or a ResourceDialogExtended.
 
- Public Member Functions inherited from LIEF::Object
 Object ()
 
 Object (const Object &other)
 
Objectoperator= (const Object &other)
 
template<class T >
output_t< T > as ()
 
template<class T >
output_const_t< T > as () const
 
virtual bool operator== (const Object &other) const
 
virtual bool operator!= (const Object &other) const
 
virtual ~Object ()
 

Static Public Member Functions

static std::unique_ptr< ResourceDialogExtendedcreate (BinaryStream &stream)
 
static bool classof (const ResourceDialog *dialog)
 
- Static Public Member Functions inherited from LIEF::PE::ResourceDialog
static dialogs_t parse (const ResourceData &node)
 Parse dialogs from the given resource data node.
 
static dialogs_t parse (const uint8_t *buffer, size_t size)
 

Detailed Description

Implementation for the new extended dialogbox format.

See: https://learn.microsoft.com/en-us/windows/win32/dlgbox/dlgtemplateex

Member Typedef Documentation

◆ it_const_items

◆ it_items

◆ items_t

Constructor & Destructor Documentation

◆ ResourceDialogExtended() [1/3]

LIEF::PE::ResourceDialogExtended::ResourceDialogExtended ( )
inline

◆ ResourceDialogExtended() [2/3]

LIEF::PE::ResourceDialogExtended::ResourceDialogExtended ( const ResourceDialogExtended & )
default

◆ ResourceDialogExtended() [3/3]

LIEF::PE::ResourceDialogExtended::ResourceDialogExtended ( ResourceDialogExtended && )
default

◆ ~ResourceDialogExtended()

LIEF::PE::ResourceDialogExtended::~ResourceDialogExtended ( )
overridedefault

Member Function Documentation

◆ accept()

void LIEF::PE::ResourceDialogExtended::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ add_item()

void LIEF::PE::ResourceDialogExtended::add_item ( const Item & item)
inline

Add a new control item to the dialog.

◆ classof()

static bool LIEF::PE::ResourceDialogExtended::classof ( const ResourceDialog * dialog)
inlinestatic

◆ clone()

std::unique_ptr< ResourceDialog > LIEF::PE::ResourceDialogExtended::clone ( ) const
inlineoverridevirtual

◆ create()

static std::unique_ptr< ResourceDialogExtended > LIEF::PE::ResourceDialogExtended::create ( BinaryStream & stream)
static

◆ font() [1/3]

const font_t & LIEF::PE::ResourceDialogExtended::font ( ) const
inline

Additional font information.

◆ font() [2/3]

ResourceDialogExtended & LIEF::PE::ResourceDialogExtended::font ( font_t f)
inline

◆ font() [3/3]

ResourceDialogExtended & LIEF::PE::ResourceDialogExtended::font ( uint16_t point_size,
uint16_t weight,
bool italic,
uint8_t charset,
std::u16string typeface )
inline

◆ help_id() [1/2]

uint32_t LIEF::PE::ResourceDialogExtended::help_id ( ) const
inline

The help context identifier for the dialog box window. When the system sends a WM_HELP message, it passes the helpID value in the dwContextId member of the HELPINFO structure.

◆ help_id() [2/2]

ResourceDialogExtended & LIEF::PE::ResourceDialogExtended::help_id ( uint32_t value)
inline

◆ items() [1/2]

it_items LIEF::PE::ResourceDialogExtended::items ( )
inline

Iterator over the control items of this dialog box.

◆ items() [2/2]

it_const_items LIEF::PE::ResourceDialogExtended::items ( ) const
inline

◆ operator=() [1/2]

ResourceDialogExtended & LIEF::PE::ResourceDialogExtended::operator= ( const ResourceDialogExtended & )
default

◆ operator=() [2/2]

ResourceDialogExtended & LIEF::PE::ResourceDialogExtended::operator= ( ResourceDialogExtended && )
default

◆ signature() [1/2]

uint16_t LIEF::PE::ResourceDialogExtended::signature ( ) const
inline

Indicates whether a template is an extended dialog box template. If signature is 0xFFFF, this is an extended dialog box template. In this case, the dlgVer member specifies the template version number.

◆ signature() [2/2]

ResourceDialogExtended & LIEF::PE::ResourceDialogExtended::signature ( uint16_t value)
inline

◆ to_string()

std::string LIEF::PE::ResourceDialogExtended::to_string ( ) const
overridevirtual

◆ version() [1/2]

uint16_t LIEF::PE::ResourceDialogExtended::version ( ) const
inline

The version number of the extended dialog box template. This member must be set to 1.

◆ version() [2/2]

ResourceDialogExtended & LIEF::PE::ResourceDialogExtended::version ( uint16_t value)
inline

The documentation for this class was generated from the following file: