Skip to main content

All Questions

Tagged with
0 votes
0 answers
25 views

When an embedded c program is created, why is there extra machine code around my compiled c program?

This C program blinks an LED attached to an AVR ATmega32u4. ISR(TIMER1_OVF_vect) // attach Interrupt Sub Routine to TIMER1 { // toggle LED PIND = (1 << PIND5); // #define PIND (*(...
Johnny Jones's user avatar
0 votes
0 answers
43 views

signal SIGSEGV: address access protected in __run_exit_handlers

I'm trying to do a packer project for my school, it is made in C and ASM, and for the moment it is supposed to target only ELF files. I have managed to do my section injection, correctly align my new ...
Maxence Gama's user avatar
-1 votes
0 answers
53 views

Why does gdb combine byte values when examining memory as words? [closed]

While examining 4 addresses from $rip as bytes in GDB, it shows 4 individual values. However, when I examine the same addresses as words, it combines that 4 byte values into a single word value. Why ...
Naresh Kumar's user avatar
1 vote
1 answer
56 views

What are the binary representations for the flags used in the Linux open() syscall?

I am learning NASM and currently unsure what values should be used for the flags argument for open() as shown in the man page. I'm mainly asking this for clarification so I don't mess something up, ...
dundermouse's user avatar
1 vote
1 answer
82 views

What is the difference between these two functions in x64 assembly?

I'm playing around with lower level stuff in C on Windows (x64) to try and learn low level concepts. I ran across something I don't understand and just wonder if someone could explain something to me....
Stephen Francis's user avatar
3 votes
0 answers
51 views

How to pass arguments to a windows syscall in NASM assembly? [duplicate]

I am learning how to implement direct system calls using nasm assembly and c code, I have created a funcs.asm that contains section .text global NtOpenProcess NtOpenProcess: mov rax, 26h ...
RAT's user avatar
  • 199
1 vote
1 answer
89 views

Why do I get multiple ASM instructions per addition? (Visual Studio 2022 Community)

Here's the C program, I use Visual Studio Community 2022 with MSVC compiler. What are all those mov instructions, I don't use any compiler optimization flags. #include <stdio.h> int main(void) {...
CupOfGreenTea's user avatar
1 vote
1 answer
44 views

E2028: _small_code_ is an undefined reference

I am working on my own bootloader. I want it to print "Hello world". For some reason, I get an error: Error! E2028: small_code is an undefined reference Hello! I am working on my own ...
Артем Соколов's user avatar
2 votes
0 answers
76 views

How does this assembly code perform the source code b = a/3 when a = 2? [duplicate]

I'm trying to trace this C source code (when a = 2): b = a/3; To this ARM assembly code (for unsigned 1 byte value): ldrb r2, [fp, #-6] @ zero_extendqisi2 @ tmp162, a ldr r3, .L34 @ tmp164, ...
Evan Lehr's user avatar
2 votes
0 answers
55 views

Native API Processor information

When I send the first parameter as 1, i.e. SystemProcessorInformation via the ntdll!NtQuerySystemInformation function, I get the output: Processor Architecture: 9 Processor Level: 25 Processor ...
wuku's user avatar
  • 21
0 votes
0 answers
99 views

By default compiler generates assembly code or object code [duplicate]

In conpiler design, in books, it is written that compiler generates assembly code then assembler convert that assembly code into object code. But assembly code is not used, so todays compiler ...
jai patel's user avatar
0 votes
1 answer
73 views

Unresolved external symbol happend when compiling C++

im trying to make a super simple direct syscall. I have 2 file, 1 is the asm file and 1 is the main source file. The ASM look likes: EXTERN wNtAllocateVirtualMemory: DWORD .CODE ...
Brian MJ's user avatar
-4 votes
0 answers
108 views

Why does the first code cause a segmentaiton fault while the later one doesn't?

I'm self-studying csapp, and currently stuck at level-3 of Attack Lab. This lab requires you to inject some code by a 40-byte input string. The basic idea is that you input a 48-byte string, with the ...
Bicheng's user avatar
  • 735
1 vote
1 answer
71 views

LLVM IR: ".s" file vs ".ll" file vs ".bc" file

I read that the '.ll' file is equivalent to the '.bc' file except that '.ll' is more human readable. But is '.ll' machine independent? I see references to x86_64 in my '.ll' file. In my '.s' file I ...
Andrew K's user avatar
2 votes
2 answers
102 views

Why is the assembly code generated with gcc under windows unable to be assembled under WSL?

I learned that assembly code doesn't depend on the OS. For verification, I generate the assembly code of the following code snippet (named test.c) under windows and try assembling it under WSL. int ...
hiiragi4000's user avatar

15 30 50 per page
1
2 3 4 5
418