Register for your free account! | Forgot your password?

You last visited: Today at 10:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



OllyDbg

Discussion on OllyDbg within the General Coding forum part of the Coders Den category.

Reply
 
Old 03/07/2014, 08:59   #16


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
Quote:
Originally Posted by MrSm!th View Post
Ein direkter Sprung am Start der Funktion, ein BP am Start der Funktion, etc.
Für VTable Hooks muss es erst einmal eine VTable geben und so undetected sind die mittlerweile auch nicht mehr.
deswegen ja auch meistens. aber jo, hast schon recht. mal ganz davon abgesehen gibt's meistens eine, toplevel halt. gibt ja noch pointer destruction und sowas.

nichts destotrotz, am effizientesten ist einfach das anti cheat zu kicken.
buFFy! is offline  
Old 03/07/2014, 13:23   #17
 
Tyrar's Avatar
 
elite*gold: 0
Join Date: Oct 2008
Posts: 1,637
Received Thanks: 1,119
Quote:
Originally Posted by buFFy! View Post
deswegen ja auch meistens. aber jo, hast schon recht. mal ganz davon abgesehen gibt's meistens eine, toplevel halt. gibt ja noch pointer destruction und sowas.

nichts destotrotz, am effizientesten ist einfach das anti cheat zu kicken.
Wenn man es als einfach bezeichnet (eventuelle) Packets zu emulieren, klar.
Tyrar is offline  
Old 03/07/2014, 16:39   #18


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
Oft reicht es auch, das AC zu krüppeln.
MrSm!th is offline  
Old 03/07/2014, 16:43   #19
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Kurze Frage zu calling conventions. Wie bekomme ich die calling convention raus, wenn die Funktion keine Parameter besitzt? Dort wird dann ja nichts aufgeräumt, weil ja keine Argumente gepushed wurden, oder seh ich das falsch?
qkuh is offline  
Old 03/07/2014, 20:29   #20


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
Quote:
Originally Posted by Tyrar View Post
Wenn man es als einfach bezeichnet (eventuelle) Packets zu emulieren, klar.
Ich hab doch total offen gehalten wie man das kickt - habe nie gesagt das das garnicht erst geladen werden soll.

Quote:
Originally Posted by MrSm!th View Post
Oft reicht es auch, das AC zu krüppeln.
Eben.

Quote:
Originally Posted by qkuh View Post
Kurze Frage zu calling conventions. Wie bekomme ich die calling convention raus, wenn die Funktion keine Parameter besitzt? Dort wird dann ja nichts aufgeräumt, weil ja keine Argumente gepushed wurden, oder seh ich das falsch?
Die calling convention muss keine bestimmte sein, solange sie passt.
So kann ein thiscall z.b. auch ein fastcall sein.
buFFy! is offline  
Old 03/07/2014, 21:36   #21
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Vielen Dank, buffy.
qkuh is offline  
Old 03/08/2014, 13:56   #22


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
Ohne Parameter (wenn man this jetzt mal dazu zählt) ist die Calling Convention irrelevant.
Diese beschreibt ja nur, wie die Argumente übergeben und später der Speicher wieder aufgeräumt wird.
MrSm!th is offline  
Old 03/08/2014, 21:09   #23
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Sowas hatte ich mir schon gedacht
Bin jetzt an ein anderes Problem gestoßen. Weiß jemand weshalb mein Detour die alten bytes nicht wiederherstellt? Er springt in mein Modul und wieder zurück, aber die bytes die durch den jmp draufgegangen sind, werden einfach nicht wiederhergestellt. Oder muss man das selber handlen? Nutze MS Detours 3.
qkuh is offline  
Old 03/08/2014, 23:30   #24


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
Dafür musst du schon etwas Code zeigen.
MrSm!th is offline  
Old 03/09/2014, 00:11   #25
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Code:
#include <windows.h>
#include <stdio.h>
#include <iostream>
#include <process.h>
#include "detours.h"

#include <QApplication>
#include "gui.h"

#include <string.h>

#pragma comment(lib, "detours.lib")

typedef void (__stdcall* SendFunction)(DWORD);
typedef void (__stdcall* ReceiveFunction)(void);

