RE: while trying to learn pack
- From: rvm@xxxxxxxxx (Bob McConnell)
- Date: Mon, 28 Jul 2008 08:44:03 -0400
From: Richard Lee
John W. Krahn wrote:
Richard Lee wrote:
I am begining to read bit of low level(assembly) book to just gain
some knoweldge on inner workings of memory.
My quesiton is, if machine is 32 bit, even if it's accessing string
'A', it will have to fetch 32 bit (instead of 8 bit that requires to
make that letter A ) ?
It depends on the CPU. An Intel compatible CPU has instructions to
access 8 bit values from memory but some CPUs can only access 32 bit
aligned data.
I know this is not a mailing list for this but i figure since it's
closely related to pack, i thought someone would clarify for me.
It is not really related to pack() as pack() is a high level function
willthat can hide the details of the CPUs addressing problems.
I am reading "step by step assembly language"... I am not sure i
read the whole thing but i just want to get better inner working of
memory as my c book didn't do enough justice.
Just one more question on the topic,
I am trying to understand how it works in binary world.
So, If let's say I take a pcap file. I am assuming here that
ethereal/wireshark will take binaries on the wire and then decoding it
based on pcap standard(? hex? ) and then present them in ascci ?ethereal
so which means in order to unpack pcap file, I have to know how
pack on their own.. is this something similar to what happens whenpcap
file gets created?
The pcap file format has a very nice solution to this problem. All data
is stored in the host's native order to optimize for speed. But the file
header begins with the magic number 0xa1b2c3d4. When the pcap file is
read on any system, the magic number is evaluated to determine the
Endean of the capture file. Then the parser knows if it needs to swap
bytes as it extracts the individual packets.
Bob McConnell
.
- References:
- while trying to learn pack
- From: Richard Lee
- Re: while trying to learn pack
- From: John W. Krahn
- Re: while trying to learn pack
- From: Richard Lee
- while trying to learn pack
- Prev by Date: Re: Pipe print output into shell in debugger
- Next by Date: rand()
- Previous by thread: Re: while trying to learn pack
- Next by thread: Re: while trying to learn pack
- Index(es):
Relevant Pages
|