Questions tagged [assembly]
Assembly language questions. Please tag the processor and/or the instruction set you are using, as well as the assembler, a valid set should be like this: ([assembly] [x86] [gnu-assembler] or [att]). Use the [.net-assembly] tag instead for .NET assemblies, [cil] for .NET assembly language, [wasm] for web assembly, and for Java bytecode, use the tag java-bytecode-asm instead.
assembly
44,635
questions
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....
0
votes
0
answers
30
views
System.IO.FileNotFoundException for System.Management Assembly in WPF Application but Works Fine in Console Application
I'm a novice C# developer working with .NET 8.0. I have encountered an issue where my code works perfectly in a dedicated console application but throws an exception when included in my existing WPF ...
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
...
4
votes
0
answers
59
views
Why does Intel x86 manual use +rd instead of +ro or +rq for 64-bit registers?
The description of the PUSH instruction in the Intel manual (PDF, Volume 2, Chapter 4.3, PUSH) contains the line 50+rd PUSH r64. It seems +rd is used throughout most of the instruction descriptions ...
1
vote
0
answers
31
views
Link function calls against reverse engineered binary
I created an windows x86 .exe file that I reverse engineer. Imagine I only have the .exe file and I reverse engineered some functions.
The goal is to create a dll that links with this .exe so the dll ...
0
votes
1
answer
47
views
Debugging assembly to call IUnknown::Release - is shadow space right?
I am getting a bug where sometimes this code works sometimes it does not:
48 8B 41 08 ; MOV RAX, [RCX + 0x08] gets the refcount
48 FF C8 ; DEC RAX ; decrement ...
1
vote
1
answer
50
views
My bootloader isn't printing after switching to Protected Mode
I'm trying to print the character "C" after switching to the Protected Mode, but it isn't working, and I don't know why. I'm using Assembly AT&T/GAS syntax
Here is the code:
.code16
....
0
votes
0
answers
67
views
Game freezes when i call a function in it from a C++ .dll
In IDA Pro, i found a function in the game that writes text to console.
Here is the function:
; void __cdecl write_to_console(char *Format, char ArgList)
write_to_console proc near ; CODE ...
-1
votes
0
answers
25
views
Writing x64 nasm assembly for windows [duplicate]
I would like to learn how to write x64 nasm assembly for windows but I can't find any resources for that.
And also how to compile the assembly into executable program.
So if anyone knows of a ...
-1
votes
0
answers
50
views
lmc program division assembly languange
I'm trying to solve this challenge:
create a simple LMC program to determine if a number evenly divides another one:
Input 2 numbers
If they do not evenly divide, then the program outputs 0 and asks ...
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) {...
1
vote
0
answers
64
views
How to Fix IMUL and DIV Errors in Assembly Calculator Code?
I'm currently learning assembly language and trying to write a simple calculator program. The program is supposed to read two numbers and an operator (+, -, *, /) from stdin, perform the specified ...
-2
votes
0
answers
33
views
objcopy says one of input files was not recognized as a valid object file
Im trying to objcopy two files together but its just not working...
I tried the following:
objcopy -I bootloader.bin extendedprogram.bin -O bootloader.flp
The result was:
llvm-objcopy: error: '...
2
votes
1
answer
36
views
Monitor memory modification between instructions in GDB
Is there any way I can check the memory change before and after si, s or something similar commands?
First came out with the idea of dump memory for diff, but haven't dig in how to do it.
Or maybe ...
3
votes
1
answer
62
views
How to get NASM to encode `push` with a sign-extended 16-bit immediate?
When assembling the following with NASM:
BITS 64
push 32767
I get 68 ff 7f 00 00. This is interesting to me, since this is the 32b encoding (push dword). Any ideas why it doesn't resort to the 16b ...