6,123 questions
0
votes
0
answers
35
views
What is the official references when coding in assembly on linux x64 with GAS and intel flavor like python docs [closed]
I am learning assembly on Linux running on intel x64 I am using GAS and intel flavor, but I always get lost when trying to quickly get some details about instruction or confirm something like:
...
Best practices
1
vote
2
replies
105
views
Loading a byte: Partial register stall for intel cpus (r8 vs r64)
My assembly program reads characters in a text file by loading them one by one in register 'al'. However I sometime need to use rax fully, and I think this causes a partial register stall. Now I think ...
1
vote
1
answer
160
views
How to compile 64-bit binaries for latest versions of OpenSSL (3.5.x) on the Windows 10
I am trying to compile latest version of the OpenSSL on Windows 10 machine (version 3.5.4).
Prerequisites are:
I ran x64 Native Tools Command Prompt for Visual Studio 2022 Community Edition
I ...
0
votes
0
answers
61
views
How does NuGet choose package assets for x86 vs x64 project targets — will it download/reference a 32-bit package when the project is set to x86?
I'm trying to understand how NuGet selects and references package assets when a project targets a specific CPU architecture (x86 vs x64). My specific questions are:
If my project platform target is ...
0
votes
0
answers
76
views
Locate return address into EXE from DllMain
I'm writing a 64-bit Windows DLL that needs to locate, on the stack, the return address that belongs to the host EXE (the place in the EXE that called into my DLL). The EXE loads my DLL and eventually ...
2
votes
2
answers
294
views
C Size of array is too big
Been given the task to convert code from the 80's to 64 bit.
Error given
error: size of array "spare2" is too large
This is line 76 of a header file
Line 76
uchar spare2[1018-XVIEWS*...
8
votes
1
answer
236
views
How to specify x64 emulation flag (EC_CODE) for shared memory sections for ARM64 Windows?
I'm working on an application that uses shared memory sections between processes on Windows (for an IPC mechanism between processes, where one process generates code that is executed by another ...
0
votes
0
answers
118
views
Can't write to user mode address space from kernel using MmCopyMemory
I've got this software based kernel mode driver (KMDF) and I've called MmcopyMemory like the following (see below). Essentially I would like to patch a user mode process in memory.
The two passed ...
1
vote
0
answers
166
views
How do I change exe's ico?
I did change in Form's properties, it change the icon in the taskbar but not the execuable file. I went to Project -> Options -> Application -> Icons did create a icon using art generator, as ...
5
votes
2
answers
216
views
Inconsistent bitwise shifting result in C code
I'm writing a C program and need to create a bitwise mask that could potentially fill a computer word (64 or 32 bits) with all 1s. I found a bug in my code but I can't make sense of it because when I ...
1
vote
1
answer
161
views
LoadLibraryA fails loading "user32.dll" in assembly x64
I have a code in assembly x86_64 that gets the kernel32.dll base through accessing the PEB and bla bla bla, gets the GetProcAddress address, uses that for getting the LoadLibraryA function and then i ...
0
votes
0
answers
131
views
Bug in `CopyAcceleratorTable` from `winuser.h` on 64-bit?
I am experiencing a weird bug in the function CopyAcceleratorTable when compiled for 64 bit (CopyAcceleratorTable).
I have two accelerator tables (from two dlls) which I want to concatenate into a ...
4
votes
0
answers
86
views
Constant value too large for OR but not for MOV on x64 [duplicate]
I am building assembly x64 functions, compiler microsoft ml64 which comes with VisualStudio. It comes that I can't do bitwise operation on 64 bit registers when I specify a value larger than 32 bit, ...
0
votes
0
answers
116
views
How to build a Windows installer/bootstrapper that can detect and install 64-bit (x64) prerequisites
I built a Windows installer/bootstrapper, using Visual Studio 2022, for an x64 app that requires certain x64 prerequisites be installed along side. However the bootstrapper is unable to detect whether ...
0
votes
0
answers
52
views
sqlite3 in fasm x64 on Windows
By using 64-bit DLL (x64) for SQLite version from here and documentation from here i'm trying to use Sqlite in Fasm for of course quite reasonable reasons.
When trying to sqlite3_open a new db file ...
0
votes
0
answers
277
views
How to run an ONNX model on raspberry pi 4 model b running a x64 bit OS?
I have trained a DL model on matlab and exported it as an ONNX file, now I need to run it on a raspberry pi 4 model B with Raspberry Pi OS X64 bit (aarch64) and python 3.11.2, I have followed many ...
0
votes
0
answers
27
views
do I have to add all the SEH stuff in the x64 windows calling convention
Writing a c compiler that generates MASM and uses ml64 to assemble and link. I read a lot about the x64 windows calling convention and it seemed that I did not have to add all the SEH plumbing, in ...
3
votes
0
answers
374
views
X86 System Agent/Memory Controller
When I learned about MMIO, I saw different sources, like this (X86 Address Space Controller?), and this video, that said that the thing which "controls" the physical address mappings to the ...
0
votes
1
answer
715
views
Error when using FFMpeg in a 64-bit .NET Framework 4.8 application with FFmpeg.AutoGen 7.0
I'm facing an issue when trying to use FFmpeg in my .NET Framework 4.8 application (64-bit) with FFmpeg.AutoGen 7.0. When I try to call any FFmpeg method, such as ffmpeg.av_version_info() in the ...
1
vote
1
answer
151
views
When should I use BigInt64Array over Float64Array for numbers less than Number.MAX_SAFE_INTEGER?
In JavaScript there are two typed array constructors that can store rather large numbers:
const longs = new BigInt64Array()
const doubles = new Float64Array()
They both represent arrays of 64-bit ...
4
votes
2
answers
419
views
In C, is it true that PRId64 is defined if-and-only-if int64_t is available?
I want to portably work with 64-bit signed types in C. However - I know that int64_t is not guaranteed to be defined. I can use some preprocessor magic in my build system generation (e.g. CMake's ...
1
vote
1
answer
187
views
Callback function pointers in wine
TL;DR; Is it possible, under wine, to call a function in a Windows exe, by function pointer, from the Linux proxy library?
I have a Windows x64 DLL called morag.dll containing a function foo. I also ...
0
votes
0
answers
78
views
Why do 'long' and 'long long' types behave differently when both are 64 bits? [duplicate]
I'm compiling for the x86_64 architecture using Apple Clang (Xcode 14). In the following code:
#include <iostream>
#include <stdint.h>
static void foo( long v )
{
std::cout << v;...
0
votes
0
answers
36
views
Install files only for 32/64 bit with Inno Setup [duplicate]
My application can run in 32 and 64 bit (.NET Any CPU) and uses a native SQLite DLL that lies in the x86 and x64 subdirectory. Now when installing the app, it is known whether the system is 32 or 64 ...
3
votes
3
answers
209
views
C++ chrono: store and retrieve date and time in 64 bit format for 2038 rollover
2038 is coming...I have to think date time in 64 bit! I'm trying to understand how to do this in C++, with chrono library, but I'm failing miserably so far.
I will have to communicate a date time ...
0
votes
0
answers
40
views
Using AnyCPU DLL in mixed environments with x86/x64 specific dependencies
I have a managed code DLL with target "Any CPU" that calls SQLite. I am calling this DLL either from an x64 application or in a x86 server. SQLite needs a native DLL SQLite.Interop.DLL ...
0
votes
1
answer
189
views
Unable to set instrumentation callback on other processes
Im trying to set a instrumentation callback on another process but it gives me 0xc000000d (STATUS_INVALID_PARAMETER) but if I set it on the current process then it succeeds.
Does anyone know what I am ...
-1
votes
1
answer
187
views
NtQueryInformationProcess returns STATUS_INVALID_INFO_CLASS for ProcessInstrumentationCallback
I am trying to get the process instrumentation callback using NtQueryInformationProcess but it keeps returning STATUS_INVALID_INFO_CLASS.
I know that this error means that the ProcessInformationClass ...
1
vote
2
answers
263
views
64 bit build acting like 32 bit program with memory
Our program is acting weird. Using Delphi 11, we are building a program where the target platform is 64 bit. Every setting we have checked would point to a 64 bit result. However, when we run the ...
1
vote
0
answers
108
views
Delphi 10.3.3 and SQL Server 2000 LOCATE problem
I noticed, in a program written with Delphi 10.3.3, that it can happen that a LOCATE statement returns "false negatives".
All LOCATE statements look at the FULL KEYof the record, sometimes ...
1
vote
1
answer
95
views
How can I enable function level linking with a Windows 64 bit assembly file
I need to have several hundred functions written in assembler. They will be statically linked into an executable. I only want the functions that are actually referenced to be included in the ...
0
votes
1
answer
73
views
"[WinError 193] %1 is not a valid Win32 application" running CDLL with 64 bit MinGW-w64
I'm trying to compile and run a package on Windows 11 with MinGW-w64, but I'm getting the error message "[WinError 193] %1 is not a valid Win32 application" when I try to run the .dll ...
1
vote
0
answers
113
views
Rust auto vectorization of exp function
I am trying to get some good codegen for a Rust binary in x64 but it seems very hard to get simd operations for exp.
I have a simplified code example: https://godbolt.org/z/4MY34T1zj
The code should ...
0
votes
0
answers
37
views
Alternate encodings of the same x86 (64) operation [duplicate]
Is there any difference in behavior or performance of these two encodings of the mov r11, rsp operation?
49 89 E3 mov r11, rsp
4C 8B DC mov r11, rsp
How should I break down these opcodes into ...
2
votes
1
answer
94
views
Assembly 8086 program to sum two 64 bit numbers using 16bit arithmetic then display the result
when i sum two numbers like
(1111 1111 1111 1111)h + (1111 1111 1111 1111)h
it display the result is (2000 20000 2000 2000)h
where the true result is (2222 2222 2222 2222)h
;the code
.model small
....
1
vote
0
answers
140
views
Python integration on C++ Builder as CLI command
I am using Embarcadero C++ Builder to create a file encryption project based on Argon2 and AES-256 with 500,000 iterations. I decided to develop everything in Python; the Python file, named AEScrypt, ...
1
vote
0
answers
102
views
VirtualAllocEx Returns Memory Marked as MEM_FREE/PAGE_NO_ACCESS
I am writing x64 assembly code to invoke VirtualAllocEx win32 API (as part of process injection lab, so I am injecting into explorer.exe) and seeing unusual (to me) behavior.
The documentation states ...
0
votes
3
answers
361
views
How to change SAP Logon language using VBA code to update it directly in Registry Editor
I am trying to rework a code from another topic (HERE) and the answer from user Storax to suit my current needs. However, in the quoted example the values are in Boolean type (1 and 0) while in my ...
1
vote
0
answers
50
views
Analyzing Performance Differences in Assembly Code on x64 Architecture [duplicate]
comparing these two assembly instructions generated by compiler:
1.
mov ebx, 1
cmp edi, ebx
jl SHORT $LN3@main
npad 7
$LL4@main:
mov eax, edi
cdq
idiv ebx
test edx, edx
je ...
1
vote
0
answers
46
views
Assembled and Linked Win64 Executable showing nothing [duplicate]
I wrote an assembly code
section .data
text db "Hello, World!", 10
length equ $ - text
section .text
global _start
_start:
mov rax, 1
mov rdi, 1
mov rsi, text
...
4
votes
0
answers
101
views
Negative zero in 64 bit VBA floating-point numbers
Disclaimer: I'm familiar with IEEE 754 floating point numbers and know that they have signed zeroes and other special values. That is not the question. If you enjoy language lawyering, read on.
We ...
2
votes
0
answers
96
views
Why does putchar called from assembly result in blank output?
I'm pretty new to assembly and am experimenting with calling C standard library functions from my assembly code. I'm on 64-bit Windows 11, and use NASM syntax.
I have three files which call putchar ...
1
vote
1
answer
64
views
Why does the VMCS ES selector have a index of 0 instead of 3?
I found that the ES selector field is 0x0800 but shouldn’t it be 0x0806 since it’s the 3rd index in the list CS, SS, DS, ES, FS, GS, LDTR, TR
I got the selector list from Volume 3C: System Programming ...
2
votes
2
answers
201
views
NASM x64: Floating Point Part Incorrectly Printed as 0.000000
I'm a newbie to assembly and I tried to write an assembly program using NASM on Windows (x64) to extract and print the fractional part of a floating-point number. However, my program prints Floating ...
0
votes
1
answer
77
views
RET to the main flow after execution of a conditional
Is there any possibility to use RET function to go back from the conditional statement to the main function (_start) where it was called from and go on with the next instructions?
Right now, it's just ...
-1
votes
1
answer
83
views
Why does operand 1 in a modr/m byte change depending on the decoding mode
I'm trying to figure out why the instruction changes from add [eax], al to add [rax], al when changing the decoding mode from x86 to x64.
The instruction bytes are 00 00
I think it might be because ...
-1
votes
1
answer
420
views
Difference between comiss and comisd in x64 asm
I wrote some code to compare the value of xmm10 and xmm6 using:
comiss xmm10, xmm6 and then comisd xmm10, xmm6
The first one works, and the second one doesn't.
I tried using subss xmm10, xmm6 followed ...
1
vote
0
answers
69
views
Assembly jump instructions don't seem to work
bits 64
default rel
section .data
fmt db "%s", 0xd, 0xa, 0
err db "Correct usage: echo <string>"
section .text
extern printf
extern ExitProcess
global ...
0
votes
1
answer
38
views
Order in which instructions are printed/executed
Why the output is in diffrent order than it is declared?
Shouldnt the output be in this order?
aaaa
bbbb
cccc
Instead it is:
I assume the issue is in assigning "bbb" value to the text ...
1
vote
1
answer
93
views
REX encoding for instructions with the VEX prefix
[x64]
is there some generic algorithm using which I can determine relevant registers for the rex byte? I'm specifically interested in the calculation of REX for instructions with the VEX prefix (so ...