Login Register




Kernel32.dll Beep Function filter_list
Author
Message
RE: Kernel32.dll Beep Function #5
(04-06-2013, 10:42 AM)Psycho_Coder Wrote: Wow great info.But in the code
Code:
GetProcAddress( GetModuleHandle(L"kernel32.dll"), "Beep" );

I think there is an extra L, within the braces, its misprinted, it should be GetModuleHandle("kernel32.dll")

and have you compiled the asm code to get the beep sound.I think there is a functon in C sound(anynumber); that does the same job, though Beep() allows us to adjust the delay time as well.

lol, Nope this is not C... There's a reason why I had the L there. Smile This is just basic C++. That L serves a purpose however. The parameter expects a type of LPCWSTR

LP: long pointer
C: constant
W: wide
STR: string.

Otherwise it's just a const char* and not even unicode (16 bits), but rather 8 bit or 1 byte per char.

And yes that inline asm (if that's what you are talking about) gives me the beep sound from the Beep function in kernel32.dll. Wink That's not the point of the thread though, the point was to use the ASM disassembly to get the shellcode for doing this, so I could compile and run that directly perhaps by injection elsewhere. Anyways, I also added onto the instructions, a ret, to avoid a segmentation fault from happening after running the set of byte instructions.
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply





Messages In This Thread
Kernel32.dll Beep Function - by ArkPhaze - 04-05-2013, 04:32 AM
RE: Kernel32.dll Beep Function - by ray_22 - 04-12-2023, 10:39 AM
RE: Kernel32.dll Beep Function - by hacxx - 09-05-2026, 11:59 PM
Kernel32.dll Beep Function - by ArkPhaze - 04-05-2013, 04:32 AM