关于作者

笔名:CoolQ
地区:
作者相册

日历 

快速登录

+ 用户名:
+ 密 码:

在线留言

友情Blog

Security

Linux

Good Blogger

访问统计:5499


蛐蛐的世界

 

My study, my feeling, my hobbies, ......

日志

2007 Tech Plan

Security:

  • More assembly skill
  • More Windows OS level skill
  • Design Implementation of Kernel/Login/PAM/OpenSSL/OpenSSH/OpenLDAP/Kerberos/etc
  • Vulnerability exploit
  • Accomplish daily work

Algorithm:

  • Language related:
    • C++ based, especially STL
    • More script such as LUA
    • Java if possible, only language and some related libraries
  • Finish all the algorithm problems in Introduction to Algorithms
  • Finish One volume of The art of programming language
  • Try to be Top 100 in ACM PKU
  • Try to get acquainted with topcoder, take some execises. If possible, join the SRM.

- 作者: CoolQ 2007年01月2日, 星期二 11:53  回复(0) |  引用(0)

ACM 06/12/10

now ranking 6122/38174

- 作者: CoolQ 2006年12月10日, 星期日 12:01  回复(0) |  引用(0)

ACM way - Nov 28th

conquer 1005, 1006

Rank: 8091/37434

- 作者: CoolQ 2006年11月28日, 星期二 10:58  回复(0) |  引用(0)

PKU ACM site

http://acm.pku.edu.cn/JudgeOnline/

I've passed 1000-1004, ranked 9798/37434. Still a long way to go...

- 作者: CoolQ 2006年11月27日, 星期一 11:01  回复(4) |  引用(0)

Linking libstdc++ statically

- 作者: CoolQ 2006年11月13日, 星期一 15:09  回复(1) |  引用(0)

python的bug

花了半天写了一个从SMTH上批量下载网页的Python程序,发现python的len()获得array的大小竟然会报

Traceback (most recent call last):
  File "download.py", line 75, in ?
    if len(post_list) != 20:
TypeError: 'int' object is not callable

的错误,把post_list的内容复制到pythonwin中,len的结果正常

用2.4.3和2.5的python都有这个问题,真是撞了鬼了

后来干脆不检查post_list的长度,一样也可以正常运行

- 作者: CoolQ 2006年11月10日, 星期五 16:03  回复(0) |  引用(0)

linux-gate.so has jmp ESP

有关linux-gate.so的基础知识参见

What is linux-gate.so.1?

http://www.trilithium.com/johan/2005/08/linux-gate/

JMP ESP的内容参见

http://www.datastronghold.com/content/view/528/27/

这样可以部分解决地址随机化的问题,因为linux-gate的地址是固定的

debian-coolq:/tmp# ./test
* 0xffffe777 : jmp *%esp

- 作者: CoolQ 2006年11月9日, 星期四 16:10  回复(2) |  引用(0)

符号的导出

今天和同事研究了一下Linux下符号的问题

假设有a.c->liba.a, (so1.c, so2.c, liba.a)-> libso.so,那么默认情况下生成的libso.so会包含静态连接的a.c中的所有符号,以及so1.c和so2.c中所有的非static符号

如果需要取出liba.a静态连接到libso.so中的符号,可以

gcc -shared -o libso.so -Xlinker --exclude-libs -Xlinker ALL so1.c so2.c -L. -la

如果要使so1.c和so2.c中的某些非API函数供动态库自己使用而不提供给库用户,可以在声明的时候使用__attribute__(visibility("hidden"))或者

#pragma GCC visibility push(hidden)

int foo(int x, int y){...}

int bar(int z) {...}

#pragma GCC visibility pop(hidden)

具体可参考

[1] http://people.redhat.com/drepper/dsohowto.pdf

[2] http://www.opencjk.org/~scz/unix/200505181616.txt

[3] http://gcc.gnu.org/wiki/Visibility

[4] http://www.nedprod.com/programs/gccvisibility.html

- 作者: CoolQ 2006年11月2日, 星期四 13:18  回复(4) |  引用(0)