Skip to content

Commit be5eff9

Browse files
committed
X64 support added
1 parent 4a47677 commit be5eff9

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Shellcodev/Shellcodev.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,14 @@
125125
<SDLCheck>true</SDLCheck>
126126
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
127127
<ConformanceMode>true</ConformanceMode>
128+
<AdditionalIncludeDirectories>$(SolutionDir)asmtk\src;$(SolutionDir)asmjit\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
129+
<MultiProcessorCompilation>true</MultiProcessorCompilation>
128130
</ClCompile>
129131
<Link>
130132
<SubSystem>Console</SubSystem>
131133
<GenerateDebugInformation>true</GenerateDebugInformation>
134+
<AdditionalLibraryDirectories>$(SolutionDir)asmjit\build_vs2022_x64\Debug;$(SolutionDir)asmtk\build_vs2022_x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
135+
<AdditionalDependencies>asmjit.lib;asmtk.lib;%(AdditionalDependencies)</AdditionalDependencies>
132136
</Link>
133137
</ItemDefinitionGroup>
134138
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">

Shellcodev/eval.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ std::vector<std::string> shelldev_parse_string(std::string reg, std::string valu
5858
hex.push_back(ss.str());
5959
}
6060

61+
std::string key = "11111111";
6162
for (int i = 0; i < hex.size(); i++)
6263
if (hex[i].size() < 8)
6364
for (int j = 0; j < (8 - hex[i].size()); j++)
6465
hex[i].insert(0, "00");
6566

66-
std::string key = "11111111";
6767
std::vector<_str_parser_t> parsers;
6868
for (int i = 0; i < hex.size(); i++)
6969
{
@@ -97,7 +97,11 @@ std::vector<std::string> shelldev_parse_string(std::string reg, std::string valu
9797
}
9898
}
9999

100+
#ifdef _M_X64
101+
instructions.push_back("mov " + reg + ", rsp");
102+
#elif defined(_M_IX86)
100103
instructions.push_back("mov " + reg + ", esp");
104+
#endif
101105

102106
return instructions;
103107
}

Shellcodev/inject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ BOOL shelldev_inject_shellcode(std::vector<asm_t>* assemblies, std::string pid)
2121
HANDLE remoteThread;
2222
PVOID remoteBuffer;
2323

24-
processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, (DWORD)std::atoi(pid.c_str()));
24+
processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PID);
2525
remoteBuffer = VirtualAllocEx(processHandle, NULL, bytes.size(), (MEM_RESERVE | MEM_COMMIT), PAGE_EXECUTE_READWRITE);
2626
WriteProcessMemory(processHandle, remoteBuffer, bytes.data(), bytes.size(), NULL);
2727
remoteThread = CreateRemoteThread(processHandle, NULL, 0, (LPTHREAD_START_ROUTINE)remoteBuffer, NULL, 0, NULL);

Shellcodev/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main(int argc, char *argv[])
1212
{
1313
SetConsoleCtrlHandler(winrepl_exit, TRUE);
1414

15-
std::cout << "Shellcodev v2.1 by XaFF based on WinREPL\n";
15+
std::cout << "Shellcodev v2.2 by XaFF based on WinREPL\n";
1616
std::cout << "Input assembly instructions, or \".help\" for a list of commands.\n" << std::endl;
1717

1818
while (TRUE)

0 commit comments

Comments
 (0)