TA的每日心情 | 开心 2018-8-6 15:15 |
---|
签到天数: 10 天 [LV.3]偶尔看看II
|

楼主 |
发表于 2019-4-2 00:35:41
|
显示全部楼层
本帖最后由 wadu 于 2019-4-2 00:46 编辑 ! P) z. |2 n9 L- F# c
0 O) @# E3 O) M+ o# D# q
感觉如果只是为了把 HTML 提取到文件的话直接用 Cheat Engine 打补丁就好了,只是这个词典不释放内存,不知道是否有意的,滚动多了就崩溃退出了。3 x; j; \) E/ g$ V. U
7 I6 O) r6 h3 p. J
我自己在 Cheat Engine 用它的 Auto Assemble 工具直接用下面的代码就可以提取内容了,接下来用 AutoHotkey 模拟滚动就行了。只是程序会崩溃真是比较麻烦(再次强调是程序自己原本在没有任何修改时不断滚动就会崩溃),需要自己过一段时间检查看看程序是不是挂掉了,然后手动重新运行程序,还要手动查看最后一个提取文件中最后一个词条的单词,回到软件上搜索到该词条,重新开 Cheat Engine 打开进程,继续重复步骤。+ H6 j [+ S: R5 k2 q- A8 t4 b
" d3 Q; T# ^( O1 X6 v
这个附件 txt 重命名为 .CT 文件然后在 Cheat Engine 里点左上角的第二个文件夹按钮 Open a cheat table 打开这个 .CT 文件,然后在下方把列表的第一个 Auto Assemble script 前面的框打勾就可以使用 script 自动把 HTML 的内容保存到 C:\OALD9_Out\ 文件夹下了。9 P* K3 C+ O8 f* e7 j$ s4 _
* G R' R4 v( B2 N, }1 B3 D
1 ?# p9 ^1 y, {( D$ d& Y
- g, l2 Q, |6 [3 b- }1 X `$ D9 \) [5 d
4 T7 L' h. `0 i8 v/ i. @
6 m' l, H1 y3 Pdefine(FILE_APPEND_DATA,4)8 J" x$ k$ ]( x. i6 V. G$ w; \
define(OPEN_ALWAYS,4)
1 e/ ^% O5 c8 r _define(FILE_ATTRIBUTE_NORMAL,0x00000080)
6 I6 ?: C) V P: x1 ]. R6 z5 M" w* Bdefine(FILE_END,2)- s. L! ~6 |9 |& E) I0 a1 T6 O
- I8 e& o/ t5 E, F) G# _globalalloc(html_str, 4). N# N. F4 {$ ]7 M2 M8 {) U! o% ~
globalalloc(html_len, 4)$ U d& ]1 b" x- P4 [2 g- k9 V
globalalloc(html_cnt, 4)2 [# c: I% V5 s
globalalloc(file_bytes, 4): D8 S1 x7 Y! E( l
globalalloc(html_filedir, 255)6 G" g* X2 n" Z) n5 G+ u$ w m
globalalloc(html_filepath, 255)! a/ V" a) t3 h, w6 p1 s' B- F I: ]
globalalloc(html_pathnumaddr, 4)6 l' X1 K3 m4 W$ h
globalalloc(html_pathnumformat, 20)
4 Q0 e8 C9 Q( y1 U6 P
. b# o3 f5 \1 c n& `3 Bhtml_str:
3 ]( v& B3 [6 f% jdd 0
$ z( U6 C; d* b9 s8 e$ n+ L5 V3 D3 n, x
html_len:
! E. J( z2 U/ H0 I6 ndd 0
" V+ r; R5 {/ P9 `3 M; ~" ]4 `# B+ p; \- J; _9 c2 v
html_cnt:/ h2 S4 l) Y2 W# l
dd 0
/ Y9 p! U4 [5 ^6 O: `
3 Z9 v( w+ F8 h& rhtml_filedir:
D. g* y+ _) M/ Ydb 'C:\OALD9_Out\'8 T) p# a6 [% |
& `; p! i8 [- k9 @4 ?2 r" a8 Hhtml_filepath:' ] p* B* q& f" Q+ R y+ ?
db 0; G. Z6 C; d+ h8 h# c9 R. n
( X3 z: u b& V7 K9 t% l3 phtml_pathnumaddr:
. R" Q$ s& E# J3 ^( V. Vdd 0
9 t" _+ F9 L6 g8 E0 c8 I4 O6 i- @0 Q% E) _# E: W
html_pathnumformat:4 C1 R' ^& ^% Z, ~8 T8 b
db '%06d.html', 0
+ Q* }2 ?6 P4 [: B5 `2 Z+ r2 U
/*+ h6 a/ |/ B% I
// lua is slow, so this is not used for now
/ d {0 J% E$ B+ Z6 D! l{$lua}( `" k( V6 |4 \. s+ x4 H
function myfunction(straddr)
2 f' r9 E- M4 M; A- ^ --showMessage('html: '..straddr)
/ D4 s# u; F0 G: W len = readInteger('html_len'), h4 g2 s* m* R D( s* Z5 j
--showMessage('len: '..len)
" ~/ Y5 Q2 H9 N$ [/ K* z& U --str = readString(straddr, len)
9 I/ W: p1 B/ j$ l7 e0 p" h8 g --showMessage('str: '..str)
9 v; e: E( n" M --showMessage('len of str is: '..string.len(str))" ^+ m0 Z$ E3 r$ @
cnt = readInteger('html_cnt')
9 ]7 u1 V7 Y7 I: e, e3 M5 ` cnt = cnt + 1
& R& L. h" v/ p4 t' S" p4 C writeInteger('html_cnt', cnt)
/ k" S1 u0 ~/ J9 u+ c filePath = string.format("C:\\OALD\\%d.html", cnt)
% m" O9 z. A4 c5 x! G writeRegionToFile(filePath, straddr, len)
1 m$ T4 L- [3 L! Nend2 t6 [" j# ?; a6 \7 u
{$asm}1 F7 `/ D2 P6 B2 y% C
; c" y' O9 n0 n9 k) }- K8 gloadlibrary(luaclient-i386.dll). P7 e7 T9 t' L
luacall(openLuaServer('CELUASERVER'))
K* h& h7 I4 n1 S+ c/ k: y( P5 |. }7 ]% b4 @
CELUA_ServerName:, U% z5 ~: n( _- R
db 'CELUASERVER',0
8 g: O8 T* C+ y$ R3 W1 u0 G
& Z4 G6 G& u" f' o( aalloc(str_myfunction,32)
$ a2 G8 |" y, n1 a9 }* R7 jalloc(functionid,4): t" v/ f" [& X" w% w4 X+ v/ d
6 @* D2 G2 |6 P2 w% istr_myfunction:% R* v/ r6 S1 ^" y- [* [% K+ F
db 'return myfunction(parameter)',0. w& Q' @# E3 {! w& ~
*/2 s5 I9 s6 G2 h0 a& c' `3 U
: Q B! z' D1 ]8 _
[ENABLE]
; G( `* ]0 ^9 P- F' }//code from here to '[DISABLE]' will be used to enable the cheat
+ l) x. i9 d: p7 S6 n, }alloc(newmem,2048)
" x1 r+ y; c- Lalloc(hFile,4)) R# `2 X8 T* q' a: s3 G
label(IncNumFileCheck)
2 a4 M* X) @; Nlabel(IncNumWriteFile)
; m0 U' P$ `/ t! b0 E/ Dlabel(DoWriteFile)0 q3 ^9 l m, B9 C; i
label(Cleanup)
6 S5 s2 F2 `5 v$ Tlabel(returnhere)- g6 a+ _2 g# F8 u. v- A
label(originalcode)
" n( {# Y% z7 y' a. U8 K& X1 F6 llabel(exit)
4 E* A* N2 ? N/ V2 G2 g* q" I7 Z z
newmem: //this is allocated memory, you have read,write,execute access
$ r8 }) U. e* r; ]$ M `. N//place your code here: e- P2 y9 _5 g1 C$ A
mov [html_str],esp
3 E, Q# E7 f8 [push edx
: T2 Z/ P( |* d+ A. ^: ~& V; Ppush ecx) w9 @/ L1 X: P0 t; ^( h4 `
push eax% S3 k3 q* s8 s* K) k9 ]* v& n
8 Y, Q3 M6 B, v, t% {
mov edx, [html_str]
9 f1 G1 E9 E0 b; T2 w* \- _& fsub edx, 286 i& x0 L1 i$ m5 I" t$ @
mov edx, [edx]
- ^+ Z1 D& X- ^$ cmov [html_str],edx
, C" J: ^0 m: Epush [html_str]) Z' |9 z- n8 V* p5 H/ a1 w7 r7 F
call kernel32.lstrlenA // stdcall, no cleanup
! o% P0 T( z5 O) o& {- c/ Imov [html_len], eax" j2 t: O7 L, T% U6 t" ~1 o4 w; t
+ a9 V+ ]) Q4 E
// check if this is the first time
5 S* s" D, \- ^3 y% z& v3 zcmp [html_cnt], 03 T( w$ w/ X$ V3 O0 ]3 _' e
jne IncNumWriteFile
: S/ r3 o; p6 W! S" |# o0 B7 l& Q. Y. F( O7 H. f7 X
push html_filedir
8 s5 K0 {4 A( s9 xpush html_filepath: h! W/ h8 R% k$ u k# e
call kernel32.lstrcpyA4 l2 |: ?0 ~" n! _
) d" {& I9 d$ o% G+ `) j6 m
push 0. `1 c) e; ]" N9 p0 C# ~
push html_filepath& X& y! }/ L9 S
call kernel32.CreateDirectoryA
2 z0 J: t# X' G" U) ~
% F s6 F9 J7 [, G+ X: A0 `0 \push html_filepath
$ U2 U9 o) W" ~3 Ncall kernel32.lstrlenA3 _# f/ c' R Z! r [
) \& C/ {1 u6 ]0 W- \$ P% z+ R1 Q
lea edx,[html_filepath]
0 M+ ~5 p k9 dadd edx,eax
% K/ o8 a" ]6 ]mov [html_pathnumaddr], edx" k" t" ]( Q3 `, L
8 f5 `/ `0 J l- J' P// find the next available number' }% X% J R2 b/ g
mov [html_cnt], 1
! o3 ?/ |9 d, y, n9 k" Y+ v" |9 d/ R1 `7 S
IncNumFileCheck:
, L/ ]8 c0 L% ~) Xpush [html_cnt], e; r( d S }
push html_pathnumformat
' k& W7 u b# M: vpush [html_pathnumaddr]0 }! m2 k e" W' I0 \2 d: F; _) \: w$ h
call user32.wsprintfA) ~4 Y! j8 k" g; a+ h' ^) O8 S; N
) P; K7 a# ~6 `push html_filepath
! N$ P, C, H: X/ h2 Ocall kernel32.GetFileAttributesA
! n" ~% ^7 O( ~cmp eax, 0xFFFFFFFF
) a/ x- v* b/ R# g Dje DoWriteFile/ [/ _7 `3 {3 b- U6 A5 S$ D2 @; H2 B
mov eax, [html_cnt]6 g8 \0 w6 F0 T! ~* M
inc eax& k6 _0 U8 [9 b1 F) J2 M
mov [html_cnt], eax
+ Y/ t' {3 [/ W8 Rjmp IncNumFileCheck. S- d. f6 G/ {0 D' m9 t+ }( A3 B W1 K
" h, _% }4 ?0 f, J
IncNumWriteFile:
8 X+ E. Z: |$ B L/ \mov eax, [html_cnt]# Y4 E$ @- {1 f$ p7 }5 X
inc eax# P: M' e1 A3 Z$ [/ d( ]/ {. p
mov [html_cnt], eax2 p0 v8 ]8 l7 B" J" ]6 Q
* u* W+ g: `$ J) a4 V7 f4 Apush [html_cnt]
; G) d& b: u" G" Bpush html_pathnumformat! n/ Z) p$ a. R) g5 w
push [html_pathnumaddr]
: X, }: F; V1 E3 vcall user32.wsprintfA7 g+ t$ }) L9 G! r: M" ]
: {, Y6 l% d; s, q2 C
DoWriteFile:( e: H4 g, l$ \, \
//push [html_str]' f! Y- [4 \, R
//push str_myfunction
0 @5 C& K( @6 `$ N; \( H( \//call CELUA_ExecuteFunction
0 q& F- O# D$ ?push 03 \8 Q h- }. S; A- b! q
push FILE_ATTRIBUTE_NORMAL
- q8 r y( g1 npush OPEN_ALWAYS D; F) J U' x1 r2 b1 A1 G3 M
push 0 t3 z3 l2 | b& `- T+ ~
push 0
0 t5 J, |# U7 c7 L$ w* M% |: D- qpush FILE_APPEND_DATA
2 K1 S1 D, G F; l6 ]1 L# a6 Hpush html_filepath5 k( Y3 t$ S* h
call kernel32.CreateFileA
- L6 d( ?0 ?" L; ztest eax, eax
1 \, _- c: Q( Q6 `je Cleanup# o, M" W+ x1 ^* z7 K) g% C
8 m4 ~( a5 v: p+ _4 I0 @mov [hFile], eax
+ w/ u% r& x" U! h: }& z) V1 x
( j H# e% N) B1 bpush FILE_END' b* c; G# x9 X- W0 E! o+ `
push 0
' t* S5 a( D9 c& x' f2 X3 apush 06 Q+ F8 P$ u. F3 a( F
push [hFile]* Z! `7 h V4 j% @
call kernel32.SetFilePointer+ S7 K n0 \( c# g; J" t
! s/ i) p$ B/ W8 Cpush 0+ u6 t7 S2 V4 M; n& X4 k$ U
push file_bytes$ L" p: H* ?6 X
push [html_len]
8 a+ ~5 ^; H0 P% l, b( K! ~7 P- J5 upush [html_str]. \" l, e! H( m2 ^4 \, M
push [hFile]# p2 j7 n. q, E3 e" B. g
call kernel32.WriteFile
. i2 ~3 q" I) H/ S0 ~# _$ Z) A, H
3 A% m. N9 e% \8 `8 u- Rpush [hFile]8 d! ^3 ?, k% g' o+ E0 T0 E
call kernel32.CloseHandle
6 @! J1 T+ S! \0 q* W
5 z; y6 o4 P& j8 q: O+ G+ Q* m8 g/ p; R: `
Cleanup:7 o7 ?0 s4 H5 W' @+ c" }
pop eax1 s" C1 x$ L+ {! j: _2 W. E5 t
pop ecx
8 b: l0 |9 X7 Q6 D4 x1 D2 [) xpop edx+ d S- R) o& }) g$ k; e# Y0 Y2 e
+ Q# F, P# a: Q! koriginalcode:
5 C% {" R+ t+ t m) Z1 a) `. \mov [ebp-04],eax
3 j- g0 S: W9 g. {$ \8 U. Z, g `push 00; w0 [0 p& W8 { e5 |0 V
/ ?1 q( H' u0 ]2 j- D) v/ d
exit:2 L7 I1 I. h o
jmp returnhere
+ ?' \0 X0 {% d' q8 @5 \
6 P1 L" h* l; O3 `, y! a. p"OALD9.exe"+32127:
) x% a5 V2 s+ ]: ]" ~jmp newmem5 |; V' J2 z- }$ I2 d" [; S5 r& H
returnhere:6 l( M- G% ~2 K; U
' I( j' I( ]4 E7 i; w
0 v3 Y" S7 C: m, H. L# A
8 i8 w+ F* f4 h- w
; W5 j+ c) x1 _0 _- K- L[DISABLE]
- a! H8 `& F3 n//code from here till the end of the code will be used to disable the cheat% j' y1 l5 j0 E& H! t, M1 ^
dealloc(newmem)
: q' [" K; g2 g: ^7 z"OALD9.exe"+32127:
% y y$ U# G7 O2 X% amov [ebp-04],eax
! S1 T U K9 N% ipush 00+ q( P' ~3 S; z6 n( z4 L" M; ^
//Alt: db 89 45 FC 6A 00 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?免费注册
x
|