arm汇编学习(三)


一、ndk编译android上运行的c程序

新建个hello目录,底下要有jni目录,下面就是Android.mk文件

1.Android.mk文件内容如下:

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)
LOCAL_SRC_FILES:= hello.c
LOCAL_MODULE:= hello

LOCAL_FORCE_STATIC_EXECUTABLE := true
#LOCAL_STATIC_LIBRARIES := libc
#LOCAL_CFLAGS += -Iinclude/dir -DSOMEFLAGS

include $(BUILD_EXECUTABLE)

2.jni下新建个hello.c,内容取自kanxue论坛上的一份代码:

#include <stdio.h>
#include <string.h>
int main(int argc,char *argv[])
{
char name[]="helloworld";
int keys[]={0xb,0x1f,0x19,0x19,0x49,0xb,0xb,0xb,0x31,0x53};
char Thekeys[11];
int i;
for(i=0;i<10;i++)
{
keys[i]^=7;
keys[i]=keys[i]/6;
keys[i]+=22;
keys[i]-=24;
keys[i]^=name[i];
}
for(i=0;i<10;i++)
{
Thekeys[i]=keys[i];
}
Thekeys[i]=0;
if(!strcmp(Thekeys,argv[1]))
printf("Good Work,you have Successed!");
else
printf("NO,you are failed!");
return 0;
}

3.编译

moonflow@WIN-KG08V2FIOKP /cygdrive/c/helloc/jni
$ $NDK/ndk-build
Cygwin : Generating dependency file converter script
Compile thumb : hello <= hello.c
Executable : hello
Install : hello => libs/armeabi/hello

4.参考:

http://leave001.blog.163.com/blog/static/16269129320111128113217384/
http://guoh.org/lifelog/2012/02/run-native-c-code-on-android/
http://www.cnblogs.com/newcj/archive/2011/08/14/2138553.html

 

二、ARM crackme学习

ARM初步完成,开始以crackme练习作为学习的目的

参考如下:

http://shubhamaher.blogspot.com/2013/04/native-android-reverse-engineering.html
http://blog.zimperium.com/arm-crackme-competition/
http://www.programlife.net/android-crackme1.html
http://bbs.pediy.com/showthread.php?p=1204020#post1204020

posted @ 2013-07-31 01:19  yarpee  阅读(343)  评论(0编辑  收藏  举报