逆向-还原代码之print (Arm 64)

逆向-还原代码之print (Arm 64)_第1张图片

逆向-还原代码之print (Arm 64)_第2张图片 

 逆向-还原代码之print (Arm 64)_第3张图片

 // source code

#include
#include
#include
#include

char *_strcpy(char *dest, const char *src)
{
    assert( (dest != NULL) && (src != NULL));
    char *adr;
    
    adr = dest;
    while ( (*dest++ = *src++) != '\0');
    
    return adr;
}

int main()
{
    char name[5] = "asdf";
    char *p1 = "name";
    char *p2;
    int i;
    

    p2 = (char *)malloc(20);
    memset(p2, 0, 20);
    
    p2 = "xiaozhixiaozhixiaozhixiaozhixiaozhixiaozhi";
    //*p2++ = 'b';
    //*p2++ = 'c';
    
    //                    4    4        4        5
    printf(" == %s %d %d %d %d\n", p1, strlen(p1), sizeof(p1), strlen(name), sizeof(name));    
    printf(" == %s %d %d\n", p2, strlen(p2), sizeof(p2));    
    
    //while(*p2++ = *p1++);
    //while((*p2++ = *p1++) != 4);
    for (i = 0; i < 3; i++)
        name[i] = *p1++;
    //*p2 = '\0';
    printf("%s\n", name);
}
 

你可能感兴趣的:(Assembly,c语言,汇编)