我是来仰视各位用易语言的大侠的

社区服务
高级搜索
猴岛论坛电脑百科我是来仰视各位用易语言的大侠的
发帖 回复
倒序阅读 最近浏览的帖子最近浏览的版块
19个回复

我是来仰视各位用易语言的大侠的

楼层直达
flint

ZxID:2676666

等级: 中士
举报 只看楼主 使用道具 楼主   发表于: 2010-10-04 0
本人才疏学浅,也就用个C++写点小东西。

昨天玩了下QQ找茬游戏,无意间就自己做了个垃圾挂。

特来此地仰视各位易语言大侠,虽说有炫耀的潜质,但易语言在我看来。

纯粹一坨屎。

首先对我做的小挂做个代码讲解

  1. #include "stdafx.h"  //控制台应用程序自动生成
  2. #include "windows.h"  //包含头文件
  3. int main(int argc, char* argv[])  //主函数
  4. {
  5.     HWND hwnd=::GetDesktopWindow();  //第一步获取桌面句柄
  6.     HDC dc=::GetWindowDC(hwnd);  //通过桌面句柄来得到设备环境
  7.                     int basex=9;
  8.     int basey=193;//定义基址
  9.     HPEN hpen=::CreatePen(PS_SOLID,5,RGB(255,0,0));  //创建画笔,红色的
  10.     ::SelectObject(dc,hpen);  //让画笔和设备环境结合
  11.     while(1)  //死循环
  12.     {
  13.         int y=basey; 
  14.         for(y;y<=640;y+=10) //for循环,具体的看百度
  15.         {
  16.             int x=basex;
  17.             for(x;x<=507;x+=10)
  18.             {
  19.                 COLORREF leftclr =::GetPixel(dc,x,y);  //得到设备环境下的点X和Y的颜色值
  20.                 COLORREF rightclr =::GetPixel(dc,x+509,y); //如上,只是坐标值发生了改变而已
  21.                 if(leftclr!=rightclr) //对两坐标值取到的颜色值进行比较
  22.                 {
  23.                     ::Ellipse(dc,x-2,y-2,x+2,y+2); 
  24.                 }
  25.             }
  26.         }
  27.     }
  28. }


可能大家看不懂,没关系,我讲下原理,实际QQ找茬游戏本身就是考验我们的分辨力,给我们两张图片,让我们从中找出它们的不同点,而知道了玩法之后,我们就可以用这段小小的代码来实现了,

这段代码的含义整体来说就是比较两张图片的坐标值,从左上方开始,以10为增加量,当相同就继续循环下去,直到找到它们的颜色值不同为止,就进行画矩形的操作。

我就不把程序发出来了,这个代码还是有很多bug的,因为之前没有判断QQ找茬游戏的窗口是否为全屏,或者咱们电脑本身的分辨率等等,呵呵,就写到这了,不同的环境下,可能效果也不一样,写个小外挂是不是很简单!

此文乃本人原创,之前我是玩黑的,但是别跟我说抓鸡,刷钻,这种垃圾的技术我是不屑的
半岛旧情°ˉ2c1

ZxID:3870552

等级: 中将
配偶: liangzuozhib
SB

举报 只看该作者 沙发   发表于: 2010-10-04 0
呵呵。 支持
〆 ˉ 壞壊

ZxID:9778602

等级: 大将
我爱你

举报 只看该作者 板凳   发表于: 2010-10-04 0
呵呵,都只是爱好而已
没有人会记得我,潜水是我唯一的选择
flint

ZxID:2676666

等级: 中士
举报 只看该作者 地板   发表于: 2010-10-04 0
我晕,忘记写了,能否加个亮啊
叶晏

ZxID:11457617

等级: 元老
举报 只看该作者 4楼  发表于: 2010-10-04 0
谢谢,受教了
⒉o1○丶初戀

ZxID:11677127

等级: 中尉

