Chinaunix首页 | 论坛 | 博客
  • 博客访问: 670684
  • 博文数量: 53
  • 博客积分: 830
  • 博客等级: 准尉
  • 技术积分: 1089
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-31 18:23
文章存档

2019年(1)

2018年(1)

2016年(1)

2015年(1)

2014年(12)

2013年(4)

2012年(33)

分类: 系统运维

2012-06-18 10:39:58

// md5 算法略

Action()
{
    int i;
    int rc ;
    char sing_pwd_q[500];

    char sign_name[50];
    
    char *_appSignSecret= "iaiyo.com#aibuyu#?!@#$123456";
    char time_hami[50];


    char vervsion_v[100];
    char vervsion_v_v[100];
    char clintId_v[100];
    char clintId_v_v[100];

    char sign_new_v[200];
    char sign_new_v_v[200];
    char sing_pwd_q_two[200];
    char sing_pwd_q_two_result[200];
    char time_new_v[50];
    char time_new_v_v[50];


    char *do_1="getList";
    char *mod="Friend_Self";
    char sign_md5[40];
    char sign_md5_v[40];

    // clientId  不加密!
    char *clientId="08f1a84d59bb9758a475daf3f167faeb";  

    // hashKey  不加密!
    char *hashKey="YmNlNGR2cEVlYVR3eXh6V01RNDd5ZjR3TEFuQjc0MWxCeWhhMlFUSEovYXYvVTM1R1NPb0d3eUI0RUVieXlLd01ob0FBcXJRb292ZEhTRXE2SWszejBYazdXVDVkNHUvZEJGYklHdzNnem9MbG1tVHVjWEJ1TkhUb09CRXFlZTBPaEpad1J3RFE1ZlVBd2dSTXhzYlRiUzhkQVZHV0xBaXlKeUdEd1QwOHVXMEMyRUtxOXR3azhwZ1lsYUp6V3hSMGY3bU1qMUNzOEFsRDk1MVVtaEU0NWVVbHd5ektHUVhnckIxcXo1em1qSmczNk9ZazR1L3dkcGloVlBEY29uTkZTaEcxa2xsbXNuTkpnQ3JSN1crOFVQOFdxVkdaUFB2MDY5TmJ2RjlvYXBYa29ieFhyTHE3VENDd21weTg5L1lRWU5LOHVVUWxldmFuT0wzVUNVaVdLWVlSRDk1ZGUxMjRIcUdqRWc1TEZ3UklMclg2dC9nMVo5UlZmbXoxcnJUYmtUa3RPNDdQTkhoTFE0NzZiMTVieDhWTHVaallLTlltUUhpMnVsMXloamgweUkwQXkwUWV1LzZhakVxbjAxODhNenhGUkt4TlI2UHp0dFJqNVVLWkViS0tPYmxxVUY2b1ErZ0dLYk5kOG4yYk1RRjlxQmYwMWllMko4MlZidllPdDZjVWc3RE4raXNIK0ZOOVJOck9YVklQdnVoZnFpd0F2RHd2Vnl4aEpMQW5BRWIxcTQ3ME1B";

     // version  不加密!
    char *version="8280a0a64c7205c17474996131e73afd";

    // sign 加密!
   //    char *sign="8175393ff673fd47c783a455a493b90f";

    char *sign_new="495c1ce79693bcf2ee79a5fcb9eb3a1c";

    char *time_new="1313992549064";

typedef long time_t;
struct _timeb {
     time_t time;
     unsigned short millitm;
     short timezone;
     short dstflag;
};

 struct _timeb t;
 _tzset();
 _ftime( &t );
 lr_message( "===> 当前系统时间毫秒数: %u%u", t.time,t.millitm );

 sprintf(time_hami, "%u%u",t.time,t.millitm);
 lr_save_string(time_hami,"time_hami_restul");

    sprintf(sing_pwd_q,"%s%s%s%s%s%s%s%s%s%s","clintId=",lr_eval_string("{clientId_p}"),"do=getInfo","hashKey=",lr_eval_string("{hashKey_p}"),"mod=User_Self","time=",lr_eval_string("{time_hami_restul}"),"version=",lr_eval_string("{version_v}"));

    lr_save_string(sing_pwd_q,"sing_pwd_q_v");


    sprintf(sing_pwd_q_two,"%s%s",lr_eval_string("{sing_pwd_q_v}"),"iaiyo.com#aibuyu#?!@#$123456");

    lr_save_string(sing_pwd_q_two,"sing_pwd_q_two_result");

    GetMd5FromString(lr_eval_string("{sing_pwd_q_two_result}"),sign_md5);

    sprintf(sign_md5_v,"%s",sign_md5);

    lr_save_string(sign_md5_v,"sign_md5_v_v");

    lr_save_string(lr_eval_string("{hashKey_p}"),"hashkey_v_v");

   sprintf(vervsion_v,"%s","8280a0a64c7205c17474996131e73afd");

   lr_save_string(vervsion_v,"vervsion_v_v");

   sprintf(clintId_v,"%s","08f1a84d59bb9758a475daf3f167faeb");

   lr_save_string(clintId_v,"clintId_v_v");

    lr_save_string(lr_eval_string("{version_v}"),"version_p");

    amf_set_version("3");

   amf_define_header_set("Id=amf_header_set",     
         HEADER,
        "Name=param",
       "MustUnderstand=false",
        "Data="
       "{vervsion_v_v}"
       "{hashkey_v_v}"
        "{sign_md5_v_v}"      
       "{clintId_v_v}"
       "{time_hami_restul}
",
         LAST);

     lr_start_transaction("获取用户信息");

     amf_call("aaa",
         "Gateway=",
         "AMFHeaderSetId=amf_header_set",
         "Snapshot=t5.inf",
         "ResponseParameter=rsp",
          MESSAGE,
         "Method=User_Self.getInfo",  //Friend_Self.getList
         "TargetObjectId=User_Self.getInfo",   //Friend_Self.getList
          BEGIN_ARGUMENTS,

         "{vervsion_v_v}{hashkey_v_v}{sign_md5_v_v}{clintId_v_v}{time_hami_restul}",

          END_ARGUMENTS,
          LAST );

     if ((rc = strspn(lr_eval_string("{rsp}"), lr_eval_string("{strcmp}"))) == 0)
     {
    
        lr_end_transaction("获取用户信息", LR_FAIL);
        lr_error_message(lr_eval_string("{rsp}"));

       }
        else
       {     
        
        lr_end_transaction("获取用户信息", LR_PASS);
       
       }
   
         return 0;

   }

阅读(3250) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~