-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathpe_File.h
More file actions
51 lines (44 loc) · 880 Bytes
/
pe_File.h
File metadata and controls
51 lines (44 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned long ULONG;
typedef int BOOL;
typedef unsigned long DWORD;
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define MAX_PATH 260
#define PE_FILE_IOBUFSIZE 1024
class pe_File
{
public:
BOOL Open(char *FileName,const char *mode="rb");
ULONG Read(void *pDestMemory,ULONG ReadSize);
bool ReadToken(void *pDestMemory, ULONG ReadSize);
ULONG Write(void *pResBuffer,ULONG WriteSize);
bool WriteToken(void *pResBuffer, ULONG WriteSize);
void Close();
void MoveToStart();
void MoveToEnd();
void MoveFromStart(DWORD Seek);
void Free();
ULONG GetFileSize();
pe_File(void)
{
m_fp=NULL;
m_FileSize=0;
}
~pe_File(void)
{
Free();
}
private:
char m_FileName[MAX_PATH];
ULONG m_FileSize;
FILE *m_fp;
};
extern ULONG stdGetFileSize(char *FileName);