Advertisement
captmicro

Untitled

Jun 1st, 2010
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1.     TCHAR *teststr = L"mon.dll\x00url";
  2.  
  3.     TCHAR *newstr;
  4.     newstr = (TCHAR*)halloc(sizeof(TCHAR)*12);
  5.    
  6.     lstrcpy(newstr, teststr+lstrlen(teststr)+1);
  7.     lstrcat(newstr, teststr);
  8.     lstrcpy(teststr, newstr);
  9.  
  10.     OutputDebugString(L"Test: ");
  11.     OutputDebugString(teststr);
  12.     OutputDebugString(L"\n");
  13.     hfree(newstr);
  14.  
  15. Output:
  16. First-chance exception at 0x767a2733 in suckblow.exe: 0xC0000005: Access violation writing location 0x010c203c.
  17. Test: mon.dll
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement