Debugging 为什么汇编语言会出现语法错误?

Debugging 为什么汇编语言会出现语法错误?,debugging,ubuntu,assembly,syntax,Debugging,Ubuntu,Assembly,Syntax,我复制了一个汇编代码,试图编译它。然而,它说我在第25行遇到语法错误 Section .text global _start _start: jmp short GotoCall shellcode: pop esi xor eax, eax mov byte [esi + 7], al lea ebx, [esi] mov long [esi + 8], ebx mov long [es

我复制了一个汇编代码,试图编译它。然而,它说我在第25行遇到语法错误

Section .text

global _start
_start:

jmp short GotoCall

shellcode:

        pop esi
        xor eax, eax
        mov byte [esi + 7], al  
        lea ebx, [esi]
        mov long [esi + 8], ebx
        mov long [esi + 12], eax
        mov byte al, 0x0b
        mov ebx, esi
        lea ecx, [esi + 8]
        lea edx, [esi + 12]
        int 0x80

GotoCall:

        Call    shellcode
        db      ‘/bin/shJAAAAKKKK’
为什么会这样

Section .text

global _start
_start:

jmp short GotoCall

shellcode:

        pop esi
        xor eax, eax
        mov byte [esi + 7], al  
        lea ebx, [esi]
        mov long [esi + 8], ebx
        mov long [esi + 12], eax
        mov byte al, 0x0b
        mov ebx, esi
        lea ecx, [esi + 8]
        lea edx, [esi + 12]
        int 0x80

GotoCall:

        Call    shellcode
        db      ‘/bin/shJAAAAKKKK’
GNU nano 2.2.6文件:shell.asm

Section .text

global _start
_start:

jmp short GotoCall

shellcode:

        pop esi
        xor eax, eax
        mov byte [esi + 7], al  
        lea ebx, [esi]
        mov long [esi + 8], ebx
        mov long [esi + 12], eax
        mov byte al, 0x0b
        mov ebx, esi
        lea ecx, [esi + 8]
        lea edx, [esi + 12]
        int 0x80

GotoCall:

        Call    shellcode
        db      ‘/bin/shJAAAAKKKK’

你从网上复制/粘贴了它(只是猜测),但它使用了错误的引号:

Section .text

global _start
_start:

jmp short GotoCall

shellcode:

        pop esi
        xor eax, eax
        mov byte [esi + 7], al  
        lea ebx, [esi]
        mov long [esi + 8], ebx
        mov long [esi + 12], eax
        mov byte al, 0x0b
        mov ebx, esi
        lea ecx, [esi + 8]
        lea edx, [esi + 12]
        int 0x80

GotoCall:

        Call    shellcode
        db      ‘/bin/shJAAAAKKKK’
Character: ‘ U+2018
Name: LEFT SINGLE QUOTATION MARK
使用ASCII子集中的单引号:

Section .text

global _start
_start:

jmp short GotoCall

shellcode:

        pop esi
        xor eax, eax
        mov byte [esi + 7], al  
        lea ebx, [esi]
        mov long [esi + 8], ebx
        mov long [esi + 12], eax
        mov byte al, 0x0b
        mov ebx, esi
        lea ecx, [esi + 8]
        lea edx, [esi + 12]
        int 0x80

GotoCall:

        Call    shellcode
        db      ‘/bin/shJAAAAKKKK’
    db      '/bin/shJAAAAKKKK'

你从网上复制/粘贴了它(只是猜测),但它使用了错误的引号:

Section .text

global _start
_start:

jmp short GotoCall

shellcode:

        pop esi
        xor eax, eax
        mov byte [esi + 7], al  
        lea ebx, [esi]
        mov long [esi + 8], ebx
        mov long [esi + 12], eax
        mov byte al, 0x0b
        mov ebx, esi
        lea ecx, [esi + 8]
        lea edx, [esi + 12]
        int 0x80

GotoCall:

        Call    shellcode
        db      ‘/bin/shJAAAAKKKK’
Character: ‘ U+2018
Name: LEFT SINGLE QUOTATION MARK
使用ASCII子集中的单引号:

Section .text

global _start
_start:

jmp short GotoCall

shellcode:

        pop esi
        xor eax, eax
        mov byte [esi + 7], al  
        lea ebx, [esi]
        mov long [esi + 8], ebx
        mov long [esi + 12], eax
        mov byte al, 0x0b
        mov ebx, esi
        lea ecx, [esi + 8]
        lea edx, [esi + 12]
        int 0x80

GotoCall:

        Call    shellcode
        db      ‘/bin/shJAAAAKKKK’
    db      '/bin/shJAAAAKKKK'