arm彙編學習(三)


1、ndk編譯android上運行的c程序php

新建個hello目錄,底下要有jni目錄,下面就是Android.mk文件html

1.Android.mk文件內容以下:android

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論壇上的一份代碼:post

#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.參考:ui

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.htmlspa

 

2、ARM crackme學習.net

ARM初步完成,開始以crackme練習做爲學習的目的code

參考以下:htm

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

相關文章
相關標籤/搜索