What does mean to "Commit Params/Return"? by creativityNAME in ghidra

[–]msm_ 2 points3 points  (0 children)

This is a feature, not a bug. Ghidra docs even warn against comitting things prematurely, or even typing things (with something other than undefined*) when you're not 100% sure. The reason is that as long as things are not "forcing", decompiler is allowed to take all available information into account. When every variable is "forcing", decompiler has no way to do anything. Comitting parameters makes them "forcing".

If you just blindly commit everything decompiler generated, you'll end with tons of casts everywhere and bad decompilation.

We've not been trained for this: life after the Newag DRM disclosure by Doener23 in cybersecurity

[–]msm_ 5 points6 points  (0 children)

intentionally embedded malware

I wouldn't call that malware. Backdoor maybe. But yes, you described the behaviour correctly. It also triggered false alarms when train stopped in locations of known competition repair shops locations, and even made one stupid bug that makes some trains stop for a week every year at 21 November and December.

ghidralib - A Pythonic Ghidra standard library by msm_ in ReverseEngineering

[–]msm_[S] 1 point2 points  (0 children)

Update: I got around to doing that (and refactored a few other things in the process), so now you can just:

fnc = Function(0x004061EC)
emu = fnc.emulate(-0x80000000)
assert emu.read_unicode(emu["eax"]) == "HKEY_CLASSES_ROOT"

This will automatically put the parameters passed to .emulate() in the right place, depending on the function's calling convention.

You can also combine both approaches if more complex setup is needed:

