存档

作者存档

匮乏

2009年4月26日

博客虽然是上线了,可是突然觉得知识太匮乏,对汇编,对系统,对系统底层的东西没有深入的理解,所以现在觉得自己必须要认真的去看书,去学习,完善自己,从就业来看,windows底层编程设计的人总是更加抢手。认真钻研了,从现在开始。
过程是枯燥、孤单的,我要走到最后!!!

作者: feeloc 分类: 生活随感 标签:

windows xp KB959426更新导致OD调试出错!!

2009年4月19日

今天早上更新了4月13号发布的漏洞补丁KB959426,也没有认真去看漏洞的描述,在中午想调试软件的时候,发现OD出现错误:
32位可执行文件’c:\WINDOWS\system32\kernel32.dll’的格式错误或格式未知
开始还以为是程序本身的原因,但试了才知道每个调用系统DLL的软件全部出现这个错误,觉得肯定是系统的原因,联想到早上装的更新,觉得可能是补丁的原因,将早上的漏洞一个个卸载掉,发现就是KB959426这个补丁的原因。

描述:此安全更新解决了 Windows SearchPath 功能中一个公开披露的漏洞,如果用户下载了特制文件到特定位置,然后打开在某些情况下可能加载该文件的应用程序,则该漏洞可能允许特权提升。

这个补丁会影响到OD这样运行在R3级的调试软件的运行。

作者: feeloc 分类: 系统研究 标签:

filebus.exe注册初探

2009年4月17日

昨天朋友给了一个软件,FileBus,听说进行了很多代码优化,传输文件速度很快,但未注册传输文件的最大只有20M,那就研究研究它的注册流程,试用试用它,在此和大家交流交流,破解过程只供学习之用,如有大家的确需要,请购买正版,支持国产软件的发展嘛。
先打开软件,点注册窗口,随便输入信息,这里输入注册名:feeloc注册码:123456789。点注册按钮,提示注册失败。PEID查壳,无壳,直接OD载入,下MessageBoxA断点,直接F9运行,将上述注册信息输入注册窗口,点注册按钮,OD断下,取消断点,ALT+F9,返回,向上找到按钮事件头。00408A9A处下断,重新载入,直接F9运行,输入注册信息,确定后,断在我们下的断点位置。直接F4到达00408B0B,

1
2
3
4
5
00408B01  |.  8945 88       MOV DWORD PTR SS:[EBP-78],EAX
00408B04  |.  C745 FC FFFFF>MOV DWORD PTR SS:[EBP-4],-1
00408B0B  |.  E8 CEFAFFFF   CALL FileBus1.004085DE                   ;  进
00408B10  |.  83C4 08       ADD ESP,8
00408B13  |.  8845 84       MOV BYTE PTR SS:[EBP-7C],AL

进CALL,F8单步走,单步走到达00408676,关键CALL,我看了一下,比较注册名的,继续向下到达0040867D,改标志位,不跳,单步向下,到达004086BD又是关键CALL,这里我就不跟进去了,直接向下,在004086C5处NOP,直接向下走,单步走,第一个CALL过后,正确注册码入栈了,说明这个CALL是正确注册码的产生流程,我电脑没电了,也就不跟进去了。在此公布三组注册码,大家可以试试。

1
2
3
4
5
004028B6  |.  50            PUSH EAX                                 ;  FileBus1.00469C30
004028B7  |.  8B4D 08       MOV ECX,DWORD PTR SS:[EBP+8]
004028BA  |.  E8 11000000   CALL FileBus1.004028D0                   ;  关键,注册名检验
004028BF  |.  F7D8          NEG EAX
004028C1  |.  1BC0          SBB EAX,EAX

filebus 3.0注册码:
feeloc zx8TBV10Y2u5MIE
feeloc1 XYis9oJIrK0p0j2
feeloc3 wx26FgBAjC2r0l4

作者: feeloc 分类: 破解 标签:

破穿山甲(Armadillo 3.XX-4.XX)

2009年4月14日

