flat assembler
Message board for the users of flat assembler.
Index
> Windows > Code Explaination Please (Listing Drives) |
Author |
|
baldr 30 Apr 2010, 08:47
Nameless,
GetLogicalDriveStrings() returns in lpBuffer something like Code: db "A:\", 0 db "C:\", 0 db "D:\", 0 db 0 MessageBox() shows them. Then we get access violation (MessageBox() returns IDOK==1, 00 00 is decoded by CPU as add [eax], al and byte at address 1 is inaccessible). |
|||
30 Apr 2010, 08:47 |
|
Nameless 30 Apr 2010, 08:58
im very sorry to disappoint u but.....
im a total n00b XD can u tell me how it did this? like what does ' mov dl, byte[ebx]' do? and 'mov [Drive],dl' ? and the rest of those? thats my problem, im a delphi coder btw, and i know some C, so anything after invoke is ok with me the rest is the problem thanks |
|||
30 Apr 2010, 08:58 |
|
ass0 30 Apr 2010, 09:31
_________________ Nombre: Aquiles Castro. Location2: about:robots |
|||
30 Apr 2010, 09:31 |
|
Nameless 30 Apr 2010, 10:56
which part should i look for? keywords plz?
|
|||
30 Apr 2010, 10:56 |
|
baldr 30 Apr 2010, 13:31
Nameless,
Google: assembly OR assembler tutorial. Look for those which are focused on 32-bit programming and Windows. |
|||
30 Apr 2010, 13:31 |
|
Nameless 30 Apr 2010, 14:55
ok, i messed with it a bit more
when i changed ebx to ecx it showed nothing, just froze switched back to ebx it showed all of them y did this happen? arent they same type "General Purpose Registers" ? and same size "32bits"? |
|||
30 Apr 2010, 14:55 |
|
revolution 30 Apr 2010, 15:12
invoke lstrcat won't preserve eax, ecx, edx or the flags.
|
|||
30 Apr 2010, 15:12 |
|
Nameless 30 Apr 2010, 16:04
now a smarter question
how should i know what function preserves what and doesnt preserver what? |
|||
30 Apr 2010, 16:04 |
|
revolution 30 Apr 2010, 16:22
Windows API uses Standard Call convention. All functions (with only two special exceptions) use stdcall.
|
|||
30 Apr 2010, 16:22 |
|
Nameless 30 Apr 2010, 18:13
i mean how should i know that lstrcat wont use ebx and will use the others?
|
|||
30 Apr 2010, 18:13 |
|
bitshifter 30 Apr 2010, 19:03
It called ABI. (application binary interface)
Register useage is a small part of this convention. |
|||
30 Apr 2010, 19:03 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.