Passing environment variables to application

25 views
Skip to first unread message

Yury Khrustalev

unread,
Jul 16, 2021, 5:59:15 AM7/16/21
to DynamoRIO Users
Hi, is there a way to propagate environment variables to the application executed via drrun?

The idea is that environment for drrun and DynamoRIO is not affected but from the app's point of view these variables are set to certain value provided in the command line. Something similar to "-E var=value" for the QEMU User space emulator.

Thanks,
Yury

sharma...@google.com

unread,
Aug 31, 2021, 4:52:32 PM8/31/21
to DynamoRIO Users
Hi Yury,
Sorry for the late response.

I'm not aware of any drrun command-line arg that can be used to set environment variables for the app. But did you try simply wrapping the app command in a shell script and exporting whatever environment variables you need in the script? Something like:

my_app_wrapped.sh:

export MY_NEW_ENV_VAR="some_value"
./my_app <args-to-my-app>

and then,
./bin64/drrun -- bash my_app_wrapped.sh

Does this work for you?

Abhinav
Reply all
Reply to author
Forward
0 new messages