joyce8/EMBER2024-capa huggingface dataset:
Function at 0x4bb2c0
Capabilities:
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, ecx
push esi
mov esi, edx
push ebx
sub esp, 0x3c
test ecx, ecx
mov dword [ebp - 0x1c], eax
jne 0x4bb2e3
jmp 0x4bb350
shr eax, 0x1f
test al, al
jne 0x4bb308
add esi, ebx
sub edi, ebx
je 0x4bb350
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_send]
sub esp, 0x10
cmp eax, edi
mov ebx, eax
jbe 0x4bb2d6
xor eax, eax
test ebx, ebx
mov esi, 0x5927b4
js 0x4bb35a
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x18], esi
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], str.dnssd_clientstub_write_all__d__failed__ld__ld__d__s
mov dword [esp], 0x1388
call dbg.syslog
lea esp, [ebp - 0xc]
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp - 0x20], edx
call edx
mov dword [esp], eax
call dbg.win32_strerror
mov edx, dword [ebp - 0x20]
mov esi, eax
call edx
jmp 0x4bb313
Function at 0x4bc040
Capabilities:
Get socket status

Disassembly:
mov edx, dword [0x5bcda8]
test edx, edx
je 0x4bc050
mov eax, edx
ret
push ebp
mov ebp, esp
sub esp, 0x138
lea edx, [ebp - 0x114]
mov dword [ebp - 0x108], eax
add eax, 1
mov dword [esp + 0x10], edx
lea edx, [ebp - 0x10c]
mov dword [ebp - 0x10c], 1
mov dword [ebp - 0x114], 0xa
mov dword [ebp - 0x110], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_select]
sub esp, 0x14
test eax, eax
je 0x4bc0c0
mov eax, dword [0x5bcda8]
leave
ret
mov dword [esp + 4], str.dnssd_clientstub_wait_for_daemon_timed_out
mov dword [esp], 0x1388
call dbg.syslog
mov eax, 0xfffeffe0
mov dword [0x5bcda8], 0xfffeffe0
leave
ret
Function at 0x4be5b0
Capabilities:
Enumerate services

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
mov dword [esp + 8], 4
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x1c], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
sub esp, 0xc
test eax, eax
mov dword [ebp - 0x2c], eax
je 0x4be6d0
xor esi, esi
xor ebx, ebx
lea edi, [ebp - 0x20]
jmp 0x4be632
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x4be705
test ebx, ebx
je 0x4be61d
mov dword [esp], ebx
call sym._free
mov esi, dword [ebp - 0x24]
mov dword [esp], esi
call sym._malloc
test eax, eax
mov ebx, eax
je 0x4be6e6
lea eax, [ebp - 0x1c]
mov dword [esp + 0x1c], eax
lea eax, [ebp - 0x24]
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 0x18], edi
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 3
mov dword [esp + 4], 0x30
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusA]
sub esp, 0x20
test eax, eax
je 0x4be600
mov eax, dword [ebp - 0x20]
xor edx, edx
mov ecx, eax
test ecx, ecx
mov dword [ebp - 0x30], eax
mov eax, ebx
je 0x4be720
mov dword [ebp - 0x34], ebx
jmp 0x4be697
add edx, 1
add eax, 0x24
cmp edx, dword [ebp - 0x30]
je 0x4be724
mov esi, dword [eax]
mov edi, str.Bonjour_Service
mov ecx, 0x10
repe cmpsb byte [esi], byte es:[edi]
jne 0x4be688
mov edx, dword [eax + 0xc]
mov ebx, dword [ebp - 0x34]
cmp edx, 1
sete al
cmp edx, 7
sete dl
or eax, edx
movzx esi, al
test ebx, ebx
je 0x4be6e8
mov dword [esp], ebx
call sym._free
jmp 0x4be6e8
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
test eax, eax
je 0x4be6e6
call ebx
test eax, eax
je 0x4be5f2
xor esi, esi
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x4be6fb
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
sub esp, 4
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4be720
nop
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4be66f
nop
xor esi, esi
jmp 0x4be6be
mov ebx, dword [ebp - 0x34]
xor esi, esi
jmp 0x4be6be
Function at 0x4c6540
Capabilities:
Allocate thread local storage

