当前位置: 编程技术>移动开发
本页文章导读:
▪八门神器 - GameKiller 中的防破译技术(附 2.50 免注册版) 八门神器 - GameKiller 中的防破解技术(附 2.50 免注册版)支持正版软件 http://maocai.taobao.com/
免注册版下载
http://pan.baidu.com/share/link?shareid=30347&uk=2114195841
注册信息页面, IMEI 和 IMSI 会显示为.........
▪ 推箱子容易实现(objective-c) 推箱子简单实现(objective-c)推箱子大家都知道吧,在cocos2d上简单实现了一个!
typedef enum
{
None=-1,
Wall=0,
Worker,
Box,
Passageway,
Destination,
WorkerInDest,
RedBox,
} Map_State;
//代表.........
▪ 有关问题小结(19)-根据包名获取主Intent 问题小结(19)-根据包名获取主Intent博客断更一个半月了,主要是没做什么实质性的工作,又不想去学一些东西,这篇博文主要是获取其他apk程序的启动的主intent,这样一个APK启动另外一个ap.........
[1]八门神器 - GameKiller 中的防破译技术(附 2.50 免注册版)
来源: 互联网 发布时间: 2014-02-18
八门神器 - GameKiller 中的防破解技术(附 2.50 免注册版)
支持正版软件 http://maocai.taobao.com/
免注册版下载 http://pan.baidu.com/share/link?shareid=30347&uk=2114195841
注册信息页面, IMEI 和 IMSI 会显示为 BLACKLIST ,这是我的疏忽所致,不影响使用。如果免注册版中有其他 bug ,请在下面评论指出。
八门神器中使用了下面列出的防破解手段,其他软件防破解技巧参见 http://blog.csdn.net/coolypf/article/details/7832823
防逆向分析 混淆 Java 代码,同时加密修改器核心引擎 gamekillerengine 。 防注册机 使用 RSA 加密注册文件。 防止修改 classes.dex 使用 classes.dex 的文件大小和 CRC32 值解密 gamekillerengine ,同时在 gamekillerengine 中检查 classes.dex 的大小和 CRC32 。 防 dalvik-cache 补丁 使用 DexFile.loadDex 生成 ODEX ,与 dalvik-cache 进行比较。 常量加密 阻止在解密后的 gamekillerengine 文件中直接搜索关键的常数和字符串,例如 classes.dex 的文件大小和 CRC32 值,以及 "/data/dalvik-cache" 等。
修改器核心引擎 gamekillerengine 中的部分防破解关键代码如下图所示:
2楼kseian昨天 15:13如果能破解POWERAMP就好了。。。1楼Tannear昨天 10:59请教下,如何对PE,或ELF,SO等文件的常量加密呢 ?Re: coolypf昨天 12:06回复Tannearn对于常量C,取一个随机数A,令B=A^Cn在程序中保存A和B的值,要用到C时以A^B代替Re: Tannear昨天 13:01回复coolypfn如果对字符串加密能用宏定义就最好不过了,比如n#define ENCRYPT_STR(_str, _key) ...n#define DECRYPT_STR(_enStr, _key) ...nn// 定义"abcd"被“1234”加密后的值n#define STR ENCRYPT_STR("abcd", "1234")nn// 使用"abcd"的时候nDECRYPT_STR(STR, "1234")nn不过ENCRYPT_STR,DECRYPT_STR好像用c语言的宏很难实现, 有没有什么好的办法呢 ?Re: coolypf昨天 13:46回复Tannearn另外写一个预处理程序,对C代码中的字符串常量进行加密转换nC代码中使用字符串常量之前再解密就行了
支持正版软件 http://maocai.taobao.com/
免注册版下载 http://pan.baidu.com/share/link?shareid=30347&uk=2114195841
注册信息页面, IMEI 和 IMSI 会显示为 BLACKLIST ,这是我的疏忽所致,不影响使用。如果免注册版中有其他 bug ,请在下面评论指出。
八门神器中使用了下面列出的防破解手段,其他软件防破解技巧参见 http://blog.csdn.net/coolypf/article/details/7832823
修改器核心引擎 gamekillerengine 中的部分防破解关键代码如下图所示:
2楼kseian昨天 15:13如果能破解POWERAMP就好了。。。1楼Tannear昨天 10:59请教下,如何对PE,或ELF,SO等文件的常量加密呢 ?Re: coolypf昨天 12:06回复Tannearn对于常量C,取一个随机数A,令B=A^Cn在程序中保存A和B的值,要用到C时以A^B代替Re: Tannear昨天 13:01回复coolypfn如果对字符串加密能用宏定义就最好不过了,比如n#define ENCRYPT_STR(_str, _key) ...n#define DECRYPT_STR(_enStr, _key) ...nn// 定义"abcd"被“1234”加密后的值n#define STR ENCRYPT_STR("abcd", "1234")nn// 使用"abcd"的时候nDECRYPT_STR(STR, "1234")nn不过ENCRYPT_STR,DECRYPT_STR好像用c语言的宏很难实现, 有没有什么好的办法呢 ?Re: coolypf昨天 13:46回复Tannearn另外写一个预处理程序,对C代码中的字符串常量进行加密转换nC代码中使用字符串常量之前再解密就行了
[2] 推箱子容易实现(objective-c)
来源: 互联网 发布时间: 2014-02-18
推箱子简单实现(objective-c)
推箱子大家都知道吧,在cocos2d上简单实现了一个!
typedef enum
{
None=-1,
Wall=0,
Worker,
Box,
Passageway,
Destination,
WorkerInDest,
RedBox,
} Map_State;
//代表堆栈长度
#define MaxNum 300
这个枚举很重要, Wall:墙, Worke:工人,Box:箱子,Passageway:通道,Destination:目的地,WorkerInDest:工人在目的地,RedBox:箱子在目的地,游戏中会根据这些不同的类型,生成对应的精灵贴图,也就是说至少有7张图,我这里用Num1.png、Num2.png...Num7.png七张图来表示。游戏开始前我会有一个关卡的配置的plist,里面是一个一维数组:010101234567... 通过这个就可以进行初始化布局!
游戏初始化:
//游戏进入函数
-(void) show
{
CGSize size = [[CCDirector sharedDirector] winSize];
movableSprites = [[NSMutableArray alloc] init];
labelStep = [CCLabelBMFont labelWithString:@"0" fntFile:@"mine.fnt"];
labelStep.position = ccp( size.width -30 , size.height-15 );
[self addChild:labelStep];
//后退按钮
flagBt=[CCSprite spriteWithSpriteFrameName:@"btnFlaged.png"];
flagBt.position=ccp(40,70);
[self addChild:flagBt z:1 tag:1000];
[movableSprites addObject:flagBt];
//向上按钮
upBt=[CCSprite spriteWithSpriteFrameName:@"up.png"];
upBt.position=ccp(230,90);
[self addChild:upBt z:1 tag:1001];
[movableSprites addObject:upBt];
//向下按钮
downBt=[CCSprite spriteWithSpriteFrameName:@"down.png"];
downBt.position=ccp(230,30);
[self addChild:downBt z:1 tag:1002];
[movableSprites addObject:downBt];
//向左按钮
leftBt=[CCSprite spriteWithSpriteFrameName:@"left.png"];
leftBt.position=ccp(180,60);
[self addChild:leftBt z:1 tag:1003];
[movableSprites addObject:leftBt];
//向右按钮
rightBt=[CCSprite spriteWithSpriteFrameName:@"right.png"];
rightBt.position=ccp(280,60);
[self addChild:rightBt z:1 tag:1004];
[movableSprites addObject:rightBt];
//初始化
[self intiGameConfig];
}
//游戏初始化
-(void) intiGameConfig
{
W=30;//每个方块宽度
m_col=10;//方块矩阵列数
m_row=10;//方块矩阵行数
m_count=m_row*m_col;//方块矩阵方块总数
//栈顶
s_top=-1;
stackStep=(int *)malloc(sizeof(int)*MaxNum);//保存走过的方向,1上2下3左4右
boxStatus=(int *)malloc(sizeof(int)*MaxNum);//保存行走时是否推了箱子
//初始化二维数组
myArrays=(int **)malloc(sizeof(int)*10);
for (int i=0; i<10; i++) {
myArrays[i]=(int *)malloc(sizeof(int)*10);
}
//读取关卡配置,一维数组:01010123456...
NSString* plistPath = [[NSBundle mainBundle] pathForResource:@"level3" ofType:@"plist"];
NSArray *Positions = [NSArray arrayWithContentsOfFile:plistPath];
int tx=0;
int ty=0;
int type=-1;
for (int i=0; i<m_count; i++) {
tx=i/m_col;//行
ty=i%m_col;//列
type=[[Positions objectAtIndex:i] intValue];
myArrays[tx][ty]=type;//保存方块类型
//方块精灵
CCSprite *p=[CCSprite spriteWithSpriteFrameName:[NSString stringWithFormat:@"Num%i.png",type]];
p.tag=i;
//p.anchorPoint=ccp(0, 0);
p.position=ccp(10+15+ty*W,130+15+tx*W);
[movableSprites addObject:p];
[self addChild:p z:1];
//找着工人位置
if (type==Worker) {
x=tx;
y=ty;
//tag=i=x*m_col+y;
}
}
}
工人行走功能实现:
-(void) ccTouchEnded:(UITouch*)touch withEvent:(UIEvent *)event
{
CGPoint touchlocation = [touch locationInView: [touch view]];
touchlocation =[[CCDirector sharedDirector] convertToGL:touchlocation];
CCSprite * newSprite = nil;
if (newSprite == nil) {
for (CCSprite *sprite in movableSprites) {
if (CGRectContainsPoint(sprite.boundingBox, touchlocation)) {
newSprite = sprite;
break;
}
}
}
if (newSprite==nil) {
CCLOG(@"NO CCSprite has beend touched!");
}
else
{
int x_1;
int y_1;
int x_2;
int y_2;
int na = [newSprite tag];
//CCLOG(@"tounchTag:%i",na);
switch (na) {
case 1000:
CCLOG(@"后退");
//
[self GoBack];
break;
case 1001:
CCLOG(@"上");
x_1=x+1;
y_1=y;
x_2=x+2;
y_2=y;
[self MoveTo:1 x1:x_1 y1:y_1 x2:x_2 y2:y_2];
break;
case 1002:
CCLOG(@"下");
x_1=x-1;
y_1=y;
x_2=x-2;
y_2=y;
[self MoveTo:2 x1:x_1 y1:y_1 x2:x_2 y2:y_2];
break;
case 1003:
CCLOG(@"左");
x_1=x;
y_1=y-1;
x_2=x;
y_2=y-2;
[self MoveTo:3 x1:x_1 y1:y_1 x2:x_2 y2:y_2];
break;
case 1004:
CCLOG(@"右");
x_1=x;
y_1=y+1;
x_2=x;
y_2=y+2;
[self MoveTo:4 x1:x_1 y1:y_1 x2:x_2 y2:y_2];
break;
default:
break;
}
}
}
//换图
-(void) changeSpritePic:(int) xx yy:(int) yy type:(int) type
{
int tag=xx*m_col+yy;
CCSprite *p=(CCSprite *)[self getChildByTag:tag];
CCSpriteFrame* hpframe = [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:[NSString stringWithFormat:@"Num%i.png",type]];
[p setDisplayFrame:hpframe];
}
//检测是否完成
-(BOOL) IsFinish
{
BOOL bFinish=YES;
for (int i=0; i<m_col; i++) {
for (int j=0; j<m_col; j++) {
if (myArrays[i][j]==Destination||myArrays[i][j]==WorkerInDest) {
bFinish=NO;
break;
}
}
}
return bFinish;
}
-(void) MoveMan:(int)xx yy:(int)yy
{
if (myArrays[xx][yy]==Worker) {
//如果是通路
myArrays[xx][yy]=Passageway;
[self changeSpritePic:xx yy:yy type:Passageway];
}
else if(myArrays[xx][yy]==WorkerInDest)
{
myArrays[xx][yy]=Destination;
[self changeSpritePic:xx yy:yy type:Destination];
}
}
//是否在方块矩阵内
-(BOOL) IsInGameArea:(int)row col:(int)col
{
return (row>=0&&row<m_row&&col>=0&&col<m_col);
}
-(void) MoveTo:(int)path x1:(int)x1 y1:(int)y1 x2:(int)x2 y2:(int)y2
{
Map_State P1,P2;
P1=P2=None;
if ([self IsInGameArea:x1 col:y1]) {
P1=myArrays[x1][y1];
}
if ([self IsInGameArea:x2 col:y2]) {
P2=myArrays[x2][y2];
}
//前面是通道
if (P1==Passageway) {
[self MoveMan:x yy:y];
x=x1;
y=y1;
myArrays[x1][y1]=Worker;
[self changeSpritePic:x1 yy:y1 type:Worker];
[self inStack:path box:0];
}
//前面是目的地
if (P1==Destination) {
[self MoveMan:x yy:y];
x=x1;
y=y1;
myArrays[x1][y1]=WorkerInDest;
[self changeSpritePic:x1 yy:y1 type:WorkerInDest];
[self inStack:path box:0];
}
//前面是墙
if (P1==Wall||![self IsInGameArea:x1 col:y1]) {
return;
}
//前面是箱子
if (P1==Box) {
if (P2==Wall||![self IsInGameArea:x2 col:y2]||P2==Box) {
return;
}
}
//前面是箱子,前面的前面是路
if (P1==Box && P2==Passageway) {
[self MoveMan:x yy:y];
x=x1;
y=y1;
myArrays[x1][y1]=Worker;
myArrays[x2][y2]=Box;
[self changeSpritePic:x1 yy:y1 type:Worker];
[self changeSpritePic:x2 yy:y2 type:Box];
[self inStack:path box:1];
}
//前面是箱子,前面的前面是目的地
if (P1==Box && P2==Destination) {
[self MoveMan:x yy:y];
x=x1;
y=y1;
myArrays[x1][y1]=Worker;
myArrays[x2][y2]=RedBox;
[self changeSpritePic:x1 yy:y1 type:Worker];
[self changeSpritePic:x2 yy:y2 type:RedBox];
[self inStack:path box:1];
}
//前面是目的地的箱子,前面的前面是路
if (P1==RedBox && P2==Passageway) {
[self MoveMan:x yy:y];
x=x1;
y=y1;
myArrays[x1][y1]=WorkerInDest;
myArrays[x2][y2]=Box;
[self changeSpritePic:x1 yy:y1 type:WorkerInDest];
[self changeSpritePic:x2 yy:y2 type:Box];
[self inStack:path box:1];
}
//前面是目的地的箱子,前面的前面是目的地
if (P1==RedBox && P2==Destination) {
[self MoveMan:x yy:y];
x=x1;
y=y1;
myArrays[x1][y1]=WorkerInDest;
myArrays[x2][y2]=RedBox;
[self changeSpritePic:x1 yy:y1 type:WorkerInDest];
[self changeSpritePic:x2 yy:y2 type:RedBox];
[self inStack:path box:1];
}
//判断是否完成
if ([self IsFinish]) {
//显示完成界面
[self showWin];
}
}
//进栈
-(void) inStack:(int) path box:(int)box
{
if (s_top+1<MaxNum) {
s_top++;
[labelStep setString:[NSString stringWithFormat:@"%i",s_top+1]];
stackStep[s_top]=path;
boxStatus[s_top]=box;
}
else
{
CCLOG(@"堆栈满了!");
}
//[self printStack];
}
//出栈
-(CGPoint) outStack
{
CGPoint temp;
if (s_top==-1) {
CCLOG(@"堆栈空了!");
temp.x=0;
temp.y=0;
}
else
{
temp.x=stackStep[s_top];
temp.y=boxStatus[s_top];
s_top--;
[labelStep setString:[NSString stringWithFormat:@"%i",s_top+1]];
}
return temp;
}
-(void) showWin
{
winLayer *layer=[winLayer node];
[layer showWinLayer];
[self addChild:layer z:2];
}
后退功能实现:
//后退函数
-(void) GoBack
{
//后退专用
int x_1;//人的前面(箱子)
int y_1;
int x_2;//人的后面
int y_2;
CGPoint p=[self outStack];
int na=p.x;
if (na==0) {
return ;
}
switch (na) {
case 1:
CCLOG(@"下");
//
x_1=x+1;
y_1=y;
x_2=x-1;
y_2=y;
[self MoveBack:p.y x1:x_1 y1:y_1 x2:x_2 y2:y_2];
break;
case 2:
CCLOG(@"上");
//
x_1=x-1;
y_1=y;
x_2=x+1;
y_2=y;
[self MoveBack:p.y x1:x_1 y1:y_1 x2:x_2 y2:y_2];
break;
case 3:
CCLOG(@"右");
//
x_1=x;
y_1=y-1;
x_2=x;
y_2=y+1;
[self MoveBack:p.y x1:x_1 y1:y_1 x2:x_2 y2:y_2];
break;
case 4:
CCLOG(@"左");
//
x_1=x;
y_1=y+1;
x_2=x;
y_2=y-1;
[self MoveBack:p.y x1:x_1 y1:y_1 x2:x_2 y2:y_2];
break;
default:
break;
}
}
-(void) MoveBack:(int)box x1:(int)x1 y1:(int)y1 x2:(int)x2 y2:(int)y2
{
Map_State P1,P2;
P1=P2=None;
//p1:前面,箱子,p2:后面
if ([self IsInGameArea:x1 col:y1]) {
P1=myArrays[x1][y1];
}
if ([self IsInGameArea:x2 col:y2]) {
P2=myArrays[x2][y2];
}
//后面是路
if (P2==Passageway) {
//
myArrays[x2][y2]=Worker;
[self changeSpritePic:x2 yy:y2 type:Worker];
}
//后面是目的地
if (P2==Destination) {
//
myArrays[x2][y2]=WorkerInDest;
[self changeSpritePic:x2 yy:y2 type:WorkerInDest];
}
[self MoveMan:x yy:y];
//前面是箱子并且当时走这一步时推了箱子
if (P1==Box&&box==1) {
//
if (myArrays[x][y]==Destination) {
myArrays[x][y]=RedBox;
[self changeSpritePic:x yy:y type:RedBox];
}
if (myArrays[x][y]==Passageway)
{
myArrays[x][y]=Box;
[self changeSpritePic:x yy:y type:Box];
}
myArrays[x1][y1]=Passageway;
[self changeSpritePic:x1 yy:y1 type:Passageway];
}
//前面是目的地的箱子并且当时走这一步时推了箱子
if (P1==RedBox&&box==1) {
//
if (myArrays[x][y]==Destination) {
myArrays[x][y]=RedBox;
[self changeSpritePic:x yy:y type:RedBox];
}
if (myArrays[x][y]==Passageway)
{
myArrays[x][y]=Box;
[self changeSpritePic:x yy:y type:Box];
}
myArrays[x1][y1]=Destination;
[self changeSpritePic:x1 yy:y1 type:Destination];
}
x=x2;
y=y2;
}
好了,就这么多,回头我会再贴一个,C#写的地图编辑器!欢迎交流!
[3] 有关问题小结(19)-根据包名获取主Intent
来源: 互联网 发布时间: 2014-02-18
问题小结(19)-根据包名获取主Intent
博客断更一个半月了,主要是没做什么实质性的工作,又不想去学一些东西,这篇博文主要是获取其他apk程序的启动的主intent,这样一个APK启动另外一个apk就又有了一个方便的方式
private Intent getIntent(String pkg) {
PackageManager mPackageManager= context.getPackageManager();
if (pkg == null)
return;
Intent intent = mPackageManager.getLaunchIntentForPackage(pkg);
return intent;
}
最新技术文章: