this pretty cute programm cause a crash of its self:
.data
checkdrives DWORD 0
formattext DB "%s %d", 0
formatbuffer DB 150 DUP(0)
formattemp DB 150 DUP(0)
.code
start:
;INVOKE GetLogicalDrives
;MOV checkdrives, EAX
INVOKE wsprintf, ADDR formatbuffer, ADDR formattext, checkdrives
INVOKE MessageBox, NULL, formatbuffer, checkdrives, NULL
INVOKE ExitProcess, NULL
END start
By the way, have I use GetLogicalDrives right ?
.data
checkdrives DWORD 0
formattext DB "%s %d", 0
formatbuffer DB 150 DUP(0)
formattemp DB 150 DUP(0)
.code
start:
;INVOKE GetLogicalDrives
;MOV checkdrives, EAX
INVOKE wsprintf, ADDR formatbuffer, ADDR formattext, checkdrives
INVOKE MessageBox, NULL, formatbuffer, checkdrives, NULL
INVOKE ExitProcess, NULL
END start
By the way, have I use GetLogicalDrives right ?
wsprintf crashes because it expected 4 parameter and you only passed 3 parameters. PS: No you got it wrong
DWORD GetLogicalDrives(VOID)
Parameters
This function has no parameters.
Return Values
If the function succeeds, the return value is a bitmask representing the currently available disk drives. Bit position 0 (the least-significant bit) is drive A, bit position 1 is drive B, bit position 2 is drive C, and so on.
If the function fails, the return value is zero.
DWORD GetLogicalDrives(VOID)
Parameters
This function has no parameters.
Return Values
If the function succeeds, the return value is a bitmask representing the currently available disk drives. Bit position 0 (the least-significant bit) is drive A, bit position 1 is drive B, bit position 2 is drive C, and so on.
If the function fails, the return value is zero.
Year, I understoot, but I wanted to choose these cute BITs.
P.S. Even now its crashs at wsprintf
P.S. Even now its crashs at wsprintf
reread my previous post... the format string is "%s %d", thus it is expected that you pass 4 parameters and not 3.
I'm sorry to be a ultra-twit !
Thats just my way of life:
> sittting in front of my 2 computers.
> organsiate girls who go under the table
> hear musik all the time, even at night. I have about 50 fafourite songs. thats one of them : http://bbs-fachdemontage.de/BISON/ForThoseWhoDied.mp3
Its not illegal, its a free mp3.
>And to do programming. Imaginee some commands, an wonder why it doesnt work, although I was hard to invent.
Please accept me.
Thanks a lot !:stupid:
Thats just my way of life:
> sittting in front of my 2 computers.
> organsiate girls who go under the table
> hear musik all the time, even at night. I have about 50 fafourite songs. thats one of them : http://bbs-fachdemontage.de/BISON/ForThoseWhoDied.mp3
Its not illegal, its a free mp3.
>And to do programming. Imaginee some commands, an wonder why it doesnt work, although I was hard to invent.
Please accept me.
Thanks a lot !:stupid:
Two computers,girls,music... You are a very lucky man,Forginforcer:alright: :)
Auspiciousness, I have solved my prob.
P.S.
THX, but I cant find the right girl, because the righ girls !
I want to get a very nice girl, who is very affectionate, faithfull and intelligent (that you will never find).
Have you heard the cool musik ?
I sometimes dream that I can sing so.
Even when I have medievil songs, where a very cool gilr sing I dream that I have the same voice. :cool: :confused:
P.S.
THX, but I cant find the right girl, because the righ girls !
I want to get a very nice girl, who is very affectionate, faithfull and intelligent (that you will never find).
Have you heard the cool musik ?
I sometimes dream that I can sing so.
Even when I have medievil songs, where a very cool gilr sing I dream that I have the same voice. :cool: :confused:
Forginforcer,
If the question is "who is right person?"... The person who understands you and who
shares your feelings and ideas.
I am afraid,the moderators are coming here. :) So,better to conclude here this touchy subject. :)
Good luck mon ami:alright:
Vortex
If the question is "who is right person?"... The person who understands you and who
shares your feelings and ideas.
I am afraid,the moderators are coming here. :) So,better to conclude here this touchy subject. :)
Good luck mon ami:alright:
Vortex
Okay, as conclusion:
Newbies, dont be so silly to make the mistake I made.
Here is the right code:
__________________
.data
checkdrives DWORD "5", 0
formattext DB "%s %dM Bytes", 0
formatbuffer DB 150 DUP(0)
formattemp DB 150 DUP(0)
.code
INVOKE wsprintf, ADDR formatbuffer, ADDR formattext, ADDR checkdrives, ADDR checkdrives
INVOKE MessageBox, NULL, ADDR formatbuffer, ADDR formatbuffer, NULL
?????????????????????????
P.S. You mean the moderators don like girls ? :confused: :grin: :grin: :grin:
Newbies, dont be so silly to make the mistake I made.
Here is the right code:
__________________
.data
checkdrives DWORD "5", 0
formattext DB "%s %dM Bytes", 0
formatbuffer DB 150 DUP(0)
formattemp DB 150 DUP(0)
.code
INVOKE wsprintf, ADDR formatbuffer, ADDR formattext, ADDR checkdrives, ADDR checkdrives
INVOKE MessageBox, NULL, ADDR formatbuffer, ADDR formatbuffer, NULL
?????????????????????????
P.S. You mean the moderators don like girls ? :confused: :grin: :grin: :grin:
Yes,that's the correct code.
P.S. : If we continue to talk about that subject,the moderators will move
this thread to the "Heap" section. :) We don't want this to happen. :)
Vortex
P.S. : If we continue to talk about that subject,the moderators will move
this thread to the "Heap" section. :) We don't want this to happen. :)
Vortex
First of all, you should get rid of those girls, they're obviously ruining your concentration. How do you expect to learn to program with all these distractions? You can send them over to me. :grin:
Third of all, the code you have doesn't do anything useful, does it? :P
Third of all, the code you have doesn't do anything useful, does it? :P
@Sephiroth3 coool :grin: :cool:
I wanted to list al my logical drives, but I'm not able to. :confused:
I wanted to list al my logical drives, but I'm not able to. :confused:
Okay. This is how you do it:
I'm not familiar with MASM, but I think that's how it would be written.
.bss
drives db 79 dup(?)
.code
start:
call GetLogicalDrives
mov edi,ADDR drives
mov ecx,0x203a41
the_loop:
shr eax,1
jae no_drive
mov dword ptr [edi],ecx
add edi,3
no_drive:
inc ecx
cmp cl,0x5b
jb the_loop
dec edi
stosb
invoke MessageBoxA,ADDR drives,ADDR blah,MB_OK
ret
blah db "The drives",0
end start
I'm not familiar with MASM, but I think that's how it would be written.
Hey Thanks !
I just have a visitor at my - my friend Valle, I will try your solution later !
Thanks !
Deep regard FF
I just have a visitor at my - my friend Valle, I will try your solution later !
Thanks !
Deep regard FF