Windows find that this file is potentially harmful [MASM 8.0]

Started by Wouter, May 11, 2007, 11:35:28 AM

Previous topic - Next topic

Wouter

Hello all,

When I create an executable file with MASM 8.0, I can not execute the
executable file on another machine.

When I doubleclick the SimpleAddition2.exe I receive the following
messagebox:

Windows find that this file is potentially harmful
To help protect your computer, Windows has blocked access to this
file.

Whatever I have tried, I cannot execute my SimpleAddition2.exe on
another computer.

Please reply also by mail if possible.

Thanks a lot in advance for reading my question.

Best Regards,

Wouter Wessels.

Draakie

I generally receive this kind of message when downloading files with executable or
compressed file extentions. XP right ? Easily solved though - just tell windows to unblock it -
you'll need administrative type access on the target computer. Right click file ... etc.

[/Edit] You're sure you don't have a virus floating around you're pc - attaching itself to .EXE's - right?
Does this code make me look bloated ? (wink)

sinsi

Saw you on osix...

Are you running the program from "My Documents"?
Are you running the program from winzip/winrar?
Are you running the program on XP?
Are you running the program on Vista?
etc etc

More information!!!
(and some source code...)
Light travels faster than sound, that's why some people seem bright until you hear them.

Tedd

If you download an executable file with Internet Explorer, it has a habit of labelling it as 'unsafe' and therefore stopping you from running it.
You need to 'authorize' it - right-click->properties, then press "unblock" then "OK"
Alternatively, just zip it first, then get it onto the other machine and unzip again.

..I've just tried it, and I actually get "The publisher could not be verified" - so maybe it's not that. So maybe it's some virus-checker related thing?
No snowflake in an avalanche feels responsible.

Wouter

Thanks for your response, here is my os and my sourcecode.

OS: Windows XP SP2

Source:

TITLE Simple Addition(1)               (main.asm)

; Description:
; Write a program that clears the screen, locates the cursor near the middle of the screen
; prompts the user for two integers, adds the integers, and displays their sum
; Revision date:

INCLUDE Irvine32.inc
.data
prompt BYTE "Please enter integer value: ",0
sumMsg BYTE "The sum of the two numbers is: ",0
wArray SDWORD 2 DUP (?)
.code
main PROC
   mov ecx,3         ; repeat question 3 times
L1:

   push ecx         ; protect loop counter because it is modified by next codelines
   call Clrscr
   mov dl,20         ; column near the middle of the screen
   mov dh,9         ; row near the middle of the screen
   call   Gotoxy      ; place cursor near the middle of the screen


   mov esi,OFFSET wArray   ; Read the signed int values entered into buffer
   mov ecx,2            ; Read two numbers
   mov edi,OFFSET prompt   ; The message to ask a user for a number
   call ReadIntArray

   mov eax,[esi]         ; Prepare for calculating the sum of the two integers
   add esi,4            ; Point ESI to the next integer
   add eax,[esi]         ; Addition of the two values
   mov dl,20            ; column near the middle of the screen
   mov dh,14            ; row near the middle of the screen
   call   Gotoxy         ; place cursor near the middle of the screen
   mov edx,OFFSET sumMsg   ; prepare for printing the result
   call WriteString
   call WriteInt         ; output the result of the addition
   mov dl,20            ; Position the press any key message
   mov dh,17
   call Gotoxy
   call WaitMsg         ; asks user to press a key to continue
   pop ecx
   loop L1
   
   
   exit
main ENDP
;-------------------------------------------------------------
; Reads a number of 32-bit signed integers from the keyboard.
; and stores them in an array, specified by the offset addres
; stored in ESI. The number of 32-bit signed integers to be
; read must be stored in ECX. EDI needs to be an offset of
; the text message used as prompt for the next integer.
;-------------------------------------------------------------
; Receives: ECX number of ints
;        ESI array offset where integers can be stored
;        EDI array offset where the array is stored with the
;          text to display when an integer should be read
; Returns: None
;
; Calls: WriteString, ReadInt
;--------------------------------------------------------------
ReadIntArray PROC
   pushad         ; Store all general registers on stack
   
L1:   
   mov edx,edi      ; prepares prompt to be printed
   call WriteString   ; writes prompt to ask user for next integer
   call ReadInt      ; Read a 32-bit signed integer decimal from keyboard
   mov [esi],eax      ; store the integer value in array
   add esi,4         ; point to next int to be read in array
