flat assembler
Message board for the users of flat assembler.
Index
> Windows > Converting DOS code into Windows |
Author |
|
typedef 29 Sep 2011, 09:04
CreateFile()
ReadFile() cld mov esi,buff mov ecx,file_size_or_bytes_read_ @@: mov ah,0x00 lodsb cmp al,0dh jne k xchg ah,[esi] k: dec ecx jnz @B WriteFile --- If needed. CloseHandle() look up those APIs, i'm posting from my psp so i can't type much |
|||
29 Sep 2011, 09:04 |
|
AsmGuru62 29 Sep 2011, 14:17
Good, but LODSB will increment ESI, so "XCHG AH, [ESI-1]" would be better. Also, why not just "MOV [ESI-1], AH"?
|
|||
29 Sep 2011, 14:17 |
|
typedef 29 Sep 2011, 16:37
^^You are right I wasn't thinking there. thanks
|
|||
29 Sep 2011, 16:37 |
|
me239 29 Sep 2011, 17:25
I tried writing a simple program to write "Hello!" to a file with no luck
Code: Code: format PE GUI 4.0 entry start include 'win32a.inc' start: invoke CreateFile, filen, GENERIC_WRITE, 2, NULL, 3, 80h, NULL, NULL invoke WriteFile, buff, 6 invoke ExitProcess filen db 'test.txt', 0 rights db 2 buff db 'Hello!', 0 section '.idata' import data readable writeable library kernel32, 'KERNEL32.DLL' import kernel32,\ CreateFile, 'CreateFileA',\ WriteFile, 'WriteFile',\ ExitProcess, 'ExitProcess' |
|||
29 Sep 2011, 17:25 |
|
typedef 29 Sep 2011, 17:42
lol lmao.......you are really a noob at win32 API (no offense)
hold on let me get on my computer so i can type fast and help you |
|||
29 Sep 2011, 17:42 |
|
me239 29 Sep 2011, 18:31
typedef wrote: lol lmao.......you are really a noob at win32 API (no offense) Code: format PE GUI 4.0 entry start include 'win32a.inc' start: invoke CreateFile, filen, GENERIC_WRITE, 0, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0 mov [hFile], eax invoke WriteFile, [hFile], buff, 6, bwrt, 0 invoke ExitProcess filen db 'test.txt', 0 rights db 2 buff db 'Hello!', 0 hFile dd 0 bwrt db 0 section '.idata' import data readable writeable library kernel32, 'KERNEL32.DLL' import kernel32,\ CreateFile, 'CreateFileA',\ WriteFile, 'WriteFile',\ ExitProcess, 'ExitProcess' |
|||
29 Sep 2011, 18:31 |
|
typedef 30 Sep 2011, 02:04
Yea, sorry.. My friend came over and I was playing MK vs DC & God Of War 3 ...
|
|||
30 Sep 2011, 02:04 |
|
me239 30 Sep 2011, 04:29
nice, I played L4D2
|
|||
30 Sep 2011, 04:29 |
|
typedef 30 Sep 2011, 13:25
haven't played that yet. is it online too?
|
|||
30 Sep 2011, 13:25 |
|
me239 01 Oct 2011, 03:22
typedef wrote: haven't played that yet. is it online too? |
|||
01 Oct 2011, 03:22 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.