News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Lots of errors with window.inc

Started by Magnum, December 28, 2012, 02:45:33 AM

Previous topic - Next topic

Magnum

This generates a lot of errors with windows.inc.
The code was written in 2005 if that helps.




; Code by Petroizki

.386
.model flat, stdcall

include C:\masm32\include\windows.inc
include C:\masm32\include\kernel32.inc
include C:\masm32\include\ws2_32.inc
include C:\masm32\include\wsock32.inc

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\ws2_32.lib
includelib \masm32\lib\wsock32.lib

.data

address db "192.168.0.1",0
icmp db "icmp.dll",0
icmpcreate db "IcmpCreateFile",0
icmpsend db "IcmpSendEcho",0
senddata db 32 dup (66h)

.data?

reply db (SIZEOF ICMP_ECHO_REPLY) + (SIZEOF senddata) dup (?)

.code

start:

invoke inet_addr, ADDR address
mov ebx, eax

invoke LoadLibrary, ADDR icmp

mov ebp, eax

invoke GetProcAddress, eax, ADDR icmpcreate

call eax ; IcmpCreateFile

mov edi, eax

invoke GetProcAddress, ebp, ADDR icmpsend

push 1000
push SIZEOF reply
push OFFSET reply
push NULL
push SIZEOF senddata
push OFFSET senddata
push ebx
push edi
call eax ; IcmpSendEcho

cmp eax, 0
je @error

; JIIHAAAAA! (ping was succesful)
int 3h

invoke FreeLibrary, ebp

invoke ExitProcess, 0

@error:
; ERROR..
int 3h

end start
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

qWord

Assembles without any error here (MASM32 v11)

You may change the include paths thus they are realtiv or point to your MASM32 installation.
MREAL macros - when you need floating point arithmetic while assembling!

dedndave

it assembles fine, here
i made one change....

Quote.386
        .MODEL  Flat, StdCall
        OPTION  CaseMap:None