副标题: Python Programming for Hackers and Reverse Engineers
作者: Justin Seitz
出版社: No Starch Press
出版年: 2009-4-23
页数: 232
定价: USD 39.95
装帧: Paperback
ISBN: 9781593271923
作者: Justin Seitz
出版社: No Starch Press
出版年: 2009-4-23
页数: 232
定价: USD 39.95
装帧: Paperback
ISBN: 9781593271923
内容简介 · · · · · ·
黑帽黑客和白帽黑客综合性Python读物。Grey Hat Python
豆瓣成员常用的标签(共12个) · · · · · ·
喜欢读"Gray Hat Python"的人也喜欢 · · · · · ·
按有用程度 按页码先后 最新笔记
-
第20页
调试器软件断点原理: 如何反调试? Soft breakpoints have one caveat, however: when you change a byte of the executable in memory, you change the running software’s cyclic redundancy check (CRC) checksum. A CRC is a type of function that is used to determine if data has been altered in any way, and it can be applied to files, memory, text, network packets, or anything you would like to ... (更多)调试器软件断点原理:如何反调试?
(收起)Soft breakpoints have one caveat, however: when you change a byte of the executable in memory, you change the running software’s cyclic redundancy check (CRC) checksum. A CRC is a type of function that is used to determine if data has been altered in any way, and it can be applied to files, memory, text, network packets, or anything you would like to monitor for data altera- tion. A CRC will take a range of values—in this case the running process’s memory—and hash the contents. It then compares the hashed value against a known CRC checksum to determine whether there have been changes to the data. If the checksum is different from the checksum that is stored for validation, the CRC check fails. This is important to note, as quite often malware will test its running code in memory for any CRC changes and will kill itself if a failure is detected. This is a very effective technique to slow reverse engineering and prevent the use of soft breakpoints, thus limiting dynamic analysis of its behavior. In order to work around these specific scenarios, you can use hardware breakpoints.
2011-04-19 16:47:38 回应
-
第17页
函数调用时栈的变化 Function Call in C /代码内容已省略/ Function Call in x86 Assembly /代码内容已省略/ To see what the stack frame would look like, refer to Figure 2-1. As you can see, this is a straightforward data structure and is the basis for all function calls inside a binary. When the my_socks() function returns... (更多)函数调用时栈的变化Function Call in C
int my_socks(color_one, color_two, color_three);
Function Call in x86 Assembly
push color_three push color_two push color_one call my_socks
To see what the stack frame would look like, refer to Figure 2-1.

