CRC calculation for the running processes in QNX6.3

Hello,

I would like to calculate the CRC values for some running processes
periodically.
The purpose is to ensure that the processes are not corrupted.
The calculated CRCs are compared to the pre-calculated CRCs to check the
processes integrity.

I implemented the CRC calculation in Q4.25 and now trying to implement it in
Q6.3, and I don’t want to use the qnx_pinfo() in the migration library.

Could anyone give me guideline how I access the running process’s memory
location (i.e., segment, offset in the segment and the process size) ?
And if there is any sample program, it will be greately helpful to me.

Thanks

ji hyeon kim <jhkim10@kopec.co.kr> wrote:

Hello,

I would like to calculate the CRC values for some running processes
periodically.
The purpose is to ensure that the processes are not corrupted.
The calculated CRCs are compared to the pre-calculated CRCs to check the
processes integrity.

I implemented the CRC calculation in Q4.25 and now trying to implement it in
Q6.3, and I don’t want to use the qnx_pinfo() in the migration library.

Could anyone give me guideline how I access the running process’s memory
location (i.e., segment, offset in the segment and the process size) ?
And if there is any sample program, it will be greately helpful to me.

There isn’t, anymore, segments and offsets.

You can access the address space of a running process by doing an
open() on /proc/pid/as, and then lseek()/read().

What I don’t know how to describe is the layout in memory of the process,
at least not in detail. The process on disk is ELF – there may be enough
info there to determine what parts are loadable, and where they get loaded
to do this work.

Or, you may be able to get source code to dumper, which creates a core
dump, so should know the in-memory layout of the process. To do so,
you may have to go through a sales or support contact, rather than through
the newsgroups.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com