-
Apr 29th, 2012, 12:47 PM
#1
Thread Starter
New Member
[RESOLVED] convert Xor C++ to VB6
I am struggling to convert the below code from C++ to VB6, any chance of some help?
i can see the constant "CSTST" is used as the xor key for the first 5 chars of the string, its the "buffit[8 + i] = i * buffit[i];" which i cant get my head around.
TIA
Code:
void Do_enc(uint8_t *buffit) {
const char cst[] = "CSTST";
uint8_t i;
for (i = 0; i < 8; i++) {
buffit[8 + i] = i * buffit[i];
if (i <= 5) {
buffit[i] ^= cst[i];
}
}
}
Last edited by k1nk0; May 1st, 2012 at 06:13 AM.
Reason: [Resolved]
-
Apr 30th, 2012, 08:15 AM
#2
Re: convert Xor C++ to VB6
-
Apr 30th, 2012, 10:24 AM
#3
Thread Starter
New Member
Re: convert Xor C++ to VB6
Thanks for the informative response. Very helpful and appreciated.
I too thought there was something up at the point you have pointed out as the original loop was looking for 6 items in an array with ubound of 5 (or 4 as we are based at 0)
Thanks again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|