Quick development about SP procedures

zhaozj2021-02-17  53

Quick development about SP procedures

For the first time I contacted the SGIP protocol to send a short message for two days, a mist, okay, the network era, collecting a lot of information online, there is also a CMPP

SGIP is Unicom's CMPP is the difference between the two.

Some ready-made development libraries are also searched online, and the trial version is formally used.

And I didn't dare to use its development library. What should I do if I have a back door in that?

Because I do programs, I have some back to make it back, but they will be removed after formally delivered.

Development conditions

1.SGIP protocol description (there are many online)

2.SGIP simulation gateway (there are many online)

3. Master a programming language, including how to make Socket communications in this language

4. UltraEdit This is too important, use it when analyzing the packet

Rapid development conditions

1. I wrote a program A function to listen to a port to receive the data of this port and save it into a file, I want to use the UltraEdit analysis packet.

2. Just find a development library, there is an example of using the development library.

3. Take a pen and notebook, you are not a computer notebook, you can use a notebook that you can use. We can always record some data formats.

I started to get the SGIP protocol, Unicom's protocol is really normative, such as 1 INTEGER, this sentence is the wrong integer is 4. Whether it thinks it is CHAR just 1.

Start your hand

1. Start SGIP analog gateway configuration Because it is analog address set to 127.0.0.1, the port uses the default

II. Compile the example of using the development library and install the instructions to configure it, let it execute. Generally, the SGIP simulation gateway will receive a short message .ok

3. Stop the SGIP analog gateway, launch the program A, listener port 8801, then run the example of using the development library, the program A will receive data at this time

IV. Analyze data

5. The first packet is the identity verification is the bind package. The SGIP protocol is ok, using UltraEdit to open the packet, you should look at HEX.

Look at the Bind package in the SGIP protocol, the first bit is 00 00 00 3D is the 4 digits of the Integer, and the 3D 3D is 10 binding 61, indicating that the Bind package data length is 61 (char). Data Your point in control SGIP protocol is

Six. Now I have to do anything, (I am really bad :-)), we haven't programmed it yet, then we write a program group package to send this intercepted data package, before starting the simulation The gateway, the gateway does not reflect, change the username and password, reissue, the simulation gateway displays the password error, Ha, success.

Seven. Because it is a long connection, after the data is issued, the analog gateway is returned, you also have to understand the format of the package in the SGIP protocol.

8. Change Program A If you receive a return package, tell the client authentication success.

Nine. The future work is a relatively complicated packet group package.

Write here, I don't know much,

Note that the 4-bit data of Integer is right-aligned, which is converted to the original CHAR [5], which is the C language, other languages, please write it yourself.

#define high_priority 1

#define low_priority 0

INT hostByteorder ()

{

Union {

UNSIGNED CHAR C [2];

UNSIGNED SHORT INT I;

} Chartoint;

Chartoint.i = 0x35ca;

IF (chartoint.c [0] == 0x35) Return Low_Priority;

Else return high_priority;

}

Void __stdcall sputl (constling lngdatalen, char * lbuff)

{/ * Converts the integer to 4 bytes of network word sequence * /

Union {

CHAR C [4];

Long L;

} Longtochar;

INT I;

Longtochar.l = lngdatalen;

IF ((HostByteorder ()) == high_priority)

{

For (i = 0; i <4; i )

{

LBUF [I] = longtochar.c [4-i-1];

}

Else

{

For (i = 0; i <4; i )

{

LBUF [i] = longtochar.c [i];

}

}

LBUF [4] = 0x00;

Return;

}

I have been mentioning the program A. This very simple program is the program of the Socket listening port I use BCB5. If you don't write, please contact me.

Other programs, you can go online to search, not available

(All rights reserved, please indicate the author and the source when reproduced)

Wang Yibing

WANGYB@51.net

Wyb45@sohu.com

Bing-a@tom.com

2004-4-19

转载请注明原文地址:https://www.9cbs.com/read-29523.html

New Post(0)