반응형

[fridump 메모리 덤프]

frida-ps -Uai sudo -H python fridump.py -U -s -r

 

[Open SSL]

ssh netcanis@172.20.10.6

 

- 앱 설치 디랙토리 

/var/mobile/Containers/Data/Application 

 

- 앱 설치영역내 txt파일 검색 

find /var/mobile/Containers/Data/Application -name '*.txt' 

Ex) /var/mobile/Containers/Data/Application/6EB9B22F-45BA-4AF1-A540-B939713D9262/Library/ Caches/2019081909.txt

 

- text파일 읽기 

cap /var/mobile/Containers/Data/Application/6EB9B22F-45BA-4AF1-A540-B939713D9262/Library/ Caches/2019081909.txt

 

 

[tcpdump 리모트 패킷캡쳐]

주어진 UUID를 Virtual interface로 등록 

rvictl -s [UUID] 

rvictl -s 00008020-000915301AF2002E

 

등록된 virtual interface 이름 확인

rvictl -l

 

네트워크로 등록되어 있는지 확인된 이름으로 조회 

Ifconfig rvi0 

 

virtual interface를 삭제하려면 

rvictl -x [UUID] 

 

패킷캡쳐 

sudo tcpdump -n -i rvi0 

 

패킷캡쳐 (간략버전) 

sudo tcpdump -n -t -i rvi0 -q tcp 

 

패킷캡쳐 (아스키) 

sudo tcpdump -n -t -i rvi0 -q -A tcp

 

2020/05/19 - [OS/Mac OS X] - gdb 사용

2020/05/19 - [iOS/Jailbreak] - Frida 설치 및 사용법

2020/05/19 - [OS/Mac OS X] - gdb 설치

2020/05/19 - [OS/Mac OS X] - Mac에서 Node.js 설치

2020/05/19 - [iOS/Jailbreak] - Tcpdump 사용법

2020/05/19 - [개발노트] - UUID의 구성 요소

2020/05/18 - [iOS/etc] - APNs

2020/05/18 - [iOS/Swift] - Multiple font colors in a single UILabel

2020/05/18 - [개발툴/Xcode] - Storyboard References (스토리보드 분리)

2020/05/18 - [iOS/Jailbreak] - OpenSSL Mac 연동

2020/05/18 - [iOS/Objective-C] - NSLog 출력 크기 제한 풀기

2020/05/18 - [OS/Mac OS X] - Symbolic Link

2020/05/18 - [개발툴/Xcode] - Release 모드에서 디버깅

2020/05/18 - [iOS/Jailbreak] - 탈옥후 안정화

2020/05/15 - [iOS/Swift] - 다중 문자열 / 캐릭터 제거

 

 

반응형

'개발 > iOS' 카테고리의 다른 글

Fridump 사용법 (2/4) - Mac OS X 환경 구축  (0) 2020.05.19
Fridump 사용법 (1/4) - iOS디바이스 환경 구축  (0) 2020.05.19
Frida 설치 및 사용법  (0) 2020.05.19
Tcpdump 사용법  (0) 2020.05.19
APNs - 기능 및 유실 사례  (0) 2020.05.18
블로그 이미지

SKY STORY

,
반응형

폰에 Frida 설치 

https://www.frida.re/docs/ios/#with-jailbreak

 

Sources 추가 및 Frida 설치 

https://build.frida.re

 

Frida 설치 

pip install frida 

pip install frida -- upgrade

pip3 install frida

pip3 install frida -- upgrade

 

frida-ps 옵션을 확인한다. 

frida-ps -h

 

 

 

기기에서 실행중인 프로세스 목록 출력

frida-ps -U

-U : USB로 연결된 기기에 접속.

-D : Device ID로 기기에 접속.

-R : Remote Server(원격서버)에 접속

-H : Host의 Remote Server(원격서버)에 접속

 

연결되어있는 기기 목록 출력 

frida-ls-devices

 

 

 

USB에 연결된 기기의 실행중인 프로세스 목록 출력 

frida-ps -Uai

 

 

 

메모리 덤프 실행 

python fridump.py -U -s -r AppName 

 

다음과 같은 에러 출력시 관리자 권한으로 실행 

python fridump.py -U -s -r AppName 

Traceback (most recent call last):

File "fridump.py", line 2, in <module> 

import frida ImportError: No module named frida

 

관리자 권한으로 메모리 덤프 실행 

