)
and why it is 1246259 only ?
i couldnt find anything on MSDN , i would appreciate if anyone can help me out .
I don't have the slightest idea. I was assuming you had invented that yourself and so know what it's for. If not, where did you get it from (apparently not MSDN)? Doesn't that source explain it?
Note that you're not "only" writing that value which appears to be a file type signature: Youre writing 12 bytes which comprises the variables header, time and msgnbr.
Also, you're writing the header to the file but I don't see any reference to it in the context of reading. I don't know your program well enough to tell whether that might be problematic, though.
Last edited by Eri523; June 28th, 2011 at 12:13 PM.
Reason: Added quote
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
I don't have the slightest idea. I was assuming you had invented that yourself and so know what it's for. If not, where did you get it from (apparently not MSDN)? Doesn't that source explain it?
Note that you're not "only" writing that value which appears to be a file type signature: Youre writing 12 bytes which comprises the variables header, time and msgnbr.
Also, you're writing the header to the file but I don't see any reference to it in the context of reading. I don't know your program well enough to tell whether that might be problematic, though.
i didnt ! i just modified the code to suite my needs !
i downloaded it form here : http://win32assembly.online.fr/source2.html
i attached the whole Original Program! before!( i re attached it again ) ,
for reading it uses oheader ! i wonder where or when this variable gets filled!! ?
If the comparison fails, the file is considered invalid.
The reason why the comparison is done against an immediate value here instead of the actual header which would be more illustrative (and safer when maintaining the program) is most likely brevity: The CMP instruction to which that .IF eventually gets translated doesn't allow to directly compare two memory locations, so a comparison to header would have needed two instructioons.
header is a constant that is filled by loading the program into memory and never written to later. It is used to be written to the output file as the file type signature, along with the two variables following it in memory.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Not really. The record described there practically consists only of variable fields, while the header field we're talking about here is rather a magic number. Unlike at least most of which is described in that article, it doesn't translate into readable ASCII text, though. (Note that although many magic numbers used in popular file formats do translate into readable ASCII, of course this isn't essential for the functionality.)
if yes, why did he used 12? and not for example 14, or 16?
(i wonder if i looked in a relevant place !)
Actually, only the constant DOWRD (i.e. 4 bytes) header is the magic number. The other 8 bytes are the variables time and msgnbr which seem to be part of the file header, yet are just this: variable. I haven't examined the program close enough to tell what they're used for when reading back in the file later.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
thank you Eri523
you are indeed a great help to me
God bless you man
by the way i called the original author ( yeah after 12 years ) ) and asked him about the header and that magic number , he kindly replied:
" i was a kid when i wrote that, and now i have no idea what that number stood for and ... : ) "
so i think , this remains still a secret )
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.