Reverse Engineering for Beginners

(avery) #1

CHAPTER 81. ORACLE RDBMS CHAPTER 81. ORACLE RDBMS


mov dword ptr [ebx], 5
test edx, edx ; EDX=0x50
jnz loc_2CE1192
mov edx, [ebp+var_14]
mov esi, [ebp+var_C]
mov eax, ebx
mov ebx, [ebp+var_8]
mov ecx, 5
jmp loc_2CE10F6

loc_2CE127A: ; DATA XREF: .rdata:0628B0B0
mov edx, [ebp+var_14] ; [EBP-14h]=0xc98c938
mov esi, [ebp+var_C] ; [EBP-0Ch]=0xcdfe248
mov edi, [ebp+var_4] ; [EBP-4]=0xc98c938
mov eax, ebx ; EBX=0xcdfe554
mov ebx, [ebp+var_8] ; [EBP-8]=0


loc_2CE1288: ; CODE XREF: kqvrow+1F
mov eax, [eax+8] ; [EAX+8]=0xce2ffb0, "NLSRTL Version 11.2.0.1.0 - Production"
test eax, eax ; EAX=0xce2ffb0, "NLSRTL Version 11.2.0.1.0 - Production"
jz short loc_2CE12A7
push offset aXKqvvsnBuffer ; "x$kqvvsn buffer"
push eax ; EAX=0xce2ffb0, "NLSRTL Version 11.2.0.1.0 - Production"
mov eax, [ebp+arg_C] ; [EBP+14h]=0x8a172b4
push eax ; EAX=0x8a172b4
push dword ptr [edx+10494h] ; [EDX+10494h]=0xc98cd58
call _kghfrf ; tracing nested maximum level (1) reached, skipping this⤦
ÇCALL
add esp, 10h


loc_2CE12A7: ; CODE XREF: kqvrow+1C1
xor eax, eax
mov esp, ebp
pop ebp
retn ; EAX=0
kqvrow endp


Now it is easy to see that the row number is passed from outside. The function returns the string, constructing it as follows:


String 1 Usingvsnstr,vsnnum,vsnbanglobal variables. Callingsprintf().
String 2 Callingkkxvsn().
String 3 Callinglmxver().
String 4 Callingnpinli(),nrtnsvrs().
String 5 Callinglxvers().

That’s how the corresponding functions are called for determining each module’s version.


81.2X$KSMLRUtable in Oracle RDBMS


There is a mention of a special table in theDiagnosing and Resolving Error ORA-04031 on the Shared Pool or Other Memory
Pools [Video] [ID 146599.1]note:


There is a fixed table called X$KSMLRU that tracks allocations in the shared pool that cause other objects
in the shared pool to be aged out. This fixed table can be used to identify what is causing the large allocation.
If many objects are being periodically flushed from the shared pool then this will cause response time
problems and will likely cause library cache latch contention problems when the objects are reloaded into
the shared pool.
One unusual thing about the X$KSMLRU fixed table is that the contents of the fixed table are erased
whenever someone selects from the fixed table. This is done since the fixed table stores only the largest
allocations that have occurred. The values are reset after being selected so that subsequent large allocations
can be noted even if they were not quite as large as others that occurred previously. Because of this resetting,
the output of selecting from this table should be carefully kept since it cannot be retrieved back after the
query is issued.

However, as it can be easily checked, the contents of this table are cleared each time it’s queried. Are we able to find why?

Free download pdf