Scrivere
un plugin per Ollydbg |
||
Data |
by ZaiRoN |
|
14-12-2oo5 |
Published by Quequero |
|
Vidi cacare e mi venne voglia! |
Grazie Zai in effetti un tute sui plugin di olly proprio ci mancava, ottima idea |
W Quequero :ppppppp (hihihi NdQue) |
.... |
|
.... |
Difficoltà |
(Z)NewBies ( )Intermedio ( )Avanzato ( )Master |
Introduzione |
Tools usati |
URL o FTP del programma |
Essay |
{ if (reason==DLL_PROCESS_ATTACH) hInst=hi; return 1; } |
{ strcpy(shortname,"antiAttach_DbgUiRemoteBreakin"); return PLUGIN_VERSION; } |
{ if (ollydbgversion<PLUGIN_VERSION) // La versione del plugin è corretta? return -1; // In caso negativo il plugin non può essere caricato hwmain=hw; // Salva l'handle della finestra principale di Ollydbg Addtolist(0,0,"antiAttach_DbgUiRemoteBreakin sample plugin, a not professional plugin made just for fun... by ZaiRoN"); return 0; } |
{ switch (origin) { case PM_MAIN: strcpy(data,"0 Save bytes,1 antiAttach DbgUiRemoteBreakin|2 &About"); return 1; default: break; }; return 0; } |
{ if (origin==PM_MAIN) { switch (action) { case 0: // Save bytes // Ottengo l'indirizzo della funzione DbgUiRemoteBreakin e salvo 0x2F byte mhNtdll = GetModuleHandle("ntdll.dll"); dbguiremotebreakinAdd = (DWORD)GetProcAddress(mhNtdll, "DbgUiRemoteBreakin"); memcpy(_DbgUiRemoteBreakin, dbguiremotebreakinAdd, 0x2F); break; case 1: // antiAttach DbgUiRemoteBreakin if (_DbgUiRemoteBreakin[0] == 0x00) { // Per poter effettuare il test è necessario aver salvato i byte... MessageBox(hwmain, "Save bytes first", "Attention!", MB_OK); break; } // Ottengo la lista dei processi in running hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); pEntry.dwSize = sizeof(PROCESSENTRY32); if (Process32First(hSnap, &pEntry)) { do { // Per ogni processo eseguo il controllo sui byte HANDLE hProcess; hProcess = OpenProcess (PROCESS_ALL_ACCESS, FALSE, pEntry.th32ProcessID); ReadProcessMemory(hProcess,dbguiremotebreakinAdd, buffer,0x2F,rBytes); if (memcmp(_DbgUiRemoteBreakin, buffer, 0x2F) != 0) // Funzione patchata! Ripristino i byte originali WriteProcessMemory(hProcess,dbguiremotebreakinAdd, _DbgUiRemoteBreakin, 0x2F,rBytes); CloseHandle(hProcess); } while (Process32Next(hSnap, &pEntry)); } CloseHandle (hSnap); MessageBox(hwmain, "Attach now", "OK",MB_OK); break; case 2: // About... MessageBox(hwmain, "antiAttach_DbgUiRemoteBreakin sample plugin, a not professional plugin made just for fun...\nby ZaiRoN","Info",MB_OK|MB_ICONINFORMATION); break; default: break; }; } } |
Note finali |
Note finali: nessuna nota finale.
Ringraziamenti: nessun ringraziamento.
Saluti: un saluto a tutti.
Disclaimer |
E' tutto vero e tutto legale!!!