sudo -H python fridump.py -U -s -r APPNAME

 

2020/05/19 - [iOS/Jailbreak] - Fridump 사용법 (1/4) - iOS디바이스 환경 구축

2020/05/19 - [iOS/Jailbreak] - Fridump 사용법 (2/4) - Mac OS X 환경 구축

2020/05/19 - [iOS/Jailbreak] - Fridump 사용법 (3/4) - 메모리 덤프

2020/06/12 - [iOS/Jailbreak] - Fridump 사용법 (4/4) - 결과물 바이너리 검색

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (1/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (2/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (3/4)

2020/07/11 - [Android/Rooting] - 안드로이드 Fridump 사용하기 (4/4)

2020/05/19 - [OS/Mac OS X] - gdb 설치

2020/05/19 - [OS/Mac OS X] - Mac에서 Node.js 설치

2020/05/19 - [iOS/Jailbreak] - Tcpdump 사용법

2020/05/19 - [개발노트] - UUID의 구성 요소

2020/05/18 - [iOS/etc] - APNs

2020/05/18 - [iOS/Swift] - Multiple font colors in a single UILabel

2020/05/18 - [개발툴/Xcode] - Storyboard References (스토리보드 분리)

2020/05/18 - [iOS/Jailbreak] - OpenSSL Mac 연동

2020/05/18 - [iOS/Objective-C] - NSLog 출력 크기 제한 풀기

2020/05/18 - [OS/Mac OS X] - Symbolic Link

2020/05/18 - [개발툴/Xcode] - Release 모드에서 디버깅

2020/05/18 - [iOS/Jailbreak] - 탈옥후 안정화

2020/05/15 - [iOS/Swift] - 다중 문자열 / 캐릭터 제거

2020/05/15 - [iOS/Swift] - String substring

2020/05/15 - [iOS/Swift] - Framework 경로

 

 

 

반응형

'개발 > iOS' 카테고리의 다른 글

Fridump 사용법 (1/4) - iOS디바이스 환경 구축  (0) 2020.05.19
Fridump, Tcpdump, OpenSSL Quick Guide  (0) 2020.05.19
Tcpdump 사용법  (0) 2020.05.19
APNs - 기능 및 유실 사례  (0) 2020.05.18
Multiple font colors in a single UILabel  (0) 2020.05.18
블로그 이미지

SKY STORY

,

Tcpdump 사용법

개발/iOS 2020. 5. 19. 09:50
반응형

tcpdump 리모트 패킷캡쳐

rvictl [-h][-l][-s <udid1> ... <udidN>][-x <udid1> ... <udidN>]

 

Remote Virtual Interface Tool starts and stops a remote packet capture instance for any set of attached mobile devices. It can also provide feedback on any attached devices that are currently relaying packets back to this host.

 

Options:

-l, -L List currently active devices

-s, -S Start a device or set of devices

-x, -X Stop a device or set of devices

 

주어진 UUID를 Virtual interface로 등록

rvictl -s [UUID] 

rvictl -s 00008020-000915301AF2002E

 

등록된 virtual interface 이름 확인

rvictl -l

virtual interface이름은 rvi0, rvi1, rvi2 등으로 구성된다.

 

네트워크로 등록되어 있는지 확인된 이름으로 조회

Ifconfig rvi0

 

등록이 잘 됬는지 확인

ifconfig -l

 

rvi0 등록여부 체크

 

virtual interface를 삭제하려면

rvictl -x [UUID] 

rvictl -x 00008020-000915301AF2002E

 

패킷캡쳐

sudo tcpdump -n -i rvi0

 

패킷캡쳐 (간략버전)

sudo tcpdump -n -t -i rvi0 -q tcp

 

패킷캡쳐 (아스키)

sudo tcpdump -n -t -i rvi0 -q -A tcp

 

중단은 Ctrl+C

 

WireShark 툴을 사용할 수 있다.

https://www.wireshark.org/download.html

 

[분할 저장] 

10초단위로 끈어서 시간명으로 파일생성

sudo tcpdump -nn net 115.68 -G 10 -w tcpdump_%Y%m%d_%H:%M:%S.pcap -Z root'

 

10초단위로 끈어서 시간명으로 파일생성하되 촤대 파일갯수는 5개

tcpdump -nn net 115.68 -G 5 -w tcpdump2_%Y%m%d_%H:%M:%S.pcap -Z root -W 5

 

저장된 파일 리스트 

ls -al trace_2014-09-11*

 

파일사이즈단위로 끈어서 저장 (1M 단위로 끈어서 저장)

tcpdump -nn net 115.68 -C 1 -w tcpdump3_%Y%m%d_%H:%M:%S.pcap -Z root

 

Wireshark 에서 tcpdump파일 읽기

sudo tcpdump -i any -s 0 port 80 -w test.pcap

 

콘솔에서 읽기

tcpdump -r test.pcap 

tcpdump -r test.pcap -X

 

 

2020/05/19 - [개발노트] - UUID의 구성 요소

2020/05/18 - [iOS/etc] - APNs

2020/05/18 - [iOS/Swift] - Multiple font colors in a single UILabel

2020/05/18 - [개발툴/Xcode] - Storyboard References (스토리보드 분리)

2020/05/18 - [iOS/Jailbreak] - OpenSSL Mac 연동

2020/05/18 - [iOS/Objective-C] - NSLog 출력 크기 제한 풀기

2020/05/18 - [OS/Mac OS X] - Symbolic Link

2020/05/18 - [개발툴/Xcode] - Release 모드에서 디버깅

2020/05/18 - [iOS/Jailbreak] - 탈옥후 안정화

2020/05/15 - [iOS/Swift] - 다중 문자열 / 캐릭터 제거

2020/05/15 - [iOS/Swift] - String substring

2020/05/15 - [iOS/Swift] - Framework 경로

2020/05/15 - [iOS/Objective-C] - Frameworks 경로

2020/05/15 - [iOS/Objective-C] - iOS디바이스 설정창 이동

 

반응형

'개발 > iOS' 카테고리의 다른 글

Fridump, Tcpdump, OpenSSL Quick Guide  (0) 2020.05.19
Frida 설치 및 사용법  (0) 2020.05.19
APNs - 기능 및 유실 사례  (0) 2020.05.18
Multiple font colors in a single UILabel  (0) 2020.05.18
OpenSSL Mac 연동  (0) 2020.05.18
블로그 이미지

SKY STORY

,
반응형

APNs 이란?

APNs(Apple Push Notification Service)는 Apple Device에 Push를 보내줄 수 있는 서비스이다. 지원하는 방식으로는 다음과 같다.

 

Legacy Push

- TLS(SSL) 소켓 통신

- Production(gateway.push.apple.com:2195) / Development(gateway.sandbox.push.apple.com:2195) 

Push

- HTTP/2 통신

- Production(api.push.apple.com:443) / Development(api.sandbox.push.apple.com:443) HTTP/1.1 통신을 지원하지 않는다.

 

APNS 기능

기본적으로 Push Notification 은 단방향 서비스이다.

개발 서버에서 APNS 에 푸쉬 알림을 요청하면 APNS가 알아서 디바이스에 전송한다.

개발 서버는 APNS에 요청하면 할 일은 끝이다.

개발 서버는 APNS 에 푸쉬 알림을 요청할 때, 데이터 format 등에 대한 정상 여부는 리턴 받지 만 실제 도착여부에 대해서는 리턴을 받지 못한다.

사용자가 설정에서 알림을 끄더라도 알림이 출력되지 않지만 알림 수신은 된다.

사용자가 알림을 중지했는지 여부는 알 수 없다. (즉 앱에서만 알 수 있음)

 

 

APNS 유실되는 사례

디바이스 전원이 꺼져있는 경우 APNS의 QoS (Quality of Service) 컴포넌트는 디바이스 전원이 꺼져있는 경우, Notification을 잠시 저장했다가 다시 사용 가능해질 때 Notification이 전달되도록 하지만, 다 음의 경우 저장된 Notification이 폐기된다.

 

- 잠시 꺼져 있는 경우(얼마나 잠시인지 명시되지 않았음) , APNS는 Notification을 저장을

하는데 저장 가능한 Notificaiton은 하나다. 디바이스가 꺼졌있는 동안 하나의 앱에서 여러

개의 푸쉬 알림을 보낸다면, 제일 나중에 보내진 Notification만 저장되어 전달된다. 이전

에 저장된 Notification 은 폐기된다.

 - 장시간 꺼져 있는 경우 (장시간이 얼마나인지는 명시되지 않았음), 저장된 Notification은 폐기된다.

 

APNS 서버 응답 코드

- 200 성공 

- 400 잘못된 요청 

- 403 인증서 또는 공급자 인증 토큰에 오류가 발생했습니다.

- 405 요청에 bad : 메서드 값이 사용되었습니다. POST 요청 만 을 지원합니다. 

- 410 장치 토큰이 해당 항목에 대해 더 이상 활성화되지 않습니다.

- 413 알림 페이로드가 너무 큽니다.

- 429 서버가 동일한 장치 토큰에 대해 너무 많은 요청을 수신했습니다.

- 500 내부 서버 오류 503 서버가 종료되어 사용할 수 없습니다.

- 503 서버가 종료되어 사용할 수 없습니다.

 

 

Feedback Service

Feedback 서비스는 Notification 전달 실패 정보를 개발 서버에 알려주기 위한 서비스다. 푸쉬 알림이 앱이 삭제된 이유로 전달되지 못했다면 , APNS 는 이를 Feedback 서비스에 알리 고 Feedback 서비스는 실패한 디바이스의 토큰을 리스트에 저장한다.

APNS 에서 푸쉬 알림을 디바이스로 전송하기 전에 실패한 – data format error 등 – 경우에 는 Feedback 서비스의 리스트에 등록되지 않는다.(즉, 전송자체가 성공한경우 Feedback 서 비스 사용이 가능함) 개발 서버는 APNS 연결과는 별개로 Feedback 서비스에 접속해서 디바이스 토큰 리스트를 요 청해야 한다. Feedback 서비스는 리스트가 요청될 때마다 리스트를 전달한 후 리스트를 초기화 (clear) 한다.

Feedback 서비스로부터 받은 리스트의 데이터에는 timestamp 정보가 포함되어 있다. 이를 이용하여 리스트에 있는 디바이스 토큰이 Push Service에 재등록되어 있는지를 확인할 수 있 다. (푸쉬 알림을 보낸 시각과 디바이스 토큰의 timestamp 를 비교하면 디바이스 토큰의 재등록 여부를 확인할 수 있다.)

 

Feedback 서비스로의 요청을 위한 url, port 및 format 등의 내용은 아래 링크 참조.

https://developer.apple.com/library/archive/documentation/NetworkingInternet/ Conceptual/RemoteNotificationsPG/BinaryProviderAPI.html

 

 

2020/05/19 - [개발노트] - UUID의 구성 요소

2020/05/18 - [분류 전체보기] - Multiple font colors in a single UILabel

2020/05/18 - [개발툴/Xcode] - Storyboard References (스토리보드 분리)

2020/05/18 - [iOS/Jailbreak] - OpenSSL Mac 연동

2020/05/18 - [iOS/Objective-C] - NSLog 출력 크기 제한 풀기

2020/05/18 - [OS/Mac OS X] - Symbolic Link

2020/05/18 - [개발툴/Xcode] - Release 모드에서 디버깅

2020/05/18 - [iOS/Jailbreak] - 탈옥후 안정화

2020/05/15 - [iOS/Swift] - 다중 문자열 / 캐릭터 제거

2020/05/15 - [iOS/Swift] - String substring

2020/05/15 - [iOS/Swift] - Framework 경로

2020/05/15 - [iOS/Objective-C] - Frameworks 경로

2020/05/15 - [iOS/Objective-C] - iOS디바이스 설정창 이동

2020/05/15 - [iOS/Objective-C] - Xcode 한글 깨짐 복구

 

반응형

'개발 > iOS' 카테고리의 다른 글

Frida 설치 및 사용법  (0) 2020.05.19
Tcpdump 사용법  (0) 2020.05.19
Multiple font colors in a single UILabel  (0) 2020.05.18
OpenSSL Mac 연동  (0) 2020.05.18
NSLog 출력 크기 제한 풀기  (0) 2020.05.18
블로그 이미지

SKY STORY

,
반응형

Type 1

  • The way to do it is to use NSAttributedString like this:

NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithAttributedString: label.attributedText];

[text addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(10, 1)];

[label setAttributedText: text];

 

 

 

Type 2

  • First of all initialize of you NSString and NSMutableAttributedString as below.

var myString:NSString = "I AM KIRIT MODI"

var myMutableString = NSMutableAttributedString()

 

In ViewDidLoad

override func viewDidLoad() {

    myMutableString = NSMutableAttributedString(string: myString, attributes: [NSFontAttributeName:UIFont(name: "Georgia", size: 18.0)!])

    myMutableString.addAttribute(NSForegroundColorAttributeName, value: UIColor.redColor(), range: NSRange(location:2,length:4))

    // set label Attribute

    labName.attributedText = myMutableString

    super.viewDidLoad()

}

 

 

  • MULTIPLE COLOR

Add the line code below in your ViewDidLoad to get multiple colors in a string.

var myMutableString = NSMutableAttributedString(string: str, attributes: [NSAttributedStringKey.font :UIFont(name: "Georgia", size: 18.0)!])

myMutableString.addAttribute(NSAttributedStringKey.foregroundColor, value: UIColor.red, range: NSRange(location:2,length:4))

 

 

 

 

Type 3

  • By using following extension function, you can directly set a color attribute to an attributed string and apply the same on your label.

extension NSMutableAttributedString {

    func setColorForText(textForAttribute: String, withColor color: UIColor) {

        let range: NSRange = self.mutableString.range(of: textForAttribute, options: .caseInsensitive)

 

        // Swift 4.2 and above

        self.addAttribute(NSAttributedString.Key.foregroundColor, value: color, range: range)

 

        // Swift 4.1 and below

        self.addAttribute(NSAttributedStringKey.foregroundColor, value: color, range: range)

    }

}

 

 

  • Try above extension, using a label:

let label = UILabel()

label.frame = CGRect(x: 60, y: 100, width: 260, height: 50)

let stringValue = "stackoverflow"

 

let attributedString: NSMutableAttributedString = NSMutableAttributedString(string: stringValue)

attributedString.setColorForText(textForAttribute: "stack", withColor: UIColor.black)

attributedString.setColorForText(textForAttribute: "over", withColor: UIColor.orange)

attributedString.setColorForText(textForAttribute: "flow", withColor: UIColor.red)

label.font = UIFont.boldSystemFont(ofSize: 40)

 

label.attributedText = attributedString

self.view.addSubview(label)

 

 

 

 

Type 4

  • You can easily use html inside attributedText property of the UILabel to easily do various text formatting.

    let htmlString = "<font color=\"red\">This is  </font> <font color=\"blue\"> some text!</font>"

    let encodedData = htmlString.data(using: String.Encoding.utf8)!

    let attributedOptions = [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType]

    do {

        let attributedString = try NSAttributedString(data: encodedData, options: attributedOptions, documentAttributes: nil)

        label.attributedText = attributedString

    } catch _ {

        print("Cannot create attributed String")

    }

 

 

 

 

Type 5

  • In my case, I needed to be able to set different colors/fonts within labels frequently so I made a UILabel extension using Krunal's NSMutableAttributedString extension.

    func highlightWords(phrases: [String], withColor: UIColor?, withFont: UIFont?) {

    let attributedString: NSMutableAttributedString = NSMutableAttributedString(string: self.text!)

    for phrase in phrases {

        if withColor != nil {

            attributedString.setColorForText(textForAttribute: phrase, withColor: withColor!)

        }

        if withFont != nil {

            attributedString.setFontForText(textForAttribute: phrase, withFont: withFont!)

        }

    }

    self.attributedText = attributedString

}

 

  • It can be used like this:

yourLabel.highlightWords(phrases: ["hello"], withColor: UIColor.blue, withFont: nil)

yourLabel.highlightWords(phrases: ["how are you"], withColor: UIColor.green, withFont: nil)

 

 

 

 

Type 6

  • Here is an extension for NSMutableAttributedString, that add/set color on string/text.

extension NSMutableAttributedString {

    func setColor(color: UIColor, forText stringValue: String) {

        let range: NSRange = self.mutableString.range(of: stringValue, options: .caseInsensitive)

        self.addAttribute(NSAttributedStringKey.foregroundColor, value: color, range: range)

    }

}

 

  • Now, try above extension with UILabel and see result

let label = UILabel()

label.frame = CGRect(x: 40, y: 100, width: 280, height: 200)

let red = "red"

let blue = "blue"

let green = "green"

let stringValue = "\(red)\n\(blue)\n&\n\(green)"

label.textColor = UIColor.lightGray

label.numberOfLines = 0

let attributedString: NSMutableAttributedString = NSMutableAttributedString(string: stringValue)

attributedString.setColor(color: UIColor.red, forText: red)   // or use direct value for text "red"

attributedString.setColor(color: UIColor.blue, forText: blue)   // or use direct value for text "blue"

attributedString.setColor(color: UIColor.green, forText: green)   // or use direct value for text "green"

label.font = UIFont.systemFont(ofSize: 26)

label.attributedText = attributedString

self.view.addSubview(label)

 

 

 

Type 7

  • HTML문자열 데이터를 특성 문자열 텍스트로 변환 

[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUTF8StringEncoding] 

                                                                                                          options:@{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: @(NSUTF8StringEncoding)

} documentAttributes:nil error:nil];

 

 

  • using NSMutableAttributedString from html string 

