,   CyberForum.ru

- C++

 
:  :  - 10,   - 5.00
Yachi
0 / 0 / 0
: 08.05.2013
: 5
08.05.2013, 08:45     #1
, , .
C++
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
#ifdef _KOR_WEBLAUNCHER_
 
#ifdef _GMTOOL_
    if( lpCmdLine )
    {
        FILE* fpLog = NULL;
        fpLog = fopen( "./ClientStartLog.txt", "a+" );
        if( fpLog )
        {
            SYSTEMTIME sysTime;
            GetLocalTime( &sysTime );
 
            fprintf( fpLog, "[%04d-%02d-%02d %02d:%02d:%02d] Execute Command Line : %s\n", 
                sysTime.wYear, sysTime.wMonth, sysTime.wDay, sysTime.wHour, sysTime.wMinute, sysTime.wSecond,
                lpCmdLine );
 
            fclose( fpLog );
        }   
    }
#endif
 
    token = strtok( 0, delimit );
    if( token == NULL )
    {
        // Ȩ
        ShellExecute( 0, "open", "explorer", "http://google.com", 0, SW_SHOWNORMAL );
        return 0;
    }
 
    TITLE->SetLoginKey(token);
 
    FILE* fp = NULL;
 
#ifndef _TW_LOCAL_
#ifndef _GMTOOL_
    if( strcmp( commandToken, "1992" ) != 0)
    {
        MessageBox( NULL, "You should not execute directly this file!!", "Error!!", MB_OK );
        return 0;
    }
 
#endif
Similar
41792 / 34177 / 6122
: 12.04.2006
: 57,940
08.05.2013, 08:45    
:

C++ .
C++ , !!
C++
++ C C++
" "? C++
.
zss
 ++
   zss
5955 / 5560 / 1788
: 18.12.2011
: 14,209
: 1
08.05.2013, 09:01     #2
22
token = strtok( 0, delimit );

char *strtor(string1,string2);
string1
char *string1; ,
char *string2; -


string1 - . .
token .
Yachi
0 / 0 / 0
: 08.05.2013
: 5
08.05.2013, 09:21  []     #3
GMTOOL , .
if( strcmp( commandToken, "1992" ) != 0) . .
-==-
FAQ
08.05.2013, 09:27     #4
Yachi,
Yachi
token = strtok( 0, delimit );
* * if( token == NULL )
* * {
* * * * // Ȩ
* * * * ShellExecute( 0, "open", "explorer", "http://google.com", 0, SW_SHOWNORMAL );
* * * * return 0;
* * }
- token == NULL .
Yachi
strtok( 0, delimit ) == NULL
strtok , . .

2
Yachi
. .
Yachi
#ifndef _TW_LOCAL_
#ifndef _GMTOOL_
* * if( strcmp( commandToken, "1992" ) != 0)
* * {
* * * * MessageBox( NULL, "You should not execute directly this file!!", "Error!!", MB_OK );
* * * * return 0;
* * }
#endif
- _TW_LOCAL_ _GMTOOL_.
Yachi
0 / 0 / 0
: 08.05.2013
: 5
08.05.2013, 09:29  []     #5
C++
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
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
#include "stdafx.h"
#include "MainGame.h"
#include "WindowIDEnum.h"
#include "./Interface/cWindowManager.h"
#include "./Interface/cEditBox.h"
#include "./Interface/cTextArea.h"
#include "./Interface/cFont.h"
#include "cMsgBox.h"
#include "./Input/UserInput.h"
#include "./Input/cIMEWnd.h"
#include "ChatManager.h"
#include "../[CC]Header/GameResourceManager.h"
#include "MouseCursor.h"
#include "mhFile.h"
#include "OptionManager.h"
#include "MHAudioManager.h"
#include "ObjectManager.h"
#include "MHMap.h"
#include "ExitManager.h"
#include "QuestManager.h"
#include "ServerConnect.h"
#include "cResourceManager.h"
#include "../hseos/Farm/SHFarmManageDlg.h"
#include <atlbase.h>
#include <atlcom.h>
#include <atlhost.h>
#include <exdispid.h>
#include "MainTitle.h"
 
#ifdef _TESTCLIENT_
    #include "TSToolManager.h"
    #include "CommCtrl.h"
#endif
 
#ifdef _GMTOOL_
    #include "GMToolManager.h"
    #include "CommCtrl.h"
#endif
 
#ifdef TAIWAN_LOCAL
    #include <shellapi.h>
#endif
 
#ifdef _HACK_SHIELD_
    #include "HShield.h"
    #include "HackShieldManager.h"
#endif
#ifdef _NPROTECT_
// nProtect
//#define NO_GAMEGUARD
    #include "NPGameLib.h"
    #include "NProtectManager.h"
#endif
 
#ifdef _ERROR_REPORT_
 
#include "./ErrorReport/include/IErrorReportLib.h"
 
#ifdef _DEBUG
    #ifdef _WIN64
        #pragma comment( lib, "./ErrorReport/lib/ErrorReportLib_x64d.lib")
    #else
        #pragma comment( lib, "./ErrorReport/lib/ErrorReportLib_x86d.lib")
    #endif
#else
    #ifdef _WIN64
        #pragma comment( lib, "./ErrorReport/lib/ErrorReportLib_x64.lib")
    #else
        #pragma comment( lib, "./ErrorReport/lib/ErrorReportLib_x86.lib")
    #endif
#endif
 
#endif
 
#define _LOGOWINDOW_
 
//////////////////////////////////////////////////////////////////////////
// Version 
//  ú Ŭ̾Ʈ  ش
 
/////////////////////////////////////////////////////////////////////////
 
char g_CLIENTVERSION[32] = "LNRU00000001";
 
 
/////////////////////////////////////////////////////////////////////////   
 
#define MAX_LOADSTRING 100
 
