Contents

Algorithm
2014.07.01 17:55

OCB5 Injection 앗싸뵹! ㅋㅋ

조회 수 926 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

앗쌰뵹 ㅋㅋㅋ


이렇게 Javascript Injection 으로 점수 조작이 가능하다 ㅋㄷ;




# 인젝션 함수 실행 부분 Example

NSString *prefixUrl1 = @"https://appgame.okcashbag.com/game/2048/";
if([request.URL.absoluteString hasPrefix:prefixUrl1]) {
  [self performSelector:@selector(doInjection) withObject:nil afterDelay:5.0];
}


# Javascript 인젝션 함수 Example

- (void)doInjection {
  NSString *buildString = @"game2048_04210214";
  NSString *scoreString = @"513842";
  NSString *keyString = @"26gameState";
  
  // 초기 값 확인 함
  [self viewJson:keyString];
  
  // 스코어 인젝션
  NSString *game2048String = [[NSUserDefaults standardUserDefaults] objectForKey:buildString];
  if ([game2048String isEqualToString:@"Y"] == NO) {
    [[NSUserDefaults standardUserDefaults] setObject:@"Y" forKey:buildString];
    [self injectScore:scoreString key:keyString];
    
    // 잘 됐는지 확인 함
    [self viewJson:keyString];
  }
}

- (void)viewJson:(NSString *)keyString {
  //NSString *result1 = [NSString stringWithFormat:@"localStorage.getItem('12gameState');"];
  NSString *result1 = [NSString stringWithFormat:@"localStorage.getItem('%@');", keyString];
  NSString *value1 = [_webView stringByEvaluatingJavaScriptFromString:result1];
  NSLog(@"------> value1 : %@", value1);
}

- (void)injectScore:(NSString *)scoreString key:(NSString *)keyString {
  //NSString *keyString = @"12gameState";
  //NSString *scoreString = @"460182";
  //NSString *buildString = @"game2048_1127";
  NSString *result0 = [NSString stringWithFormat:@"localStorage.setItem(\"%@\",
    JSON.stringify({\"grid\":{\"size\":4,\"cells\":[[{\"position\":{\"x\":0,\"y\":0},\"value\":2},
    {\"position\":{\"x\":0,\"y\":1},\"value\":1024},{\"position\":{\"x\":0,\"y\":2},\"value\":8192},
    {\"position\":{\"x\":0,\"y\":3},\"value\":64}],[{\"position\":{\"x\":1,\"y\":0},\"value\":512},
    {\"position\":{\"x\":1,\"y\":1},\"value\":256},{\"position\":{\"x\":1,\"y\":2},\"value\":256},
    {\"position\":{\"x\":1,\"y\":3},\"value\":128}],[{\"position\":{\"x\":2,\"y\":0},\"value\":1024},
    {\"position\":{\"x\":2,\"y\":1},\"value\":4},{\"position\":{\"x\":2,\"y\":2},\"value\":2},
    {\"position\":{\"x\":2,\"y\":3},\"value\":2048}],[{\"position\":{\"x\":3,\"y\":0},\"value\":1024},
    null,null,null]]},\"score\":%@,\"over\":false,\"won\":false,\"keepPlaying\":false,\"started\":true}));",
    keyString, scoreString];
  NSString *value0 = [_webView stringByEvaluatingJavaScriptFromString:result0];
  NSLog(@"------> value0 : %@", value0);
}


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
81 Develop [c] 이진 탐색 두 가지 코드 (재귀/반복) file hooni 2015.06.26 957
80 Develop [c] 기막힌 정렬 코드 ㅋㄷ file hooni 2015.10.13 954
79 Develop [android] N-Puzzle 게임 file hooni 2015.07.09 952
78 Develop [git] 쉬운 버전관리 Git 설명 hooni 2015.08.18 951
77 Develop Aspect Oriented Programming in Objective-C hooni 2015.05.18 938
76 Develop [ios] iOS 앱 아이콘을 만드는 유틸 file hooni 2015.01.03 938
75 Develop [android] Android N requires the IDE to be running with Java 1.8 or later 오류 hooni 2016.08.30 937
74 Develop [ios] NSString, RegularExpression Find/Replace hooni 2017.04.14 935
73 System/OS [macos] How to Fix ‘You Shut Down Your Computer Because of a Problem’ file hooni 2022.06.01 932
72 Develop [android] 초간단 얼럿 (AlertDialog) hooni 2016.10.21 932
71 Develop [io] Apple Watch, Today Extension 앱ID 설정 hooni 2016.04.20 927
» Algorithm OCB5 Injection 앗싸뵹! ㅋㅋ file hooni 2014.07.01 926
Board Pagination Prev 1 ... 87 88 89 90 91 92 93 94 95 96 ... 98 Next
/ 98