heaven
heaven

Reputation: 11

how to retrieve the value at a memory address in cpp.how can we do the same in java

1.I have different sets of memory addresses which correspond to addresses used by a sequence of procedure invocations. These are collected by the process of dynamic binary analysis using valgrind and its tool taintgrind.

BI1:[400b000, _IO_file_underflow@@GLIBC_2.1]
BI2:[_IO_default_uflow, 400b000]
BI3:[main, beefc247, beefc200]
BI4:[BF_cbc_encrypt, beefaf6c, beefc200]
BI5:[BF_encrypt, beefaf6c, beefaf70]
BI6:[beefc1fc, beefafe4, BF_cbc_encrypt, beefaf70]
BI7:[beefafa4, beefb18c,beefb17c,beefafe4, CRYPTO_cfb128_encrypt]
BI8:[beefaf84, BF_cbc_encrypt, beefaf30]
BI9:[BF_decrypt, beefaf2c, beefaf30, beefaf18]
BI10:[beefaf38, beefaf2c, beefaf84, BF_cbc_encrypt,beefc1f4]

I need to iterate through these sets and retrieve the data at these addresses.these addresses are starting address of diff buffers used in the program which performs blowfish and aes.

can i get the data by some method in either cpp or java? 2. why the below code is showing segmentation fault?

  char *p;
  p=(char *)0xbff83c40; 
  printf("value of p:%p",p);
  printf("value at p:%c",(char)*p);

can anyone help me to sort out this issue?

Upvotes: 0

Views: 65

Answers (1)

ANjaNA
ANjaNA

Reputation: 1426

Looks you have couple of addresses in memory and you want to get the values of the buffers starting from those numbers. Also the addresses from valgrind, it means the program is ran in past time and its operation completed.

Sorry you can retrive the values, because that memory addresses from the program runtime stack/heep. Once program completed its operation that memory will release to another application, most probably. Then these addresses will have some other data. Some times these addresses can have your program values, but can't guarantees the accuracy of values.

note that, if you want to values of addresses of program, you can use a debugger. It allows you to read the values of addresses of program at runtime.

Upvotes: 1

Related Questions