// Global Variables:
HANDLE g_hMap = NULL;
HINSTANCE g_hInst;                              // current instance
HWND _g_hWnd;
char szTitle[MAX_LOADSTRING];                               // The title bar text
char szWindowClass[MAX_LOADSTRING];                             // The title bar text
BOOL g_bActiveApp = FALSE;
char g_AgentAddr[16];
WORD g_AgentPort;
char g_PATCHVERSION[256];
#ifdef _TW_LOCAL_
char g_szHeroIDName[21];
char g_szHeroKey[21];
#else
char g_szHeroIDName[MAX_NAME_LENGTH+1];
#endif
int g_nServerSetNum;
ScriptCheckValue g_Check;
 
HIMC g_hIMC = NULL;
 
 
CComModule _Module; 
BEGIN_OBJECT_MAP(ObjectMap) 
END_OBJECT_MAP() 
 
// Foward declarations of functions included in this code module:
ATOM                MyRegisterClass(HINSTANCE hInstance);
BOOL                InitInstance(HINSTANCE, int);
LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK    About(HWND, UINT, WPARAM, LPARAM);
void LeaveClientApplication();
BOOL EnterClientApplication();
 
//BOOL CheckParameter(LPSTR parameter);
BOOL    GetPatchVersion();
BOOL    CheckResourceFile();
void    ChangeVerInfo();
BOOL    SaveFileList();
 
#ifdef _HACK_SHIELD_
BOOL HS_Init();
BOOL HS_StartService();
BOOL HS_StopService();
BOOL HS_UnInit();
int __stdcall HS_CallbackProc (long lCode, long lParamSize, void* pParam );
BOOL HS_PauseService();
BOOL HS_ResumeService();
void HS_SaveFuncAddress();
 
LONG WINAPI TopLevelFilter(struct _EXCEPTION_POINTERS* pExPtr)
{
    HS_StopService();
    HS_UnInit();
    return EXCEPTION_EXECUTE_HANDLER;
}
 
#endif
 
#ifdef _NPROTECT_
 
BOOL CALLBACK NPGameMonCallback(DWORD dwMsg, DWORD dwArg);
 
LONG WINAPI TopLevelFilter(struct _EXCEPTION_POINTERS* pExPtr)
{
    NPROTECTMGR->Release();
    return EXCEPTION_EXECUTE_HANDLER;
}
 
#endif
 
 
void ClearDirectory( LPCTSTR pStrName )
{
    WIN32_FIND_DATA FindFileData;
    char buf[MAX_PATH];
    wsprintf( buf, "%s\\*", pStrName );
 
    HANDLE hFind = FindFirstFile( buf, &FindFileData);
 
    if( hFind == INVALID_HANDLE_VALUE ) return;
 
    while( 1 )
    {
        if( FindFileData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY )
        {
            if( strcmp( FindFileData.cFileName, "." ) != 0 &&
                strcmp( FindFileData.cFileName, ".." ) != 0 )
            {
                wsprintf( buf, "%s\\%s", pStrName, FindFileData.cFileName );
                ClearDirectory( buf );
                RemoveDirectory( buf );
            }
        }
        else
        {
            wsprintf( buf, "%s\\%s", pStrName, FindFileData.cFileName );
            DeleteFile( buf );
        }
        if( FindNextFile( hFind, &FindFileData ) == FALSE )
            break;
    }
    FindClose( hFind ); 
}
 
int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
    GUID guid; 
    AtlAxWinInit(); 
    _Module.Init(ObjectMap, hInstance, &guid); 
 
#ifdef _TW_LOCAL_
    sscanf( lpCmdLine, "%s %s", g_szHeroIDName, g_szHeroKey );
#endif
 
    SetScriptCheckValue( g_Check );
 
    char buf[MAX_PATH]={0,};
    char commandToken[MAX_PATH]={0,};
    const char* delimit = " ";
    strncpy( buf, lpCmdLine, sizeof(buf) );
    char* token = strtok( buf, delimit );
    if( token )
        strncpy( commandToken, token, sizeof(commandToken) );
 
#ifdef _KOR_WEBLAUNCHER_
 
#ifdef _GMTOOL_
    if( lpCmdLine )
    {
        FILE* fpLog = NULL;
        fpLog = fopen( "./ClientStartLog.txt", "a+" );
        if( fpLog )
        {
            SYSTEMTIME sysTime;
            GetLocalTime( &sysTime );
 
            fprintf( fpLog, "[%04d-%02d-%02d %02d:%02d:%02d] Execute Command Line : %s\n", 
                sysTime.wYear, sysTime.wMonth, sysTime.wDay, sysTime.wHour, sysTime.wMinute, sysTime.wSecond,
                lpCmdLine );
 
            fclose( fpLog );
        }   
    }
 
#endif
 
    token = strtok( 0, delimit );
    if( token == NULL )
    {
        // Ȩ
        ShellExecute( 0, "open", "explorer", "http://vk.com/id161479879", 0, SW_SHOWNORMAL );
        return 0;
    }
    TITLE->SetLoginKey(token);
 
#endif
 
    FILE* fp = NULL;
 
#ifndef _TW_LOCAL_
#ifndef _GMTOOL_
    if( strcmp( commandToken, "1992" ) != 1)
    {
        MessageBox( NULL, "You should not execute directly this file!!", "Error!!", MB_OK );
        return 0;
    }
 
#endif
#endif
    if(!EnterClientApplication()) return 0;
 
 
#ifdef _HACK_SHIELD_
 
    DIRECTORYMGR->Init();
 
    if( !HS_Init() )
    {
        HS_UnInit();
        MessageBox( NULL, "HackShield Init Failed.", "ERROR", MB_OK );  
        return 0;
    }
    if( !HS_StartService() )
    {
        HS_StopService();
        HS_UnInit();
        MessageBox( NULL, "HackShield Init Failed.", "ERROR", MB_OK );
        return 0;
    }
    HS_SaveFuncAddress();
 
    ::SetUnhandledExceptionFilter(TopLevelFilter);
 
#endif
 
    DeleteFile("Debug.txt");
    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
    //_CrtMemDumpAllObjectsSince(0);
    
    fp = fopen("_DONOTUSEENGINEPACK","r");
    if(fp)
    {
        g_bUsingEnginePack = FALSE;
        fclose(fp);
    }
 
    // Initialize global strings
    GetPatchVersion();
 
    GAMERESRCMNGR->LoadGameDesc();
 