Disassembly:
push ebx
mov eax, 0x16
sub esp, 8
mov ebx, dword [esp + 0x10]
test ebx, ebx
je 0x4c656b
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov edx, eax
cmp edx, 0xffffffff
mov edx, 0
mov dword [ebx], eax
mov eax, 0xc
cmovne eax, edx
add esp, 8
pop ebx
ret

Function at 0x4c6590
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
cmp eax, 1
sbb eax, eax
and eax, 0x16
leave
ret
Function at 0x4c8560
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
mov edi, dword [edx + 0x10]
cmp eax, 0xffffffff
mov edx, dword [edi + 8]
mov dword [ebp - 0x1c], edx
je 0x4c8620
imul eax, eax, 0x58
mov eax, dword [eax + 0x5bd240]
test eax, eax
je 0x4c868f
xor esi, esi
lea ebx, [edi + 0x54]
mov dword [ebp - 0x20], edi
mov edi, esi
mov esi, dword [ebp + 0xc]
jmp 0x4c85ac
add edi, 1
add ebx, 0x18
cmp edi, 0x20
je 0x4c8610
mov eax, dword [ebx]
test eax, eax
je 0x4c85a1
mov ecx, dword [ebx + 4]
cmp byte [ecx], 3
jne 0x4c85a1
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x40000080
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0xc0000000
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
sub esp, 0x1c
cmp eax, 0xffffffff
je 0x4c8628
mov dword [esi + edi*8 + 0x1c], eax
add edi, 1
add ebx, 0x18
cmp edi, 0x20
jne 0x4c85ac
lea esi, [esi]
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [edi + 0x50]
jmp 0x4c8581
mov dword [esp], 0
mov esi, edi
mov edi, dword [ebp - 0x20]
call dbg.windows_error_str
mov dword [esp + 0x14], esi
mov dword [esp + 0x18], eax
lea eax, [esi + esi*2]
mov eax, dword [edi + eax*8 + 0x54]
mov dword [esp + 0xc], str.could_not_open_device__s__interface__d_:__s
mov dword [esp + 8], str.winusbx_open
mov dword [esp + 4], 1
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call dbg.usbi_log
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
mov eax, 0xfffffffc
cmp edx, 2
je 0x4c8612
xor eax, eax
cmp edx, 5
setne al
lea eax, [eax + eax - 3]
jmp 0x4c8612
mov eax, 0xfffffffd
jmp 0x4c8612
Function at 0x4cfd00
Capabilities:
Hash data using djb2

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
mov edx, dword [esp + 0x40]
test edx, edx
je 0x4cff24
mov eax, dword [esp + 0x40]
movsx edx, byte [eax]
lea ecx, [eax + 1]
mov eax, 0x1505
test dl, dl
je 0x4cfd44
mov ebx, eax
add ecx, 1
shl ebx, 5
add edx, ebx
add eax, edx
movsx edx, byte [ecx - 1]
test dl, dl
jne 0x4cfd26
test eax, eax
mov edx, 1
cmove eax, edx
mov ecx, dword [0x5bd504]
xor edx, edx
div ecx
test edx, edx
mov edi, edx
je 0x4cfe95
lea edx, [edx*8]
add edx, dword [0x5bd50c]
mov eax, dword [edx]
test eax, eax
je 0x4cfeaf
cmp edi, eax
mov ebx, dword [edx + 4]
jne 0x4cfd9c
test ebx, ebx
mov eax, str._NULL_
cmovne eax, ebx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x40]
mov dword [esp], eax
call sym._strcmp
mov edx, eax
mov eax, edi
test edx, edx
je 0x4cfe8d
mov eax, dword [esp + 0x40]
mov dword [esp + 0x14], ebx
mov ebx, edi
mov dword [esp + 0xc], str.hash_collision___s_vs__s_
mov dword [esp + 8], str.htab_hash
mov dword [esp + 0x10], eax
mov dword [esp + 4], 4
mov dword [esp], 0
call dbg.usbi_log
mov eax, dword [0x5bd504]
xor edx, edx
mov ebp, eax
lea ecx, [eax - 2]
mov dword [esp + 0x1c], eax
mov eax, edi
div ecx
lea esi, [edx + 1]
mov edx, dword [0x5bd50c]
sub ebp, esi
lea esi, [esi]
mov ecx, ebx
lea eax, [ebx + ebp]
sub ecx, esi
cmp ebx, esi
cmova eax, ecx
cmp eax, edi
mov ebx, eax
je 0x4cfe13
lea ecx, [edx + eax*8]
mov eax, dword [ecx]
cmp eax, edi
je 0x4cfef0
test eax, eax
jne 0x4cfdf0
mov ecx, dword [esp + 0x1c]
cmp dword [0x5bd500], ecx
jae 0x4cfebd
mov dword [esp], 0x5bd508
lea esi, [ebx*8]
call dbg.usbi_mutex_lock
mov ebp, dword [0x5bd50c]
add ebp, esi
mov eax, dword [ebp + 4]
test eax, eax
je 0x4cfe54
mov dword [esp], eax
call sym._free
mov dword [ebp + 4], 0
mov eax, dword [esp + 0x40]
mov dword [ebp], edi
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__strdup]
mov dword [ebp + 4], eax
mov eax, dword [0x5bd50c]
mov eax, dword [eax + esi + 4]
test eax, eax
je 0x4cff2e
mov dword [esp], 0x5bd508
add dword [0x5bd500], 1
call sym._usbi_mutex_unlock
mov eax, ebx
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, 8
mov edi, 1
add edx, dword [0x5bd50c]
mov eax, dword [edx]
test eax, eax
jne 0x4cfd6f
cmp dword [0x5bd500], ecx
mov ebx, edi
jb 0x4cfe23
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], str.hash_table_is_full___d_entries_
mov dword [esp + 8], str.htab_hash
mov dword [esp + 4], 1
mov dword [esp], 0
call dbg.usbi_log
add esp, 0x2c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ecx + 4]
mov ecx, str._NULL_
mov dword [esp + 0x18], edx
test eax, eax
cmove eax, ecx
mov dword [esp + 4], eax
mov eax, dword [esp + 0x40]
mov dword [esp], eax
call sym._strcmp
mov edx, dword [esp + 0x18]
test eax, eax
jne 0x4cfdf0
mov eax, ebx
jmp 0x4cfe8d
add esp, 0x2c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0xc], str.could_not_duplicate_string_for_hash_table
mov dword [esp + 8], str.htab_hash
mov dword [esp + 4], 1
mov dword [esp], 0
call dbg.usbi_log
mov dword [esp], 0x5bd508
call sym._usbi_mutex_unlock
xor eax, eax
jmp 0x4cfe8d
Function at 0x4cff70
Capabilities:
Terminate thread

