From e13223465ce70e387991ecb424f3ac34e7f4d974 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 19 Jan 2017 20:51:58 +0000 Subject: ldso: added pe_get_peb_command_line(), pe_get_peb_environment_block(). --- src/ldso/pe_get_peb_strings.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/ldso/pe_get_peb_strings.c (limited to 'src/ldso') diff --git a/src/ldso/pe_get_peb_strings.c b/src/ldso/pe_get_peb_strings.c new file mode 100644 index 0000000..7817c16 --- /dev/null +++ b/src/ldso/pe_get_peb_strings.c @@ -0,0 +1,28 @@ +/*****************************************************************************/ +/* pemagination: a (virtual) tour into portable bits and executable bytes */ +/* Copyright (C) 2013--2017 Z. Gilboa */ +/* Released under GPLv2 and GPLv3; see COPYING.PEMAGINE. */ +/*****************************************************************************/ + +#include +#include +#include "pe_os.h" + +wchar16_t * pe_get_peb_command_line(void) +{ + struct os_peb * peb; + + return (peb = (struct os_peb *)pe_get_peb_address()) + ? peb->process_params->command_line.buffer + : 0; +} + + +wchar16_t * pe_get_peb_environment_block(void) +{ + struct os_peb * peb; + + return (peb = (struct os_peb *)pe_get_peb_address()) + ? peb->process_params->environment + : 0; +} -- cgit v1.2.3