{"action":"opened","issue":{"url":"https://api.github.com/repos/L2J/L2J_Server/issues/155","labels_url":"https://api.github.com/repos/L2J/L2J_Server/issues/155/labels{/name}","comments_url":"https://api.github.com/repos/L2J/L2J_Server/issues/155/comments","events_url":"https://api.github.com/repos/L2J/L2J_Server/issues/155/events","html_url":"https://github.com/L2J/L2J_Server/issues/155","id":119821695,"number":155,"title":"Question about the Init packet","user":{"login":"Exilor","id":5578107,"avatar_url":"https://avatars.githubusercontent.com/u/5578107?v=3","gravatar_id":"","url":"https://api.github.com/users/Exilor","html_url":"https://github.com/Exilor","followers_url":"https://api.github.com/users/Exilor/followers","following_url":"https://api.github.com/users/Exilor/following{/other_user}","gists_url":"https://api.github.com/users/Exilor/gists{/gist_id}","starred_url":"https://api.github.com/users/Exilor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Exilor/subscriptions","organizations_url":"https://api.github.com/users/Exilor/orgs","repos_url":"https://api.github.com/users/Exilor/repos","events_url":"https://api.github.com/users/Exilor/events{/privacy}","received_events_url":"https://api.github.com/users/Exilor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-01T22:21:40Z","updated_at":"2015-12-01T22:21:40Z","closed_at":null,"body":"I've been trying to understand the way L2's packets are created and encrypted. \r\nTo accomplish that I've hardcoded everything that is random in the Init packet (and the xor key in NewCrypt's encXORPass) so I would always receive the same data when I connected to the server.\r\n\r\nHowever there must be something that I've overlooked because part of the packet still changes from connection to connection.\r\n\r\nHere are the parameters I've hardcoded:\r\n\r\n```java\r\n// com.l2jserver.loginserver.network.serverpackets.Init\r\npublic Init(byte[] publickey, byte[] blowfishkey, int sessionId)\r\n\t{\r\n\t\t_sessionId = 134;\r\n\t\t_publicKey = // a byte[] from 0 to 127 (128 bytes)\r\n\t\t_blowfishKey = // a byte[] from -128 to -113 (16 bytes)\r\n\t}\r\n```\r\nAnd in ```com.l2jserver.util.crypt.LoginCrypt``` I changed the random xor key to be always ```740365835```.\r\n\r\n\r\n\r\nThen I connect to the login server, read the first two bytes that indicate that Init's size is 186 and then the rest of the packet (184 bytes):\r\n\r\n```[51, 66, 65, 43, 43, 227, 75, 50, 112, 127, 99, 99, 58, 153, 113, 91, 205, 72, 192, 42, 250, 99, 80, 163, 229, 68, 101, 153, 99, 87, 121, 215, 107, 48, 143, 137, 98, 40, 170, 139, 35, 2, 179, 166, 134, 223, 32, 18, 74, 213, 39, 116, 16, 244, 77, 156, 77, 4, 9, 1, 71, 239, 119, 87, 40, 197, 173, 27, 235, 12, 75, 181, 83, 87, 174, 71, 135, 48, 21, 28, 145, 192, 176, 99, 142, 148, 80, 152, 170, 29, 204, 170, 102, 7, 141, 53, 226, 121, 205, 87, 180, 192, 2, 205, 165, 73, 199, 110, 193, 244, 82, 82, 173, 157, 204, 69, 237, 241, 32, 239, 95, 102, 223, 170, 96, 183, 203, 23, 39, 241, 166, 181, 33, 11, 174, 0, 88, 18, 228, 211, 96, 79, 92, 43, 158, 13, 75, 92, 186, 59, 81, 105, 19, 180, 209, 233, 130, 60, 69, 50, 116, 79, 247, 38, 34, 239, 133, 169,``` **168, 225, 113, 241, 194, 54, 151, 110, 18, 19, 179, 230, 50, 135, 91, 95**```]```\r\n\r\nThe packet is always the same on every connection except for the last 16 bytes that I've bolded which appear to be random.\r\n\r\nAny insight on why this happens would be greatly appreciated :disappointed: "}}