码迷,mamicode.com
首页 > 系统相关 > 详细

linux(x86) exploit 开发系列2:整数溢出

时间:2016-03-18 00:13:32      阅读:228      评论:0      收藏:0      [点我收藏+]

标签:

What is Integer Overflow?

Storing a value greater than maximum supported value is called integer overflow. Integer overflow on its own doesnt lead to arbitrary code execution, but an integer overflow might lead to stack overflow or heap overflow which could result in arbitrary code execution.

 

Data types size and its range:

datatype    size    unsigned_range             signed_range

char             1            0到255                         -128到127

short           2            0到65535                   -32768到32767

int               4        0到4294967296       -2147483648到2147483647

 

Integer underflow

Similarly storing a value lesser than the minimum supported value is called integer underflow. For example when we try to store -2147483649 to signed int data type, its gets wrapped around and stored as 21471483647. This is called integer underflow.

 

strlen()’s return type is size_t (unsigned int)

linux(x86) exploit 开发系列2:整数溢出

标签:

原文地址:http://www.cnblogs.com/junmoxiao/p/5290047.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!