Jump to content

Bezsensowne i zabawne snippety w assemblerze


Bartosz Wójcik
 Share

Recommended Posts

Raz pisalem prace w GCC pod linuxem, exek mial niezla optymalizacje 300kb :D, pod debugerem znalazlem takie cos na poczatku kazdej funkcji:

push ebp
pop ebp
mov ebp, esp
Niezla optymalizacja :D, ten sam kod naklepalem w konsoli asma o zawartosci 4 kb :), dostalem piatke za to :), ale niestety nie spodobalo to sie naszemu doktorkowi, ktory zawsze sieje propagande Linux zamiast Windows :P
Link to comment
Share on other sites

3 kawałki kodu, na które ostatnio natrafiłem podczas zabawy, z Visuala:

.text:0042B185 xor     edx, edx
.text:0042B187 mov     dh, [eax]
.text:0042B189 xor     ecx, edx
...
.text:0042B176 mov     edx, eax
.text:0042B178 dec     eax
.text:0042B179 test    edx, edx
.text:0042B17B jz      short loc_42B1A9
.text:0042B17D push    esi
.text:0042B17E lea     esi, [eax+1]
.text:0042B181 mov     eax, [esp+4+arg_0]
...
.text:0044C2DA xor     ecx, ecx
.text:0044C2DC mov     cl, [esi+edi]
.text:0044C2DF mov     edx, ecx
.text:0044C2E1 mov     ecx, [esp+8+arg_4]
...jak zwykle Bozia za mało rejestrów dała... o jakieś 1024 za mało.
Link to comment
Share on other sites

  • 7 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...