NSHTMLTextDocumentTypeNSString *s = @"<p><a href='https://itunes.apple.com/us/app/xxxx/xxxx?mt=8'>https://itunes.apple.com/us/app/xxxx/xxxx?mt=8</a></p>";

NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithData:[s dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil ];

myUILabel.attributedText = text;

 

 

 

 

 

참고

  • HTML to NSAttributedString

 NSString *htmlString=[[NSString alloc]initWithFormat:@"<!DOCTYPE html><html><body><h1>My First Heading</h1><p>My first paragraph.</p></body></html>"];

//Converting HTML string with UTF-8 encoding to NSAttributedString

 NSAttributedString *attributedString = [[NSAttributedString alloc]

                                        initWithData: [htmlString dataUsingEncoding:NSUnicodeStringEncoding]

                                        options: @{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType }

                                        documentAttributes: nil

                                        error: nil ];

 

  • NSAttributedString to HTML

//Dictionary to hold all the attributes of NSAttributed String

 NSDictionary *documentAttributes = @{NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType};

 //Saving the NSAttributedString with all its attributes as a NSData Entity

 NSData *htmlData = [attributedString dataFromRange:NSMakeRange(0, attributedString.length) documentAttributes:documentAttributes error:NULL];

 //Convert the NSData into HTML String with UTF-8 Encoding

 NSString *htmlString = [[NSString alloc] initWithData:htmlData encoding:NSUTF8StringEncoding];

 

 

