IN CPP:
extern "C" {
void ENCRYPT_CPP(char buffer,int count, char CIPHER,int CIPHER_LENGTH);
void ENCRYPT_CPP(char buffer[],int count,char CIPHER[],int CIPHER_LENGTH )
{
int t=0;
for( int i=0; i<count; i++)
{
buffer[i]=buffer[i] ^ CIPHER[t % CIPHER_LENGTH];
t++;
}
}
Im having trouble converting this cpp function into an ASM procedure. The closest code i got near to a procedure was
mov ecx,LENGTHOF buffer
mov esi,0
mov edi,0
L1:
mov eax,esi
CDQ
mov ebx,CIPHER_LENGTH
IDIV ebx
mov edi,edx
mov eax,0
mov eax,DWORD PTR CIPHER[edi]
mov ebx,0
mov ebx, DWORD PTR buffer[esi]
xor eax, ebx
mov buffer[esi],al
inc esi
loop L1
Help plz