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,596
questions
1
vote
0
answers
10
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 ...
1
vote
1
answer
25
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
37
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
59
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
19
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
35
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
73
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) {...
0
votes
0
answers
40
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
19
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
33
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
50
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 ...
1
vote
1
answer
60
views
RISC-V assembly: global pointer set to a weird value
I am experimenting with RISC-V assembly language on an emulator (qemu64, ubuntu for RISC-V).
Here is a simple program, its function is to convert the instr string to uppercase, outstr is the resulting ...
0
votes
0
answers
19
views
x86 NASM Crash - Iterate over string
How to iterate over individual characters of a string in x86 assembly and print them?
global _main ; declare _main entry point
extern _printf ; extern method
section ....
0
votes
0
answers
31
views
How can I disassemble a whole obj file in valid asm, amend some sections of such asm code and reassemble to obj?
Is it possible on Linux to use objdump (or any other utility) to fully disassemble an obj file to asm code, modify such code and then pass the asm to as?
The challenge I have with objdump is that it ...
16
votes
2
answers
1k
views
How to prepare stack pointer for bare metal Rust?
I'm trying to write an x86 bootloader and operating system completely in Rust (no separate assembly files, only inline assembly within Rust).
My bootloader works completely as intended within the QEMU ...