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

This class is the base class for either a regular (legacy) Dialog or an extended Dialog. These different kinds of Dialogs are documented by MS at the following addresses: More...

#include <ResourceDialog.hpp>

Inheritance diagram for LIEF::PE::ResourceDialog:
Collaboration diagram for LIEF::PE::ResourceDialog:

Classes

struct  ordinal_or_str_t
 This structure wraps either an ordinal value (uint16_t) or a string. The ordinal value should refer to an existing resource id in the resource tree. More...
class  Item
 This class represents an element of the dialog. It can be for instance, a button, or a caption. More...

Public Types

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

 ResourceDialog ()=default
 ResourceDialog (const ResourceDialog &)=default
ResourceDialogoperator= (const ResourceDialog &)=default
 ResourceDialog (ResourceDialog &&)=default
ResourceDialogoperator= (ResourceDialog &&)=default
 ResourceDialog (TYPE ty)
virtual std::unique_ptr< ResourceDialogclone () const =0
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 std::string to_string () const =0
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)
 Object (Object &&other) noexcept=default
Objectoperator= (Object &&other) noexcept=default
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 ()
virtual void accept (Visitor &visitor) const =0

Static Public Member Functions

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

This class is the base class for either a regular (legacy) Dialog or an extended Dialog. These different kinds of Dialogs are documented by MS at the following addresses:

Member Typedef Documentation

◆ dialogs_t

using LIEF::PE::ResourceDialog::dialogs_t = std::vector<std::unique_ptr<ResourceDialog>>

Member Enumeration Documentation

◆ CONTROL_STYLES

enum class LIEF::PE::ResourceDialog::CONTROL_STYLES : uint32_t
strong

From: https://learn.microsoft.com/en-us/windows/win32/controls/common-control-styles.

Enumerator
TOP 
NOMOVEY 
BOTTOM 
NORESIZE 
NOPARENTALIGN 
ADJUSTABLE 
NODIVIDER 
VERT 
LEFT 
RIGHT 
NOMOVEX 

◆ DIALOG_STYLES

enum class LIEF::PE::ResourceDialog::DIALOG_STYLES : uint32_t
strong

From: https://learn.microsoft.com/en-us/windows/win32/dlgbox/dialog-box-styles.

Enumerator
ABSALIGN 
SYSMODAL 
LOCALEDIT 
SETFONT 
MODALFRAME 
NOIDLEMSG 
SETFOREGROUND 
S3DLOOK 
FIXEDSYS 
NOFAILCREATE 
CONTROL 
CENTER 
CENTERMOUSE 
CONTEXTHELP 
SHELLFONT 

◆ TYPE

enum class LIEF::PE::ResourceDialog::TYPE
strong

Enum for discriminating the kind of the Dialog (regular vs extended).

Enumerator
UNKNOWN 
REGULAR 
EXTENDED 

◆ WINDOW_EXTENDED_STYLES

From https://docs.microsoft.com/en-us/windows/win32/winmsg/extended-window-styles.

Enumerator
DLGMODALFRAME 
NOPARENTNOTIFY 
TOPMOST 
ACCEPTFILES 
TRANSPARENT_STY 
MDICHILD 
TOOLWINDOW 
WINDOWEDGE 
CLIENTEDGE 
CONTEXTHELP 
RIGHT 
LEFT 
RTLREADING 
LEFTSCROLLBAR 
CONTROLPARENT 
STATICEDGE 
APPWINDOW 

◆ WINDOW_STYLES

enum class LIEF::PE::ResourceDialog::WINDOW_STYLES : uint32_t
strong

From: https://docs.microsoft.com/en-us/windows/win32/winmsg/window-styles.

Enumerator
OVERLAPPED 
POPUP 
CHILD 
MINIMIZE 
VISIBLE 
DISABLED 
CLIPSIBLINGS 
CLIPCHILDREN 
MAXIMIZE 
CAPTION 
BORDER 
DLGFRAME 
VSCROLL 
HSCROLL 
SYSMENU 
THICKFRAME 
GROUP 
TABSTOP 

Constructor & Destructor Documentation

◆ ResourceDialog() [1/4]

◆ ResourceDialog() [2/4]

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

References ResourceDialog().

◆ ResourceDialog() [3/4]

LIEF::PE::ResourceDialog::ResourceDialog ( ResourceDialog && )
default

References ResourceDialog().

◆ ResourceDialog() [4/4]

LIEF::PE::ResourceDialog::ResourceDialog ( TYPE ty)
inline

◆ ~ResourceDialog()

virtual LIEF::PE::ResourceDialog::~ResourceDialog ( )
virtualdefault

Member Function Documentation

◆ as()

template<class T>
const T * LIEF::PE::ResourceDialog::as ( ) const
inline

Helper to downcast a ResourceDialog into a ResourceDialogRegular or a ResourceDialogExtended.

References LIEF::PE::T.

◆ clone()

virtual std::unique_ptr< ResourceDialog > LIEF::PE::ResourceDialog::clone ( ) const
pure virtual

◆ cx() [1/2]

int16_t LIEF::PE::ResourceDialog::cx ( ) const
inline

