求助国外的源码
本帖最后由 916074607 于 2017-8-13 17:33 编辑我这个DLL我在里面打上的中文编译出来注入显示的是问号怎么办 采用是Unicode还是ANSI字符集 A_Elite 发表于 2017-8-12 13:27
采用是Unicode还是ANSI字符集
我用编码转换成Unicode和UTF8字符集也不行用16进制软件查看是中文但是注入了就是问号 能发dll在中的内容吗? A_Elite 发表于 2017-8-12 13:27
采用是Unicode还是ANSI字符集
但他源文件是ASCII字符集 A_Elite 发表于 2017-8-12 13:32
能发dll在中的内容吗?
你是要所有源还是改的那个文件源 乱码一定是字符集的问题。你最好发下代码。 就是你出问题的那个地方的代码、 A_Elite 发表于 2017-8-12 13:37
就是你出问题的那个地方的代码、
static float rainbow;
rainbow += 0.005f;
if (rainbow > 1.f) rainbow = 0.f;
Render::Text(10, 10, Color::FromHSB(rainbow, 1.f, 1.f), Render::Fonts::Menu, "成功"); FromHSB函数的第一个参数是什么类型,应该不是浮点型。需要转换一下? A_Elite 发表于 2017-8-12 13:41
FromHSB函数的第一个参数是什么类型,应该不是浮点型。需要转换一下?
这个是前面所有代码因为是老外的我都没有看懂// Funtion Typedefs
typedef void(__thiscall* DrawModelEx_)(void*, void*, void*, const ModelRenderInfo_t&, matrix3x4*);
typedef void(__thiscall* PaintTraverse_)(PVOID, unsigned int, bool, bool);
typedef bool(__thiscall* InPrediction_)(PVOID);
typedef void(__stdcall *FrameStageNotifyFn)(ClientFrameStage_t);
typedef void(__thiscall* RenderViewFn)(void*, CViewSetup&, CViewSetup&, int, int);
using OverrideViewFn = void(__fastcall*)(void*, void*, CViewSetup*);
typedef float(__stdcall *oGetViewModelFOV)();
// Function Pointers to the originals
PaintTraverse_ oPaintTraverse;
DrawModelEx_ oDrawModelExecute;
FrameStageNotifyFn oFrameStageNotify;
OverrideViewFn oOverrideView;
RenderViewFn oRenderView;
// Hook function prototypes
void __fastcall PaintTraverse_Hooked(PVOID pPanels, int edx, unsigned int vguiPanel, bool forceRepaint, bool allowForce);
bool __stdcall Hooked_InPrediction();
void __fastcall Hooked_DrawModelExecute(void* thisptr, int edx, void* ctx, void* state, const ModelRenderInfo_t &pInfo, matrix3x4 *pCustomBoneToWorld);
bool __stdcall CreateMoveClient_Hooked(/*void* self, int edx,*/ float frametime, CUserCmd* pCmd);
void__stdcall Hooked_FrameStageNotify(ClientFrameStage_t curStage);
void __fastcall Hooked_OverrideView(void* ecx, void* edx, CViewSetup* pSetup);
float __stdcall GGetViewModelFOV();
void __fastcall Hooked_RenderView(void* ecx, void* edx, CViewSetup &setup, CViewSetup &hudViewSetup, int nClearFlags, int whatToDraw);
// VMT Managers
namespace Hooks
{;
// VMT Managers
Utilities::Memory::VMTManager VMTPanel; // Hooking drawing functions
Utilities::Memory::VMTManager VMTClient; // Maybe CreateMove
Utilities::Memory::VMTManager VMTClientMode; // CreateMove for functionality
Utilities::Memory::VMTManager VMTModelRender; // DrawModelEx for chams
Utilities::Memory::VMTManager VMTPrediction; // InPrediction for no vis recoil
Utilities::Memory::VMTManager VMTPlaySound; // Autoaccept
Utilities::Memory::VMTManager VMTRenderView;
};
// Undo our hooks
void Hooks::UndoHooks()
{
VMTPanel.RestoreOriginal();
VMTPrediction.RestoreOriginal();
VMTModelRender.RestoreOriginal();
VMTClientMode.RestoreOriginal();
}
// Initialise all our hooks
void Hooks::Initialise()
{
// Panel hooks for drawing to the screen via surface functions
VMTPanel.Initialise((DWORD*)Interfaces::Panels);
oPaintTraverse = (PaintTraverse_)VMTPanel.HookMethod((DWORD)&PaintTraverse_Hooked, Offsets::VMT::Panel_PaintTraverse);
//Utilities::Log("Paint Traverse Hooked");
// No Visual Recoi l
VMTPrediction.Initialise((DWORD*)Interfaces::Prediction);
VMTPrediction.HookMethod((DWORD)&Hooked_InPrediction, 14);
//Utilities::Log("InPrediction Hooked");
// Chams
VMTModelRender.Initialise((DWORD*)Interfaces::ModelRender);
oDrawModelExecute = (DrawModelEx_)VMTModelRender.HookMethod((DWORD)&Hooked_DrawModelExecute, Offsets::VMT::ModelRender_DrawModelExecute);
//Utilities::Log("DrawModelExecute Hooked");
// Setup ClientMode Hooks
VMTClientMode.Initialise((DWORD*)Interfaces::ClientMode);
VMTClientMode.HookMethod((DWORD)CreateMoveClient_Hooked, 24);
oOverrideView = (OverrideViewFn)VMTClientMode.HookMethod((DWORD)&Hooked_OverrideView, 18);
VMTClientMode.HookMethod((DWORD)&GGetViewModelFOV, 35);
// Setup client hooks
VMTClient.Initialise((DWORD*)Interfaces::Client);
oFrameStageNotify = (FrameStageNotifyFn)VMTClient.HookMethod((DWORD)&Hooked_FrameStageNotify, 36);
}
void MovementCorrection(CUserCmd* pCmd)
{
}
//---------------------------------------------------------------------------------------------------------
// Hooked Functions
//---------------------------------------------------------------------------------------------------------
// Animated ClanTag Function
void SetClanTag(const char* tag, const char* name)
{
static auto pSetClanTag = reinterpret_cast<void(__fastcall*)(const char*, const char*)>(((DWORD)Utilities::Memory::FindPattern("engine.dll", (PBYTE)"\x53\x56\x57\x8B\xDA\x8B\xF9\xFF\x15\x00\x00\x00\x00\x6A\x24\x8B\xC8\x8B\x30", "xxxxxxxxx????xxxxxx")));
pSetClanTag(tag, name);
}
// Blank Clantag
void NoClantag()
{
SetClanTag("", "");
}
// Clantag Functions
void ClanTag()
{
int speed = Menu::Window.MiscTab.OtherClantagspeed.GetValue();
static int counter = 0;
switch (Menu::Window.MiscTab.OtherClantag.GetIndex())
{
case 0:
// No
break;
case 1:
{
static int motion = 0;
int ServerTime = (float)Interfaces::Globals->interval_per_tick * hackManager.pLocal()->GetTickBase() * speed;
if (counter % 48 == 0)
motion++;
int value = ServerTime % 20;
switch (value) {
case 0:SetClanTag("hake", "hake"); break;
case 1:SetClanTag("hake", "hake"); break;
case 2:SetClanTag("hake", "hake"); break;
case 3:SetClanTag("hake", "hake"); break;
case 4:SetClanTag("hake", "hake"); break;
case 5:SetClanTag("hake", "hake"); break;
case 6:SetClanTag("hake", "hake"); break;
case 7:SetClanTag("hake", "hake"); break;
case 8:SetClanTag("hake", "hake"); break;
case 9:SetClanTag("cuck", "hake"); break;
case 10:SetClanTag("hake", "hake"); break;
case 11:SetClanTag("hake", "hake"); break;
case 12:SetClanTag("hake", "hake"); break;
case 13:SetClanTag("hake", "hake"); break;
case 14:SetClanTag("hake", "hake"); break;
case 15:SetClanTag("hake", "hake"); break;
case 16:SetClanTag("hake", "hake"); break;
case 17:SetClanTag("hake", "hake"); break;
case 18:SetClanTag("hake", "hake"); break;
case 19:SetClanTag("hake", "hake"); break;
}
counter++;
}
break;
case 2:
{
static int motion = 0;
int ServerTime = (float)Interfaces::Globals->interval_per_tick * hackManager.pLocal()->GetTickBase() * speed;
if (counter % 48 == 0)
motion++;
int value = ServerTime % 42;
switch (value) {
case 0: SetClanTag("/ ", "Complex"); break;
case 1: SetClanTag("- ", "Complex"); break;
case 2: SetClanTag("C ", "Complex"); break;
case 3: SetClanTag("C/ ", "Complex"); break;
case 4: SetClanTag("C- ", "Complex"); break;
case 5: SetClanTag("Co ", "Complex"); break;
case 6: SetClanTag("Co/ ", "Complex"); break;
case 7: SetClanTag("Co- ", "Complex"); break;
case 8: SetClanTag("Com ", "Complex"); break;
case 9: SetClanTag("Com/ ", "Complex"); break;
case 10:SetClanTag("Com- ", "Complex"); break;
case 11:SetClanTag("Comp ", "Complex"); break;
case 12:SetClanTag("Comp/", "Complex"); break;
case 13:SetClanTag("Comp-", "Complex"); break;
case 14:SetClanTag("Compl", "Complex"); break;
case 15:SetClanTag("Compl/ ", "Complex"); break;
case 16:SetClanTag("Compl- ", "Complex"); break;
case 17:SetClanTag("Comple ", "Complex"); break;
case 18:SetClanTag("Comple/", "Complex"); break;
case 19:SetClanTag("Comple-", "Complex"); break;
case 20:SetClanTag("Complex", "Complex"); break;
case 21:SetClanTag("Comple-", "Complex"); break;
case 22:SetClanTag("Comple/", "Complex"); break;
case 23:SetClanTag("Comple ", "Complex"); break;
case 24:SetClanTag("Compl- ", "Complex"); break;
case 25:SetClanTag("Compl/ ", "Complex"); break;
case 26:SetClanTag("Compl", "Complex"); break;
case 27:SetClanTag("Comp-", "Complex"); break;
case 28:SetClanTag("Comp/", "Complex"); break;
case 29:SetClanTag("Comp ", "Complex"); break;
case 30:SetClanTag("Com- ", "Complex"); break;
case 31:SetClanTag("Com/ ", "Complex"); break;
case 32:SetClanTag("Com ", "Complex"); break;
case 33:SetClanTag("Co- ", "Complex"); break;
case 34:SetClanTag("Co/ ", "Complex"); break;
case 35:SetClanTag("Co ", "Complex"); break;
case 36:SetClanTag("C- ", "Complex"); break;
case 37:SetClanTag("C/ ", "Complex"); break;
case 38:SetClanTag("C ", "Complex"); break;
case 39:SetClanTag("- ", "Complex"); break;
case 40:SetClanTag("/ ", "Complex"); break;
case 41:SetClanTag(" ", "Complex"); break;
}
counter++;
}
break;
case 3:
{
static int motion = 0;
int ServerTime = (float)Interfaces::Globals->interval_per_tick * hackManager.pLocal()->GetTickBase() * speed;
if (counter % 48 == 0)
motion++;
int value = ServerTime % 3;
switch (value) {
case 0:SetClanTag(">> Complex <<", "pasteware"); break;
case 1:SetClanTag(">Complex<", "pasteware"); break;
}
counter++;
}
break;
case 4:
// stainless
SetClanTag("\r", "\r");
break;
case 5:
SetClanTag("", "Valve");
break;
case 6:
{
static int motion = 0;
int ServerTime = (float)Interfaces::Globals->interval_per_tick * hackManager.pLocal()->GetTickBase() * speed;
if (counter % 48 == 0)
motion++;
int value = ServerTime % 7;
switch (value) {
case 0:SetClanTag("dick", "pasteware"); break;
case 1:SetClanTag("fuck", "pasteware"); break;
case 2:SetClanTag("bitch", "pasteware"); break;
case 3:SetClanTag("cock", "pasteware"); break;
case 4:SetClanTag("coon", "pasteware"); break;
case 5:SetClanTag("nigger", "pasteware"); break;
case 6:SetClanTag("cunt", "pasteware"); break;
}
counter++;
}
break;
case 7:
time_t now = time(0);
char timestamp = "";
strftime(timestamp, 10, "[%H:%M:%S]", localtime(&now));
SetClanTag(timestamp, "Time");
break;
}
}
// Rank Revealer
void MsgFunc_ServerRankRevealAll()
{
using MsgFunc_ServerRankRevealAllFn = bool(__cdecl*)(float*);
static MsgFunc_ServerRankRevealAllFn MsgFunc_ServerRankRevealAll = reinterpret_cast<MsgFunc_ServerRankRevealAllFn>((PDWORD)Utilities::Memory::FindPattern("client.dll", (PBYTE)"\x55\x8B\xEC\x8B\x0D\x00\x00\x00\x00\x68\x00\x00\x00\x00", "xxxxx????x????"));
float fArray;
fArray = 0.f;
fArray = 0.f;
fArray = 0.f;
MsgFunc_ServerRankRevealAll(fArray);
}
BYTE bMoveData;
// Movement Prediction
void Prediction(CUserCmd* pCmd, IClientEntity* LocalPlayer)
{
if (Interfaces::MoveHelper && Menu::Window.RageBotTab.AimbotEnable.GetState() && Menu::Window.RageBotTab.AccuracyPrediction.GetState() && LocalPlayer->IsAlive())
{
float curtime = Interfaces::Globals->curtime;
float frametime = Interfaces::Globals->frametime;
int iFlags = LocalPlayer->GetFlags();
Interfaces::Globals->curtime = (float)LocalPlayer->GetTickBase() * Interfaces::Globals->interval_per_tick;
Interfaces::Globals->frametime = Interfaces::Globals->interval_per_tick;
Interfaces::MoveHelper->SetHost(LocalPlayer);
Interfaces::GamePrediction->SetupMove(LocalPlayer, pCmd, nullptr, bMoveData);
Interfaces::GameMovement->ProcessMovement(LocalPlayer, bMoveData);
Interfaces::GamePrediction->FinishMove(LocalPlayer, pCmd, bMoveData);
Interfaces::MoveHelper->SetHost(0);
Interfaces::Globals->curtime = curtime;
Interfaces::Globals->frametime = frametime;
*LocalPlayer->GetPointerFlags() = iFlags;
}
}
// Create moves
bool __stdcall CreateMoveClient_Hooked(float frametime, CUserCmd* pCmd)
{
if (!pCmd->command_number)
return true;
if (Interfaces::Engine->IsConnected() && Interfaces::Engine->IsInGame())
{
PVOID pebp;
__asm mov pebp, ebp;
bool* pbSendPacket = (bool*)(*(DWORD*)pebp - 0x1C);
bool& bSendPacket = *pbSendPacket;
CClientState* pClient;
INetChannel* pNet;
CInput* pInput;
if (Menu::Window.MiscTab.OtherClantag.GetIndex() > 0)
ClanTag();
// CUserCmd* cmdlist = *(CUserCmd**)((DWORD)Interfaces::pInput + 0xEC);
// CUserCmd* pCmd = &cmdlist;
// Backup for safety
Vector origView = pCmd->viewangles;
Vector viewforward, viewright, viewup, aimforward, aimright, aimup;
Vector qAimAngles;
qAimAngles.Init(0.0f, pCmd->viewangles.y, 0.0f);
AngleVectors(qAimAngles, &viewforward, &viewright, &viewup);
// Do da hacks
IClientEntity *pLocal = Interfaces::EntList->GetClientEntity(Interfaces::Engine->GetLocalPlayer());
if (Interfaces::Engine->IsConnected() && Interfaces::Engine->IsInGame() && pLocal && pLocal->IsAlive())
Hacks::MoveHacks(pCmd, bSendPacket);
// Movement Fix
qAimAngles.Init(0.0f, GetAutostrafeView().y, 0.0f);
AngleVectors(qAimAngles, &viewforward, &viewright, &viewup);
qAimAngles.Init(0.0f, pCmd->viewangles.y, 0.0f);
AngleVectors(qAimAngles, &aimforward, &aimright, &aimup);
Vector vForwardNorm; Normalize(viewforward, vForwardNorm);
Vector vRightNorm; Normalize(viewright, vRightNorm);
Vector vUpNorm; Normalize(viewup, vUpNorm);
// Movement Prediction
if (Interfaces::Engine->IsConnected() && Interfaces::Engine->IsInGame() && pLocal)
{
if (pLocal->IsAlive())
{
Prediction(pCmd, pLocal);
}
}
// Original shit for movement correction
float forward = pCmd->forwardmove;
float right = pCmd->sidemove;
float up = pCmd->upmove;
if (forward > 450) forward = 450;
if (right > 450) right = 450;
if (up > 450) up = 450;
if (forward < -450) forward = -450;
if (right < -450) right = -450;
if (up < -450) up = -450;
pCmd->forwardmove = DotProduct(forward * vForwardNorm, aimforward) + DotProduct(right * vRightNorm, aimforward) + DotProduct(up * vUpNorm, aimforward);
pCmd->sidemove = DotProduct(forward * vForwardNorm, aimright) + DotProduct(right * vRightNorm, aimright) + DotProduct(up * vUpNorm, aimright);
pCmd->upmove = DotProduct(forward * vForwardNorm, aimup) + DotProduct(right * vRightNorm, aimup) + DotProduct(up * vUpNorm, aimup);
// Angle normalisation
if (Menu::Window.MiscTab.OtherSafeMode.GetState())
{
GameUtils::NormaliseViewAngle(pCmd->viewangles);
if (pCmd->viewangles.z != 0.0f)
{
pCmd->viewangles.z = 0.00;
}
if (pCmd->viewangles.x < -89 || pCmd->viewangles.x > 89 || pCmd->viewangles.y < -180 || pCmd->viewangles.y > 180)
{
GameUtils::NormaliseViewAngle(pCmd->viewangles);
Beep(750, 800);
if (pCmd->viewangles.x < -89 || pCmd->viewangles.x > 89 || pCmd->viewangles.y < -180 || pCmd->viewangles.y > 180)
{
pCmd->viewangles = origView;
pCmd->sidemove = right;
pCmd->forwardmove = forward;
}
}
}
if (pCmd->viewangles.x > 90)
{
pCmd->forwardmove = -pCmd->forwardmove;
}
if (pCmd->viewangles.x < -90)
{
pCmd->forwardmove = -pCmd->forwardmove;
}
if (bSendPacket)
LastAngleAA = pCmd->viewangles;
}
return false;
}
// Paint Traverse Hooked function
void __fastcall PaintTraverse_Hooked(PVOID pPanels, int edx, unsigned int vguiPanel, bool forceRepaint, bool allowForce)
{
if (Menu::Window.VisualsTab.OtherNoScope.GetState() && !strcmp("HudZoom", Interfaces::Panels->GetName(vguiPanel)))
return;
oPaintTraverse(pPanels, vguiPanel, forceRepaint, allowForce);
static unsigned int FocusOverlayPanel = 0;
static bool FoundPanel = false;
if (!FoundPanel)
{
PCHAR szPanelName = (PCHAR)Interfaces::Panels->GetName(vguiPanel);
if (strstr(szPanelName, "MatSystemTopPanel"))
{
FocusOverlayPanel = vguiPanel;
FoundPanel = true;
}
}
else if (FocusOverlayPanel == vguiPanel)
{
if (Menu::Window.MiscTab.WaterMark.GetState() == true)
{
static float rainbow;
rainbow += 0.005f;
if (rainbow > 1.f) rainbow = 0.f;
Render::Text(10, 10, Color::FromHSB(rainbow, 1.f, 1.f), Render::Fonts::Menu, "成功"); 916074607 发表于 2017-8-12 13:43
这个是前面所有代码因为是老外的我都没有看懂
在你发的这个代码中并没有FromHSB的声明,你得找到这个函数的声明,然后看它的第一个参数的数据类型,具体是什么、 A_Elite 发表于 2017-8-12 13:45
在你发的这个代码中并没有FromHSB的声明,你得找到这个函数的声明,然后看它的第一个参数的数据类型,具 ...
是这个吗?static Color FromHSB(float hue, float saturation, float brightness) A_Elite 发表于 2017-8-12 13:45
在你发的这个代码中并没有FromHSB的声明,你得找到这个函数的声明,然后看它的第一个参数的数据类型,具 ...
是这个吗?hsb的静态颜色(浮色,浮动饱和度,浮动亮度)
{
浮动h===1.0 f?0:颜色6;
浮动f=h-(int)h;
浮动p=亮度(1.0 f-饱和度);
浮动q=亮度(1.0 f-饱和度f);
浮动t=亮度(1.0 f-(饱和度(1.0 f-f))); A_Elite 发表于 2017-8-12 13:45
在你发的这个代码中并没有FromHSB的声明,你得找到这个函数的声明,然后看它的第一个参数的数据类型,具 ...
是这个吗?static Color FromHSB(float hue, float saturation, float brightness)
{
float h = hue == 1.0f ? 0 : hue * 6.0f;
float f = h - (int)h;
float p = brightness * (1.0f - saturation);
float q = brightness * (1.0f - saturation * f);
float t = brightness * (1.0f - (saturation * (1.0f - f))); 第一个参数是float 类型 你的text函数的原型是什么? A_Elite 发表于 2017-8-12 14:02
你的text函数的原型是什么?
这个void Render::Text(int x, int y, Color color, DWORD font, const char* text)
{
size_t origsize = strlen(text) + 1;
const size_t newsize = 100;
size_t convertedChars = 0;
wchar_t wcstring;
mbstowcs_s(&convertedChars, wcstring, origsize, text, _TRUNCATE);
Interfaces::Surface->Microsoft jas black(font);
Interfaces::Surface->DrawSetTextColor(color);
Interfaces::Surface->DrawSetTextPos(x, y);
Interfaces::Surface->DrawPrintText(wcstring, wcslen(wcstring));
return;
} 你现在的工程字符集是什么? A_Elite 发表于 2017-8-12 14:02
你的text函数的原型是什么?
不对是这个void Render::Text(int x, int y, Color color, DWORD font, const char* text)
{
size_t origsize = strlen(text) + 1;
const size_t newsize = 100;
size_t convertedChars = 0;
wchar_t wcstring;
mbstowcs_s(&convertedChars, wcstring, origsize, text, _TRUNCATE);
Interfaces::Surface->DrawSetTextFont(font);
Interfaces::Surface->DrawSetTextColor(color);
Interfaces::Surface->DrawSetTextPos(x, y);
Interfaces::Surface->DrawPrintText(wcstring, wcslen(wcstring));
return;
}
页:
[1]
2