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. JsonConvert.SerializeObject() 输出josn格式 也就是序列化。

    JsonConvert.SerializeObject() 输出josn格式  也就是序列化. JSON.parse 反序列化  http://www.cnblogs.com/ahlx/p/52280 ...

  2. 5.触摸touch,单点触摸,多点触摸,触摸优先和触摸事件的吞噬

     1 触摸 Coco2dx默认仅仅有CCLayer及其派生类才有触摸的功能. 2 单点触摸 打开触摸开关和触摸方式 setTouchEnabled(true); setTouchMode(kCCT ...

  3. [linux]w命令和uptime命令查看系统负载

    在Linux系统中查询系统CPU和内存的负载(使用率)时,我们通常习惯于使用top.atop或者ps,这篇文章将要给大家介绍如何使用w命令和uptime命令来查看系统的负载情况,对于uptime命令, ...

  4. centos7单机版安装hbase

    1.首先安装jdk1.8 yum install java-1.8.0-openjdk* -y 2.下载hbase 地址:http://mirrors.shuosc.org/apache/hbase/ ...

  5. GEEK学习笔记— —程序猿面试宝典笔记(三)

    所谓笔记,就是比較个人的东西,把个人认为有点意思的东西记录下来~~ 程序猿面试宝典笔记(一)基本概念 程序猿面试宝典笔记(二)预处理.const和sizeof 程序猿面试宝典笔记(三)auto_ptr ...

  6. [容器]gcr.io镜像下载

    下载gcr.io的镜像hosts文件  把下面两行加入到/etc/hosts中. 更多在这里http://wst.so/files/hosts 61.91.161.217 gcr.io 61.91.1 ...

  7. iptables修改

    https://fedoraproject.org/wiki/How_to_edit_iptables_rules?rd=User_talk:Rforlot Listing Rules Current ...

  8. css制作的各种图形

    1.六角形的制作: 代码: #star-six{ height:0; width:0; border-bottom:100px solid red; border-left: 50px solid t ...

  9. ccentos 7下安装php5.6并使用nginx + php-fpm部署多个不同端口网站

    作为一个的勤杂工,近期因公司内部信息化的需求,给新进员工提供基础的知识培训和介绍,也为了给公司内部建立一个沟通交流的平台,百度找了开源的百科系统HDwiki和开源的问答系统Tipask问答系统,蛋痛的 ...

  10. 喜闻乐见的const int *p、int* const p、const int* const p

    不废话直接代码示例: void f(const int *p) { ; *p = ; // error p = &b; // fine } void f(int* const p) { ; * ...