출처 :

https://stackoverflow.com/questions/27728466/use-multiple-font-colors-in-a-single-label

 

 

 

 

반응형

'개발 > iOS' 카테고리의 다른 글

Tcpdump 사용법  (0) 2020.05.19
APNs - 기능 및 유실 사례  (0) 2020.05.18
OpenSSL Mac 연동  (0) 2020.05.18
NSLog 출력 크기 제한 풀기  (0) 2020.05.18
탈옥후 안정화  (0) 2020.05.18
블로그 이미지

SKY STORY

,

OpenSSL Mac 연동

개발/iOS 2020. 5. 18. 11:15
반응형

SSL 접속 ssh root@192.168.0.112

[ 비밀번호 입력 ]

 

The authenticity of host '192.168.0.112 (192.168.0.112)' can't be established. RSA key fingerprint is SHA256:r0yomySgcGIUYEun3FJM4P0XpZ8CSFYJOxBU+p7UVB8.

Are you sure you want to continue connecting (yes/no)? yes 

Warning: Permanently added '192.168.0.112' (RSA) to the list of known hosts. 

root@192.168.0.112's password:

 

Cydia를 통해 OpenSSH 및 iFile설치 OpenSSH는 PC에서 디바이스에 원격으로 접속하기 위해 설치(PC에서 터미널을 사용하기 위 함) 

