Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Zoe Phin, 2021/04/24
- # https://phzoe.com/?p=1761
- wget -O- http://flatassembler.net/fasm-1.73.27.tgz | tar zx fasm/fasm
- echo ' use32
- org 0x505A4000
- db 0x7F, "ELF"
- dd 1
- dd 0
- dd $$
- dw 2
- dw 3
- dd start
- dd start
- dd 4
- start: pop ecx
- pop edi
- jmp .end
- .arg: pop esi
- .char: lodsb
- cmp al, 0
- jmp .cont
- dw 32
- dd 1
- .cont: je .done
- rcr al, 1
- adc ah, ah
- jmp .char
- .done: mov [edi+edx], ah
- inc edx
- xor eax,eax
- .end: loop .arg
- jmp edi
- ' > bex.asm; fasm/fasm bex.asm bex; chmod +x bex
- input="10110000 00000100 01000011 10001001 11111001 11001101 10000000 10010011 11001101 10000000"
- output=$(./bex $input | xxd -b -c10 | cut -c11-99)
- echo "Input: $input"
- echo "Output: $output"
- [[ $input = $output ]] && echo "Match!" || echo "Error: No Match"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement