PDA

Просмотр полной версии : RSA


kargo
05.05.2010, 18:05
Здравствуйте, я пытаюсь сделать loginserver эмулятор в Delphi, У тебя есть какие-либо примеры ребята шифрования RSA?

Извините, переводчик:D

Добавлено через 19 часов 48 минут
Эй, кто-то может объяснить мне, как это loginserver склепа? Является ли его использовать XOR?

И еще один qustion, что пакет сервера отправить GameServer IP? Это одна?

1a 00 ac 7e 71 08 5a b4 f4 a8 e7 d6 e1 90 85 ab 0b 41 a7 89 81 05 17 b1 e0 c4

QaK
05.05.2010, 18:29
kargo, do not use translator, it's suck.:confused:

Xen
05.05.2010, 18:34
RSA слишком сложно

kargo
05.05.2010, 18:39
Hehe i wonder how works this translator :P

Is last packet send from server new IP of gameserver?

Look at this :D

procedure TForm1.IdTCPServer1Execute(AThread: TIdPeerThread);
procedure HexToBuff(hex:string);
var
a : integer;
convert : string;
begin
Packet.Size := length(hex) div 2;
for a := 0 to (length(hex) div 2)-1 do begin
convert := '$'+hex[a*2+1]+hex[a*2+2];
if length(convert) = 3 then begin
Packet.Buff[a] := strtoint(convert);
end;
end;
end;
var
hexi : string;
LastRecv: Byte;
begin
try
Athread.Connection.ReadBuffer(ReadPacket.Buff, 2);
LastRecv := ReadPacket.Buff[0];
with ReadPacket do begin
if Buff[0] = $2A then Size := 40;
if Buff[0] = $B2 then Size := 176;
if Buff[0] = $22 then Size := 32;
end;
Athread.connection.readbuffer(ReadPacket.Buff, ReadPacket.Size);

if LastRecv = $2A then begin
AThread.Connection.Socket.ConnectClient('127.0.0.1 ', 7777, '127.0.0.1', 5000, 7000, 8000, -1);
hexi := '2a00';
HexToBuff(hexi);
Athread.Connection.WriteBuffer(Packet.Buff, 2);

hexi := 'ed415416247fca586b8aae0f9be333f26b8aae0f9be333f25 0f180c7377d74332cb8c2612b3a276f';
HexToBuff(hexi);
AThread.connection.WriteBuffer(Packet.Buff, Packet.Size);
end;

if LastRecv = $B2 then begin
hexi := '4200';
HexToBuff(hexi);
Athread.Connection.WriteBuffer(Packet.Buff, 2);

hexi := '55dd3d3055c522dc463fdbb18cde12f24f868881fa4ca0f26 b8aae0f9be333f26b8aae0f9be333f26b8aae0f9be333f27ef cd76091496db7cba401fb92a9f292';
HexToBuff(hexi);
Athread.Connection.WriteBuffer(Packet.Buff, Packet.Size);
end;

if LastRecv = $22 then begin
if id > 0 then begin
hexi := '1a00';
HexToBuff(hexi);
Athread.Connection.WriteBuffer(Packet.Buff, 2);

hexi := 'ac7e71085ab4f4a8e7d6e19085ab0b41a789810517b1e0c4' ;
HexToBuff(hexi);
Athread.Connection.WriteBuffer(Packet.Buff, Packet.Size);
log.lines.add('done..');
exit;
end;
hexi := '9200';
HexToBuff(hexi);
Athread.Connection.WriteBuffer(Packet.Buff, 2);

hexi := 'ee32e6c07b0975d5880a69d3dcf213033c6959a0663fbee2b 020b24398ef85ccf862'+
'1ed708b8a388e56b5a84ba92b9de0ad1a9b706ec7a5c06aff f3b04c234e59855282e443ff830d5948c3ed6febbe5339bdc4 0b54ae3f983fcdbc7c6572e9c446c0930c2fe54eecf848e1cc dbf86acae734bf0593877319e530c3a99fbe7354a1d470a0fb 042c74e3cd4003f497581';
HexToBuff(hexi);
Athread.Connection.WriteBuffer(Packet.Buff, Packet.Size);
id := id +1;
end;
except
log.lines.add('except dc');
athread.connection.disconnect;
end;
end;

This one is last packet sent
if id > 0 then begin
hexi := '1a00';
HexToBuff(hexi);
Athread.Connection.WriteBuffer(Packet.Buff, 2);

hexi := 'ac7e71085ab4f4a8e7d6e19085ab0b41a789810517b1e0c4' ;
HexToBuff(hexi);
Athread.Connection.WriteBuffer(Packet.Buff, Packet.Size);
log.lines.add('done..');
exit;
end;

How can i redirect client to GameServer after this? Or as i said last packet include IP and port?

Prixmegently
05.05.2010, 20:27
Threre is la2_client_emu on delphi, google it.

kargo
06.05.2010, 15:51
Well, i guess on russian sites:D

Btw. im trying to write server emu not client :P for my own experience

Добавлено через 13 часов 55 минут
I found that la2 client emu, but its not prepared even for Interlude, however i found there some very useful informations about structure :P

But how it works on CT2? Init packet got 186 bytes. So way that i get RSA key is : decrypt with BF, find key in packet? or xor also?:P And where exacly is this key alocate? In that client i can see its 12th byte, was that changed in CT2?

kargo
12.05.2010, 03:23
Well, my loginserver works fine.. i mean fine, but w/o RSA yet.

When i try to decrypt my buff using LockBox, i got msg block re not correct. Anyway im working all the time with it, anyone know better way to decrypt it?