举报 只看该作者 5楼  发表于: 2010-10-04 0
不解释
qinhaoang

ZxID:6631876

等级: 中士
传说佛祖阿难曾经爱过一女子。死后对佛祖说,我愿化身石桥,受五
举报 只看该作者 6楼  发表于: 2010-10-04 0
本帖de评分: 1 条评分 DB -1
DB-1

请不要恶意灌水,恶意灌水包括:纯表情 ..

妈、媳妇跑了

ZxID:12760316

等级: 少将

举报 只看该作者 7楼  发表于: 2010-10-04 0
此人装b呀   


我不屑于什么技术,都没叼用,都是一堆垃圾,你看你傲气那样子,易语言怎么了?

NB的人编程序直接用01010101编,谁还用C++??


夜、依旧

ZxID:8392579

等级: 上将
有一种偏执叫单曲循环。

举报 只看该作者 8楼  发表于: 2010-10-04 0
7L的 0101010101 是什么东西  完全没听说
本帖de评分: 1 条评分 DB +1
DB+1

二进制代码,不解释






村头㈠朵草╮

ZxID:12068101

等级: 贵宾
雪枫银浪
举报 只看该作者 9楼  发表于: 2010-10-04 0
太装B了,自大狂
承接小型软件定制业务,价格另议
未滿十八歲╮

ZxID:6748612

等级: 禁止发言

举报 只看该作者 10楼  发表于: 2010-10-04 0
不经常编写
℡陌メ尐楓

ZxID:10371843

等级: 准尉

举报 只看该作者 11楼  发表于: 2010-10-04 0
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#pragma pack(push, 1)

struct zip_header_t {
DWORD signature;
WORD ver_needed;
WORD flags;
WORD method;
WORD lastmod_time;
WORD lastmod_date;
DWORD crc;
DWORD compressed_size;
DWORD uncompressed_size;
WORD filename_length;
WORD extra_length;
};

struct zip_eod_t {
DWORD signature;
WORD disk_no;
WORD disk_dirst;
WORD disk_dir_entries;
WORD dir_entries;
DWORD dir_size;
DWORD dir_offs;
WORD comment_len;
};

struct zip_dir_t {
DWORD signature;
WORD made_by;
WORD ver_needed;
WORD flags;
WORD method;
WORD lastmod_time;
WORD lastmod_date;
DWORD crc;
DWORD compressed_size;
DWORD uncompressed_size;
WORD filename_length;
WORD extra_length;
WORD comment_length;
WORD disk_no;
WORD internal_attr;
DWORD external_attr;
DWORD local_offs;
};
#pragma pack(pop)




unsigned long crc32(unsigned long crc, const unsigned char *buf, int len)

{
#define CRC32_POLYNOMIAL 0xEDB88320
unsigned long crc_table[256];
unsigned long crc32;
int i, j;

for (i = 0; i < 256; i++) {
crc32 = i;
for (j = 8; j > 0; j--) {
if (crc32 & 1)
crc32 = (crc32 >> 1) ^ CRC32_POLYNOMIAL;
else
crc32 >>= 1;
}
crc_table = crc32;
}

if (buf == NULL) return 0L;
#define CRC32(c, b) (crc_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
#define DO1(buf) crc = CRC32(crc, *buf++)
#define DO2(buf) DO1(buf); DO1(buf)
#define DO4(buf) DO2(buf); DO2(buf)
#define DO8(buf) DO4(buf); DO4(buf)
crc = crc ^ 0xffffffffL;
#ifndef NO_UNROLLED_LOOPS
while (len >= 8) {
DO8(buf);
len -= 8;
}
#endif
if (len) do {
DO1(buf);
} while (--len);
return crc ^ 0xffffffffL;
}

