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 


[Vb.net] Copymemory Problem

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
TheRealLinky
How do I cheat?
Reputation: 0

Joined: 18 Jun 2009
Posts: 7

PostPosted: Thu Jul 30, 2009 4:10 pm    Post subject: [Vb.net] Copymemory Problem Reply with quote

My Copymemory declaration is as follows.
Code:
 Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByVal Destination As Image_Dos_header, ByRef Source As Byte, ByVal Length As Int32)


The variables in play for the actually call are.
Code:
Dim IDH1 As Image_Dos_header = Nothing
 Dim file1() As Byte


My Image_dos_header structure is
Code:
   <StructLayout(LayoutKind.Sequential)> _
   Public Structure Image_Dos_header
        Public e_magic As Integer 'magic number
        Public e_cblp As Integer 'bytes on last page of file
        Public e_cp As Integer     'Pages in file
        Public e_crlc As Integer   'Relocations
        Public e_cparhdr As Integer    'Size of header in Paragraphs
        Public e_minalloc As Integer   'Mn extra paragraphs needed
        Public e_maxalloc As Integer   'Max extra Paragraphs needed
        Public e_ss As Integer         'Initial (relative) ss value
        Public e_sp As Integer         'Initial SP value
        Public e_csum As Integer       'Checksum
        Public e_ip As Integer         'Initial IP value
        Public e_cs As Integer         'Initial (relative) cs value
        Public e_lfarlc As Integer     'File Address of Relocation Table
        Public e_ovno As Integer       'Overlay number
        <MarshalAs(UnmanagedType.ByValArray, SizeConst:=9)> _
        Public e_res() As Integer    'Reserved Words
        Public e_oemid As Integer      'Oem Identifier (for e_oeminfo)
        Public e_oeminfo As Integer    'OEM Info; e_oemid specific
        <MarshalAs(UnmanagedType.ByValArray, SizeConst:=9)> _
        Public e_res2() As Integer 'Reserved Words
        Public e_lfanew As Long        'File Address of New Exe header
    End Structure


And my call looks like.
Code:
Call CopyMemory(IDH1, file1(0), 64)


How ever nothing gets copied to IDH1. And there for the other calls fail. Ive tried marshaling. And everything i could think of.Any help guys?

Edit: Solved the Problem and Managed to read all the headers. Please Lock.
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