Osu! AOB's

Posts 110 of 10 · Page 1 of 1
Osu! AOB's
someone know the osu! time aob?
Yes i know the aob pretty well. But what in exchange?
Quote Originally Posted by Razielex View Post
Yes i know the aob pretty well. But what in exchange?
????????

here you go fam, no exchange.
A3 00 00 00 00 8B 35 00 00 00 00 85 F6
x????xx????xx
offset +1
Quote Originally Posted by Azuki View Post


????????

here you go fam, no exchange.
A3 00 00 00 00 8B 35 00 00 00 00 85 F6
x????xx????xx
offset +1
whats an aob
Quote Originally Posted by chcken View Post
whats an aob
an array of bytes
Quote Originally Posted by Azuki View Post


????????

here you go fam, no exchange.
A3 00 00 00 00 8B 35 00 00 00 00 85 F6
x????xx????xx
offset +1
thanks, sadly for some reason my pattern scanner doesn't work with osu! (maybe some of kind of protection). Well, at least i think i got my parser working

Quote Originally Posted by Azuki View Post


????????

here you go fam, no exchange.
A3 00 00 00 00 8B 35 00 00 00 00 85 F6
x????xx????xx
offset +1
Thats totally different aob than mine but ok
Quote Originally Posted by Razielex View Post
Thats totally different aob than mine but ok
well who gives a shit, he wanted a time aob. now he has one.


- - - Updated - - -

Quote Originally Posted by superpendejo View Post
thanks, sadly for some reason my pattern scanner doesn't work with osu! (maybe some of kind of protection). Well, at least i think i got my parser working

weird. osu doesn't have any protections. you sure you're doing everything right? whats the ps code
Quote Originally Posted by Azuki View Post


well who gives a shit, he wanted a time aob. now he has one.


- - - Updated - - -



weird. osu doesn't have any protections. you sure you're doing everything right? whats the ps code
actually i just copied some code and tweaked it a bit
Code:
//paternscan.c 

#include "patternscan.h"
/*
 * 2018-26-01 removed permission change (VirtualProtectEx call)
 * 2019-26-01 added a check for page read/write permissions (42 - 50)
 */

#define true 1
#define false 0
typedef int bool;

DWORD get_process_id(const char* name) {
	// store process ID in here to return later.
	DWORD process_id = 0;

	HANDLE process_list = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

	PROCESSENTRY32 entry = {0};
	entry.dwSize = sizeof (PROCESSENTRY32);

	if (Process32First(process_list, &entry)) {
		while (Process32Next(process_list, &entry)) {
			if (strcmp(entry.szExeFile, name) == 0) {
				process_id = entry.th32ProcessID;
			}
		}
	}

	CloseHandle(process_list);

	return process_id;
}

//Get ModuleEntry from module name, using toolhelp32snapshot
MODULEENTRY32 GetModule(DWORD dwProcID, const char * moduleName)
{
	MODULEENTRY32 modEntry = { 0 };

	HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, dwProcID);

	if (hSnapshot != INVALID_HANDLE_VALUE)
	{
		MODULEENTRY32 curr = { 0 };

		curr.dwSize = sizeof(MODULEENTRY32);
		if (Module32First(hSnapshot, &curr))
		{
			do
			{
				if (!strcmp(curr.szModule, moduleName))
				{
					modEntry = curr;
					break;
				}
			} while (Module32Next(hSnapshot, &curr));
		}
		CloseHandle(hSnapshot);
	}
	return modEntry;
}
//Internal Pattern Scan
void * PatternScan(char* base, size_t size, const char* pattern, const char* mask)
{
	size_t patternLength = strlen(mask);

	for (unsigned int i = 0; i < size - patternLength; i++)
	{
		bool found = true;
		for (unsigned int j = 0; j < patternLength; j++)
		{
			if (mask[j] != '?' && pattern[j] != *(base + i + j))
			{
				found = false;
				break;
			}
		}
		if (found)
		{
			return (void*)(base + i);
		}
	}
	return NULL;
}

