|
|
|
Acprotect v1.41奇幻旅程(终结篇)
奇幻之旅终于完成了,辛苦辛苦 |
|
ACprotect v1.41奇幻旅程
前两天,偶也看了一个ACProtect 的EMBEDD protect。分段解密并加密。 调用 pusha push 5 push 0 push 0 push 0FFFFFFFFh call MessageBoxA popa 开始解密 如果传参数 4,就会对解密代码进行加密。 EMBEDD protect 一般在 popad后就是原程序的代码。好在代码没做什么改动,直接Dump出来就能用 |
|
|
|
|
|
Shaping Regions源代码
上一个代码用了棋盘标记,在数据很多的情况下,慢的要死。今天程序写了一个,方法就是切割矩形,我的做法是将一个矩形切割出成不多于四个小矩形。切割矩形真的好麻烦-__-||想了一白天才想出这种切割方法,可能还不是最快的方法。 ┌─┬─┬─┐ │ │上│ │ │ ├─┤ │ │左│ │右│ │ ├─┤ │ │ │下│ │ └─┴─┴─┘ /* ShapingRegions2.cpp ID: Zmworm[CCG] PROG: rect1 LANG: C++ */ #include "stdafx.h" #include <fstream> #define MAX_COORD 10000 #define MAX_N 1000 #define MAX_COLOR MAX_N + 2 #define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) typedef struct tagMatrix { int llx, lly, urx, ury, color; } Matrix, *pMatrix; //一个矩形结构 Matrix BackRect ;//白纸信息 int RectDepth;//矩形的深度,为矩形总数量减一 static unsigned int ColorInfo[MAX_COLOR]; //序号为颜色类型,第二项为该颜色的数量 Matrix RectInfo[MAX_N] ; //保存从文件中读取的所有矩形信息 int init(); int DivRect(int nLayer, pMatrix matrix, int size); int main() { if (0 == init()) //读取元素,并进行检查 return 1; int i,j,k,temp; ColorInfo[1] = BackRect.urx * BackRect.ury; //开始全是白色 for(i=0;i <= RectDepth;i++)//切割矩形 { DivRect(i,&RectInfo[i],1); } //输出结果 std::ofstream fout("rect1.out"); for(i = 0;i < MAX_COLOR;++i) if( ColorInfo[i] != 0) fout << i << " " << ColorInfo[i]<< "\n"; fout.close(); return 0; } int init() { std::ifstream fin("rect1.in"); if(fin.fail()) return -1; int i = 0; fin >> BackRect.urx >> BackRect.ury >> RectDepth; if (BackRect.urx > MAX_COORD || BackRect.ury > MAX_COORD || 0 == BackRect.ury || 0 == BackRect.ury) return -1; //检查白纸是否合法 RectDepth -= 1;//深度为矩形数量减一,因为深度是从0开始的 Matrix eTemp; while(!fin.eof() && i <= RectDepth) { fin >> eTemp.llx >> eTemp.lly >> eTemp.urx >> eTemp.ury >> eTemp.color; if(eTemp.llx < eTemp.urx && eTemp.lly < eTemp.ury && eTemp.urx <= BackRect.urx && eTemp.ury <= BackRect.ury && eTemp.color < MAX_COLOR) RectInfo[i] =eTemp;//如果矩形数据合法,则加入这条信息 ++i; } fin.close(); return 1; } int DivRect(int nLayer, pMatrix matrix, int size) { int i,nAcreage; if( RectDepth == nLayer) {//如果到了最后一层,就输出结果 for(i = 0;i<size;++i) { nAcreage = (matrix[i].urx - matrix[i].llx) * (matrix[i].ury - matrix[i].lly); ColorInfo[matrix->color] += nAcreage;//增加该区域颜色 ColorInfo[1] -= nAcreage;//从白色区域中去除 } return 1; } for(i = 0; i<size; ++i) { int ax =matrix[i].llx;//要切割的矩形 int ay =matrix[i].lly; int bx =matrix[i].urx; int by =matrix[i].ury; int Ax =RectInfo[nLayer+1].llx;//下一层的矩形 int Ay =RectInfo[nLayer+1].lly; int Bx =RectInfo[nLayer+1].urx; int By =RectInfo[nLayer+1].ury; if (bx < Ax || ax > Bx || by <Ay || ay > By) {//两矩形没有相交 DivRect(nLayer+1,matrix+i,1); } else {//处理两矩形相交时的情况,就是把矩形分成四部分 pMatrix pDivRect1 = new Matrix[4]; int j = 0; if (by > By)//上区 { pDivRect1[j].color = matrix[0].color; pDivRect1[j].llx = max(ax,Ax); pDivRect1[j].lly = By; pDivRect1[j].urx = min(bx,Bx); pDivRect1[j].ury = by; ++j; } if(Ay > ay)//下区 { pDivRect1[j].color = matrix[0].color; pDivRect1[j].llx = max(ax,Ax); pDivRect1[j].lly = ay; pDivRect1[j].urx = min(bx,Bx); pDivRect1[j].ury = Ay; ++j; } if(ax < Ax)//左区 { pDivRect1[j].color = matrix[0].color; pDivRect1[j].llx = ax; pDivRect1[j].lly = ay; pDivRect1[j].urx = Ax; pDivRect1[j].ury = by; ++j; } if(Bx < bx)//右区 { pDivRect1[j].color = matrix[0].color; pDivRect1[j].llx = Bx; pDivRect1[j].lly = ay; pDivRect1[j].urx = bx; pDivRect1[j].ury = by; ++j; } if(j)//如果切割出矩形,则进入下一层 DivRect(nLayer+1,pDivRect1,j); delete pDivRect1; } } return 1; } |
|
Shaping Regions源代码
最初由 luocong 发布 还有这么一说? |
|
|
|
Shaping Regions源代码
花了一晚上的时间,我也写了一段代码,来凑凑热闹。用老罗给的例子测试,和他的结果一样,哈。不过我使用了个数组做白纸,挺吃内存的。另外输出的排序,直接使用了std(偷懒了)。程序用VC.net编译通过(用 VC6我想也应该没什么问题) 下面是C++代码 /* ShapingRegions.cpp ID: Zmworm[CCG] PROG: rect1 LANG: C++ */ #include "stdafx.h" #include <map> #include <vector> #include <fstream> #define MAX_SIZE 0x200 #define MAX_COORD MAX_SIZE * sizeof(int) * 8 //坐标最大值 16384 typedef struct tagMatrix { int llx, lly, urx, ury, color; } Matrix; //一个矩形结构 Matrix BackRect;//白纸信息 static unsigned int Coordinate [MAX_SIZE * MAX_COORD] ;//坐标数组 要浪费32M内存-__-|| std::map<int,int> ColorInfo; //第一项为颜色类型,第二项为该颜色的数量 std::vector<Matrix> RectInfo; //保存从文件中读取的所有矩形信息 int init(); unsigned int check(int x,int y); //非零表示这个点已经被覆盖过了 int main() { if (0 == init()) //读取元素,并进行检查 return -1; int i,j,k; i = (int)RectInfo.size() - 1; ColorInfo[1] = BackRect.urx * BackRect.ury; //开始全是白色 for(i ;i >= 0 ;--i) //倒序读取 for(j = RectInfo[i].llx;j < RectInfo[i].urx ; ++j) //遍历一个矩形元素的x点 for(k = RectInfo[i].lly;k < RectInfo[i].ury ;++k) //遍历一个矩形元素的y点 if(0 == check(j,k)) { ColorInfo[RectInfo[i].color] += 1; //如果该点没有占用,此颜色数目加1 ColorInfo[1] -=1; //背景色减一,如果为0也可以跳出循环,并输出结果。 }; //输出结果 std::ofstream fout("rect1.out"); std::map<int, int>::iterator it; for(it = ColorInfo.begin();it != ColorInfo.end();++it) if( it->second != 0) fout << it->first << " " << it->second << "\n"; fout.close(); return 1; } int init() { std::ifstream fin("rect1.in"); if(fin.fail()) return -1; int i = 0, count; fin >> BackRect.urx >> BackRect.ury >> count; if (BackRect.urx > MAX_COORD || BackRect.ury > MAX_COORD || 0 == BackRect.ury || 0 == BackRect.ury) return -1; //检查白纸是否合法 Matrix eTemp; while(!fin.eof() && i < count) { ++i; fin >> eTemp.llx >> eTemp.lly >> eTemp.urx >> eTemp.ury >> eTemp.color; if(eTemp.llx < eTemp.urx && eTemp.lly < eTemp.ury && eTemp.urx <= BackRect.urx && eTemp.ury <= BackRect.ury) RectInfo.push_back(eTemp);//如果矩形数据合法,则加入这条信息 } fin.close(); for (i =0;i< MAX_SIZE * MAX_COORD;++i) Coordinate [i] = 0;//初始化白纸数组 return 1; } unsigned int check(int x,int y) { int nResult; int i = (y * BackRect.urx +x) / 32 int j = (y * BackRect.urx +x) % 32); //坐标转成白纸数组中的位置 unsigned int uMark = 1; uMark = uMark << j; nResult = Coordinate[i] & uMark; //获得结果 Coordinate[i] |= uMark ;//标记该点已经覆盖 return nResult; } |
|
[圣诞贺礼]OllyDbg中文帮助文档
最初由 killl 发布 谢谢您提供这么多宝贵意见,如果有问题,您可以再提。我们会及时修正的 |
|
[圣诞贺礼]OllyDbg中文帮助文档
堆栈 应该是两个概念吧 堆是Heap 栈是Stack 两个东东是不一样的 |
|
[圣诞贺礼]OllyDbg中文帮助文档
最初由 killl 发布 知道了,谢谢,希望大家多多提出错误之处(*^___^*) |
|
关于智能软件?
没有~~~~~~~~ |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值