noeska
05-06-2006, 05:23 PM
First of all i know this is not the forum to ask c questions.
So if you know better places where i can ask this question do let me know.
The idea is that i get an pointer to data what i want to xor encode with an password.
I propably should cast the pointer or something like that to get things to work.
But for the moment i am out of ideas.
building:
void XorEncode(void *password, void *data)
{
int dlength = length(data);
int ipl = length(password);
int ip = 0;
int i =0;
for (i=0; i < dlength; i++) {
if (ip = ipl) ip = 0;
data[i] = data[i] ^ password[ip] ; //this is line 29
ip +=1;
}
}
gives the following error:
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
crypt.c:
Error E2453 crypt.c 29: Size of the type 'void' is unknown or zero in function X
orEncode
Error E2109 crypt.c 29: Not an allowed type in function XorEncode
Error E2453 crypt.c 29: Size of the type 'void' is unknown or zero in function X
orEncode
Error E2109 crypt.c 29: Not an allowed type in function XorEncode
Error E2453 crypt.c 29: Size of the type 'void' is unknown or zero in function X
orEncode
Error E2109 crypt.c 29: Not an allowed type in function XorEncode
*** 6 errors in Compile ***
** error 1 ** deleting crypt.obj
Thanks for your answers in advance.
So if you know better places where i can ask this question do let me know.
The idea is that i get an pointer to data what i want to xor encode with an password.
I propably should cast the pointer or something like that to get things to work.
But for the moment i am out of ideas.
building:
void XorEncode(void *password, void *data)
{
int dlength = length(data);
int ipl = length(password);
int ip = 0;
int i =0;
for (i=0; i < dlength; i++) {
if (ip = ipl) ip = 0;
data[i] = data[i] ^ password[ip] ; //this is line 29
ip +=1;
}
}
gives the following error:
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
crypt.c:
Error E2453 crypt.c 29: Size of the type 'void' is unknown or zero in function X
orEncode
Error E2109 crypt.c 29: Not an allowed type in function XorEncode
Error E2453 crypt.c 29: Size of the type 'void' is unknown or zero in function X
orEncode
Error E2109 crypt.c 29: Not an allowed type in function XorEncode
Error E2453 crypt.c 29: Size of the type 'void' is unknown or zero in function X
orEncode
Error E2109 crypt.c 29: Not an allowed type in function XorEncode
*** 6 errors in Compile ***
** error 1 ** deleting crypt.obj
Thanks for your answers in advance.