iFile : iOS는 Android와 같은 ADB환경이 구축되지 않아, PC와 iOS디바이스 간의 파일 전송이 필요함.

 

putty로 iOS 디바이스의 IP로 SSL접속 후 iOS용으로 빌드된 apt-get을 push해준다. 

cd /usr/bin/

 

/usr/bin/ 내의 apt-get에 실행 권한을 주고 Cydia에서 APT 0.7 Strict를 설치해주면 apt-get 명령을 사용할 수 있다.

chmod 755 apt-get

 

만약 /usr/bin/ 디렉토리에 gdb가 존재하지 않는다면 gdb를 설치해준다. 

sudo apt-get update 

sudo apt-get install gdb

 

gdb 실행 권한 설정 

chmod 755 gdb

 

원격 터미널로 접속하기 위해 App의 PID 정보 확인한다. 

grep명령으로 앱의 저장 경로 및 PID 정보를 출력한다. 

ps -ef | grep UBpayLibDev 

 

 

PID를 이용하여 gdb Attach한다. 

gdb -p 925

 

유틸 설치 

sudo apt-get install flex bison 

sudo apt-get install build-essential gcc-multilib lib32stdc++-5-dev 

python-dev python3-dev git

 

2020/05/18 - [iOS/Objective-C] - NSLog 출력 크기 제한 풀기