#ifdef _KOR_
#ifdef _TESTCLIENT_
    sprintf(szTitle,"糪÷(TEST) %s %s ExeVer:%s PatchVer:%s",__DATE__,__TIME__,g_CLIENTVERSION,g_PATCHVERSION);
    sprintf(szWindowClass,"糪÷(TEST) %s %s ExeVer:%s PatchVer:%s",__DATE__,__TIME__, g_CLIENTVERSION,g_PATCHVERSION);
#elif _GMTOOL_
    sprintf(szTitle,"糪÷[GM_TOOL] %s %s ExeVer:%s PatchVer:%s",__DATE__,__TIME__,g_CLIENTVERSION,g_PATCHVERSION);
    sprintf(szWindowClass,"糪÷[GM_TOOL] %s %s ExeVer:%s PatchVer:%s",__DATE__,__TIME__, g_CLIENTVERSION,g_PATCHVERSION);
#else
    sprintf(szTitle,"糪÷");
    sprintf(szWindowClass,"糪÷");
#endif
#else
#ifdef _TESTCLIENT_
    sprintf(szTitle,"LUNA Online(TEST) %s %s ExeVer:%s PatchVer:%s",__DATE__,__TIME__,g_CLIENTVERSION,g_PATCHVERSION);
    sprintf(szWindowClass,"LUNA Online(TEST) %s %s ExeVer:%s PatchVer:%s",__DATE__,__TIME__, g_CLIENTVERSION,g_PATCHVERSION);
#elif _GMTOOL_
    sprintf(szTitle,"LUNA Online[GM_TOOL] %s %s ExeVer:%s PatchVer:%s",__DATE__,__TIME__,g_CLIENTVERSION,g_PATCHVERSION);
    sprintf(szWindowClass,"LUNA Online[GM_TOOL] %s %s ExeVer:%s PatchVer:%s",__DATE__,__TIME__, g_CLIENTVERSION,g_PATCHVERSION);
#else
    sprintf(szTitle,"LUNA Online");
    sprintf(szWindowClass,"LUNA Online");
#endif
#endif
    MyRegisterClass(hInstance);
    //LOGEX(lpCmdLine, PT_MESSAGEBOX);
 
    GAMERESRCMNGR->LoadDeveloperInfo();
    // quest data load
    QUESTMGR->LoadQuestString( "./system/Resource/QuestString.bin" );
    QUESTMGR->LoadQuestScript( "./system/Resource/QuestScript.bin" );
    //QUESTMGR->LoadNewbieGuide( "./system/Resource/NewbieGuide.bin" );
    QUESTMGR->LoadQuestNpc( "./system/Resource/QuestNpcList.bin" );
 
    // Perform application initialization:
    if (!InitInstance (hInstance, nCmdShow)) 
    {
        LeaveClientApplication();
        return FALSE;
    }
 
 
#ifdef _ERROR_REPORT_
    // ䷸ ɾø ˴ϴ.
    INIT_DUMP_HANDLER init;
    memset( &init, 0, sizeof(init));
    init.iBuildNum  =   1;
    init.dumpType   =   MiniDumpNormal;
    strcpy( init.szFtpServerIP, "192.168.0.101");               // ⿡ ftp * ip ִ´.
    init.iFtpServerPort =   21;
    strcpy( init.szUserName, "lunasrv_ftp");
    strcpy( init.szPass, "fnskeksehrftp~!");
    init.hApplicationInstance = hInstance;
    init.bUseDescriptionDialog = TRUE;
 
    InitErrorDumpHandler(NULL);     // szFtpServerIP == NULL   dump  .
 
    SetUnhandledExceptionFilter( ErrorDumpHandler);
#endif
 
//  HACCEL hAccelTable;
//  hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_TEST);
 
    // Main message loop:
    MSG msg;
    while (1) //GetMessage(&msg, NULL, NULL, NULL));
    {
        if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
        {
//          if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) 
//          {
#ifdef _GMTOOL_
            if( !GMTOOLMGR->IsGMDialogMessage(&msg) )
#elif _TESTCLIENT_
            if( !TSTOOLMGR->IsTSDialogMessage(&msg) )
#endif
            {
                TranslateMessage(&msg);
                DispatchMessage(&msg); 
            }
//          }
        }
        else
        {
            if(MAINGAME->Process() == -1)
                break;
        }
    }
 
//  DeleteFile("recv.txt");
 
    LeaveClientApplication();
 
//  _ASSERTE( _CrtCheckMemory( ) );
 
#ifdef _HACK_SHIELD_
    HS_StopService();
    HS_UnInit();
#endif
#ifdef _NPROTECT_   
    NPROTECTMGR->Release();
#endif
    return msg.wParam;
}
 
 
ATOM MyRegisterClass(HINSTANCE hInstance)
{
    WNDCLASSEX wcex;
 
    wcex.cbSize = sizeof(WNDCLASSEX); 
#ifndef _GMTOOL_
    wcex.style          = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_NOCLOSE;
#else
    wcex.style          = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
#endif
    wcex.lpfnWndProc    = (WNDPROC)WndProc;
    wcex.cbClsExtra     = 0;
    wcex.cbWndExtra     = 0;
    wcex.hInstance      = hInstance;
//  wcex.hIcon          = LoadIcon(hInstance, (LPCTSTR)IDI_TEST);
//  wcex.hIcon          = NULL;
    wcex.hIcon          = LoadIcon( hInstance, MAKEINTRESOURCE(IDI_GAMEICON) );
 
    wcex.hCursor        = NULL;
//  wcex.hbrBackground  = (HBRUSH)(COLOR_WINDOW+1);
    wcex.hbrBackground  = (HBRUSH)GetStockObject(BLACK_BRUSH);
    wcex.lpszMenuName   = NULL;
    wcex.lpszClassName  = szWindowClass;
//  wcex.hIconSm        = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
    wcex.hIconSm        = NULL;
 
    return RegisterClassEx(&wcex);
}
 
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
    //if(!EnterClientApplication()) return FALSE;   //AIϨ=8ˢˢI E?Aˢ硧aEIU. //KES
 
    CURSOR->Init( hInstance );
    
    HWND hWnd;
    g_hInst = hInstance; // Store instance handle in our global variable
