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 


[VB6] Calling API's from dbk32.dll

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Sat Apr 14, 2007 6:26 am    Post subject: [VB6] Calling API's from dbk32.dll Reply with quote

How can i call API's from dbk32.dll and unprotect memory with it?

I hope someone can help me.

I've tried Windows' VirtualProtectEX(), WriteProcessMemory() and NtWriteVirtualMemory() with no luck.

I can read from the offset just not write Crying or Very sad

I took a look on the Exports of the DLL and these seem interesting:
MakeWritable()
UnprotectMe() / ProtectMe()
WritePhysicalMemory() / ReadPhysicalMemory()

But the problem is i don't know what parameters they need and of which type.
Example:

Private Declare Function MakeWritable Lib "dbk32.dll" (ByVal ?? As ??, ByVal ?? As ??, ByVal ?? As ??) As ??
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sat Apr 14, 2007 8:48 am    Post subject: Reply with quote

Here are the delphi prototypes from dbkfunctions.pas, you may need to convert the types if your language does not support these.

Code:

function MakeWritable(Address,Size:dword;copyonwrite:boolean): boolean; stdcall;

function WritePhysicalMemory(hProcess:THANDLE;lpBaseAddress:pointer;lpBuffer:pointer;nSize:DWORD;var NumberOfBytesWritten:DWORD):BOOL; stdcall;

function ReadPhysicalMemory(hProcess:THANDLE;lpBaseAddress:pointer;lpBuffer:pointer;nSize:DWORD;var NumberOfBytesRead:DWORD):BOOL; stdcall;

function ProtectMe(ProtectedProcessID: dword; denylist,globaldenylist:BOOL;list:pchar; listsize:dword):BOOL; stdcall;

function UnprotectMe:bool; stdcall;
Back to top
View user's profile Send private message
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Fri Apr 20, 2007 1:07 am    Post subject: Reply with quote

Hm thanks!
Can do Smile

Will post result when done.

Edit Result:

These seem to work:
Code:
Public Declare Function MakeWritable Lib "dbk32.dll" (ByVal Address As Long, ByVal Size As Long, ByVal copyonwrite As Boolean) As Boolean
Public Declare Function WritePhysicalMemory Lib "dbk32.dll" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Boolean
Public Declare Function ReadPhysicalMemory Lib "dbk32.dll" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesRead As Long) As Boolean


However i cant get
Code:
Public Declare Function GetPhysicalAddress Lib "dbk32.dll" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByRef Address As Long) As Boolean

to work.
It always returns 0 or I'm calling it wrong?

This is the call i try:
Code:
GetPhysicalAddress CEpHandle, longAddress, longNewAddress

CEpHandle is valid pHandle
longAddress is offset in process memory
resultMem is Long .. dont know for what.. possible (should) return physical address?

longNewAddress should be Int64 which doesn't exist in VB6.
Instead i tried Currency (old trick lol) and Long but it keeps returning 0.

Edit:
Someone?
Appalsap perhaps?

Come on this should be cake for you guys.
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Fri Apr 20, 2007 6:10 am    Post subject: Reply with quote

stealthy17 wrote:
longNewAddress should be Int64 which doesn't exist in VB6.


Looks like you've outgrown the language. Welcome back from 1998.
Back to top
View user's profile Send private message
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Fri Apr 20, 2007 12:55 pm    Post subject: Reply with quote

Possibly it been a few years when i was really active as a developer.
But I'm not talking about VB.NET i really mean VB6.

Also do you know how i can call them properly and use them?
Back to top
View user's profile Send private message
zowex
How do I cheat?
Reputation: 0

Joined: 25 May 2007
Posts: 2

PostPosted: Fri May 25, 2007 10:16 am    Post subject: Reply with quote

iIrealy would like how this turned out stealthy17, did it ever work out four you? Making unbdetecable trainers using darbytes engine with vb6 been my dream for a while now, i wish ppl could share there information and help on this.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
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