Skip to content

Commit

Permalink
add crash_server
Browse files Browse the repository at this point in the history
  • Loading branch information
skomski committed Aug 19, 2013
1 parent db0c1d9 commit 417522b
Show file tree
Hide file tree
Showing 682 changed files with 487,190 additions and 39 deletions.
1 change: 0 additions & 1 deletion dota2-lua-engine/commands.h
@@ -1,5 +1,4 @@
// Copyright 2013 Karl Skomski - GPL v3

#pragma once

namespace commands {
Expand Down
5 changes: 5 additions & 0 deletions dota2-lua-engine/config.yaml
Expand Up @@ -26,6 +26,11 @@ dynamic:
offset: 2
name: Hud
signature: "57 BE ? ? ? ? E8 ? ? ? ? 56"
-
commands:
offset: 2
name: ClientMode
signature: "8B 0D ? ? ? ? 56 57 8B B8 0C 04 00 00"
-
commands:
offset: 3
Expand Down
14 changes: 14 additions & 0 deletions dota2-lua-engine/dota/dota_global.h
Expand Up @@ -82,4 +82,18 @@ class CCommandBuffer {
}
};

class ClientMode {
public:
static ClientMode* GetInstance() {
return *reinterpret_cast<ClientMode**>(
GlobalAddressRetriever::GetInstance()
.GetDynamicAddress("ClientMode"));
}
void CreateMove(float input_sample_time, UserCMD* cmd) {
typedef void ( __thiscall* OriginalFn )( PVOID, float, UserCMD*);
utils::GetVtableFunction<OriginalFn>(this, 27)
(this, input_sample_time, cmd);
}
};

} // namespace dota
94 changes: 74 additions & 20 deletions dota2-lua-engine/dota/dota_player.h
Expand Up @@ -18,25 +18,71 @@ class BasePlayer : public BaseEntity {
}
};

struct UserCMD {
uint32_t vtable; //0x0000
int command_number; //0x0004
int tick_count; //0x0008
float angle_x; //0x000C
float angle_y; //0x0010
float angle_z; //0x0014
float forwardmove; //0x0018
float sidemove; //0x001C
float upmove; //0x0020
int buttons; //0x0024
BYTE impulse; //0x0028
BYTE N02E2995E; //0x0029
BYTE N02E2DCC7; //0x002A
BYTE N02E2995F; //0x002B
int entindex_under_cursor; //0x002C
int entindex_selected; //0x0030
WORD N0299E18C; //0x0034
WORD N02B7B1CC; //0x0036
WORD N0299E18B; //0x0038
WORD N02B7CFAC; //0x003A
WORD N0299E18A; //0x003C
WORD N02B7C270; //0x003E
DWORD N0299E189; // 0x0040 order begin
DWORD order_number; //0x0044
DWORD N0299E187; //0x0048
DWORD N0299E7AF; //0x004C
DWORD N0299BCBB; //0x0050
DWORD N0299BCBC; //0x0054
DWORD N0299BCBD; //0x0058
DWORD order_id; //0x005C
DWORD N0299BCBF; //0x0060
DWORD N0299BCC0; //0x0064
DWORD N0299BCC1; //0x0068
DWORD N0299BCC2; //0x006C
DWORD N0299BCC3; //0x0070
DWORD N0299BCC4; //0x0074
uint16_t camera_x; //0x0078
uint16_t camera_y; //0x007A
BYTE N0299BCC6; //0x007C
BYTE N02B6D3A6; //0x007D
BYTE hud_shop_mode; //0x007E
BYTE hud_stats_dropdown_category_index; //0x007F
BYTE hud_stats_dropdown_sort_method; //0x0080
};

class DotaPlayer : public BasePlayer {
public:
enum Order {
kMoveToPosition = 1,
kMoveToEntity = 2,
kAttackPosition = 3,
kAttackEntity = 4,
kUseAbilityPosition = 5,
kUseAbilityEntity = 6,
kUseAbilityUnknown = 7,
kUseAbility = 8,
kToggleAbility = 9,
kHoldPosition = 10,
kUpdgradeAbility = 11,
kAutocast = 20,
kStop = 21,
kBuyback = 23,
kGlyph = 24,
};
enum Order {
kMoveToPosition = 1,
kMoveToEntity = 2,
kAttackPosition = 3,
kAttackEntity = 4,
kUseAbilityPosition = 5,
kUseAbilityEntity = 6,
kUseAbilityUnknown = 7,
kUseAbility = 8,
kToggleAbility = 9,
kHoldPosition = 10,
kUpdgradeAbility = 11,
kAutocast = 20,
kStop = 21,
kBuyback = 23,
kGlyph = 24,
};

static BaseEntity* GetLocalPlayerSelectedUnit() {
uint32_t address = GlobalAddressRetriever::GetInstance()
Expand Down Expand Up @@ -90,10 +136,12 @@ class DotaPlayer : public BasePlayer {
vec3_origin, ability->GetIndex(), 0, 0, 0);
}
void ToggleAbility(DotaAbility* ability) {
PrepareUnitOrders(Order::kToggleAbility, 0, vec3_origin, ability->GetIndex(), 0, 0, 0);
PrepareUnitOrders(Order::kToggleAbility, 0, vec3_origin,
ability->GetIndex(), 0, 0, 0);
}
void UseAbility(DotaAbility* ability) {
PrepareUnitOrders(Order::kUseAbility, 0, vec3_origin, ability->GetIndex(), 0, 0, 0);
PrepareUnitOrders(Order::kUseAbility, 0, vec3_origin,
ability->GetIndex(), 0, 0, 0);
}
void AbilityAutocast(DotaAbility* ability) {
PrepareUnitOrders(Order::kAutocast, 0, vec3_origin, ability->GetIndex(),
Expand All @@ -114,7 +162,8 @@ class DotaPlayer : public BasePlayer {
void (__stdcall *PrepareUnitOrders)(void*, int, int, float, float,
float, int, int, BaseNPC*, int) =
reinterpret_cast<void(__stdcall *)(void*, int, int, float, float,
float, int, int, BaseNPC*, int)>(address);
float, int, int, BaseNPC*, int)>
(address);

PrepareUnitOrders(this, order, entindex, vec.x, vec.y, vec.z,
entindex_2, order_issuer, base_npc, unknown);
Expand All @@ -131,6 +180,11 @@ class DotaPlayer : public BasePlayer {
call address
}
}
void CreateMove(float input_sample_time, UserCMD* cmd) {
typedef void ( __thiscall* OriginalFn )( PVOID, float, UserCMD*);
utils::GetVtableFunction<OriginalFn>(this, 261)
(this, input_sample_time, cmd);
}
};

} // namespace dota
14 changes: 9 additions & 5 deletions dota2-lua-engine/dota2-lua-engine.vcxproj
Expand Up @@ -73,8 +73,8 @@
<LibraryPath>C:\Users\bogus\Documents\GitHub\dxhook-master\AntTweakBar\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LibraryPath>..\address-retriever\address-retriever\libyaml;..\LuaJIT\src\;..\Release;..\hl2sdk-dota\lib\public;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir);$(ProjectDir);C:\boost_1_54_0;..\hl2sdk-dota;..\hl2sdk-dota\public;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)protobuf-2.5.0\vsprojects\Release;..\address-retriever\address-retriever\libyaml;..\LuaJIT\src\;..\Release;..\hl2sdk-dota\lib\public;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)protobuf\;$(SolutionDir)protobuf-2.5.0\src;$(SolutionDir)protobuf-2.5.0\vsprojects;$(SolutionDir)protobuf-2.5.0\vsprojects\Release;$(SolutionDir);$(ProjectDir);C:\boost_1_54_0;..\hl2sdk-dota;..\hl2sdk-dota\public;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<TargetName>$(ProjectName)64</TargetName>
Expand Down Expand Up @@ -126,7 +126,7 @@
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>vstdlib.lib;tier0.lib;tier1.lib;lua51.lib;address-retriever.lib;libyaml-cppmd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>vstdlib.lib;tier0.lib;tier1.lib;lua51.lib;address-retriever.lib;libyaml-cppmd.lib;libprotobuf.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<MASM />
<MASM />
Expand All @@ -136,8 +136,8 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<BrowseInformation>true</BrowseInformation>
<PrecompiledHeaderFile>precompiled_headers.h</PrecompiledHeaderFile>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<WarningLevel>Level3</WarningLevel>
<TreatWarningAsError>false</TreatWarningAsError>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderOutputFile>$(IntDir)precompiled.pch</PrecompiledHeaderOutputFile>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
Expand Down Expand Up @@ -183,6 +183,10 @@ xcopy /y "$(SolutionDir)scripts\*.lua" "$(OutDir)"</Command>
<ProjectReference />
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\protobuf\dota_clientmessages.pb.cc" />
<ClCompile Include="..\protobuf\dota_commonmessages.pb.cc" />
<ClCompile Include="..\protobuf\netmessages.pb.cc" />
<ClCompile Include="..\protobuf\networkbasetypes.pb.cc" />
<ClCompile Include="commands.cc" />
<ClCompile Include="dota\dota_chat.cc" />
<ClCompile Include="dota\dota_global.cc" />
Expand Down
15 changes: 15 additions & 0 deletions dota2-lua-engine/dota2-lua-engine.vcxproj.filters
Expand Up @@ -43,6 +43,9 @@
<Filter Include="Source Files\lua">
<UniqueIdentifier>{c1d6319b-d0db-4fd3-9d69-f330d473b320}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\protobuf">
<UniqueIdentifier>{5ff16b8d-4b26-4bfa-ad67-bdbd23ad66ef}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="commands.cc">
Expand Down Expand Up @@ -108,6 +111,18 @@
<ClCompile Include="dota\dota_projectilemanager.cc">
<Filter>Source Files\dota</Filter>
</ClCompile>
<ClCompile Include="..\protobuf\dota_clientmessages.pb.cc">
<Filter>Source Files\protobuf</Filter>
</ClCompile>
<ClCompile Include="..\protobuf\dota_commonmessages.pb.cc">
<Filter>Source Files\protobuf</Filter>
</ClCompile>
<ClCompile Include="..\protobuf\netmessages.pb.cc">
<Filter>Source Files\protobuf</Filter>
</ClCompile>
<ClCompile Include="..\protobuf\networkbasetypes.pb.cc">
<Filter>Source Files\protobuf</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="tools\Injector.exe">
Expand Down

0 comments on commit 417522b

Please sign in to comment.