Saltar al contenido
Underc0de /foro

Biblioteca de APIs do Windows

🌐 Esta é uma tradução automática de um tópico do Underc0de, a maior comunidade de hacking e TI em espanhol. Ler o original (espanhol) e responder →
Alex ·
[ÍNDICE]
<br /><br />    * Sleep <br />    * Findwindow <br />    * Shellexecute <br />    * ShFileOperation <br />    * Copyfile <br />    * SetwindowPost <br />    * Exitprocess <br />    * GetCurrentProcess <br />    * URLDownloadToFile <br />    * GetLogicalDrives <br />    * Keybd_Event <br />    * DoFileDownload <br />    * MoveFile <br />    * TextOut <br />    * GetParent <br />    * SetCursorPos <br />    * BlockInput <br />    * ExitWindowsEx<br />    * GetLogicalTime<br />    * GetCursorPos<br />    * SetWindowText<br />    * GetForegroundWindow<br />    * GetWindowText<br />    * mouse_event
Alex ·
Nome: Sleep<br /><br />Declaração:<br /><br />
Código: text
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)<br />Explicação: Serve para gerar um atraso.+
<br /><br />Exemplo de uso:<br /><br />
Código: text
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)<br />private sub form_load()<br />sleep(5000)<br />msgbox "ya pasaron 5 segundos"<br />end sub
Alex ·
Nome: Findwindow<br /><br />Declaração:<br /><br />
Código: text
Private Declare Function FindWindow _ <br />     Lib "user32" _ <br />     Alias "FindWindowA" ( _ <br />         ByVal lpClassName As String, _ <br />         ByVal lpWindowName As String) As Long
<br /><br /><br />Explicação desta API: Serve para saber se uma janela está ativa, entre outras coisas.<br /><br />Exemplo de uso:<br />
Código: text
Private Declare Function FindWindow _ <br />     Lib "user32" _ <br />     Alias "FindWindowA" ( _ <br />        ByVal lpClassName As String, _ <br />        ByVal lpWindowName As String) As Long<br />private sub command1_click() <br />   <br /> Dim hola As Long <br />         <br />     hola = FindWindow(clase, vbNullString) <br />       <br /><br />     If hola<> 0 Then <br />         MsgBox "está abierta"<br />     Else  
Alex ·
Nome: Shellexecute<br /><br />Declaração:<br /><br />
Código: text
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _<br />(ByVal hWnd As Long, ByVal lpOperation As String, ByVal _<br /> lpFile As String, ByVal lpParameters As String, ByVal _<br /> lpDirectory As String, ByVal nShowCmd As Long) As Long<br />
<br /><br />Explicação: O que essa API faz é executar arquivos.<br /><br />Exemplo de uso: (este code é de mr.blood, obrigado amigo)<br /><br />
Código: text
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _<br />(ByVal hWnd As Long, ByVal lpOperation As String, ByVal _<br /> lpFile As String, ByVal lpParameters As String, ByVal _<br /> lpDirectory As String, ByVal nShowCmd As Long) As Long<br /><br />Public Function Archivos(ByVal rute As String, hWnd As String, VBHide As Boolean)<br />Dim num As Integer<br />If VBHide = False Then<br />num = 1<br />Else<br />If VBHide = True Then<br />num = 0<br />End If<br />End If<br />Call ShellExecute(hWnd, "Open", rute, "", "", num)<br />End Function<br />é um exemplo de uma dll, para reproduzir música.
Alex ·
Nome: ShFileOperation<br /><br />Declaração:<br /><br />
Código: text
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long  
<br /><br />Explicação: Esta API serve para excluir um arquivo.<br /><br />Exemplo de uso:<br /><br />
Código: text
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long  <br />  <br /> Private Sub Form_Load()  <br />     Dim Operacion As SHFILEOPSTRUCT  <br />     Dim file As String  <br />     file = "c:\Nuevo Documento de texto.txt"  <br />    With Operacion  <br />          <br />         .wFunc = 3  <br />         'Este el Path al archivo a eliminar  <br />         .pFrom = App.Path & "\" & file  <br />          <br />         .fFlags = 64  <br />     End With  <br />        <br />     SHFileOperation Operacion  <br />  <br /> End Sub
<br /><br />Nota: o arquivo é excluído nesta linha:<br /><br />
Código: text
SHFileOperation Operacion
<br /><br />Operacion é o path do arquivo a excluir.
Alex ·
Nome: Copyfile<br /><br />Declaração:<br /><br />
Código: text
Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long<br />
<br /><br />Explicação: Serve para copiar um arquivo.<br /><br />Exemplo de uso:<br /><br />
Código: text
Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long<br />Dim Copiar As Long<br /><br />Copiar = CopyFile(App.Path & "\Drinky.crack", "C:\Drinky.crack", 1)
<br /><br />obrigado drinky :D<br /><br />saudações!
Alex ·
Nome: SetwindowPost<br /><br />Declaração:<br /><br />
Código: text
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long<br />
<br /><br />Explicação: Serve para fazer com que uma janela fique sempre visível, entre outras coisas.<br /><br />Exemplo de uso:<br /><br />
Código: text
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long<br /><br />Private Const HWND_TOPMOST = -1<br /><br />Private Sub Form_Load()<br />Me.ScaleMode = vbPixels<br />SetWindowPos Me.hwnd, HWND_TOPMOST, Me.ScaleLeft, Me.ScaleTop, Me.ScaleWidth, Me.ScaleHeight, 0<br />End Sub
Alex ·
Nome: Exitprocess<br /><br />Declaração:<br /><br />
Código: text
Private Declare Sub ExitProcess Lib "kernel32" ( _ <br />     ByVal uExitCode As Long) <br /> Private Declare Function GetExitCodeProcess Lib "kernel32" ( _ <br />     ByVal hProcess As Long, _ <br />     lpExitCode As Long) As Long
<br /><br />Explicação: Serve para encerrar um processo.<br /><br />Exemplo de uso:<br /><br />
Código: text
Private Declare Sub ExitProcess Lib "kernel32" ( _ <br />     ByVal uExitCode As Long) <br /> Private Declare Function GetExitCodeProcess Lib "kernel32" ( _ <br />     ByVal hProcess As Long, _ <br />     lpExitCode As Long) As Long<br />ExitProcess GetExitCodeProcess(GetCurrentProcess, 0)
<br /><br />Nota: Esta API vai junto com a API GetCurrentProcess (explicada mais abaixo. Se não lerem o uso dela, também não vão entender esta API, já explicada.
Alex ·
Nome: GetCurrentProcess<br /><br />Declaração:<br /><br />
Código: text
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
<br /><br />Explicação: Lê os processos que estão abertos.<br /><br />Exemplo de uso: Igual à API Exitprocess, mas declarando esta. Já disse antes que estas APIs vão juntas.<br />Qualquer dúvida sobre elas, perguntem.
Alex ·
Nome: URLDownloadToFile<br /><br />Declaração:<br /><br />
Código: text
Private Declare Function URLDownloadToFile _ <br />     Lib "urlmon" _ <br />     Alias "URLDownloadToFileA" ( _ <br />         ByVal pCaller As Long, _ <br />         ByVal szURL As String, _ <br />         ByVal szFileName As String, _ <br />         ByVal dwReserved As Long, _ <br />         ByVal lpfnCB As Long) As Long
<br /><br />Explicação: Serve para baixar arquivos.<br /><br />Exemplo de uso:<br /><br />
Código: text
Private Declare Function URLDownloadToFile _ <br />     Lib "urlmon" _ <br />     Alias "URLDownloadToFileA" ( _ <br />         ByVal pCaller As Long, _ <br />         ByVal szURL As String, _ <br />         ByVal szFileName As String, _ <br />         ByVal dwReserved As Long, _ <br />         ByVal lpfnCB As Long) As Long<br />private sub command1_click()<br />Call URLDownloadToFile(0, Url, App.Path & "\nombre.drinkyf", 0, 0)
<br /><br />Nota: o primeiro parâmetro é a url e o segundo é onde é salvo.
Alex ·
Nome: Keybd_Event<br /><br />Declaração:<br />Declara-se da seguinte forma:<br /><br />
Código: text
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _ <br />     ByVal bScan As Byte, _ <br />     ByVal dwFlags As Long, _ <br />     ByVal dwExtraInfo As Long) <br />e faltam duas constantes:<br />Código:<br />Const KEYEVENTF_KEYUP = &H2 <br /> Const KEYEVENTF_EXTENDEDKEY = &H1
<br /><br />Explicação: Serve para simular o pressionamento de teclas.<br /><br />Exemplo de uso:<br /><br />
Código: text
   <br /> Const KEYEVENTF_KEYUP = &H2 <br /> Const KEYEVENTF_EXTENDEDKEY = &H1 <br />     <br />   Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _ <br />       ByVal bScan As Byte, _ <br />       ByVal dwFlags As Long, _ <br />       ByVal dwExtraInfo As Long) <br />     <br />     <br />     <br />   Sub Pulsar_Tecla(Tecla As Long) <br />     <br />       Call keybd_event(Tecla, 0, 0, 0) <br />     <br />       Call keybd_event(Tecla, 0, KEYEVENTF_KEYUP, 0) <br />     <br />   End Sub  <br /><br />   Private Sub Timer1_Timer() <br />   Call Pulsar_Tecla(vbKeyTab) <br />   End Sub 
Grupo de WhatsApp