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

std::vector scanning problem #13

Open
Scoserix opened this issue Dec 9, 2019 · 1 comment
Open

std::vector scanning problem #13

Scoserix opened this issue Dec 9, 2019 · 1 comment

Comments

@Scoserix
Copy link

Scoserix commented Dec 9, 2019

Hey, could it be that the structure of std::vector changed?

This function doesn't seem to work for me.
Am I doing something wrong? Maybe for this code to work I need to use some c++ version or sdk in particular?

TY

`void readVector(DWORD vectorAddress)
{
struct _vector
{
DWORD* begin;
DWORD* end;
DWORD* tail;
};

_vector* vec = (_vector*)vectorAddress;

DWORD count = ((DWORD)vec->end - (DWORD)vec->begin) / sizeof(DWORD);
DWORD capacity = ((DWORD)vec->tail - (DWORD)vec->begin) / sizeof(DWORD);

printf("Vector has %d items and %d capacity\n", count, capacity);

for (int i = 0; i < count; i++)
	printf("\tValue at %d is %d\n", i, vec->begin[i]);

}`

@skyl34n
Copy link

skyl34n commented Jul 12, 2021

Try to compile in Release mode

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