Skip to content

Instantly share code, notes, and snippets.

@CodaFi
Created October 3, 2013 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodaFi/7c73abd9dfb602dcc26e to your computer and use it in GitHub Desktop.
Save CodaFi/7c73abd9dfb602dcc26e to your computer and use it in GitHub Desktop.
sub_79c1c:
push {r7, lr} ; push on the stack frame. save r7 (saved frame) and link register.
mov r7, sp ; Adjusts r7 to point to old frame
sub sp, #0x4 ; Allocate some local storage
; END STACK POINTER ADJUSTMENTS
mov r3, r1 ; Move something into r3.
movw r1, #0xc57e ;
movt r1, #0x0 ; Taken together, these are equivalent to an OR. r1 = (0x0 and 0xffff) | (0xc57e << 16)
str r2, [sp, #0x4 + var_0] ; Stores what was allocated into the local storage into r2
add r1, pc ; Add program counter and r1
movs r2, #0xf ; Move 0xf into r2, set some flags
blx imp___picsymbolstub4__guarded_open_np ; Call function pointer, presumably with r1, r2, and r3 +
add sp, #0x4 ; Fix up the stack pointer again and deallocate local storage
pop {r7, pc} ; Pop off the stack frame.
// +Possibly
int guarded_open_np(const char *p, int flags, int mode);?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment