flat assembler
Message board for the users of flat assembler.
Index
> Main > write into file uhh |
Author |
|
comrade 22 Dec 2005, 03:53
Try using "cinvoke" or "ccall" for wsprintf.
You can use the return value of wsprintf to see how long the string is, instead of always writing 20h bytes. What is "shi"? Are you saving/restoring ebx after your code is done? PS: use code tags to paste your code in threads |
|||
22 Dec 2005, 03:53 |
|
shism2 22 Dec 2005, 04:29
Code: invoke CreateFile,database,GENERIC_ALL, \ NULL, NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE, NULL mov [datahandle],eax mov ebx,5h cinvoke wsprintf,buffer,shi,ebx < ---- crashes here invoke WriteFile,[datahandle],buffer,20h,databytes,0 invoke CloseHandle,[datahandle] shi db "%s",0 database db "collection",0 datahandle dd 0 buffer dd 20 databytes dd ? Last edited by shism2 on 22 Dec 2005, 05:17; edited 1 time in total |
|||
22 Dec 2005, 04:29 |
|
comrade 22 Dec 2005, 04:37
ok, show us declarations of datahandle, buffer, shi, databytes
everything relevant |
|||
22 Dec 2005, 04:37 |
|
shism2 22 Dec 2005, 05:17
there i added it
|
|||
22 Dec 2005, 05:17 |
|
comrade 22 Dec 2005, 06:08
i am sure you want:
Code: buffer rb 20h and not: buffer dd 20h you want an array of 32 bytes, not a 4-byte variable that contains the value 32 next time i don't want to see any attitude from you, mmmkay?! |
|||
22 Dec 2005, 06:08 |
|
IceStudent 22 Dec 2005, 10:22
mov ebx,5h?
So, you want convert number to string? use "%d" instead "%s". See help for wsprintf. |
|||
22 Dec 2005, 10:22 |
|
shism2 22 Dec 2005, 12:05
what attitude lol?????
but thanks comrade you know your stuff also thanks ice |
|||
22 Dec 2005, 12:05 |
|
Reverend 22 Dec 2005, 20:16
%s with 05h byte would work in a way, that it would try to put ASCII char 05h which is some unprintable, control byte (some tab, space, carriage or other have such low values).
|
|||
22 Dec 2005, 20:16 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.