//External Wrapper
void * PatternScanEx(HANDLE hProcess, uintptr_t begin, uintptr_t end, const char* pattern, const char* mask)
{
	uintptr_t currentChunk = begin;
	SIZE_T bytesRead;

    MEMORY_BASIC_INFORMATION memInfo = {0};
	while (currentChunk < end)
	{
		char buffer[4096];

		DWORD oldprotect;

        //checking page permisions
        if (VirtualQueryEx(hProcess, (void*)currentChunk, &memInfo, sizeof(MEMORY_BASIC_INFORMATION)) == 0)
            break;

#define WRITABLE (PAGE_READWRITE | PAGE_WRITECOPY | PAGE_EXECUTE_READWRITE | PAGE_EXECUTE_WRITECOPY)
        if (!(memInfo.Protect && WRITABLE) && (memInfo.State == MEM_COMMIT))
        {
            //ignore memory pages
            currentChunk = currentChunk + memInfo.RegionSize;
            continue;
        }

		/* VirtualProtectEx(hProcess, (void*)currentChunk, sizeof(buffer), PAGE_EXECUTE_READWRITE, &oldprotect); */
		ReadProcessMemory(hProcess, (void*)currentChunk, &buffer, sizeof(buffer), &bytesRead);
		/* VirtualProtectEx(hProcess, (void*)currentChunk, sizeof(buffer), oldprotect, &oldprotect); */

		if (bytesRead == 0)
		{
			return NULL;
		}

		void* internalAddress = PatternScan((char*)&buffer, bytesRead, pattern, mask);

		if (internalAddress != NULL)
		{
			//calculate from internal to external
			uintptr_t offsetFromBuffer = (uintptr_t)internalAddress - (uintptr_t)&buffer;
			return (void*)(currentChunk + offsetFromBuffer);
		}
		else
		{
			//advance to next chunk
			currentChunk = currentChunk + bytesRead;
		}
	}
	return NULL;
}

void * find_pattern(const char* process_name, const char* pattern, const char* mask){
    DWORD process_id = get_process_id(process_name);
    HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, process_id);
    
    MODULEENTRY32 modEntry = GetModule(process_id, process_name);
	
	//if module not found
    if (!modEntry.th32ModuleID)
		return NULL;

	//maybe this is wrong?
	uintptr_t begin = (uintptr_t)modEntry.modBaseAddr;
	uintptr_t end = begin + modEntry.modBaseSize;
    
    return PatternScanEx(hProcess, begin, end, pattern, mask);
}
Code:
//paternscan.h
#pragma once
#include <windows.h>
#include <tlhelp32.h>
#include <stdint.h>
#include <string.h>

DWORD get_process_id(const char* name); 
MODULEENTRY32 GetModule(DWORD dwProcID, const char * moduleName);

//Internal Pattern Scan
void * PatternScan(char* base, size_t size, const char* pattern, const char* mask);

//External Wrapper
void * PatternScanEx(HANDLE hProcess, uintptr_t begin, uintptr_t end, const char* pattern, const char* mask);
void * find_pattern(const char* process_name, const char* pattern, const char* mask);
and how i use it

Code:
//main.c
#include <stdio.h>
#include "patternscan.h"

int main(int argc, char** argv){
	//A3 00 00 00 00 8B 35 00 00 00 00 85 F6

    void * address = find_pattern("osu!.exe",
            "\xA3\x00\x00\x00\x00\x8B\x35\x00\x00\x00\x00\x85\xF6",
            "x????xx????xx");

    printf("%p", address); //prints 0
}
Quote Originally Posted by superpendejo View Post
-snip-
find a new function that gets the int from the pattern
after you get the int from the pattern you have the read that value from the address
so
patternscan(aob) = result
readint32(result + 1) = time address
readint32(time address) = current osu! time
Posts 110 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?