View previous topic :: View next topic |
Author |
Message |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu Oct 21, 2010 1:59 pm Post subject: Loading libraries in asm |
|
|
i'm using TASM assembler to write assembly
i'd like to start using win32 api's but not using the invoke method,
instead i'd like to use the old fashion way, ( push parameters and then call ).
my code is as followed
Code: |
.386
.model flat, stdcall
.data
msg db "my msg$"
.code
start:
xor eax,eax
lea edx,msg
push eax
push eax
push edx
push eax
; here i should call MessageBoxA, but i don't how to obtain it's address, or loading the user32.dll
leave
retn
end start
|
any idea on how to get it?
Thanks.
_________________
Stylo |
|
Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Thu Oct 21, 2010 2:17 pm Post subject: |
|
|
Include the proper header files and try 'call MessageBoxA' or 'call [MessageBoxA]' . It should just import the function automatically (so it should link to user32).
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu Oct 21, 2010 2:25 pm Post subject: |
|
|
i tried taking user32.inc from fasm assembler and did
Code: |
include 'user32.inc'
|
but it keeps saying couldn't find user32.inc
idk what i need to import?
_________________
Stylo |
|
Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 891
|
Posted: Thu Oct 21, 2010 3:07 pm Post subject: |
|
|
MASM is free, works well, and includes examples. Check it out.
|
|
Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Thu Oct 21, 2010 4:54 pm Post subject: |
|
|
I agree with justa_dude. Try MASM or FASM which have many examples. (MASM is windows-only I believe).
If you want to use TASM just google for TASM examples to find out what files to include.
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
|
Back to top |
|
 |
|