Re: RosAsm injects extra bytes into your data



På 27 Apr 2005 14:26:42 -0700, skrev Alex McDonald <alex_mcd@xxxxxxxxxxxxxxx>:

Betov wrote:
"Alex McDonald" <alex_mcd@xxxxxxxxxxxxxxx> écrivait
news:1114628472.109735.162400@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:

> Thank you. You wrote;
>
>> > The point of my "idea" is rather than injecting all these
padding
> bytes
>> > to align things, why not rearrange all the declarations to
> *minimize*
>> > the wasted space while maintaining the alignment the user
requests.
>
>> Because this would be unusable, for the Programmer.
>
>> (The ones who have already written a bit of Assembly
>>  will probably understand without explanations... :)
>
> I still don't understand this statement. Can you explain?

As the sense of humour might vary from culture
to culture, and as, maybe, some beginner would
also not understand, here is a trivial example:

[MyFirstData: DwordData: D§ ?]
;...
;...
[WordData: W§ ? ?]
;...
;...
[ByteData: B§ ? ? ? ? ? ? ? MyLastData: D§ ?]
;...
;...

; Clear My Data from 'MyFirstData' to 'MyLastData':

mov eax 0, edi MyFirstData
While edi < MyLastData | stosd | End_While

:)

Betov.

< http://rosasm.org >

As a coding style, this is pretty ropey. There are several assumptions the novice programmer that wrote this has made in the above code. A sense of humour is required when reading it, that's for sure.

In no particular order;

. The label MyLastData points to the _start_ of 4 bytes at the end of
the structure, not the end. MyLastData - MyFirstData is 4 bytes short
of the length.

. The while end_while depends on a less-than test. The last four bytes
will not be cleared.

The *3* last bytes, and they will be cleared :))))

.



Relevant Pages

  • Re: Muslim headgear
    ... I'm trying to understand your sense of "humour and culture". ... Moi, a nasty streak? ... your esteem self but I did not remind "everyone" that it is a public forum. ...
    (uk.local.kent)
  • Re: Muslim headgear
    ... I'm trying to understand your sense of "humour and culture". ... transposing your position with me will get you out of the hole you've dug. ... Now he's doing it with the psychological trait ...
    (uk.local.kent)
  • Re: Have you noticed your sense of humour declining lately?
    ... Wit, humour and jokes are related, but different. ... know is also rarely funny for eg. ... modern culture changes rapidly. ...
    (uk.philosophy.humanism)
  • Re: RosAsm injects extra bytes into your data
    ... why not rearrange all the declarations to ... >>> the wasted space while maintaining the alignment the user requests. ... As the sense of humour might vary from culture ... mov eax 0, edi MyFirstData ...
    (alt.lang.asm)
  • Re: Muslim headgear
    ... I'm trying to understand your sense of "humour and culture". ... I do not understand Jack hackett's humour, or culture for that matter, ... Other words also come to mind! ...
    (uk.local.kent)