;------- Added this to funtion
   mov dl,20         ; column near the middle of the screen
   mov dh,10         ; row near the middle of the screen
   call   Gotoxy      ; place cursor near the middle of the screen
;----------------------------------
   loop L1         ; continue to read ints until all ints are read

   popad         ; pops all general registers from stack
   ret            ; Return to next instruction address from the calling procedure
ReadIntArray ENDP
END main

sinsi

Quote from: Wouter on May 11, 2007, 12:05:39 PM
Thanks for your response, here is my os and my sourcecode.

OS: Windows XP SP2


But your OS doesn't matter, it's the OS's of your friends' computers and where they run it from.
Do they get "OK" and "Cancel" buttons in the message box? Or any other options?

And what's this "Irvine32.inc"?
Light travels faster than sound, that's why some people seem bright until you hear them.

Wouter

;But your OS doesn't matter, it's the OS's of your friends' computers and where they run it from.
;Do they get "OK" and "Cancel" buttons in the message box? Or any other options?

My friends OS is windows XP SP2, and there are no OK buttons as far as I know.

I like to assemble executables that generate NOT this warning/blocking.

My question is: How can I create executables with MASM 8.0 that not generate this warning?

B.T.W. Irvine32.inc is a very basic library with elemtary procedures to do for example text output to screen.

Thanks a lot everybody who tries to help me.

Wouter.

hutch--

Wouter,

I cannot see anything wrong with the source code you have posted in and as long as you can get ML 8.00 to work with Kip Irvine's style of code it should not be a problem ether. Depending on what you have turned on with your OS version it may be a safety mechnism like a built in or installed AV mechanism.

I would be inclined to turn OFF the DEP setting for files you have made yourself as it may be a problem even though it should not be if you have not tried to execute code in the data section or compressed the file using an older EXE compressor.

As already suggested insure the machine does not have any virus or trojan infection as this could also be the source of the problem. Also try installing the file onto the machine as a zip file, unzip it in place and see if it runs.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

sinsi

Quote from: Wouter on May 11, 2007, 12:56:30 PM
My question is: How can I create executables with MASM 8.0 that not generate this warning?
I don't think that MASM is the problem...It all seems to be related to zip/rar files and how XP treats downloaded files.
As hutch said, your code looks OK (the irvine32 stuff looks to be standard, and now hutch has mentioned Kip Irvine, I recognise irvine32.inc).

These were the first 3 results from google...
http://digg.com/security/Windows_has_blocked_access_to_these_files_to_help_protect_your_computer.
http://kerpau.net/windows-has-blocked-access-to-these-files-to-help-protect-your-computer-workaround/
http://theether.net/kb/100023
Light travels faster than sound, that's why some people seem bright until you hear them.

Wouter

The biggest problem is that I like to e-mail my executables to my family to show my progress in assembly.

When I send them the zip file, they cannot extract it with winzip, the message box appears and you can not unblock it.

If I send it as an executable, also the same problem, and also a problem with MSN e-mail, that does not trust the executable file.

I hope one of you know how I can compile my source code in such a way the warnings dissapear.

I always compile from the Visual C++ Express Edition, maybe this is the cause?

Thanks a lot in advance for helping me.

Wouter.

hutch--

Wouter,

Having just read the links that siinsi posted for you, the problem is almost exclusively the configuration of the machine that has to run the file you have built. There is nothing wrong with your code or ML 8.00.

Send the file to them as a zip file and give them instructions on how to install it. Download the zip file directly to disk and don't try and unpack it from a browser. Open it on disk with winrar, winzip or even pkzip and it should work. If the machine still blocks the unzipping of the file, track down WHY it is being blocked and change the setting.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

sinsi

Yep, don't open the file but save it, then unzip it into its own folder and run it.
Or send it as an EXE but rename it file.ABC or something...bung it on a floppy if need be...
Light travels faster than sound, that's why some people seem bright until you hear them.

Wouter

Does someone wants to receive my executable by mail, to see if the file works?

Thanks a lot in advance,

Wouter.

sinsi

Light travels faster than sound, that's why some people seem bright until you hear them.

hutch--

With a bit of messing around I got it to build here with Kip Irvines include file, library and some of the libs from MASM32. It runs fine on my win2000 although the app does not seem to have a way to close it. The problem is not in the code or ML 8.0, its in the configuration of the XP Sp2 macine that you are trying to get it to run on.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php