You are not logged in.
забобахана давно уже CMarker
Это можно, надо в базе листенера лазить...
Вот эту еще надо перевести в C++
.text:004C3C00 ; int __cdecl createRadarBlip(int, float, float, float, int, int) .text:004C3C00 _createRadarBlip proc near ; CODE XREF: CScriptThread__opcodeHandler_13+1B08p .text:004C3C00 ; CScriptThread__opcodeHandler_12+9FAp .text:004C3C00 .text:004C3C00 type = dword ptr 4 .text:004C3C00 x = dword ptr 8 .text:004C3C00 y = dword ptr 0Ch .text:004C3C00 z = dword ptr 10h .text:004C3C00 flag1 = dword ptr 14h .text:004C3C00 flag2 = dword ptr 18h .text:004C3C00 .text:004C3C00 000 8B 44 24 14 mov eax, [esp+flag1] .text:004C3C04 000 8B 54 24 18 mov edx, [esp+flag2] .text:004C3C08 000 53 push ebx .text:004C3C09 004 55 push ebp .text:004C3C0A 008 52 push edx ; flag2 .text:004C3C0B 00C 50 push eax ; flag1 .text:004C3C0C 010 8B 44 24 14 mov eax, [esp+10h+type] .text:004C3C10 010 FF 74 24 20 push [esp+10h+z] ; z .text:004C3C14 014 FF 74 24 20 push [esp+14h+y] ; y .text:004C3C18 018 FF 74 24 20 push [esp+18h+x] ; x .text:004C3C1C 01C 50 push eax ; type .text:004C3C1D 020 E8 5E 00 00 00 call _createMarker .text:004C3C22 020 83 C4 18 add esp, 18h .text:004C3C25 008 83 F8 FF cmp eax, 0FFFFFFFFh .text:004C3C28 008 75 06 jnz short loc_4C3C30 ; != .text:004C3C2A 008 83 C8 FF or eax, 0FFFFFFFFh .text:004C3C2D 008 5D pop ebp .text:004C3C2E 004 5B pop ebx .text:004C3C2F 000 C3 retn .text:004C3C30 ; --------------------------------------------------------------------------- .text:004C3C30 .text:004C3C30 loc_4C3C30: ; CODE XREF: _createRadarBlip+28j .text:004C3C30 008 89 C1 mov ecx, eax .text:004C3C32 008 89 CA mov edx, ecx .text:004C3C34 008 81 E2 FF FF 00 00 and edx, 0FFFFh .text:004C3C3A 008 83 F8 FF cmp eax, 0FFFFFFFFh .text:004C3C3D 008 74 20 jz short loc_4C3C5F .text:004C3C3F 008 89 D5 mov ebp, edx .text:004C3C41 008 81 E1 00 00 FF FF and ecx, 0FFFF0000h .text:004C3C47 008 8D 1C ED 00 00 00 00 lea ebx, ds:0[ebp*8] .text:004C3C4E 008 C1 E9 10 shr ecx, 10h .text:004C3C51 008 29 EB sub ebx, ebp .text:004C3C53 008 0F B7 1C DD 5C 7D 7D 00 movzx ebx, ds:_radarBlips.field_24[ebx*8] .text:004C3C5B 008 39 D9 cmp ecx, ebx .text:004C3C5D 008 74 03 jz short loc_4C3C62 .text:004C3C5F .text:004C3C5F loc_4C3C5F: ; CODE XREF: _createRadarBlip+3Dj .text:004C3C5F 008 83 CA FF or edx, 0FFFFFFFFh .text:004C3C62 .text:004C3C62 loc_4C3C62: ; CODE XREF: _createRadarBlip+5Dj .text:004C3C62 008 8D 0C D5 00 00 00 00 lea ecx, ds:0[edx*8] .text:004C3C69 008 29 D1 sub ecx, edx .text:004C3C6B 008 C6 04 CD 60 7D 7D 00 01 mov ds:_radarBlips.field_28[ecx*8], 1 .text:004C3C73 008 5D pop ebp .text:004C3C74 004 5B pop ebx .text:004C3C75 000 C3 retn .text:004C3C75 _createRadarBlip endp
Вот начало перевода:
DWORD __cdecl CreateRadarBlip(DWORD type, float x, float y, float z, DWORD flag1, DWORD flag2)
{
DWORD res = Create_Marker(type, x,y,z,flag1,flag2);
if(x != 0xFFFFFFFF)
return ( res | 0xFFFFFFFF);
};
Надо в памяти менять стрельбу пушак, разве так трудно?
Да про этот JB я думал, наверное надо прыгать на абсолютный адрес, но какой инструкцией указывается?
есть код на C++
__declspec(naked) void sub_4C5680_Code()
{
__asm cmp si, 750
__asm jb 0xE9
__asm test dl, dl
__asm push 004C5AA9h
__asm ret
};вот этот участок пытаюсь с инжектить
.text:004C5AA0 loc_4C5AA0: ; CODE XREF: sub_4C5680+41Cj .text:004C5AA0 048 46 inc esi .text:004C5AA1 048 66 83 FE 4B cmp si, 4Bh .text:004C5AA5 048 72 E9 jb short loc_4C5A90 .text:004C5AA7 048 84 D2 test dl, dl .text:004C5AA9 048 75 6C jnz short loc_4C5B17 .text:004C5AAB 048 0F B7 05 40 0A A1 00 movzx eax, ds:word_A10A40
void injectFunction(DWORD address, DWORD function)
{
DWORD Old;
VirtualProtect( PVOID(address), 16, PAGE_READWRITE, &Old);
BYTE * patch = (BYTE *)address;
*patch = 0xE9; // JMP
*(DWORD *)(patch+1) = (function-(address+5));
VirtualProtect( PVOID(address), 16, Old, &Old);
}вот как инжектю
injectFunction(0x04C5AA1, (DWORD)sub_4C5680_Code);
Что не так? Друзья помогите!
Да можно вызывать!
vPos.x
А почему тип отсутствует, по нотации? Как же указать что это переменная структуры?
Имейте введу, что Интерфейс DX уже выделин, его только надо перехватить...
я по работал не много над ним что-бы он компилировался)))
По поводу Хука смотри пример на моем сайте:
http://gtaexe.3dn.ru/load/gta_vc/iskhod … od/3-1-0-2
IDirect3D9 * = void* - если для языка высокого уровня, то разные веши.
Для ассемблера же это все одинаково!!!
IDirect3D9 * = void*
Это идентично...
Только CLEO юзать...
Seemann
И мозаичные можно делать 
Потом и для СА можно по делать...
(Адрес функции) - (Заменяемый адрес)+1
Получаем нормальное смещение для прыжка (JMP)
Взломан полностью лимит маркеров!!!!
А также теперь маркер может иметь любой цвет...
Оригинальная тема:
http://gtaexe.3dn.ru/forum/7-27-1
Тут не просто инжект надо было делать))))
Имеется участок кода:
.text:004C47DF 028 inc ebx ; default .text:004C47E0 028 add ebp, 38h .text:004C47E3 028 cmp ebx, 4Bh ; ? .text:004C47E6 028 fldz .text:004C47E8 028 fldz .text:004C47EA 028 fldz .text:004C47EC 028 jl loc_4C49F0 .text:004C47F2 028 cmp ds:_menu.field_35, 0 .text:004C47F9 028 jz loc_4C4A00 .text:004C47FF 028 cmp ds:?drawRadar, 0 .text:004C4806 028 jz short loc_4C4820 .text:004C4808 028 fld flt_68FDA0 .text:004C480E 028 fsub ds:flt_704734
cmp ebx, 4Bh
Беда такая что сюда не влазеет больше байта...
По пытался с инжектить:
void injectFunctionCall(DWORD address, DWORD function)
{
DWORD Old;
VirtualProtect( PVOID(address), 16, PAGE_READWRITE, &Old);
BYTE * patch = (BYTE *)address;
*patch = 0xE8; // Call
*(DWORD *)(patch+1) = (function-(address+5));
VirtualProtect( PVOID(address), 16, Old, &Old);
}
__declspec(naked) void Code_1()
{
_asm inc ebx
_asm add ebp, 38h
_asm cmp ebx, 1600h
_asm retn;
}injectFunctionCall(0x04C47DF, (DWORD)Code_1); PathByte(0x04C47E4, 0x90); PathByte(0x04C47E5, 0x90);
Но не че не заменяется!!! Игра вылетает, как же заменить кусок кода на свой?
Вот еще:
.text:004C3840 _showMarkerOnRadar proc near ; CODE XREF: CScriptThread__opcodeHandler_03+A4Ap .text:004C3840 ; CScriptThread__opcodeHandler_03+13C3p .text:004C3840 ; CScriptThread__opcodeHandler_03+1434p .text:004C3840 ; CScriptThread__opcodeHandler_03+14A5p ... .text:004C3840 .text:004C3840 arg_0 = dword ptr 4 .text:004C3840 arg_4 = dword ptr 8 .text:004C3840 .text:004C3840 000 mov edx, [esp+arg_0] ; 131072 .text:004C3844 000 push ebx .text:004C3845 004 mov eax, edx .text:004C3847 004 push ebp .text:004C3848 008 mov ecx, eax .text:004C384A 008 mov ebp, [esp+8+arg_4] .text:004C384E 008 and ecx, 0FFFFh .text:004C3854 008 cmp edx, 0FFFFFFFFh .text:004C3857 008 jz short loc_4C3878 .text:004C3859 008 mov ebx, ecx ; ebx = id .text:004C385B 008 and eax, 0FFFF0000h ; ; 131072 .text:004C3860 008 lea edx, ds:0[ebx*8] ; edx = 8*0 .text:004C3867 008 shr eax, 10h .text:004C386A 008 sub edx, ebx .text:004C386C 008 movzx edx, ds:_radarBlips.field_24[edx*8] .text:004C3874 008 cmp eax, edx .text:004C3876 008 jz short loc_4C387B .text:004C3878 .text:004C3878 loc_4C3878: ; CODE XREF: _showMarkerOnRadar+17j .text:004C3878 008 or ecx, 0FFFFFFFFh .text:004C387B .text:004C387B loc_4C387B: ; CODE XREF: _showMarkerOnRadar+36j .text:004C387B 008 cmp ds:_menu.field_35, 0 .text:004C3882 008 jz short loc_4C3889 .text:004C3884 008 mov ebp, 1 .text:004C3889 .text:004C3889 loc_4C3889: ; CODE XREF: _showMarkerOnRadar+42j .text:004C3889 008 cmp ecx, 0FFFFFFFFh .text:004C388C 008 jnz short loc_4C3891 .text:004C388E 008 pop ebp .text:004C388F 004 pop ebx .text:004C3890 000 retn .text:004C3891 ; --------------------------------------------------------------------------- .text:004C3891 .text:004C3891 loc_4C3891: ; CODE XREF: _showMarkerOnRadar+4Cj .text:004C3891 008 lea eax, ds:0[ecx*8] .text:004C3898 008 sub eax, ecx .text:004C389A 008 mov ds:_radarBlips.Scale[eax*8], bp .text:004C38A2 008 pop ebp .text:004C38A3 004 pop ebx .text:004C38A4 000 retn .text:004C38A4 _showMarkerOnRadar endp
Пойдет так как я перевел?
void __cdecl ScaleMarkerOnRadar(DWORD id_marker, DWORD Scale)
{
DWORD _menu_field_35 = 0x0869630 + 0x35;
DWORD id_, s_id;
WORD f24;
//131072
id_ = 0x0ffff & id_marker; //ID = 0
s_id = id_marker >> 16;
f24 = VCRadarBlips[0].field_24;
if (id_marker == 0xFFFFFFFF)
return;
if (s_id == VCRadarBlips[id_].field_24)
{
if ( *(BYTE*)_menu_field_35 == 0 )
VCRadarBlips[id_].scale = Scale;
}
};
А так:
DWORD __cdecl Create_Marker(DWORD type, float x, float y, float z, DWORD flag1, DWORD flag2)
{
DWORD result = -1;
for (int i=0; i < 75; i++)
{
if ( VCRadarBlips[i].inUse == 0)
{
VCRadarBlips[i].typeMarker = type;
VCRadarBlips[i].id_color = 5;
VCRadarBlips[i].field_26 = 1;
VCRadarBlips[i].inUse = 1;
VCRadarBlips[i].field_28 = 0;
VCRadarBlips[i].field_2C = 1.0f;
VCRadarBlips[i].pos.x = x;
VCRadarBlips[i].pos.y = y;
VCRadarBlips[i].pos.z = z;
VCRadarBlips[i].field_18 = VCRadarBlips[i].pos;
VCRadarBlips[i].entityHandle = 0;
VCRadarBlips[i].scale = 1;
VCRadarBlips[i].field_32 = flag2;
VCRadarBlips[i].iconID = 0;
VCRadarBlips[i].field_24++;
if ((VCRadarBlips[i].field_24 & 0xFFFF)==0) VCRadarBlips[i].field_24 = 1;
result = ((VCRadarBlips[index].field_24 << 16) | i)
break;
}
}
}
return result;
};
Вот код из IDA.
.text:004C3C80 ; int __cdecl createMarker(int type, float x, float y, float z, int flag1, int flag2) .text:004C3C80 _createMarker proc near ; CODE XREF: CScriptThread__opcodeHandler_03+A08p .text:004C3C80 ; CScriptThread__opcodeHandler_03+1566p .text:004C3C80 ; CScriptThread__opcodeHandler_03+1634p .text:004C3C80 ; CScriptThread__opcodeHandler_06+408p ... .text:004C3C80 .text:004C3C80 type = dword ptr 4 .text:004C3C80 x = dword ptr 8 .text:004C3C80 y = dword ptr 0Ch .text:004C3C80 z = dword ptr 10h .text:004C3C80 flag1 = dword ptr 14h .text:004C3C80 flag2 = dword ptr 18h .text:004C3C80 .text:004C3C80 000 xor edx, edx .text:004C3C82 000 xor eax, eax .text:004C3C84 000 fld [esp+z] .text:004C3C88 000 fld [esp+y] .text:004C3C8C 000 jmp short loc_4C3C94 .text:004C3C8C ; --------------------------------------------------------------------------- .text:004C3C8E 000 align 10h .text:004C3C90 .text:004C3C90 loc_4C3C90: ; CODE XREF: _createMarker+20j .text:004C3C90 000 add eax, 38h .text:004C3C93 000 inc edx .text:004C3C94 .text:004C3C94 loc_4C3C94: ; CODE XREF: _createMarker+Cj .text:004C3C94 000 cmp ds:_radarBlips.inUse[eax], 0 .text:004C3C9B 000 jz short loc_4C3CA2 .text:004C3C9D 000 cmp edx, 75 .text:004C3CA0 000 jb short loc_4C3C90 .text:004C3CA2 .text:004C3CA2 loc_4C3CA2: ; CODE XREF: _createMarker+1Bj .text:004C3CA2 000 cmp edx, 75 .text:004C3CA5 000 jnb loc_4C3D70 .text:004C3CAB 000 mov ecx, edx .text:004C3CAD 000 mov eax, [esp+type] .text:004C3CB1 000 imul ecx, 38h .text:004C3CB4 000 fld [esp+x] .text:004C3CB8 000 mov ds:_radarBlips.type[ecx], eax .text:004C3CBE 000 mov dword ptr ds:_radarBlips.id_color[ecx], 5 .text:004C3CC8 000 mov ds:_radarBlips.field_26[ecx], 1 .text:004C3CCF 000 mov ds:_radarBlips.inUse[ecx], 1 .text:004C3CD6 000 mov ds:_radarBlips.field_28[ecx], 0 .text:004C3CDD 000 mov ds:_radarBlips.field_2C[ecx], 3F800000h .text:004C3CE7 000 fstp ds:_radarBlips.pos.x[ecx] .text:004C3CED 000 fst ds:_radarBlips.pos.y[ecx] .text:004C3CF3 000 fld st(1) .text:004C3CF5 000 fstp ds:_radarBlips.pos.z[ecx] .text:004C3CFB 000 fld [esp+x] .text:004C3CFF 000 mov eax, [esp+flag2] .text:004C3D03 000 fstp ds:_radarBlips.field_18.x[ecx] .text:004C3D09 000 fst ds:_radarBlips.field_18.y[ecx] .text:004C3D0F 000 fld st(1) .text:004C3D11 000 fstp ds:_radarBlips.field_18.z[ecx] .text:004C3D17 000 mov ds:_radarBlips.entityHandle[ecx], 0 .text:004C3D21 000 mov ds:_radarBlips.field_30[ecx], 1 .text:004C3D2A 000 mov ds:_radarBlips.field_32[ecx], ax .text:004C3D31 000 mov eax, edx .text:004C3D33 000 imul eax, 38h .text:004C3D36 000 mov ds:_radarBlips.iconID[ecx], 0 .text:004C3D3F 000 cmp ds:_radarBlips.field_24[eax], 0FFFEh .text:004C3D47 000 jnb short loc_4C3D52 .text:004C3D49 000 inc ds:_radarBlips.field_24[eax] .text:004C3D50 000 jmp short loc_4C3D5B .text:004C3D52 ; --------------------------------------------------------------------------- .text:004C3D52 .text:004C3D52 loc_4C3D52: ; CODE XREF: _createMarker+C7j .text:004C3D52 000 mov ds:_radarBlips.field_24[eax], 1 .text:004C3D5B .text:004C3D5B loc_4C3D5B: ; CODE XREF: _createMarker+D0j .text:004C3D5B 000 movzx eax, ds:_radarBlips.field_24[eax] .text:004C3D62 000 fcompp .text:004C3D64 000 shl eax, 10h .text:004C3D67 000 or eax, edx .text:004C3D69 000 retn .text:004C3D69 ; --------------------------------------------------------------------------- .text:004C3D6A 000 align 10h .text:004C3D70 .text:004C3D70 loc_4C3D70: ; CODE XREF: _createMarker+25j .text:004C3D70 000 or eax, 0FFFFFFFFh .text:004C3D73 000 fcompp .text:004C3D75 000 retn .text:004C3D75 _createMarker endp
А вот я ее перевел в C++:
DWORD __cdecl Create_Marker(DWORD type, float x, float y, float z, DWORD flag1, DWORD flag2)
{
DWORD index = 0;
for (int i=0; index < 75; i++)
{
index = i;
if ( VCRadarBlips[index].inUse == 0)
{
VCRadarBlips[index].typeMarker = type;
VCRadarBlips[index].id_color = 5;
VCRadarBlips[index].field_26 = 1;
VCRadarBlips[index].inUse = 1;
VCRadarBlips[index].field_28 = 0;
VCRadarBlips[index].field_2C = 0x3F800000;
VCRadarBlips[index].pos.x = x;
VCRadarBlips[index].pos.y = y;
VCRadarBlips[index].pos.z = z;
VCRadarBlips[index].field_18 = VCRadarBlips[index].pos;
VCRadarBlips[index].entityHandle = 0;
VCRadarBlips[index].scale = 1;
VCRadarBlips[index].field_32 = flag2;
VCRadarBlips[index].iconID = 0;
if (VCRadarBlips[index].field_24 <= 0xFFFE)
{
VCRadarBlips[index].field_24 = 1;
return ((VCRadarBlips[index].field_24 << 16) | index);
}
VCRadarBlips[index].field_24 += VCRadarBlips[index].field_24;
return ((VCRadarBlips[index].field_24 << 16) | index);
}
}
return ((VCRadarBlips[index].field_24 << 16) | index);
};Верно ли я сделал?
Вот функция в IDA
.text:004C3950 ; int __cdecl set_color_marker(int id_marker, int id_color) .text:004C3950 proc set_color_marker near ; CODE XREF: sub_453670+91Cp .text:004C3950 .text:004C3950 id_marker = dword ptr 4 .text:004C3950 id_color = dword ptr 8 .text:004C3950 .text:004C3950 000 mov ecx, [esp+id_marker] ; id marker .text:004C3954 000 push ebx .text:004C3955 004 mov eax, ecx .text:004C3957 004 mov edx, eax .text:004C3959 004 and edx, 0FFFFh .text:004C395F 004 cmp ecx, 0FFFFFFFFh .text:004C3962 004 jz short loc_4C3983 .text:004C3964 004 mov ebx, edx .text:004C3966 004 and eax, 0FFFF0000h .text:004C396B 004 lea ecx, [ds:0+ebx*8] .text:004C3972 004 shr eax, 10h .text:004C3975 004 sub ecx, ebx .text:004C3977 004 movzx ecx, [ds:_radarBlips.field_24+ecx*8] .text:004C397F 004 cmp eax, ecx .text:004C3981 004 jz short loc_4C3986 .text:004C3983 .text:004C3983 loc_4C3983: ; CODE XREF: set_color_marker+12j .text:004C3983 004 or edx, 0FFFFFFFFh .text:004C3986 .text:004C3986 loc_4C3986: ; CODE XREF: set_color_marker+31j .text:004C3986 004 cmp edx, 0FFFFFFFFh .text:004C3989 004 jnz short loc_4C3990 .text:004C398B 004 pop ebx .text:004C398C 000 retn .text:004C398C ; --------------------------------------------------------------------------- .text:004C398D 000 align 10h .text:004C3990 .text:004C3990 loc_4C3990: ; CODE XREF: set_color_marker+39j .text:004C3990 004 lea ecx, [ds:0+edx*8] .text:004C3997 004 mov eax, [esp+4+id_color] .text:004C399B 004 sub ecx, edx .text:004C399D 004 mov [ds:_radarBlips.field_0+ecx*8], eax .text:004C39A4 004 pop ebx .text:004C39A5 000 retn .text:004C39A5 endp set_color_marker
Попытался перевести ее для дельфи:
procedure a_marker_set_color(id_marker, id_color : dword); cdecl; begin _radarBlips := pointer($007D7D40); asm mov ecx, [esp+id_marker] // id marker push ebx mov eax, ecx mov edx, eax and edx, 0FFFFh cmp ecx, 0FFFFFFFFh jz @@loc_4C3983 //short loc_4C3983 mov ebx, edx and eax, 0FFFF0000h lea ecx, [ds:0+edx*8] shr eax, 10h sub ecx, ebx movzx ecx, [ds:007D7D64h+ecx*8] cmp eax, ecx jz @@loc_4C3986 @@loc_4C3983: // CODE XREF: set_color_marker+12j or edx, 0FFFFFFFFh @@loc_4C3986: // CODE XREF: set_color_marker+31j cmp edx, 0FFFFFFFFh jnz @@loc_4C3990 pop ebx retn @@loc_4C3990: // CODE XREF: set_color_marker+39j lea ecx, [ds:0+edx*8] mov eax, [esp+4+id_color] sub ecx, edx mov [ds: 007D7D40h+ecx*8], eax pop ebx retn end;
Пытаюсь ее вызвать:
Marker_Create := ptr($004C3CA0);
marker_show_onRadar := ptr($004C3860);
marker_set_color := ptr($004C3950); //Вот эта работает нормально!
randomize;
Marker_Handle := Marker_Create(4, Random(1400), Random(1400), 10.0, 2, 3);
marker_show_onRadar(Marker_Handle, 3);
a_marker_set_color(Marker_Handle, 4); //Вот онаНо не фига не выходит! Что не так? Только не надо молчать пожалуйста!!!
Нашел вот метод в IDA:
.text:004BBEB0 ; int __cdecl CPlayer_Busted() .text:004BBEB0 CPlayer_Busted proc near ; CODE XREF: sub_42BB70+76p .text:004BBEB0 000 cmp byte ptr [ecx+0CCh], 0 .text:004BBEB7 000 jnz short locret_4BBEFC .text:004BBEB9 000 mov byte ptr [ecx+0CCh], 2 .text:004BBEC0 000 mov eax, ds:currentTime .text:004BBEC5 000 mov [ecx+0D0h], eax .text:004BBECB 000 mov byte ptr [ecx+148h], 0 .text:004BBED2 000 call sub_429F90 .text:004BBED7 000 mov ecx, offset pointer_GXTFile .text:004BBEDC 000 push offset aBusted ; "BUSTED" .text:004BBEE1 004 call CText_GXT_locate .text:004BBEE6 000 push 2 ; type font .text:004BBEE8 004 push 1388h ; wait .text:004BBEED 008 push eax .text:004BBEEE 00C call StyledText_0 .text:004BBEF3 00C add esp, 0Ch .text:004BBEF6 000 inc ds:Statistics_Busteds .text:004BBEFC .text:004BBEFC locret_4BBEFC: ; CODE XREF: CPlayer_Busted+7j .text:004BBEFC 000 retn .text:004BBEFC CPlayer_Busted endp
не могу его переименовать в __thiscall почему? Пытался делать через "Y"...