borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (WebControls)Next Topic (how can i do a ocr programm by c#) New Topic New Poll Post Reply
AndreaVB Forum : C# : C - VB
Poster Message
darek
Level: Guest


icon C - VB

Hi
I'm Darek from Poland, please help me.
How  write this function in VB ?  

Darek

void CRC( unsigned char *aPBuf, int aLen, unsigned char *aPLoCRC, unsigned char *aPHiCRC )
{
    unsigned char            *sPChar = aPBuf;
    unsigned short  sCRC = 0xffff;
    unsigned short  sData;

    while ( aLen-- )
        {
sData = (*(sPChar++)) << 8;
sCRC  = ((sCRC & 0x00ff)<<8) + (sCRC>>8);
sCRC  = sCRC ^ sData;
sData = sCRC & 0xff00;
sData = sData << 4;
sCRC  = sCRC ^ sData;
sData = sCRC & 0xff00;
sData = sData >> 5;
sCRC  = sCRC ^ sData;
sData = sData >> 7;
sCRC  = sCRC ^ sData;
        }
    *aPLoCRC = sCRC & 0x00ff;
    *aPHiCRC = (sCRC & 0xff00) >> 8;
}

03-07-2003 at 06:22 AM
| Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 1052
icon Re: C - VB

Hi Darek,
I have seen that you have had no response from this.
I would suggest that you translate it into pseudo-code then the developers who don't understand C may be able to help.
Eg.
What is it supposed to do?
What are the inputs/outputs?
To be honest, it looks like an encryption algo to generate a CRC for a given non-unicode string.
<< = divide by factor of 2 -as in << 8 appears to be ascii(mid$(aPBuf, index, 1) / (0+1+2+4+8+16+32+64).
Note.
I am unsure if << begins at 0 or 1.
Hope this helps,
Kieron
Note:
This appears to be a reasonable checksum, one would question why you have retrieved code that you cannot translate? Newbie Hacker?

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

30-04-2004 at 11:25 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : C# : C - VB
Previous Topic (WebControls)Next Topic (how can i do a ocr programm by c#) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder