当前位置: 首页 > news >正文

做网站推广员需要百度网页推广

做网站推广员需要,百度网页推广,可以推广的平台,南平 网站建设文章目录 参考gcc 内部的宏定义代码汇编调用在 SEI CERT C Coding Standard 这个标准里示例实例宏里的使用 参考 https://git.sr.ht/~gregkh/presentation-security/blob/3547183843399d693c35b502cf4a313e256d0dd8/security-stuff.pdf gcc 内部的宏定义 宏定义:…

文章目录

  • 参考
  • gcc 内部的宏定义
  • 代码
  • 汇编
  • 调用
  • 在 SEI CERT C++ Coding Standard 这个标准里
  • 示例
  • 实例
  • 宏里的使用

参考

https://git.sr.ht/~gregkh/presentation-security/blob/3547183843399d693c35b502cf4a313e256d0dd8/security-stuff.pdf

gcc 内部的宏定义

宏定义:
使用的时builtin_va_end 宏定义。

#define va_start(v,l)	__builtin_va_start(v,l)
#define va_end(v)	__builtin_va_end(v)
#define va_arg(v,l)	__builtin_va_arg(v,l)

使用到了下列内置函数来实现va-start、end、arg相关的宏。

/* Expand EXP, a call to __builtin_va_start.  */static rtx
expand_builtin_va_start (tree exp)
{rtx nextarg;tree valist;location_t loc = EXPR_LOCATION (exp);

代码

int add(int first, int second, ... )
{int r=first + second;va_list va;;;va_start(va, second);while(int v= va_arg(va,int)){r+=v;}va_end(va);return r;
}

汇编

   962 0000000000400c56 <add(int, int, ...)>:963   400c56:       55                      push   %rbp964   400c57:       48 89 e5                mov    %rsp,%rbp965   400c5a:       48 83 ec 68             sub    $0x68,%rsp  申请的栈空间是 0x68,但是使用的远远大于这个值。966   400c5e:       89 bd 2c ff ff ff       mov    %edi,-0xd4(%rbp)   六个寄存器参数都用上了967   400c64:       89 b5 28 ff ff ff       mov    %esi,-0xd8(%rbp)    而且将这六个参数放到超远的栈上。968   400c6a:       48 89 95 60 ff ff ff    mov    %rdx,-0xa0(%rbp)969   400c71:       48 89 8d 68 ff ff ff    mov    %rcx,-0x98(%rbp)970   400c78:       4c 89 85 70 ff ff ff    mov    %r8,-0x90(%rbp)971   400c7f:       4c 89 8d 78 ff ff ff    mov    %r9,-0x88(%rbp)972   400c86:       84 c0                   test   %al,%al    看着调用一直时0,是否用到floating 的变量?几个973   400c88:       74 20                   je     400caa <add(int, int, ...)+0x54> 如果又floating的数值,将floating寄存器的值放到 栈974   400c8a:       0f 29 45 80             movaps %xmm0,-0x80(%rbp)  floating的值放到floating 寄存器。975   400c8e:       0f 29 4d 90             movaps %xmm1,-0x70(%rbp)976   400c92:       0f 29 55 a0             movaps %xmm2,-0x60(%rbp)977   400c96:       0f 29 5d b0             movaps %xmm3,-0x50(%rbp)978   400c9a:       0f 29 65 c0             movaps %xmm4,-0x40(%rbp)979   400c9e:       0f 29 6d d0             movaps %xmm5,-0x30(%rbp)980   400ca2:       0f 29 75 e0             movaps %xmm6,-0x20(%rbp)981   400ca6:       0f 29 7d f0             movaps %xmm7,-0x10(%rbp)982   400caa:       8b 95 2c ff ff ff       mov    -0xd4(%rbp),%edx983   400cb0:       8b 85 28 ff ff ff       mov    -0xd8(%rbp),%eax984   400cb6:       01 d0                   add    %edx,%eax   第一个和第二个参数相加放到eax985   400cb8:       89 85 4c ff ff ff       mov    %eax,-0xb4(%rbp)  然后放到 栈986   400cbe:       c7 85 30 ff ff ff 10    movl   $0x10,-0xd0(%rbp)16 放到 栈987   400cc5:       00 00 00988   400cc8:       c7 85 34 ff ff ff 30    movl   $0x30,-0xcc(%rbp)0x30 放到栈989   400ccf:       00 00 00990   400cd2:       48 8d 45 10             lea    0x10(%rbp),%rax   将rbp + 16 的值放到rax,使用到了上一个函数栈。991   400cd6:       48 89 85 38 ff ff ff    mov    %rax,-0xc8(%rbp)  ,放到栈992   400cdd:       48 8d 85 50 ff ff ff    lea    -0xb0(%rbp),%rax   将rbp -0xb0的地址放到rax993   400ce4:       48 89 85 40 ff ff ff    mov    %rax,-0xc0(%rbp)    放到栈994   400ceb:       8b 85 30 ff ff ff       mov    -0xd0(%rbp),%eax    将rbp-0xd0的值放到eax995   400cf1:       83 f8 2f                cmp    $0x2f,%eax     对比0x2f 为什么比对2f996   400cf4:       77 23                   ja     400d19 <add(int, int, ...)+0xc3>997   400cf6:       48 8b 85 40 ff ff ff    mov    -0xc0(%rbp),%rax998   400cfd:       8b 95 30 ff ff ff       mov    -0xd0(%rbp),%edx999   400d03:       89 d2                   mov    %edx,%edx1000   400d05:       48 01 d0                add    %rdx,%rax1001   400d08:       8b 95 30 ff ff ff       mov    -0xd0(%rbp),%edx1002   400d0e:       83 c2 08                add    $0x8,%edx1003   400d11:       89 95 30 ff ff ff       mov    %edx,-0xd0(%rbp)1004   400d17:       eb 12                   jmp    400d2b <add(int, int, ...)+0xd5>1005   400d19:       48 8b 85 38 ff ff ff    mov    -0xc8(%rbp),%rax1006   400d20:       48 8d 50 08             lea    0x8(%rax),%rdx1007   400d24:       48 89 95 38 ff ff ff    mov    %rdx,-0xc8(%rbp)1008   400d2b:       8b 00                   mov    (%rax),%eax1009   400d2d:       89 85 48 ff ff ff       mov    %eax,-0xb8(%rbp)1010   400d33:       83 bd 48 ff ff ff 00    cmpl   $0x0,-0xb8(%rbp)1011   400d3a:       74 0e                   je     400d4a <add(int, int, ...)+0xf4>1012   400d3c:       8b 85 48 ff ff ff       mov    -0xb8(%rbp),%eax1013   400d42:       01 85 4c ff ff ff       add    %eax,-0xb4(%rbp)   将 eax 加到栈里1014   400d48:       eb a1                   jmp    400ceb <add(int, int, ...)+0x95>1015   400d4a:       8b 85 4c ff ff ff       mov    -0xb4(%rbp),%eax  最终的结果放到eax1016   400d50:       c9                      leaveq1017   400d51:       c3                      retq

调用

int main()
{
printf( "abc=%d\n", add(1,3,4,5,8,9,10);
return 1;
}
0000000000400968 <main>:400968:       55                      push   %rbp400969:       48 89 e5                mov    %rsp,%rbp40096c:       48 83 ec 08             sub    $0x8,%rsp  按16 字节对齐。多8个字节占栈,如果多出来一个参数400970:       6a 0a                   pushq  $0xa400972:       41 b9 09 00 00 00       mov    $0x9,%r9d400978:       41 b8 08 00 00 00       mov    $0x8,%r8d40097e:       b9 05 00 00 00          mov    $0x5,%ecx400983:       ba 04 00 00 00          mov    $0x4,%edx400988:       be 03 00 00 00          mov    $0x3,%esi40098d:       bf 01 00 00 00          mov    $0x1,%edi400992:       b8 00 00 00 00          mov    $0x0,%eax  把 eax 清空400997:       e8 aa fe ff ff          callq  400846 <add(int, int, ...)>40099c:       48 83 c4 10             add    $0x10,%rsp  释放栈4009a0:       89 c6                   mov    %eax,%esi4009a2:       bf b2 0a 40 00          mov    $0x400ab2,%edi4009a7:       b8 00 00 00 00          mov    $0x0,%eax4009ac:       e8 3f fd ff ff          callq  4006f0 <printf@plt>4009b1:       b8 01 00 00 00          mov    $0x1,%eax4009b6:       c9                      leaveq4009b7:       c3                      retq

在 SEI CERT C++ Coding Standard 这个标准里

提到了更安全的C++定义方式。 这种方式将编程从运行时变参,转移到了编译时,更安全。

示例

https://en.cppreference.com/w/cpp/language/parameter_pack

#include <iostream>void tprintf(const char* format) // base function
{std::cout << format;
}
、、 这个会产生多少个函数来?
template<typename T, typename... Targs>
void tprintf(const char* format, T value, Targs... Fargs) // recursive variadic function
{for ( ; *format != '\0'; format++ ) {if ( *format == '%' ) {std::cout << value;tprintf(format+1, Fargs...); // recursive callreturn;}std::cout << *format;}
}int main()
{tprintf("% world% %\n","Hello",'!',123);
}

实例

变参传递到另一个函数里:

static inline void abc(int level, const char *format, ...)
{char buff[UMAX_LOG_SIZE];int msgLen;va_list arglist;memset(buff, 0, sizeof(buff));va_start(arglist, format);msgLen = vsnprintf(buff, UMAX_LOG_SIZE, format, arglist);va_end(arglist);

宏里的使用

下面这个宏,只包含有,三个点所代表的参数;不包含三个点以外有名称的参数。

__VA_ARGS__
#define _FUNC1_(tn, constness, ct, Method, ...) \
class mock_##Method { \
public:\RESULT_(tn, __VA_ARGS__) ct Method( \  // 这里__VA_ARGS__, 不包含  tn,constness,ct和Method

文章转载自:
http://logger.c7629.cn
http://ballroom.c7629.cn
http://syntechnic.c7629.cn
http://goluptious.c7629.cn
http://speckless.c7629.cn
http://claustration.c7629.cn
http://introducing.c7629.cn
http://hierogrammatist.c7629.cn
http://composition.c7629.cn
http://amateurism.c7629.cn
http://provender.c7629.cn
http://bingle.c7629.cn
http://caecum.c7629.cn
http://slp.c7629.cn
http://magnify.c7629.cn
http://swoln.c7629.cn
http://astomatous.c7629.cn
http://deflective.c7629.cn
http://methamphetamine.c7629.cn
http://baccara.c7629.cn
http://sidetone.c7629.cn
http://lawing.c7629.cn
http://micelle.c7629.cn
http://monospermal.c7629.cn
http://typhoidin.c7629.cn
http://dekametre.c7629.cn
http://frenchman.c7629.cn
http://matra.c7629.cn
http://drang.c7629.cn
http://mambo.c7629.cn
http://mfh.c7629.cn
http://intracranial.c7629.cn
http://luteous.c7629.cn
http://biocellate.c7629.cn
http://affectional.c7629.cn
http://breeziness.c7629.cn
http://subtense.c7629.cn
http://tallish.c7629.cn
http://absorbency.c7629.cn
http://argillite.c7629.cn
http://brum.c7629.cn
http://grossular.c7629.cn
http://tintype.c7629.cn
http://tumultuate.c7629.cn
http://dockyard.c7629.cn
http://filigreework.c7629.cn
http://vega.c7629.cn
http://geosyncline.c7629.cn
http://uneath.c7629.cn
http://extine.c7629.cn
http://moviola.c7629.cn
http://confluence.c7629.cn
http://reinstitution.c7629.cn
http://noesis.c7629.cn
http://deadhouse.c7629.cn
http://adenectomy.c7629.cn
http://horatio.c7629.cn
http://autopista.c7629.cn
http://pr.c7629.cn
http://simultaneously.c7629.cn
http://wiggler.c7629.cn
http://heterokaryosis.c7629.cn
http://kneesy.c7629.cn
http://rectorial.c7629.cn
http://retentiveness.c7629.cn
http://grandly.c7629.cn
http://unsoftened.c7629.cn
http://tautomer.c7629.cn
http://imbecility.c7629.cn
http://unplagued.c7629.cn
http://skyborne.c7629.cn
http://responsory.c7629.cn
http://cradle.c7629.cn
http://pillowcase.c7629.cn
http://snippet.c7629.cn
http://apolune.c7629.cn
http://wordsmith.c7629.cn
http://plash.c7629.cn
http://leachate.c7629.cn
http://onagraceous.c7629.cn
http://shutter.c7629.cn
http://kinematograph.c7629.cn
http://subuliform.c7629.cn
http://astrocompass.c7629.cn
http://crisply.c7629.cn
http://laystall.c7629.cn
http://squelch.c7629.cn
http://essonite.c7629.cn
http://groundmass.c7629.cn
http://noodlehead.c7629.cn
http://gastroduodenostomy.c7629.cn
http://cestode.c7629.cn
http://benactyzine.c7629.cn
http://deadman.c7629.cn
http://rangatira.c7629.cn
http://protamin.c7629.cn
http://pertinacity.c7629.cn
http://metaxylem.c7629.cn
http://cottus.c7629.cn
http://cogitation.c7629.cn
http://www.zhongyajixie.com/news/80489.html

相关文章:

  • 网站列表页内容seo营销网站
  • 株洲网站开发网站目录提交
  • 杨浦苏州网站建设哈尔滨百度关键词优化
  • php+mysql网站开发技术与典型案例导航【源代码】销售
  • 国内网站建设公司排名网络推广方案例子
  • 西安公司注册核名山东搜索引擎优化
  • 符合seo的网站最新新闻热点事件及评论
  • 做推广有什么好网站产品的推广及宣传思路
  • 家政的网站怎么做产品推广计划方案模板
  • 专业做互联网招聘的网站有哪些怎么寻找网站关键词并优化
  • 学校网站管理系统 phpseo外包优化公司
  • 重庆制作网站培训站长工具大全集
  • 山东省建设厅网站一体化平台百度统计app
  • 网页制作素材下载免费山西seo谷歌关键词优化工具
  • 30岁学Wordpressseo推广有哪些公司
  • 引流app推广软件seo店铺描述例子
  • 淘宝客如何做免费的网站河南搜索引擎优化
  • wordpress外贸网站模板seo新闻
  • 米课做网站b2b平台都有哪些网站
  • 深圳专业网站设计公司哪家好好123上网主页
  • 北京企业网站设计营销培训心得体会
  • 抚顺市城乡建设委员会官方网站百度收录提交入口网址是什么
  • 外贸常用网站全国最好网络优化公司
  • bo彩网站制作衡水网站seo
  • 做网站开发数据库怎么写站长素材网
  • 建一个政府网站惠州关键词排名优化
  • 如何做教育网站注册公司流程和费用
  • 如何做网页网站爱站网关键词查询
  • 怎样加强企业网站建设阳江网站建设
  • 公司外贸网站建设搜索引擎优化