News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

new to asm (simple question)

Started by Troy Lundin, June 03, 2006, 10:33:24 AM

Previous topic - Next topic

Mark Jones

Quote from: Troy Lundin on June 06, 2006, 11:39:08 PM
   .if eax==WM_INITDIALOG
         invoke  GetDlgItem,hWin,chkTurns  ; CheckBox0
         mov hChkTurns, eax

...It gives an error on the bold line. It gives no description just the error number A2001.
chkTurns is declared (chkTurns equ 1001), hChkTurns is declared (hChkTurns equ 0)

I have no idea what is wrong. Also, where can I find out what the error numbers mean? I am using RadASM with MASM.


Hi Troy,

Take things one step at a time. MASM error descriptions are read from a file (ML.ERR) located in \masm32\bin. If that file is missing, any errors reported will not contain descriptions. (The first time I installed MASM32 mine disappeared somewhow...) :lol

As for your mov hChkTurns, eax, consider what you're trying to do here. EAX is a DWORD register (4 bytes) and you're tring to move that into a STATIC value declared with EQU. For this instruction to work you'll need to supply four non-static bytes at a memory offset. What Ossa said above reserves a DWORD (DD, 4 bytes), initalized to zero, at the physical memory offset "hChkTurns." Never give up! :U
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Troy Lundin

#16
ok, i see that now. I changed the equ to dd and it will run but gives a compile warning. Also the msgbox still never appears and the close button on my form does not work. I had to end the process manually.

I have attached the project as a sort of last resort. Thank you.

Mark Jones

Okay Troy, I'll help. I don't know what "Oasis" is, but note that the discussion of any sort of program which violates a software license agreement is forbidden here. Your code includes a "poke" routine and a "nopit" value and others which are indicative of tampering with another program... if that is the case this topic may be locked and/or deleted. Fair warning!

Quote from: Troy Lundin on June 07, 2006, 12:10:16 AM
I changed the EQU to DD and it will run but gives a compile warning.

You did change "EQU" to "DD", but the "DD" was still under a .CONST directive. :wink

Constants go under .CONST, data under .DATA or .DATA?, and code under .CODE sections. The "." directives supercede all other directives and datatypes.

You don't technically need an .inc file. You could delete that file and replace the top of the main file with this:


include masm32rt.inc       ; MASM32 v9.0 compile-time libs and standard options
comment * unused:
include shell32.inc
includelib shell32.lib *

DlgProc     PROTO   :HWND,:UINT,:WPARAM,:LPARAM
Poke        PROTO   :DWORD,:DWORD,:BYTE

; Constants only!
.const
IDD_DIALOG1         equ 101
chkTurns            equ 1001
chkFollowers        equ 1002
chkScarab           equ 1003

; Initialized (preset) Data
.data
wnd_name            db  'Oasis',0
cls_name            db  'Oasis',0
rew                 db  'This Stuff Is Hard!',0
nopit               db  090h,090h,090h
aTurns              dd  041825Eh
uTurns              db  004h,050h,089h

; Unitialized (zeroed) Data
.data?
hInstance           dd  ?
hChkTurns           dd  ?

.code
start:


As an optimization tip, notice that "wnd_name" and "cls_name" have the same values. If both of these do not change, remove one of them.

As for all the other issues,

Quote
    ;mov eax,uMsg

This is causing a big problem. When Windows sends messages to your WndProc, the message (a DWORD) is passed as "uMsg" so here this value is never getting into EAX and therefore no messages are ever being retrieved and processed! :U
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Troy Lundin

Well, as to your first comment. That is the reason I had never posted my project.

As to ;mov eax,uMsg: I uncommented it and it all worked fine. That makes it even more irritating that this was such a simple solution.
Thank you for your continued help.

rags

Quote from: Mark Jones on June 07, 2006, 01:45:58 AM
Okay Troy, I'll help. I don't know what "Oasis" is, but note that the discussion of any sort of program which violates a software license agreement is forbidden here. Your code includes a "poke" routine and a "nopit" value and others which are indicative of tampering with another program... if that is the case this topic may be locked and/or deleted. Fair warning!
Quote from: Troy Lundin on June 07, 2006, 01:57:16 AM
Well, as to your first comment. That is the reason I had never posted my project.
Mark,
apparantly he's trying to write a trainer for the game called "Oasis", available here:http://www.oasisgame.com/
According to the EULA for the game this is illegal:
Quote4. RESTRICTIONS. You may not delete or obscure any copyright, trademark or other proprietary notice on the Software or accompanying printed materials. You may not decompile, modify, reverse engineer, disassemble or otherwise reproduce the Software. You may not copy, rent, lease, sublicense, distribute, publicly display the Software, create derivative works based on the Software or otherwise commercially exploit the Software. You may not "hack," "crack," or otherwise attempt to circumvent any copy protection, access control, or license-enforcement mechanisms associated with or related to the Software. You may not electronically transmit the Software from one computer, console or other platform to another or over a network. You may not use any backup or archival copy of the Software for any purpose other than to replace the original copy in the event it's destroyed or becomes defective.
Regards,
  Rags
God made Man, but the monkey applied the glue -DEVO

P1

Troy,

Please PM a moderator with what you are trying to accomplish here.  So we may properly handle your request.

I hope your signature is not entirely correct, when it comes to this matter.

Regards,  P1  :8)