elainehoo 发表于 2008-8-5 19:18:56

LR报错Error -- memory violation : Exception ACCESS_VIOLATION received.

回放时出错,报如下错误

Action.c(46): Error: C interpreter run time error: Action.c (46):Error -- memory violation : Exception ACCESS_VIOLATION received.
Action.c(46): Notify: CCI trace: Action.c(46): strcpy(0x015f0020 "", 0x0000004d, 0x014905cb "{str}", 12, 0x014904cb, 0x01490728 "ENDITEM", 0x014904c2 "Name=tag", 0x014904bb "Value=", 0x01490728 "ENDITEM", 0x014904af "Name=friend", 0x014904a7 "Value=3", 0x01490728 "ENDITEM", 0x01490499 "Nam.
Action.c(46): Notify: CCI trace: e=password", 0x014904bb "Value=", 0x01490728 "ENDITEM", 0x01490488 "Name=selectgroup", 21562555, 21563176, 21562486, 21562555, 21563176, 21562470, 21562459, 21563176, 21563271, 21562424, 21562355, 21563176, 21562313, 21562355, 21563176, 21562977)
.
Action.c(46): Notify: CCI trace: Compiled_code(0): Action()
.





Action()
{
        char string ;
        char tmp;
        web_add_cookie("uchome_loginuser=admin; DOMAIN=uchome.communicatte.com");

        web_add_cookie("uchome_auth=2342gd5ckUIBBYc1QsoDuNFyvdj25BlyoCBxaQq%2FfouxnJx8In0MA4lk1kk3RAYLMeJKOZzV%2FnjddZ0NePNs; DOMAIN=uchome.communicatte.com");

        web_add_cookie("uchome_synfriend=1; DOMAIN=uchome.communicatte.com");

        web_url("cp.php",
                "URL=http://uchome.communicatte.com/cp.php?ac=blog",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=/template/default/common.css", "Referer=http://uchome.communicatte.com/cp.php?ac=blog", ENDITEM,
                "Url=/template/default/image/appicons.gif", "Referer=http://uchome.communicatte.com/cp.php?ac=blog", ENDITEM,
                "Url=/template/default/image/submenu.gif", "Referer=http://uchome.communicatte.com/cp.php?ac=blog", ENDITEM,
                "Url=/image/editor/editor_boolbar.gif", "Referer=http://uchome.communicatte.com/editor.php?charset=utf-8&allowhtml=1", ENDITEM,
                LAST);

        web_url("editor.php",
                "URL=http://uchome.communicatte.com/editor.php?op=blank&charset=utf-8",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://uchome.communicatte.com/editor.php?charset=utf-8&allowhtml=1",
                "Snapshot=t2.inf",
                "Mode=HTML",
                LAST);

        web_url("editor.php_2",
                "URL=http://uchome.communicatte.com/editor.php?op=blank&charset=utf-8",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://uchome.communicatte.com/editor.php?charset=utf-8&allowhtml=1",
                "Snapshot=t3.inf",
                "Mode=HTML",
                LAST);

        lr_rendezvous("fa");
        lr_convert_string_encoding(lr_eval_string("{content}"),LR_ENC_SYSTEM_LOCALE,LR_ENC_UTF8,"{str}");

        web_submit_data("cp.php_2",
                "Action=http://uchome.communicatte.com/cp.php?ac=blog&blogid=",
                "Method=POST",
                "EncType=multipart/form-data",
                "RecContentType=text/html",
                "Referer=http://uchome.communicatte.com/cp.php?ac=blog",
                "Snapshot=t4.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=classid", "Value=1", ENDITEM,
                "Name=subject", "Value=娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯", ENDITEM,

       strcpy(tmp,lr_eval_string,("{str}"),
       sprintf(string,"Name=message", "Value=<DIV",tmp),
                ">娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯</DIV>", ENDITEM,
                "Name=tag", "Value=", ENDITEM,
                "Name=friend", "Value=3", ENDITEM,
                "Name=password", "Value=", ENDITEM,
                "Name=selectgroup", "Value=", ENDITEM,
                "Name=target_names", "Value=", ENDITEM,
                "Name=blogsubmit", "Value=true", ENDITEM,
                EXTRARES,
                "Url=/template/default/image/bg.gif", "Referer=http://uchome.communicatte.com/space.php?uid=1&do=blog&id=22", ENDITEM,
                "Url=/template/default/image/icon_lock.gif", "Referer=http://uchome.communicatte.com/space.php?uid=1&do=blog&id=22", ENDITEM,
                LAST));

        return 0;
}

nataliedu 发表于 2008-8-6 08:47:24

看起来你strcpy的函数明显有误啊,strcpy的定义是这样的char *strcpy ( char *dest, const char *source );
而且据我了解函数嵌套在函数里面作为一个参数也是不允许的
strcpy(tmp,lr_eval_string,("{str}"), sprintf(string,"Name=message", "Value=<DIV",tmp),....);

elainehoo 发表于 2008-8-6 16:06:54

已经改了,但通不过,尤其是下面这段,不知道怎么写好

        strcpy(tmp,lr_eval_string("{str}")),
           "Name=message",
                sprintf(string,"Value=<DIV>鎬ц兘娴嬭瘯鎬</DIV>,ENDITEM",tmp);



Action()
{
        char string ;
        char tmp;
        .........

        lr_rendezvous("fa");
        lr_convert_string_encoding(lr_eval_string("{content}"),LR_ENC_SYSTEM_LOCALE,LR_ENC_UTF8,"str");

        web_submit_data("cp.php_2",
                "Action=http://uchome.communicatte.com/cp.php?ac=blog&blogid=",
                "Method=POST",
                "EncType=multipart/form-data",
                "RecContentType=text/html",
                "Referer=http://uchome.communicatte.com/cp.php?ac=blog",
                "Snapshot=t4.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=classid", "Value=1", ENDITEM,
                "Name=subject", "Value=娴嬭瘯娴嬭瘯娴嬭瘯娴嬭瘯", ENDITEM,

        strcpy(tmp,lr_eval_string("{str}")),
           "Name=message",
                sprintf(string,"Value=<DIV>鎬ц兘娴嬭瘯鎬</DIV>,ENDITEM",tmp);
          
                "Name=tag", "Value=", ENDITEM,
                "Name=friend", "Value=3", ENDITEM,
                "Name=password", "Value=", ENDITEM,
                "Name=selectgroup", "Value=", ENDITEM,
                "Name=target_names", "Value=", ENDITEM,
                "Name=blogsubmit", "Value=true", ENDITEM,
                EXTRARES,
                "Url=/template/default/image/bg.gif", "Referer=http://uchome.communicatte.com/space.php?uid=1&do=blog&id=22", ENDITEM,
                "Url=/template/default/image/icon_lock.gif", "Referer=http://uchome.communicatte.com/space.php?uid=1&do=blog&id=22", ENDITEM,
                LAST);

        return 0;
}
页: [1]
查看完整版本: LR报错Error -- memory violation : Exception ACCESS_VIOLATION received.