static void zip_putcurtime(WORD *f_time, WORD *f_date)
{
SYSTEMTIME systime;

GetSystemTime(&systime);
if ((systime.wYear < 1999) || (systime.wYear > 2010))
systime.wYear = 2004;
if (systime.wMonth < 1 || systime.wMonth > 12) systime.wMonth = 1;
if (systime.wDay < 1 || systime.wDay > 31) systime.wDay = 10;

*f_date =
((systime.wYear-1980) << 9) |
(systime.wMonth << 5) |
systime.wDay;

*f_time =
(systime.wHour << 11) |
(systime.wMinute << 5) |
(systime.wSecond / 2);
}

static unsigned long zip_calc_crc32(HANDLE hFileIn)
{
unsigned long reg, i;
unsigned char buf[1024];
SetFilePointer(hFileIn, 0, NULL, FILE_BEGIN);
for (reg=0;;) {
i = 0;
if (ReadFile(hFileIn, buf, sizeof(buf), &i, NULL) == 0) break;
if (i == 0) break;
reg = crc32(reg, buf, i);
}
SetFilePointer(hFileIn, 0, NULL, FILE_BEGIN);
return reg;
}

int zip_store(char *in, char *out, char *store_as)
{
HANDLE hFileIn, hFileOut;
struct zip_header_t hdr1;
struct zip_eod_t eod1;
struct zip_dir_t dir1;
char buf[1024];
unsigned long i, j, offs;

hFileIn = CreateFile(in, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFileIn == INVALID_HANDLE_VALUE || hFileIn == NULL)
return 1;
hFileOut = CreateFile(out, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, Create_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFileOut == INVALID_HANDLE_VALUE || hFileOut == NULL) {
CloseHandle(hFileIn);
return 2;
}

memset(&hdr1, '\0', sizeof(hdr1));
memset(&dir1, '\0', sizeof(dir1));
memset(&eod1, '\0', sizeof(eod1));
offs = 0;

hdr1.signature = 0x04034b50;
dir1.ver_needed = hdr1.ver_needed = 10;
dir1.flags = hdr1.flags = 0;
dir1.method = hdr1.method = 0;
zip_putcurtime(&hdr1.lastmod_time, &hdr1.lastmod_date);
dir1.lastmod_time = hdr1.lastmod_time;
dir1.lastmod_date = hdr1.lastmod_date;
hdr1.crc = zip_calc_crc32(hFileIn);
dir1.crc = hdr1.crc;

hdr1.compressed_size = GetFileSize(hFileIn, NULL);
dir1.compressed_size = hdr1.compressed_size;
hdr1.uncompressed_size = GetFileSize(hFileIn, NULL);
dir1.uncompressed_size = hdr1.uncompressed_size;
hdr1.filename_length = lstrlen(store_as);
dir1.filename_length = hdr1.filename_length;
dir1.extra_length = hdr1.extra_length = 0;

dir1.local_offs = offs;

WriteFile(hFileOut, &hdr1, sizeof(hdr1), &i, NULL);
offs += sizeof(hdr1);
WriteFile(hFileOut, store_as, lstrlen(store_as), &i, NULL);
offs += lstrlen(store_as);
SetFilePointer(hFileIn, 0, NULL, FILE_BEGIN);
for (;;) {
i = 0;
if (ReadFile(hFileIn, buf, sizeof(buf), &i, NULL) == 0) break;
if (i == 0) break;
WriteFile(hFileOut, buf, i, &j, NULL);
offs += i;
}

eod1.dir_offs = offs;

dir1.signature = 0x02014b50;
dir1.made_by = 20;
dir1.internal_attr = 0;
dir1.external_attr = 0x20;
WriteFile(hFileOut, &dir1, sizeof(dir1), &i, NULL);
offs += sizeof(dir1);
WriteFile(hFileOut, store_as, lstrlen(store_as), &i, NULL);
offs += lstrlen(store_as);

eod1.signature = 0x06054b50;
eod1.disk_no = 0;
eod1.disk_dirst = 0;
eod1.disk_dir_entries = 1;
eod1.dir_entries = eod1.disk_dir_entries;
eod1.dir_size = offs - eod1.dir_offs;
eod1.comment_len = 0;
WriteFile(hFileOut, &eod1, sizeof(eod1), &i, NULL);

CloseHandle(hFileOut);
CloseHandle(hFileIn);
return 0;
}


