Click here to Skip to main content
15,895,011 members

Comments by lascuola_marimo (Top 2 by date)

lascuola_marimo 21-Mar-13 19:20pm View    
if i use easyhook library, with this code

<DllImport("Ws2_32.dll")> _
Private Shared Function recv(socketHandle As IntPtr, buf As IntPtr, count As Integer, socketFlags As Integer) As Integer
End Function

<unmanagedfunctionpointer(callingconvention.stdcall, charset:="CharSet.Unicode," setlasterror:="True)"> _
Private Delegate Function Drecv(socketHandle As IntPtr, buf As IntPtr, count As Integer, socketFlags As Integer) As Integer

Private Shared Function recv_Hooked(socketHandle As IntPtr, buf As IntPtr, count As Integer, socketFlags As Integer) As Integer
Dim bytesCount As Integer = recv(socketHandle, buf, count, socketFlags)
If bytesCount > 0 Then
Dim newBuffer As Byte() = New Byte(bytesCount - 1) {}
Marshal.Copy(buf, newBuffer, 0, bytesCount)
Dim s As String = System.Text.UnicodeEncoding.ASCII.GetString(newBuffer)
'Dim s As String = System.Text.ASCIIEncoding.ASCII.GetString(newBuffer)
Dim tw As TextWriter = New StreamWriter("log.txt")
tw.Write(s)
tw.Close()
File.AppendAllText("hook.txt", vbNewLine + vbNewLine + s)

End If
Return bytesCount
End Function

i obtain this text

<cmessagexmlns:xsd="http: www.w3.org="" 2001="" xmlschema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><type>status<from>server<to>1.1::::hljhx2ekkczr5k0tkio3wa00::::1ec0c69::::6b83<vars>r=1&r4=1_1_1_0_1&e7=35&v=618515&z7=0_0&u1=1&k=1&b8=1&o7=1&x=1;1;2;5;1;1;;;;&spos3_0=po_1#co_4#C1&c1=;;1;2;;;;;;&p7=1&z8=1&d2=0&k1=;;;C1|B1;;;;;;&j3=1_1_1_0_0&z1=2&a9=4&w1=1&a=6#[mappa78]:Fold#0#0#0#0#0;6#[lampolight]+%3a+Ha+vinto+un+piatto+di+0%2c10#0#0#0#0#0&h1=;;1;1;;;;;;&a8=1&t1=1&c=0&c2=0&l1=;;;;;;;;;&w=1;1;1;1;1;&b2=15&s1=2;2;1;1;2;2&b1=;;225765;226095;;;;;;&r1=10&a1=;;1;1;;;;;;&e8=1;1;2;2;1;1;;;;&d=-1&m3=1;1;1;1;1;1&x1=1&p1=;;3;;;;;;;&c3=4&d1=;;1;2;;;;;;&g=1&a2=1;1;3;2;1;1&l=1&o1=;;;2;;;;;;&z=;;1;1;;;;;;&y1=mappa78&q1=(Shallow)+Berlino&q7=&z6=0.00&e3=YW761OT8B&v1=&v5=No+Limit+0.05%e2%82%ac%2f0.10%e2%82%ac&j1=;;;;;;;;;&i1=;;;0.15;;;;;;&p4=RAKE%3a+0.00&s3=0.10&m1=;;;;;;;;;&f1=;;mappa78;lampolight;;;;;;&d3=YW761OPMI&q4=0.10&y2=0.10&g1=0;0;1.94;2.67;0;0;;;;&b3=0.10&txtTempPot=0.00&n1=;;Fold;;;;;;;&y8=0&n7=1&f3=0&cmd_spos=1&u3=0&s=1&t=0&u=0&e=-1&g2=0&o=-1&f7=0&<commands>Status<secid>

It semm utf-16. in wich way can i make it radble?
lascuola_marimo 21-Mar-13 11:52am View    
Thanks for reply.
My problem is that chat is not static and i want to get text continuously.
Another proble is the process of image (there are only 4 image: spade, heart, picche).

thanks