//  int x = GetSystemMetrics(SM_CXSIZEFRAME)*2;
    int x = GetSystemMetrics(SM_CXFIXEDFRAME)*2;
//  int y = GetSystemMetrics(SM_CYSIZEFRAME)*2+GetSystemMetrics(SM_CYCAPTION);
    int y = GetSystemMetrics(SM_CXFIXEDFRAME)*2+GetSystemMetrics(SM_CYCAPTION);
 
#ifndef _GMTOOL_
    DWORD dwStyle = WS_OVERLAPPED | WS_CAPTION | WS_CLIPCHILDREN |
        WS_SYSMENU;
#else
    DWORD dwStyle = WS_OVERLAPPED | WS_CAPTION | WS_CLIPCHILDREN |
        WS_SYSMENU | WS_MINIMIZEBOX;
#endif
    // 070201 LYW --- Modified window style and whidth height.
    //_g_hWnd = hWnd = CreateWindow(szWindowClass, szTitle, dwStyle, //WS_OVERLAPPEDWINDOW,
        //CW_USEDEFAULT, 0, 1280+x, 1024+y, NULL, NULL, hInstance, NULL);   //WINDOW SIZE
 
#ifdef _TESTCLIENT_
    dwStyle |= WS_THICKFRAME;
#endif
    DWORD width     = 0 ;
    DWORD height    = 0 ;
 
    const DISPLAY_INFO& dispInfo = GAMERESRCMNGR->GetResolution();
    width   = dispInfo.dwWidth ;
    height  = dispInfo.dwHeight ;
 
    // desc_hseos_ػ01
    // S ػ ߰ added by hseos 2007.06.25
    // .. 忡*  ÷ ػ󵵿  ػ󵵰   , Ʒ 
    // ..߸  ִ.     x = GetSystemMetrics(SM_CXFIXEDFRAME)*2;
    // ..*   x  ֱ ̴. (¿  ϱ )
    // .. 忡*  ÷ ػx  ػx    ʱ Ѵ.
    // ..(ٵ, ٸ ػ󵵿* x = 0  ص  ̰ .....???    ޶  ⵵..)
    // ..(·  ػ󵵿  ǹǷ x  0..)
    // ..Ʒ ߸   𸣰..
    DWORD nUserScreenWidth = GetSystemMetrics(SM_CXSCREEN);
    if (nUserScreenWidth == width) x = 0;
    // E ػ ߰ added by hseos 2007.06.25
 
    _g_hWnd = hWnd = CreateWindow(szWindowClass, szTitle, dwStyle, //WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, 0, width+x, height+y, NULL, NULL, hInstance, NULL);  //WINDOW SIZE
    
    if (!hWnd)
    {
        return FALSE;
    }
 
#ifndef _NO_NPROTECT_START
#ifdef _NPROTECT_
    if(!NPROTECTMGR->Init(_g_hWnd))
    {
        return FALSE;
    }
 
    ::SetUnhandledExceptionFilter(TopLevelFilter);
#endif
#endif
 
//  gMp3 = new CBGMLoader(hInstance,hWnd);
 
    ShowWindow(hWnd, nCmdShow);
    
//  if( g_bWindowMode )
//      ShowWindow(hWnd, nCmdShow);
//  else
//      ShowWindow(hWnd, SW_HIDE);
 
    UpdateWindow(hWnd);
    ShowCursor(TRUE);
 
    CoInitialize(NULL);
 
#ifndef _LOGOWINDOW_
    PlayCutscene("logo.avi",g_hInst);
#endif
 
    //////////////////////////////////////////////////////////////////////////
    // MAININIT
    MAINGAME->Init(hWnd);
        
#ifndef _TESTCLIENT_
    MAINGAME->SetGameState(eGAMESTATE_CONNECT);
#else
    TSTOOLMGR->CreateTSDialog();
 
    int initKind = eGameInInitKind_Login;
    MAINGAME->SetGameState(eGAMESTATE_GAMEIN,&initKind,sizeof(int));
#endif                 
 
#ifdef _GMTOOL_
    GMTOOLMGR->CreateGMDialog();
#endif
    
    
    return TRUE;
}
 
 
 
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    MOUSE->GetWindowMessage(hWnd, message, wParam, lParam);
    CHATMGR->MsgProc( message, wParam ) ;
    CIMEWND->OnMsg(hWnd, message, wParam, lParam);
    
    switch (message) 
    {
        // 100209 LUJ, Ʒ ޽ ó , IME Է   ʴ´
    case WM_IME_CHAR:
#ifndef _TW_LOCAL_
    case WM_IME_STARTCOMPOSITION:
#endif
    case WM_CHAR:
    case WM_SYSKEYUP:
        return 0;
    case WM_SYSCOMMAND:
        {
            if(SC_KEYMENU == wParam)
            {
                return 0;
            }
        }
        break;
    case WM_ACTIVATEAPP:
        {
            g_bActiveApp = (BOOL)wParam;
 
            if( !g_bActiveApp )
            {
                AUDIOMGR->MuteBGM( TRUE );
 
                CIMEWND->SetCtrlPushed( FALSE );
            }
            else
            {
                AUDIOMGR->MuteBGM( FALSE );
            }
        }
        break;
 
    case WM_ACTIVATE:
        
        if( g_UserInput.GetKeyboard()->GetDirectInput() )
        {
            if( WA_INACTIVE != wParam )
            {
                // Make sure the device is acquired, if we are gaining focus.
                g_UserInput.GetKeyboard()->ClearKeyState();
                g_UserInput.GetKeyboard()->UpdateKeyboardState();
                //g_UserInput.SetInputFocus( TRUE );
                OBJECTMGR->SetAllNameShow( FALSE );
            }
        }
        break;
 
    case WM_USER+155:
        {
            ISC_BaseNetwork* lpNet = NETWORK->GetBaseNetwork();
            if(lpNet)
                lpNet->SocketEventProc();
        }
        return TRUE;        
        
    case WM_CLOSE:
        {
            MAINGAME->SetGameState( eGAMESTATE_END );
 
#ifdef _NPROTECT_
            if(NPROTECTMGR->GetMsg())
            {
                MessageBox(hWnd, NPROTECTMGR->GetMsg(), "nProtect GameGuard", MB_OK);
            }
#endif
        }
        break;
 
    case WM_SETFOCUS:
    case WM_SETCURSOR:
        { 
            CURSOR->Process();
        }
        return 0;
    case WM_SYSKEYDOWN:     //Alt + F4 IoIˢAo
        {
            if( wParam == VK_F4 )
            {
                if( MAINGAME->GetCurStateNum() == eGAMESTATE_TITLE )
                {
                    break;      // ˢ硧OAO EEcAI uEˢ硧i ~ˢˢa
                }
                else if( MAINGAME->GetCurStateNum() == eGAMESTATE_CHARSELECT ||
                    MAINGAME->GetCurStateNum() == eGAMESTATE_CHARMAKE )
                {
                    WINDOWMGR->MsgBox( MBI_EXIT, MBT_YESNO, RESRCMGR->GetMsg( 263 ) );
                    return 0;
                }
            }
        }
        return 0;
    case WM_MOVE:
#ifdef _GMTOOL_
        GMTOOLMGR->SetPositionByMainWindow();
#elif _TESTCLIENT_
        TSTOOLMGR->SetPositionByMainWindow();
        TSTOOLMGR->SetPositionByOutputWindow();
#endif
        break;
 
 
    case WM_CREATE:
        {
#ifdef _GMTOOL_
            INITCOMMONCONTROLSEX icex;
            icex.dwSize = sizeof( icex );
            icex.dwICC  = ICC_DATE_CLASSES;
            InitCommonControlsEx( &icex );
#elif _TESTCLIENT_
            INITCOMMONCONTROLSEX icex;
            icex.dwSize = sizeof( icex );
            icex.dwICC  = ICC_DATE_CLASSES;
            InitCommonControlsEx( &icex );
#endif
 
#ifdef _JAPAN_LOCAL_
            HIMC hImc = ImmGetContext( hWnd );
            DWORD dwConversion, dwSentence;
            ImmGetConversionStatus( hImc, &dwConversion, &dwSentence );
            dwSentence |= IME_SMODE_SINGLECONVERT;
            ImmSetConversionStatus( hImc, dwConversion, dwSentence );
            ImmReleaseContext( hWnd, hImc );
#endif
        }
        break;
    }
    
    return DefWindowProc(hWnd, message, wParam, lParam);
}
 
 
 
// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
        case WM_INITDIALOG:
                return TRUE;
 
        case WM_COMMAND:
            if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) 
            {
                EndDialog(hDlg, LOWORD(wParam));
                return TRUE;
            }
            break;
    }
    return FALSE;
}
 
 
BOOL GetPatchVersion()
{
    CMHFile file;
    if(!file.Init("LunaVerInfo.ver", "r"))
        return FALSE;
    strcpy(g_PATCHVERSION, file.GetString());
 
    return TRUE;
}
 
BOOL EnterClientApplication()
{
#ifndef _GMTOOL_
    g_hMap = CreateFileMapping((HANDLE)0xFFFFFFFF, NULL, PAGE_READWRITE, 0, 1024, "LUNA Online Client Application");
    if(g_hMap != NULL && GetLastError() == ERROR_ALREADY_EXISTS) 
    { 
        CloseHandle(g_hMap); 
        g_hMap = NULL;
        return FALSE;
    }
#endif
 
    return TRUE;
}
 
 
void LeaveClientApplication()
{//taiyo
    if(g_hMap)
    {
        CloseHandle(g_hMap);
        g_hMap = NULL;
    }   
}
 
 
//pjslocal
#ifdef TAIWAN_LOCAL
int is_big5(BYTE *str)
{
    if( str[0] & 0x80 )
    {
        if ( str[0] == 0xa2)
        {
            if( str[1]>= 0xaf && str[1]<= 0xb8 )
                return 1;
            else if( str[1] >= 0xcf && str[1] <= 0xff )
                return 1;
        } 
        if ( str[0] == 0xa3)
        {
            if( str[1]>=0x43 && str[1]<=0xff )
                return 1;
        }
 
        if ( str[0] == 0xa4)
        {
            if( str[1] >= 0x40 && str[1] <= 0xff )
                return 1;
        }
 
        if ( str[0] >= 0xa5 && str[0] <= 0xc5 )
            return 1;
 
        if ( str[0] == 0xc6 )
        {
            if( str[1] >= 0x00 && str[1] <= 0x7e )
                return 1;
        }
    }
    else
    {
        return 1;
    }
    return 0;
}
 
#endif
 