Disassembly:
mov eax, dword [0x5bd524]
test eax, eax
je 0x4d0013
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [0x5bd520]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x402
mov dword [esp], eax
call dword [0x5bd510]
sub esp, 0x10
test eax, eax
jne 0x4d0015
mov dword [esp + 0xc], str.could_not_wait_for_timer_thread_to_quit
mov dword [esp + 8], str.windows_destroy_clock
mov dword [esp + 4], 4
mov dword [esp], 0
call dbg.usbi_log
mov eax, dword [0x5bd524]
mov dword [esp + 4], 1
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
sub esp, 8
mov eax, dword [0x5bd524]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x5bd524], 0
mov dword [0x5bd520], 0
sub esp, 4
leave
repz ret
mov eax, dword [0x5bd524]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
sub esp, 8
test eax, eax
jne 0x4cffb0
jmp 0x4cffed
Function at 0x4d42cf
Capabilities:
Contain obfuscated stackstrings
Print debug messages

Disassembly:
push ebp
mov ebp, esp
push edi
push ebx
add esp, 0xffffff80
cmp dword [ebp + 8], 0
jne 0x4d42e2
jmp 0x4d4416
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._pthread_spin_destroy
cmp eax, 1
jne 0x4d440e
mov dword [ebp - 0x77], 0x6f727245
mov dword [ebp - 0x73], 0x6c632072
mov dword [ebp - 0x6f], 0x696e6165
mov dword [ebp - 0x6b], 0x7520676e
mov dword [ebp - 0x67], 0x70732070
mov dword [ebp - 0x63], 0x6b5f6e69
mov dword [ebp - 0x5f], 0x20737965
mov dword [ebp - 0x5b], 0x20726f66
mov dword [ebp - 0x57], 0x65726874
mov dword [ebp - 0x53], 0x206461
lea edx, [ebp - 0x4f]
mov ebx, 0x43
mov eax, 0
mov ecx, edx
and ecx, 1
test ecx, ecx
je 0x4d435a
mov byte [edx], al
add edx, 1
sub ebx, 1
mov ecx, edx
and ecx, 2
test ecx, ecx
je 0x4d436c
mov word [edx], ax
add edx, 2
sub ebx, 2
mov ecx, ebx
shr ecx, 2
mov edi, edx
rep stosd dword es:[edi], eax
mov edx, edi
mov ecx, ebx
and ecx, 2
test ecx, ecx
je 0x4d4386
mov word [edx], ax
add edx, 2
and ebx, 1
mov ecx, ebx
test ecx, ecx
je 0x4d4394
mov byte [edx], al
add edx, 1
mov eax, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
call eax
mov dword [esp + 8], 0xa
lea edx, [ebp - 0x77]
add edx, 0x27
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll__ultoa]
call eax
mov dword [ebp - 0xc], 0x27
jmp 0x4d43c4
add dword [ebp - 0xc], 1
lea edx, [ebp - 0x77]
mov eax, dword [ebp - 0xc]
add eax, edx
movzx eax, byte [eax]
test al, al
je 0x4d43db
mov eax, dword [ebp - 0xc]
cmp eax, 0x69
jbe 0x4d43c0
mov eax, dword [ebp - 0xc]
cmp eax, 0x69
ja 0x4d43f9
lea edx, [ebp - 0x77]
mov eax, dword [ebp - 0xc]
add eax, edx
mov byte [eax], 0xa
mov eax, dword [ebp - 0xc]
add eax, 1
mov byte [ebp + eax - 0x77], 0
lea eax, [ebp - 0x77]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
call eax
sub esp, 4
call sym._abort
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov dword [eax], edx
lea esp, [ebp - 8]
pop ebx
pop edi
pop ebp
ret
Function at 0x4d51fd
Capabilities:
Allocate thread local storage

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
mov eax, dword [sym.imp.KERNEL32.dll_TlsAlloc]
call eax
mov dword [0x56064c], eax
mov eax, dword [0x56064c]
cmp eax, 0xffffffff
jne 0x4d521e
call sym._abort
leave
ret