上次介绍了Armadillo的四种保护选项,对四种保护选项有了了解之后就可以破解了。破解Armadillo的基本方法分为六步:
1、到达OEP(脚本来完成)
需要记录:入口的头2字节
OEP的头2字节
OEP=
PID=
在找OEP之前我们需要对程序使用了哪几个保护选项有个了解,可以用Armadillo find protected 1.3.exe来查它使用了哪几个保护选项,
下面公布一个很好用的Armadillo的脱壳脚本,这个脚本还是很强大的可以很方便的到达OEP,可以为我们省去很多事,将以下代码保存为txt格式就可以在OD中采用脚本方式脱了:

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
//////////////////////////
// To declare vars
/////////////////////////
 
var WaitForDebugEvent
var WriteProcessMemory
var pDebugEvent
var pBuffer
var child_ProcID
var oep_offset1
var oep_offset2
var oep_offset3
var crypto_proc
var child_OEP
var patched_line1
var imgbase
var rdata_begin
var text_begin
var text_patch
var tb_report1
var tb_report2
var tb_report3
var tb_report4
var tb_report5
var tb_report6
var addr_1000
var buffer_1000
var temp
var temp1
 
//////////////////////////////////////
// Find rdata_begin or (data_begin)
/////////////////////////////////////
 
gmi eip,MODULEBASE
mov imgbase, $RESULT
mov rdata_begin, imgbase
find rdata_begin, #4441544100#  //find "DATA" string
cmp $RESULT,0
jne lbcontinue
 
find rdata_begin, #2E726461746100#  //find ".rdata" string
cmp $RESULT,0
jne lbcontinue
 
find rdata_begin, #2E6461746100#  //find ".data" string
cmp $RESULT,0
jne lbcontinue
jmp no_run_script
lbcontinue:
mov rdata_begin, $RESULT
add rdata_begin, 0c
mov rdata_begin, [rdata_begin]
add rdata_begin, imgbase
log rdata_begin
 
/////////////////////////////////
// Find text_begin
////////////////////////////////
 
gmi eip,MODULEBASE
mov imgbase, $RESULT
mov text_begin, imgbase
find text_begin, #434F444500#  //find "CODE" string
cmp $RESULT,0
jne lbcontinue2
 
find text_begin, #2E7465787400#  //find ".text" string
cmp $RESULT,0
jne lbcontinue2
jmp no_run_script
 
lbcontinue2:
 
mov text_begin, $RESULT
add text_begin, 0c
mov text_begin, [text_begin]
add text_begin, imgbase
log text_begin
 
/////////////////////////////////////////////////////
//eob found_WaitForDebugEvent WriteProcessMemory
////////////////////////////////////////////////////
 
gpa "WaitForDebugEvent", "kernel32.dll"
mov WaitForDebugEvent, $RESULT
gpa "WriteProcessMemory", "kernel32.dll"
mov WriteProcessMemory, $RESULT
 
///////////////////////////////////////
//Armadillo check bp first 5 bytes so:
///////////////////////////////////////
 
add WriteProcessMemory,5
bp WriteProcessMemory
run
bc WriteProcessMemory
sub WriteProcessMemory,5
 
//////////////////////////////////////////////
//Get infomation at bp Call WaitForDebugEvent
/////////////////////////////////////////////
 
bp WaitForDebugEvent
run
bc WaitForDebugEvent
 
mov pDebugEvent, esp
add pDebugEvent, 04
mov pDebugEvent, [pDebugEvent]
log pDebugEvent
 
mov oep_offset1, pDebugEvent
add oep_offset1, 18
mov oep_offset2, pDebugEvent
add oep_offset2, 24
mov oep_offset3, pDebugEvent
add oep_offset3, 28
 
////////////////////////////////////////
// Find Child_ProcID and child_OEP
///////////////////////////////////////
 
bp WriteProcessMemory
run
bc WriteProcessMemory
 
mov child_ProcID, pDebugEvent
add child_ProcID, 4
mov child_ProcID, [child_ProcID]
mov child_OEP, [oep_offset1]
 
///////////////////////////////////
//Save info Table report
///////////////////////////////////
 
mov tb_report1,[pDebugEvent]
 
mov tb_report2,pDebugEvent
add tb_report2,4
mov tb_report2,[tb_report2]
 
mov tb_report3,pDebugEvent
add tb_report3,8
mov tb_report3,[tb_report3]
 
mov tb_report4,pDebugEvent
add tb_report4,C
mov tb_report4,[tb_report4]
 
mov tb_report5,pDebugEvent
add tb_report5,10
mov tb_report5,[tb_report5]
 
mov tb_report6,pDebugEvent
add tb_report6,14
mov tb_report6,[tb_report6]
 
////////////////////////////////////////////////////
//Get info in stack at bp Call WriteProcessMemory
///////////////////////////////////////////////////
 
mov addr_1000,esp
add addr_1000,8
mov addr_1000,[addr_1000]
log addr_1000
 
mov buffer_1000,esp
add buffer_1000,C
mov buffer_1000,[buffer_1000]
log buffer_1000
 
/////////////////////////////////
//Patch OEP of Son to EBFE
/////////////////////////////////
 
mov temp,child_OEP
sub temp,addr_1000
add temp,buffer_1000
mov temp1,[temp]
 
and temp1,FFFF
eval "Bytes patched at OEP of Son (to invert the bytes order)  : {temp1}"
msg $RESULT
log $RESULT
 
fill temp,1,eb
add temp,1
fill temp,1,fe
 
///////////////////////////
// FIND ENCRYPTOR
///////////////////////////
 
mov crypto_proc, esp
add crypto_proc, 128
mov crypto_proc, [crypto_proc]
add crypto_proc, 2d0
mov [crypto_proc], #9090909090#
rtr	//ctrl-f9
sto	//f8
 
///////////////////////
//Log info to win log
//////////////////////
 
log "crypto_proc was nopped..."
log "patched OEP of child process to EBFE"
log child_ProcID
log child_OEP
 
log "press script/resume when ready"
eval "Patched successful OEP={child_OEP} of child process (PID= {child_ProcID}) to EBFE !!!!.More Info in Window Log.Press button OK to continues!"
msg $RESULT
 
////////////////////////////////////////////////////////////////
//Patch jump to section .text and NOPs call WaitForDebugEvent
///////////////////////////////////////////////////////////////
 
bp WaitForDebugEvent
run
bc WaitForDebugEvent
 
mov patched_line1, [esp]
sub patched_line1, 12
 
fill patched_line1, 12, 90
add patched_line1,14
 
eval "jmp {text_begin}"
asm patched_line1,$RESULT
 
add patched_line1,5
eval "NOP"
asm patched_line1,$RESULT 
 
//////////////////////////////////////
//Patch in section .text (or CODE)
//////////////////////////////////////
 
mov text_patch, text_begin
 
eval "add dword [{oep_offset1}],1000"
asm text_patch,$RESULT
 
add text_patch,A
eval "add dword [{oep_offset2}],1000"
asm text_patch,$RESULT
 
add text_patch,A
eval "add dword [{oep_offset3}],1000"
asm text_patch,$RESULT
 
add text_patch,A
eval "cmp dword [{oep_offset3}],{rdata_begin}"
asm text_patch,$RESULT
 
add text_patch,A
eval "jnz {patched_line1}"
asm text_patch,$RESULT
 
add text_patch,6
eval "push {child_ProcID}"
asm text_patch,$RESULT
 
add text_patch,5
eval "CALL DebugActiveProcessStop"
asm text_patch,$RESULT
 
add text_patch,5
eval "NOP"
asm text_patch,$RESULT
 
//////////////////////////////
//Patch in Table report at :
//////////////////////////////
 
sub text_begin,1000
mov [oep_offset1], text_begin
mov [oep_offset2], text_begin
mov [oep_offset3], text_begin
 
//////////////////////////////////
//go [esp](New origin here)
///////////////////////////////////
mov eip, [esp]
 
//////////////////////////
// Set bp F2 at
/////////////////////////
 
bp text_patch
run
bc text_patch
 
msg "Successful!.Close OllyDbg, execute again and attach to your newely created process.More Info in Window Log. Have fun."
jmp theend
 
//////////////////////////////////
no_run_script:
msg "This srcipt don't run with this file. Plz Close Olly.Sorry!"
 
///////////////////////////////
theend:
ret

记录了以上数据之后就可以在OD中附加PID数据了,将新的头字节还原成程序的原OEP的头两个字节,下面就可以进入第三步了。

2、找、处理IAT
在OD中,ctrl+B查找FF 25,就可以找到程序的IAT了,然后就进入到处理IAT了,再打开一个OD
3、Code Splicing处理
4、挪动IAT
5、Nanomites处理
6、可能还有校验需要处理

作者: feeloc 分类: 破解 标签: ,

wordpress代码高亮插件优化

2009年4月13日

昨天发布代码的时候就发现显示总是会出错,还会使页面错乱,下了几种插件,在这个主题下都无法使用,出现错误,也不想去看代码了,最后选择了wp-syntax[1].0.9.3,下载地址:

    http://downloads.wordpress.org/plugin/wp-syntax.0.9.3.zip

使用方法:

所要显示的代码

支持代码种类:
abap, actionscript, ada, apache, applescript, asm, asp, autoit, bash, blitzbasic, bnf, c, c_mac, caddcl, cadlisp, cfdg, cfm, cpp-qt, cpp, csharp, css, d, delphi, diff, div, dos, dot, eiffel, fortran, freebasic, genero, gml, groovy, haskell, html4strict, idl, ini, inno, io, java, java5, javascript, latex, lisp, lua, m68k, matlab, mirc, mpasm, mysql, nsis, objc, ocaml-brief, ocaml, oobas, oracle8, pascal, per, perl, php-brief, php, plsql, python, qbasic, rails, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, vb, vbnet, vhdl, visualfoxpro, winbatch, xml, xpp, z80

但随即又出现了问题,不支持代码自动换行,最后终于找到了解决办法,修改所用主题的CSS文件,添加:

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
.wp_syntax {
  color: #100;
  background-color: #f9f9f9;
  border: 1px solid silver;
  margin: 0 0 1.5em 0;
  overflow: auto;
}
 
/* IE FIX */
.wp_syntax {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: expression(this.scrollWidth > this.offsetWidth ? 15 : 0);
}
 
.wp_syntax table {
  table-layout:fixed;
  overflow:hidden;
  text-overflow:ellipsis;
  WORD-BREAK: break-all;
  WORD-WRAP: break-word;
  border-collapse: collapse;
}
 
.wp_syntax div, .wp_syntax td {
  vertical-align: top;
  padding: 2px 4px;
}
 
.wp_syntax .line_numbers {
  text-align: right;
  background-color: #def;
  width:30px;
  color: gray;
  overflow: visible;
  font-family: 'Lucida Grande',
  'Trebuchet MS', Verdana, Helvetica, Arial, sans-serif;
}
 
/* potential overrides for other styles */
.wp_syntax pre {
  margin: 0;
  width: fixed;
  float: none;
  clear: none;
  WORD-BREAK: break-all;
  WORD-WRAP: break-word;
  overflow: visible;
  font-size:8pt;
  font-family: Courier New;
}
作者: feeloc 分类: 建站 标签: ,

wordpress显示文章摘要的方法

2009年4月12日

wordpress的很多主题,在主页中都无法显示文章摘要,虽然有很多插件可以完成这一功能,但没有下面这个方法使用方便。其实问题就是出现在

1
<?php the_content(); ?>

这行代码中。根据自己所用的主题,找到home.php,如果没有就找到index.php,找到

1
<?php the_content(); ?>

这句代码,将其修改为:

1
2
3
4
5
6
7
8
9
10
11
12
<?php if(is_category() || is_archive() || is_home() )
{
    the_excerpt();
}
else
{
    the_content('Read the rest of this entry &raquo;');
} ?>
<div class="details">
<div class="inside">
<?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> so far | <a href="<?php the_permalink() ?>">Read On &raquo;</a></div>
</div>

如果自己的主题没有category或者archive页面,可根据实际情况修改。
这样使各个页面都以文章摘要的形式输出,不仅使自己页面看上去整洁,也有利于搜索引擎人优化。

作者: feeloc 分类: 建站 标签: ,

