小專欄地址sass
公司每一年的6月份會舉辦一場奪旗大賽,做爲讀書會的小組成員。我就負責出了一份比較簡單的iOS題bash
base64解碼獲得2383214142
經過手機鍵盤-九宮格獲得
答案 CVAGH
複製代碼
@interface MyAccount : NSObject
@property (nonatomic, copy) NSString *flag;
@end
@implementation MyAccount
@end
複製代碼
一、.m文件實現NSCoding協議,補充代碼以下
#import "MyAccount.h"
@interface MyAccount()<NSCoding>
@end
@implementation MyAccount
- (void)encodeWithCoder:(NSCoder *)aCoder{
[aCoder encodeObject:self.flag forKey:@"flag"];
}
- (id)initWithCoder:(NSCoder *)decoder {
if (self = [super init]) {
_flag = [decoder decodeObjectForKey:@"flag"];
}
return self;
}
@end
二、導入data包,NSKeyedUnarchiver解檔對象,獲得flag: c2h1aXJ1aWtlamljdGY=
NSString *dataFile = [[NSBundle mainBundle]pathForResource:@"data" ofType:@"asd"];
MyAccount *model = [NSKeyedUnarchiver unarchiveObjectWithFile:dataFile];
NSLog(@"dataFile = %@",model.flag);
三、使用base64解碼獲得
答案: shuiruikejictf
複製代碼
使用Hopper Disassembler工具反編譯
以下圖讀取到
flag = U2FsdGVkX18wjamzHeMlywW3nE/EPSImPYlN25ihcf0=
decode = shurui
使用AES 解密(密鑰shurui)
答案:flag = asdxczcsa
複製代碼