I often receive pseudo-packets. Can someone tell me the principle? I looked up the source data! ! ! Less than 5? Why?
if (data.remaining() < 5) {
//op + static code + op == 5 bytes
log.error("收到伪造数据包: " + this);
return false;
}
I often receive pseudo-packets. Can someone tell me the principle? I looked up the source data! ! ! Less than 5? Why?
if (data.remaining() < 5) {
//op + static code + op == 5 bytes
log.error("收到伪造数据包: " + this);
return false;
}
The first 7 bytes of the server packet are 2 bytes size followed by 5 bytes encoded opcode.
The 5 bytes are a mix of obfuscated opcode as well as a static opcode.
For an example to help you visualize this, let say we have a packet of size 10, that's 0x0A in Hex.
The packet structure would look something like this {0x00, 0x0A, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}
The code you posted essentially checks if the encoded opcode length is not less than 5 otherwise it's not a valid encoded opcode size and therefore could be malicious.
I personally don't think it's valid to use such code anymore from a security perspective as the packet structures are public as well as the static opcodes and methods to obfuscate it, publicity of this code defeats the purpose of the code you posted. It could still be useful in the case where you are receiving packets that are not correctly formatted.
Regarding pseudo packets, your code shouldn't be hitting this chunk of code unless you're running an unsupported game client on an unsupported emulator.. or you're sending incorrectly formatted packets to your server ;)
Hope this helps.
Last edited by StingerOne; 18-05-22 at 04:03 PM.
I should have asked these initially, what is the problem you're having? and what do you mean exactly when you say they're pseudo-packets?
If you're using a genuine 4.3 client and it hasn't been downgraded, providing your emulator supports the version of 4.3 you're running, you should have no problems. This is why I guessed it being a compatibility problem.
With my time developing my own emulator, I've noticed there are upper and lower bounds when it comes to different versions of Aion if that makes sense.
Perhaps your emulator that you're running only supports late 4.3 versions meanwhile your version might be early 4.3 or vice versa.
You'll need to be more specific if you still have questions and concerns about getting your issue fixed.
Hope this helps.