As you can see, this is a straightforward data structure and is the basis for all function calls inside a binary. When the my_socks() function returns, it pops off all the values on the stack and jumps to the return address to continue executing in the parent function that called it. The other consideration is the notion of local variables. Local variables are slices of memory that are valid only for the function that is executing. To expand our my_socks() function a bit, let’s assume that the first thing it does is set up a character array into which to copy the parameter color_one. The code would look like this:
int my_socks(color_one, color_two, color_three) { char stinky_sock_color_one[10]; ... }The variable stinky_sock_color_one would be allocated on the stack so that it can be used within the current stack frame. Once this allocation has occurred, the stack frame will look like the image in Figure 2-2.
Now you can see how local variables are allocated on the stack and how the stack pointer gets incremented to continue to point to the top of the stack. The ability to capture the stack frame inside a debugger is very useful for tracing functions, capturing the stack state on a crash, and tracking down stack-based overflows. (收起)
2011-04-19 16:36:24 回应
-
第5页
我见到的最全的eclipse+PyDev环境搭建解说 安装Eclips和PyDev 1. Download the Eclipse Classic package from http://www.eclipse.org/ downloads/. 2. Unzip it to C:\Eclipse. 3. Run C:\Eclipse\eclipse.exe. 4. The first time it starts, it will ask where to store your workspace; you can accept the default and check the box Use this as default and do not ask again. Click OK. 5. O... (更多)我见到的最全的eclipse+PyDev环境搭建解说安装Eclips和PyDev
配置Eclipse和PyDev1. Download the Eclipse Classic package from http://www.eclipse.org/ downloads/. 2. Unzip it to C:\Eclipse. 3. Run C:\Eclipse\eclipse.exe. 4. The first time it starts, it will ask where to store your workspace; you can accept the default and check the box Use this as default and do not ask again. Click OK. 5. Once Eclipse has fired up, choose Help 6. Select the radio button labeled Search for new features to install and click Next. 7. On the next screen click New Remote Site. 8. In the Name field enter a descriptive string like PyDev Update. Make sure the URL field contains http://pydev.sourceforge.net/updates/ and click OK. Then click Finish, which will kick in the Eclipse updater. 9. The updates dialog will appear after a few moments. When it does, expand the top item, PyDev Update, and check the PyDev item. Click Next to continue. 10. Then read and accept the license agreement for PyDev. If you agree to its terms, then select the radio button I accept the terms in the license agreement. 11. Click Next and then Finish. You will see Eclipse begin pulling down the PyDev extension. When it’s finished, click Install All. 12. The final step is to click Yes on the dialog box that appears after PyDev is installed; this will restart Eclipse with your shiny new PyDev included.
(收起)1. With Eclipse started, select Window 2. Expand the PyDev tree item, and select Interpreter – Python. 3. In the Python Interpreters section at the top of the dialog, click New. 4. Browse to C:\Python25\python.exe, and click Open. 5. The next dialog will show a list of included libraries for the interpreter; leave the selections alone and just click OK. 6. Then click OK again to finish the interpreter setup.
2011-04-18 18:27:06 回应
-
第7页
调用DLL函数的两种约定,区别主要在于由谁来平栈,调用者还是被调用者? U N D E R S T A N D I N G C A L L I N G C O N V E N T I O N S A calling convention describes how to properly call a particular function. This includes the order of how function parameters are allocated, which parameters are pushed onto the stack or passed in registers, and how the stack is unwound when a function retur... (更多)调用DLL函数的两种约定,区别主要在于由谁来平栈,调用者还是被调用者?U N D E R S T A N D I N G C A L L I N G C O N V E N T I O N S A calling convention describes how to properly call a particular function. This includes the order of how function parameters are allocated, which parameters are pushed onto the stack or passed in registers, and how the stack is unwound when a function returns. You need to understand two calling conventions: cdecl and stdcall. In the cdecl convention, parameters are pushed from right to left, and the caller of the func- tion is responsible for clearing the arguments from the stack. It’s used by most C systems on the x86 architecture. Following is an example of a cdecl function call: In C
int python_rocks(reason_one, reason_two, reason_three);
In x86 Assemblypush reason_three push reason_two push reason_one call python_rocks add esp, 12
You can clearly see how the arguments are passed, and the last line increments the stack pointer 12 bytes (there are three parameters to the function, and each stack parameter is 4 bytes, and thus 12 bytes), which essentially clears those parameters. An example of the stdcall convention, which is used by the Win32 API, is shown here:In Cint my_socks(color_one color_two, color_three);
In x86 Assemblypush color_three push color_two push color_one call my_socks
(收起)In this case you can see that the order of the parameters is the same, but the stack clearing is not done by the caller; rather the my_socks function is responsible for cleaning up before it returns. For both conventions it’s important to note that return values are stored in the EAX register.
2011-04-18 18:43:44 回应
-
第20页
调试器软件断点原理: 如何反调试? Soft breakpoints have one caveat, however: when you change a byte of the executable in memory, you change the running software’s cyclic redundancy check (CRC) checksum. A CRC is a type of function that is used to determine if data has been altered in any way, and it can be applied to files, memory, text, network packets, or anything you would like to ... (更多)调试器软件断点原理:如何反调试?
(收起)Soft breakpoints have one caveat, however: when you change a byte of the executable in memory, you change the running software’s cyclic redundancy check (CRC) checksum. A CRC is a type of function that is used to determine if data has been altered in any way, and it can be applied to files, memory, text, network packets, or anything you would like to monitor for data altera- tion. A CRC will take a range of values—in this case the running process’s memory—and hash the contents. It then compares the hashed value against a known CRC checksum to determine whether there have been changes to the data. If the checksum is different from the checksum that is stored for validation, the CRC check fails. This is important to note, as quite often malware will test its running code in memory for any CRC changes and will kill itself if a failure is detected. This is a very effective technique to slow reverse engineering and prevent the use of soft breakpoints, thus limiting dynamic analysis of its behavior. In order to work around these specific scenarios, you can use hardware breakpoints.
2011-04-19 16:47:38 回应
-
第17页
函数调用时栈的变化 Function Call in C /代码内容已省略/ Function Call in x86 Assembly /代码内容已省略/ To see what the stack frame would look like, refer to Figure 2-1. As you can see, this is a straightforward data structure and is the basis for all function calls inside a binary. When the my_socks() function returns... (更多)函数调用时栈的变化Function Call in C
int my_socks(color_one, color_two, color_three);
Function Call in x86 Assembly
push color_three push color_two push color_one call my_socks
To see what the stack frame would look like, refer to Figure 2-1.