看懂了告诉我 膜拜?  你不够 资格
[img]http://s8.hk/5hkb                                 


[/img]
5224080

ZxID:1672518

等级: 上将
本无意与众不同 怎奈品位出众

举报 只看该作者 12楼  发表于: 2010-10-04 0
哎.......我手贱进来了.
灰太狼浩浩

ZxID:10361013

等级: 中将
头好晕。。

举报 只看该作者 13楼  发表于: 2010-10-06 0
哎。。。。。。。。。。。。。。
flint

ZxID:2676666

等级: 中士
举报 只看该作者 14楼  发表于: 2010-10-06 0
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#pragma pack(push, 1)

struct zip_header_t {
DWORD signature;
WORD ver_needed;
WORD flags;
WORD method;
WORD lastmod_time;
WORD lastmod_date;
DWORD crc;
DWORD compressed_size;
DWORD uncompressed_size;
WORD filename_length;
WORD extra_length;
};

struct zip_eod_t {
DWORD signature;
WORD disk_no;
WORD disk_dirst;
WORD disk_dir_entries;
WORD dir_entries;
DWORD dir_size;
DWORD dir_offs;
WORD comment_len;
};

struct zip_dir_t {
DWORD signature;
WORD made_by;
WORD ver_needed;
WORD flags;
WORD method;
WORD lastmod_time;
WORD lastmod_date;
DWORD crc;
DWORD compressed_size;
DWORD uncompressed_size;
WORD filename_length;
WORD extra_length;
WORD comment_length;
WORD disk_no;
WORD internal_attr;
DWORD external_attr;
DWORD local_offs;
};
#pragma pack(pop)




unsigned long crc32(unsigned long crc, const unsigned char *buf, int len)

{
#define CRC32_POLYNOMIAL 0xEDB88320
unsigned long crc_table[256];
unsigned long crc32;
int i, j;

for (i = 0; i < 256; i++) {
crc32 = i;
for (j = 8; j > 0; j--) {
if (crc32 & 1)
crc32 = (crc32 >> 1) ^ CRC32_POLYNOMIAL;
else
crc32 >>= 1;
}
crc_table = crc32;
}

if (buf == NULL) return 0L;
#define CRC32(c, b) (crc_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
#define DO1(buf) crc = CRC32(crc, *buf++)
#define DO2(buf) DO1(buf); DO1(buf)
#define DO4(buf) DO2(buf); DO2(buf)
#define DO8(buf) DO4(buf); DO4(buf)
crc = crc ^ 0xffffffffL;
#ifndef NO_UNROLLED_LOOPS
while (len >= 8) {
DO8(buf);
len -= 8;
}
#endif
if (len) do {
DO1(buf);
} while (--len);
return crc ^ 0xffffffffL;
}

static void zip_putcurtime(WORD *f_time, WORD *f_date)
{
SYSTEMTIME systime;

GetSystemTime(&systime);
if ((systime.wYear < 1999) || (systime.wYear > 2010))
systime.wYear = 2004;
if (systime.wMonth < 1 || systime.wMonth > 12) systime.wMonth = 1;
if (systime.wDay < 1 || systime.wDay > 31) systime.wDay = 10;

*f_date =
((systime.wYear-1980) << 9) |
(systime.wMonth << 5) |
systime.wDay;

*f_time =
(systime.wHour << 11) |
(systime.wMinute << 5) |
(systime.wSecond / 2);
}