Function at 0x4d5388
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov dword [ebp - 0x1c], 0xffffffff
mov dword [esp + 4], sym._pthread_tls_init
mov dword [esp], 0x5bd558
call sym.__pthread_once_raw
mov eax, dword [0x56064c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_TlsGetValue]
call eax
sub esp, 4
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x4d53cf
mov eax, dword [ebp - 0x20]
jmp 0x4d551a
call sym._pop_pthread_mem
mov dword [ebp - 0x20], eax
mov eax, dword [entry3]
test eax, eax
je 0x4d53e6
cmp dword [ebp - 0x20], 0
jne 0x4d53f0
mov eax, 0
jmp 0x4d551a
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x24], 1
mov eax, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
call eax
mov edx, dword [ebp - 0x20]
mov dword [edx + 0x3c], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
mov eax, dword [sym.imp.KERNEL32.dll_CreateEventA]
call eax
sub esp, 0x10
mov edx, dword [ebp - 0x20]
mov dword [edx + 0x18], eax
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x1c], 0xffffffff
mov eax, dword [ebp - 0x20]
lea edx, [eax + 0x38]
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov dword [esp], edx
call sym._replace_spin_keys
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x64], 0
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x14], 0
mov eax, dword [ebp - 0x20]
lea edi, [eax + 0x14]
mov eax, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
call eax
mov esi, eax
mov eax, dword [sym.imp.KERNEL32.dll_GetCurrentThread]
call eax
mov ebx, eax
mov eax, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
call eax
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edi
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_DuplicateHandle]
call eax
sub esp, 0x1c
test eax, eax
jne 0x4d54c2
call sym._abort
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetThreadPriority]
call eax
sub esp, 4
mov edx, dword [ebp - 0x20]
mov dword [edx + 0x6c], eax
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x68], 0
mov eax, dword [ebp - 0x20]
movzx edx, byte [eax + 0x20]
and edx, 0xffffffcf
or edx, 0x10
mov byte [eax + 0x20], dl
mov eax, dword [0x56064c]
mov edx, dword [ebp - 0x20]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_TlsSetValue]
call eax
sub esp, 8
test eax, eax
jne 0x4d5517
call sym._abort
mov eax, dword [ebp - 0x20]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
Function at 0x4d55de
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov dword [ebp - 0x10], 0
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], eax
call sym.___pthread_self_lite
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0xb4]
mov dword [esp], eax
call sym.__pthread_cleanup_dest
mov eax, dword [ebp - 0x14]
movzx eax, byte [eax + 0x20]
and eax, 0x30
test al, al
jne 0x4d5637
mov eax, dword [ebp - 0x14]
add eax, 0x70
mov dword [esp + 4], 1
mov dword [esp], eax
call sym._longjmp
mov eax, dword [0x56064c]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_TlsGetValue]
call eax
sub esp, 4
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x4d5761
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x14]
test eax, eax
jne 0x4d56c9
mov eax, dword [ebp - 0x10]
mov dword [eax], 0xdeadbeef
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x18]
test eax, eax
je 0x4d5686
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [eax + 0x18], 0
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 4]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._push_pthread_mem
mov dword [ebp - 0x10], 0
mov eax, dword [0x56064c]
mov edx, dword [ebp - 0x10]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_TlsSetValue]
call eax
sub esp, 8
jmp 0x4d5761
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 4]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x10]
mov dword [eax + 0x68], 1
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x18]
test eax, eax
je 0x4d56f9
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [eax + 0x18], 0
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x24]
and eax, 4
test eax, eax
je 0x4d5761
mov eax, dword [ebp - 0x10]
mov dword [eax], 0xdeadbeef
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_CloseHandle]
call eax
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [eax + 0x14], 0
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._push_pthread_mem
mov dword [ebp - 0x10], 0
mov eax, dword [0x56064c]
mov edx, dword [ebp - 0x10]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_TlsSetValue]
call eax
sub esp, 8
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll__endthreadex]
call eax
Function at 0x4dec20
Capabilities:
Write file on windows

