From 50b421a8c7cf382dbe297cd05e6a9fe8cef551ce Mon Sep 17 00:00:00 2001 From: Akira Kawata Date: Sat, 4 Oct 2025 15:52:07 +0900 Subject: [PATCH] Fix variable names --- ch01_introduction/03_revisit-hello-world/hello_exec_byte.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ch01_introduction/03_revisit-hello-world/hello_exec_byte.c b/ch01_introduction/03_revisit-hello-world/hello_exec_byte.c index 1335fe9..2c60048 100644 --- a/ch01_introduction/03_revisit-hello-world/hello_exec_byte.c +++ b/ch01_introduction/03_revisit-hello-world/hello_exec_byte.c @@ -1,18 +1,18 @@ #include #include -unsigned char hello_for_binaryhack[] = { +unsigned char hello_for_elfhack[] = { 0xe8, 0x0e, 0x00, 0x00, 0x00, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x0a, 0xba, 0x0e, 0x00, 0x00, 0x00, 0x5e, 0xbf, 0x01, 0x00, 0x00, 0x00, 0xb8, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x05, 0xbf, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x3c, 0x00, 0x00, 0x00, 0x0f, 0x05}; -unsigned int hello_for_binaryhack_len = 49; +unsigned int hello_for_elfhack_len = 49; int main(void) { void *code = mmap(NULL, 4096, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - memcpy(code, hello_for_binaryhack, hello_for_binaryhack_len); + memcpy(code, hello_for_elfhack, hello_for_elfhack_len); void (*fn)(void) = (void (*)(void))code; fn(); }