Questions tagged [masm64]

MASM64 is a 64-bit version of the MASM32 software development environment (SDK) for programmers using Microsoft's Assembler (MASM) to target 64-bit Windows. DO NOT USE THIS TAG FOR REGULAR 64-BIT ASSEMBLY PROGRAMMING (instead use [x86-64] and [assembly]).

60 questions
1
vote
1 answer

Tabulate function Y=3.3\*log(2)(x^2+1)

Can't log2 to masm64. How exactly do I apply fyl2x in my code? I can't figure out where to apply this piece of code. Basically, the program crashes, or incorrect data. Here is my code: \`include win64a.inc .data \_x dq 3.0 \_op1 dq 3.3 \_op2 dq…
Ana_406
  • 11
  • 2
1
vote
0 answers

MASM64 reverse tcp shell - cmd not binding to socket

I'm trying to write code that creates a reverse connection and binds a cmd.exe to a socket. There are no errors - I created socket, connecttion and the cmd process started in the OS, but in the console with netcat I see only successful connect and…
Slava
  • 13
  • 1
  • 3
1
vote
1 answer

Correctly Setting Up Stack Pointer in x64 Assembly on Windows with Masm + LOCALS

I have the follow simple program I'm trying to build targeting x64 on Windows 10 building with MASM: WSTR MACRO lbl:req,qstr:VARARG LOCAL arg,unq,qot,q lbl LABEL WORD FOR arg, qot SubStr ,1,1 q = 0 IFIDNI…
Malcolm McCaffery
  • 2,468
  • 1
  • 22
  • 43
1
vote
1 answer

How to horizontally sum signed bytes in XMM

I am writing some code in x64 assembly and using SIMD. I have 9 bytes packed in the xmm15 register. For simplicity, let's look at the following code: .data Masks BYTE 0, -1, 0, -1, 5, -1, 0, -1, 0 .code GetSumOfMasks proc movdqu xmm15, xmmword ptr…
nooblet2
  • 31
  • 6
1
vote
1 answer

My MASM code shows 3 errors after debugging, but I do not know how to fix them. Can someone help me?

;programul citeste de la tastatura doua numere intregi si le afiseaza. .386 ;folosim instructiuni cu operanzi pe 32 biti .MODEL FLAT, C ;memoria este organizata liniar si conventia de apel a functiilor este cea din C .STACK 100h …
1
vote
1 answer

How to call a x64 Assembly procedure in C#

I am working on a project and currently have the following structure: C# WPF project containing the User Interface as well as calls to external methods. C++ DLL project containing an algorithm. ASM DLL project containing an algorithm. For…
nooblet
  • 31
  • 1
  • 9
1
vote
1 answer

Why am I getting this error in the assembly code below?

This is my first trial running an assembly code for x64 in MASM: _text SEGMENT main PROC mov ah,0 ret main ENDP _text ENDS END and I'm getting a linker error LNK2001: unresolved external symbol mainCRTStartup. Why? I have the entry point…
João Afonso
  • 1,934
  • 13
  • 19
1
vote
0 answers

Detecting potential MASM 64-bit sign extension errors for immediate 32-bit operands (imm32)

I'm trying to write a tool to scan 64-bit assembly code looking for possible sign extension errors. For example, suppose a 32-bit constant (imm32) is defined as SOCKET_ERROR_INT EQU 0FFFFFFFFh Next, call any API that returns a SOCKET_ERROR (32-bit…
vengy
  • 1,548
  • 10
  • 18
1
vote
2 answers

Why the gs segment register is address is set to 0x0000000000000000 on visual studio x64(MASM)?

I am currently reading "The Ultimate Anti Debugging Reference" and I am trying to implement some of the techniques. To check the Value of the NtglobalFlag they use this code - push 60h pop rsi gs:lodsq ;Process Environment Block mov al,…
Cyber_Noob
  • 89
  • 9
1
vote
2 answers

Program run under x64dbg goes immediately to completion

I'm using the x64dbg debugger from SourceForge under Windows 10, and I've been having a problem with it that I think is probably due to my own stupidity somehow, but so far I can't pin it down. I'm using the MASM assembler, and when I'm working on a…
1
vote
0 answers

I get empty items when inserting them in Treeview

I have a problem using Treeview control, when I try to insert items it shows the first line empty without any caption as you can see in the picture: Figure1 First,I declared a variable called TreeCaption which holds the item caption: TreeCaption …
Rever7eR
  • 11
  • 6
1
vote
1 answer

Link assembly script with a resource file

I am trying to link my assembly script with a resource file made with ResEdit that both belong to the same directory with the .bat file: @echo off C:\masm64\ml64.exe dialog_box.asm /link /entry:Main resources.res /subsystem:windows…
Bart
  • 11
  • 1
1
vote
1 answer

LNK1104 when using MASM 64bit

I'm currently trying to learn Assembly for x64 Windows. I tried the example code from this Intel website, but whenever I try to compile it with the command given in the document: ml64 hello.asm /link /subsystem:windows /defaultlib:kernel32.lib…
0
votes
1 answer

Win32 CALL to CreateFileW always returns ERROR_INVALID_PARAMETER in MASM x64. Why?

I'm currently trying to learn MASM x64, and so far I seem to be getting the hang of things pretty well. Everything was going well right up until I tried to call CreateFileW to read the contents of a .txt file. The problematic code is as follows: …
FireController1847
  • 1,458
  • 1
  • 11
  • 26
0
votes
1 answer

Use .obj created by MASM (ml64) with gcc on linux

I have a .obj file that is created by ml64 and then used by a vsxproj to compile a windows dll. The C part simply acts as a pass-through to one function in the masm code. Is it possible to do the same with gcc so I can compile a linux .so…
BJury
  • 2,526
  • 3
  • 16
  • 27