Disassembly:
push ebx
sub esp, 0x18
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x1b
lea ebx, [esp + 0x24]
mov dword [esp + 4], 1
mov dword [esp], str.Mingw_w64_runtime_failure:_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sym._fwrite
mov eax, dword [esp + 0x20]
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sym._vfprintf
call sym._abort
jmp dbg.mark_section_writable

Function at 0x4dec80
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
push ebx
sub esp, 0x3c
mov eax, dword [0x5bd900]
test eax, eax
jle 0x4ded83
mov edx, dword [0x5bd904]
xor ebx, ebx
mov ecx, dword [edx + 4]
cmp ecx, esi
ja 0x4decb1
mov edi, dword [edx + 8]
add ecx, dword [edi + 8]
cmp esi, ecx
jb 0x4ded26
add ebx, 1
add edx, 0xc
cmp ebx, eax
jne 0x4deca0
mov dword [esp], esi
call dbg.__mingw_GetSectionForAddress
test eax, eax
mov edi, eax
je 0x4dedaa
lea esi, [ebx + ebx*2]
mov ebx, dword [0x5bd904]
shl esi, 2
add ebx, esi
mov dword [ebx + 8], eax
mov dword [ebx], 0
call dbg._GetPEImageBase
add eax, dword [edi + 0xc]
mov dword [ebx + 4], eax
lea eax, [ebp - 0x34]
mov dword [esp + 4], eax
mov eax, dword [0x5bd904]
mov dword [esp + 8], 0x1c
mov eax, dword [eax + esi + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
sub esp, 0xc
test eax, eax
je 0x4ded8a
mov eax, dword [ebp - 0x20]
cmp eax, 0x40
jne 0x4ded30
add dword [0x5bd900], 1
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
cmp eax, 4
je 0x4ded1f
cmp eax, 0x80
je 0x4ded1f
cmp eax, 8
je 0x4ded1f
mov eax, dword [ebp - 0x28]
add esi, dword [0x5bd904]
mov dword [esp + 8], 0x40
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x34]
mov dword [esp + 0xc], esi
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
sub esp, 0x10
test eax, eax
jne 0x4ded1f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.__VirtualProtect_failed_with_code_0x_x
mov dword [esp + 4], eax
call dbg.__report_error
xor ebx, ebx
jmp 0x4decbb
mov eax, dword [0x5bd904]
mov eax, dword [eax + esi + 4]
mov dword [esp + 8], eax
mov eax, dword [edi + 8]
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov dword [esp + 4], eax
call dbg.__report_error
mov dword [esp + 4], esi
mov dword [esp], str.Address__p_has_no_image_section
call dbg.__report_error
lea esi, [esi]

