/
hooking.cpp
1722 lines (1463 loc) · 67.7 KB
/
hooking.cpp
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
/*
Copyright 2016-2017 sub1to
This file is part of subVersion 2 GTA:O Hack.
subVersion 2 GTA:O Hack is free software: you can redistribute
it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
subVersion 2 GTA:O Hack is distributed in the hope that it
will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with subVersion 2 GTA:O Hack. If not, see <http://www.gnu.org/licenses/>.
*/
#include "stdafx.h"
/*
//Init static public members
*/
std::vector<LPVOID> CHooking::m_hooks;
eGameState* CHooking::m_gameState;
CBlipList* CHooking::m_blipList;
CReplayInterface* CHooking::m_replayIntf;
__int64** CHooking::m_globalBase;
MemoryPool** CHooking::m_entityPool;
//CRITICAL_SECTION CHooking::m_critSec;
threeBytes* CHooking::m_infAmmo;
threeBytes* CHooking::m_noReload;
CViewPort* CHooking::m_viewPort;
screenReso* CHooking::m_resolution;
void* CHooking::m_objectHashTable;
void* CHooking::m_objectHashTableSectionEnd;
void* CHooking::m_onlineName;
twoBytes* CHooking::m_ownedExplosionBypass;
uint64_t* CHooking::m_frameCount;
CTextInfo* CHooking::m_textInfo;
char* CHooking::m_onscreenKeyboardResult;
clockTime* CHooking::m_clockTime;
uint64_t* CHooking::m_networkTime;
MemoryPool** CHooking::m_pedPool;
void* CHooking::m_gameInfo;
CPlayers* CHooking::m_players;
fpIsEntityDead CHooking::is_entity_dead;
//fpIsPlayerOnline CHooking::IS_PLAYER_ONLINE;
fpIsPlayerPlaying CHooking::is_player_playing;
fpPlayerId CHooking::player_id;
fpGetPlayerPed CHooking::get_player_ped;
fpGetPlayerTeam CHooking::get_player_team;
fpGetVehiclePedIsUsing CHooking::get_vehicle_ped_is_using;
fpGetPedInVehicleSeat CHooking::get_ped_in_vehicle_seat;
fpIsAimCamActive CHooking::is_aim_cam_active;
fpGetEntityPlayerIsFreeAimingAt CHooking::get_entity_player_is_free_aiming_at;
fpNetworkIsSessionStarted CHooking::network_is_session_started;
fpGetEntitySpeed CHooking::get_entity_speed;
fpGetPlayerName CHooking::get_player_name;
fpDrawRect CHooking::draw_rect;
fpDrawLine CHooking::draw_line;
fpGetGroundZFor3dCoord CHooking::get_ground_z_for_3d_coord;
fpCreateVehicle CHooking::create_vehicle;
fpSetEntityCoordsNoOffset CHooking::set_entity_coords_no_offset;
fpGetEntityHeading CHooking::get_entity_heading;
fpGetGameplayCamRot CHooking::get_gameplay_cam_rot;
fpGetGameplayCamCoord CHooking::get_gameplay_cam_coord;
fpGetPlayerGroup CHooking::get_player_group;
fpSetPlayerModel CHooking::set_player_model;
fpSetPedRandomComponentVariatian CHooking::set_ped_random_component_variation;
fpSetPedDefaultComponentVariation CHooking::set_ped_default_component_variation;
fpIsPedInAnyVehicle CHooking::is_ped_in_any_vehicle;
fpCreatePed CHooking::create_ped;
fpSetPedIntoVehicle CHooking::set_ped_into_vehicle;
fpSetPedConfigFlag CHooking::set_ped_config_flag;
fpClearPedBloodDamage CHooking::clear_ped_blood_damage;
fpClearPedWetness CHooking::clear_ped_wetness;
fpCreateObject CHooking::create_object;
//fpGetPedNearbyVehicles CHooking::get_ped_nearby_vehicles;
//fpGetPedNearbyPeds CHooking::get_ped_nearby_peds;
fpGetPedGroupIndex CHooking::get_ped_group_index;
fpClonePed CHooking::clone_ped;
fpNetworkShopBeginService CHooking::network_shop_begin_service;
fpNetworkShopCheckoutStart CHooking::network_shop_checkout_start;
fpStatSetInt CHooking::stat_set_int;
fpStatSetFloat CHooking::stat_set_float;
fpStatSetBool CHooking::stat_set_bool;
fpStatSetDate CHooking::stat_set_date;
fpStatGetInt CHooking::stat_get_int;
fpAddExplosion CHooking::add_explosion;
fpGiveDelayedWeaponToPed CHooking::give_delayed_weapon_to_ped;
fpRemoveAllPedWeapons CHooking::remove_all_ped_weapons;
fpRemoveWeaponFromPed CHooking::remove_weapon_from_ped;
fpSetMobileRadio CHooking::set_mobile_radio;
fpGetPlayerRadioStationIndex CHooking::get_player_radio_station_index;
fpGetRadioStationName CHooking::get_radio_station_name;
fpNetworkHasControlOfEntity CHooking::network_has_control_of_entity;
fpAddOwnedExplosion CHooking::add_owned_explosion;
fpNetworkRequestControlOfEntity CHooking::network_request_control_of_entity;
fpNetworkGetNetworkIdFromEntity CHooking::network_get_network_id_from_entity;
fpNetworkHasControlOfNetworkId CHooking::network_has_control_of_network_id;
fpNetworkRequestControlOfNetworkId CHooking::network_request_control_of_network_id;
fpSetNetworkIdCanMigrate CHooking::set_network_id_can_migrate;
fpNetworkCreateSynchronisedScene CHooking::network_create_synchronised_scene;
fpNetworkAddPedToSynchronisedScene CHooking::network_add_ped_to_synchronised_scene;
fpNetworkStartSynchronisedScene CHooking::network_start_synchronised_scene;
fpClearPedTasksImmediately CHooking::clear_ped_tasks_immediately;
fpSetEntityVisible CHooking::set_entity_visible;
fpSetPedAsGroupMember CHooking::set_ped_as_group_member;
fpIsPedGroupMember CHooking::is_ped_group_member;
fpSetPedGravity CHooking::set_ped_gravity;
fpSetEntityHasGravity CHooking::set_entity_has_gravity;
fpIsVehicleDrivable CHooking::is_vehicle_drivable;
fpIsModelAHeli CHooking::is_model_a_heli;
fpIsModelAPlane CHooking::is_model_a_plane;
fpIsModelACar CHooking::is_model_a_car;
fpSetHeliBladesFullSpeed CHooking::set_heli_blades_full_speed;
fpSetVehicleForwardSpeed CHooking::set_vehicle_forward_speed;
fpSetVehicleNumberPlateText CHooking::set_vehicle_number_plate_text;
fpSetPedToRagdoll CHooking::set_ped_to_ragdoll;
fpGetPedBoneCoords CHooking::get_ped_bone_coords;
fpSetEntityAsMissionEntity CHooking::set_entity_as_mission_entity;
fpApplyForceToEntity CHooking::apply_force_to_entity;
fpSetEntityRotation CHooking::set_entity_rotation;
fpSetEntityHeading CHooking::set_entity_heading;
fpFreezeEntityPosition CHooking::freeze_entity_position;
fpShootSingleBulletBetweenCoords CHooking::shoot_single_bullet_between_coords;
fpSetPedNeverLeavesGroup CHooking::set_ped_never_leaves_group;
fpSetGroupFormation CHooking::set_group_formation;
fpGetPedBoneIndex CHooking::get_ped_bone_index;
fpSetPedComponentVariation CHooking::set_ped_component_variation;
fpClearAllPedProps CHooking::clear_add_ped_props;
fpSetPedPropIndex CHooking::set_ped_prop_index;
fpIsEntityInAir CHooking::is_entity_in_air;
fpSetEntityVelocity CHooking::set_entity_velocity;
fpGetEntityAttachedTo CHooking::get_entity_attached_to;
fpDetachEntity CHooking::detach_entity;
fpDeleteEntity CHooking::delete_entity;
fpIsEntityAttached CHooking::is_entity_attached;
fpSetEntityAsNoLongerNeeded CHooking::set_entity_as_no_longer_needed;
fpGetEntityVelocity CHooking::get_entity_velocity;
fpGetEntityRotation CHooking::get_entity_rotation;
fpGetEntityModel CHooking::get_entity_model;
fpSetVehicleOnGroundProperly CHooking::set_vehicle_on_ground_properly;
fpSetVehicleUndriveable CHooking::set_vehicle_undriveable;
fpSetVehicleFixed CHooking::set_vehicle_fixed;
fpSetVehicleDeformationFixed CHooking::set_vehicle_deformation_fixed;
fpIsVehicleSeatFree CHooking::is_vehicle_seat_free;
fpSetVehicleModKit CHooking::set_vehicle_mod_kit;
fpSetVehicleNumberPlateIndex CHooking::set_vehicle_number_plate_index;
fpToggleVehicleMod CHooking::toggle_vehicle_mod;
fpSetVehicleMod CHooking::set_vehicle_mod;
fpSetVehicleWheelType CHooking::set_vehicle_wheel_type;
fpGetNumVehicleMod CHooking::get_num_vehicle_mod;
fpAddTextCompSubstrPlayerName CHooking::add_text_comp_substr_playername;
fpEndTextCmdDisplayText CHooking::end_text_cmd_display_text;
fpBeginTextCmdDisplayText CHooking::begin_text_cmd_display_text;
fpSetNotificationTextEntiry CHooking::set_notification_text_entry;
fpDrawNotification CHooking::draw_notification;
fpSetWeatherTypeNowPersist CHooking::set_weather_type_now_persist;
fpDisplayOnscreenKeyboard CHooking::display_onscreen_keyboard;
fpUpdateOnscreenKeyboard CHooking::update_onscreen_keyboard;
fpSetLocalPlayerVisibleLocally CHooking::set_local_player_visible_locally;
fpNetworkOverrideClockTime CHooking::network_override_clock_time;
fpGetNetworkTime CHooking::get_network_time;
fpAiTaskWanderStandard CHooking::ai_task_wander_standard;
fpAiTaskPlayAnim CHooking::ai_task_play_anim;
fpIsModelInCdimage CHooking::is_model_in_cdimage;
fpIsModelValid CHooking::is_model_valid;
fpIsModelAVehicle CHooking::is_model_a_vehicle;
fpRequestModel CHooking::request_model;
fpHasModelLoaded CHooking::has_model_loaded;
fpRequestAnimDict CHooking::request_anim_dict;
fpHasAnimDictLoaded CHooking::has_anim_dict_loaded;
fpDecorRegister CHooking::decor_register;
fpDecorSetInt CHooking::decor_set_int;
fpCreateAmbientDrop CHooking::create_ambient_pickup;
fpIsPlayerFreeAiming CHooking::is_player_free_aiming;
fpGetPedLastWeaponImpactCoord CHooking::get_ped_last_weapon_impact;
fpStartRayCast CHooking::start_ray_cast;
fpGetRayCast CHooking::get_ray_cast;
fpPtrToHandle CHooking::ptr_to_handle;
fpNetworkSetInSpectatorMode CHooking::network_set_in_spectator_mode;
fpSetPedCombatAbility CHooking::set_ped_combat_ability;
fpAiTaskCombatPed CHooking::ai_task_combat_ped;
fpTriggerScriptEvent CHooking::trigger_script_event;
fpApplyVehicleColors CHooking::apply_vehicle_colors;
fpSetPedRelationshipGroupHash CHooking::set_ped_relationship_group_hash;
fpSetPlayerVisibleLocally CHooking::set_player_visible_locally;
fpSetModelAsNoLongerNeeded CHooking::set_model_as_no_longer_needed;
fpSetRadioToStationName CHooking::set_radio_to_station_name;
fpSetVehicleEngineOn CHooking::set_vehicle_engine_on;
fpAttachEntityToEntity CHooking::attach_entity_to_entity;
fpSetEntityCollision CHooking::set_entity_collision;
/*
//Private declarations
*/
bool initHooks();
void antiCheatBypass(bool);
bool hookNatives();
void findPatterns();
static void* g_eventPtr[REVENT_END] = { nullptr };
static unsigned char g_eventRestore[REVENT_END] = { 0 };
static std::vector<objectHash> g_antiCrash;
/*
//threeBytes public functions
*/
bool threeBytes::empty()
{
bool r = true;
for(int i = 0; i < 3; ++i)
if(this->byte[i] != 0)
{
r = false;
break;
}
return r;
}
bool twoBytes::empty()
{
bool r = true;
for(int i = 0; i < 2; ++i)
if(this->byte[i] != 0)
{
r = false;
break;
}
return r;
}
/*
//Hooking public functions
*/
void CHooking::init()
{
CLog::msg("Initializing hooks");
// InitializeCriticalSection(&m_critSec);
findPatterns();
//set max menu padding
//this can only be done after this point, because it requires the resolution
static_cast<CFeatActionValueMenu*>(CMenu::getFeature(FEATURE_I_MENU_PADDING_X))->m_fMax = round((m_resolution->w - 320.f) / 25) * 25;
static_cast<CFeatActionValueMenu*>(CMenu::getFeature(FEATURE_I_MENU_PADDING_Y))->m_fMax = round((m_resolution->h - 310.f) / 25) * 25;
while(*CHooking::m_gameState != GameStatePlaying)
Sleep(100);
if(!initHooks())
killProcess();
antiCheatBypass(true);
CLog::msg("Hooks ready");
}
void CHooking::onTick()
{
try
{
CHack::refresh();
}
catch (const std::exception& e)
{
CLog::error((char*) e.what());
}
catch (...)
{
CLog::error("Unknown exception");
}
}
void CHooking::cleanup()
{
antiCheatBypass(false);
CLog::msg("Cleaning up hooks");
for(int i = 0; i < m_hooks.size(); i++)
if(MH_DisableHook(m_hooks[i]) != MH_OK && MH_RemoveHook(m_hooks[i]) != MH_OK)
CLog::error("Failed to unhook %p", (void*) m_hooks[i]);
MH_Uninitialize();
//DeleteCriticalSection(&m_critSec);
}
__int64* CHooking::getGlobalPtr(int index)
{
return &m_globalBase[index >> 0x12 & 0x3F][index & 0x3FFFF];
}
void CHooking::defuseEvent(eRockstarEvent e, bool b)
{
static const BYTE ret = 0xC3;
BYTE* ptr = (BYTE*) g_eventPtr[e];
if(b)
{
if(g_eventRestore[e] == 0)
g_eventRestore[e] = ptr[0];
*ptr = ret;
}
else if(g_eventRestore[e] != 0)
*ptr = g_eventRestore[e];
}
DWORD __stdcall antiCrashSearch(LPVOID lpParam)
{
Hash* hashptr = (Hash*) CHooking::m_objectHashTable;
char* end = (char*) CHooking::m_objectHashTableSectionEnd - 0x20;
for(; (char*) hashptr < end; ++hashptr)
{
if(*hashptr == 0)
continue;
for(int i = 0; i < get_array_size(hash::forbidden_object); ++i)
{
if(*hashptr != hash::forbidden_object[i])
continue;
g_antiCrash.push_back( { hashptr, *hashptr } );
}
}
return S_OK;
}
bool CHooking::antiCrash(bool toggle)
{
static HANDLE hAntiCrash = 0;
constexpr Hash dildo = 0xe6cb661e;
Hash* hashptr = nullptr;
char* end = nullptr;
if(!g_antiCrash.empty() || hAntiCrash)
goto LABEL_SET_VALUE;
if(!toggle)
return true;
hAntiCrash = CreateThread( NULL,
0,
antiCrashSearch,
NULL,
0,
nullptr);
LABEL_SET_VALUE:
if(WaitForSingleObject(hAntiCrash, 0) != WAIT_OBJECT_0) //if the thread is still alive, return; it's still searching
return false;
if(hAntiCrash)
CloseHandle(hAntiCrash);
if(!toggle)
{
for(std::vector<objectHash>::iterator it = g_antiCrash.begin(); it != g_antiCrash.end(); ++it)
{
if(*it->ptr != dildo && *it->ptr != it->hash)
{
g_antiCrash.erase(it);
continue;
}
*it->ptr = it->hash;
}
return true;
}
for(std::vector<objectHash>::iterator it = g_antiCrash.begin(); it != g_antiCrash.end(); ++it)
*it->ptr = dildo;
return true;
}
bool CHooking::setPlayerName(std::string& name)
{
size_t newLen = name.size() + 1;
if(newLen <= 1 || newLen > 20)
return false;
char buffer[0x20] = {};
char* pSearch = (char*) CHooking::m_onlineName + 0x5C;
size_t curLen = strlen(pSearch) + 1;
strncpy_s(buffer, pSearch, curLen);
for(uint32_t i = 0, found = 0, match = 0; found < 4; ++pSearch)
{
if(*pSearch != buffer[i])
goto LABEL_RESET;
if(++match < curLen)
{
++i;
continue;
}
strncpy_s(pSearch - i, newLen, &name[0], newLen);
++found;
LABEL_RESET:
i = match = 0;
}
strncpy_s(CPlayerMem::get_player_cped(CPlayerMem::player_id())->pCPlayerInfo->sName, &name[0], newLen);
return true;
}
void CHooking::ownedExplosionBypass(bool toggle)
{
constexpr twoBytes patched = { 0x39, 0xDB };
constexpr twoBytes restore = { 0x3B, 0xD8 };
if(m_ownedExplosionBypass == nullptr)
return;
*m_ownedExplosionBypass = toggle ? patched : restore;
}
/*
//Hooking private functions
*/
bool initHooks()
{
if(MH_Initialize() != MH_OK)
killProcess("MinHook failed to initialize");
if(!hookNatives())
killProcess("Failed to initialize hooks");
return true;
}
void antiCheatBypass(bool b = true)
{
CHooking::defuseEvent(REVENT_REQUEST_PICKUP_EVENT, b); //bypass pickup detection
CHooking::ownedExplosionBypass(b);
//CHooking::defuseEvent(REVENT_REPORT_MYSELF_EVENT, b);
//CHooking::defuseEvent(REVENT_REPORT_CASH_SPAWN_EVENT, b);
}
fpIsEntityDead OG_IS_ENTITY_DEAD = nullptr;
BOOL __cdecl HK_IS_ENTITY_DEAD(Entity entity)
{
static uint64_t last = 0;
uint64_t cur = *CHooking::m_frameCount;
if (last != cur)
{
last = cur;
CHooking::onTick();
}
return OG_IS_ENTITY_DEAD(entity);
}
/*fpTriggerScriptEvent OG_TRIGGER_SCRIPT_EVENT = nullptr;
BOOL __cdecl HK_TRIGGER_SCRIPT_EVENT(bool unk0, uint64_t* args, int argCount, int bitFlags)
{
CLog::msg("SCRIPT_EVENT unk0: 0x%016llx", unk0);
for(int i = 0; i < argCount; ++i)
CLog::msg("SCRIPT_EVENT p2[%i]: 0x%016llx", i, args[i]);
CLog::msg("SCRIPT_EVENT bitFlags: 0x%016llx", bitFlags);
return OG_TRIGGER_SCRIPT_EVENT(unk0, args, argCount, bitFlags);
}*/
bool hookNatives()
{
MH_STATUS status = MH_CreateHook(CHooking::is_entity_dead, HK_IS_ENTITY_DEAD, (void**) &OG_IS_ENTITY_DEAD);
if((status != MH_OK && status != MH_ERROR_ALREADY_CREATED) || MH_EnableHook(CHooking::is_entity_dead) != MH_OK)
return false;
CHooking::m_hooks.push_back(CHooking::is_entity_dead);
//status = MH_CreateHook(CHooking::trigger_script_event, HK_TRIGGER_SCRIPT_EVENT, (void**) &OG_TRIGGER_SCRIPT_EVENT);
//if((status != MH_OK && status != MH_ERROR_ALREADY_CREATED) || MH_EnableHook(CHooking::trigger_script_event) != MH_OK)
// return false;
//CHooking::m_hooks.push_back(CHooking::trigger_script_event);
return true;
}
void failPat(const char* name)
{
CLog::fatal("Failed to find %s pattern.", name);
killProcess();
}
template <typename T>
void setPat
(
const char* name,
char* pat,
char* mask,
T** out,
bool rel,
int offset = 0,
int deref = 0,
int skip = 0
)
{
T* ptr = nullptr;
CPattern pattern(pat, mask);
pattern.find(1 + skip);
if(rel)
ptr = pattern.get(skip).get_rel<T>(offset);
else
ptr = pattern.get(skip).get<T>(offset);
while(true)
{
if(ptr == nullptr)
failPat(name);
if(deref <= 0)
break;
ptr = *(T**) ptr;
--deref;
}
*out = ptr;
return;
}
template <typename T>
void setFn
(
const char* name,
char* pat,
char* mask,
T* out,
int skip = 0
)
{
char* ptr = nullptr;
CPattern pattern(pat, mask);
pattern.find(1 + skip);
ptr = pattern.get(skip).get<char>(0);
if(ptr == nullptr)
failPat(name);
*out = (T) ptr;
return;
}
void findPatterns()
{
char* ptr = nullptr;
constexpr char pattern_event[] = "\x4C\x8D\x05";
HANDLE steam = GetModuleHandleA("steam_api64.dll");
//game state
setPat<eGameState>( "game state",
"\x8B\x05\x00\x00\x00\x00\x33\xED\x8B\xF2",
"xx????xxxx",
&CHooking::m_gameState,
true,
2);
//world
setPat<CWorld>( "world",
"\x48\x8B\x05\x00\x00\x00\x00\x4C\x8B\x68\x08\x4C\x89\xAD\xD8\x03\x00\x00\x4D\x85\xED\x0F\x84\x93\x04\x00\x00\x8D\x4B\x0F\x48\x8D",
"xxx????xxxxxxxxxxxxxxxxxxxxxxxxx",
&CHack::m_pCWorld,
true,
3,
1);
//blips
setPat<CBlipList>( "blip list",
"\x4C\x8D\x05\x00\x00\x00\x00\x0F\xB7\xC1",
"xxx????xxx",
&CHooking::m_blipList,
true,
3);
//replay interface
setPat<CReplayInterface>( "replay interface",
"\x48\x8D\x0D\x00\x00\x00\x00\x48\x8B\xD7\xE8\x00\x00\x00\x00\x48\x8D\x0D\x00\x00\x00\x00\x8A\xD8\xE8\x00\x00\x00\x00\x84\xDB\x75\x13\x48\x8D\x0D\x00\x00\x00\x00",
"xxx????xxxx????xxx????xxx????xxxxxxx????",
&CHooking::m_replayIntf,
true,
3,
1);
//global
setPat<__int64*>( "global",
"\x4C\x8D\x05\x00\x00\x00\x00\x4D\x8B\x08\x4D\x85\xC9\x74\x11",
"xxx????xxxxxxxx",
&CHooking::m_globalBase,
true,
3);
//player list
setPat<CPlayers>( "player list",
"\x48\x8B\x0D\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x48\x8B\xC8\xE8\x00\x00\x00\x00\x48\x8B\xCF",
"xxx????x????xxxx????xxx",
&CHooking::m_players,
true,
3);
//entity pool
setPat<MemoryPool*>( "entity pool",
"\x4C\x8B\x0D\x00\x00\x00\x00\x44\x8B\xC1\x49\x8B\x41\x08",
"xxx????xxxxxxx",
&CHooking::m_entityPool,
true,
3);
//ped pool
setPat<MemoryPool*>( "ped pool",
"\x48\x8B\x05\x00\x00\x00\x00\x41\x0F\xBF\xC8\x0F\xBF\x40\x10",
"xxx????xxxxxxxx",
&CHooking::m_pedPool,
true,
3);
//viewport
setPat<CViewPort>( "viewport",
"\x48\x8B\x15\x00\x00\x00\x00\x48\x8D\x2D\x00\x00\x00\x00\x48\x8B\xCD",
"xxx????xxx????xxx",
&CHooking::m_viewPort,
true,
3,
1);
//resolution
setPat<screenReso>( "resolution",
"\x8B\x0D\x00\x00\x00\x00\x49\x8D\x56\x28",
"xx????xxxx",
&CHooking::m_resolution,
true,
2);
//player name
setPat<void>( "name changer",
"\x48\x8B\x05\x00\x00\x00\x00\xC3\x8A\xD1",
"xxx????xxx",
&CHooking::m_onlineName,
true,
3,
1);
//frame count
setPat<uint64_t>( "frame count",
"\x8B\x15\x00\x00\x00\x00\x41\xFF\xCF",
"xx????xxx",
&CHooking::m_frameCount,
true,
2);
//text color
setPat<CTextInfo>( "text info",
"\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x44\x24\x00\x8B\x05\x00\x00\x00\x00\x89\x44\x24\x28",
"xxx????xxxx?xx????xxxx",
&CHooking::m_textInfo,
true,
3);
//clock time
setPat<clockTime>( "clock time",
"\x48\x8D\x0D\x00\x00\x00\x00\x8B\xFA\xE8\x00\x00\x00\x00\x44\x8D\x0C\x5B",
"xxx????xxx????xxxx",
&CHooking::m_clockTime,
true,
3);
//network time
setPat<uint64_t>( "network time",
"\x8B\x0D\x00\x00\x00\x00\x3B\xCB\x0F\x47\xCB",
"xx????xxxxx",
&CHooking::m_networkTime,
true,
2);
//game info (p0 for set_radio_to_station_name)
setPat<void>( "game info",
"\x48\x8D\x0D\x00\x00\x00\x00\x41\xB0\x01\x33\xD2\x88\x1D",
"xxx????xxxxxxx",
&CHooking::m_gameInfo,
true,
3);
//inf ammo
setPat<threeBytes>( "infinite ammo",
"\x41\x2B\xD1\xE8",
"xxxx",
&CHooking::m_infAmmo,
false);
//no reload
setPat<threeBytes>( "no reload",
"\x41\x2B\xC9\x3B\xC8\x0F",
"xxxxxx",
&CHooking::m_noReload,
false);
//owned explosion bypass
setPat<twoBytes>( "owned explosion bypass",
"\x3B\xD8\x0F\x94\xC3",
"xxxxx",
&CHooking::m_ownedExplosionBypass,
false);
if(!steam)
{
//onscreen keyboard result
setPat<char>( "onscreen keyboard result",
"\x48\x8D\x0D\x00\x00\x00\x00\x41\x3B\xC0",
"xxx????xxx",
&CHooking::m_onscreenKeyboardResult,
true,
3);
}
else
{
//onscreen keyboard result
setPat<char>( "onscreen keyboard result",
"\x48\x8D\x0D\x00\x00\x00\x00\x41\xB9\x00\x00\x00\x00\x41\x3B\xC0",
"xxx????xx????xxx",
&CHooking::m_onscreenKeyboardResult,
true,
3);
}
/*
//functions
*/
//\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x40\x8A\xFA\xE8\x00\x00\x00\x00\x33\xDB xxxx?xxxx?xxxxxxxxx????xx
//fpIsEntityDead is_entity_dead;
//is_entity_dead
setFn<fpIsEntityDead>( "is_entity_dead",
"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x40\x8A\xFA\xE8\x00\x00\x00\x00\x33\xDB",
"xxxx?xxxx?xxxxxxxxx????xx",
&CHooking::is_entity_dead);
//is_player_playing
setFn<fpIsPlayerPlaying>( "is_player_playing",
"\x48\x83\xEC\x28\x33\xD2\xE8\x00\x00\x00\x00\x48\x85\xC0",
"xxxxxxx????xxx",
&CHooking::is_player_playing);
//player_id
setFn<fpPlayerId>( "player_id",
"\x48\x83\xEC\x28\x80\x3D\x00\x00\x00\x00\x00\x74\x12\x48\x8B\x0D\x00\x00\x00\x00\xE8",
"xxxxxx?????xxxxx????x",
&CHooking::player_id);
//get_player_ped
setFn<fpGetPlayerPed>( "get_player_ped",
"\x40\x53\x48\x83\xEC\x20\x33\xDB\x83\xF9\xFF\x74\x09\xB2\x01\xE8\x00\x00\x00\x00\xEB\x16",
"xxxxxxxxxxxxxxxx????xx",
&CHooking::get_player_ped);
//get_player_team
setFn<fpGetPlayerTeam>( "get_player_team",
"\x48\x83\xEC\x28\xB2\x01\xE8\x00\x00\x00\x00\x48\x85\xC0\x74\x0C\x48\x8B\xC8\x48\x83\xC4\x28\xE9\x00\x00\x00\x00\x83\xC8\xFF",
"xxxxxxx????xxxxxxxxxxxxx????xxx",
&CHooking::get_player_team);
//get_vehicle_ped_is_using
setFn<fpGetVehiclePedIsUsing>( "get_vehicle_ped_is_using",
"\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x20\x8B\xF9\x33\xDB\xE8\x00\x00\x00\x00\x48\x8B\xD0",
"xxxx?xxxxxxxxxx????xxx",
&CHooking::get_vehicle_ped_is_using);
//get_ped_in_vehicle_seat
setFn<fpGetPedInVehicleSeat>( "get_ped_in_vehicle_seat",
"\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x41\x8A\xE8\x8D\x72\x01",
"xxxx?xxxx?xxxx?xxxxxxxxxxx",
&CHooking::get_ped_in_vehicle_seat);
//is_aim_cam_active
setFn<fpIsAimCamActive>( "is_aim_cam_active",
"\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x20\xE8\x00\x00\x00\x00\x33\xD2\x48\x8B\xC8\x48\x8B\xF8",
"xxxx?xxxxxx????xxxxxxxx",
&CHooking::is_aim_cam_active);
//get_entity_player_is_free_aiming_at
setFn<fpGetEntityPlayerIsFreeAimingAt>( "get_entity_player_is_free_aiming_at",
"\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\xFA\xB2\x01\x33\xDB\xE8\x00\x00\x00\x00\x48\x85\xC0\x74\x3F",
"xxxx?xxxxxxxxxxxxx????xxxxx",
&CHooking::get_entity_player_is_free_aiming_at);
//network_is_session_started
setFn<fpNetworkIsSessionStarted>( "network_is_session_started",
"\x48\x8B\x0D\x00\x00\x00\x00\x33\xC0\x48\x85\xC9\x74\x0E\x83\xB9\x00\x00\x00\x00\x00\x75\x05",
"xxx????xxxxxxxxx?????xx",
&CHooking::network_is_session_started);
//get_entity_speed
setFn<fpGetEntitySpeed>( "get_entity_speed",
"\x48\x83\xEC\x38\x0F\x29\x74\x24\x00\x0F\x57\xF6\xE8\x00\x00\x00\x00\x48\x85\xC0\x74\x3E",
"xxxxxxxx?xxxx????xxxxx",
&CHooking::get_entity_speed);
//get_player_name
setFn<fpGetPlayerName>( "get_player_name",
"\x40\x53\x48\x83\xEC\x20\x80\x3D\x00\x00\x00\x00\x00\x8B\xD9\x74\x22",
"xxxxxxxx?????xxxx",
&CHooking::get_player_name);
//draw_rect
setFn<fpDrawRect>( "draw_rect",
"\x48\x8B\xC4\x48\x89\x58\x08\x57\x48\x83\xEC\x70\x48\x63\x0D\x00\x00\x00\x00\x0F",
"xxxxxxxxxxxxxxx????x",
&CHooking::draw_rect);
//draw_line
setFn<fpDrawLine>( "draw_line",
"\x40\x53\x48\x83\xEC\x40\xF3\x0F\x10\x09\xF3\x0F\x10\x41\x00\xF3\x0F\x10\x51\x00\x45\x8B\xD0\xBB",
"xxxxxxxxxxxxxx?xxxx?xxxx",
&CHooking::draw_line,
1); //skip 1, first one is draw_box
//get_ground_z_for_3d_coord
setFn<fpGetGroundZFor3dCoord>( "get_ground_z_for_3d_coord",
"\x4C\x8B\xDC\x49\x89\x5B\x10\x49\x89\x7B\x20",
"xxxxxxxxxxx",
&CHooking::get_ground_z_for_3d_coord);
//create_vehicle
setFn<fpCreateVehicle>( "create_vehicle",
"\x48\x89\x5C\x24\x00\x55\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8B\xEC\x48\x83\xEC\x50\xF3\x0F\x10\x02",
"xxxx?xxxxxxxxxxxxxxxxxxxxxx",
&CHooking::create_vehicle);
//set_entity_coords_no_offset
setFn<fpSetEntityCoordsNoOffset>( "set_entity_coords_no_offset",
"\x48\x8B\xC4\x48\x89\x58\x08\x48\x89\x70\x10\x57\x48\x81\xEC\x00\x00\x00\x00\xF3\x0F\x10\x15",
"xxxxxxxxxxxxxxx????xxxx",
&CHooking::set_entity_coords_no_offset);
//get_entity_heading
setFn<fpGetEntityHeading>( "get_entity_heading",
"\x48\x83\xEC\x38\x0F\x29\x74\x24\x00\xE8\x00\x00\x00\x00\x0F",
"xxxxxxxx?x????x",
&CHooking::get_entity_heading);
//get_gameplay_cam_rot
setFn<fpGetGameplayCamRot>( "get_gameplay_cam_rot",
"\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x30\x8B\xDA\x48\x8B\xF9\xE8\x00\x00\x00\x00\x48\x8D\x4C\x24\x00\x48\x8D\x90\x00\x00\x00\x00",
"xxxx?xxxxxxxxxxx????xxxx?xxx????",
&CHooking::get_gameplay_cam_rot);
//get_gameplay_cam_coord
setFn<fpGetGameplayCamCoord>( "get_gameplay_cam_coord",
"\x40\x53\x48\x83\xEC\x20\x48\x8B\xD9\xE8\x00\x00\x00\x00\x8B\x90\x00\x00\x00\x00",
"xxxxxxxxxx????xx????",
&CHooking::get_gameplay_cam_coord);
//get_player_group
setFn<fpGetPlayerGroup>( "get_player_group",
"\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x50\xB2\x01",
"xxxx?xxxxxxx",
&CHooking::get_player_group);
//set_player_model
setFn<fpSetPlayerModel>( "set_player_model",
"\x40\x55\x53\x57\x48\x8B\xEC\x48\x83\xEC\x30\x8B\xF9",
"xxxxxxxxxxxxx",
&CHooking::set_player_model);
//set_ped_random_component_variation
setFn<fpSetPedRandomComponentVariatian>( "set_ped_random_component_variation",
"\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x40\x8B\xFA\xE8\x00\x00\x00\x00\x48\x8B\xD8",
"xxxx?xxxxxxxx????xxx",
&CHooking::set_ped_random_component_variation);
//set_ped_default_component_variation
setFn<fpSetPedDefaultComponentVariation>( "set_ped_default_component_variation",
"\x40\x53\x48\x83\xEC\x20\xE8\x00\x00\x00\x00\x48\x8B\xD8\x48\x85\xC0\x74\x2F",
"xxxxxxx????xxxxxxxx",
&CHooking::set_ped_default_component_variation);
//set_ped_default_component_variation
setFn<fpIsPedInAnyVehicle>( "is_ped_in_any_vehicle",
"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x40\x8A\xFA\xE8\x00\x00\x00\x00\x32\xDB",
"xxxx?xxxx?xxxxxxxxx????xx",
&CHooking::is_ped_in_any_vehicle);
//create_ped
setFn<fpCreatePed>( "create_ped",
"\x48\x8B\xC4\x48\x89\x58\x08\x48\x89\x70\x10\x55\x57\x41\x56\x48\x8D\x68\xB1\x48\x81\xEC\x00\x00\x00\x00\x40\x8A\x75\x77",
"xxxxxxxxxxxxxxxxxxxxxx????xxxx",
&CHooking::create_ped);
//set_ped_into_vehicle
setFn<fpSetPedIntoVehicle>( "set_ped_into_vehicle",
"\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x56\x57\x41\x56\x48\x83\xEC\x30\x41\x8B\xE8\x8B\xFA",
"xxxx?xxxx?xxxxxxxxxxxxx",
&CHooking::set_ped_into_vehicle);
//set_ped_config_flag
setFn<fpSetPedConfigFlag>( "set_ped_config_flag",
"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x41\x8A\xF0\x8B\xFA\xE8\x00\x00\x00\x00\x48\x8B\xD8\x48\x85\xC0\x74\x53",
"xxxx?xxxx?xxxxxxxxxxx????xxxxxxxx",
&CHooking::set_ped_config_flag);
//clear_ped_blood_damage
setFn<fpClearPedBloodDamage>( "clear_ped_blood_damage",
"\x40\x53\x48\x83\xEC\x20\x8A\x91\x00\x00\x00\x00\x48\x8B\xD9\x80\xFA\xFF\x74\x51",
"xxxxxxxx????xxxxxxxx",
&CHooking::clear_ped_blood_damage);
//clear_ped_wetness
setFn<fpClearPedWetness>( "clear_ped_wetness",
"\x40\x53\x48\x83\xEC\x20\xE8\x00\x00\x00\x00\x48\x8B\xD8\x48\x85\xC0\x74\x23\x48\x8B\xC8\xE8\x00\x00\x00\x00\x48\x8B\x8B\x00\x00\x00\x00",
"xxxxxxx????xxxxxxxxxxxx????xxx????",
&CHooking::clear_ped_wetness);
//create_object
setFn<fpCreateObject>( "create_object",
"\x48\x8B\xC4\x48\x89\x58\x08\x48\x89\x70\x10\x48\x89\x78\x18\x55\x41\x54\x41\x57\x48\x8D\x68\xD9",
"xxxxxxxxxxxxxxxxxxxxxxxx",
&CHooking::create_object);
//get_ped_nearby_vehicles
//CPattern pattern_get_ped_nearby_vehicles ( "\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x40\x48\x8B\xDA\xE8\x00\x00\x00\x00\x33\xFF",
// "xxxx?xxxx?xxxxxxxxx????xx");
//ptr = pattern_get_ped_nearby_vehicles.find(1).get(0).get<char>(0);
//ptr == nullptr ? killProcess("Failed to find get_ped_nearby_vehicles pattern") : CHooking::get_ped_nearby_vehicles = (fpGetPedNearbyVehicles) ptr;
//get_ped_nearby_peds
//CPattern pattern_get_ped_nearby_peds ( "\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x41\x56\x41\x57\x48\x83\xEC\x20\x45\x8B\xF8\x48\x8B\xDA",
// "xxxx?xxxx?xxxx?xxxxxxxxxxxxxxx");
//ptr = pattern_get_ped_nearby_peds.find(1).get(0).get<char>(0);
//ptr == nullptr ? killProcess("Failed to find get_ped_nearby_peds pattern") : CHooking::get_ped_nearby_peds = (fpGetPedNearbyPeds) ptr;
//get_ped_group_index
setFn<fpGetPedGroupIndex>( "get_ped_group_index",
"\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x50\xE8\x00\x00\x00\x00\x48\x85",
"xxxx?xxxxxx????xx",
&CHooking::get_ped_group_index);
//clone_ped
setFn<fpClonePed>( "clone_ped",
"\x48\x8B\xC4\x48\x89\x58\x08\x48\x89\x68\x10\x48\x89\x70\x18\x48\x89\x78\x20\x41\x56\x48\x83\xEC\x30\x33\xDB\x41\x8A\xF1",
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
&CHooking::clone_ped);
//network_shop_begin_service
setFn<fpNetworkShopBeginService>( "network_shop_begin_service",
"\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x41\x56\x41\x57\x48\x83\xEC\x50\x45\x8B\xF1",
"xxxx?xxxx?xxxx?xxxxxxxxxxxx",
&CHooking::network_shop_begin_service);
//network_shop_checkout_start
setFn<fpNetworkShopCheckoutStart>( "network_shop_checkout_start",
"\x40\x53\x48\x83\xEC\x20\x8B\xD9\xE8\x00\x00\x00\x00\x84\xC0\x75\x06",
"xxxxxxxxx????xxxx",
&CHooking::network_shop_checkout_start);
//stat_set_int
setFn<fpStatSetInt>( "stat_set_int",
"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x89\x54\x24\x10\x55\x57\x41\x57",
"xxxx?xxxx?xxxxxxxx",
&CHooking::stat_set_int);
//stat_set_float
setFn<fpStatSetFloat>( "stat_set_float",
"\x48\x89\x5C\x24\x00\xF3\x0F\x11\x4C\x24\x00\x57\x48\x83\xEC\x40",
"xxxx?xxxxx?xxxxx",
&CHooking::stat_set_float);
//stat_set_bool
setFn<fpStatSetBool>( "stat_set_bool",
"\x48\x89\x5C\x24\x00\x88\x54\x24\x10\x57\x48\x83\xEC\x40",
"xxxx?xxxxxxxxx",
&CHooking::stat_set_bool);
//stat_set_date
setFn<fpStatSetDate>( "stat_set_date",
"\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x60\x48\x8B\xDA\x8B\xF9",
"xxxx?xxxx?xxxxxxxxxx",
&CHooking::stat_set_date);
//stat_get_int
setFn<fpStatGetInt>( "stat_get_int",
"\x48\x8B\xC4\x48\x89\x58\x10\x48\x89\x70\x18\x57\x48\x83\xEC\x30\x48\x8B\xF2",
"xxxxxxxxxxxxxxxxxxx",
&CHooking::stat_get_int);
//give_delayed_weapon_to_ped
setFn<fpGiveDelayedWeaponToPed>( "give_delayed_weapon_to_ped",
"\x48\x89\x5C\x24\x00\x48\x89\x6C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x30\x41\x8A\xE9\x41\x8B\xF0\x8B\xFA\xE8\x00\x00\x00\x00\x48\x8B\xD8\x48\x85\xC0\x74\x63",
"xxxx?xxxx?xxxx?xxxxxxxxxxxxxx????xxxxxxxx",
&CHooking::give_delayed_weapon_to_ped);
//remove_all_ped_weapons
setFn<fpRemoveAllPedWeapons>( "remove_all_ped_weapons",
"\x48\x83\xEC\x28\x8B\x05\x00\x00\x00\x00\x89\x05\x00\x00\x00\x00\xE8",
"xxxxxx????xx????x",
&CHooking::remove_all_ped_weapons);
//remove_weapon_from_ped
setFn<fpRemoveWeaponFromPed>( "remove_weapon_from_ped",
"\x48\x89\x5C\x24\x00\x57\x48\x83\xEC\x20\x8B\xFA\xE8\x00\x00\x00\x00\x33\xDB",
"xxxx?xxxxxxxx????xx",