SendFunction Send = (SendFunction)0x51EDD4;
ReceiveFunction Receive = (ReceiveFunction)0x519B78;

static void (__stdcall* OrigSend)(DWORD) = Send;
static void (__stdcall* OrigRecv)(void) = Receive;

Gui* gui;
char* cmd;

void NewSend(DWORD)
{
	char* cmd = nullptr;

	__asm
	{
		MOV cmd, ECX
	}

	gui->ui.listWidget->addItem(QString("[S->]") + cmd);
}

void NewReceive(void)
{
	_asm
	{

		MOV cmd, EDX	
	}
	return Receive();
}

unsigned __stdcall threadMain(void*)
{
	QApplication a(__argc, __argv);
	gui = new Gui();
	gui->show();
	return a.exec();
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
	switch(fdwReason)
	{
	case DLL_PROCESS_ATTACH:
		_beginthreadex(NULL, 0, threadMain, NULL, 0, NULL);
		DisableThreadLibraryCalls(hinstDLL);
		DetourTransactionBegin();
		DetourUpdateThread(GetCurrentThread());
		DetourAttach(&(PVOID&)OrigSend, NewSend);
		DetourAttach(&(PVOID&)OrigRecv, NewReceive);
		DetourTransactionCommit();
		break;
	}

	return true;
}
qkuh is offline  
Old 03/09/2014, 13:03   #26


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
Quote:
Originally Posted by qkuh View Post
Code:
#include <windows.h>
#include <stdio.h>
#include <iostream>
#include <process.h>
#include "detours.h"

#include <QApplication>
#include "gui.h"

#include <string.h>

#pragma comment(lib, "detours.lib")

typedef void (__stdcall* SendFunction)(DWORD);
typedef void (__stdcall* ReceiveFunction)(void);

SendFunction Send = (SendFunction)0x51EDD4;
ReceiveFunction Receive = (ReceiveFunction)0x519B78;

static void (__stdcall* OrigSend)(DWORD) = Send;
static void (__stdcall* OrigRecv)(void) = Receive;

Gui* gui;
char* cmd;

void NewSend(DWORD)
{
	char* cmd = nullptr;

	__asm
	{
		MOV cmd, ECX
	}

	gui->ui.listWidget->addItem(QString("[S->]") + cmd);
}

void NewReceive(void)
{
	_asm
	{

		MOV cmd, EDX	
	}
	return Receive();
}

unsigned __stdcall threadMain(void*)
{
	QApplication a(__argc, __argv);
	gui = new Gui();
	gui->show();
	return a.exec();
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
	switch(fdwReason)
	{
	case DLL_PROCESS_ATTACH:
		_beginthreadex(NULL, 0, threadMain, NULL, 0, NULL);
		DisableThreadLibraryCalls(hinstDLL);
		DetourTransactionBegin();
		DetourUpdateThread(GetCurrentThread());
		DetourAttach(&(PVOID&)OrigSend, NewSend);
		DetourAttach(&(PVOID&)OrigRecv, NewReceive);
		DetourTransactionCommit();
		break;
	}

	return true;
}
hast natürlich genau das gezeigt was uns nix bringt.
wie auch immer, alles was du beim detouren patchst musst du selber nachholen.
natürlich nur, wenn die funktion das nicht für dich übernimmt.