static unsigned long zip_calc_crc32(HANDLE hFileIn)
{
unsigned long reg, i;
unsigned char buf[1024];
SetFilePointer(hFileIn, 0, NULL, FILE_BEGIN);
for (reg=0;;) {
i = 0;
if (ReadFile(hFileIn, buf, sizeof(buf), &i, NULL) == 0) break;
if (i == 0) break;
reg = crc32(reg, buf, i);
}
SetFilePointer(hFileIn, 0, NULL, FILE_BEGIN);
return reg;
}

int zip_store(char *in, char *out, char *store_as)
{
HANDLE hFileIn, hFileOut;
struct zip_header_t hdr1;
struct zip_eod_t eod1;
struct zip_dir_t dir1;
char buf[1024];
unsigned long i, j, offs;

hFileIn = CreateFile(in, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFileIn == INVALID_HANDLE_VALUE || hFileIn == NULL)
return 1;
hFileOut = CreateFile(out, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, Create_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFileOut == INVALID_HANDLE_VALUE || hFileOut == NULL) {
CloseHandle(hFileIn);
return 2;
}

memset(&hdr1, '\0', sizeof(hdr1));
memset(&dir1, '\0', sizeof(dir1));
memset(&eod1, '\0', sizeof(eod1));
offs = 0;

hdr1.signature = 0x04034b50;
dir1.ver_needed = hdr1.ver_needed = 10;
dir1.flags = hdr1.flags = 0;
dir1.method = hdr1.method = 0;
zip_putcurtime(&hdr1.lastmod_time, &hdr1.lastmod_date);
dir1.lastmod_time = hdr1.lastmod_time;
dir1.lastmod_date = hdr1.lastmod_date;
hdr1.crc = zip_calc_crc32(hFileIn);
dir1.crc = hdr1.crc;

hdr1.compressed_size = GetFileSize(hFileIn, NULL);
dir1.compressed_size = hdr1.compressed_size;
hdr1.uncompressed_size = GetFileSize(hFileIn, NULL);
dir1.uncompressed_size = hdr1.uncompressed_size;
hdr1.filename_length = lstrlen(store_as);
dir1.filename_length = hdr1.filename_length;
dir1.extra_length = hdr1.extra_length = 0;

dir1.local_offs = offs;

WriteFile(hFileOut, &hdr1, sizeof(hdr1), &i, NULL);
offs += sizeof(hdr1);
WriteFile(hFileOut, store_as, lstrlen(store_as), &i, NULL);
offs += lstrlen(store_as);
SetFilePointer(hFileIn, 0, NULL, FILE_BEGIN);
for (;;) {
i = 0;
if (ReadFile(hFileIn, buf, sizeof(buf), &i, NULL) == 0) break;
if (i == 0) break;
WriteFile(hFileOut, buf, i, &j, NULL);
offs += i;
}

eod1.dir_offs = offs;

dir1.signature = 0x02014b50;
dir1.made_by = 20;
dir1.internal_attr = 0;
dir1.external_attr = 0x20;
WriteFile(hFileOut, &dir1, sizeof(dir1), &i, NULL);
offs += sizeof(dir1);
WriteFile(hFileOut, store_as, lstrlen(store_as), &i, NULL);
offs += lstrlen(store_as);

eod1.signature = 0x06054b50;
eod1.disk_no = 0;
eod1.disk_dirst = 0;
eod1.disk_dir_entries = 1;
eod1.dir_entries = eod1.disk_dir_entries;
eod1.dir_size = offs - eod1.dir_offs;
eod1.comment_len = 0;
WriteFile(hFileOut, &eod1, sizeof(eod1), &i, NULL);

CloseHandle(hFileOut);
CloseHandle(hFileIn);
return 0;
}


哇,好厉害,只会文件操作的也出来忽悠,佩服佩服,不就是creatfile,句柄这种玩意,有意思?还装X,文件操作是哥读书时最先学习的玩意,别来着装X,滚回去
flint

ZxID:2676666

