IP Library Granted Patent US 10,997,055
Granted Patent B2
US 10,997,055 · App. 16/739,208 · Granted May 4, 2021

Methods, circuits, apparatus, systems and associated software modules for evaluating code behavior

Inventors: Eli Lopian (Tel Aviv, IL); Doron Peretz (Pardesia, IL)
Assignee: Eli Lopian
G06F11/3612G06F11/3624G06F11/3636G06F11/3664G06F11/3684G06F11/3688G06F9/455
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,997,055
App. No.
16/739,208
Granted
May 4, 2021
Kind
B2
Abstract

Disclosed are methods, circuits, apparatus, systems and associated software modules for dynamically evaluating code behavior in runtime. There is provided a code testing platform and/or framework which may include: (1) a code execution environment instancing module (CEEIM), (2) code execution resources, (3) executed code isolation logic, and (4) code call response logic. The CEEIM may instance, on a computing platform, a code execution environment (CEE) which is at least partially isolated from external resources functionally associated with the computing platform. The CEE may include code execution resources adapted to execute code whose behavior is to be evaluated, wherein a resource call generated from code execution may be analyzed by the code isolation logic and may under certain conditions be routed to the code call response logic.

Claims (34)

1. A system for evaluating code behavior, said system comprising:

a non-transitory tangible medium containing processor executable software testing code adapted to cause a processor to:

i. instance a code execution environment (CEE);

ii. execute one or more code segments of a given code being evaluated, within said code execution environment;

iii. identify a non-public field called during code execution of the given code;

iv. identify a location in a memory associated with the non-public field, within a digital memory functionally associated with the processor, by finding an offset associated with the field in a Debug, Import Address Table (TAT), Run-Time Type Identification (RTTI) or metadata method relating to the field;

v. set or copy a value of the non-public field, to test the given code, by directly setting or copying the value in the identified memory location;

vi. forward a selected call of a first resource, resulting from the execution of the one or more code segments, to a code call response logic;

vii. determine, by the code call response logic, a call response format corresponding to the selected call; and

viii. dynamically generate, based on the code call response logic, testing code to replace the first resource and generate a fake response to the selected call according to the determined format, which fake response implements a defined testing parameter.

2. The system according to claim 1 , wherein setting or copying a value of the non-public field includes setting the value to a test value.

3. The system according to claim 1 , wherein said processor executable software testing code is further adapted to cause the processor to deep copy arguments for the generated testing code and later use the copied arguments for verification.

4. The system according to claim 1 , wherein said software testing code is further adapted to cause the processor to:

i. identify debugger event code within one or more code segments of a second code being evaluated;

ii. retrieve an original code of the second code being evaluated, which original code represents the second code prior to a debugging operation;

iii. execute code segments of the original code, within said code execution environment;

iv. analyze resource calls from code execution of the original code; and

v. forward a second selected call of a second resource, resulting from the execution of the code segments of the original code, to a code call response logic configured to dynamically generate testing code to replace the second resource and generate a fake response to the second selected call, which fake response implements a second defined testing parameter.

5. The system according to claim 4 , wherein the original code is retrieved by querying a debugger.

6. The system according to claim 4 , wherein the original code is retrieved from an external source.

7. The system according to claim 1 , wherein said processor executable software testing code is further adapted to cause the processor to identify arguments associated by reference, or by pointer, with a segment of the given code under evaluation and set the identified arguments to a desired testing value.

8. The system according to claim 4 , wherein the fake response to the selected call comprises code designed to generate a fake response to a subsequent resource call.

9. The system according to claim 1 , wherein said processor executable code further comprises an EAT/IAT manager configured to read object definitions from an export address table (EAT) or an import address table (TAT), and wherein said processor executable software testing code is further adapted to cause the processor to use said object definitions to generate testing code for replacing a called resource.

10. The system according to claim 1 , wherein said processor executable code further comprises a program debug information manager configured to dynamically detect object definitions and addresses associated with the given code under evaluation in a debug information repository, and wherein said processor executable software testing code is further adapted to cause the processor to use said object definitions and addresses to generate the testing code for replacing a first resource.

11. The system according to claim 1 , wherein said processor executable code further comprises a program debug information manager configured to dynamically detect object definitions and addresses associated with the given code under evaluation in a debug information repository, and wherein said processor executable software testing code is further adapted to cause the processor to use said object definitions and addresses to detour the first resource.

12. The system according to claim 1 , wherein said processor executable software testing code is further adapted to cause the processor to analyze a stack and calling convention associated with the one or more code segments and then clean up the stack and associated registers.

13. The system according to claim 1 , wherein said processor executable code further comprises a program debug information manager configured to dynamically detect object definitions associated with the given code under evaluation in a debug information repository, and wherein said processor executable software testing code is further adapted to cause the processor to use said object definitions and addresses to set and read data members and fields associated with the given code being evaluated.

14. The system according to claim 1 , wherein said software testing code is further adapted to cause the processor to:

i. analyze resource calls from code execution of the given code;

ii. fill a virtual table suitable to a virtual method of the given code being evaluated; and

iii. forward a selected call of a first resource, resulting from the execution of the one or more code segments, to a code call response logic configured to dynamically generate testing code to replace the first resource and generate a fake response to the selected call, which fake response implements a defined testing parameter;

wherein forwarding a selected call includes inserting an address in the virtual table pointing to the generated testing code.

15. The system according to claim 14 , wherein said processor executable software testing code is further adapted to cause the processor to identify arguments associated by reference, or by pointer, with a segment of the given code under evaluation and set the identified arguments to a desired testing value.

16. The system according to claim 14 , wherein the fake response to the selected call comprises code designed to generate a fake response to a subsequent resource call.

Continuity (5)
Continuation 15844669 · Dec 18, 2017
Continuation In Part 14944253 · Nov 18, 2015
Continuation 13366333 · Feb 5, 2012
Provisional Application 61447411 · Feb 28, 2011
Related Publication 20200401498A1 · Dec 24, 2020