# PECOFF4J
PE/COFF 4J is a java engineering library for portable executables, the format used by Windows. It has the following features:
* Parser for Windows executables and DLLs.
* Assembler for creating and modifying executables and DLLs.
* Resource directory parser - understands version info, icons.
This is a fork of http://sourceforge.net/projects/pecoff4j/
Imported from CVS on May 24th, 2014
[![Actions Status](https://github.com/kichik/pecoff4j/workflows/Build/badge.svg)](https://github.com/kichik/pecoff4j)
[![Maven Central](https://img.shields.io/maven-central/v/com.kichik.pecoff4j/pecoff4j.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.kichik.pecoff4j%22%20AND%20a:%22pecoff4j%22)
## Installation
This fork of PECOFF4J is available on [Maven Central](https://search.maven.org/artifact/com.kichik.pecoff4j/pecoff4j).
```xml
<dependency>
<groupId>com.kichik.pecoff4j</groupId>
<artifactId>pecoff4j</artifactId>
<version>0.3.1</version>
</dependency>
```
See [Maven Central](https://search.maven.org/artifact/com.kichik.pecoff4j/pecoff4j) for more installation options like
Gradle, SBT, Ivy, etc.
## License
Sources are licensed under [Common Public License v1.0](http://www.eclipse.org/legal/cpl-v10.html)
## New Features
The project was forked to implement version string parsing for a [StackOverflow question](http://stackoverflow.com/questions/23845480/how-to-get-windows-file-details/23848792).
### Example
```java
import java.io.IOException;
import com.kichik.pecoff4j.PE;
import com.kichik.pecoff4j.ResourceDirectory;
import com.kichik.pecoff4j.ResourceEntry;
import com.kichik.pecoff4j.constant.ResourceType;
import com.kichik.pecoff4j.io.PEParser;
import com.kichik.pecoff4j.io.ResourceParser;
import com.kichik.pecoff4j.resources.StringFileInfo;
import com.kichik.pecoff4j.resources.StringTable;
import com.kichik.pecoff4j.resources.VersionInfo;
import com.kichik.pecoff4j.util.ResourceHelper;
public class Main {
public static void main(String[] args) throws IOException {
PE pe = PEParser.parse("C:/windows/system32/notepad.exe");
ResourceDirectory rd = pe.getImageData().getResourceTable();
ResourceEntry[] entries = ResourceHelper.findResources(rd, ResourceType.VERSION_INFO);
for (int i = 0; i < entries.length; i++) {
byte[] data = entries[i].getData();
VersionInfo version = ResourceParser.readVersionInfo(data);
StringFileInfo strings = version.getStringFileInfo();
StringTable table = strings.getTable(0);
for (int j = 0; j < table.getCount(); j++) {
String key = table.getString(j).getKey();
String value = table.getString(j).getValue();
System.out.println(key + " = " + value);
}
}
}
}
```
Will print:
```
CompanyName = Microsoft Corporation
FileDescription = Notepad
FileVersion = 6.1.7600.16385 (win7_rtm.090713-1255)
InternalName = Notepad
LegalCopyright = © Microsoft Corporation. All rights reserved.
OriginalFilename = NOTEPAD.EXE
ProductName = Microsoft® Windows® Operating System
ProductVersion = 6.1.7600.16385
```
## Other Forks
[jonnyzzz/PE](https://github.com/jonnyzzz/PE) has even more features and probably got much more love than this fork.
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
PE/COFF 4J is a java engineering library for portable executables, the format used by Windows. It has the following features: Parser for Windows executables and DLLs. Assembler for creating and modifying executables and DLLs. Resource directory parser - understands version info, icons.
资源详情
资源评论
资源推荐
收起资源包目录
PECOFF4J jar 源码 (156个子文件)
style.css 941B
ClassLibrary.dll 4KB
pecoff_v8.doc 487KB
clr.doc 207KB
WinRun4J.exe 52KB
SplashScreen.gif 5KB
jxll.gif 570B
xlloop.gif 568B
variantcodec.gif 563B
jvst.gif 366B
pecoff4j.gif 174B
winrun4j.gif 122B
expr4j.gif 114B
.gitignore 23B
Icons in Win32.htm 32KB
res32fmt.htm 16KB
new_exe.html 20KB
cpl-v10.html 15KB
index.html 4KB
eclipse.ico 24KB
favicon.ico 4KB
Test1.ini 45B
WinRun4JTest.jar 7KB
WinRun4J.jar 6KB
PEParser.java 25KB
PEAssembler.java 11KB
ResourceParser.java 10KB
OptionalHeader.java 7KB
TestPAProblems.java 5KB
CLRRuntimeHeader.java 5KB
ImageData.java 5KB
AssemblyParser.java 5KB
LoadConfigDirectory.java 5KB
DOSHeader.java 4KB
DataReader.java 4KB
AbstractInstruction.java 4KB
MOV.java 3KB
ResourceAssembler.java 3KB
ByteArrayDataReader.java 3KB
SectionFlag.java 3KB
RCEdit.java 3KB
SectionTable.java 3KB
ExportDirectory.java 3KB
IconExtractor.java 3KB
FixedFileInfo.java 3KB
Reflection.java 3KB
IO.java 2KB
SectionHeader.java 2KB
PEParserTest.java 2KB
DataWriter.java 2KB
IconFile.java 2KB
IntMap.java 2KB
BitmapInfoHeader.java 2KB
IconDirectoryEntry.java 2KB
PE.java 2KB
ResourceHelper.java 2KB
VersionStringsTest.java 2KB
DebugDirectory.java 2KB
COFFHeader.java 2KB
MachineType.java 2KB
GroupIconDirectoryEntry.java 2KB
StringTable.java 2KB
StringFileInfo.java 2KB
Diff.java 2KB
VersionInfo.java 2KB
StringPair.java 2KB
ResourceEntry.java 2KB
ResourceType.java 2KB
ResourceDirectoryTable.java 2KB
GroupIconDirectory.java 2KB
BitmapFileHeader.java 2KB
Characteristics.java 2KB
HexDump.java 1KB
ImportDirectory.java 1KB
ImportDirectoryEntry.java 1KB
IconImage.java 1KB
DLLCharacteristics.java 1KB
IDataReader.java 1KB
AttributeCertificateTable.java 1KB
TestParseAssemble.java 1KB
AssemblyFormatter.java 1KB
BoundImport.java 1KB
RVAConverter.java 1KB
ImageDataDirectoryType.java 1KB
AssemblyParserTest.java 1KB
ModRM.java 1KB
WindowsSubsystem.java 1KB
Bitmap.java 1KB
DebugType.java 1KB
IconDirectory.java 1KB
LEA.java 1KB
PUSH.java 1KB
VarFileInfo.java 1KB
TestParseProblemDLL.java 1KB
ADD.java 1KB
ResourceDirectory.java 1KB
RGBQuad.java 997B
JumpIfInstruction.java 992B
CALL.java 989B
TestParseDLLs.java 972B
共 156 条
- 1
- 2
ITSugar
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 嵌入式开发概述及其常用编程语言介绍
- 5G模组升级刷模块救砖以及5G模组资料路由器固件
- C183579-123578-c1235789.jpg
- Qt5.14 绘画板 Qt Creator C++项目
- python实现Excel表格合并
- Java实现读取Excel批量发送邮件.zip
- 【java毕业设计】商城后台管理系统源码(springboot+vue+mysql+说明文档).zip
- 【java毕业设计】开发停车位管理系统(调用百度地图API)源码(springboot+vue+mysql+说明文档).zip
- 星耀软件库(升级版).apk.1
- 基于Django后端和Vue前端的多语言购物车项目设计源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0