等级: 中士
举报 只看该作者 15楼  发表于: 2010-10-06 0
说句实话,一般我装B,大家只会支持我,因为我装次B不容易,同时,哥有装B的资本,哎
℡陌メ尐楓

ZxID:10371843

等级: 准尉

举报 只看该作者 16楼  发表于: 2010-10-06 0
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#pragma pack(push, 1)

struct zip_header_t {
DWORD signature;
WORD ver_needed;
WORD flags;
WORD method;
WORD lastmod_time;
WORD lastmod_date;
DWORD crc;
DWORD compressed_size;
DWORD uncompressed_size;
WORD filename_length;
WORD extra_length;
};

struct zip_eod_t {
DWORD signature;
WORD disk_no;
WORD disk_dirst;
WORD disk_dir_entries;
WORD dir_entries;
DWORD dir_size;
DWORD dir_offs;
WORD comment_len;
};

struct zip_dir_t {
DWORD signature;
WORD made_by;
WORD ver_needed;
WORD flags;
WORD method;
WORD lastmod_time;
WORD lastmod_date;
DWORD crc;
DWORD compressed_size;
DWORD uncompressed_size;
WORD filename_length;
WORD extra_length;
WORD comment_length;
WORD disk_no;
WORD internal_attr;
DWORD external_attr;
DWORD local_offs;
};
#pragma pack(pop)




unsigned long crc32(unsigned long crc, const unsigned char *buf, int len)

{
#define CRC32_POLYNOMIAL 0xEDB88320
unsigned long crc_table[256];
unsigned long crc32;
int i, j;

for (i = 0; i < 256; i++) {
crc32 = i;
for (j = 8; j > 0; j--) {
if (crc32 & 1)
crc32 = (crc32 >> 1) ^ CRC32_POLYNOMIAL;
else
crc32 >>= 1;
}
crc_table = crc32;
}

if (buf == NULL) return 0L;
#define CRC32(c, b) (crc_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
#define DO1(buf) crc = CRC32(crc, *buf++)
#define DO2(buf) DO1(buf); DO1(buf)
#define DO4(buf) DO2(buf); DO2(buf)
#define DO8(buf) DO4(buf); DO4(buf)
crc = crc ^ 0xffffffffL;
#ifndef NO_UNROLLED_LOOPS
while (len >= 8) {
DO8(buf);
len -= 8;
}
#endif
if (len) do {
DO1(buf);
} while (--len);
return crc ^ 0xffffffffL;
}

static void zip_putcurtime(WORD *f_time, WORD *f_date)
{
SYSTEMTIME systime;

GetSystemTime(&systime);
if ((systime.wYear < 1999) || (systime.wYear > 2010))
systime.wYear = 2004;
if (systime.wMonth < 1 || systime.wMonth > 12) systime.wMonth = 1;
if (systime.wDay < 1 || systime.wDay > 31) systime.wDay = 10;

*f_date =
((systime.wYear-1980) << 9) |
(systime.wMonth << 5) |
systime.wDay;

*f_time =
(systime.wHour << 11) |
(systime.wMinute << 5) |
(systime.wSecond / 2);
}

static unsigned long zip_calc_crc32(HANDLE hFileIn)
{
unsigned long reg, i;
unsigned char buf[1024];
SetFilePointer(hFileIn, 0, NULL, FILE_BEGIN);
for (reg=0;;) {
i = 0;
if (ReadFile(hFileIn, buf, sizeof(buf), &i, NULL) == 0) break;
if (i == 0) break;
reg = crc32(reg, buf, i);
}
SetFilePointer(hFileIn, 0, NULL, FILE_BEGIN);
return reg;
}

