어셈블리 질문잇습니다.

overthesky1의 이미지

계속 잡고있어도 딱히 해결해가는 방법이 떠오르지 않아 질문올립니다..

08048db4 :
8048db4:        push   %ebp
8048db5:        mov    %esp,%ebp
8048db7:        sub    $0x38,%esp
8048dba:        lea    -0x24(%ebp),%eax
8048dbd:        mov    %eax,0x4(%esp)
8048dc1:        mov    0x8(%ebp),%eax
8048dc4:        mov    %eax,(%esp)
8048dc7:        call   804897e
8048dcc:        movl   $0x1,-0xc(%ebp)
8048dd3:        jmp    8048df9
8048dd5:        mov    -0xc(%ebp),%eax
8048dd8:        mov    -0x24(%ebp,%eax,4),%eax
8048ddc:        mov    -0xc(%ebp),%edx
8048ddf:         sub    $0x1,%edx
8048de2:        mov    -0x24(%ebp,%edx,4),%edx
8048de6:        add    $0xbf,%edx
8048dec:        cmp    %edx,%eax
8048dee:        je     8048df5
8048df0:         call   8048d93
8048df5:         addl   $0x1,-0xc(%ebp)
8048df9:         cmpl   $0x5,-0xc(%ebp)
8048dfd:         jle    8048dd5
8048dff:          call   8048d73
8048e04:        leave  
8048e05:        ret    

0804897e :
804897e:        push   %ebp
804897f:         mov    %esp,%ebp
8048981:        push   %edi
8048982:        push   %esi
8048983:        push   %ebx
8048984:        sub    $0x5c,%esp
8048987:        mov    0xc(%ebp),%eax
804898a:        add    $0x14,%eax
804898d:        mov    %eax,-0x2c(%ebp)
8048990:        mov    0xc(%ebp),%eax
8048993:        lea    0x10(%eax),%edi
8048996:        mov    0xc(%ebp),%eax
8048999:        lea    0xc(%eax),%esi
804899c:        mov    0xc(%ebp),%eax
804899f:         lea    0x8(%eax),%ebx
80489a2:        mov    0xc(%ebp),%eax
80489a5:        add    $0x4,%eax
80489a8:        mov    %eax,-0x3c(%ebp)
80489ab:        mov    $0x804917d,%ecx
80489b0:        mov    0x8(%ebp),%edx
80489b3:        mov    -0x2c(%ebp),%eax
80489b6:        mov    %eax,0x1c(%esp)
80489ba:        mov    %edi,0x18(%esp)
80489be:        mov    %esi,0x14(%esp)
80489c2:        mov    %ebx,0x10(%esp)
80489c6:        mov    -0x3c(%ebp),%eax
80489c9:        mov    %eax,0xc(%esp)
80489cd:        mov    0xc(%ebp),%eax
80489d0:        mov    %eax,0x8(%esp)
80489d4:        mov    %ecx,0x4(%esp)
80489d8:        mov    %edx,(%esp)
80489db:        call   8048694 <__isoc99_sscanf@plt>
80489e0:        mov    %eax,-0x1c(%ebp)
80489e3:        cmpl   $0x5,-0x1c(%ebp)
80489e7:        jg     80489ee
80489e9:        call   8048d93
80489ee:        add    $0x5c,%esp
80489f1:         pop    %ebx
80489f2:         pop    %esi
80489f3:         pop    %edi
80489f4:         pop    %ebp
80489f5:         ret

정답이 배열하고 관련있는거 같은데..... 이거 빼고 그뒤로는 나아가는게 없네요..

제 힘으로 풀어야 하는데.. 너무 답답해서 질문올립니다..

디버깅하면서 어떤 지점에 브레이크포인트를걸고 어떤변수값을 확인해야하나요?

shint의 이미지

----------------------------------------------------------------------------
젊음'은 모든것을 가능하게 만든다.

매일 1억명이 사용하는 프로그램을 함께 만들어보고 싶습니다.
정규 근로 시간을 지키는. 야근 없는 회사와 거래합니다.

각 분야별. 좋은 책'이나 사이트' 블로그' 링크 소개 받습니다. shintx@naver.com

cleansugar의 이미지

이거 gas 문법인가요?

재벌 2세가 재벌이 될 확률과
금메달리스트 2세가 금메달을 딸 확률이 비슷해지도록
자유오픈소스 대안화폐를 씁시다.

아이디의 아이디어 무한도전
http://blog.aaidee.com

귀태닷컴
http://www.gwitae.com