2012/06/02

千千靜聽去廣告工具 ttpadp

千千靜聽去廣告工具 v1.0 TTPlayer Advertisement Patcher


預覽圖:

載點:按我下載


Source Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, const char* args[])
{
    const char str[] = {0x68, 0x00, 0x74, 0x00, 0x74, 0x00, 0x70, 0x00, 0x3A, 0x00, 0x2F, 0x00, 0x2F, 0x00, 0x74, 0x00, 0x74, 0x00, 0x6D, 0x00, 0x73, 0x00, 0x67, 0x00, 0x2E, 0x00, 0x71, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6E, 0x00, 0x71, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6E, 0x00, 0x2E, 0x00, 0x63, 0x00, 0x6F, 0x00, 0x6D, 0x00, 0x2F, 0x00, 0x6D, 0x00, 0x73, 0x00, 0x67, 0x00, 0x2E, 0x00, 0x70, 0x00, 0x68, 0x00, 0x70, 0x00, 0x3F, 0x00, 0x25, 0x00, 0x73, 0x00, 0x26, 0x00, 0x69, 0x00, 0x64, 0x00, 0x3D, 0x00, 0x25, 0x00, 0x73};
   
    if(argc == 1)
    {
        printf("TTPlayer Advertisement Patcher  v1.0\n\n      --Powered By Inndy\n\n\n");
        printf("Use %s [File]\nEx: %s TTPlayer.exe", args[0], args[0]);
        return 0;
    }
   
    FILE* fp = fopen(args[1], "rb");
    int l = filelength(fp->_file);
    char* buffer = malloc(l);
    fread(buffer, l, 1, fp);
    fclose(fp);
   
    if(l < 0x00080000)
    {
        printf("File is too small.\n");
        return 0;
    }
   
    int i;
    int ln = sizeof(str);
    int m = l - ln;
    int result = 0;
    for(i = 0x00080000; i <= m; i += 4)
    {
        if(memcmp(buffer+i, str, ln) == 0)
        {
            result = i;
            break;
        }
    }
   
    if(result)
    {
        printf("Found patch point.\n");
        printf("Please backup your file and press any key to continue.\n");
        system("pause>nul");
        printf("Patching...\n");
        fp = fopen(args[1], "rb+");
        fseek(fp, i, SEEK_SET);
        fwrite("\x0\x0\x0\x0", 4, 1, fp);
        fclose(fp);
        printf("Done!\n");
    }
    else
    {
        printf("Didn't find patch point.\n");
    }
   
    free(buffer);
   
    return 0;
}

沒有留言:

張貼留言