DumpBinary
stdafx.h
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstdlib>
main.cpp
#include "stdafx.h"
int main(int argc, char *argv[])
{
#if 0
if (argc != 3)
{
return 0;
}
std::fstream fs(argv[1], std::ios::binary | std::ios::trunc | std::ios::in | std::ios::out);
#endif
std::fstream in("D:\\axhelper.exe", std::ios::binary | std::ios::in);
if (!in.is_open())return 1;
//至文件尾获取文件大小
in.seekg(0,std::ios::end);
std::streamoff inSize = in.tellg();
std::cout << "文件大小:" <<inSize << std::endl;
//至文件头
in.seekg(0, std::ios::beg);
//分配内存
char *buff = (char*)std::calloc((size_t)inSize, sizeof(char));
//释放内存
std::free(buff);
in.close();
getchar();
//fs.read()
return 0;
}
DumpBinary的更多相关文章
随机推荐
- lua面向对象编程 《lua程序设计》 16章 笔记
Lua中的table就是一种对象,即它拥有状态.拥有独立于其值的标识(self).table与对象一样具有独立于创建者和创建地的征集周期 什么叫对象拥有独立的生命周期? Account = {bala ...
- 初学spring(二)
1.spring推荐使用接口编程,配合di可以达到层与层之间解耦
- 当执行sql更新失误,添加了错误的判断条件,导致数据表数据出错时,如何利用备份数据库实现联合更新还原数据。
首先得有备份数据库,没有备份肯定无法联合更新回复. 我错误更新了 [SBSDB].[dbo].[wallet_user_info]中的用户名user_name 我的备份数据库及对应数据表SBSDBTe ...
- es备份
#!/bin/bash export LC_ALL=en_US.UTF- export LANG=en_US.UTF- Ip=10.0.10.10 Date=$(date +"%Y%m%d& ...
- 开放平台(接口)开发-1-天气API接口大全
前几天有个公司让准备一下第二次面试.应聘的是IOS开发实习生,可是之前一直做android,IOS刚接触了一个月,会的不是非常多,所以决定做一个实际的项目展现给面试官,余同学给了个建议:能够做一 ...
- unity,实现屏幕后处理的两种方法
方法一: Main Camera的Target Texture保持为None.挂一个Blit脚本,在其中的OnRenderImage中调用Graphics.Blit(sourceTexture,des ...
- I2S与pcm的区别
I2S仅仅是PCM的一个分支,接口定义都是一样的, I2S的采样频率一般为44.1KHZ和48KHZ做,PCM采样频率一般为8K,16K.有四组信号: 位时钟信号,同步信号,数据输入,数据输出. I2 ...
- Creating Dialogbased Windows Application (4) / 创建基于对话框的Windows应用程序(四)Edit Control、Combo Box的应用、Unicode转ANSI、Open File Dialog、文件读取、可变参数、文本框自动滚动 / VC++, Windows
创建基于对话框的Windows应用程序(四)—— Edit Control.Combo Box的应用.Unicode转ANSI.Open File Dialog.文件读取.可变参数.自动滚动 之前的介 ...
- 170. Two Sum III - Data structure design【easy】
170. Two Sum III - Data structure design[easy] Design and implement a TwoSum class. It should suppor ...
- jquery中Uncaught TypeError: $(...).ajaxUpload is not a function(…)错误解决方法
错误原因:该函数不是jquery的核心函数,所以需要外部引入ajaxfileupload.js文件,可能是没有引入,或者引入的js文件互相冲突 解决方法:每次进入一个函数之前打印该函数所有的js文件, ...