2020/05/18 - [OS/Mac OS X] - Symbolic Link

2020/05/18 - [개발툴/Xcode] - Release 모드에서 디버깅

2020/05/18 - [iOS/Jailbreak] - 탈옥후 안정화

2020/05/15 - [iOS/Swift] - 다중 문자열 / 캐릭터 제거

2020/05/15 - [iOS/Swift] - String substring

2020/05/15 - [iOS/Swift] - Framework 경로

2020/05/15 - [iOS/Objective-C] - Frameworks 경로

2020/05/15 - [iOS/Objective-C] - iOS디바이스 설정창 이동

2020/05/15 - [iOS/Objective-C] - Xcode 한글 깨짐 복구

2020/05/12 - [iOS/Swift] - WKWebView 스크린샷

2020/05/12 - [iOS/Swift] - json 포멧 체크

2020/05/12 - [iOS/Swift] - Access Control (접근 제한자)

2020/05/12 - [iOS/Swift] - WKWebview에서 tel, email, mailto, sms, facetime 처리

 

 

 

반응형

'개발 > iOS' 카테고리의 다른 글

APNs - 기능 및 유실 사례  (0) 2020.05.18
Multiple font colors in a single UILabel  (0) 2020.05.18
NSLog 출력 크기 제한 풀기  (0) 2020.05.18
탈옥후 안정화  (0) 2020.05.18
다중 문자열 / 캐릭터 제거  (0) 2020.05.15
블로그 이미지