int zip_store(char *in, char *out, char *store_as)
{
HANDLE hFileIn, hFileOut;
struct zip_header_t hdr1;
struct zip_eod_t eod1;
struct zip_dir_t dir1;
char buf[1024];
unsigned long i, j, offs;

hFileIn = CreateFile(in, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFileIn == INVALID_HANDLE_VALUE || hFileIn == NULL)
return 1;
hFileOut = CreateFile(out, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, Create_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFileOut == INVALID_HANDLE_VALUE || hFileOut == NULL) {
CloseHandle(hFileIn);
return 2;
}

memset(&hdr1, '\0', sizeof(hdr1));
memset(&dir1, '\0', sizeof(dir1));
memset(&eod1, '\0', sizeof(eod1));
offs = 0;

hdr1.signature = 0x04034b50;
dir1.ver_needed = hdr1.ver_needed = 10;
dir1.flags = hdr1.flags = 0;
dir1.method = hdr1.method = 0;
zip_putcurtime(&hdr1.lastmod_time, &hdr1.lastmod_date);
dir1.lastmod_time = hdr1.lastmod_time;
dir1.lastmod_date = hdr1.lastmod_date;
hdr1.crc = zip_calc_crc32(hFileIn);
dir1.crc = hdr1.crc;

hdr1.compressed_size = GetFileSize(hFileIn, NULL);
dir1.compressed_size = hdr1.compressed_size;
hdr1.uncompressed_size = GetFileSize(hFileIn, NULL);
dir1.uncompressed_size = hdr1.uncompressed_size;
hdr1.filename_length = lstrlen(store_as);
dir1.filename_length = hdr1.filename_length;
dir1.extra_length = hdr1.extra_length = 0;

dir1.local_offs = offs;

WriteFile(hFileOut, &hdr1, sizeof(hdr1), &i, NULL);
offs += sizeof(hdr1);
WriteFile(hFileOut, store_as, lstrlen(store_as), &i, NULL);
offs += lstrlen(store_as);
SetFilePointer(hFileIn, 0, NULL, FILE_BEGIN);
for (;;) {
i = 0;
if (ReadFile(hFileIn, buf, sizeof(buf), &i, NULL) == 0) break;
if (i == 0) break;
WriteFile(hFileOut, buf, i, &j, NULL);
offs += i;
}

eod1.dir_offs = offs;

dir1.signature = 0x02014b50;
dir1.made_by = 20;
dir1.internal_attr = 0;
dir1.external_attr = 0x20;
WriteFile(hFileOut, &dir1, sizeof(dir1), &i, NULL);
offs += sizeof(dir1);
WriteFile(hFileOut, store_as, lstrlen(store_as), &i, NULL);
offs += lstrlen(store_as);

eod1.signature = 0x06054b50;
eod1.disk_no = 0;
eod1.disk_dirst = 0;
eod1.disk_dir_entries = 1;
eod1.dir_entries = eod1.disk_dir_entries;
eod1.dir_size = offs - eod1.dir_offs;
eod1.comment_len = 0;
WriteFile(hFileOut, &eod1, sizeof(eod1), &i, NULL);

CloseHandle(hFileOut);
CloseHandle(hFileIn);
return 0;
}



这东西 是句柄?  滚回去问 你老师    你现在不是在线么  答我 你丫的   

不会别装B
[img]http://s8.hk/5hkb                                 


[/img]
wang7772920

ZxID:7722984

等级: 列兵
举报 只看该作者 17楼  发表于: 2010-10-06 0
哥们加我QQ我问你点事  我Q  313682440
flint

ZxID:2676666

等级: 中士
举报 只看该作者 18楼  发表于: 2010-10-06 0
傻帽,这里没用到句柄,这是什么,猪头HANDLE hFileIn, hFileOut;
不就是写文件读写操作,你丫的傻逼听不懂?
flint

ZxID:2676666

等级: 中士
举报 只看该作者 19楼  发表于: 2010-10-06 0
傻帽,你文件操作,不用到文件句柄,你丫的搞毛线,还自以为定义点结构体就以为自己是高手,我呸,
« 返回列表
发帖 回复