Thank you pushedx.
I finally got it. I'm working for Turkish Servers so I think some of the opcodes are different for me. Before I found this topic, I try to use phConnector and phAnalyzer. When I send the login credential to the gateway server I can able to login my char but I can't get any information on phAnalyzer. In phAnalyzer, gateway IP and port were okay, login credentials (username, password, secondary passcode, etc.) were also okay. The last thing needed for the actual game connection is the Agent Server IP address and port. But when are came from the server I wasn't can get any packet data from the phAnalyzer. So after all I tried to use combine two phConnectors together, another proxy sniffer called "XSniff" is not worked for me.
In the end, I found this article. But in this application something was wrong. For example, you used OP:0xA102 for connecting the client to the agent server. But in TrSro this opcode changed to 0xA10A. I was able to fix it after adding some console.writeline actions. When I try to use this state of this program some things still went wrong. When I was looked from phAnalyzer I can see this packet:
[S->C] [23] [0xa10a] [E]
01 9f 00 00 00 0d 00 39 34 2e 31 39 39 2e 31 30 .......94.199.10
33 2e 37 34 d9 56 01 3.74.V..........
But in this Application I saw this packet:
[S->C][A10A][19 bytes][Encrypted]
0000000000 01 97 00 00 00 09 00 31 32 37 2E 30 2E 30 2E 31 .......127.0.0.1
0000000016 81 3E .>.............
The first two bytes in this packet are the "result" and "id" variables which already comes from the actual server, I learned from this application. I don't know anything about the later five bytes. But I know before the IP address part, I have to see seven bytes of data. After these seven bytes, the agent server IP and port are coming. I can able to see the IP addresses easily when I remove the 3's from the sixteens position in a byte and change 0x2E's with dots. Their sizes depend on their lengths. For example, I'm using localhost and it needs 6 bytes for numerical writing. But actual TrSro server using an IP address, which needs 10 bytes. There are the same amount dots( I mean 3 dots). I didn't explain the last three bytes from the output of the phAnalyzer. The first two of the last three bytes are the agent server port in little-endian format. I can easily swap bytes locations between them and convert them from hexadecimal to decimal.
Together with these most of the thing is okay. So well the last byte of the packet? I really can't understand. When I look to especially agent server information packets, there is always one byte after the port information and it contains this "0x01" data. What does the last byte mean? I'm really want to know.
But as you can see this proxy application doesn't send this "0x01" byte to the client. And I usually saw the "result" variable contains my wanted value and I repeated the sending process for the "result" variable. Finally, I can able to get the whole data stream.
As a result, I don't know how can I give my regards. So much thanks pushedx. After a week, I was able to do something.