How to study cracking the coding interview

 

Low level

16.4 Write a step-by-step run of things that happen after the user presses a key

keyboard. Use as much data as possible.

INTRODUCTION


1. The keyboard sends a key scan code to the keyboard controller (scan code for

key pressed and key released are different).

 

2. The keyboard controller interprets How to study cracking the coding interview  and stores the scan code in a buffer.

 

3. The keyboard controller sends a hardware input to the processor. This is done with

“Broken application line” signpost: IRQ 1.

 

4. The controller breaks the assignment of IRQ 1 to INT 9.

 

5. An interrupt is a signal that tells the processor to stop what it was currently doing.

and perform a special task.

 

6. The processor invokes the "interrupt handler". The CPU gets the address "Interrupt

 

7. The ISR reads the scan code for port 60h and decides if it should be processed or passed.

control to program to operate.

As with any interview question that is ambiguously worded, it can be helpful to explore the interviewer.

Understand what you are specifically trying to solve. Are you trying to block that code?

Execution execution buffer exceeded when overwriting stacked values? Is

Want to maintain some kind of specific thread isolation between threads? Is the code

Interesting native code like C ++ or running in a virtual machine like Java?

 

Remember, in a multi-threaded environment, there can be multiple stacks in progress.

 

NATIVE CODE

 

A threat to steel is the entry of malicious programs, which can override and override a buffer ¬

write stacking tips, circling the planned execution of the program.

 

If the interviewer is looking for a simple method to reduce the risk of a buffer overflow

native code, modern compilers provide this kind of command stacking protection

line option. With Microsoft CL, it just brings a pass / GS to the compiler. With EPA, you can use it

-fsta c k- p rotecto r-a 11.

 

For more complex schemas, you can set individual permissions on the memory range

pages showing the stacked part in your care. In the Win32 API, you would use Virtu-

alProtect API to mark PAGE_READONLY or PAGE_NOACCESS. This will cause

code that has access to the region to go through an exception to access the specific part of it

the battery.

 

Alternatively, you can use HW (DR) debugging programs to read or write a breakpoint

at the specific memory addresses of interest. A separate process can be used to debug

the welfare process, find the HW exception that would be generated if this part of the

access to batteries.

 

However, it is very important to consider normal circumstances, threads and processes.

they are not access control methods. Nothing can stop writing native code anywhere

within the address space of your process, including steel. Specifically, there is nothing

to prevent malicious code in the process call VirtualProtect and check the stack

stakeholders PAGE_EXECUTE_READWRITE. Similarly, nothing prevents the code

remove HW debugging programs, remove their minutiae. In short, nothing can

completely prevent native code from accessing memory addresses, including the stack, within your

own process space.

A last resort is to consider linking this code, which should be a "sandbox" run on men.

old language like Java or C # /. NET. By default, virtual machines run managed code

In these languages ​​it is impossible to get full access to steel from the

process.

 

Additional runtime security features can be used to prevent code from leaking

pass dental processes or "unsafe" code to inspect   steel. With .NET, for example,

capable of using Access Code Security (CAS) or application domain permissions to control such execution.

Comments

Popular posts from this blog

Cracking the coding interview pdf 8th edition

Cracking the coding interview 6th edition pdf

Cracking the Coding Interview