'Shared Library'에 해당되는 글 1건

# Code by JaeHyuk Cho <mailto:minzkn@infoeq.com> Made in KOREA
# http://minzkn.pe.ky

.global L_EngineStub

.text
.org 0x0000
L_EngineStub:

        /* Shared library 가 실행될때 offset 을 검출하기 위한 trick */
        call 0f
0:
        popl %ecx
        subl $0b, %ecx

        /* write(1, (void *)pMessage, strlen(pMessage)); */
        movl $0x4,%eax
        movl $1, %ebx
        addl $0f, %ecx
        movl $1f - 0f, %edx
        int $0x80

        /* exit(0); */                                     
        movl $1,%eax
        xorl %ebx, %ebx
        int $0x80

        /* while(1); */                                                                                               
        jmp . /* Halt */

0:     /* pMessage */
        .ascii "My shared stub message\n"
        .ascii "Code by JaeHyuk Cho <mailto:minzkn@infoeq.com> Made in KOREA\n"
        .ascii "\n"
1:

# End of source
크리에이티브 커먼즈 라이센스
Creative Commons License
Posted by minzkn

트랙백 주소 :: http://blog.minzkn.com/trackback/27

댓글을 달아 주세요