SKY STORY

,
반응형

NSLog의 최대 출력은 1024 byte까지만 출력이 가능하다.

만약 이 한계를 넘어서는 로그 출력시 일부분만 출력 되게 된다.

 

다음과 같이 printf C함수를 사용하여 매크로 함수 선언후 사용하면 1024 byte 이상 문자열을 출력할 수 있다.

#ifdef DEBUG 

#define NSLogEx FORMAT, ...) printf("%s(%d) : %s\n", __PRETTY_FUNCTION__, __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]); 

#else

#define NSLogEx( FORMAT, ... ) 

#endif

 

사용방법 

NSString *logString = @“Q@# …. @#$”; 

NSLogEx(@“%@“, logString);

 

2020/05/18 - [OS/Mac OS X] - Symbolic Link

2020/05/18 - [개발툴/Xcode] - Release 모드에서 디버깅

2020/05/18 - [iOS/Jailbreak] - 탈옥후 안정화

2020/05/15 - [iOS/Swift] - 다중 문자열 / 캐릭터 제거

2020/05/15 - [iOS/Swift] - String substring

2020/05/15 - [iOS/Swift] - Framework 경로

2020/05/15 - [iOS/Objective-C] - Frameworks 경로

2020/05/15 - [iOS/Objective-C] - iOS디바이스 설정창 이동

2020/05/15 - [iOS/Objective-C] - Xcode 한글 깨짐 복구

2020/05/12 - [iOS/Swift] - WKWebView 스크린샷

2020/05/12 - [iOS/Swift] - json 포멧 체크

2020/05/12 - [iOS/Swift] - Access Control (접근 제한자)

2020/05/12 - [iOS/Swift] - WKWebview에서 tel, email, mailto, sms, facetime 처리

 

반응형

'개발 > iOS' 카테고리의 다른 글

Multiple font colors in a single UILabel  (0) 2020.05.18
OpenSSL Mac 연동  (0) 2020.05.18
탈옥후 안정화  (0) 2020.05.18
다중 문자열 / 캐릭터 제거  (0) 2020.05.15
String substring  (0) 2020.05.15
블로그 이미지

SKY STORY

,

탈옥후 안정화

개발/iOS 2020. 5. 18. 10:31
반응형
반응형

'개발 > iOS' 카테고리의 다른 글

OpenSSL Mac 연동  (0) 2020.05.18
NSLog 출력 크기 제한 풀기  (0) 2020.05.18
다중 문자열 / 캐릭터 제거  (0) 2020.05.15
String substring  (0) 2020.05.15
Framework 경로  (0) 2020.05.15
블로그 이미지

SKY STORY

,