[VB6-317] Basic login handling
Hey guys,
I still had a old project i once made.
Its far from being done or anything but you can login.
And read the username and password from the client.
Its made in no not java but vb6..
Yeah i know but yet here it is..
The code is added to a early version of Basic-Server.
A server base i normaly use in vb6 the latest has error handling sql handling and normal packet handling.
And even better socket handling then this version its added to.
But here it is so have fun ? or something?
Download!
Re: [VB6-317] Basic login handling
Haha well done Thugie, I never thought anyone would get around to trying to make a base in VB6. Ofcourse the are so many reasons for this I won't think to list them, you've actually gone and done it :thumbup:
So what are your plans, will you attempt the rest of the server? Or leave it here, to prove it could atleast be done :ott1:
Re: [VB6-317] Basic login handling
Oh jeez! Where have you been jerk?!
I remember you mentioned this before, and I see it never got finished. That's how it goes for me as well xD
Thanks for the release, I'm the VB boys will like the attention
Re: [VB6-317] Basic login handling
Yeah i found it on a old harddrive.
Removed a few bugs as it didnt read the username and pass.
So i fixed that up and though why not share people might like it.
And for finishing it that will never happen.
Might continue a bit more but will have to convert the crypt..
And where have i been all around doing about just anything + mostly real life work gf and stuff :).
Re: [VB6-317] Basic login handling
I feel ya man, I got a lot of work goin on and stuff too. If you need, I have the packet documentation and the protocol for login if you want it, rather than looking through an ugly client class.
crypt is ripped anyways, so a rewrite will really improve it's performance
Re: [VB6-317] Basic login handling
Awww come now, this masterpiece needs finishing Thugie! Don't let the dream die :lol:
Someone might actually find a use for it, I'd be interested to see what they do with that aswell!
Gah, you're not allowed a real life, well atleast you're still popping in and out mate, just make it more frequent :wink:
Re: [VB6-317] Basic login handling
If you check my profile you can see I'm still active on rz :).
And for the cryption i will probably just convert it though.
And yeah if you got a clear document that would really help ghost :)
1 Attachment(s)
Re: [VB6-317] Basic login handling
This is as much info as I got, I formatted it a bit to make it easier to read. The last section is packet information
Cheers, mate
Re: [VB6-317] Basic login handling
Psht ain't we all? Problem is we need to be more active here. But yeah, we all got distracted I think. Sad times.
Well I'll be interested to see just how far you get with this, butI imagine performance is nothing to write home about?
Re: [VB6-317] Basic login handling
Well that mostly depends on how you code it isn't it ?
Code:
Dim cryptVar1 As Integer, cryptVar2 As Integer, cryptVar3 As Integer
Dim cryptArray(256) As Integer, keySetArray(256) As Integer, keyArrayIdx As Integer
Private Function generateNextKeySet()
Dim i As Integer, j As Integer, k As Integer
cryptVar2 = cryptVar2 + (cryptVar3 + 1)
For i = 0 To 255
j = cryptArray(i)
If (i & 3) = 0 Then
cryptVar1 = cryptVar1 ^ ShiftLeft(cryptVar1, 13)
ElseIf (i & 3) = 1 Then
cryptVar1 = cryptVar1 ^ ShiftRight(cryptVar1, 6)
ElseIf (i & 3) = 2 Then
cryptVar1 = cryptVar1 ^ ShiftLeft(cryptVar1, 2)
ElseIf (i & 3) = 3 Then
cryptVar1 = cryptVar1 ^ ShiftRight(cryptVar1, 16)
End If
cryptVar1 = cryptVar1 & cryptArray(i + 128)
k = cryptArray(ShiftRight((j & "&H3FC"), 2) + cryptVar1 + cryptVar2)
cryptArray(i) = k
cryptVar2 = cryptArray(ShiftRight(ShiftRight(k, (8 & "&H3FC"))), 2) + j
keySetArray(i) = cryptVar2
End Function
A begin not tested or even looked over twice.
I guess its a begin right ?
Re: [VB6-317] Basic login handling
looks good to me. Of course, I am not versed in VB. but from snippets I've seen, it looks good
When I go over the Stream and Cryption classes, if I manage to refactor em properly (mainly for legality sake), I'll make sure to hand you a copy
Re: [VB6-317] Basic login handling
Looks sweet, will download now and take a look.
Re: [VB6-317] Basic login handling
Btw isn't there a way to disable the whole isaac cipher ?
It seems you can bypass it but then you wont obtain username + password so thats useles :p.
Re: [VB6-317] Basic login handling
well it's completely possible to disable it, I mean it's just like RSA... The only problem is you're increasing the risk there man.
wait, I don't think the user and pass are ciphered
As far as I remember, it's just plain text. Or rather, the user and password are converted to longs and then split up into a byte array and passed to the server. Shit I gotta look this up. Going to bed, I'll have a proper answer for you in the mornin'
Re: [VB6-317] Basic login handling
The username and pass are just plain text as the rsa is disabled.
But for easy use and the boredom of converting the isaaccipher.
I just wanted to disable it for until a later time :p.
Damn converting the isaac cipher is a pain!
Nobody wanna do it for me ? 8(
btw i guess i have disabled it in my client just no server to test it on :D.
Re: [VB6-317] Basic login handling
Yay i got a i think working isaac cipher .ocx :) named Cryption.ocx and i should be able to use it in vb6 i do get results but not yet sure if it works or not :p.
Edit:
Just compared the result! it works perfectly :D. yay?
If i really wanna work on this i have to do alot alot alot of recoding.
How about i also release the ocx. with a bit info on how to use it.
And some other people do some work ?
Edit2:
Well kinda busy with life right now.
But will probably remake it in my new server-base as its more stable etc.
And has mysql + error control etc.
and a packet handler but i probably have to rewrite that one as its well..
not really useful for the runescape packets.
will add the isaac cipher etc.
Will first get login fully working then see what to add next.
probably find a easy way to add new packets.
so it wont get a bigass mess like client.java in the old servers haha.
Re: [VB6-317] Basic login handling
bro, lemme give you some food for teh server. Either today or tomorrow, I'm posting a whitescape source I've been working on (old school ftw). It has not only the thread per client removed, but I might be adding in an event manager that removes the need for the process() methods of the "handlers." maybe it'd do you good to take a look at it when I'm finished with it
Re: [VB6-317] Basic login handling
Key yeah sure,
More interested in the packet formats though.
opcode,size,format,name,info about the packet etc
Edit:
Is there a way to keep just 1 in/out cryption module loaded..
Not 1 each player.
Its easy to make the keys static already fixt that.. if i wanted to.
But then still as for each player it still needs there own count..
So is there a way to like.. make the key update to the new count.
I'm thinking if i can recode the cryption module a bit so i can select what pase it was at for the cur player.
Edit2:
Seems it just counts down from 255 to 0 then 255 again..
Wow seems i forgot it reGenerates the keyset.. damn.
Gone check what changes :p lol
Edit3:
Well it seems all possible,
I just have to store the crypt values for each client.
And update the crypt for each packet its quite easy.
Its not 2 crypts per client in/out.
Its then 1 crypt that gets 1 random key on server startup.
The client gets 1 little edit that disabled the random generation for the client key.
Could base it on the server key or just use the server key twice ?
That is what I'm doing atm.
So its like this
server startup>gen key>init crypt>get incomming connections etc etc etc..
Now the server sends the key that got gen the client sends well i guess a key we can ignore.. as its the server key twice ?
set the crypt values for the client in/out values.
just change the function to accept extra values and let it use those :p.
easy right ?
startup read these values when calling crypt set these vars.
then when done store them again so its ready for the next crypt :).
Code:
public int keyArrayIdx = 0;
public int keySetArray[] = null;
public int cryptArray[] = null;
public int cryptVar1 = 0;
public int cryptVar2 = 0;
public int cryptVar3 = 0;
Edit Again?:
Btw guys i need info about the packetSize array.
Is the client array the same for the server and handled the same?
As i see this being used in server
Code:
static int packetSizes[256] = {
0, 0, 0, 1, -1, 0, 0, 0, 0, 0, //0
0, 0, 0, 0, 8, 0, 6, 2, 2, 0, //10
0, 2, 0, 6, 0, 12, 0, 0, 0, 0, //20
0, 0, 0, 0, 0, 8, 4, 0, 0, 2, //30
2, 6, 0, 6, 0, -1, 0, 0, 0, 0, //40
0, 0, 0, 12, 0, 0, 0, 0, 8, 0, //50
0, 8, 0, 0, 0, 0, 0, 0, 0, 0, //60
6, 0, 2, 2, 8, 6, 0, -1, 0, 6, //70
0, 0, 0, 0, 0, 1, 4, 6, 0, 0, //80
0, 0, 0, 0, 0, 3, 0, 0, -1, 0, //90
0, 13, 0, -1, 0, 0, 0, 0, 0, 0,//100
0, 0, 0, 0, 0, 0, 0, 6, 0, 0, //110
1, 0, 6, 0, 0, 0, -1, 0, 2, 6, //120
0, 4, 6, 8, 0, 6, 0, 0, 0, 2, //130
0, 0, 0, 0, 0, 6, 0, 0, 0, 0, //140
0, 0, 1, 2, 0, 2, 6, 0, 0, 0, //150
0, 0, 0, 0, -1, -1, 0, 0, 0, 0,//160
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //170
0, 8, 0, 3, 0, 2, 0, 0, 8, 1, //180
0, 0, 12, 0, 0, 0, 0, 0, 0, 0, //190
2, 0, 0, 0, 0, 0, 0, 0, 4, 0, //200
4, 0, 0, 0, 7, 8, 0, 0, 10, 0, //210
0, 0, 0, 0, 0, 0, -1, 0, 6, 0, //220
1, 0, 0, 0, 6, 0, 6, 8, 1, 0, //230
0, 4, 0, 0, 0, 0, -1, 0, -1, 4,//240
0, 0, 6, 6, 0, 0 //250-255
};
And this in the client
Code:
public static final int[] packetSizes = {
0, 0, 0, 0, 6, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, -2, 4, 3, 0, 0, 0,
0, 0, 0, 0, 5, 0, 0, 6, 0, 0,
9, 0, 0, -2, 0, 0, 0, 0, 0, 0,
-2, 1, 0, 0, 2, -2, 0, 0, 0, 0,
6, 3, 2, 4, 2, 4, 0, 0, 0, 4,
0, -2, 0, 0, 7, 2, 0, 6, 0, 0,
0, 0, 0, 0, 0, 0, 0, 2, 0, 1,
0, 2, 0, 0, -1, 4, 1, 0, 0, 0,
1, 0, 0, 0, 2, 0, 0, 15, 0, 0,
0, 4, 4, 0, 0, 0, -2, 0, 0, 0,
0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 0, 14, 0, 0,
0, 4, 0, 0, 0, 0, 3, 0, 0, 0,
4, 0, 0, 0, 2, 0, 6, 0, 0, 0,
0, 3, 0, 0, 5, 0, 10, 6, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, -1, 0, 0, 0,
4, 0, 0, 0, 0, 0, 3, 0, 2, 0,
0, 0, 0, 0, -2, 7, 0, 0, 2, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2, -2, 0, 0, 0, 0, 6, 0, 4, 3,
0, 0, 0, -1, 6, 0, 0
};
So if that is correct!
-1 = unknown non-static
0 = well no extra? not used?
1+ = packet size ?
EDIT YAY!??:
Well it seems the cryption works perfectly :).
Just have to make it send crypted opcodes :).
decrypting recieved codes works i think!