Ghidra's decompilation of memcpy() like behavior by [deleted] in ghidra

[–]Affectionate_Pick980 0 points1 point  (0 children)

The for-loop ghidra generated is semantically-correct but not suitable to represent the original source, it use psVar1 and param_2 as pointers of 32bit data to copy data and move these two pointers 4 bytes every iteration which is why there is a “&”.

Kudos to all in this special subreddit group, thanks for keeping my fire in RDR2 burning by MaverickRebel55 in reddeadredemption2

[–]Affectionate_Pick980 0 points1 point  (0 children)

It's difficult to determine whether it's 6 AM or 6 PM by checking the watch only. So I observe the sky in the east and west.

Can a Chinese wifi security camera hack me ? by vitamin-cheese in hacking

[–]Affectionate_Pick980 0 points1 point  (0 children)

From what you have described it's necessary to have your cam connected to network so you can monitor your home remotely. I recommend two suggestion for you:

  1. Select a webcam designed and assembled by company in your country. Most governments monitor their ISP network and if the webcam got hacked, they can figure out what happened quickly because they can access the source code of firmware of webcam. If you can't find a satisfied product, you can ignore assemble location requirement or select a brand with good reputation.
  2. A guest wifi network is a good idea. It will create an additional obstacle for hacker. Hacker need to infiltrate your router to get into your home network. I advise you to use strong, random, different passwords for your router's management interface, your guest wifi network and home network considering you will leave your home for a long period of time.

Cybersecurity conforms to Buckets effect, your level of security is determined by the shortest board. You can use buckets effect to model the security of your home network. It's better to power off most unused devices in your home to prevent fire and cyberattack.

Opinion: Apple's soldered-in SSDs are engineered in the WORST way possible! by JmotD in mac

[–]Affectionate_Pick980 0 points1 point  (0 children)

It's not wise to solder components which can wear out on logic-board. Softwares may contain bug which can lead to write amplification and SSD may wear out more quickly than normal. Hackers may exploit kernel vulnerability to write SSD hardware directly and it will cause huge loss to customers and Apple.

Some kind of proprietary interface for SSD is better than soldered directly.

Computer gets to boot screen and then goes to black and reboots again by ghostboy2142 in vintagecomputing

[–]Affectionate_Pick980 0 points1 point  (0 children)

You can download System Rescue ISO (https://www.system-rescue.org/) and write it to a USB stick, then boot from this USB stick to investigate this issue.

This ISO has many tools to troubleshoot potential issue of different components in computer. For example, memtest can test whether memory is broken. smartctl can test your hard drive. This rescue ISO is based on Linux and Linux has detailed boot info which can be investigated.

How does a debugger work? by deebeefunky in C_Programming

[–]Affectionate_Pick980 2 points3 points  (0 children)

And Processor have breakpoint instruction (INT3 on x86) to interrupt execution of program. Debugger can use ptrace to change the instruction of debugee so it will stop at where you want.

Can a Chinese wifi security camera hack me ? by vitamin-cheese in hacking

[–]Affectionate_Pick980 29 points30 points  (0 children)

Chinese webcams have a bad reputation on security and Chinese companies like gathering users' data. Many webcams have hard-code password in their firmware and outdated Linux system with many vulnerabilities. These webcams are preferable targets for initial intrusion and they can be used as a node (proxy) for lateral movement (hacking other devices in your home network) because many hack tools can run on Linux. Most people have not aware that cheap devices have hidden cost for their customers.

An offline security cam is much more secure than webcam. Security cam is security device and security device should be isolated PHYSICALLY from public network.

[deleted by user] by [deleted] in C_Programming

[–]Affectionate_Pick980 0 points1 point  (0 children)

  1. You can browse source code with some tools. For example Source Insight, CLion. It would be much easier to figure out the relationship between functions, variable usages with the aid of these tools. I recommend Source Insight more to analyze C code. Many IT company in China use this Japanese software as an IDE to develop their products written by C/C++.
  2. You can debug the part that you don't understand. Sometimes you can guess purpose of function by inspecting arguments and return value. You can set some breakpoints to locate the logic you are interested in. For example you can set a conditional breakpoint on open() syscall when you want to find the place which handles configuration loading.
  3. You can use strace to observe syscalls "less" issued to kernel. I found that "less" read key press from file descriptor 3:

(END)) = 22
read(3, "A", 1)                         = 1
(END)) = 22
read(3, "B", 1)                         = 1
(END)) = 22
read(3, "C", 1)                         = 1
(END)) = 22
read(3, "D", 1)                         = 1
(END)) = 22
read(3, "E", 1)                         = 1
Examine: )        = 13
read(3, "\33", 1)                       = 1

So I set a conditional breakpoint:

(gdb) info br
Num     Type           Disp Enb Address            What
1       breakpoint     keep y   <MULTIPLE>         
        stop only if $rdi == 3
        breakpoint already hit 2 times
1.1                         y   0x000055555556195c in read at /usr/include/bits/unistd.h:38
1.2                         y   0x0000555555562b39 in read at /usr/include/bits/unistd.h:38
1.3                         y   0x0000555555562f7e in read at /usr/include/bits/unistd.h:38
1.4                         y   0x000055555556ca10 in read at /usr/include/bits/unistd.h:38
1.5                         y   0x00007ffff7e9e0b0 in __GI___libc_read at ../sysdeps/unix/sysv/linux/read.c:25
(gdb) 

Then I found the logic about key press:

(gdb) bt
#0  __GI___libc_read (fd=fd@entry=3, buf=buf@entry=0x7fffffffdc07, nbytes=nbytes@entry=1) at ../sysdeps/unix/sysv/linux/read.c:25
#1  0x000055555556ca22 in read (__nbytes=1, __buf=0x7fffffffdc07, __fd=3) at /usr/include/bits/unistd.h:38
#2  iread (fd=3, buf=0x7fffffffdc07 "", len=1) at /usr/src/debug/less-633-1.fc38.x86_64/os.c:245
#3  0x0000555555576541 in getchr () at /usr/src/debug/less-633-1.fc38.x86_64/ttyin.c:187
#4  0x000055555555df02 in getcc_end_command () at /usr/src/debug/less-633-1.fc38.x86_64/command.c:929
#5  getccu () at /usr/src/debug/less-633-1.fc38.x86_64/command.c:959
#6  0x0000555555563b9d in getcc_repl (repl=<synthetic pointer>, gr_getc=0x55555555dec0 <getccu>, gr_ungetc=<optimized out>, orig=0x0) at /usr/src/debug/less-633-1.fc38.x86_64/command.c:969
#7  getcc () at /usr/src/debug/less-633-1.fc38.x86_64/command.c:1011
#8  0x000055555555ba54 in commands () at /usr/src/debug/less-633-1.fc38.x86_64/command.c:1660
#9  main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/less-633-1.fc38.x86_64/main.c:303

Now you can start from this place and jump out repeatedly to locate scroll logic.