BananaPhone icon indicating copy to clipboard operation
BananaPhone copied to clipboard

32位下会报错。有没有asm_x32.s?

Open shadow1ng opened this issue 3 years ago • 5 comments

asm: asmins: illegal 64: 00018 (C:\Users\Administrator\Desktop\aaa\bananaphone\asm_x64.s:4) MOVQ 96(GS), AX asm: asmins: illegal in mode 32: 00018 (C:\Users\Administrator\Desktop\aaa\bananaphone\asm_x64.s:4) MOVQ 96(GS), AX (24 14)

32位下会报错。有没有asm_x32.s?

shadow1ng avatar Apr 02 '21 08:04 shadow1ng

Hi,

No, 32 bits is not currently supported. It requires a custom go asm file to be written, which is unpleasant.

It should be easy to do, but I haven't gotten around to it yet because I'm yet to run into a 386 system that would make use of BananaPhone.

C-Sto avatar Apr 06 '21 03:04 C-Sto

when I trying to build https://github.com/vyrus001/go-mimikatz, that base on BananaPhone using

SET GOOS=windows
SET GOARCH=386
go1 build -ldflags="-s -w " -trimpath

it will error

shadow1ng avatar Apr 08 '21 15:04 shadow1ng

when the system version is windows 2003, it usely is x86 ,and that will error.

