WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
Pages (3) 1 [2] 3   ( Go to first unread post )

Discussion: WinAsm Studio & the Iczelion tutorials, please give your feedback, suggestions and comments about this article here.

poshpikiren
Quote Post


New Member
*

Group: Members
Posts: 3
Member No.: 40772
Joined: 30-December 10


Specifically talking about porting Iczelion's tut24 (mousehook.asm) there is an exe and a dll to be made, therefore I require two projects. Assuming win 7 64bit, UAC off, C:\masm32 and C:\WinAsm and tut24 already unpacked in c:\tut24 (probably any folder would do for this one)
(First of this is my second asm encounter, first time WinAsm, I'm a newbie.)

First, I deleted mousehook.dll and mousehook.exe just to make sure I'm rebuilding them. I don't know what's with the mousehook.lib but if I delete that it won't be recreated.
Then, opened WinAsm, File->New Project->Empty Project->Standard EXE
Project->Add Files or Ctrl+D
in C:\tut24
Selected
mousehook.asm
mousehook.inc
mousehook.rc
Removed untitled1.asm rightclick on it remove, don't save
Then, Make->Go All
Asked to save project , save in c:\tut24 with name tut24 to get tut24.exe when compiled. Must be saved in same folder as sources (apparently, from the DLL project below)
I get two errors:
QUOTE
C:\tut24\mousehook.asm(12) : error A2111: conflicting parameter definition
C:\tut24\mousehook.asm(12) : fatal error A1016: Internal Assembler Error

I go to that file and put a ";" to comment this line:
CODE
;wsprintfA proto C :DWORD,:DWORD,:VARARG


Then Make->Go All again
this made tut24.exe but it will complain it doesn't have mousehook.dll
No problem, let's make second project for this DLL

File->New Project->Empty Project->Standard DLL
Project->Add Files
navigate to folder C:\tut24\HookDLL\
selected
mousehook.asm
mousehook.def
Removed untitled2.asm from project
Make->Go All
Asked to save project, navigated to c:\tut24\HookDLL\ and put name mousehook as name, this will yield mousehook.dll It didn't want to compile when project was saved in c:\tut24\ but sources were in subfolder HookDLL, because it was trying to find the .obj file in subfolder but it was in c:\tut24\

Now either copy/move the mousehook.dll from c:\tut24\HookDLL\ to c:\tut24\
or better yet, make a symlink to it:
run Start->Run->cmd
c:
cd \tut24
C:\tut24>mklink mousehook.dll HookDLL\mousehook.dll
symbolic link created for mousehook.dll <<===>> HookDLL\mousehook.dll

Now run tut24.exe
Should work.
The mousehook.wap project could have been anything if you're going to make the symlink, just use mklink mousehook.dll HookDLL\projname.dll
where projname.wap exists there

I also made these changes(in bold) in mousehook.asm from c:\tut24 , because it's recommended to use GetModuleHandleEx
;invoke GetModuleHandle,NULL
;mov hInstance,eax
invoke GetModuleHandleEx, GET_MODULE_HANDLE_EX_FLAG_PIN, NULL, ADDR hInstance
cmp eax,0
jz fail1

invoke DialogBoxParam,hInstance,IDD_MAINDLG,NULL,addr DlgFunc,NULL
fail1:
invoke ExitProcess,NULL

the part with cmp eax,0 is probably equivalent with xor eax,eax ? that's one part that I remember(EDIT: wrongly) from long ago. EDIT: thanks to shoorick in next post for the very useful info related to this! wink.gif
EDIT2: btw, the only reason I made this post is so that people that are as newbie as me would find this useful or even make tut24 run, since this is the first tut that I came across while needing to understand(and don't yet know) how a hook of a method like SetWindowTheme works at lower than c#/C++ level - at win32 api level.

PMEmail Poster
Top
shoorick
Quote Post


Extremely Active Member
******

Group: Admins
Posts: 2301
Member No.: 160
Joined: 22-June 04


as already told many times, Iczelion tutorials are not perfect and sometimes outdated and need correction to run under w2k/xp etc., of course, they are only examples and after you understand how do they work you may improove them and even fully rewrite on your own taste.

"cmp eax,0" is equiwalent of "or eax,eax", "xor eax,eax" is equivalent of "mov eax,0"
PMEmail PosterUsers Website
Top
5p3ctral
Quote Post


New Member
*

Group: Members
Posts: 2
Member No.: 45897
Joined: 28-August 11


Hi

I saw that this is the thread to discuss about IczeLion's tutorials and WinAsm. Just a quick question for his tutorial 24 Windows Hooks. How do I go about creating the makefile that was mentioned?

I was not able to download the example from the link in the chm file, it just crashes when I clicked on it, so I was trying to code everything from scratch.

any advice would be helpful
PMEmail Poster
Top
5p3ctral
Quote Post


New Member
*

Group: Members
Posts: 2
Member No.: 45897
Joined: 28-August 11


Sorry, just to add something

Specifically, I am looking to build the inc file from scratch since I cannot download the example.
PMEmail Poster
Top
dogskool
Quote Post


New Member
*

Group: Members
Posts: 1
Member No.: 44997
Joined: 26-June 11


It appears that Iczelion's site ( http://win32assembly.online.fr/ ) is down. Does anyone know if it has moved or what may have happened?
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (3) 1 [2] 3  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google