그래서 누군가가 "어떻게"숨길 수 있는지 질문했습니다. 그것을 할 수인라인 어셈블리 및 함수가 세그 폴트로 인해 덮어 쓰기
encode.c: In function `main': encode.c:13: warning: initialization from incompatible pointer type C:\DOCUME~1\Aviral\LOCALS~1\Temp/ccYaOZhn.o:encode.c:(.text+0xf): undefined reference to `text' C:\DOCUME~1\Aviral\LOCALS~1\Temp/ccYaOZhn.o:encode.c:(.text+0x14): undefined reference to `printf' collect2: ld returned 1 exit status
내 첫 번째 질문은 왜 인라인 어셈블리는 실패한다 ... 어떤 것이 올바른 방법은 : 문제가있다,
#include <stdio.h>
#include <stdlib.h>
int encrypt(void)
{
char *text="Hello World";
asm("push text");
asm("call printf");
return 0;
}
int main(int argc, char *argv[])
{
volatile unsigned char *i=encrypt;
while(*i!=0x00)
*i++^=0xBE;
return EXIT_SUCCESS;
}
하지만이 내 대답했다? 다른 것 - "ret"또는 "retn"에 대한 코드는 0x00입니다. 바로 ... 내 코드 xor의 물건이 반환 될 때까지 ... 그렇다면 왜 SEGFAULTing입니까?