git clone https://github.com/vyrus001/go-mimikatz
SET GOOS=windows
SET GOARCH=386
go run main.go
asm: asmins: illegal 64: 00018 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:4)   MOVQ    96(GS), AX
asm: asmins: illegal in mode 32: 00018 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:4)   MOVQ    96(GS), AX (24 14)
asm: asmins: illegal 64: 00026 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:5)   MOVQ    AX, ret+4(FP)
asm: asmins: illegal in mode 32: 00026 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:5)   MOVQ    AX, ret+4(FP) (14 24)
asm: asmins: illegal 64: 00018 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:12)  MOVQ    96(GS), AX
asm: asmins: illegal in mode 32: 00018 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:12)  MOVQ    96(GS), AX (24 14)
asm: asmins: illegal 64: 00026 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:14)  MOVQ    24(AX), AX
asm: asmins: illegal in mode 32: 00026 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:14)  MOVQ    24(AX), AX (24 14)
asm: asmins: illegal 64: 00030 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:17)  MOVQ    32(AX), AX
asm: asmins: illegal in mode 32: 00030 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:17)  MOVQ    32(AX), AX (24 14)
asm: asmins: illegal 64: 00034 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:20)  MOVQ    (AX), AX
asm: asmins: illegal in mode 32: 00034 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:20)  MOVQ    (AX), AX (24 14)
asm: asmins: illegal 64: 00037 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:24)  MOVQ    32(AX), CX
asm: asmins: illegal in mode 32: 00037 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:24)  MOVQ    32(AX), CX (24 15)
asm: asmins: illegal 64: 00041 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:25)  MOVQ    CX, start+4(FP)
asm: asmins: illegal in mode 32: 00041 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:25)  MOVQ    CX, start+4(FP) (15 24)
asm: asmins: illegal 64: 00046 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:27)  MOVQ    48(AX), CX
asm: asmins: illegal in mode 32: 00046 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:27)  MOVQ    48(AX), CX (24 15)
asm: asmins: illegal 64: 00050 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:28)  MOVQ    CX, size+12(FP)
asm: asmins: illegal in mode 32: 00050 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:28)  MOVQ    CX, size+12(FP) (15 24)
asm: asmins: illegal 64: 00018 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:36)  MOVQ    96(GS), AX
asm: asmins: illegal in mode 32: 00018 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:36)  MOVQ    96(GS), AX (24 14)
asm: asmins: illegal 64: 00026 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:38)  MOVQ    24(AX), AX
asm: asmins: illegal in mode 32: 00026 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:38)  MOVQ    24(AX), AX (24 14)
asm: asmins: illegal 64: 00030 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:41)  MOVQ    32(AX), AX
asm: asmins: illegal in mode 32: 00030 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:41)  MOVQ    32(AX), AX (24 14)
asm: invalid instruction: 00034 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:44) XORQ    R10, R10
asm: invalid instruction: 00034 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:46) CMPQ    R10, i+4(FP)
asm: asmins: illegal 64: 00036 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:49)  MOVQ    (AX), AX
asm: asmins: illegal in mode 32: 00036 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:49)  MOVQ    (AX), AX (24 14)
asm: invalid instruction: 00039 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:50) INCQ    R10
asm: asmins: illegal 64: 00041 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:55)  MOVQ    32(AX), CX
asm: asmins: illegal in mode 32: 00041 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:55)  MOVQ    32(AX), CX (24 15)
asm: asmins: illegal 64: 00045 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:56)  MOVQ    CX, start+12(FP)
asm: asmins: illegal in mode 32: 00045 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:56)  MOVQ    CX, start+12(FP) (15 24)
asm: asmins: illegal 64: 00050 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:58)  MOVQ    48(AX), CX
asm: asmins: illegal in mode 32: 00050 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:58)  MOVQ    48(AX), CX (24 15)
asm: asmins: illegal 64: 00054 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:59)  MOVQ    CX, size+20(FP)
asm: asmins: illegal in mode 32: 00054 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:59)  MOVQ    CX, size+20(FP) (15 24)
asm: asmins: illegal 64: 00059 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:60)  MOVQ    AX, CX
asm: asmins: illegal in mode 32: 00059 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:60)  MOVQ    AX, CX (14 15)
asm: asmins: illegal 64: 00062 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:61)  ADDQ    $56, CX
asm: asmins: illegal in mode 32: 00062 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:61)  ADDQ    $56, CX (7 15)
asm: asmins: illegal 64: 00066 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:62)  MOVQ    CX, modulepath+28(FP)
asm: asmins: illegal in mode 32: 00066 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:62)  MOVQ    CX, modulepath+28(FP) (15 24)
asm: asmins: illegal 64: 00018 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:70)  MOVQ    96(GS), AX
asm: asmins: illegal in mode 32: 00018 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:70)  MOVQ    96(GS), AX (24 14)
asm: asmins: illegal 64: 00026 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:72)  MOVQ    24(AX), AX
asm: asmins: illegal in mode 32: 00026 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:72)  MOVQ    24(AX), AX (24 14)
asm: asmins: illegal 64: 00030 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:75)  MOVQ    32(AX), AX
asm: asmins: illegal in mode 32: 00030 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:75)  MOVQ    32(AX), AX (24 14)
asm: invalid instruction: 00034 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:78) XORQ    R10, R10
asm: invalid instruction: 00034 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:80) CMPQ    R10, i+4(FP)
asm: asmins: illegal 64: 00036 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:83)  MOVQ    (AX), AX
asm: asmins: illegal in mode 32: 00036 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:83)  MOVQ    (AX), AX (24 14)
asm: invalid instruction: 00039 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:84) INCQ    R10
asm: asmins: illegal 64: 00041 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:87)  MOVQ    AX, CX
asm: asmins: illegal in mode 32: 00041 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:87)  MOVQ    AX, CX (14 15)
asm: asmins: illegal 64: 00044 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:88)  SUBQ    $16, CX
asm: asmins: illegal in mode 32: 00044 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:88)  SUBQ    $16, CX (7 15)
asm: asmins: illegal 64: 00048 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:89)  MOVQ    CX, ret+12(FP)
asm: asmins: illegal in mode 32: 00048 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:89)  MOVQ    CX, ret+12(FP) (15 24)
asm: asmins: illegal 64: 00018 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:97)  XORQ    AX, AX
asm: asmins: illegal in mode 32: 00018 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:97)  XORQ    AX, AX (14 14)
asm: asmins: illegal in 32-bit mode: 00026 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:99)      PUSHQ   CX
asm: asmins: illegal 64: 00027 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:101) MOVQ    argh_len+28(FP), CX
asm: asmins: illegal in mode 32: 00027 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:101) MOVQ    argh_len+28(FP), CX (24 15)
asm: asmins: illegal 64: 00032 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:103) MOVQ    argh_base+20(FP), SI
asm: asmins: illegal in mode 32: 00032 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:103) MOVQ    argh_base+20(FP), SI (24 18)
asm: asmins: illegal 64: 00037 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:105) MOVQ    48(GS), DI
asm: asmins: illegal in mode 32: 00037 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:105) MOVQ    48(GS), DI (24 18)
asm: asmins: illegal 64: 00052 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:107) SUBQ    $128, SP
asm: asmins: illegal in mode 32: 00052 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:107) SUBQ    $128, SP (6 18)
asm: asmins: illegal 64: 00071 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:116) MOVQ    SP, DI
asm: asmins: illegal in mode 32: 00071 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:116) MOVQ    SP, DI (18 18)
asm: asmins: illegal 64: 00076 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:118) MOVSQ
asm: asmins: illegal in mode 32: 00076 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:118) MOVSQ (1 1)
asm: asmins: illegal 64: 00078 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:119) MOVQ    SP, SI
asm: asmins: illegal in mode 32: 00078 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:119) MOVQ    SP, SI (18 18)
asm: asmins: illegal 64: 00081 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:121) SUBQ    $8, SP
asm: asmins: illegal in mode 32: 00081 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:121) SUBQ    $8, SP (7 18)
asm: asmins: illegal 64: 00085 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:124) MOVQ    (SI), CX
asm: asmins: illegal in mode 32: 00085 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:124) MOVQ    (SI), CX (24 15)
asm: asmins: illegal 64: 00088 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:125) MOVQ    8(SI), DX
asm: asmins: illegal in mode 32: 00088 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:125) MOVQ    8(SI), DX (24 21)
asm: invalid instruction: 00092 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:126)        MOVQ    16(SI), R8
asm: invalid instruction: 00092 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:127)        MOVQ    24(SI), R9
asm: asmins: illegal 64: 00092 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:132) MOVQ    CX, X0
asm: asmins: illegal in mode 32: 00092 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:132) MOVQ    CX, X0 (15 64)
asm: asmins: illegal 64: 00097 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:133) MOVQ    DX, X1
asm: asmins: illegal in mode 32: 00097 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:133) MOVQ    DX, X1 (21 66)
asm: invalid instruction: 00102 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:134)        MOVQ    R8, X2
asm: invalid instruction: 00102 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:135)        MOVQ    R9, X3
asm: invalid instruction: 00102 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:137)        MOVQ    CX, R10
asm: asmins: illegal 64: 00104 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:139) ADDQ    $136, SP
asm: asmins: illegal in mode 32: 00104 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:139) ADDQ    $136, SP (6 18)
asm: asmins: illegal in 32-bit mode: 00111 (D:\Program\go\gopath\pkg\mod\github.com\!c-!sto\[email protected]\pkg\BananaPhone\asm_x64.s:141)     POPQ    CX
asm: assembly failed

shadow1ng avatar May 16 '21 06:05 shadow1ng

Yes, you will need to create a 386 compliant version of the asm found in the .s file

C-Sto avatar May 16 '21 15:05 C-Sto

It looks like you're the only one who can write it fast.

shadow1ng avatar May 18 '21 01:05 shadow1ng