low-level

How to find text segment range in iOS

拥有回忆 提交于 2019-12-30 16:19:40
问题 How can I find the text segment (AKA code segment) range in iOS? Meaning, what is the start address and the end address of the text segment? I found this interesting post but it works for me on Android but not on iOS. 回答1: After some digging and expert help (thanks Moshe Kravchik) I got to the desired solution - getting the text segment range by parsing the mach header and retrieving the load commands, segments and sections. #include <mach-o/dyld.h> #include <stdio.h> #include <stdlib.h>

How to find text segment range in iOS

青春壹個敷衍的年華 提交于 2019-12-30 16:19:13
问题 How can I find the text segment (AKA code segment) range in iOS? Meaning, what is the start address and the end address of the text segment? I found this interesting post but it works for me on Android but not on iOS. 回答1: After some digging and expert help (thanks Moshe Kravchik) I got to the desired solution - getting the text segment range by parsing the mach header and retrieving the load commands, segments and sections. #include <mach-o/dyld.h> #include <stdio.h> #include <stdlib.h>

Low level keyboard input from Windows

不羁的心 提交于 2019-12-30 06:43:18
问题 What win32 calls can be used to detect key press events globally (not just for 1 window, I'd like to get a message EVERY time a key is pressed), from a windows service? 回答1: You want to use Win32 Hooks. In particular a keyboard hook. You can read more about it here The type of hook you want is WH_KEYBOARD and you can set it via the Win32 API SetWindowsHookEx. Basically windows will call a function in a dll that you create everytime a key is pressed in any application system wide. The hook

How to run a C program with no OS on the Raspberry Pi?

大憨熊 提交于 2019-12-29 02:24:04
问题 I'd like to experiment using the Raspberry Pi for some different low level embedded applications. The only problem is that, unlike the AVR and PIC microcontroller boards available, Raspberry Pi typically runs an OS (like Raspbian) that distributes CPU time across all running programs and makes it impractical for certain real time applications. I've recently learned that, assuming you have a bootloader like GRUB installed, running a C program on x86 (in the form of a kernel) takes very little

Service Calls Executing Based on User Input

折月煮酒 提交于 2019-12-25 04:26:32
问题 I've just written my first MIPS addition program. My output is expected ($t0 + $t1 = $t2), but I have a question regarding some strange behavior that I believe should be avoidable. On the lines where I gather the user input ( li $v0, 5 ), the value of the $v0 service call gets set to the value of my user input. So for example, if I enter "10" as user input, $v0 is assigned the value 10, which is the service code to terminate the program. Is there something I can do to ensure that my user

Very Simple Crypt Program Error

雨燕双飞 提交于 2019-12-25 03:13:04
问题 I'm creating a program that takes a file as input & outputs the decrypted password of each line. The file contains three lines of encrypted passwords. I am guaranteed that the passwords decrypt to 4 letter words. Given that i have created an char[] of the letters. I'm having a problem reading the file line by line using LOW LEVEL IO and putting the resulting password in a new file. Any & all advice is appreciated! Here is my code so far: #include <sys/types.h> #include <sys/stat.h> #include

The lowest level function to handle a user input

冷暖自知 提交于 2019-12-24 21:40:19
问题 The following code I have reads the input from user similar to gets function in C language. section .text global _start _start: mov eax, 3 ; Read user input into str mov ebx, 0 ; | mov ecx, str ; | <- destination mov edx, 100 ; | <- length int 80h ; \ mov eax, 1 ; Return mov ebx, 0 ; | <- return code int 80h ; \ section .data str: times 100 db 0 ; Allocate buffer of 100 bytes I am not sure how Linux is handling my code, but I am curious how this code is handled on an Intel machine natively

Can I put LowLevelMouseProc and LowLevelKeyboardProc in the main EXE?

北城余情 提交于 2019-12-23 18:34:05
问题 Global Windows hooks must be in a DLL because the hook is going to be called in the context of a different process, so the hook procedure's code must be injected into that process. However, there are limitations: SetWindowsHookEx can be used to inject a DLL into another process. A 32-bit DLL cannot be injected into a 64-bit process, and a 64-bit DLL cannot be injected into a 32-bit process. If an application requires the use of hooks in other processes, it is required that a 32-bit

How and when are stack frames built?

♀尐吖头ヾ 提交于 2019-12-23 13:00:50
问题 I am currently reading about exploiting memory vulnerabilities under Linux and I found it hard to find any information on when the layout of stack frames is decided. In other words, is it something determined at the compile time, before the program's execution or are those built when a function is being called? Does the layout differ between operating systems? 回答1: There are several factors. On x86, there's a calling convention that defines how to call a function. I assume other architectures

Where in memory are return values stored in memory?

我只是一个虾纸丫 提交于 2019-12-23 12:29:21
问题 Where in memory are return values stored in memory? Consider the follwing code: int add(int a, int b) { int result = a+b; return result; } void main() { int sum = add(2, 3); } When add(2, 3) is called, the 2 function parameters are pushed on the stack, the stack frame pointer is pushed on the stack, and a return address is pushed on the stack. The flow of execution then jumps to add(...) , and local variables within that function are also stored on the stack. When add(...) is complete, and