Skip to content

Instantly share code, notes, and snippets.

Oren Goldberg 0rka

Block or report user

Report or block 0rka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View .py
re.compile(ur'^\.class.*\ (.+(?=\;))', re.MULTILINE)
View .py
re.compile(ur'^\.class.*\ (.+(?=\;))', re.MULTILINE)
re.compile(ur'^\.method.+?\ (.+?(?=\())\((.*?)\)(.*?$)(.*?(?=\.end\ method))', re.MULTILINE | re.DOTALL)
re.compile(ur'invoke-.*?\ {(.*?)}, (.+?(?=;))\;\-\>(.+?(?=\())\((.*?)\)(.*?)(?=$|;)', re.MULTILINE | re.DOTALL)
re.compile(ur'move-result.+?(.*?)$', re.MULTILINE | re.DOTALL)
View .py
self.cursor.execute('''SELECT id FROM methods where calling_to LIKE "%" || ? || "%"''', (method,))
@0rka
0rka / .smali
Created Jan 28, 2018
smali example
View .smali
.class public Lcom/test/helloworld/HelloWorldActivity;
.super Landroid/app/Activity;
.source "HelloWorldActivity.java"
# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
.locals 2
.parameter "savedInstanceState"
.prologue
@0rka
0rka / .sql
Created Jan 28, 2018
scheme layout
View .sql
CREATE TABLE methods (id, class_name, method_name, parameters, return_value, calling_to, called_from, data)
@0rka
0rka / .go
Created Jan 28, 2018
usage example
View .go
func main() {
myjson := []byte(`{"company":"0rkaTV","notices":"NO RUNNING WITH SCISSORS","id":"0x1337H4X0R","library":{"movies":[{"title":"Titanic","length":194},{"title":"Matrix","length":150}]}}`)
var OrkaTVGuide TVGuide
if err := json.Unmarshal(myjson, &OrkaTVGuide); err != nil {
fmt.Println(err)
}
fmt.Println(OrkaTVGuide)
fmt.Println("Hello, playground")
}
@0rka
0rka / .json
Created Jan 28, 2018
json example
View .json
{
"company": "0rkaTV",
"notices": "NO RUNNING WITH SCISSORS",
"id": "0x1337H4X0R",
"library": {
"movies": [
{
"title": "Titanic",
"length": 194
},
@0rka
0rka / .go
Created Jan 28, 2018
UnmarshalJSON
View .go
func (p *Playables) UnmarshalJSON(b []byte) error {
var LibraryFields map[string]*json.RawMessage
if err := json.Unmarshal(b, &LibraryFields); err != nil {
return err
}
for LFKey, LFValue := range LibraryFields {
if LFKey == "movies" {
var LibraryMovies []*json.RawMessage
if err := json.Unmarshal(*LFValue, &LibraryMovies); err != nil {
return err
View .go
type Movie struct {
Title string `json:"title"`
Length int `json:"length"`
}
func (m *Movie) Play() error {
time.Sleep(time.Duration(m.Length) * time.Minute)
return nil
}
@0rka
0rka / .go
Last active Jan 28, 2018
TVGuide
View .go
type Playables []Playable
type TVGuide struct {
Company string `json:"company"`
Notices string `json:"notices"`
ID string `json:"id"`
Library Playables `json:"library"`
}
You can’t perform that action at this time.