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的更多相关文章

随机推荐

  1. MongoDB笔记(二):MongoDB下Shell的基本操作

    一.mongoDB与关系型数据库对比 对比项              mongoDB             关系型数据库(oracle.mysql) 表 集合List 二维表table 表的一行数 ...

  2. 关于SVN提交强制加入注释

    一.摘要 场景: 在这次开发项目过程中,团队中总是有人忘记添加注释. 问题: 1:其他成员不知道你提交是什么代码, 给回滚操作带来很多不必要的麻烦. 2:这个工作需要有一个人天天提醒大家在提交代码的时 ...

  3. MVC的设计模式在JavaWeb中的实现

    JSP开发模式 jsp开发模式的发展 1.模式1:(适合小型项目的技术的开发)     a.第一版本号,纯jsp(封装数据.处理数据,显示数据)     b.第二版本号,Jsp+JavaBean.   ...

  4. 经典图算法Java代码实践:BFS,DFS以及几种最短路径算法

    public class City { String name; int id; static int idCounter = 0; public City(String name) { this.n ...

  5. PILE读书笔记_进程环境

    进程是操作系统运行程序的一个实例, 也是操作系统分配资源的单位. 在Linux环境中, 每个进程都有独立的进程空间, 以便对不同的进程进行隔离, 使之不会互相影响. atexit函数 #include ...

  6. 27. Remove Element【easy】

    27. Remove Element[easy] Given an array and a value, remove all instances of that value in place and ...

  7. PHP图片识别成文字

    http://apistore.baidu.com/apiworks/servicedetail/146.html 分类: php2011-- : 3576人阅读 评论() 收藏 举报 phpfunc ...

  8. Java 扫描包下所有类(包括jar包)

    package com.MyUtils.file; [java] view plain copy import java.io.File; import java.io.FileFilter; imp ...

  9. SVN各种错误提示产生原因及处理方法大全(转)

    SVN各种错误提示产生原因及处理方法大全 1. svn: Server sent unexpected return value (500 Internal Server Error) in resp ...

  10. 微信蓝牙ble记录

    参加了一个简单的微信蓝牙ble项目,做一些记录 首先按网站上面的各种配置 简单的说就是,软件上面,生成deviceid->绑定设备和deviceid. 几点注意: 1>deviceid是唯 ...