WinDbg is very useful when you develop software with assembly language. You can install WinDbg using PowerShell by opening PowerShell as an administrator and running this command:
PS C:\WINDOWS\system32> Add-WindowsCapability -Online -Name WinDbg
You can download it from the Microsoft store.
In this simple example, I will show how to write a file using the assembly programming language with FASM, known as flat assembler. You can use the FASM editor with the FASMW.EXE executable. Open this editor and use this commented source code:
;define format of exe file
format pe console 4.0
;include file WIN32AX
; define data for code
;this will be the filename of file
filename db 'file.txt',0
; this string will be write on the file
buffer_text db 'This is a test by Catalin!'
; this is the size for WriteFile based on buffer_text
buffer_size = $ - buffer_text
; define a space
bytes_to_write dd ?
; the code for running
invoke CreateFile,filename, GENERIC_WRITE, 0, 0, 4, FILE_ATTRIBUTE_NORMAL, 0
invoke WriteFile, eax, buffer_text, buffer_size, bytes_to_write, 0
invoke ExitProcess, 0
Each step is describe in the source code. Run and test with… Read More »
The entire world map praises OpenAI for its ability to analyze, sort, and give correct feedback on a defined issue. I do not completely agree, there are still reminders related to the way of solving complex tasks. An example is creating source code in an assembler for FASM. Although FASM is very strict in terms… Read More »
Compiler Explorer is an interactive tool that lets you type code in one window and see the results of its compilation in another window… The project can be found on GitHub, and the online tool can be found on this webpage.
In the last FASM tutorial I add a simple ComboBox without items. In this tutorial I will add two items and one button to show the output of selected ComboBox. The source code is similar with the source code from the last tutorial. I commented the source code rows for a good image of development… Read More »
Today I will show you how to use the MMX instructions. SSE stands for Streaming SIMD Extensions and uses 128-bit registers: XMM0 XMM1 XMM2 XMM3 XMM4 XMM5 XMM6 XMM7 The capabilities of the XMM registers are: 2 64-bit floating points (double precision) 2 64-bit integers 4 32-bit floating points (single-precision) 4 32-bit integers 8 16-bit… Read More »
I haven’t worked with FASM, Linux, and system functions for a while. Here is an extremely simple example for beginners with output on my nickname: mythcat.
format ELF executable 3
segment readable executable
BYTES = 255 ;number of byte 255
;read a char from input
mov ebx,0 ;0 stdin, 1 stdout, 2 stderr
;write byte read to output
;exit from program
mov eax,1 ; System call 'exit'
xor ebx,ebx ; 'xor ebx,ebx'
segment readable writeable
char_Buffer db BYTES dup(0)
CharRead db 1
The result is … as follows:
[mythcat@desk fasm]$ ./fasm char_write.asm
flat assembler version 1.73.24 (16384 kilobytes memory)
3 passes, 428 bytes.
[mythcat@desk fasm]$ ./char_write
The tutorial for today is about debugging and FASM with fdbg tool. For debugging and testing you can use any debugger, but you can use the You can here all version for these operating system: GUI for Windows x64, Windows x64, Linux x64 and UEFI x64. I used the Linux x64 version for this tutorial.… Read More »