Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
!showwindow
#1
What's Up?

OK, So I new to tossing and churning software source code and such and I need help with this.

Basically my goal is to run a application with a window, After googling i found that the user32.dll function !showwindow is what im looking for, But im not sure how to edit it? So heres the files details if needed.

Its a PE executable written it Microsoft Visual C++ 6.0 according to Stud_PE

Anyone shed some light on my project.

Thanks Bye.
[Image: Scorpion-Sig3.png]
Reply
#2
ShowWindow is one of the functions in the Windows SDK, it does quite literally what is says and sets the visibility flags of any window handle passed into it.

See also, CreateWindow and Using Windows.

The MSDN is your friend when it comes to anything Windows SDK, DirectX SDK, .NET, or XNA related.
[Image: sig.php]
The little boat gently drifted across the pond exactly the way a bowling ball wouldn't.
Reply
#3
(10-15-2009, 01:45 PM)MrD. Wrote: ShowWindow is one of the functions in the Windows SDK, it does quite literally what is says and sets the visibility flags of any window handle passed into it.

See also, CreateWindow and Using Windows.

The MSDN is your friend when it comes to anything Windows SDK, DirectX SDK, .NET, or XNA related.

Ah ok, How can i edit that in the file however?
[Image: Scorpion-Sig3.png]
Reply
#4
Um... you don't. The Windows SDK is a library, you just call it from your own code, you don't edit it. In fact, you can't edit it since you only have access to the headers. The Using Windows tutorial I posted a link to explains how to use the function.

What IDE are you using? If you are using Visual Studio it even has a Win32 project as a default project type that creates the code to create a main window for you (although the code it creates is a bit bloated for some things, so it's sometimes best to work out how to do it for yourself).

If you would rather not use the Windows SDK directly, then there are alternatives like wxWidgets which is basically a nicer wrapper around the Windows SDK.
[Image: sig.php]
The little boat gently drifted across the pond exactly the way a bowling ball wouldn't.
Reply
#5
I found using IDA Pro the string
Code:
.idata:0066F95C ; BOOL __stdcall ShowWindow(HWND hWnd,int nCmdShow)
.idata:0066F95C                 extrn ShowWindow:byte   ; DATA XREF: sub_4048B0+23r
.idata:0066F95C                                         ; sub_406750+CEr ...
so instead of ncmdshow it would be SW_HIDE? Sorry i know im bad :-(
[Image: Scorpion-Sig3.png]
Reply
#6
SW_HIDE will hide the window, SW_SHOW will show it. The notes here explain all the values that can be passed in nCmdShow.
[Image: sig.php]
The little boat gently drifted across the pond exactly the way a bowling ball wouldn't.
Reply
#7
Sorry top bump the thread but i cant seem to get any help anywhere else, I forgot to mention that the file isent made by me, And i dont have the source code, Meaning i would have to decompile the file, Or use a dissembler, Where the show window string is, You cant edit it like i thought.

Ow well back to square one :-(

Thanks for your help So far MrD.
[Image: Scorpion-Sig3.png]
Reply
#8
Oh, are you actually trying to inject code into someone else's application? I misunderstood your aim.

Method 2 or 3 here should help you more with this, it shows you the basics of injecting a DLL with your own code into someone else's application.
[Image: sig.php]
The little boat gently drifted across the pond exactly the way a bowling ball wouldn't.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)