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

楼主 |
发表于 2019-4-2 00:35:41
|
显示全部楼层
本帖最后由 wadu 于 2019-4-2 00:46 编辑 & \& I* n/ T% \6 K
\3 K( y1 S, o8 W感觉如果只是为了把 HTML 提取到文件的话直接用 Cheat Engine 打补丁就好了,只是这个词典不释放内存,不知道是否有意的,滚动多了就崩溃退出了。
1 w3 @0 z( V4 d, U1 i; r) k+ w0 o1 t) J+ i3 p
我自己在 Cheat Engine 用它的 Auto Assemble 工具直接用下面的代码就可以提取内容了,接下来用 AutoHotkey 模拟滚动就行了。只是程序会崩溃真是比较麻烦(再次强调是程序自己原本在没有任何修改时不断滚动就会崩溃),需要自己过一段时间检查看看程序是不是挂掉了,然后手动重新运行程序,还要手动查看最后一个提取文件中最后一个词条的单词,回到软件上搜索到该词条,重新开 Cheat Engine 打开进程,继续重复步骤。
9 m; e& X% V9 b$ A2 h- i2 a( d
% F. f6 \4 |. R7 T. B4 A/ @, u这个附件 txt 重命名为 .CT 文件然后在 Cheat Engine 里点左上角的第二个文件夹按钮 Open a cheat table 打开这个 .CT 文件,然后在下方把列表的第一个 Auto Assemble script 前面的框打勾就可以使用 script 自动把 HTML 的内容保存到 C:\OALD9_Out\ 文件夹下了。
+ ]; f( h/ t. a5 l6 ?
" v8 U: J' V5 U; p& P4 m; B4 j* p2 S) |
$ _% d) ?$ q9 J3 z% |
% b* h& O8 X- m( }( t2 |' M) L; L8 C) G
+ r" f% [# Y: N) B+ Mdefine(FILE_APPEND_DATA,4)
6 N$ D# y1 |# R) odefine(OPEN_ALWAYS,4)
5 u& x7 d6 n- Y2 k, S9 y" |define(FILE_ATTRIBUTE_NORMAL,0x00000080)3 A ?1 Z& [' Q& N4 ]0 M$ y
define(FILE_END,2)
+ ~: a$ C: x# q" v( e$ Y4 b6 M$ a
4 e% e* n \: f& tglobalalloc(html_str, 4)
7 \* x6 S8 h& F. P3 Wglobalalloc(html_len, 4)
A6 S& L" Y3 Aglobalalloc(html_cnt, 4)
; }& X8 g0 N X6 \2 |globalalloc(file_bytes, 4)
& m! X; v( k1 o, _& Cglobalalloc(html_filedir, 255)2 {; H, Q3 W, `# z
globalalloc(html_filepath, 255)
: R% X" t, E- Fglobalalloc(html_pathnumaddr, 4)
7 o" E! @; K9 \ P2 ^globalalloc(html_pathnumformat, 20)! ~# q+ b8 p& `, j" l
( \7 y) P7 O# F ~7 _5 v$ Chtml_str:1 Z6 r& X1 u, s
dd 0
# V$ u% F" f: Z8 y- b8 ?: V) C, V; ]
html_len:6 ]& }* F4 k) ^) f; I
dd 0
- n; b" N5 _ K$ J6 o7 A/ ]+ A3 M, G' d
html_cnt:$ \' W3 i, Z" D: @6 P' P3 j5 g4 o
dd 08 ~5 i7 A3 F2 A6 R
9 X. `9 M, @- s! e! Q
html_filedir:/ f5 i7 R) K/ h+ Q
db 'C:\OALD9_Out\') F3 k7 h) D0 O0 H0 R- ~
+ _+ \; o8 |3 H
html_filepath:# e2 v7 Q3 J( ^- T
db 0
' o, _- ^/ ^5 ]
' Y( R8 d r" d2 Nhtml_pathnumaddr:
4 C) r$ l0 L; udd 06 }5 G- P! ^2 f# u! _8 z0 v' R* f% X
' d' J9 C" T ^7 \0 bhtml_pathnumformat:9 A5 B# N/ B3 l1 m( ]
db '%06d.html', 04 e E5 d. B& B2 a C" K+ `
1 C" n) x4 G! Q6 l$ v7 k5 Q/*- y: l6 b0 t5 W
// lua is slow, so this is not used for now
G h' U& H% e{$lua}8 K/ Z1 ?) W8 S, A
function myfunction(straddr)# ^* d; y+ ^& x$ r: U# g2 N
--showMessage('html: '..straddr)
; E& N% ]7 S% w len = readInteger('html_len'), a, Y _% Y; @! q6 I6 M7 g
--showMessage('len: '..len)
7 R9 Y& L/ i- `# V. B --str = readString(straddr, len), G8 H# J# @! b
--showMessage('str: '..str)
) r. F7 U$ R. }" G1 P5 x( o# T: y --showMessage('len of str is: '..string.len(str))' B$ a* _/ E( y/ I5 }! s
cnt = readInteger('html_cnt')
3 K, B8 l. T$ z9 Z' V cnt = cnt + 1
3 U& F5 `# R7 F( q/ M writeInteger('html_cnt', cnt)% }( I, A' F( D7 R6 ~0 T' y x
filePath = string.format("C:\\OALD\\%d.html", cnt)
- A% o2 |8 S, @% I3 { writeRegionToFile(filePath, straddr, len)
! d4 g% b& [; d- `, i8 e* ^% Wend) y$ s* D1 M8 C5 a4 l
{$asm}$ x: }" R& T0 n
, l5 T. H. J2 W
loadlibrary(luaclient-i386.dll)! W: N" p# ?* r" s' b) h3 L
luacall(openLuaServer('CELUASERVER'))
7 b+ g, R2 t7 K- M$ l& [3 K5 L
# M/ X7 H( r- x+ LCELUA_ServerName:% ]4 b7 C* u) O3 W
db 'CELUASERVER',0
! U* W, l b" E a: c! J* x7 S: `" {/ b, F3 H2 J4 Z q
alloc(str_myfunction,32)
D" d3 f' {1 G6 B2 ^# G1 ^4 _( z# N. Nalloc(functionid,4)8 N1 R3 h$ s2 H! X
' Z6 Y( T2 s2 t. R" L. [1 hstr_myfunction:
( d5 q7 }( c1 y$ j4 mdb 'return myfunction(parameter)',0% I y& T) a' R* j
*/# k8 d3 ^$ C/ q' X5 Z3 l
" x Y' G3 | b% O0 o; B! p! s
[ENABLE]+ g3 m6 g4 L0 P4 q4 }" i
//code from here to '[DISABLE]' will be used to enable the cheat
6 G9 _3 g) ]% Aalloc(newmem,2048)0 c( E9 u6 {& J
alloc(hFile,4)
; x1 k+ E0 r/ a9 o4 S# ~label(IncNumFileCheck)" u3 b5 \+ f: j9 u( L0 a
label(IncNumWriteFile)
" ~4 p ^9 q# c4 `label(DoWriteFile)# |4 i; ]: z3 y/ e8 G5 _# I
label(Cleanup)# a* I7 B x# d
label(returnhere)
. Z; r0 |1 w4 E) g: g8 g% hlabel(originalcode)& {# z8 ~/ [3 v k& U9 W* s
label(exit)* t# B9 S; }3 u9 \5 o- p
7 i& m" v1 h, u! M) l9 i, n
newmem: //this is allocated memory, you have read,write,execute access5 l j8 z$ r! }
//place your code here6 g8 o4 ~0 X/ e. D$ A o
mov [html_str],esp
; B7 u' M$ E7 ?push edx+ `, j2 l6 Q3 J( E J; h, o0 k
push ecx' S+ f* c8 c) C6 M
push eax
1 m; A( g2 W- A g
5 J' r. h& g! ]) Umov edx, [html_str]/ o" {% H! ^: M7 z4 J( I
sub edx, 28
4 q0 j/ s' J0 w+ M' Omov edx, [edx]/ z2 Z( u/ r9 [( g g% W3 F3 c
mov [html_str],edx
& H4 s5 M q& p2 P4 I- apush [html_str]5 z2 @6 U/ {4 P! D
call kernel32.lstrlenA // stdcall, no cleanup' j2 @( g* _6 O; w& o4 J
mov [html_len], eax
3 r5 x. j" E; o( x3 x K
( f. B% d, \9 N" m- h' O// check if this is the first time
8 |$ N- Z3 L: X6 T) i, G" r; Qcmp [html_cnt], 0, {0 {8 z! j+ t; w: W, s
jne IncNumWriteFile
0 c6 ?" E; f$ S
/ c9 p9 D9 h! m/ T0 M; _push html_filedir0 K, W; a9 f$ _1 ~2 J
push html_filepath
4 `( L5 o. ^% M4 ~call kernel32.lstrcpyA! o* x% e9 h1 [6 r8 l
: R& Q( U( c% Y! D, }push 05 ], X; r! E( M' u' w. d: h* g
push html_filepath: I$ K& x; ^% L( ?0 C
call kernel32.CreateDirectoryA
& M8 s# s; x; i3 `
6 h. W6 @1 t& j/ n! R2 Qpush html_filepath
5 T/ c# {0 B, ^9 ?call kernel32.lstrlenA2 a- L+ J* x; p" N1 _
" n. F( K4 a; d7 i+ f: A J
lea edx,[html_filepath]' R2 c4 U/ L7 ^; w+ u5 ]
add edx,eax
" F; `2 B9 G- P; v. pmov [html_pathnumaddr], edx# b! ?" R# i8 J, O8 ^
7 i8 |) S$ F, ~9 O* i+ b// find the next available number) N1 T; P! q$ n$ Z& l0 Y+ ^
mov [html_cnt], 1
$ x: F9 w. J( U9 ]5 ]* m$ L* Q2 z8 L
IncNumFileCheck:
& A' ^: q# B* j3 r; @push [html_cnt]3 g9 t# [6 H( j& O
push html_pathnumformat5 @2 {- |6 o4 `) x/ |( }$ c! O
push [html_pathnumaddr]
. W/ y# r. R# o9 I# jcall user32.wsprintfA9 z# t/ n. V5 R& t! @$ j0 K
( h% Y+ \$ N6 R) {9 y$ y5 i
push html_filepath
9 ^! X- b. m8 {# J/ ~call kernel32.GetFileAttributesA/ \* Z q: d4 e9 ^
cmp eax, 0xFFFFFFFF% z) L/ M7 g1 G2 i. M
je DoWriteFile) c$ s, C' Z0 @/ p$ d9 |* J
mov eax, [html_cnt]
5 J" ?: |; z- f( S" C0 M, pinc eax
( w6 R: O. ?: r- Imov [html_cnt], eax9 _' i6 o. I3 {6 [) |9 Y
jmp IncNumFileCheck
1 T2 E& s& O5 J- ~1 F
( v! k8 P% f( GIncNumWriteFile:
( w2 J8 D9 y& k! @( ]mov eax, [html_cnt]
" R. x9 R0 z' |# g, U: minc eax
" z% r" r S p. b( a' {mov [html_cnt], eax1 d, a/ a1 Q- Z1 ]; _
$ a7 C' D& L5 u& {. ]
push [html_cnt]* @4 |% v) j" c/ c9 f. |) g! y, p
push html_pathnumformat
2 w3 a+ _/ D; m+ b5 I- }+ S6 V; ~push [html_pathnumaddr]
- {4 L. ^7 z5 Y( C$ m% d& y& I3 n7 fcall user32.wsprintfA
+ \; _: |) s5 E5 I2 u" l* m; S) U- ]6 _
DoWriteFile:$ o! j+ p" o8 D) H R
//push [html_str]
1 Q( N/ d; K# N2 O* Y//push str_myfunction
; I, L0 `: z5 }//call CELUA_ExecuteFunction1 \; T ^. `8 U# [8 ` w- d) m$ `, B& ?
push 0
, I9 g' i. q0 ]+ Spush FILE_ATTRIBUTE_NORMAL1 M, i: h; c( q6 |
push OPEN_ALWAYS
9 V" {1 R# j( w7 h/ cpush 0
1 F- y, @# L" o7 t' Tpush 0/ C# s) M+ N* @: M) k
push FILE_APPEND_DATA
1 ?. t! v% e- A* H8 B6 i) P$ r( ppush html_filepath
/ z2 ~1 s" d" y, wcall kernel32.CreateFileA5 b$ X' ^+ P% r8 i$ o/ m. h3 J
test eax, eax7 R# g4 @: N! r% v' f
je Cleanup
$ C4 R1 G; z9 ]. P$ E0 X3 ^
3 [4 j9 ], O& Y2 O8 [) ?# Pmov [hFile], eax
" i9 c/ O5 J$ ?/ r$ x7 y( W5 }# _, V! w* Q8 N4 G+ M, T) @/ X
push FILE_END% H n; i" r8 R+ o( c% B
push 09 d4 a9 t! ]/ Z# {5 v, g2 o" U; A
push 0
: S9 r2 I8 R, w4 s+ P& ipush [hFile]
9 k4 f. y3 E+ _9 d Vcall kernel32.SetFilePointer) P" C& _" p8 a8 s
7 C# O- K1 ~- U3 A
push 0
$ b) i, ~0 x2 Dpush file_bytes3 n0 j7 Q: w; ~& \5 r8 ?
push [html_len]
A" l: E5 K! Opush [html_str]
# v- W- L* z1 m! a Z( npush [hFile]
) `1 y8 s0 w& [; J6 v: _+ h1 Zcall kernel32.WriteFile% n/ g% X0 M3 b' {" v
9 B$ S2 t# y) J V0 ?+ Q- R' }push [hFile]
* I1 J; v& j8 B1 [call kernel32.CloseHandle
4 J! g! a! {2 Q7 u$ r) @* {
' S7 x6 `5 a0 l5 Y t$ M! ~9 ^6 O
( r2 b+ e5 A, ?( }: kCleanup:' `1 f* R/ y4 V9 U
pop eax9 b$ i3 M- n: X
pop ecx
3 q3 R( ^( v' Ipop edx
" S6 f+ y) K9 m/ {9 a/ G! u) h; u; C+ V" d/ Q% |& I- ?& Z( B5 g
originalcode:
/ @) y% o9 Y8 L' Mmov [ebp-04],eax
1 G3 f: Y/ q" r) `push 00
8 r5 m9 D* n) W; j* d" Q3 H# }' R' v7 Q& y
exit:
( [% n' s) l' \jmp returnhere& t6 q: K* J0 ~2 ]; o) H& S
- U" q* n6 Y2 P( [$ v
"OALD9.exe"+32127:
W9 C. W+ s- F' y$ Z* Rjmp newmem/ {6 g6 H( \3 \( b2 ~! T# I% h1 R6 d
returnhere:
j) s* @3 i7 c1 @" w0 |8 C+ Q# B2 n S5 @3 H. r# z
8 X6 r- `5 i& z
( m' h6 W5 Q1 ^: b4 a( s
9 {& n% b' Q7 t% c[DISABLE]/ W8 @: W4 C/ ? |% r2 \9 @
//code from here till the end of the code will be used to disable the cheat5 Q+ Q: \% E4 p& b d
dealloc(newmem)
2 ?8 D. \! d+ x" u( h6 H"OALD9.exe"+32127:
* O5 J" r) [$ ?. d$ D( M" l/ emov [ebp-04],eax
" w% O9 p3 B. v. x$ Hpush 00
) o1 m, X/ ?5 ]. w//Alt: db 89 45 FC 6A 00 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?免费注册
x
|