| View previous topic :: View next topic |
| Author |
Message |
stealthy17 Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 144 Location: The Netherlands
|
Posted: Sat Apr 14, 2007 6:26 am Post subject: [VB6] Calling API's from dbk32.dll |
|
|
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
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 |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Apr 14, 2007 8:48 am Post subject: |
|
|
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 |
|
 |
stealthy17 Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 144 Location: The Netherlands
|
Posted: Fri Apr 20, 2007 1:07 am Post subject: |
|
|
Hm thanks!
Can do
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 |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Fri Apr 20, 2007 6:10 am Post subject: |
|
|
| 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 |
|
 |
stealthy17 Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 144 Location: The Netherlands
|
Posted: Fri Apr 20, 2007 12:55 pm Post subject: |
|
|
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 |
|
 |
zowex How do I cheat?
Reputation: 0
Joined: 25 May 2007 Posts: 2
|
Posted: Fri May 25, 2007 10:16 am Post subject: |
|
|
| 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 |
|
 |
|