Page 1 of 1
python or bash snapshot current cpu realtime binary calculations
Posted: Fri Nov 25, 2022 4:30 pm
by blumenwesen
Hi, can the current pc work be displayed in binary with bash or python?
A snapshot of the current realtime cpu calculations in binary, i.e. the complete system working code from the processor.
Only a short excerpt may be possible at intervals, otherwise the work of the selection program would consume exponentially more resources and the pc crashes.
Re: python or bash snapshot current cpu realtime binary calculations
Posted: Tue Nov 29, 2022 7:18 pm
by blumenwesen
Ok, it seems to be impossible.
But how can I read out the memory in a short moment?
Re: python or bash snapshot current cpu realtime binary calculations
Posted: Fri Dec 02, 2022 7:01 am
by williams2
can the current pc work be displayed in binary with bash or python?
Python is very slow.
Bash is very, very slow.
I do not think either would work to write what seems to be a monitor program.
https://en.wikipedia.org/wiki/Machine_code_monitor
If you are trying to watch micro code as it is executing,
it would probably be easier to examine the (open source) source code.
There are, of course, various reverse engineering tools.
One thing to consider: any code running in user space will have strict limits of what ram you can access.
Trying to access ram memory that you are not permitted to access will result in an immediate seg fault or memory access error.
You can examine the ram memory in /proc or /sys or in /dev
But the kernel will not let you read more than a few megs,
to prevent you from doing what you seem to want to do..
For example, cat /dev/mem | hd
Re: python or bash snapshot current cpu realtime binary calculations
Posted: Fri Dec 09, 2022 10:48 am
by blumenwesen
It should be just a short excerpt, and show a few recent reactions of the program code processing.
A few MB is more than enough, where /proc or /sys or in /dev can the kernel be read?
Re: python or bash snapshot current cpu realtime binary calculations
Posted: Fri Dec 09, 2022 10:07 pm
by williams2
I think /dev/mem is what ram that the kernel can access.
But the kernel will not allow you to see all of the ram in /dev/mem in case you are a hacker with evil intentions.
For example:
https://bakhi.github.io/devmem/
Directly Access Your Physical Memory (dev/mem) - Heejin Park bakhi.github.io/devmem/ 2020-12-10T00:00:00.0000000 "/dev/mem" is a character device file, image of the main memory of system. It allows to directly access any phys address. 2 How to use 2.1 Requisites. To use /dev/mem, your kernel must be configured with "CONFIG_STRICT_DEVMEM=n", or it prevent access from even privileged user.
Re: python or bash snapshot current cpu realtime binary calculations
Posted: Tue Dec 13, 2022 4:06 pm
by blumenwesen
Ok I was hoping there is a way to read out current data directly without assambler. Thanks anyway.