shellnoob icon indicating copy to clipboard operation
shellnoob copied to clipboard

Unicode Characters in Shellcode Cause Exception

Open adamdoupe opened this issue 11 years ago • 2 comments

break.asm .section .text xor %eax,%eax /* ☃ */ push %eax push $0x68732f2f push $0x6e69622f mov %esp,%ebx push %eax push %ebx mov %esp,%ecx mov $0xb,%al int $0x80 -- end break.asm --

python shellnoob.py --from-asm break.asm --to-exe break

causes the following exception:

Traceback (most recent call last): File "shellnoob.py", line 1557, in main() File "shellnoob.py", line 1553, in main snoob.do_conversion(input_fp, output_fp, input_fmt, output_fmt) File "shellnoob.py", line 515, in do_conversion _output = getattr(self, conv_func_name)(_input) File "shellnoob.py", line 221, in conv _hex = to_hex(self, input_s, with_breakpoint) File "shellnoob.py", line 665, in asm_to_hex obj = self.asm_to_obj(asm, with_breakpoint) File "shellnoob.py", line 960, in asm_to_obj tmp_asm_f.write(asm.encode("utf-8")) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 36: ordinal not in range(128)

@reyammer

adamdoupe avatar Dec 04 '14 19:12 adamdoupe

☃☃☃☃☃☃☃☃☃☃☃

kapravel avatar Dec 05 '14 02:12 kapravel

@kapravel, thanks for your valuable contribution. Now the problem is much clearer. :P

reyammer avatar Dec 05 '14 02:12 reyammer