rejetto forum

help me to find error!

Guest · 6 · 12394

0 Members and 1 Guest are viewing this topic.

Vaulter

  • Guest
i write plugin (on VC++ 6.0)
part:

Code: [Select]
case PE_INITIALIZE:           // plugin initialization, issued only by &RQ
_irqver ver;
currpos+=readfrombuff(comm,currpos,&ver,sizeof(ver));
if(ver.api_version!=APIversion)
{
//api error
return 0;
}
int UIN;
int strlen;
char RQ_path[MAX_PATH];memset(RQ_path,0,MAX_PATH);
char user_path[MAX_PATH];memset(user_path,0,MAX_PATH);
//
currpos+=readfrombuff(comm,currpos,&strlen,sizeof(int));
currpos+=readfrombuff(comm,currpos,RQ_path,strlen);
currpos+=readfrombuff(comm,currpos,&strlen,sizeof(int));
currpos+=readfrombuff(comm,currpos,user_path,strlen);
currpos+=readfrombuff(comm,currpos,&UIN,sizeof(int));
MessageBox(0,lstrcat(lstrcat(RQ_path,"\n"),user_path),"",0);

result+=(char)PM_DATA;
result+=(BYTE*)_istring("Test plugin");
result+=(BYTE*)_int(APIversion);
break;
then i send packet:
Code: [Select]
LPSTR retpacket=(LPSTR)LocalAlloc(LPTR,result.size()+sizeof(int));
len=result.size();
memcpy(retpacket,&len,sizeof(int));
if(len)memcpy(retpacket+sizeof(int),result.c_str(),len);
return retpacket;

there is access violation of memory exeption in &RQ!!!

but i saw the packet byte by byte - all right!
what the problem?[/code]


Vaulter_unreg

  • Guest
where is error in this packet:
Code: [Select]
020 0x14 
000 0x00
000 0x00
000 0x00
002 0x02 
011 0x0b
000 0x00
000 0x00
000 0x00
084 0x54 T
101 0x65 e
115 0x73 s
116 0x74 t
032 0x20
112 0x70 p
108 0x6c l
117 0x75 u
103 0x67 g
105 0x69 i
110 0x6e n
004 0x04 
000 0x00
000 0x00
000 0x00


Offline Vaulter

  • Occasional poster
  • *
    • Posts: 3
    • View Profile

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
sorry but i can't fix that bug in a very short time
it is sad but i have to spent the little time i have on other &RQ matters now
but i added it to the buglist


Anonymous

  • Guest
rejetto just tell me: is packet right, and its only a bug of &RQ. 'Cause i'll dig my code in order to find my own bug, if it is mine ))[/b]