|
- #define PINT int *
- #define FASTCALL __fastcall
- #pragma pack(1)
- typedef struct
- {
- DWORD Unused0;
- DWORD stringID;
- DWORD code;
- DWORD Unused2;
- DWORD Address;
- DWORD Value;
- USHORT Operator;
- } *ActionParams;
- const FARPROC (WINAPI**sc_GetProcAddress) ( HMODULE hModule, LPCSTR lpProcName ) = (const FARPROC(WINAPI**)(HMODULE,LPCSTR))0x4ED160;
- //PBYTE (FASTCALL*GetResString)(USHORT index) = (PBYTE(FASTCALL*)(USHORT))0x448880;
- const LPCSTR CurrentPlayerName = (LPCSTR)0x65A808;
- const char(*PlayerName)[36] = (const char(*)[36])0x65A853;
- const LPCSTR (FASTCALL*GetResString)(USHORT index) = (const LPCSTR(FASTCALL*)(USHORT))0x448880;
- BOOL FASTCALL Comment(ActionParams params)//6号按钮插件
- {
- PBYTE str_add = GetResString(params->stringID);
- if(*str_add=='1')
- {
- *str_add='0';
- str_add++;
- PBYTE str_back = str_add;
- while(str_add[0]&&str_add[1]&&str_add[2]&&str_add[3])
- {
- str_back[0] = ( ( ( str_add[0] - 0x30) << 2 ) & 0xFC ) + ( ( ( str_add[1] - 0x30 ) >> 4 ) & 0x03 );
- str_back[1] = ( ( ( str_add[1] - 0x30) << 4 ) & 0xF0 ) + ( ( ( str_add[2] - 0x30 ) >> 2 ) & 0x0F );
- str_back[2] = ( ( ( str_add[2] - 0x30) << 6 ) & 0xC0 ) + ( (str_add[3] - 0x30 ) & 0x3F);
- str_add += 4;
- str_back += 3;
- }
- *(int *)(str_back-1)=0;
- }
- *(int *)params->Address = params->Operator;
- *(int *)(params->Address + 4) = (int)GetResString(params->stringID) + 1;
- return true;
- }
- BOOL FASTCALL Comment(ActionParams params)//51号设置数值插件
- {
-
- int n=params->Operator;
- if(n>0&&n<9)
- {
- char *add=(char *)params->code;
- char *val=(char *)&(params->Address);
- while(n--)
- *(add++)=*(val++);
- }
- else if(n>=9)
- {
- PBYTE str_add = GetResString(params->stringID);
- PBYTE add = str_add + 1;
- if(*str_add=='1')
- {
- *str_add='0';
- str_add++;
- PBYTE str_back = str_add;
- while(str_add[0]&&str_add[1]&&str_add[2]&&str_add[3])
- {
- str_back[0] = ( ( ( str_add[0] - 0x30) << 2 ) & 0xFC ) + ( ( ( str_add[1] - 0x30 ) >> 4 ) & 0x03 );
- str_back[1] = ( ( ( str_add[1] - 0x30) << 4 ) & 0xF0 ) + ( ( ( str_add[2] - 0x30 ) >> 2 ) & 0x0F );
- str_back[2] = ( ( ( str_add[2] - 0x30) << 6 ) & 0xC0 ) + ( (str_add[3] - 0x30 ) & 0x3F);
- str_add += 4;
- str_back += 3;
- }
- }
- str_add = add;
- add = (PBYTE)params->code;
- while(n--)
- *(add++)=*(str_add++);
- }
- return true;
- }
- BOOL FASTCALL Comment(ActionParams params)//50号设置数值插件
- {
- char *add=(char *)params->code;
- char *val=(char *)&(params->Address);
- while(n--)
- *(add++)=*(val++);
- }
复制代码 |
|