VB.Net Pointer

  • Partenaires

Utilisateurs qui regardent le poste (Total: 0, Members: 0, Invité: 0)

Statut
La discussion n'est pas ouverte à d'autres réponses
T

TrueBlue

Level 1
25 Sept. 2012
8
0
201
Hi,
I don't know French, so im gonna ask my question in English. xD
I need a little help. So, this is my code :

If CheckBox11.Checked = True Then
ElseIf IsProcessRunning("S4Client") = True Then
Try
tmp = ReadLong("S4Client", &H1116340) + Offsets(0)
tmp = ReadLong("S4Client", tmp) + Offsets(1)
tmp = ReadLong("S4Client", tmp) + Offsets(2)
tmp = ReadLong("S4Client", tmp) + Offsets(3)
Coordinate(0) = ReadLong("S4Client", tmp) + &H684
Coordinate(1) = Coordinate(0) + 8
Coordinate(2) = Coordinate(0) + 4

End If

I got my base address and offsets but i can't make the bold area working. i didnt understand &H684 , is there an another offsets ? :/
 
Nociif

Nociif

2b || !2b
Level 5
Level 4
Level 3
Level 2
Level 1
23 Sept. 2011
2,607
5
944
push location
Discord
Nociif#5969
&h684 is the last offset for the first coord. The 2 others coord are separated of 4 bytes.
 
T

TrueBlue

Level 1
25 Sept. 2012
8
0
201
&h684 is the last offset for the first coord. The 2 others coord are separated of 4 bytes.

I knew it. Merci. =) But i have an another problem.

for example, my base addy is 01234567 , i type it in vb.net like &H1234567, but it always returns to 0. it doesnt work without the putting 0. however i cant put the 0 in vb.net . what should i do ?
 
RockRoss

RockRoss

Level 5
Level 4
Level 3
Level 2
Level 1
5 Juil. 2010
3,539
0
601
Hi,

I don't know well VB.NET language ... But a quick search over google said that this "&H" means you are using hexadecimal syntax. On last lines, you're adding Coordinate(0) with decimal value 8 or 4. Coordinate(0) is set with a "value + &H684", which is equivalent to "value + [((6*16²) + (8*16) + 4) = 1668]".
 
davydavekk

davydavekk

Level 5
Level 4
Level 3
Level 2
Level 1
23 Mai 2013
508
0
322
'merica
As Nociif said, they're separated by 4 bytes, therefore you have to add 0x4 to their address and NOT to their value.

Declare a new unsigned long (its a System.UINT64 in VB) that's gonna store the address of the first coordinate and then :

Coordinate(0) = ReadLong("S4Client", firstCoordAddr + &H0)
Coordinate(1) = ReadLong("S4Client", firstCoordAddr + &H8)
Coordinate(2) = ReadLong("S4Client", firstCoordAddr + &H4)


For your other problem, are you sure the base in hex in 1234567 ? That would be odd af.
 
T

TrueBlue

Level 1
25 Sept. 2012
8
0
201
As Nociif said, they're separated by 4 bytes, therefore you have to add 0x4 to their address and NOT to their value.

Declare a new unsigned long (its a System.UINT64 in VB) that's gonna store the address of the first coordinate and then :

Coordinate(0) = ReadLong("S4Client", firstCoordAddr + &H0)
Coordinate(1) = ReadLong("S4Client", firstCoordAddr + &H8)
Coordinate(2) = ReadLong("S4Client", firstCoordAddr + &H4)


For your other problem, are you sure the base in hex in 1234567 ? That would be odd af.

Well.. It's actually like this :

27z9rq0.png


After i put it like ( in vb.net ) :

WritePointerInteger("S4Client", &H111634, 0, &H4A, &H4C, &H2C, &H400)

Or

If CheckBox11.Checked = True Then
Dim s4proc As Process() = Process.GetProcessesByName("S4Client")
Dim modules4 As System.Diagnostics.ProcessModule = s4proc(0).MainModule
Dim baseaddr As Long = TextBox1.Text = ReadLong("S4Client", modules4.BaseAddress + &H111634,)
Dim firstadd As Long = ReadLong("S4Client", baseaddr + &H20A)
firstadd = ReadLong("S4Client", baseaddr + &H4A)
firstadd = ReadLong("S4Client", baseaddr + &H4C)
firstadd = ReadLong("S4Client", baseaddr + &H2C)
firstadd = ReadLong("S4Client", baseaddr + 400)
WriteLong("S4Client", baseaddr, 0)
End If

^ It doesn't work aswell..

I'm noob at writing base addy + offsets. T.T
 
davydavekk

davydavekk

Level 5
Level 4
Level 3
Level 2
Level 1
23 Mai 2013
508
0
322
'merica
You are doing it wrong. Read if you want to understand how pointers work.

Your code is just reading at a certain address + offset, and setting the result as the value of the variable firstadd. (and btw, what's in textbox1 ?)

It should go like that :
Code:
'pseudo-code
ptr = ReadProcessMemory(baseAddress)
ptr = ReadProcessMemory(ptr + offset)
etc ...
 
Statut
La discussion n'est pas ouverte à d'autres réponses