|
You last visited: Today at 13:13
Advertisement
[METIN2_GF]New KeyAgreement + PacketEncryption
Discussion on [METIN2_GF]New KeyAgreement + PacketEncryption within the Metin2 Hacks, Bots, Cheats, Exploits & Macros forum part of the Metin2 category.
01/05/2017, 00:14
|
#1
|
elite*gold: 5
Join Date: Dec 2011
Posts: 1,083
Received Thanks: 650
|
[METIN2_GF]New KeyAgreement + PacketEncryption
#removed
|
|
|
01/05/2017, 00:31
|
#2
|
elite*gold: 0
Join Date: Jan 2013
Posts: 4
Received Thanks: 1
|
i don't understand but thank you.
|
|
|
01/05/2017, 00:50
|
#3
|
elite*gold: 281
Join Date: May 2011
Posts: 1,552
Received Thanks: 946
|
Nice
|
|
|
01/05/2017, 20:28
|
#4
|
elite*gold: 405
Join Date: Dec 2007
Posts: 6,615
Received Thanks: 6,358
|
Good job, I have some tips about your programming style though which you of course don't need to follow, but I would recommend you to do so.
You use different c/c++ types for the same variable type. For sizes you used unsigned int and size_t, I recommend using size_t, it will save you from problems that will occur when you switch to x64 bit development. And you should use the <stdint.h> types like uint32_t instead of unsigned int in general.
The other thing are magic values. The small PHP code (please use [code] tags, not [php]) you posted contains 0x41 and 0x20 so often, either you should reuse your variables that contain the value or create a constant and use that. The Activate call even seems wrong because of that, you get the data length back from Prepare, either in dataLength or agreedLength, don't use 0x41 as the argument.
And please use sizeof(keyClient) instead of the magic value 261, maybe it changes in the future and then you have to search through your code to find out why it is not working correctly because you used a magic value.
|
|
|
01/05/2017, 21:54
|
#5
|
elite*gold: 5
Join Date: Dec 2011
Posts: 1,083
Received Thanks: 650
|
Quote:
Originally Posted by Mi4uric3
Good job, I have some tips about your programming style though which you of course don't need to follow, but I would recommend you to do so.
You use different c/c++ types for the same variable type. For sizes you used unsigned int and size_t, I recommend using size_t, it will save you from problems that will occur when you switch to x64 bit development. And you should use the <stdint.h> types like uint32_t instead of unsigned int in general.
The other thing are magic values. The small PHP code (please use [code] tags, not [php]) you posted contains 0x41 and 0x20 so often, either you should reuse your variables that contain the value or create a constant and use that. The Activate call even seems wrong because of that, you get the data length back from Prepare, either in dataLength or agreedLength, don't use 0x41 as the argument.
And please use sizeof(keyClient) instead of the magic value 261, maybe it changes in the future and then you have to search through your code to find out why it is not working correctly because you used a magic value.
|
Aye aye sir, done.
|
|
|
All times are GMT +1. The time now is 13:14.
|
|