• Welcome to Valhalla Legends Archive.
 

Porting C++ to VB

Started by Eric, February 09, 2004, 01:03 AM

Previous topic - Next topic

Eric

Edit: Accidental double post

Eric

#1
I've been working on porting BnetAuth.dll from C++ to VB so that I can insert it into my VB project without having to include the extra .dll file.
I've gotten a decent amount of the password hashing finished, however I'm stuck.

hashbuf[] is referring to an unsigned long array cotaining 5 blocks of information, each block being 10 bytes long.

What I'm confused about is what exactly hashbuf+5 does, I think it's joining the array someway, but I don't know exactly how.

iago

#2
You can add to an array instead of indexing into it, so this:
a = array[ 7 ];
is the same as
a = array + 7;

or
a = array[ 0 ];
is the same as
a = *array;

Don't forget, however, that Visual Basic doesn't have unsigned datatypes. I hope you have some workaround for that.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


UserLoser.

Quote from: LoRd[nK] on February 09, 2004, 01:04 AM
I've been working on porting BnetAuth.dll from C++ to VB so that I can insert it into my VB project without having to include the extra .dll file.
I've gotten a decent amount of the password hashing finished, however I'm stuck.

hashbuf[] is referring to an unsigned long array cotaining 5 blocks of information, each block being 10 bytes long.

What I'm confused about is what exactly hashbuf+5 does, I think it's joining the array someway, but I don't know exactly how.

I have everything ported over into VB - If you want it, I can send it to you when I get home

MyndFyre

Quote from: UserLoser. on February 09, 2004, 10:43 AM
Quote from: LoRd[nK] on February 09, 2004, 01:04 AM
I've been working on porting BnetAuth.dll from C++ to VB so that I can insert it into my VB project without having to include the extra .dll file.
I've gotten a decent amount of the password hashing finished, however I'm stuck.

hashbuf[] is referring to an unsigned long array cotaining 5 blocks of information, each block being 10 bytes long.

What I'm confused about is what exactly hashbuf+5 does, I think it's joining the array someway, but I don't know exactly how.

I have everything ported over into VB - If you want it, I can send it to you when I get home

He's obviously showing the initiative to do it himself....  Why don't you point him in the right direction and help him out?  In the end, that will be a lot better for him anyway....
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Kp

Quote from: iago on February 09, 2004, 08:09 AMa = array[7];
is the same as
a = array + 7;

or
a = array[ 0 ];
is the same as
a = *array;

Not quite.  array[ 7 ] refers to the value at offset 7 in the array.  array+7 refers to the address of the element at offset 7.  That is, *(array+7) == array[ 7 ].  Alternately,  &array[ 7 ] == array+7.

No challenge to your second statement, but the forum did damage it (hid your subscript zero).
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

iago

Quote from: Kp on February 09, 2004, 04:36 PM
Quote from: iago on February 09, 2004, 08:09 AMa = array[7];
is the same as
a = array + 7;

or
a = array[ 0 ];
is the same as
a = *array;

Not quite.  array[ 7 ] refers to the value at offset 7 in the array.  array+7 refers to the address of the element at offset 7.  That is, *(array+7) == array[ 7 ].  Alternately,  &array[ 7 ] == array+7.

No challenge to your second statement, but the forum did damage it (hid your subscript zero).

You're right about everything.  That was my bad not dereferencing, and I fixed the thing that board broke.
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*