////////////////////////////////////////////////////////////////////////////////////////
// resource סˢuEIouEAC סˢAAI ˢ硧Eˢic(jsd)
///////////////////////////////////////////////////////////////////////////////////////
BOOL CheckResourceFile()
{
    HANDLE hSrch;
    WIN32_FIND_DATA wfd;
    SYSTEMTIME time;
    char Dir[MAX_PATH];
    char filename[MAX_PATH];
    BOOL bResult = TRUE;
    CMHFile file;
    char temp[256];
    WORD year, month, day, hour, min;   
 
    GetWindowsDirectory( Dir, MAX_PATH );
    strcat( Dir, "\\mfl.dat" );
        
    GetCurrentDirectory( MAX_PATH, filename );
    strcat( filename, "\\Resource\\*.bin" );
    hSrch = FindFirstFile( filename, &wfd );
    while( bResult )
    {
        FileTimeToSystemTime( &wfd.ftLastWriteTime, &time );
 
        ///
        if( !file.Init( Dir, "rt", MHFILE_FLAG_DONOTDISPLAY_NOTFOUNDERROR ) )
        {
            file.Release();
            goto filesave;
        }
        while( !file.IsEOF() )
        {
            file.GetString( temp );
            if( strcmp( wfd.cFileName, temp ) == 0 )
            {
                year = file.GetWord();
                month = file.GetWord();
                day = file.GetWord();
                hour = file.GetWord();
                min = file.GetWord();
                
                if( year != time.wYear || month != time.wMonth || day != time.wDay ||
                    hour != time.wHour || min != time.wMinute )
                {
                    file.Release();
                    return FALSE;
                }
                else
                    break;
            }
        }
        file.Release();
        ///     
 
        bResult = FindNextFile( hSrch, &wfd );
    }
 
    bResult = TRUE;
    GetCurrentDirectory( MAX_PATH, filename );
    strcat( filename, "\\Resource\\SkillArea\\*.bsad" );
    hSrch = FindFirstFile( filename, &wfd );
    while( bResult )
    {
        FileTimeToSystemTime( &wfd.ftLastWriteTime, &time );
 
        ///
        if( !file.Init( Dir, "rt", MHFILE_FLAG_DONOTDISPLAY_NOTFOUNDERROR ) )
        {
            file.Release();
            goto filesave;
        }
        while( !file.IsEOF() )
        {
            file.GetString( temp );
            if( strcmp( wfd.cFileName, temp ) == 0 )
            {
                year = file.GetWord();
                month = file.GetWord();
                day = file.GetWord();
                hour = file.GetWord();
                min = file.GetWord();
                
                if( year != time.wYear || month != time.wMonth || day != time.wDay ||
                    hour != time.wHour || min != time.wMinute )
                {
                    file.Release();
                    return FALSE;
                }
                else
                    break;
            }
        }
        file.Release();
        ///     
 
        bResult = FindNextFile( hSrch, &wfd );
    }
 
    return TRUE;
 
filesave:
    SaveFileList();
    return TRUE;
}
 
void ChangeVerInfo()
{
    char temp[256];
    FILE* fp = fopen( "LunaVerInfo.ver", "r" );
    if( fp == NULL )
        return;
    fscanf( fp, "%s", temp );
    fclose( fp );
 
    temp[10] = NULL;
    fp = fopen( "LunaVerInfo.ver", "w" );
    if( fp == NULL )
        return;
    fprintf( fp, "%s%s", temp, "01" );
    fclose( fp );
}
 
BOOL SaveFileList()
{
    DWORD count = 1;
    HANDLE hSrch;
    WIN32_FIND_DATA wfd;
    SYSTEMTIME time;
    char Dir[MAX_PATH];
    char filename[MAX_PATH];
    BOOL bResult = TRUE;
    
    GetWindowsDirectory( Dir, MAX_PATH );
    strcat( Dir, "\\mfl.dat" );
    FILE* fp = fopen( Dir, "w" );
    if( fp == NULL )
    {
        fclose( fp );
        return FALSE;
    }
 
    GetCurrentDirectory( MAX_PATH, filename );
    strcat( filename, "\\Resource\\*.bin" );
    hSrch = FindFirstFile( filename, &wfd );
    while( bResult )
    {
        FileTimeToSystemTime( &wfd.ftLastWriteTime, &time );
        fprintf( fp, "%d %s\t", count, wfd.cFileName );
        fprintf( fp, "%4d %02d %02d %02d %02d\n", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute );
        bResult = FindNextFile( hSrch, &wfd );
        ++count;
    }
    
    bResult = TRUE;
    GetCurrentDirectory( MAX_PATH, filename );
    strcat( filename, "\\Resource\\SkillArea\\*.bsad" );
    hSrch = FindFirstFile( filename, &wfd );
    while( bResult )
    {
        FileTimeToSystemTime( &wfd.ftLastWriteTime, &time );
        fprintf( fp, "%d %s\t", count, wfd.cFileName );
        fprintf( fp, "%4d %02d %02d %02d %02d\n", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute );
        bResult = FindNextFile( hSrch, &wfd );
        ++count;
    }
 
    fclose( fp );
 
    return TRUE;
}
 
#ifdef _HACK_SHIELD_
BOOL HS_Init(void)
{
    int     dwRet = 0;          // _AhnHS_Initialize Լ  
 
 
    TCHAR   szFullFilePath[MAX_PATH];   //  
    TCHAR   szMsg[MAX_PATH];        // ޽ 
    DWORD   dwOption = 0;           // ʱ* ɼ
 
    //    θ մϴ.
    //   :
    //    GetCurrentDirectory Լ ƴ, GetModuleFileName Լ ̿ؼ* 
    //     θ Ͻñ ٶϴ.
    strcpy(  szFullFilePath, DIRECTORYMGR->GetFullDirectoryName(eLM_Root) );
    // Ӱ  HackShield EhSvc.Dll   
    lstrcat ( szFullFilePath, _T( "HShield\\EhSvc.dll" ) );
 
    // ʱ* ɼ մϴ. AHNHS_CHKOPT_ ϴ ɼ  Ϸ
 
 
    // dwOption = AHNHS_CHKOPT_ALL  ϰ   ֽϴ.
    // ڼ  "α׷ ̵" ϼ.
    //   :
    //      , 
    //    AHNHS_CHKOPT_READWRITEPROCESSMEMORY, AHNHS_CHKOPT_KDTARCER
    //    AHNHS_CHKOPT_OPENPROCESS, AHNHS_CHKOPT_MESSAGEHOOK ɼ 
    //    ϼž  մϴ.
    dwOption = 
#ifndef _GMTOOL_
        AHNHS_CHKOPT_READWRITEPROCESSMEMORY |
        AHNHS_CHKOPT_KDTRACER |
//      AHNHS_CHKOPT_KDTARCER |
        AHNHS_CHKOPT_OPENPROCESS |
        AHNHS_CHKOPT_MESSAGEHOOK |
#endif
        AHNHS_CHKOPT_ALL;
        
 
    // HackShield * ʱ*
 
 
    // ʱ* Լ _AhnHS_Initialize      ֽϴ.
    // 3°: ڵ,
    // 4°: ̼ Ű,
    // 6°: ǵ ΰ
 
 
    //   ˸  üϽñ ٶϴ.
    // ڼ  "α׷ ̵" ϼ
 
    dwRet = _AhnHS_Initialize ( szFullFilePath, HS_CallbackProc, 5885, "01740D2BA4853F462EAE1256", 
        dwOption, AHNHS_SPEEDHACK_SENSING_RATIO_HIGH );
 
    // HackShield ʱ*    ó
    if ( dwRet != HS_ERR_OK ) 
    {
        // _AhnHS_Initialize Լ ȣ  ÿ Ѿ ڵ忡  óִ κԴϴ.
        // "α׷ ̵" Ͻþ  ޽ ֽñ ٶϴ.
        switch ( dwRet )
        {
        case HS_ERR_INVALID_PARAM:
            {
                wsprintf ( szMsg, "[HS Code=%x] Init: ߸ CallbackԼ    ̼ Ű   ùٸ ʽϴ. ", 
                    dwRet );
                break;
            }
        case HS_ERR_INVALID_LICENSE:
            {
                wsprintf ( szMsg, "[HS Code=%x] Init: ̼ Ű ùٸ ʽϴ.", 
                    dwRet );
                break;
            }
        default:
            {
                wsprintf ( szMsg, "[HS Code=%x] Init:     ߻Ͽϴ.", 
                    dwRet );
                break;
            }
        }
        //  * ˸ ޽ ߻մϴ.
//      MessageBox( _g_hWnd, szMsg, "HSERR", MB_OK );
 
 
        return FALSE;
    }
    return TRUE;
}
 
