CPU x86指令集,235个字节
00000750 50 push eax
00000751 8A10 mov dl,[eax]
00000753 80FA00 cmp dl,0x0
00000756 7418 jz 0x770
00000758 31DB xor ebx,ebx
0000075A EB03 jmp short 0x75f
0000075C F9 stc
0000075D EB13 jmp short 0x772
0000075F 8A83C1A14000 mov al,[ebx+0x40a1c1]
00000765 3C00 cmp al,0x0
00000767 74F3 jz 0x75c
00000769 38C2 cmp dl,al
0000076B 7404 jz 0x771
0000076D 43 inc ebx
0000076E EBEF jmp short 0x75f
00000770 42 inc edx
00000771 F8 clc
00000772 58 pop eax
00000773 C3 ret
00000774 53 push ebx
00000775 8B442408 mov eax,[esp+0x8]
00000779 31C9 xor ecx,ecx
0000077B 09C0 or eax,eax
0000077D 7505 jnz 0x784
0000077F 31C0 xor eax,eax
00000781 48 dec eax
00000782 EB2F jmp short 0x7b3
00000784 E8C7FFFFFF call 0x750
00000789 72F4 jc 0x77f
0000078B 7510 jnz 0x79d
0000078D F6D3 not bl
0000078F 80E33F and bl,0x3f
00000792 88D9 mov cl,bl
00000794 8AB3C1A14000 mov dh,[ebx+0x40a1c1]
0000079A 8830 mov [eax],dh
0000079C 40 inc eax
0000079D E8AEFFFFFF call 0x750
000007A2 72DB jc 0x77f
000007A4 750D jnz 0x7b3
000007A6 30D9 xor cl,bl
000007A8 8AB1C1A14000 mov dh,[ecx+0x40a1c1]
000007AE 8830 mov [eax],dh
000007B0 40 inc eax
000007B1 EBEA jmp short 0x79d
000007B3 5B pop ebx
000007B4 C20400 ret 0x4
000007B7 53 push ebx
000007B8 8B442408 mov eax,[esp+0x8]
000007BC 31C9 xor ecx,ecx
000007BE 09C0 or eax,eax
000007C0 7505 jnz 0x7c7
000007C2 31C0 xor eax,eax
000007C4 48 dec eax
000007C5 EB32 jmp short 0x7f9
000007C7 E884FFFFFF call 0x750
000007CC 72F4 jc 0x7c2
000007CE 750F jnz 0x7df
000007D0 30D9 xor cl,bl
000007D2 8AB1C1A14000 mov dh,[ecx+0x40a1c1]
000007D8 8830 mov [eax],dh
000007DA 88D9 mov cl,bl
000007DC 40 inc eax
000007DD EBE8 jmp short 0x7c7
000007DF 8B442408 mov eax,[esp+0x8]
000007E3 E868FFFFFF call 0x750
000007E8 72D8 jc 0x7c2
000007EA 750D jnz 0x7f9
000007EC F6D3 not bl
000007EE 80E33F and bl,0x3f
000007F1 8AB3C1A14000 mov dh,[ebx+0x40a1c1]
000007F7 8830 mov [eax],dh
000007F9 5B pop ebx
000007FA C20400 ret 0x4
函数find()和deCript()+字符串abc:171字节+ 64字节= 235,使用nasmw进行汇编,使用Borland C编译器编译/库:
; nasmw -fobj this.asm
; bcc32 -v this.obj
section _DATA use32 public class=DATA
global _main
extern _printf
fmt1 db "result=%s" , 13, 10, 0, 0
fmt2 db "abc[63]=%c" , 13, 10, 0, 0
code1 db "code" , 0, 0
code2 db ",&'8[14 =?;gp+% 2'@s&&c45/eg8?&" , 0, 0
code3 db ';a$5$%0r?2@12dw6# lb-eg&519nt%ot=9$@es@96+?;ga" 4*)&ta56dp[?o#t%oh/"(&?#ee![,+,/+fe4"' , 0, 0
abc db ' !"#$%' , "&'()*+,-./0123456789:;=?@[\]^_abcdefghijklmnopqrstuvwxyz|~" , 0, 0
section _TEXT use32 public class=CODE
find:
push eax
mov dl, [eax]
cmp dl, 0
je .2
xor ebx, ebx
jmp short .1
.e: stc
jmp short .z
.1: mov al, [abc+ebx]
cmp al, 0
je .e
cmp dl, al
je .3
inc ebx
jmp short .1
.2: inc edx ; set zf=0
.3: clc
.z: pop eax
ret
deCript:
push ebx
mov eax, dword[esp+8]
xor ecx, ecx
or eax, eax
jnz .1
.e: xor eax, eax
dec eax
jmp short .z
.1: call find
jc .e
jnz .2
not bl
and bl, 03Fh
mov cl, bl
mov dh, [abc+ebx]
mov [eax], dh
inc eax
.2: call find
jc .e
jnz .z
xor cl, bl
mov dh, [abc+ecx]
mov [eax], dh
inc eax
jmp short .2
.z:
pop ebx
ret 4
cript:
push ebx
mov eax, dword[esp+8]
xor ecx, ecx
or eax, eax
jnz .1
.e: xor eax, eax
dec eax
jmp short .z
.1: call find
jc .e
jnz .2
xor cl, bl
mov dh, [abc+ecx]
mov [eax], dh
mov cl, bl
inc eax
jmp short .1
.2: mov eax, dword[esp+8]
call find
jc .e
jnz .z
not bl
and bl, 03Fh
mov dh, [abc+ebx]
mov [eax], dh
.z:
pop ebx
ret 4
_main:
pushad
push code1
call cript
push code1
push fmt1
call _printf
add esp, 8
xor eax, eax
mov al, [abc+63]
push eax
push fmt2
call _printf
add esp, 8
push code1
call deCript
push code1
push fmt1
call _printf
add esp, 8
push code2
call deCript
push code2
push fmt1
call _printf
add esp, 8
push code3
call deCript
push code3
push fmt1
call _printf
add esp, 8
popad
mov eax, 0
ret
结果:
result=945/
abc[63]=~
result=code
result=programming puzzles & code golf
result=a $150 reward will be given to those sending account and pin# to hackers@steal_id.com
汇编更好(说真的,我使用宏系统,是的,我知道它太长了,但是作为带有宏系统的C one +-,说真的,因为指令更简单,即使不使用汇编也很容易编写代码改正为英文书写(不是I))