|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Finding the function adress when load dll
Hey guys i got a little problem ive created a little program
here it is. Code:
#include <windows.h>
int main()
{
MessageBox(0, 0, 0, 0);
ExitProcess(0);
return 0;
}
I was guna turn this into asm like the following Code:
[BITS 32]
start:
xor edx, edx ; Avoids NULL byte
push edx ; MsgBox type
push edx ; MsgBox body
push edx ; MsgBox caption
push edx ; Owner hWnd
mov eax, 0x77d804ea ; Addr of MessageBox, USER32 should be loaded
call eax
xor eax, eax ; Avoids NULL byte
push eax ; Exit code
mov eax, 0x7c81caa2 ; Addr of ExitProcess,KERNEL32 should be loaded
call eax
Now i went to set the function adress for MessageBox in user32.dll but couldnt find it erm erm i couldn find MessageBoxA which function messagebox in my code in the user32.dll..Any help would be much apriciated..Im using win xp service pack 2 english.From what ive read there is no MessageBox function in user32.dll .. ![]() Last edited by muhaa : May 10th, 2007 at 09:40 PM. |
|
#2
|
|||
|
|||
|
MessageBoxA() and MessageBoxW() are both implemented in user32.dll. I think your assumption that User32 and Kernel32 "should be loaded" is... well they probably are loaded, but what have you done to map them into your process? Those hard coded addresses you are calling through eax look a bit spooky. Why aren't you using windows.inc?
You should have something like call MessageBox or [i]invoke MessageBox instead. It's been a really long time since I wrote any assembler for Windows. Try [url]http://www.grc.com/smgassembly.htm[url] for an example of how to do this properly. Google assembler+windows for more links.
__________________
It's not always a matter of what you can do with a language, but whether you should. [JwD] |
|
#3
|
|||
|
|||
|
M8 could you show me of an example in asm haw it should be done .And also im using nasmw not masm that is the reason i cant .inc ...
Last edited by muhaa : May 13th, 2007 at 09:48 AM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Finding the function adress when load dll |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|