| Deutsch English Français Italiano |
|
<vnou73$tcss$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: pozz <pozzugno@gmail.com>
Newsgroups: comp.arch.embedded
Subject: Inspecting memory on the field
Date: Mon, 3 Feb 2025 00:12:49 +0100
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <vnou73$tcss$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 03 Feb 2025 00:13:39 +0100 (CET)
Injection-Info: dont-email.me; posting-host="2bbcd83b2dfd035b013bccd96ebbd12f";
logging-data="963484"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QM5kov+CSn6fUm8Uxbfrl/j8eWJnJilI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:S+y3O1MfQ8UfZ4Yi2ARnSZYcxJw=
Content-Language: it
Bytes: 2214
I instrumented one of my system with a low-level memory read
functionality. I'm able to read the content of a memory block in a
running system by remote.
I also have the source code and build files of the firmware running in
the system.
Now suppose you have a complex static data structure at address X. Its
size is 1000 bytes. The struct could be defined as:
--- mystruct.c ---
#include "object1.h"
#include "object2.h"
static struct {
int x;
int y;
struct {
enum { OBJ1, OBJ2 } type;
union {
object1 obj1; // object1 is another struct
object2 obj2; // object2 is another struct
};
} array[10];
...
} mystruct;
---
By using low-level memory read function, I can read the current values
of all the bytes in mystruct. How to print a nice report of mystruct
values, such as:
mystruct = {
x = 10,
y = 3,
array = [
{ OBJ1, obj={...}, obj2={...} },
{ OBJ1, obj={...}, obj2={...} },
{ OBJ1, obj={...}, obj2={...} },
{ OBJ1, obj={...}, obj2={...} },
]
}
I know I can write a script that works on a specific mystruct, maybe
calculating the offset address of each field. I'm searching for a tool
that can calculate the correct offset address and print a nice report as
before.