auch hier gilt: olly ran und debuggen!
buFFy! is offline  
Old 03/09/2014, 13:07   #27
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
ASM Code:
Code:
CPU Disasm
Address   Hex dump          Command                                  Comments
00519B78  /$  53            PUSH EBX                                 ; nostalex.00519B78(guessed void)
00519B79  |.  56            PUSH ESI
00519B7A  |.  57            PUSH EDI
00519B7B  |.  55            PUSH EBP
00519B7C  |.  51            PUSH ECX
00519B7D  |.  891424        MOV DWORD PTR SS:[LOCAL.4],EDX
00519B80  |.  8BE8          MOV EBP,EAX
00519B82  |.  33F6          XOR ESI,ESI
00519B84  |.  8B45 04       MOV EAX,DWORD PTR SS:[EBP+4]
00519B87  |.  8B78 08       MOV EDI,DWORD PTR DS:[EAX+8]
00519B8A  |.  4F            DEC EDI
00519B8B  |.  3BFE          CMP EDI,ESI
00519B8D  |.  7C 32         JL SHORT 00519BC1
00519B8F  |>  8D1C37        /LEA EBX,[ESI+EDI]
00519B92  |.  D1EB          |SHR EBX,1
00519B94  |.  8B45 04       |MOV EAX,DWORD PTR SS:[EBP+4]
00519B97  |.  8BD3          |MOV EDX,EBX
00519B99  |.  E8 BE22F0FF   |CALL 0041BE5C
00519B9E  |.  8B40 10       |MOV EAX,DWORD PTR DS:[EAX+10]
00519BA1  |.  8B1424        |MOV EDX,DWORD PTR SS:[LOCAL.4]
00519BA4  |.  E8 2B1BEFFF   |CALL 0040B6D4                           ; [nostalex.0040B6D4
00519BA9  |.  85C0          |TEST EAX,EAX
00519BAB  |.  7D 05         |JGE SHORT 00519BB2
00519BAD  |.  8D73 01       |LEA ESI,[EBX+1]
00519BB0  |.  EB 0B         |JMP SHORT 00519BBD
00519BB2  |>  8BFB          |MOV EDI,EBX
00519BB4  |.  4F            |DEC EDI
00519BB5  |.  85C0          |TEST EAX,EAX
00519BB7  |.  75 04         |JNZ SHORT 00519BBD
00519BB9  |.  8BC3          |MOV EAX,EBX
00519BBB  |.  EB 07         |JMP SHORT 00519BC4
00519BBD  |>  3BFE          |CMP EDI,ESI
00519BBF  |.^ 7D CE         \JGE SHORT 00519B8F
00519BC1  |>  83C8 FF       OR EAX,FFFFFFFF
00519BC4  |>  5A            POP EDX
00519BC5  |.  5D            POP EBP
00519BC6  |.  5F            POP EDI
00519BC7  |.  5E            POP ESI
00519BC8  |.  5B            POP EBX
00519BC9  \.  C3            RETN
Durch Detour:
Code:
CPU Disasm
Address   Hex dump          Command                                  Comments
00519B78  /$  E9 137F125D   JMP 5D641A90                             ; nostalex.00519B78(guessed void)
00519B7D  |.  891424        MOV DWORD PTR SS:[LOCAL.4],EDX
00519B80  |.  8BE8          MOV EBP,EAX
00519B82  |.  33F6          XOR ESI,ESI
00519B84  |.  8B45 04       MOV EAX,DWORD PTR SS:[EBP+4]
00519B87  |.  8B78 08       MOV EDI,DWORD PTR DS:[EAX+8]
00519B8A  |.  4F            DEC EDI
00519B8B  |.  3BFE          CMP EDI,ESI
00519B8D  |.  7C 32         JL SHORT 00519BC1
00519B8F  |>  8D1C37        /LEA EBX,[ESI+EDI]
00519B92  |.  D1EB          |SHR EBX,1
00519B94  |.  8B45 04       |MOV EAX,DWORD PTR SS:[EBP+4]
00519B97  |.  8BD3          |MOV EDX,EBX
00519B99  |.  E8 BE22F0FF   |CALL 0041BE5C
00519B9E  |.  8B40 10       |MOV EAX,DWORD PTR DS:[EAX+10]
00519BA1  |.  8B1424        |MOV EDX,DWORD PTR SS:[LOCAL.4]
00519BA4  |.  E8 2B1BEFFF   |CALL 0040B6D4                           ; [nostalex.0040B6D4
00519BA9  |.  85C0          |TEST EAX,EAX
00519BAB  |.  7D 05         |JGE SHORT 00519BB2
00519BAD  |.  8D73 01       |LEA ESI,[EBX+1]
00519BB0  |.  EB 0B         |JMP SHORT 00519BBD
00519BB2  |>  8BFB          |MOV EDI,EBX
00519BB4  |.  4F            |DEC EDI
00519BB5  |.  85C0          |TEST EAX,EAX
00519BB7  |.  75 04         |JNZ SHORT 00519BBD
00519BB9  |.  8BC3          |MOV EAX,EBX
00519BBB  |.  EB 07         |JMP SHORT 00519BC4
00519BBD  |>  3BFE          |CMP EDI,ESI
00519BBF  |.^ 7D CE         \JGE SHORT 00519B8F
00519BC1  |>  83C8 FF       OR EAX,FFFFFFFF
00519BC4  |>  5A            POP EDX
00519BC5  |.  5D            POP EBP
00519BC6  |.  5F            POP EDI
00519BC7  |.  5E            POP ESI
00519BC8  |.  5B            POP EBX
00519BC9  \.  C3            RETN
______________________
CPU Disasm
Address   Hex dump          Command                                  Comments
5D641A90    8915 0CA2645D   MOV DWORD PTR DS:[5D64A20C],EDX
5D641A96  ^ FF25 C0A1645D   JMP DWORD PTR DS:[5D64A1C0]
qkuh is offline  
Old 03/10/2014, 07:42   #28


 
buFFy!'s Avatar
 
elite*gold: 1826
Join Date: Mar 2009
Posts: 4,310
Received Thanks: 6,287
jo dann musst du theoretisch in deiner func

Code:
__asm
{
PUSH EBX
PUSH ESI
PUSH EDI
PUSH EBP
PUSH ECX
}
exekutieren. jenachdem wie du's willst, anfang sollte reichen.
buFFy! is offline  
Old 03/10/2014, 10:54   #29


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
Eigentlich sollte MS Detours dir ein Trampolin mit den überschriebenen Bytes erstellen. Du musst es halt nur ausführen.
MrSm!th is offline  
Thanks
1 User
Old 03/10/2014, 12:20   #30
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Quote:
Originally Posted by buFFy! View Post
jo dann musst du theoretisch in deiner func

Code:
__asm
{
PUSH EBX
PUSH ESI
PUSH EDI
PUSH EBP
PUSH ECX
}
exekutieren. jenachdem wie du's willst, anfang sollte reichen.
Das wird leider nicht viel bringen. Denn dann hab ich entweder das Problem, dass die Endlosschleife durch das "return Receive" nochimmer da ist oder, dass der Rest der originalen Funktion nicht ausgeführt wird, da ohne return logischerweise hinter den Caller gesprungen wird.

Und wie komm ich an die Adresse vom Trampoline? Ich könnte natürlich in OllyDBG evtl. danach suchen aber ich denke, dass das weniger sinnvoll ist.

Mein Problem ist eigentlich nur, dass ich
a) Die überschriebenen bytes benötige
und
b) Die originale Funktion weiter ausgeführt werden soll

