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 


Byte Arrays in VB?

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

Joined: 10 Jan 2009
Posts: 9

PostPosted: Tue Feb 17, 2009 6:56 pm    Post subject: Byte Arrays in VB? Reply with quote

Alright... I've been trying to make a trainer on VB2008, and I noticed that some of the bigger numbers caused overflow errors.

Right now, I'm trying to do:
Writememory(&H4BD7B03B, 4294967103, 4)
But since a byte can't hold that much data, my program keeps crashing.

So I'm guessing I need to convert that into byte arrays, which would be...
Hex: ffffff3f
Byte Array: F3 FF FF FF 00

So I'm wondering...
What is the code that is like WriteMemory except for byte arrays?

I'm pretty sure it wouldn't be Writememory(&H4BD7B03B, 0xF3 0xFF 0xFF 0xFF 0x00, 4)...
I couldn't find out how to do this in Cheat Engine either...

Thanks for your help Smile
Back to top
View user's profile Send private message
Matt-h4ck3r
Newbie cheater
Reputation: 0

Joined: 19 Feb 2009
Posts: 16

PostPosted: Sun Feb 22, 2009 6:31 pm    Post subject: Reply with quote

i think it is writememory,,
your using visual basics right?
Back to top
View user's profile Send private message
W1z8it
How do I cheat?
Reputation: 0

Joined: 19 Feb 2009
Posts: 3

PostPosted: Sun Feb 22, 2009 6:45 pm    Post subject: Reply with quote

The second parameter should be a pointer, to the buffer holding your value, not the value itself...

Try this

Code:
Public Shared Function VarPtr(ByVal e As Object) As Integer
        Dim GC As GCHandle = GCHandle.Alloc(e, GCHandleType.Pinned)
        Dim GC2 As Integer = GC.AddrOfPinnedObject.ToInt32
        GC.Free()
        Return GC2
    End Function
Public Shared Sub MyFunc()
        Dim my_var As Long = 4294967103
        Dim my_var_prt = VarPtr(my_var)
        Writememory(&H4BD7B03B, my_var_prt, 8)
    End Sub Sub


Edit: And because your value is a long, in vb.net that's 64 bits (8 bytes, not 4)
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 Gamehacking 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