📚 OpenRCE is preserved as a read-only archive. Launched at RECon Montreal in 2005. Registration and posting are disabled.








Flag: Tornado! Hurricane!

 Forums >>  IDA Pro  >>  GetTickCount() Method in Skype

Topic created on: August 30, 2007 23:41 CDT by jaffersathik2010 .

Hi All,

I just found that skype application uses one of the windows dll method
GetTickCount() at couple of places and compraing the return values.

If the values are not same, it takes me to some random pages (which has only series of INT instruction!!!).

It obstructs me to move ahead.

In short, I have 3 questions in my mind.

1. Can GetTickCount() be used as anti-debugging method ?

2. If the answer to the question-1 is yes, how to over come
   that one?

3. Have any one hacked Skype before ?

I welcome any knid of help.

Thanks,
Jaffer

  simpleuser   August 31, 2007 02:54.52 CDT
1/
call GTC twice and compare results.
if it's the same then wrong.
if it's too different (>0x500 ?) then wrong.

2/
modify it
or
modify the results
or
just set a breakpoint after the 2nd call and run.

3/
check Vanilla-skype Recon presentations.

  jaffersathik2010     August 31, 2007 04:37.40 CDT
Thanks a lot man.

Vanilla-skype Recon presentation gave me better ideas.

--Jaffer

  jms     August 31, 2007 09:31.23 CDT
Once you have done some manual verification, just use ImmunityDebugger or PyDbg to script a quick hook on the exit of the function (in the case of ID you will need to set a BP on [ESP]), and then just flip the value in EAX to whatever you need it to be, its quick and dirty but it will alleviate some of the headache of dealing with that call.

  bw     September 13, 2007 17:07.26 CDT
call GetTickCount  ; returns 0FFFFFFFFh
nop
nop
...
call GetTickCount  ; returns 0000000xxh

try to compare results now :), msdn clearly says "the time will wrap around to zero if Windows is run continuously for 49.7 days", so it's not a good thing to use it for example in server applications, try GetSystemTime(), GetSystemTimeAsFileTime() and QueryPerformanceCounter() instead.

  dami     September 13, 2007 21:23.15 CDT
While playing with hackerchallenge 07, this antidebug method was used, here is my way of bypassing it using a Immunity Debugger hook @ kernel32.GetTickCount.

mem = imm.remoteVirtualAlloc(4)
imm.writeLong(mem, 0x10101010)
logbp_hook = HookGetTickCount(mem)
logbp_hook.add("hooktick",imm.getAddress("kernel32.GetTickCount"))
imm.getAddress("kernel32.GetTickCount"))

and the hook itself:

class HookGetTickCount(immlib.LogBpHook):
    def __init__(self, mem):
        immlib.LogBpHook.__init__(self)
        self.mem = mem
                
    def run(self,regs):
        imm = immlib.Debugger()
        imm.Log("inside GetTickCount")
        tick = imm.readLong(self.mem)
        tick += random.randint(30,80)
        imm.writeLong(self.mem, tick)
        imm.Log("setting tick to: %08X" % tick)
        imm.setReg("EAX", tick)
        imm.setReg("EIP", 0x7C8092D3)


Of course JMS answer is much more simple than this, im just showing another way of doing it :)

Note: Registration is required to post to the forums.

There are 31,328 total registered users.


Recently Created Topics
[help] Unpacking VMP...
Mar/12
Reverse Engineering ...
Jul/06
let 'IDAPython' impo...
Sep/24
set 'IDAPython' as t...
Sep/24
GuessType return une...
Sep/20
About retrieving the...
Sep/07
How to find specific...
Aug/15
How to get data depe...
Jul/07
Identify RVA data in...
May/06
Question about memor...
Dec/12


Recent Forum Posts
Finding the procedur...
rolEYder
Question about debbu...
rolEYder
Identify RVA data in...
sohlow
let 'IDAPython' impo...
sohlow
How to find specific...
hackgreti
Problem with ollydbg
sh3dow
How can I write olly...
sh3dow
New LoadMAP plugin v...
mefisto...
Intel pin in loaded ...
djnemo
OOP_RE tool available?
Bl4ckm4n


Recent Blog Entries
halsten
Mar/14
Breaking IonCUBE VM

oleavr
Oct/24
Anatomy of a code tracer

hasherezade
Sep/24
IAT Patcher - new tool for ...

oleavr
Aug/27
CryptoShark: code tracer ba...

oleavr
Jun/25
Build a debugger in 5 minutes

More ...


Recent Blog Comments
nieo on:
Mar/22
IAT Patcher - new tool for ...

djnemo on:
Nov/17
Kernel debugger vs user mod...

acel on:
Nov/14
Kernel debugger vs user mod...

pedram on:
Dec/21
frida.github.io: scriptable...

capadleman on:
Jun/19
Using NtCreateThreadEx for ...

More ...


Imagery
SoySauce Blueprint
Jun 6, 2008

[+] expand

View Gallery (11) / Submit