ROSE 0.11.145.192
Public Attributes | List of all members
Rose::BinaryAnalysis::Partitioner2::LoaderSettings Struct Reference

Description

Settings for loading specimens.

The runtime descriptions and command-line parser for these switches can be obtained from Engine::settings.

Definition at line 194 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

#include <Rose/BinaryAnalysis/Partitioner2/BasicTypes.h>

Collaboration diagram for Rose::BinaryAnalysis::Partitioner2::LoaderSettings:
Collaboration graph
[legend]

Public Attributes

MemoryDataAdjustment memoryDataAdjustment = DATA_IS_INITIALIZED
 How to globally adjust memory segment access bits for data areas.
 
bool memoryIsExecutable = false
 Whether all of memory should be made executable.
 
bool linkObjectFiles = true
 Whether to link object files before parsing.
 
bool linkStaticArchives = true
 Whether to link library archives before parsing.
 
std::string linker = "ld -o %o --unresolved-symbols=ignore-all --whole-archive %f"
 Linker command.
 
std::vector< std::string > envEraseNames
 Names to erase from the environment.
 
std::vector< boost::regex > envErasePatterns
 Patterns to erase from the environment.
 
std::vector< std::string > envInsert
 Environment variables to insert.
 
size_t deExecuteZerosThreshold = 0
 When to remove execute permission from zero bytes.
 
size_t deExecuteZerosLeaveAtFront = 16
 When to remove execute permission from zero bytes.
 
size_t deExecuteZerosLeaveAtBack = 1
 When to remove execute permission from zero bytes.
 

Member Data Documentation

◆ deExecuteZerosThreshold

size_t Rose::BinaryAnalysis::Partitioner2::LoaderSettings::deExecuteZerosThreshold = 0

When to remove execute permission from zero bytes.

This is the number of consecutive zero bytes that must be present before execute permission is removed from this part of the memory map. A value of zero disables this feature. The deExecuteZerosThreshold is the number of consecutive zero bytes that must be found to trigger this alteration, while the deExecuteZerosLeaveAtFront and deExecuteZerosLeaveAtBack narrow each region slightly before removing execute permission in order to leave some zeros unaffected.

This action happens after the memoryIsExecutable property is processed.

Definition at line 206 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

◆ deExecuteZerosLeaveAtFront

size_t Rose::BinaryAnalysis::Partitioner2::LoaderSettings::deExecuteZerosLeaveAtFront = 16

When to remove execute permission from zero bytes.

This is the number of consecutive zero bytes that must be present before execute permission is removed from this part of the memory map. A value of zero disables this feature. The deExecuteZerosThreshold is the number of consecutive zero bytes that must be found to trigger this alteration, while the deExecuteZerosLeaveAtFront and deExecuteZerosLeaveAtBack narrow each region slightly before removing execute permission in order to leave some zeros unaffected.

This action happens after the memoryIsExecutable property is processed.

Definition at line 207 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

◆ deExecuteZerosLeaveAtBack

size_t Rose::BinaryAnalysis::Partitioner2::LoaderSettings::deExecuteZerosLeaveAtBack = 1

When to remove execute permission from zero bytes.

This is the number of consecutive zero bytes that must be present before execute permission is removed from this part of the memory map. A value of zero disables this feature. The deExecuteZerosThreshold is the number of consecutive zero bytes that must be found to trigger this alteration, while the deExecuteZerosLeaveAtFront and deExecuteZerosLeaveAtBack narrow each region slightly before removing execute permission in order to leave some zeros unaffected.

This action happens after the memoryIsExecutable property is processed.

Definition at line 208 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

◆ memoryDataAdjustment

MemoryDataAdjustment Rose::BinaryAnalysis::Partitioner2::LoaderSettings::memoryDataAdjustment = DATA_IS_INITIALIZED

How to globally adjust memory segment access bits for data areas.

This property controls whether the partitioner makes any global adjustments to the memory map. The readable, writable, and initialized bits (see MemoryMap) determine how the partitioner treats memory read operations. Reading from memory that is non-writable is treated as if the memory location holds a constant value; reading from memory that is writable and initialized is treated as if the memory contains a valid initial value that can change during program execution, and reading from memory that is writable and not initialized is treated as if it has no current value.

The default is to use the memory map supplied by the executable or the user without making any changes to these access bits.

Definition at line 221 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

◆ memoryIsExecutable

bool Rose::BinaryAnalysis::Partitioner2::LoaderSettings::memoryIsExecutable = false

Whether all of memory should be made executable.

If this property is set, then the engine will remap all memory to be executable. Executability determines whether the partitioner is able to make instructions at that address. The default, false, means that the engine will not globally modify the execute bits in the memory map. This action happens before the various de-execute-zeros stuff is processed according to deExecuteZerosThreshold et al.

Definition at line 229 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

◆ linkObjectFiles

bool Rose::BinaryAnalysis::Partitioner2::LoaderSettings::linkObjectFiles = true

Whether to link object files before parsing.

Object files (".o" files) typically don't contain information about how the object is mapped into virtual memory, and thus machine instructions are not found. Turning on linking causes all the object files (and possibly library archives) to be linked into an output file and the output file is analyzed instead.

See also, linkStaticArchives, linker.

Definition at line 238 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

◆ linkStaticArchives

bool Rose::BinaryAnalysis::Partitioner2::LoaderSettings::linkStaticArchives = true

Whether to link library archives before parsing.

Static library archives (".a" files) contain object files that typically don't have information about where the object is mapped in virtual memory. Turning on linking causes all archives (and possibly object files) to be linked into an output file that is analyzed instead.

See also, linkObjectFiles, linker.

Definition at line 247 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

◆ linker

std::string Rose::BinaryAnalysis::Partitioner2::LoaderSettings::linker = "ld -o %o --unresolved-symbols=ignore-all --whole-archive %f"

Linker command.

ELF object files typically don't contain information about how the object is mapped into memory. If this setting is a non-empty string then a shell command is constructed and run on all the supplied object and library files and the resulting file is used instead.

This is the Bourne shell command used to link object files and static library archives depending on the linkObjectFiles and linkStaticArchives properties. The "%o" substring is replaced by the name of the linker output file, and the "%f" substring is replaced by a space separated list of input files (the objects and libraries). These substitutions are escaped using Bourne shell syntax and thus should not be quoted.

Definition at line 259 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

◆ envEraseNames

std::vector<std::string> Rose::BinaryAnalysis::Partitioner2::LoaderSettings::envEraseNames

Names to erase from the environment.

This property is a list of environment variable names that will be removed before launching a "run:" style specimen. These names are matched exactly.

Definition at line 265 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

◆ envErasePatterns

std::vector<boost::regex> Rose::BinaryAnalysis::Partitioner2::LoaderSettings::envErasePatterns

Patterns to erase from the environment.

This property is a list of regular expressions that will erase matching environment variable names before launching a "run:" style specimen. The expressions match only the variable name, not its value.

Definition at line 271 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.

◆ envInsert

std::vector<std::string> Rose::BinaryAnalysis::Partitioner2::LoaderSettings::envInsert

Environment variables to insert.

This property is a list of environment variables and values to insert before launching a "run:" style specimen. Insertions always occur after all environment variable erasures have been processed. Each string must contain at least one equal sign ("="), the first of which separates the variable name from its value.

Definition at line 278 of file Rose/BinaryAnalysis/Partitioner2/BasicTypes.h.


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