GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — add tools · imrzyang/SKRoot-linuxKernelRoot@fa9422d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • patch_kernel_root/exe/快速扩充文件体积工具
    • QuicklyExpandFileSize.cpp
    • QuicklyExpandFileSize128M.exe
    • QuicklyExpandFileSize192M.exe
    • QuicklyExpandFileSize64.exe
    • QuicklyExpandFileSize96.exe
    • 用法:将kernel文件拖拽至exe
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎patch_kernel_root/exe/快速扩充文件体积工具/QuicklyExpandFileSize.cpp‎

Copy file name to clipboard
+47Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// QuicklyExpandFileSize.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
2+
//
3+
4+
#include <iostream>
5+
#include <string>
6+
#include <sstream>
7+
using namespace std;
8+
#define TARGET_BYTES 192*1024*1024 //目标体积大小
9+
int main(int argc, char *argv[]) {
10+
char *inimage = argv[0];
11+
++argv;
12+
--argc;
13+
14+
cout << "本工具用于快速扩大boot.img的文件体积" << endl << endl;
15+
16+
17+
const char *lpszFilePath = argv[0];
18+
FILE * pFile = fopen(lpszFilePath, "rb+");
19+
if (!pFile) {
20+
cout << "打开文件失败:" << lpszFilePath << endl;
21+
system("pause");
22+
return 0;
23+
}
24+
fseek(pFile, 0, SEEK_END);
25+
auto nSize = ftell(pFile);
26+
rewind(pFile);
27+
if (nSize >= TARGET_BYTES) {
28+
cout << "目标文件体积已经大于" << TARGET_BYTES / 1024 / 1024 << "MB,无需再扩大" << endl;
29+
system("pause");
30+
return 0;
31+
}
32+
33+
fseek(pFile, 0, SEEK_END);
34+
auto writeSize = TARGET_BYTES - nSize;
35+
void * pEmptySize = malloc(writeSize);
36+
if (!pEmptySize) {
37+
cout << "申请内存大小" << writeSize << "字节,失败" << endl;
38+
system("pause");
39+
return 0;
40+
}
41+
fwrite((char*)pEmptySize, writeSize, 1, pFile);
42+
free(pEmptySize);
43+
fclose(pFile);
44+
cout << "目标文件体积扩充完毕:" << TARGET_BYTES / 1024 / 1024 << "MB" << endl;
45+
system("pause");
46+
return 0;
47+
}
Collapse file

‎patch_kernel_root/exe/快速扩充文件体积工具/QuicklyExpandFileSize128M.exe‎

Copy file name to clipboard
13 KB
Binary file not shown.
Collapse file

‎patch_kernel_root/exe/快速扩充文件体积工具/QuicklyExpandFileSize192M.exe‎

Copy file name to clipboard
13 KB
Binary file not shown.
Collapse file

‎patch_kernel_root/exe/快速扩充文件体积工具/QuicklyExpandFileSize64.exe‎

Copy file name to clipboard
13 KB
Binary file not shown.
Collapse file

‎patch_kernel_root/exe/快速扩充文件体积工具/QuicklyExpandFileSize96.exe‎

Copy file name to clipboard
13 KB
Binary file not shown.
Collapse file

‎patch_kernel_root/exe/快速扩充文件体积工具/用法:将kernel文件拖拽至exe‎

Copy file name to clipboardExpand all lines: patch_kernel_root/exe/快速扩充文件体积工具/用法:将kernel文件拖拽至exe
Whitespace-only changes.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.