Valhalla Legends Forums Archive | General Programming | Porting C++ to VB

AuthorMessageTime
LoRd
Edit: Accidental double post
February 9, 2004, 7:03 AM
LoRd
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.
February 9, 2004, 7:04 AM
iago
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.
February 9, 2004, 2:09 PM
UserLoser.
[quote author=LoRd[nK] link=board=5;threadid=5184;start=0#msg43277 date=1076310294]
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.
[/quote]

I have everything ported over into VB - If you want it, I can send it to you when I get home
February 9, 2004, 4:43 PM
Myndfyr
[quote author=UserLoser. link=board=5;threadid=5184;start=0#msg43307 date=1076344998]
[quote author=LoRd[nK] link=board=5;threadid=5184;start=0#msg43277 date=1076310294]
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.
[/quote]

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

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....
February 9, 2004, 7:55 PM
Kp
[quote author=iago link=board=5;threadid=5184;start=0#msg43292 date=1076335771]a = array[7];
is the same as
a = array + 7;

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

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).
February 9, 2004, 10:36 PM
iago
[quote author=Kp link=board=5;threadid=5184;start=0#msg43395 date=1076366161]
[quote author=iago link=board=5;threadid=5184;start=0#msg43292 date=1076335771]a = array[7];
is the same as
a = array + 7;

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

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).
[/quote]

You're right about everything. That was my bad not dereferencing, and I fixed the thing that board broke.
February 9, 2004, 11:20 PM

Search