The width, in dialog box units, of the dialog box.

◆ cx() [2/2]

ResourceDialog & LIEF::PE::ResourceDialog::cx ( int16_t value)
inline

References ResourceDialog().

◆ cy() [1/2]

int16_t LIEF::PE::ResourceDialog::cy ( ) const
inline

The height, in dialog box units, of the dialog box.

◆ cy() [2/2]

ResourceDialog & LIEF::PE::ResourceDialog::cy ( int16_t value)
inline

References ResourceDialog().

◆ extended_style() [1/2]

uint32_t LIEF::PE::ResourceDialog::extended_style ( ) const
inline

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.

◆ extended_style() [2/2]

ResourceDialog & LIEF::PE::ResourceDialog::extended_style ( uint32_t value)
inline

References ResourceDialog().

◆ has() [1/3]

bool LIEF::PE::ResourceDialog::has ( DIALOG_STYLES style) const
inline

Check if the dialog used to given dialog style.

References style().

◆ has() [2/3]

bool LIEF::PE::ResourceDialog::has ( WINDOW_EXTENDED_STYLES style) const
inline

Check if the dialog used to given extended window style.

References style().

◆ has() [3/3]

bool LIEF::PE::ResourceDialog::has ( WINDOW_STYLES style) const
inline

Check if the dialog used to given window style.

References style().

◆ menu() [1/3]

const ordinal_or_str_t & LIEF::PE::ResourceDialog::menu ( ) const
inline

ordinal or name value of a menu resource.

◆ menu() [2/3]

ResourceDialog & LIEF::PE::ResourceDialog::menu ( std::u16string title)
inline

◆ menu() [3/3]

ResourceDialog & LIEF::PE::ResourceDialog::menu ( uint16_t ord)
inline

References ResourceDialog().

◆ operator=() [1/2]

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

References ResourceDialog().

◆ operator=() [2/2]

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

References ResourceDialog().

◆ parse() [1/2]

dialogs_t LIEF::PE::ResourceDialog::parse ( const ResourceData & node)
static

Parse dialogs from the given resource data node.

◆ parse() [2/2]

dialogs_t LIEF::PE::ResourceDialog::parse ( const uint8_t * buffer,
size_t size )
static

◆ style() [1/2]

uint32_t LIEF::PE::ResourceDialog::style ( ) const
inline

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).

Referenced by has(), has(), and has().

◆ style() [2/2]

ResourceDialog & LIEF::PE::ResourceDialog::style ( uint32_t value)
inline

References ResourceDialog().

◆ styles_list()

std::vector< DIALOG_STYLES > LIEF::PE::ResourceDialog::styles_list ( ) const

List of DIALOG_STYLES used by this dialog.

◆ title() [1/3]

const std::u16string & LIEF::PE::ResourceDialog::title ( ) const
inline

title of the dialog box

◆ title() [2/3]

ResourceDialog & LIEF::PE::ResourceDialog::title ( const std::string & title)

References ResourceDialog(), and title().

◆ title() [3/3]

ResourceDialog & LIEF::PE::ResourceDialog::title ( std::u16string value)
inline

References ResourceDialog().

Referenced by menu(), title(), and window_class().

◆ title_utf8()

std::string LIEF::PE::ResourceDialog::title_utf8 ( ) const

title of the dialog box

◆ to_string()

virtual std::string LIEF::PE::ResourceDialog::to_string ( ) const
pure virtual

◆ type()

TYPE LIEF::PE::ResourceDialog::type ( ) const
inline

◆ window_class() [1/3]

const ordinal_or_str_t & LIEF::PE::ResourceDialog::window_class ( ) const
inline

ordinal of a predefined system window class or name of a registered window class

◆ window_class() [2/3]

ResourceDialog & LIEF::PE::ResourceDialog::window_class ( std::u16string title)
inline

◆ window_class() [3/3]

ResourceDialog & LIEF::PE::ResourceDialog::window_class ( uint16_t ord)
inline

References ResourceDialog().

◆ windows_ext_styles_list()

std::vector< WINDOW_EXTENDED_STYLES > LIEF::PE::ResourceDialog::windows_ext_styles_list ( ) const

List of WINDOW_EXTENDED_STYLES used by this dialog.

◆ windows_styles_list()

std::vector< WINDOW_STYLES > LIEF::PE::ResourceDialog::windows_styles_list ( ) const

List of WINDOW_STYLES used by this dialog.

◆ x() [1/2]

int16_t LIEF::PE::ResourceDialog::x ( ) const
inline

The x-coordinate, in dialog box units, of the upper-left corner of the dialog box.

◆ x() [2/2]

ResourceDialog & LIEF::PE::ResourceDialog::x ( int16_t value)
inline

References ResourceDialog().

◆ y() [1/2]

int16_t LIEF::PE::ResourceDialog::y ( ) const
inline

The y-coordinate, in dialog box units, of the upper-left corner of the dialog box.

◆ y() [2/2]

ResourceDialog & LIEF::PE::ResourceDialog::y ( int16_t value)
inline

References ResourceDialog().


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