// HackShield * 
BOOL HS_StartService ( void )
{
    int     nReturn = 0;
    TCHAR   szMsg[MAX_PATH];
 
    //  Լ ȣ 
    nReturn = _AhnHS_StartService();
 
    // HackShield  н  ó
    if ( nReturn != HS_ERR_OK )
    {
        switch ( nReturn )
        {
        case HS_ERR_NOT_INITIALIZED:
            {
                wsprintf ( szMsg, "[HS Code=%x] StartService: _Ahn_HS_Initialize ʱ* ʿմϴ. ", nReturn ); 
                    break;
            }
        case HS_ERR_ALREADY_SERVICE_RUNNING:
            {
                wsprintf ( szMsg, "[HS Code=%x] StartService: _Ahn_HS_Initialize  ̹ ʱ* Ǿ ֽϴ.", nReturn );
                    break;
            }
 
        default:
            {
                wsprintf ( szMsg, "[HS Code=%x] StartService:     ߻Ͽϴ. ", nReturn );
                    break;
            }
        }
        // ӳ* ˸ ޽ ߻մϴ.
//      MsgBox (szMsg, "˸" ..);
        return FALSE;
    }
    return TRUE;
}
 
// HackShield * 
BOOL HS_StopService ( void )
{
    int     nReturn = 0;
//  TCHAR   szMsg[MAX_PATH];
 
    nReturn = _AhnHS_StopService();
 
    // HackShield     ó
    if ( nReturn != HS_ERR_OK ) 
    {
//      ...
            return FALSE;
    }
    return TRUE;
}
 
// HackShield * 
BOOL HS_UnInit ( void )
{
    int     nReturn = 0;
//  TCHAR   szMsg[MAX_PATH];
 
    nReturn = _AhnHS_Uninitialize();
 
    // HackShield     ó
    if ( nReturn != HS_ERR_OK ) 
    {
//      ..
            return FALSE;
    }
    return TRUE;
}
 
// HackShield *񽺷κ Ǵ  ŷ ̺Ʈ ϱ  ݹ Լ
int __stdcall HS_CallbackProc( long lCode, long lParamSize, void* pParam )
{
    TCHAR   szMsg[MAX_PATH];
 
    switch ( lCode )
    {
    case AHNHS_ENGINE_DETECT_GAME_HACK:
        {
            wsprintf ( szMsg, "[HS Code=%x] MoSiang can't play with this program[%s].", lCode, ( LPTSTR ) pParam );
            MessageBox( _g_hWnd, szMsg, "HSError", MB_OK );
 
                //  * ˸ ޽ ߻մϴ.
//              MsgBox (szMsg, "˸" ..);
            // Ḧ մϴ.
            //PostQuitMessage(0);
            PostMessage( _g_hWnd, WM_CLOSE, NULL, NULL );
        }
        break;
//  case AHNHS_ACTAPC_DETECT_SPEEDHACK_APP:
    case AHNHS_ACTAPC_DETECT_SPEEDHACK:
        {
            wsprintf ( szMsg, "[HS Code=%x] Detected SpeedHack.", lCode);
            MessageBox( _g_hWnd, szMsg, "HSError", MB_OK );
                //  * ˸ ޽ ߻մϴ.
    //          MsgBox (szMsg, "˸" ..);
            // ǵ 뿡 ΰ α׷ * մϴ.
            //PostQuitMessage(0);
            PostMessage( _g_hWnd, WM_CLOSE, NULL, NULL );
        }
        break;
    case AHNHS_ACTAPC_DETECT_KDTRACE_CHANGED:
    case AHNHS_ACTAPC_DETECT_KDTRACE:
        {
            wsprintf ( szMsg, "[HS Code=%x] Detected Debuging.", lCode);
            MessageBox( _g_hWnd, szMsg, "HSError", MB_OK );
 
            //  * ˸ ޽ ߻մϴ.
//          MsgBox (szMsg, "˸" ..);
            // ڰ α׷  ۾  ɼ Ƿ Ḧ մϴ.
            //PostQuitMessage(0);
            PostMessage( _g_hWnd, WM_CLOSE, NULL, NULL );
        }
        break;
    case AHNHS_ACTAPC_DETECT_HOOKFUNCTION:
    case AHNHS_ACTAPC_DETECT_MESSAGEHOOK:
    case AHNHS_ACTAPC_DETECT_MODULE_CHANGE:
        {
            wsprintf ( szMsg, "[HS Code=%x] HackShield Error.", lCode );
            MessageBox( _g_hWnd, szMsg, "HSError", MB_OK );
            //  * ˸ ޽ ߻մϴ.
//          MsgBox (szMsg, "˸" ..);
            // Ḧ 
 
 
            //PostQuitMessage(0);
            PostMessage( _g_hWnd, WM_CLOSE, NULL, NULL );
        }
        break;
//  case AHNHS_ENGINE_DETECT_GENERAL_HACK:
    case AHNHS_ACTAPC_DETECT_ALREADYHOOKED:
    case AHNHS_ACTAPC_DETECT_DRIVERFAILED:
//  case AHNHS_ACTAPC_DETECT_SPEEDHACK_APP:
        {
            //    ó ŵ ˴ϴ.
            break;
        }
    }
    return 1;
}
 