Function at 0x4df480
Capabilities:
Enumerate pe sections

Disassembly:
push esi
push ebx
mov edx, dword [esp + 0xc]
mov ebx, dword [esp + 0x10]
add edx, dword [edx + 0x3c]
movzx esi, word [edx + 6]
movzx eax, word [edx + 0x14]
test esi, esi
lea eax, [edx + eax + 0x18]
je 0x4df4b8
xor edx, edx
nop
mov ecx, dword [eax + 0xc]
cmp ecx, ebx
ja 0x4df4ae
add ecx, dword [eax + 8]
cmp ebx, ecx
jb 0x4df4ba
add edx, 1
add eax, 0x28
cmp edx, esi
jb 0x4df4a0
xor eax, eax
pop ebx
pop esi
ret
Function at 0x4e1610
Capabilities:
Query environment variable

Disassembly:
mov eax, dword [esp + 4]
mov edx, dword [esp + 8]
mov ecx, dword [esp + 0xc]
mov dword [esp + 8], 0
mov dword [esp + 0xc], 0
mov dword [esp + 4], 0
jmp dbg.getopt_internal

Function at 0x4e5d40
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x22c
mov ebx, dword [ebp + 8]
call sym.__errno
test ebx, ebx
mov dword [eax], 0
je 0x4e5ed3
cmp word [ebx], 0
je 0x4e5ea0
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
sub esp, 4
cmp eax, 0xffffffff
je 0x4e5eb5
test al, 0x10
je 0x4e5ea0
lea esi, [ebp - 0x220]
mov dword [esp + 4], ebx
mov dword [esp + 8], 0x104
mov dword [esp], esi
call sym.__wfullpath
mov dword [esp], esi
call sym._wcslen
mov dword [esp], 0x59bde0
mov edi, eax
call sym._wcslen
mov dword [esp], 0x59bde4
mov ebx, eax
call sym._wcslen
lea edx, [edi + ebx + 0x21d]
add eax, edx
add eax, eax
mov dword [esp], eax
call sym._malloc
test eax, eax
mov ebx, eax
je 0x4e5ec4
lea edi, [eax + 0x434]
mov dword [esp + 4], esi
mov dword [esp], edi
call sym._wcscpy
cmp word [ebx + 0x434], 0
jne 0x4e5e60
mov dword [esp], edi
mov dword [esp + 4], 0x59bde4
call sym._wcscat
xor edx, edx
xor eax, eax
mov word [ebx + 0x222], dx
lea edx, [ebx + 0x224]
mov ecx, 0x82
mov word [ebx + 0x220], ax
mov edi, edx
xor eax, eax
mov dword [ebx + 0x42c], 0xffffffff
mov dword [ebx + 0x430], 0
mov dword [ebx + 0x21c], 0
rep stosd dword es:[edi], eax
mov eax, ebx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], edi
call sym._wcslen
cmp word [ebx + eax*2 + 0x432], 0x2f
je 0x4e5e00
mov dword [esp], edi
call sym._wcslen
cmp word [ebx + eax*2 + 0x432], 0x5c
je 0x4e5e00
mov dword [esp + 4], 0x59bde0
mov dword [esp], edi
call sym._wcscat
jmp 0x4e5e00
call sym.__errno
mov dword [eax], 0x14
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
call sym.__errno
mov dword [eax], 2
xor eax, eax
jmp 0x4e5e53
call sym.__errno
mov dword [eax], 0xc
xor eax, eax
jmp 0x4e5e53
call sym.__errno
mov dword [eax], 0xe
xor eax, eax
jmp 0x4e5e53