Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can constant value be read from nvbit? #35

Open
leiwen83 opened this issue Jan 2, 2021 · 1 comment
Open

Can constant value be read from nvbit? #35

leiwen83 opened this issue Jan 2, 2021 · 1 comment

Comments

@leiwen83
Copy link

leiwen83 commented Jan 2, 2021

Hi,

I see we could use nvbit could r/w register, but I wonder whether we could do global or constant memory reading inside the injection function?

Thx,
Lei

@ovilla
Copy link
Collaborator

ovilla commented Jan 4, 2021

Hi,

At this point we don't have that capability, but you can do the equivalent (although with a less powerful mechanism) by passing constant values as arguments to the injected function using:

/* Add uint32_t argument to last injected call, constant bank value at c[bankid][bankoffset] */
void nvbit_add_call_arg_cbank_val(const Instr* instr, int bankid, int bankoffset, bool is_variadic_arg = false);

We agree this mechanism is less powerful as it could require passing a lot of arguments when reading many constant bank values, so a new function (similar to those that read/write registers) makes a lot of sense.
We will consider that in the next releases.
Thanks,

--Oreste

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants