【发布时间】:2021-07-04 01:36:42
【问题描述】:
iPhone 上有一个应用程序,该应用程序通过 TCP 端口将人脸数据转发到其 iClone 应用程序 通过 Wireshark,我查看了从手机传输到计算机的内容
而从电脑到手机,我不知道它在那里发送了什么,也许是连接了什么
18 c0 4d 34 75 02 c2 2c 80 32 56 db 08 00 45 00 ..M4u..,.2V...E.
0010 02 72 00 00 40 00 40 06 de 55 ac 10 01 0b ac 10 .r..@.@..U......
0020 01 05 03 e7 c5 8d 2c e8 b3 6b 0a 28 cb 70 50 18 ......,..k.(.pP.
0030 20 00 00 ec 00 00 65 79 65 4c 6f 6f 6b 49 6e 5f .....eyeLookIn_
0040 52 20 3a 20 31 33 2c 6d 6f 75 74 68 44 69 6d 70 R : 13,mouthDimp
0050 6c 65 5f 52 20 3a 20 34 2c 63 68 65 65 6b 53 71 le_R : 4,cheekSq
0060 75 69 6e 74 5f 4c 20 3a 20 34 2c 65 79 65 4c 6f uint_L : 4,eyeLo
0070 6f 6b 49 6e 5f 4c 20 3a 20 30 2c 6a 61 77 52 69 okIn_L : 0,jawRi
0080 67 68 74 20 3a 20 30 2c 65 79 65 4c 6f 6f 6b 44 ght : 0,eyeLookD
0090 6f 77 6e 5f 4c 20 3a 20 30 2c 6e 6f 73 65 53 6e own_L : 0,noseSn
00a0 65 65 72 5f 4c 20 3a 20 36 2c 6d 6f 75 74 68 46 eer_L : 6,mouthF
00b0 72 6f 77 6e 5f 52 20 3a 20 31 31 2c 6d 6f 75 74 rown_R : 11,mout
00c0 68 52 6f 6c 6c 4c 6f 77 65 72 20 3a 20 31 30 2c hRollLower : 10,
00d0 6d 6f 75 74 68 53 74 72 65 74 63 68 5f 52 20 3a mouthStretch_R :
00e0 20 31 36 2c 6d 6f 75 74 68 44 69 6d 70 6c 65 5f 16,mouthDimple_
00f0 4c 20 3a 20 34 2c 6d 6f 75 74 68 53 68 72 75 67 L : 4,mouthShrug
0100 55 70 70 65 72 20 3a 20 31 33 2c 62 72 6f 77 4f Upper : 13,browO
0110 75 74 65 72 55 70 5f 52 20 3a 20 30 2c 6d 6f 75 uterUp_R : 0,mou
0120 74 68 4c 6f 77 65 72 44 6f 77 6e 5f 4c 20 3a 20 thLowerDown_L :
0130 31 31 2c 6d 6f 75 74 68 43 6c 6f 73 65 20 3a 20 11,mouthClose :
0140 32 31 2c 65 79 65 57 69 64 65 5f 52 20 3a 20 33 21,eyeWide_R : 3
0150 36 2c 6d 6f 75 74 68 50 72 65 73 73 5f 4c 20 3a 6,mouthPress_L :
0160 20 35 2c 6d 6f 75 74 68 52 6f 6c 6c 55 70 70 65 5,mouthRollUppe
0170 72 20 3a 20 38 2c 65 79 65 4c 6f 6f 6b 44 6f 77 r : 8,eyeLookDow
0180 6e 5f 52 20 3a 20 30 2c 6d 6f 75 74 68 46 72 6f n_R : 0,mouthFro
0190 77 6e 5f 4c 20 3a 20 38 2c 62 72 6f 77 44 6f 77 wn_L : 8,browDow
01a0 6e 5f 4c 20 3a 20 32 2c 65 79 65 42 6c 69 6e 6b n_L : 2,eyeBlink
01b0 5f 52 20 3a 20 30 2c 6d 6f 75 74 68 4c 65 66 74 _R : 0,mouthLeft
01c0 20 3a 20 33 2c 65 79 65 42 6c 69 6e 6b 5f 4c 20 : 3,eyeBlink_L
01d0 3a 20 30 2c 65 79 65 4c 6f 6f 6b 4f 75 74 5f 4c : 0,eyeLookOut_L
01e0 20 3a 20 33 2c 62 72 6f 77 4f 75 74 65 72 55 70 : 3,browOuterUp
01f0 5f 4c 20 3a 20 30 2c 68 65 61 64 5f 55 70 20 3a _L : 0,head_Up :
0200 20 32 39 2e 32 32 38 30 30 34 2c 68 65 61 64 5f 29.228004,head_
0210 4c 65 66 74 20 3a 20 30 2e 30 35 33 38 37 36 36 Left : 0.0538766
0220 34 36 2c 68 65 61 64 5f 52 69 67 68 74 54 69 6c 46,head_RightTil
0230 74 20 3a 20 37 2e 31 37 38 37 34 37 37 2c 48 65 t : 7.1787477,He
0240 61 64 50 6f 73 58 20 3a 20 30 2e 30 33 31 39 32 adPosX : 0.03192
0250 32 32 2c 48 65 61 64 50 6f 73 59 20 3a 20 30 2e 22,HeadPosY : 0.
0260 30 32 35 34 36 38 39 32 39 2c 48 65 61 64 50 6f 025468929,HeadPo
0270 73 5a 20 3a 20 30 2e 34 33 33 31 35 38 30 34 2c sZ : 0.43315804,
但我就是数不过来。我有什么:
static NetworkStream stream;
static TcpClient client;
static BinaryReader reader;
static BinaryWriter writer;
private const int port = 999;
private const string server = "192.168.0.23";
static void Main (string [] args)
{
ConStack ();
}
static void ConStack ()
{
client = new TcpClient ();
client.Connect (server, port); // client connection
var stream = client.GetStream (); // returns a NetworkStream object
reader = new BinaryReader (stream, Encoding.Unicode, false);
writer = new BinaryWriter (stream, Encoding.Unicode, true);
//writer.Write("JawOpen "); // When trying to send any message, the program flies into Exception and close program for iPhone| upd. Although I noticed that not all lines are crashed
// start a new thread to receive data
Thread receiveThread = new Thread (new ThreadStart (ReceiveMessage));
receiveThread.Start (); // start stream
Console.WriteLine ("Start Thread");
}
static void ReceiveMessage ()
{
byte [] data = new byte [1065]; // buffer for received data
StringBuilder builder = new StringBuilder ();
while (true)
{
try
{
var byt = reader.Read(data, 0, data.Length);
builder.Append (Encoding.Unicode.GetString (data, 0, byt));
Console.WriteLine (builder.ToString ());
// I get emptiness
}
catch (Exception ex)
{
Console.WriteLine ("Connection aborted! \ N {0}", ex.Message);
Console.ReadLine ();
}
}
}
因此,如果我不发送消息,则会收到空白行和reader.Read == 0。
【问题讨论】:
-
TCP 只是一个数据流……您必须想出一种方法来确定一条消息何时完成。通过使用特殊的分隔符 .. 对基于字符串的消息可行,但对二进制内容不利...您必须接收一条消息......两者都要求手机上的应用程序也符合相应的协议
-
顺便说一句,第一个图像(Wireshark 中的第二个条目)只是您的 PC 对电话的 TCP 包已成功传送的响应;)这就是为什么 ist 没有数据,只有一个标头。您对从手机传入 PC 的数据更感兴趣;)
-
@derHugo image packet 包的长度总是不同的。或者更确切地说,我扫描了包裹,发现包裹的大小从 612 到 1812 但这又是主观的。包的大小取决于其中提供的数据。在包中,我想从 iPhone 程序中获取面部网格。我提供的截图是iPhone上的FACE LIVE程序与Realussion iClone程序ip 172.16.1.5 PC(iClone) ip 172.16.1.11 iPhone的交互
-
我还没有用 Wireshark 测试过我的应用和 iPhone 截图显示包的结尾总是一样的
HeadPosZ : 0.4320508, -
在我看来,
,后面的内容更像是下一个包中的更多内容;)