Armadillo 1.XX-2.XX

2009年4月11日

Armadillo protect 一共有四种保护选项,如果四种保护选项都使用的话,它的保护强度是很大的。很多软件都使用了四种中的三项,保护强度只是弱了那么一点点,所以对于Armadillo的破解是比较复杂的,下面我们来看看这四种保护保护选项:

1、Nanomites Processing
The Nanomites provide additional protection against memory-dumping for your programs. They will protect your program even if it is somehow stripped out of the SoftwarePassport/Armadillo shell. If your program can use the Debugger-Blocker or CopyMem-II, it should be able to use Nanomites as well. Besides enabling this option, you must mark sections within your program where Nanomites are permitted to reside and won’t cause any speed problems, and use a custom build of the Armadillo engine. This option can only be used with the Debugger-Blocker or CopyMem-II protections.
Nanomites Processing就是通常所谓的CC,Armadillo最让人头痛的保护措施。

2、Import Table Elimination
Import Table Elimination is another anti-dumping defense. It removes the import table of the program, making it much more difficult to reconstruct the unprotected program file. Unlike CopyMem-II and the Nanomites, this defense does not require the Debugger-Blocker, but it is only available in custom builds.
Import Table Elimination一般是把输入表放在壳申请的内存处并且乱序处理。
对于输入表乱序,以前有两种解法:①、写代码重新排序;②、直接用ImportRec“创建新的IAT”功能来构造新的输入表。

3、Code Splicing
Strategic Code Splicing is another anti-dumping defense. It removes portions of your code and places them randomly in memory, changing them so that they still operate the same but are coded differently. Unlike CopyMem-II and the Nanomites, this defense does not require the Debugger-Blocker, but it is only available in custom builds.
Code Splicing通常称为远程地址,Armadillo会把程序中的部分代码挪移到壳申请的内存段运行,普通dump会导致此部分代码丢失。以前有两种解法:①、修改VirtualAlloc返回地址,使其把挪移的代码放到无用的壳区段;②、Dmp后补上那个包含挪移代码的壳申请的内存段。

4、Memory-Patching Protections
He Memory-Patching Protections prevent an attacker from using a loader to change your program’s code in memory, once it’s loaded. If you handle any part of the expiration logic in your program’s code, or use environment variables to control features that are only allowed in the paid-for version, then your program might be vulnerable to a memory-patching attack.
If you use this option, you MUST use either CopyMem-II or the monitoring thread (or both), or it won’t be able to do anything.
The only time this option can cause a problem is if your program uses self-modifying code — this option would consider that an attack, and would deliberately crash your program to stop it.
内存校验。

作者: feeloc 分类: 破解 标签: ,

关于破解的一点感想

2009年4月11日

学习破解已经有几个月了,以前的步骤总是脱壳之后先试注册,根据所给的提示,在OD中查找字符串,然后再向上或向下找关键CALL或者是关键JUMP,从而实现爆破或者是跟踪算法。
其实破解的一个关键步骤就是找按钮事件,所以就下好各类断点,当按钮事件被触发中断后,返回代码,找到事件头,下好断点,重新加载后,F9运行,断下后就可以向下分析代码,找到关键CALL或者关键JUMP,从而实现破解。
总结各类断点真的很重要,这就要求我们在平时的学习中要关注遇到的断点的作用,在破解的时候使用它,现在的OD插件对各种断点总结的还是很全的,省去了我们去记那些很长的断点的时间,还是很方便的,所以说用好断点,常常会达到事半功倍的效果。

作者: feeloc 分类: 汇编 标签:

feeloc的个人网站开业了啊!!!

2009年4月10日

个人网站正式上线,点点滴滴将记录于此,同志们要多多支持啊!!!!
经过好几天的准备,我的网站终于上线了,其实在此我要感谢NEEKE,是他让我有决心创建这个网站,将今后生活,学习,工作中的点点滴滴记录在此。在此十分感谢他,学习的路很长、很艰辛,我会将我心得体会与大家分享,希望能对大家有所帮助,同时也是对自己成长足迹的记录。

作者: feeloc 分类: 生活随感 标签: