I have this file I wan't to assemble and link:


If I use this syntax, I can't make this file
work right:

ml /c /Cp /coff scrshfun.asm

link /subsystem:windows scrshfun.obj

what do I miss here :confused:
Posted on 2003-12-28 16:11:42 by The SharK
I had no problems assembling and linking the program and I used the same commands you used. The program crashed when I ran it though. I looked at the code and I saw that you had tried to modify data in the code section so I set the code section to writeable. The program didn't crash then but my system froze. What exactly is the program supposed to do?
Posted on 2003-12-28 16:58:15 by Odyssey
@echo off

if exist %1.obj del %1.obj
if exist %1.exe del %1.exe

\masm32\bin\ml /c /coff %1.asm
if errorlevel 1 goto errasm

if not exist rsrc.obj goto nores

\masm32\bin\Link /SUBSYSTEM:WINDOWS %1.obj rsrc.obj

q editors default assembles this well

you are writiing to code section
mov wcx.hCursor, eax

make the code section writable runs the proggie and it seems freezing
so i changed the show windows param to sw_showmormal

004010E5 PUSH 1 ; /ShowState = SW_SHOWNORMAL
004010E7 PUSH EAX ; |hWnd = NULL
004010E8 CALL 00401212 ; \ShowWindow

instead of your sw_maximsed
and it runs well shows the desktop

did you want to make the proggie look like its freezing the system

whats the puprose

btw with sw_maximised it looks exactly like desktop and looks like its frozen the hell only ctrl+alt+del and getting the taskmgr to end task restores original desktop
Posted on 2003-12-29 01:37:19 by bluffer
Hi guys


Yeah, it's supposed to fool people to think their computer is freezing,
by taking a snapshot of the desktop, and showing it in a window.
I have the taking the program from this link:

http://www.asmcommunity.net/board/index.php?topic=14078&highlight=fate+worse

by arkane

The program didn't crash then but my system froze.


Hi Odyssey :grin: :grin: sorry for laughing, but ya see - you made it work as it should :alright:

Hi bluffer
make the code section writable runs the proggie


How do I make the code section writeable:confused:
Posted on 2003-12-29 05:10:16 by The SharK
The Shark,

LOL :grin:

I tried it again. I pressed alt+f4 thus time instead of killing the process :grin:.

To set the code section to writeable.

link /subsystem:windows /section:.text,ERW scrshfun.obj
Posted on 2003-12-29 05:17:03 by Odyssey
Oh, I think I found it:

I simply move this code from the .CODE section, and into .DATA section.

    clwn            DB "scrshfun",0

trayWnd DB "Shell_TrayWnd", 0
wcx WNDCLASSEX<SIZEOF WNDCLASSEX, CS_BYTEALIGNWINDOW, OFFSET MainProc,\
NULL, NULL, NULL, NULL, NULL, NULL, NULL, OFFSET clwn, NULL>
:)



I can NEVER make the codes look nice in here @#$&#"...
Posted on 2003-12-29 05:18:34 by The SharK
hi odyssey tx for tellin how to do it while linking

i used olly to load the exe and changed its section headers to e0000020 and saved it back
rightclickcpupane --->view--->executablefile --->ctrl+g (0) --rightclick --->special peheader--->scroll to section header--->ctrl+e edit --->right click --->save file

oops too much work it seems to your /section:.text ,ERW
Posted on 2003-12-29 05:35:45 by bluffer
bluffer,

no problem :grin:

The Shark,

When you're posting code you can use the "code" and "/code" tags. The tags should be enclosed by brackets "[]".
Posted on 2003-12-29 05:53:49 by Odyssey
Which way is the best:

to move the code, from the .CODE section into .DATA section,
or
to make the code section writeable at link time:
link /subsystem:windows /section:.text,ERW scrshfun.obj

  clwn            DB "scrshfun",0

trayWnd DB "Shell_TrayWnd", 0
wcx WNDCLASSEX <SIZEOF WNDCLASSEX, CS_BYTEALIGNWINDOW, OFFSET MainProc,\
NULL, NULL, NULL, NULL, NULL, NULL, NULL, OFFSET clwn, NULL


maybe there is no best way...:)
Posted on 2003-12-29 09:41:51 by The SharK
I think you should keep your data in the data section unless you have a special reason for having it in the code section. That's the way it was meant to be. :)
Posted on 2003-12-29 09:52:51 by Odyssey
You're right,

thanks Odyssey:alright:
Posted on 2003-12-29 10:27:35 by The SharK