fasm

How to use the fixups attribute on a section?

主宰稳场 提交于 2021-02-20 01:36:28
问题 What exactly does "fixups" do when applied on a section? In a fasm sample i found the following section delcaration and i'm really not sure what the fixups attribute does, i couldn't find much information on that in the fasm documentation. section '.reloc' fixups data readable discardable if $=$$ dd 0,8 ; if there are no fixups, generate dummy entry end if 回答1: This appears to be a workaround for a bug in how FASM generates PECOFF DLLs. The .reloc section only applies to PECOFF images (EXEs

Assembly clone syscall thread function not called

醉酒当歌 提交于 2021-02-10 14:47:00
问题 Im trying to create a thread using 'clone' syscall ... i searched toooooooo much ! for example, link1 link2 and now this is my source code in assembly for linux x64: FORMAT ELF64 EXECUTABLE ENTRY thread_linux_x64 THREAD_MEM_SIZE = 1024 define PROT_READ 0x1 define PROT_WRITE 0x2 define PROT_EXEC 0x4 define MAP_PRIVATE 0x02 define MAP_ANONYMOUS 0x20 define CLONE_VM 0x00000100 define CLONE_FS 0x00000200 define CLONE_FILES 0x00000400 define CLONE_SIGHAND 0x00000800 define CLONE_PARENT 0x00008000

Why is this assembly program crashing (re-assembled ndisasm output)?

社会主义新天地 提交于 2021-01-29 12:39:57
问题 I extracted the assembly code of the windows/meterpreter/reverse_tcp payload with lhost set to 127.0.0.1 and lport set to 443 , however after building the assembly program with fasm the program crashes, any ideas as to why? assembly code: format PE console use32 entry start start: pusha mov ebp,esp xor edx,edx mov edx,[fs:edx+0x30] mov edx,[edx+0xc] mov edx,[edx+0x14] xor edi,edi movzx ecx,word [edx+0x26] mov esi,[edx+0x28] xor eax,eax lodsb cmp al,0x61 jl 0x27 sub al,0x20 ror edi, 0xd add

How to write to StdOut in Windows and FASM?

99封情书 提交于 2020-01-17 01:11:08
问题 The question is pretty simple, yet I can't seem to find how to do it: how do I write to StdOut in Windows/FASM? There does not seem to be any documentation online. Ideas? 回答1: There are a few options... 1) Use the WinAPI. This is either WriteConsole OR by using CreateFile with the filename as CON and then using WriteFile 2) Using msvcrt, and printf as you would in a c program. 来源: https://stackoverflow.com/questions/7263097/how-to-write-to-stdout-in-windows-and-fasm

How to write to StdOut in Windows and FASM?

China☆狼群 提交于 2020-01-17 01:11:07
问题 The question is pretty simple, yet I can't seem to find how to do it: how do I write to StdOut in Windows/FASM? There does not seem to be any documentation online. Ideas? 回答1: There are a few options... 1) Use the WinAPI. This is either WriteConsole OR by using CreateFile with the filename as CON and then using WriteFile 2) Using msvcrt, and printf as you would in a c program. 来源: https://stackoverflow.com/questions/7263097/how-to-write-to-stdout-in-windows-and-fasm

call to sprintf crashing in assembly

梦想的初衷 提交于 2020-01-05 05:27:14
问题 I'm trying to call sprintf to format a string and store the result in a stack variable. However, my attempt is failing miserably and it crashes instantly. sub esp, 0x100 ;Allocate 256 bytes on the stack. push dword[RequestedFile] ;push string2 push dword[Host] ;push string1 push dword[GetHeader] ;push format "String1: %s, String2: %s" push dword[ebp - 0x04] ;push buffer/stack variable call [sprintf] ;store string in buffer add esp, 0x10 ;restore stack push dword[ebp - 0x04] ;push the stack

Does FASM uses Intel Syntax?

北城余情 提交于 2019-12-25 01:36:00
问题 I have tried compiling the following code in FASM: mov DWORD PTR [ebp - 4], 1234567 It gave me an "Invalid Expression" error. However the following code worked: mov DWORD [ebp - 4], 1234567 So does FASM uses Intel Syntax (I am assuming that the first line of code is compliant with Intel Syntax)? 回答1: It gave me an "Invalid Expression" error. Unlike MASM (and others), FASM doesn't need "ptr". So does FASM uses Intel Syntax? Yes. But there are some differences between different assemblers, for