flat assembler
Message board for the users of flat assembler.

Index > Windows > Win XP snippets

Author
Thread Post new topic Reply to topic
r22



Joined: 27 Dec 2004
Posts: 805
r22
Here's a few cool little code snippets from looking at kernel32.dll under winxp.

They aren't practical to use in programs that you want portability in, but for test apps and such they are quite useful.

Quote:

GetCurrentProcessID:
mov eax, large fs:18h
mov eax, [eax+20h]

GetCommandLineA
mov eax, 7C8835F4h

GetCommandLineW
mov eax, 7C883004h

GetProcessHeap
mov eax, large fs:18h
mov eax, [eax+30h]
mov eax, [eax+18h]
Post 29 Aug 2005, 13:56
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
RedGhost



Joined: 18 May 2005
Posts: 443
Location: BC, Canada
RedGhost
r22 wrote:
Here's a few cool little code snippets from looking at kernel32.dll under winxp.

They aren't practical to use in programs that you want portability in, but for test apps and such they are quite useful.

Quote:

GetCurrentProcessID:
mov eax, large fs:18h
mov eax, [eax+20h]

GetCommandLineA
mov eax, 7C8835F4h

GetCommandLineW
mov eax, 7C883004h

GetProcessHeap
mov eax, large fs:18h
mov eax, [eax+30h]
mov eax, [eax+18h]


seems pretty cool, let me try em out

*edit: GetCommandLineA did not work for me on win XP home sp2
Post 29 Aug 2005, 14:55
View user's profile Send private message AIM Address MSN Messenger Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
pretty useless - especially the hardcoded values in GetCommandLine* are likely to change between OS and service pack versions.
Post 29 Aug 2005, 20:03
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.