Original Post
Ive searched this on the web and read many times that it is impossible. Tho, I have seen this working before, so Im 100% sure it''s possible. (In visual basic)
I wanna call an api function without declaring it first. This is what I have so far:
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function CreateThread Lib "kernel32" (lpThreadAttributes As Any, ByVal dwStackSize As Long, lpStartAddress As Long, lpParameter As Any, ByVal dwCreationFlags As Long, lpThreadId As Long) As Long
Private Sub Form_Load()
Dim lib As Long
Dim procaddr As Long
Dim ThreadID As Long
''Load the library
lib = LoadLibrary("kernel32")
If lib <> 0 Then
''Get the proc address
procaddr = GetProcAddress(lib, "Beep")
''Free the library
FreeLibrary lib
''If i got the proc address, execute it
If procaddr <> 0 Then
CreateThread ByVal 0, 0, ByVal procaddr, 0, 0, ThreadID
End If
End If
End Sub
This way, Beep gets executed fine. Now only I wanna pass the parameters 1000 and 1000 to it. How can I do this?
The one time I saw it it was alot of very strange code (Some hex I think, so probably assembly instructions).
So how do I pass 1000 and 1000 to it?
10x,
H4ck3r