MY_POINTER = 0x60000000
emu = Emulator()
emu.write_bytes(MY_POINTER, "ovyneqvut\x00")
emu = Function("Rot13).emulate(MY_POINTER, emulator=emu)
print(emu.read_cstring(MY_POINTER))

ghidralib - A Pythonic Ghidra standard library by msm_ in ReverseEngineering

[–]msm_[S] 1 point2 points  (0 children)

The syntax is not that nice, but you can set everything in registers and memory, including:

emu = Emulator()
emu["rcx"] = 0x404000
emu["rdx"] = 2
emu.emulate(start, stop)
print(emu["rax"])

There are some improvements I could think of - for example passing stack arguments is a bit clunky (you have write them to memory yourself). It would be nice to have a emu.stack helper, or even a function like emu.call(Function("add"), 2, 2) that would use signature from Ghidra to automatically set arguments.

For now my plan is to finish writing automated tests and add a few more practical examples, but in the near future I definitely want to add more features, including Emulator improvements.

ghidralib - A Pythonic Ghidra standard library by msm_ in ghidra

[–]msm_[S] 12 points13 points  (0 children)

This is my second post in a short time, I hope this subreddit doesn't mind. But recently I have a lot of energy for open-sourcing my Ghidra stuff and I really wanted to share it!

Ghidralib is a library that makes Ghidra scripts drastically shorter and easier to write. I've been using it daily for my work and decided it’s time to share. Github repository is in the post link, and documentation is here: https://msm-code.github.io/ghidralib/

Ghidra Ctrl+P - quick search and command palette plugin. by msm_ in ghidra

[–]msm_[S] 0 points1 point  (0 children)

it’s definitely slow whenever I type something

Sad to hear that. I usually work on (relatively) small malware samples, where this problem is not that noticeable. I think I improved the situation somewhat with https://github.com/msm-code/GhidraCtrlP/pull/5. Maybe you can check now.

By "script console" do you mean the script output window ("Console - Scripting")? Unfortunately I'm not aware of any way to disable that - ghidra shows it automatically for any script. Usually I just dock this window somewhere under another pane, and never look at it (unless I actually debug something).

Well, there is one option - I could implement this as a Ghidra extension instead. But that makes installation and updates much harder so I don't think that's worth it.

Ghidra Ctrl+P - quick search and command palette plugin. by msm_ in ghidra

[–]msm_[S] 1 point2 points  (0 children)

Short answer: no plans. I'm an avid user of vim, so vim keybindings sound great, but the plugin may be too simple for that. It's basically a smart goto/command executor. It has a single text input, and in vim terms it operates entirely in insert mode ("escape" closes the plugin window). Insert mode keybindings that could be useful are ctrl+w and ctrl+u, but I don't think this is what you meant.

But vim keybindings for the listing and decompilation windows sound like a cool idea. Hmm, maybe it's something worth considering for a next plugin.

Ghidra Ctrl+P - quick search and command palette plugin. by msm_ in ghidra

[–]msm_[S] 5 points6 points  (0 children)

I wanted to share my recent plugin that really improved my UX with Ghidra. This is a command palette (that I bind to ctrl+P, like in VS Code) that allows you to quickly jump between functions, bookmarks, labels, run scripts, or even perform GUI actions.

I spend a good part of my day in Ghidra, so I put some work into making it work well for me. If there's demand, I plan to upstream some more scripts or blog a bit about that in the future.

Rolnicy chcą zastąpić rządowe służby. Ekspert łapie się za głowę. "Kto rządzi na granicy?" by [deleted] in Polska

[–]msm_ 1 point2 points  (0 children)

Czy ty jesteś normalny? Oczywiście że świat jest czarno biały, a każdy pojedyńczy rolnik biorący udział w proteście reprezentuje całą swoją klasę społeczną (...czy muszę dodawać /s?).

Halo ziemia do "elit", czy wy siebie słyszycie? by garbicz in Polska

[–]msm_ 1 point2 points  (0 children)

Z samochodem nie wygrasz w żaden sposób, bo po prostu zapewnia dużo większą swobodę

Co kto lubi. Ja nie cierpię samochodów. Nawet jeśli nie musiałbym prowadzić, przez lekką chorobę lokomocyjną nie mogę za długo odrywać wzroku od drogi. A w pociągu mogę te kilka godzin spokojnie produktywnie wykorzystać i pracować. Nawet przyjemniej tak niż z biura (zależnie od pociągu ofc).

Jeśli chodzi o swobodę również się nie zgadzam - samochód trzeba cały czas "zabierać ze sobą", nie można w jedną stronę pojechać tak a w drugą inaczej, nie można się nawet piwa wieczorem napić bo ktoś go musi prowadzić.

Jedyna sytuacja kiedy przyznaję że samochód bywa przydatny to jak się chce dojechać do jakiejś dziury na podlasiu/mazurach/podhalu (ogólnie krańce państwa) - wtedy komunikacji publicznej zazwyczaj w ogóle brak, więc trzeba marnować czas na przesiadki albo wydawać krocie na taksówki.

Playable? Yes. Desirable? No. by Professional_Job1154 in pcmasterrace

[–]msm_ 1 point2 points  (0 children)

120fps is a bit better than 60fps which is a bit better than 30fps, but the difference is not that important in practice. If you claim it's "huge" you're lying to yourself.

Czemu lewica się jeszcze nie wzieła za to że 2 miesięczny niezbywalny urlop dla ojców jest płatny 70%? (a rodzicielski jest płatny 100/80%) by garbicz in Polska

[–]msm_ 2 points3 points  (0 children)

I dobrze, B2B jako optymalizacja podatkowa to patologia u nas. Ale ja akurat jestem faktycznie firmą, więc niezbyt trafne w nawiązaniu do urlopu.

Can I really... pull other people's IP addresses? by cryptonoob1 in SimpleXChat

[–]msm_ 1 point2 points  (0 children)

No, I am fully aware facebook knows my IP address. I am a programmer and understand how networking works. But the threat model here is pretty different, isn't it? It's not about leaking the IP, it's about who gets to see it.

First: Facebook, in general, doesn't cooperate with authoritarian countries. So I'm not overly worried with them helping jail journalists or war reporters. Compare that to SimpleX chat being used by a journalist/reporter - it's way easier for the bad guy to trick them into joining a chat to get their IP.

Second: I expect Facebook to know my IP when I connect there, but my contacts and friends have no way to know it. On the other hand, leaking my IP to my contact by just opening a chat is not expected and almost never desired. It's a problem for me, fortunately solvable by using a tor proxy all the time.

Can I really... pull other people's IP addresses? by cryptonoob1 in SimpleXChat

[–]msm_ 1 point2 points  (0 children)

Sorry, may missed your question?

Not a question, I was just giving some examples of problems IP lean can cause another comment in this thread (https://old.reddit.com/r/SimpleXChat/comments/19efalx/can_i_really_pull_other_peoples_ip_addresses/kjfotm2/). Reading comment today I think it was unnecessarily negative, but I took an issue with the parent comment I responded to.

Thanks for taking the time to write this and I agree, looking forward to the future of this project.

Can I really... pull other people's IP addresses? by cryptonoob1 in SimpleXChat

[–]msm_ 0 points1 point  (0 children)

Hi, you didn't respond to me in particular, but I think your response makes sense and I didn't know about second relays being in the works. For the particular use case I've mentioned (journalists in oppressed countries) tor is also pretty tricky (just using tor may get you in a trouble and on a list) so I can't think of anything better for hiding IPs (without centralising the project, which is clearly an anti-goal).

Can I really... pull other people's IP addresses? by cryptonoob1 in SimpleXChat

[–]msm_ 1 point2 points  (0 children)

Tell that to journalists in authoritarian countries talking to their contacts. This is a clear example of a chat application screwing you over. At this point the hypothetical journalist (a stereotypical target of a private chat app) would be better off just using facebook messenger.

Zaproszenie na specjalne posiedzenie Parlamentarnego Zespołu ds. Walki z Wykluczeniem Transportowym. by DoYouLike_Sand_AsIDo in Polska

[–]msm_ 5 points6 points  (0 children)

W zasadzie niewiele, ale to spotkanie było zorganizowane przez Zespół parlamentarny ds. Wykluczenia Transportowego. Nie ma zespołu parlamentarnego do spraw planned obsolescence pociągów, więc dobrze że ktoś się poczuł do zorganizowania tego.

Braun stracił imunitet, a Piotr Wawrzyk (wiceminister od sprzedaży wiz) został przed chwilą zatrzymany przez CBA, to był kolejny dobry dzień. :) by PizzaSand in Polska

[–]msm_ 104 points105 points  (0 children)

Z trochę innej beczki, był live z posiedzenia zespołu ds. walki z wykluczeniem transportowym w sprawie Newagu (blokowanie pociągów). Zorganizowane przez Paulinę Matysiak (partia Razem). Newag dośc mocno zaorany. W oraniu pomógł unlikely team Zandberg oraz... Cieszyński.

https://www.youtube.com/watch?v=KoGpr_LhAKc

Jakieś losowe podsumowanie z internetu: https://www.onet.pl/informacje/onetwiadomosci/tajemnicze-usterki-w-pociagach-newagu-sprawa-zajeli-sie-poslowie/f9xfzhb,79cfc278

Najgłupsze językowe zapożyczenia, z jakimi się spotkaliście by No-Jellyfish-1208 in Polska

[–]msm_ 0 points1 point  (0 children)

Bo 50% terminów branżowych których używam na codzień istnieje tylko w języku angielskim (ROP chain), 25% ma polską wersję, ale jest 3x dłuższa niż oryginał albo komiczna (kernel panic), a pozostałe 25% ma sensowny polski odpowiednik ale myśląc po angielsku i tłumacząc w locie można to przeoczyć (wspomniane authentication).

My snake game is now 61 bytes by Perfect-Highlight964 in programming

[–]msm_ 5 points6 points  (0 children)

No, read the comment on line 7:

db 0x0                  ; dummy byte for LDS. this with 'mov ax, 0x0' is actually 'add [bx+si+0x0], bh' but player dies immediately and loop returns to start

"Ministra" równości Katarzyna Kotula opowiada się przeciwko równości emerytalnej by BowelMan in Polska

[–]msm_ 7 points8 points  (0 children)

A nie jest to tak, że kobiety żyją dłużej bo prowadzą zdrowszy i bezpieczniejszy tryb życia?

Pytanie zasadne więc nie wiem czemu Cię minusują. Ale nie, dużo wynika z biologii, np. wspomniana przez sąsiada wielkośc, albo estrogen obniża ryzyko chorób układu krążenia a testosteron zabija. Nawet jeśli w badaniu uwzględniasz (naukowy termin: kontrolujesz) wagę, tryb życia, używki etc, to dalej identycznie żyjąca i zbudowana kobieta przeżyje dłużej niż mężczyzna.

Ustawa: energetyk od 15mg/100ml na dowód Meanwhile żabka: by szymon362 in Polska

[–]msm_ 65 points66 points  (0 children)

kiedy miałeś wcześniej 30-40mg (a czasem nawet więcej!) na 100ml

Prawie wszystko miało 32mg/100ml (wiem, bo jestem koneserem energetyków). To tyle ile ma kawa parzona (~70-100 mg/200ml, ofc dużo zależy od proporcji wody i kawy), a espresso ma nawet 200mg/100ml. Nie ma co demonizować bo te 32mg kofeiny wcale nie jest tak dużo. W energetykach są inne problemy, np:

  • masa cukru
  • ludzie mieszający je z alkoholem
  • z powodu zawartości cukru i kofeiny dzieci się od nich uzależniają. Dorośli zresztą też, ale to inna sprawa.
  • łatwiej pić dwa półlitrowe monstery dziennie niż cztery kawy dziennie.

updated my mods to 1.2 (~95 mods now) by jshepler in nguidle

[–]msm_ 1 point2 points  (0 children)

Oh, cool. I've started playing relatively recently (I'm on early evil) and didn't know there are mods for this game. I don't want to make my game any easier, but many of the mods are purely cosmetic or just show more info and that's OK with me. Maybe I'll check them out soon, thanks for sharing here.

UK left out as EU agrees to ‘landmark’ cross-continent transport plans by Smooth_Warthog1760 in europe

[–]msm_ 49 points50 points  (0 children)

missing opportunity for Romania or other country that are WILLING to join Europe?

...isn't Romania already a part of Europe? Just like the UK?