On Thu, Sep 29, 2011 at 11:44:10AM +0200, nks escher wrote:
> I am trying to do a RIM_JavaLoader deviceinfo with just raw commands. In
> order to to this quick and dirty I changed the Controller::SelectMode
> function, present in src/controller.cc, while using brawchannel as a base.

Is this for personal research, or are you working around some limitation
in the library?  If the latter, please tell me, so I can fix the library. :-)


> I tried to use "m_zero.Receive(response);" here and there, maybe multiple
> responses interfere with the communication. However, no success. With using
> the -v option the following output is generated:
> 
> BulkWrite to endpoint 0x2:
>     00000000: 00 00 18 00 07 ff 00 07 52 49 4d 5f 4a 61 76 61
>  ........RIM_Java
>     00000010: 4c 6f 61 64 65 72 00 00                          Loader..

Mode open packet.


> SocketZero::RawReceive: Endpoint 82
> Received:
>     00000000: 00 00 30 00 08 03 00 07 52 49 4d 5f 4a 61 76 61
>  ..0.....RIM_Java
>     00000010: 4c 6f 61 64 65 72 00 00 00 00 00 00 01 00 08 00
>  Loader..........
>     00000020: 02 00 08 00 03 01 00 00 04 01 00 00 05 10 03 00
>  ................

Mode response packet.


> BulkWrite to endpoint 0x2:
>     00000000: 00 00 08 00 0a 03 00 08                          ........
> 
> SocketZero::RawReceive: Endpoint 82
> Received:
>     00000000: 00 00 08 00 10 03 00 08                          ........

Socket open and success.


> SocketZero::RawReceive: Endpoint 82
> Received:
>     00000000: 00 00 0c 00 13 03 01 00 00 00 00 00              ............

Sequence packet.


> SocketZero::RawReceive: Endpoint 82
> Received:
>     00000000: 03 00 05 00 01                                   .....

Javaloader junk packet.  (we don't know exactly what this means, but doesn't
hurt to throw it away)


> BulkWrite to endpoint 0x2:
>     00000000: 03 00 08 00 64 00 00 00                          ....d...

Javaloader HELLO, simple command, no data.


> SocketZero::RawReceive: Endpoint 82
> Received:
>     00000000: 00 00 0c 00 13 03 01 00 01 00 00 00              ............

Sequence packet.


> SocketZero::RawReceive: Endpoint 82
> Received:
>     00000000: 03 00 08 00 65 00 00 00                          ....e...

Javaloader HELLO ACK from device.


> BulkWrite to endpoint 0x2:
>     00000000: 03 00 08 00 70 00 01 00                          ....p...

Javaloader UNKNOWN1 command (used to start stream)


> SocketZero::RawReceive: Endpoint 82
> Received:
>     00000000: 00 00 0c 00 13 03 01 00 02 00 00 00              ............

Sequence packet.

So the device is waiting for you to request the next javaloader response.
And probably because you haven't been reading all the sequence packets,
you've been writing commands way ahead of the device, and the handshaking
is out of whack.

Since it looks like you're using SocketZero, all the sequence packet
handling is up to you.  Since you're also using version 0.17.x, then
even at the non-zero socket level, the sequence packet handling is
somewhat up to you.  In version 0.18, I've tried to hide this sequence
packet handling inside the socket layer, so that the API is closer to
the Windows COM routines.  That's what the "SyncSend()" stuff is for
in 0.18.

Note that Javaloader commands are in the form of (cmd + size) + data.
Some commands are only commands and have no data packets.  Others have
data packets along behind.

You can see some of the logic in m_javaloader.cc.  It uses packet.cc
to create the raw data packets in memory.

Hope that helps,
- Chris


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Barry-devel mailing list
Barry-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/barry-devel

Reply via email to