本帖最后由 shane007 于 2023-8-26 16:14 编辑 0 [& X1 ^9 E j/ i( F
$ I3 Z8 e1 `3 d: v# T: S" `9 `
我用代理dll的方式,让这个游戏窗口化了。! x: z. I9 _/ n9 |+ E
随后用cheat engine(用其他工具老是出异常,无法正常调试)在内存中检索一句字幕,下内存方位断点。$ r% X( R# H" T) S a: r; R& g4 V
在以下地方断下。2 v, p; R8 i& q
# M* o0 i* a5 u; K9 v
- CaptainMorgane.exe+96F5 - 83 C0 01 - add eax,01
9 c6 q8 q) A& b8 o$ l - 地址004096F5
复制代码
5 E# j( n" N( p) c5 ~# o
& h; S5 `+ G6 l& w' _随后,在ida pro中查看伪代码,感觉这是一个字符串长度的check函数,) W& W# u( ~& v7 M" t4 B0 A# V
真正的字幕显示函数需要追到上一层,后续再继续分析
; w \0 g: S. x4 D
% U: o O, s: b5 H& j
! j2 A0 p' T: k- void __usercall sub_409670(char a1@<dil>, const char *a2@<esi>)
w, T' g a& L" J5 z - {2 C5 B6 {2 n: ^
- _DWORD *v2; // eax! D( L- J7 D9 u
- " {4 N9 D! [: m
- if ( !dword_5D9B50 )6 M/ Y& m9 b" O/ E4 Q- Q }& v
- {
* G3 Q+ [# S* @! K7 s" j5 E - if ( !a2 )2 r& ~ j0 C2 I, N- d
- goto LABEL_7;
, a4 [* r* ^1 Z - if ( strlen(a2) >= 0x80 ); }1 [+ N* }& b9 ]" i
- {
5 ?& g1 `2 C. D% s( G7 f, s: N - sub_51AEC6("ASSERT\n", a1);. u z1 q* T4 _; Q s$ }: `
- sub_51AEC6("file: %s(%d)\n", (unsigned int)"..\\..\\Source\\Dialogs\\Common\\DialogInterface.cpp");
2 O1 o* `6 [- T5 j - sub_51AEC6("function: %s\n", (unsigned int)"DialogInterface::SetCaptionDisplayed");
# h7 u- }4 p9 g: X" j: v5 I) p - sub_51AEC6("condition: %s\n", (unsigned int)"sCaption==NULL || strlen(sCaption)< NB_CHAR_MAX");
" O( F* F" C9 b: w3 M. l# A M( M - }/ A5 T3 P0 p" g; b: [% D
- } |& x# S+ k# d1 s7 u( A3 {
- if ( a2 )- e* t; \' N$ h- G: G l0 I. h
- {
1 D" C! e& k/ P# u5 D! q& k - strcpy((char *)&unk_5D3370, a2);
5 s0 t. R( q/ { - v2 = (_DWORD *)dword_5D3E6C;
( ~3 J( `: N ~( P* q - byte_5D33F0 = 1;
* J( k9 d. g3 d" Q- s/ x+ f - *(_BYTE *)(dword_5D3E6C + 4) = 1;8 D6 H1 n3 X( w) Z9 s
- v2[2] = 0;
; `' [( A- i1 C0 D8 t# k y: o - v2[4] = 0x100000;1 e; U( P! d8 Q3 K
- v2[3] = 0;
" Q0 T2 c& Y; [) O/ W - v2[5] = 786432;7 i( A- M+ U# |( B4 e
- return;' L% X z2 i5 a' X# N* C, T
- }
0 t4 p9 n5 x1 ^8 x1 o - LABEL_7:/ R! r U& x% h) @
- byte_5D33F0 = 0;
7 M4 M6 C! @: l- I - }
复制代码- .text:004096EB ; ---------------------------------------------------------------------------6 R/ k; d6 E0 v" r M% \
- .text:004096ED align 10h
) n4 V0 l) Z- n. G& B - .text:004096F02 \. t5 ~, X* Q! l' H
- .text:004096F0 loc_4096F0: ; CODE XREF: sub_409670+7B↑j# x" D) l( ^5 }. w
- .text:004096F0 ; sub_409670+8A↓j
}$ V! D8 H- b* n9 u - .text:004096F0 mov cl, [eax]
9 N" C( o" O+ u, { - .text:004096F2 mov [edx+eax], cl6 N9 R0 }2 {8 ] J" z9 l7 a) f
- .text:004096F5 add eax, 1
7 X- X& H: G8 s# C# x - .text:004096F8 test cl, cl
! c& {% T6 I- |/ C2 h) d - .text:004096FA jnz short loc_4096F08 Z% L: a) [" Z) z% c1 u' `
- .text:004096FC mov eax, dword_5D3E6C
, t, s1 j/ o& i7 V - .text:00409701 mov byte_5D33F0, 1
7 R. i: p1 A( c - .text:00409708 mov byte ptr [eax+4], 1
9 D, ~, o, H D - .text:0040970C mov dword ptr [eax+8], 0
8 ~; z+ @, F/ R( J2 t- o - .text:00409713 mov dword ptr [eax+10h], 100000h: S) I0 ]9 \ P/ O6 w6 i; ]& F
- .text:0040971A mov dword ptr [eax+0Ch], 0
, `9 ~2 k8 L; y7 E! Z' p$ m7 X - .text:00409721 mov dword ptr [eax+14h], 0C0000h5 p! x0 ]8 R1 @# _* ~8 {
- .text:00409728 retn/ ^6 U# f! g8 M5 a
- .text:00409729 ; ---------------------------------------------------------------------------
复制代码
7 L8 K8 W' }3 s' x |