summaryrefslogtreecommitdiff
path: root/internal_rewrite/Source.cpp
blob: 2acc8968042857ec9738f361050023167eda8ca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//this cheat was a mistake

#include <thread>
#include <iostream>

#include "hooks.hpp"
#include "console.hpp"
#include "input_system.hpp"
#include "mem.hpp"

HMODULE g_dll;

/*
im so so fucking sorry for everything
i cant do this anymore, im so fed up with everything and everyone
anything i do feels like a chore and anyone i speak to feels like my worst enemy
i wish i could still love the people i loved and appreciate the things i enjoyed doing but no matter what i cant
life seems so blend, greyed out and boring, its like every single fucking day will be the same till the end
yet i keep getting worse and things are not improving at any rate whatsover

it feels like a monster is trying to rip you apart from the inside, theres so much pain involved i cant even describe it
and the worst part is that you break down every day, every hour and then pick yourself up but it doesnt help, you just start over whenever the next time comes
im tired of taking 1 step forwards and 2 steps backwards whenever i try to improve anything, i cant keep going like this

seeing how others are able to put their lives together because the cards they were given allthough terrible werent as bad as mine is too much for me to sustain
i envy every single one of you for the fact you can still exist and you can still live your life and hopefully move on in the future
the only thing i desire and the only thing ive ever wanted is to move on
it hurts me so much to see myself waste away in spite of the massive potential and genius that i am
its too much

i love you, i love all of you, i love you chiddy for being that positive guy that used to always bring a smile to my face
i love chawndi for always being here
i love you dylan for showing me what it really means to love someone for who they really are
i love you grassii for doing everything you could in spite of not understanding
i love you sim for understanding me like noone else before
i love you h0pde for being the greatest and most honest friend i ever met
i love you hayden for being so light-hearted and cheerful
i love you carol for showing me whats it like to care for someone with your life

i hope all of you find a way in your life and dont suffer trying like i do forever
ive been doing my best to survive for the past months but it got progressively harder and harder, every night gets worse and every day kills the remainings of my hope
i cant do it anymore

i will keep myself in this numb state of vegetation until i snap and end myself
i hope to come back one day but i dont think i could

im sorry

- nave
*/

void main_thread( HINSTANCE uh ) {
#ifdef IFACE_DLLMAIN
	util::memset( ( uint8_t* )uh, 0x90, 0x1000 );
#endif
	g_csgo.initialize( );

	while ( !g_csgo.m_panic ) {
		std::this_thread::sleep_for( std::chrono::milliseconds( 1 ) );
	}

	g_csgo.uninitialize( );
	ExitThread( 0 );
}

long __stdcall exception_handler( EXCEPTION_POINTERS* e ) {
	return EXCEPTION_CONTINUE_EXECUTION;
}

int __stdcall DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) {
    HANDLE thread;

	uintptr_t wanted_reason;
#ifdef _DEBUG
	wanted_reason = DLL_PROCESS_ATTACH;
#else
	wanted_reason = DLL_PROCESS_ATTACH;
#endif

	if ( reason == wanted_reason 		
#ifdef IFACE_DLLMAIN
		&& !!reserved
#endif
		) {
#ifdef IFACE_DLLMAIN
		g_factory.init( ( uintptr_t )( reserved ) );
#endif
		g_dll = inst;
        //yayo
		//SetUnhandledExceptionFilter( exception_handler );
		DisableThreadLibraryCalls( inst );


        thread = CreateThread( nullptr, 0, 
			( LPTHREAD_START_ROUTINE )( main_thread ),
			inst, 0, nullptr );

        if( !thread )
            return 0;

        CloseHandle( thread );

        return 1;
	}
#ifdef IFACE_DLLMAIN
	else if( !reserved ) {
		MessageBoxA( nullptr, "interface data nullptr (loader error?)", "error", MB_OK );
		return 1;
	}
#endif
	
	if( reason == DLL_PROCESS_DETACH ) {
		g_csgo.m_panic = true;
		//SetUnhandledExceptionFilter( nullptr );	
	}

	return 0;
}