Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


calling dlls?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Sep 21, 2007 4:42 pm    Post subject: calling dlls? Reply with quote

How do I call a dll in delphi? I would also like to know how to call in C++ but I need to know how to do in delphi, its important for a project im doing.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Fri Sep 21, 2007 4:43 pm    Post subject: Reply with quote

LoadLibrary/GetProcAddress call eax
_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Sep 21, 2007 4:44 pm    Post subject: Reply with quote

/ = and or or?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Fri Sep 21, 2007 4:45 pm    Post subject: Reply with quote

and
_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Sep 21, 2007 4:50 pm    Post subject: Reply with quote

kk, btw, how do i get the file path of something?
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Fri Sep 21, 2007 5:07 pm    Post subject: Reply with quote

for your own program? details... if you want to know your on programs path (GetModulePath)
_________________
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Fri Sep 21, 2007 5:43 pm    Post subject: Reply with quote

Vague, what do you mean by call?
Back to top
View user's profile Send private message MSN Messenger
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Fri Sep 21, 2007 5:44 pm    Post subject: Reply with quote

guessing he meant call a function in the dll. Confused
_________________
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Fri Sep 21, 2007 5:52 pm    Post subject: Reply with quote

_declspec(dllimport) ?
Back to top
View user's profile Send private message MSN Messenger
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Sep 21, 2007 6:39 pm    Post subject: Reply with quote

Yea, I want to know how to call a function in the dll.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
TheSorc3r3r
I post too much
Reputation: 0

Joined: 06 Sep 2006
Posts: 2404

PostPosted: Fri Sep 21, 2007 7:17 pm    Post subject: Reply with quote

DWORD addy = GetProcAddress(LoadLibrary(dllpath), functionname);
__asm
{
push arguments
call addy
}

_________________


Don't laugh, I'm still learning photoshop!
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Sep 21, 2007 7:20 pm    Post subject: Reply with quote

TheSorc3r3r wrote:
DWORD addy = GetProcAddress(LoadLibrary(dllpath), functionname);
__asm
{
push arguments
call addy
}


Code:

DWORD addy = GetProcAddress(LoadLibrary(/*can i leave path blank if its in the same folder?*/)main);
_asm
{
push arguments //is that rly something i do lol
call addy
}


???

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
TheSorc3r3r
I post too much
Reputation: 0

Joined: 06 Sep 2006
Posts: 2404

PostPosted: Fri Sep 21, 2007 7:49 pm    Post subject: Reply with quote

No, yes.

For example:

to call the function nub(int arg1, int arg2) like nub(4, 6), from lol.dll,

DWORD nub = GetProcAddress(LoadLibrary("lol.dll"), "nub");
__asm{
push 6
push 4 // MUST BE IN REVERSE ORDER!
call nub
}

_________________


Don't laugh, I'm still learning photoshop!
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Fri Sep 21, 2007 7:55 pm    Post subject: Reply with quote

and what if he isn't using the stdcall calling convention? c/c++ compilers don't do that by default Rolling Eyes

the proper way is

Code:

typedef int(__cdecl* nubprototype)(int arg1, int arg2);

void aaaa()
{
     nubprototype nb;

     nb = (nubprototype)GetProcAddress(LoadLibrary(TEXT("lol.dll")), "nub");
     nb(1, 2); //you can call it like any function, no inline asm required
}
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Sep 21, 2007 8:20 pm    Post subject: Reply with quote

TheSorc3r3r wrote:
No, yes.

For example:

to call the function nub(int arg1, int arg2) like nub(4, 6), from lol.dll,

DWORD nub = GetProcAddress(LoadLibrary("lol.dll"), "nub");
__asm{
push 6
push 4 // MUST BE IN REVERSE ORDER!
call nub
}


push 6 push 4? I'm sorry, I havn't done assembly in a while =P btw, i know what its doing, well like i know what push 6 and push 4 means i just dont know what its acutally doing

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites