Skip to content

Instantly share code, notes, and snippets.

View Mischa-Alff's full-sized avatar

Mischa Alff Mischa-Alff

View GitHub Profile
"""
cee - The C++-evaluating IRC bot (written in Python)
Please run this file.
Please?
Also, there's a README, and a LICENSE file.
I chose MIT as a license because it rocks.

8FF1 A51E 97BA FCA9 2B88 C435 5F6F D812 150D 841B (captured above as body.key.fingerprint), yielding the PGP signature:

-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.22 (MingW32)

owGbwMvMwMRYl/5hd8QqkZeMpw+sSWIINsmQrFZKyk+pVLKqVspOBVNpmXnpqUUF
RZl5JUpWShZpaYaJpoapluZJiWnJiZZGSRYWySbGpqZpZmkpFoZGhqYGKRYmhklK
OkoZ+cUgHUBjkhKLU/Uy84FiQE58ZgpQ1NTNzM0Fot4FqN4JKFcKlkhKNLE0ME0y
@Mischa-Alff
Mischa-Alff / autoBANNED.cpp
Created April 22, 2014 13:29
autoBANNED.cpp
#include <list>
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window{{800, 600}, "AutoBANNED"};
window.setFramerateLimit(60);
; disable paging
mov eax, cr0
and eax, (1<<31)-1
mov cr0, eax
; Clear memory that will
; contain page tables stuff
mov edi, 0xC1000
mov cr3, edi
xor eax, eax
typedef uint64_t page_t;
typedef page_t page_table_t[0x200];
typedef page_table_t *page_directory_t[0x200];
typedef page_directory_t *page_directory_pointer_t[0x200];
typedef page_directory_pointer_t *pml4_t[0x200];
pml4_t pml4;
extern "C"
void setup_paging()
; 32bit stuff
push eax
push ebx
;... set up long mode stuff
pop ebx
pop eax
lgdt [gdt.ptr]
strlen:
mov esi, eax
xor ecx, ecx
.loop:
mov edx, [esi+ecx]
cmp edx, 0
je .end
inc ecx
jmp .loop
.end:
namespace std
{
template <typename T, typename Y> T* begin(std::pair<T*, Y> const& p){ return p.first; }
template <typename T, typename Y> T* end(std::pair<T*, Y> const& p){ return p.second*sizeof(p.first); }
}
#include <memory>
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window{{800, 600}, "Backface Calculations for zsbzsb"};
sf::CircleShape light_point(5.f);
light_point.setOrigin({5.f, 5.f});
light_point.setPosition(static_cast<sf::Vector2f>(window.getSize())/2.f);
#include <ctime>
#include <iostream>
#include <SFML/Graphics.hpp>
#include <noise/noise.h>
class Game;
class Level
{
friend class Game;