Class RopActionTests

Inheritance Relationships

Base Type

Class Documentation

class RopActionTests : public TestSuite

Public Functions

inline RopActionTests()
inline virtual void init()

Virtual method for test suite initialization.

inline RopChain GetRopChain()
inline bool ExecuteRopChain(RopChain &rop, uint64_t min_stack = 0, uint64_t max_stack = 4096, uint64_t buf_size = 4096)
inline bool ExecuteRopAction(RopActionId id, std::vector<uint64_t> arguments = {}, uint64_t min_stack = 0, uint64_t max_stack = 4096, uint64_t buf_size = 4096)
inline  TEST_METHOD (commitCredsTest, "COMMIT_INIT_TASK_CREDS is working")
inline  TEST_METHOD (winTargetWorks, "win_target is working")
inline  TEST_METHOD (writeWhatWhereTest, "WRITE_WHAT_WHERE_64 is working")
inline bool check_fork(int expected_exitcode)
inline  TEST_METHOD (teleforkTest, "TELEFORK is working, its stack usage is in expected range")
inline  TEST_METHOD (ret2usrTest, "RET2USR works")
inline  TEST_METHOD (switchTaskNamespacesTest, "SWITCH_TASK_NAMESPACES works")
virtual void deinit()

Virtual method for test suite deinitialization.

virtual void Log(const char *format, ...)

Logs a message using a format string.

Parameters:
  • format – The format string for the message.

  • ... – The arguments for the format string.

void Error(const char *format, ...)

Logs an error message and sets the had_errors flag.

Parameters:
  • format – The format string for the error message.

  • ... – The arguments for the format string.

Test &RegisterTest(Test test)

Registers a test case with the test suite.

Parameters:

test – The Test object to register.

Returns:

A reference to the registered Test object.

void AssertLogs(bool fail_if_no_expected = true)

Asserts that the logged output matches the expected results in a file.

Parameters:

fail_if_no_expected – If true, the test will fail if no expected results file is found.

void AssertNoErrors()

Asserts that no errors have occurred during the test execution.

Throws:

ExpKitError – if the had_errors flag is true.

Public Members

std::string class_name
std::string desc
std::vector<Test> tests
std::vector<std::string> logs
std::vector<std::string> errors
TestEnvironment *env
Test *current_test
bool had_errors = false