• 听声辨位识DUMP


    要处理的dump成千上万,每个都用眼睛去看也太累了,不如用耳朵听好了.相信经过一段时间适应,一定可以做到凭听就解决dump分析.(逃

    DumpMusican

    这个小exe只需要把dump路径作为参数传进去,就会把dump转成一个wav音频,好了,我相信足够的训练集可以帮你以后听声辨位识dump的.


    PS:这是神功,一定要刻苦训练,功成之日天下无敌...

    如果缺少crt无法运行,可以直接编译:

    #include <Windows.h>
    #include <cstdio>
    #pragma pack(push) 
    #pragma pack(1)
    struct WAVHeader
    {
    	char RIFF[4] = { 'R','I','F','F' };
    	DWORD FileSize;
    	char WAVE[4] = { 'W','A','V','E' };
    	char FMT[4] = { 'f','m','t',' ' };
    	DWORD BitLenth = 16;
    	WORD Format = 1;
    	WORD Channel = 2;
    	DWORD SampleRate = 44100;
    	DWORD BandWidth = 176400;
    	WORD Type = 4;
    	WORD BitPerSample = 16;
    	char DatHeader[4] = { 'd','a','t','a' };
    	DWORD DatSize;
    };
    #pragma pack(pop)
    
    int main(int argc, char *argv[])
    {
    	HANDLE pFile;
    	DWORD fileSize;
    	char *buffer, *tmpBuf;
    	DWORD dwBytesRead, dwBytesToRead;
    
    	if (argc == 0)
    		return 1;
    
    	pFile = CreateFileA(argv[0], GENERIC_READ,
    		FILE_SHARE_READ,
    		NULL,
    		OPEN_EXISTING,
    		FILE_ATTRIBUTE_NORMAL,
    		NULL);
    
    	if (pFile == INVALID_HANDLE_VALUE)
    	{
    		CloseHandle(pFile);
    		return FALSE;
    	}
    
    	fileSize = GetFileSize(pFile, NULL);
    
    	WAVHeader WavHader;
    	WavHader.FileSize = fileSize - 4;
    	WavHader.DatSize = fileSize - 44;
    
    	buffer = (char *)malloc(fileSize);
    
    	memset(buffer, 0, fileSize);
    	dwBytesToRead = fileSize;
    	dwBytesRead = 0;
    	tmpBuf = buffer;
    
    	do {
    
    		ReadFile(pFile, tmpBuf, dwBytesToRead, &dwBytesRead, NULL);
    
    		if (dwBytesRead == 0)
    			break;
    
    		dwBytesToRead -= dwBytesRead;
    		tmpBuf += dwBytesRead;
    
    	} while (dwBytesToRead > 0);
    
    	CloseHandle(pFile);
    
    	{
    		char *tmpBuf;
    		DWORD dwBytesWrite, dwBytesToWrite;
    		char namebufp[256];
    		sprintf(namebufp, "%s.wav", argv[0]);
    		pFile = CreateFileA(namebufp, GENERIC_WRITE,
    			FILE_SHARE_WRITE,
    			NULL,
    			CREATE_ALWAYS,        
    			FILE_ATTRIBUTE_NORMAL,
    			NULL);
    
    		if (pFile == INVALID_HANDLE_VALUE)
    		{
    			
    			CloseHandle(pFile);
    			return FALSE;
    		}
    
    		dwBytesToWrite = fileSize + sizeof(WAVHeader);
    		dwBytesWrite = 0;
    
    		tmpBuf = buffer;
    
    		BOOL bOK = WriteFile(pFile, &WavHader, sizeof(WAVHeader), &dwBytesWrite, NULL);
    		bOK = WriteFile(pFile, buffer, fileSize, &dwBytesWrite, NULL);
    
    		
    		free(buffer);
    		CloseHandle(pFile);
    	}
    
    	return 0;
    }
    
  • 相关阅读:
    git常用命令笔记(二)
    Git for Windows安装和从Github下载工程
    为什么Mac或者Windows经常要配置环境变量?
    javagradle安装gradle的两种方式以及配置环境变量
    Macmac安装和使用homebrew
    收藏之关键词[git]搜索结果
    MAC电脑配置MYSQL JAVA MAVEN环境变量
    多测师讲解 python+selenium自动化测试讲解线性脚本(2) 高级讲师肖sir
    多测师讲解__app面试指导课_高级讲师肖sir
    多测师讲解__linux_高级讲师肖sir
  • 原文地址:https://www.cnblogs.com/Baesky/p/DumpMusican.html
Copyright © 2020-2023  润新知