Gruß
qkuh is offline  
Reply


Similar Threads Similar Threads
ollydbg about
05/12/2013 - SRO Private Server - 0 Replies
hello ollydbg about i want I want to find something that I want to line sample event so-ok To change the ice cups per kill to find out where he is + Can you help me in this regard? Jobs reward job When giving money only I would like to give gold coin at the end of each job
ollydbg und elf
09/19/2010 - General Coding - 3 Replies
Hi Leute Gibt es für ollydbg bzw. odbgscript ein script womit man ELF dynamic librarys (.so) öffnen kann?
Help please with Ollydbg
02/24/2010 - Mabinogi - 1 Replies
ok ive tried the fix with the *.osc plugin and ive tried many other ways to get it to work with the .dlls but it still wont find the addresses to the CORRECT function that IDA PRO 32bit and 64 bit show for anything i look too mod ive even gone and put ollydbg on my 32 bit laptop and it still didnt work:mad: anyone have a idea how to edit them same way but different program or a fix?
OllyDBG
01/25/2009 - Dekaron - 11 Replies
ok i just have a simple question: is it possible to make an argate hack using ollydbg? would u need a crc bypasser to be able to use it or do i need one in order for the argate hack to work?
OllyDBG Help
03/25/2008 - General Coding - 4 Replies
Hi,i recently heard you could dupe items in ROSE Online with OllyDBG,it's patched already,and i was wondering if this works with any game.If so,could someone release a Tutorial or something to help me understand how to use OllyDBG better? I'm sorry if there is one already posted,i searched and couldnt find any.



All times are GMT +1. The time now is 10:32.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.