Function at 0x496bc0
Capabilities:
Hook routines via microsoft detours

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
cmp dword [ebp + 8], 0x7ff80000
jbe 0x496bdc
mov eax, dword [ebp + 8]
sub eax, 0x7ff80000
mov dword [ebp - 0x1c], eax
jmp 0x496be3
mov dword [ebp - 0x1c], 0x10000
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 8], ecx
cmp dword [ebp + 8], 0x80000000
jae 0x496c00
mov edx, dword [ebp + 8]
add edx, 0x7ff80000
mov dword [ebp - 0x20], edx
jmp 0x496c07
mov dword [ebp - 0x20], 0xfff80000
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], 0
cmp dword [0x4d10cc], 0
jne 0x496c32
cmp dword [0x4d10c8], 0
je 0x496c32
mov ecx, dword [0x4d10c8]
mov dword [0x4d10cc], ecx
cmp dword [0x4d10cc], 0
je 0x496caf
mov edx, dword [0x4d10cc]
cmp dword [edx + 8], 0
je 0x496caf
mov eax, dword [0x4d10cc]
mov ecx, dword [eax + 8]
cmp ecx, dword [ebp - 8]
jb 0x496caf
mov edx, dword [0x4d10cc]
mov eax, dword [edx + 8]
cmp eax, dword [ebp - 0xc]
ja 0x496caf
mov ecx, dword [0x4d10cc]
mov edx, dword [ecx + 8]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 8]
jb 0x496c7e
mov ecx, dword [ebp - 0x10]
cmp ecx, dword [ebp - 0xc]
jbe 0x496c85
xor eax, eax
jmp 0x496e92
mov edx, dword [0x4d10cc]
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x40]
mov dword [edx + 8], ecx
push 0x48
push 0xcc
mov edx, dword [ebp - 0x10]
push edx
call fcn.0047a8e0
add esp, 0xc
mov eax, dword [ebp - 0x10]
jmp 0x496e92
mov eax, dword [0x4d10c8]
mov dword [0x4d10cc], eax
jmp 0x496cca
mov ecx, dword [0x4d10cc]
mov edx, dword [ecx + 4]
mov dword [0x4d10cc], edx
cmp dword [0x4d10cc], 0
je 0x496d09
cmp dword [0x4d10cc], 0
je 0x496d07
mov eax, dword [0x4d10cc]
cmp dword [eax + 8], 0
je 0x496d07
mov ecx, dword [0x4d10cc]
mov edx, dword [ecx + 8]
cmp edx, dword [ebp - 8]
jb 0x496d07
mov eax, dword [0x4d10cc]
mov ecx, dword [eax + 8]
cmp ecx, dword [ebp - 0xc]
ja 0x496d07
jmp 0x496c62
jmp 0x496cbb
mov edx, dword [ebp + 8]
and edx, 0xffff
mov eax, dword [ebp + 8]
sub eax, edx
mov dword [ebp + 8], eax
mov dword [ebp - 4], 0
cmp dword [ebp - 4], 0
jne 0x496d49
cmp dword [ebp + 8], 0x40000000
jbe 0x496d49
mov ecx, dword [ebp + 8]
sub ecx, 0x40000000
push ecx
mov edx, dword [ebp - 8]
push edx
call fcn.00496fa0
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x496d71
cmp dword [ebp + 8], 0x40000000
jae 0x496d71
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp + 8]
add ecx, 0x40000000
push ecx
call fcn.00496ea0
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x496d98
cmp dword [ebp + 8], 0x40000000
jbe 0x496d98
mov edx, dword [ebp + 8]
push edx
mov eax, dword [ebp + 8]
sub eax, 0x40000000
push eax
call fcn.00496ea0
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x496dc0
cmp dword [ebp + 8], 0x40000000
jae 0x496dc0
mov ecx, dword [ebp + 8]
add ecx, 0x40000000
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00496fa0
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x496dd9
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 8]
push ecx
call fcn.00496fa0
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x496df2
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.00496ea0
add esp, 8
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x496e90
mov ecx, dword [ebp - 4]
mov dword [0x4d10cc], ecx
mov edx, dword [0x4d10cc]
mov dword [edx], 0x52727464
mov eax, dword [0x4d10cc]
mov dword [eax + 8], 0
mov ecx, dword [0x4d10cc]
mov edx, dword [0x4d10c8]
mov dword [ecx + 4], edx
mov eax, dword [0x4d10cc]
mov dword [0x4d10c8], eax
mov dword [ebp - 0x14], 0
mov ecx, dword [0x4d10cc]
add ecx, 0x48
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0x18], 0x38c
jmp 0x496e5b
mov edx, dword [ebp - 0x18]
sub edx, 1
mov dword [ebp - 0x18], edx
cmp dword [ebp - 0x18], 1
jle 0x496e7f
mov eax, dword [ebp - 0x18]
imul eax, eax, 0x48
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x14]
mov dword [ecx + eax + 0x40], edx
mov eax, dword [ebp - 0x18]
imul eax, eax, 0x48
add eax, dword [ebp - 0x10]
mov dword [ebp - 0x14], eax
jmp 0x496e52
mov ecx, dword [0x4d10cc]
mov edx, dword [ebp - 0x14]
mov dword [ecx + 8], edx
jmp 0x496c62
xor eax, eax
mov esp, ebp
pop ebp
ret