As you can see, this is a straightforward data structure and is the basis for all function calls inside a binary. When the my_socks() function returns, it pops off all the values on the stack and jumps to the return address to continue executing in the parent function that called it. The other consideration is the notion of local variables. Local variables are slices of memory that are valid only for the function that is executing. To expand our my_socks() function a bit, let’s assume that the first thing it does is set up a character array into which to copy the parameter color_one. The code would look like this:
int my_socks(color_one, color_two, color_three) { char stinky_sock_color_one[10]; ... }The variable stinky_sock_color_one would be allocated on the stack so that it can be used within the current stack frame. Once this allocation has occurred, the stack frame will look like the image in Figure 2-2.
Now you can see how local variables are allocated on the stack and how the stack pointer gets incremented to continue to point to the top of the stack. The ability to capture the stack frame inside a debugger is very useful for tracing functions, capturing the stack state on a crash, and tracking down stack-based overflows. (收起)
2011-04-19 16:36:24 回应
书评 · · · · · · (共7条)
我来评论这本书
-
最有用的好评
-
最有用的中差评
热门评论 最新评论
这个大系的书总是书名眼前一亮,翻看眼前一黑。
-
- bluewater(求知者) 这个安全技术大系的书总是书名眼前一亮,翻看眼前一黑。 这个大系的书都感觉一般,原来买过另外的一本,比较失望,这本也有相似的问题,写的太简略,编校也比较粗糙,这本书的方向很吸引我,但在书店翻看了半个小时,还是放下了。 这本书更像一个向导,是那种进入一个世界需要的一本薄书。 适合启发式阅读,然后自己寻找答案。......2011-05-16 3/3有用来自 电子工业出版社2011版
低级错误很多
-
- sure 先撇开翻译水平不谈,不知道审校的人都做了什么,读了10页就发现4处印刷错误,object写成objecl,首字母大小写随意,源代没有缩进,而且代码也有错误,11页中print第二行my_barley.barley_long中long应该为int,原著也是一样的,难道我理解错了?思路不错,但是不认真负责......2011-05-14 2/2有用来自 电子工业出版社2011版
中文翻译一般
-
- chaoswong(All is well) 书刚看到第三章, 写的还是不错, 像我这种水平比较差的, 觉得讲的深浅合适, 比看深入理解计算机系统之类的书要好看的多(看那本我总是要睡着....) 但翻译的水平还是比较一般的, 不光是代码的缩进没有整理, 而且很明显代码没有自己敲进电脑里看看. 第三章开篇的CreateProcessA这个函数很明显有很多...... (1回应)2011-05-08 3/3有用来自 电子工业出版社2011版
还可以!
-
- within 好书不多,但也不少,所以大家肯定也得有选择性的看,去选择看哪些书。我电脑全自学的,经常到处找人问,后来找到一个猎豹网校,还不错。都是看视频课程那种,真是学起来容易多了。而且有老师随时可以请教指点,这比自己单纯看书,理解得更容易了。 ......2011-12-02 来自 电子工业出版社2011版
P27-P28 bug
-
- 冷冷的夜">(">/ aaaaa)
坑爹的翻译和排版
-
- NightKing(darkness is my strength) 书是很好的,但有很多坑爹的翻译和排版错漏,有条件的建议看英文原版 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 抱歉,你的评论太短了 ......2011-05-24 1/3有用来自 电子工业出版社2011版
"Gray Hat Python"的论坛 · · · · · ·
- > 点这儿转让 有77人想读,手里有一本闲着?
这本书的其他版本 · · · · · · ( 全部2 )
- 电子工业出版社版 2011-3 / 44人读过 / 有售
以下豆列推荐 · · · · · · (全部)
- 编程书籍候选 (笨蛋.mk⑨)
- 编程C语言,Python等类书籍 (IVAN)
- 计算机安全 (戈尔巴乔猫)
- 系统与软件安全 (Alan Xin)
- Learning Python (Arthur)
谁读这本书?
喜欢这本书的人关注的活动 · · · · · ·
订阅关于Gray Hat Python的评论:
feed: rss 2.0












