Mail Archives: djgpp/2005/07/30/04:47:05
Hi guys,
just checked back in, and two useful answers. Wow! This
'group' stuff really works ;)
News Reader wrote:
> But that's all what I can slice off my weekend.
And thanks for that slice of last weekend, that is a pretty elegant
solution you came up with.
It never occurred to me (duh) to access the functions via &func; was
thinking was too low-levelish.
> asm(".ascii \"ABC\"");
Aah! I'd been looking all over for that and had almost feared there
wasn't any such command.
Schumacher, Gordon wrote:
> extern char* _text asm(".text");
> extern char* _etext asm("etext");
> static char* __dbg_progstart = (char*) &_text;
> static size_t __dbg_progsize = (&_etext - &_text) - sizeof(uint32);
And this is exactly what I was looking for!
In my case I'm better off using these DJ-pointers to do a byte-for-byte
marker-scan, as I have several places all spread out through different
libraries that I need to CRC.
> I have some functions to take CRC "snapshots" of a block of
> memory to ensure they haven't changed
That sounds like a good idea, I might borrow that one as well. ;)
I basically need the check to get a piece of software approved for
'legal trade'. The requirements are that the binary code is virtually
impossible to manipulate. Which is what as a customer you really
expect, i.e. from a gas/petrol pump, grocery scale, etc.
Up to now, I had been CRCing the whole .EXE file on disk, the drawback
of course being that any insignificant change voids the whole approval.
This way I can split the approval-critical stuff from the non-relevant.
Thanks again guys, big help!!
Gundolf
- Raw text -