티스토리 뷰

상황 예제

- String이 분명히 바이너리에서 사용되는데 'no xrefs to'가 발생하면서 참조가 안 되는 상황



문자열 찾는 방법 1

- Alt + B를 눌러 String의 주소를 검색



문자열 찾는 방법 2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from struct import pack, unpack
import idautils
import idaapi
 
def SearchString(curser):
    #curser = here()
    b1 = (curser >> 24& 0xff
    b2 = (curser >> 16& 0xff
    b3 = (curser >> 8& 0xff
    b4 = curser & 0xff
    
    print '[+] String Address : ' + hex(curser)
    binstr = '%x %x %x %x' % (b4, b3, b2, b1)
 
    tmplist = []
    tmplist.append(FindBinary(0, SEARCH_DOWN | SEARCH_CASE, binstr, 16))
 
    iscontinue = True
    while iscontinue:
        tmp = FindBinary(0, SEARCH_DOWN | SEARCH_CASE | SEARCH_NEXT, binstr, 16)
        if tmp == -1 or tmp in tmplist:
            iscontinue = False
        else:
            tmplist.append(tmp)
 
    if len(tmplist) == 1:
        print '[+] Find Binary Address : ' + hex(tmplist[0])
    else:
        print '[+] Find Binary Address : '
        print tmplist
 
    Jump(tmplist[0])
 
    return len(tmplist)
 
def main():
    SearchString(here())
 
if __name__ == '__main__':
    main()
cs

- 이런 식으로 스크립트를 작성해서 돌리면 됨


'Reversing' 카테고리의 다른 글

windbg pykd 설치  (0) 2018.06.18
Windows DLL Injector  (0) 2018.04.03
IDA 단축키 정리  (0) 2017.11.17
Windows stub code와 main 함수(IDA 사용)  (0) 2017.10.19
[Windows Driver] Reversing  (0) 2017.10.12
댓글
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31