//  HS_PauseService :
//    Ư XP OS* äâ ѱŰ Է Ұ ,
//    Ű MSG Hooking ȣ  Ͻ ϴ ԼԴϴ.
BOOL HS_PauseService ( void )
{
    int     nReturn = 0;
    TCHAR   szMsg[MAX_PATH];
 
    nReturn = _AhnHS_PauseService ( AHNHS_CHKOPT_MESSAGEHOOK );
 
    if ( nReturn != HS_ERR_OK )
    {
        switch ( nReturn )
        {
        case HS_ERR_NOT_INITIALIZED:
            {
                wsprintf ( szMsg, "[HS Code=%x] PauseService: _Ahn_HS_Initialize ʱ* ʿմϴ. ", nReturn );
                    break;
            }
        case HS_ERR_SERVICE_NOT_RUNNING:
            {
                wsprintf ( szMsg, "[HS Code=%x] PauseService: _Ahn_HS_StartService  ʿմϴ.", nReturn );
                break;
            }
 
        default:
            {
                wsprintf ( szMsg, "[HS Code=%x] PauseService: ˼  ߻ Ͽϴ.", 
                    nReturn );
                break;
            }
        }
        // ӳ* ˸ ޽ ߻մϴ.
//      MsgBox (szMsg, "˸" ..);
        return FALSE;
    }
    return TRUE;
}
 
// _AhnHS_PauseService() Լ ̿Ͽ,
//  Ű MSG Hooking ȣ   Ѵ.
BOOL HS_ResumeService ( void )
{
    int     nReturn = 0;
    TCHAR   szMsg[MAX_PATH];
 
    nReturn = _AhnHS_ResumeService ( AHNHS_CHKOPT_MESSAGEHOOK );
 
    if ( nReturn != HS_ERR_OK )
    {
        switch ( nReturn )
        {
        case HS_ERR_NOT_INITIALIZED:
            {
                wsprintf ( szMsg, "[HS Code=%x] ResumeService: _Ahn_HS_Initialize ʱ* ʿմϴ.", nReturn );
                    break;
            }
        case HS_ERR_SERVICE_NOT_RUNNING:
            {
                wsprintf ( szMsg, "[HS Code=%x] ResumeService: _Ahn_HS_StartService  ʿմϴ.", nReturn );
                    break;
            }
 
        default:
            {
                wsprintf( szMsg, "[HS Code=%x] ResumeService:     ߻Ͽϴ.", nReturn );
                    break;
            }
        }
        // ӳ* ˸ ޽ ߻մϴ.
//      MsgBox (szMsg, "˸" ..);
        return FALSE;
    }
    return TRUE;
}
 
void HS_SaveFuncAddress()
{
//  TCHAR   szMsg[MAX_PATH];
 
    int nResult = _AhnHS_SaveFuncAddress( 3,
                                            HS_Init,
                                            HS_CallbackProc,
                                            CHackShieldManager::NetworkMsgParse
                                            );
}
 
#endif
 
#ifdef _NPROTECT_
BOOL CALLBACK NPGameMonCallback(DWORD dwMsg, DWORD dwArg)
{
    return NPROTECTMGR->MsgProc(dwMsg, dwArg);
}
#endif
?
-==-
08.05.2013, 09:42
  #6

:

Yachi, ( 3 , 5 ),

Yachi
0 / 0 / 0
: 08.05.2013
: 5
08.05.2013, 09:45  []     #7
.
-==-
08.05.2013, 09:51
  #8

:

Yachi, , ...

Yachi
0 / 0 / 0
: 08.05.2013
: 5
08.05.2013, 10:01  []     #9

:

, , , )



8
C++
1
2
3
4
5
6
7
8
9
10
11
cWindowManager.obj : error LNK2019: unresolved external symbol "int __cdecl HS_ResumeService(void)" (?HS_ResumeService@@YAHXZ) referenced in function "public: void __thiscall cWindowManager::SetFocusedEdit(class cWindow *,int)" (?SetFocusedEdit@cWindowManager@@QAEXPAVcWindow@@H@Z)
cWindowManager.obj : error LNK2019: unresolved external symbol "int __cdecl HS_PauseService(void)" (?HS_PauseService@@YAHXZ) referenced in function "public: void __thiscall cWindowManager::SetFocusedEdit(class cWindow *,int)" (?SetFocusedEdit@cWindowManager@@QAEXPAVcWindow@@H@Z)
..\CWorking/LUNAClient.exe : fatal error LNK1120: 2 unresolved externals
 
Build log was saved at "file://c:\Luna Plus\7830dd80e4db108c\7830dd80e4db108c\Obj\LUNAClient\Release\BuildLog.htm"
LUNA Client - 3 error(s), 1 warning(s)
 
 
---------------------- Done ----------------------
 
    Build: 0 succeeded, 1 failed, 0 skipped
Taatshi
08.05.2013, 10:03
  #10

:

-==-, .

MoreAnswers
37091 / 29110 / 5898
: 17.06.2006
: 43,301
08.05.2013, 10:07    
:

. C++
C++
, 80 C++



:
-==-
08.05.2013, 10:07    
  #11

:

Yachi, - . , , - .

Yandex
08.05.2013, 10:07    

: 08:27. GMT +3.
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
@Mail.ru