joyce8/EMBER2024-capa huggingface dataset:
Function at 0x405f01
Capabilities:
Encode data using xor
Hash data with crc32

Disassembly:
cmp dword [0x422a54], 0
push esi
jne 0x405f38
xor ecx, ecx
push 8
mov eax, ecx
pop esi
mov edx, eax
and dl, 1
neg dl
sbb edx, edx
and edx, 0xedb88320
shr eax, 1
xor eax, edx
dec esi
jne 0x405f12
mov dword [ecx*4 + 0x422a50], eax
inc ecx
cmp ecx, 0x100
jl 0x405f0d
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 8]
test edx, edx
not eax
jbe 0x405f69
mov ecx, dword [esp + 0xc]
push edi
movzx edi, byte [ecx]
mov esi, eax
and esi, 0xff
xor esi, edi
shr eax, 8
mov esi, dword [esi*4 + 0x422a50]
xor eax, esi
inc ecx
dec edx
jne 0x405f4b
pop edi
not eax
pop esi
ret 0xc

Function at 0x40a830
Capabilities:
Packed with generic packer

Disassembly:
pushal
mov esi, section.UPX1
lea edi, [esi - 0x8000]
push edi
jmp 0x40a84a
mov al, byte [esi]
inc esi
mov byte [edi], al
inc edi
add ebx, ebx
jne 0x40a851
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
jb 0x40a840
mov eax, 1
add ebx, ebx
jne 0x40a863
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
adc eax, eax
add ebx, ebx
jae 0x40a858
jne 0x40a874
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
jae 0x40a858
xor ecx, ecx
sub eax, 3
jb 0x40a888
shl eax, 8
mov al, byte [esi]
inc esi
xor eax, 0xffffffff
je 0x40a8fa
mov ebp, eax
add ebx, ebx
jne 0x40a893
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
adc ecx, ecx
add ebx, ebx
jne 0x40a8a0
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
adc ecx, ecx
jne 0x40a8c4
inc ecx
add ebx, ebx
jne 0x40a8b0
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
adc ecx, ecx
add ebx, ebx
jae 0x40a8a5
jne 0x40a8c1
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
jae 0x40a8a5
add ecx, 2
cmp ebp, 0xfffff300
adc ecx, 1
lea edx, [edi + ebp]
cmp ebp, 0xfffffffc
jbe 0x40a8e4
mov al, byte [edx]
inc edx
mov byte [edi], al
inc edi
dec ecx
jne 0x40a8d5
jmp 0x40a846
mov eax, dword [edx]
add edx, 4
mov dword [edi], eax
add edi, 4
sub ecx, 4
ja 0x40a8e4
add edi, ecx
jmp 0x40a846
pop esi
lea edi, [esi + 0x8000]
mov eax, dword [edi]
or eax, eax
je 0x40a943
mov ebx, dword [edi + 4]
lea eax, [eax + esi + 0xcb14]
add ebx, esi
push eax
add edi, 8
call dword [esi + 0xcb9c]
xchg ebp, eax
mov al, byte [edi]
inc edi
or al, al
je 0x40a901
mov ecx, edi
push edi
dec eax
repne scasb al, byte es:[edi]
push ebp
call dword [esi + 0xcba4]
or eax, eax
je 0x40a93d
mov dword [ebx], eax
add ebx, 4
jmp 0x40a91e
call dword [esi + 0xcba0]
mov ebp, dword [esi + 0xcba8]
lea edi, [esi - 0x1000]
mov ebx, 0x1000
push eax
push esp
push 4
push ebx
push edi
call ebp
lea eax, [edi + 0x20f]
and byte [eax], 0x7f
and byte [eax + 0x28], 0x7f
pop eax
push eax
push esp
push eax
push ebx
push edi
call ebp
pop eax
popal
lea eax, [esp - 0x80]
push 0
cmp esp, eax
jne 0x40a977
sub esp, 0xffffff80
jmp 0x401e00
Function at 0x401101
Capabilities:
Accept command line arguments

Disassembly:
push ebp
mov ebp, esp
push ecx
lea eax, [ebp + 0xc]
push esi
push eax
lea eax, [ebp + 8]
push eax
call sym.ruby187c.exc_NtInitialize
pop ecx
pop ecx
call sym.ruby187c.exc_ruby_init
lea eax, [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
push eax
call sym.ruby187c.exc_rb_w32_cmdvector
mov ecx, dword [ebp + 0xc]
mov dword [ebp + 8], eax
add ecx, 4
dec eax
push ecx
push eax
call sym.ruby187c.exc_ruby_set_argv
push str.exerb
call fcn.004012d1
push 0x47e070
call sym.ruby187c.exc_rb_str_new2
push eax
push dword [sym.ruby187c.exc_rb_load_path]
call sym.ruby187c.exc_rb_ary_push
add esp, 0x20
lea eax, [ebp - 4]
xor esi, esi
push eax
mov dword [ebp - 4], esi
push dword [ebp + 0x10]
call sym.ruby187c.exc_rb_uint2inum
pop ecx
push eax
push 0x4011c5
call sym.ruby187c.exc_rb_protect
add esp, 0xc
cmp dword [ebp - 4], esi
je 0x4011b6
push dword [sym.ruby187c.exc_rb_eSystemExit]
mov esi, dword [sym.ruby187c.exc_ruby_errinfo]
push esi
call sym.ruby187c.exc_rb_obj_is_kind_of
pop ecx
test eax, eax
pop ecx
je 0x4011ae
push str.status
push esi
call sym.ruby187c.exc_rb_iv_get
pop ecx
mov esi, eax
pop ecx
sar esi, 1
jmp 0x4011b6
push esi
call dword [ebp + 0x14]
pop ecx
push 1
pop esi
call sym.ruby187c.exc_ruby_finalize
call fcn.004013e0
mov eax, esi
pop esi
leave
ret

Function at 0x401a34
Capabilities:
Allocate or change rwx memory
Delete file
Execute shellcode via indirect call

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10c
cmp dword [0x488f78], 0x20
jbe 0x401a56
push str.the_loaded_library_table_is_too_big.
push dword [sym.ruby187c.exc_rb_eExerbRuntimeError]
call sym.ruby187c.exc_rb_raise
push ebx
mov ebx, dword [ebp + 8]
push esi
lea eax, [ebp - 4]
mov esi, dword [sym.imp.KERNEL32.dll_VirtualProtect]
push edi
and dword [ebp - 4], 0
and dword [ebp - 8], 0
push eax
push 4
push dword [ebp + 0xc]
push ebx
call esi
push ebx
call fcn.00401b29
pop ecx
lea eax, [ebp - 8]
push eax
push dword [ebp - 4]
push dword [ebp + 0xc]
push ebx
call esi
mov al, byte [0x4890d4]
push 0x40
mov byte [ebp - 0x10c], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x10b]
rep stosd dword es:[edi], eax
push dword [ebp + 0xc]
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x10c]
push ebx
push eax
push str.exerb
call fcn.0040289d
add esp, 0x10
lea eax, [ebp - 0x10c]
push 8
push 0
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov edi, eax
test edi, edi
jne 0x401af0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
lea eax, [ebp - 0x10c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push esi
call fcn.0040290d
pop ecx
mov eax, dword [0x488f78]
push dword [ebp + 0x10]
mov esi, eax
shl esi, 3
call fcn.00402686
inc dword [0x488f78]
cmp byte [ebp + 0x14], 0
mov dword [esi + 0x488f80], eax
pop ecx
mov dword [esi + 0x488f84], edi
jne 0x401b22
push edi
call fcn.00402032
pop ecx
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret
Function at 0x401e81
Capabilities:
Enumerate pe sections

Disassembly:
mov ecx, dword [esp + 4]
push esi
xor esi, esi
push edi
movzx eax, word [ecx + 0x14]
lea eax, [eax + ecx + 0x18]
movzx ecx, word [ecx + 6]
test ecx, ecx
jle 0x401eb5
mov edx, dword [eax + 0xc]
cmp dword [esp + 0x10], edx
jb 0x401ead
mov edi, dword [eax + 8]
add edi, edx
cmp dword [esp + 0x10], edi
jb 0x401eb7
inc esi
add eax, 0x28
cmp esi, ecx
jl 0x401e99
xor eax, eax
pop edi
pop esi
ret

Function at 0x4027b6
Capabilities:
Get file size

Disassembly:
push edi
push 0
push dword [esp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4027e5
push esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [esp + 0xc]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call fcn.0040290d
pop ecx
pop esi
mov eax, edi
pop edi
ret

Function at 0x40289d
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x104
mov al, byte [0x4890d4]
push esi
push edi
push 0x40
mov byte [ebp - 0x104], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x103]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x104]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push dword [ebp + 0xc]
lea eax, [ebp - 0x104]
push 0
push dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
push dword [ebp + 0xc]
call fcn.004026e3
push dword [ebp + 0x14]
mov esi, eax
push dword [ebp + 0x10]
push esi
call fcn.00402776
push esi
call fcn.00402714
add esp, 0x14
pop edi
pop esi
leave
ret
Function at 0x411a51
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x64
lea eax, [ebp - 4]
push esi
push eax
call sym.ruby187c.exc_Init_stack
mov eax, dword [sym.ruby187c.exc_ruby_frame]
xor esi, esi
mov dword [ebp - 0x24], eax
mov eax, dword [0x4891e0]
mov dword [ebp - 0x20], eax
mov eax, dword [0x4891b4]
mov dword [ebp - 0xc], eax
mov eax, dword [sym.ruby187c.exc_ruby_scope]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x64]
mov dword [0x4891b4], eax
lea eax, [ebp - 0x64]
push esi
push eax
mov dword [ebp - 0x18], 4
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x10], esi
mov dword [ebp - 8], esi
call sub.MSVCRT.dll__setjmp3
add esp, 0xc
cmp eax, esi
mov dword [ebp - 4], eax
jne 0x411ac7
push dword [ebp + 0xc]
push dword [ebp + 8]
call sym.ruby187c.exc_ruby_process_options
mov eax, dword [ebp - 0xc]
pop ecx
pop ecx
mov dword [0x4891b4], eax
pop esi
leave
ret
push eax
mov dword [0x495220], esi
mov dword [0x495224], esi
call fcn.00411ae1
pop ecx
push eax
call dword [sym.imp.MSVCRT.dll_exit]

Function at 0x411f0f
Capabilities:
Terminate process

Disassembly:
cmp dword [sym.ruby187c.exc_ruby_nerrs], 0
jle 0x411f20
push 1
call dword [sym.imp.MSVCRT.dll_exit]
call sym.ruby187c.exc_ruby_exec
test eax, eax
je 0x411f37
cmp dword [0x489180], 0
jne 0x411f37
mov dword [0x489180], eax
push dword [0x489180]
call sym.ruby187c.exc_ruby_stop

Function at 0x4163d1
Capabilities:
Terminate process

Disassembly:
cmp dword [0x4891b4], 0
je 0x4163f2
push 4
push 0x48086c
call sym.ruby187c.exc_rb_str_new
pop ecx
pop ecx
push eax
push dword [esp + 8]
call fcn.00416401
call sym.ruby187c.exc_ruby_finalize
push dword [esp + 4]
call dword [sym.imp.MSVCRT.dll_exit]

Function at 0x422251
Capabilities:
Encode data using base64

Disassembly:
push ebp
mov ebp, esp
lea eax, [ebp + 8]
push esi
push eax
lea eax, [ebp + 0xc]
mov esi, dword [0x4891b4]
push eax
push 0x47edf8
push dword [ebp + 0xc]
push dword [ebp + 8]
call sym.ruby187c.exc_rb_scan_args
push dword [ebp + 0xc]
call sym.ruby187c.exc_rb_to_id
shl eax, 8
add esp, 0x18
or al, 0xe
mov dword [ebp + 0xc], eax
test esi, esi
je 0x4222ab
mov ecx, dword [esi + 0x48]
cmp ecx, eax
je 0x42229b
cmp ecx, 2
je 0x4222c7
mov esi, dword [esi + 0x58]
jmp 0x422286
mov dword [esi + 0x54], eax
mov eax, dword [ebp + 8]
test esi, esi
mov dword [esi + 0x4c], eax
jne 0x4222e8
mov eax, dword [ebp + 0xc]
shr eax, 8
push eax
call sym.ruby187c.exc_rb_id2name
pop ecx
push eax
mov eax, dword [ebp + 0xc]
shr eax, 8
push str.uncaught_throw___s
push eax
call sym.ruby187c.exc_rb_name_error
push dword [sym.ruby187c.exc_rb_curr_thread]
shr eax, 8
push eax
call sym.ruby187c.exc_rb_id2name
pop ecx
push eax
push str.uncaught_throw___s_in_thread_0x_lx
push dword [sym.ruby187c.exc_rb_eThreadError]
call sym.ruby187c.exc_rb_raise
call sym.ruby187c.exc_Init_ext
mov eax, dword [0x4891b4]
push 7
push eax
mov ecx, dword [eax + 0x40]
mov dword [sym.ruby187c.exc_ruby_frame], ecx
mov ecx, dword [eax + 0x44]
mov dword [0x4891e0], ecx
call dword [sym.imp.MSVCRT.dll_longjmp]
Function at 0x42230d
Capabilities:
Encode data using base64

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
push dword [ebp + 8]
call sym.ruby187c.exc_rb_intern
shl eax, 8
or al, 0xe
pop ecx
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 4], eax
lea eax, [ebp - 8]
push eax
push 2
call fcn.00422251
Function at 0x42a475
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push esi
mov esi, dword [esp + 8]
push edi
mov cl, byte [esi]
movsx eax, cl
cmp eax, 0x30
jg 0x42a575
cmp eax, 0x2e
jge 0x42a596
cmp eax, 0x27
jg 0x42a4e3
cmp eax, 0x26
jge 0x42a596
cmp eax, 0x21
jl 0x42a4b7
cmp eax, 0x22
jle 0x42a596
cmp eax, 0x24
je 0x42a596
cmp cl, 0x80
jae 0x42a5eb
mov eax, dword [sym.imp.MSVCRT.dll___mb_cur_max]
mov edi, dword [sym.imp.MSVCRT.dll__isctype]
cmp dword [eax], 1
jle 0x42a599
movzx eax, cl
push 4
push eax
call edi
pop ecx
pop ecx
jmp 0x42a5aa
cmp eax, 0x2a
jl 0x42a4b7
cmp eax, 0x2c
jle 0x42a596
cmp eax, 0x2d
jne 0x42a4b7
mov cl, byte [esi + 1]
inc esi
movzx eax, cl
mov edx, eax
xor edx, 0x80
sub edx, 0x80
cmp edx, 0xffffffff
je 0x42a5e2
cmp cl, 0x80
jae 0x42a549
mov ecx, dword [sym.imp.MSVCRT.dll___mb_cur_max]
cmp dword [ecx], 1
jle 0x42a534
push 0x107
push eax
call dword [sym.imp.MSVCRT.dll__isctype]
pop ecx
pop ecx
jmp 0x42a545
mov ecx, dword [sym.imp.MSVCRT.dll__pctype]
mov ecx, dword [ecx]
mov ax, word [ecx + eax*2]
and eax, 0x107
test eax, eax
jne 0x42a562
mov al, byte [esi]
cmp al, 0x5f
je 0x42a562
mov ecx, dword [sym.ruby187c.exc_re_mbctab]
movzx eax, al
cmp byte [eax + ecx], 0
je 0x42a5e2
movzx eax, byte [esi]
mov ecx, dword [sym.ruby187c.exc_re_mbctab]
movzx eax, byte [eax + ecx]
lea esi, [esi + eax + 1]
jmp 0x42a5e2
cmp eax, 0x3a
jl 0x42a4b7
cmp eax, 0x40
jle 0x42a596
cmp eax, 0x5c
je 0x42a596
cmp eax, 0x60
je 0x42a596
cmp eax, 0x7e
jne 0x42a4b7
inc esi
jmp 0x42a5e2
movzx eax, cl
mov ecx, dword [sym.imp.MSVCRT.dll__pctype]
mov ecx, dword [ecx]
mov al, byte [ecx + eax*2]
and eax, 4
test eax, eax
je 0x42a5eb
mov al, byte [esi + 1]
inc esi
cmp al, 0x80
jae 0x42a5e2
mov ecx, dword [sym.imp.MSVCRT.dll___mb_cur_max]
cmp dword [ecx], 1
jle 0x42a5cd
movzx eax, al
push 4
push eax
call edi
pop ecx
pop ecx
jmp 0x42a5de
mov ecx, dword [sym.imp.MSVCRT.dll__pctype]
movzx eax, al
mov ecx, dword [ecx]
mov al, byte [ecx + eax*2]
and eax, 4
test eax, eax
jne 0x42a5ae
xor eax, eax
cmp byte [esi], al
sete al
jmp 0x42a5ed
xor eax, eax
pop edi
pop esi
ret

Function at 0x42ad6d
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x200
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push ebx
push esi
push edi
lea esi, [eax + 0x40]
lea eax, [ebp - 0x200]
push 0x200
push eax
call fcn.0042ac29
mov edi, dword [sym.imp.MSVCRT.dll_fwrite]
mov ebx, eax
push esi
push ebx
lea eax, [ebp - 0x200]
push 1
push eax
call edi
add esp, 0x18
cmp eax, ebx
je 0x42adca
mov eax, dword [sym.imp.MSVCRT.dll__iob]
lea esi, [eax + 0x20]
lea eax, [ebp - 0x200]
push esi
push ebx
push 1
push eax
call edi
add esp, 0x10
cmp eax, ebx
jne 0x42adf9
push esi
push str._BUG_
call dword [sym.imp.MSVCRT.dll_fputs]
lea eax, [ebp + 0xc]
push eax
push dword [ebp + 8]
push esi
call dword [sym.imp.MSVCRT.dll_vfprintf]
push dword [sym.ruby187c.exc_ruby_description]
push str._n_s_n_n
push esi
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0x20
jmp dword [sym.imp.MSVCRT.dll_abort]
Function at 0x42e77a
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
mov eax, dword [ebp + 8]
mov dword [ebp - 4], eax
push dword [ebp + 0xc]
call sym.ruby187c.exc_rb_to_int
pop ecx
mov dword [ebp + 0xc], eax
test byte [ebp + 0xc], 1
je 0x42e7a7
mov eax, dword [ebp + 0xc]
sar eax, 1
push eax
call sym.ruby187c.exc_rb_int2big
pop ecx
mov dword [ebp + 0xc], eax
mov eax, dword [ebp + 0xc]
cmp byte [eax + 8], 0
jne 0x42e7c5
push dword [ebp + 0xc]
call sym.ruby187c.exc_rb_big_clone
mov dword [ebp + 0xc], eax
push dword [ebp + 0xc]
call fcn.0042c3ff
pop ecx
pop ecx
mov eax, dword [ebp - 4]
cmp byte [eax + 8], 0
jne 0x42e7e3
push dword [ebp - 4]
call sym.ruby187c.exc_rb_big_clone
mov dword [ebp - 4], eax
push dword [ebp - 4]
call fcn.0042c3ff
pop ecx
pop ecx
push ebx
push esi
push edi
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 0xc]
mov eax, dword [eax + 0xc]
cmp eax, dword [ecx + 0xc]
jle 0x42e814
mov eax, dword [ebp + 0xc]
mov edi, dword [eax + 0xc]
mov eax, dword [ebp - 4]
mov esi, dword [eax + 0xc]
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 0x10]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 4]
mov ebx, dword [eax + 0x10]
mov eax, dword [ebp + 0xc]
jmp 0x42e832
mov eax, dword [ebp - 4]
mov edi, dword [eax + 0xc]
mov eax, dword [ebp + 0xc]
mov esi, dword [eax + 0xc]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x10]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 0xc]
mov ebx, dword [eax + 0x10]
mov eax, dword [ebp - 4]
mov al, byte [eax + 8]
mov byte [ebp + 0xb], al
mov eax, dword [ebp - 4]
cmp byte [eax + 8], 0
setne al
mov ecx, dword [ebp - 4]
mov byte [ecx + 8], al
mov eax, dword [ebp + 0xc]
cmp byte [eax + 8], 0
setne al
mov ecx, dword [ebp + 0xc]
mov byte [ecx + 8], al
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 4]
mov al, byte [eax + 8]
xor al, byte [ecx + 8]
neg al
sbb eax, eax
inc eax
push eax
push esi
push dword [sym.ruby187c.exc_rb_cBignum]
call fcn.0042c3a0
mov dword [ebp - 0xc], eax
mov eax, dword [eax + 0x10]
add esp, 0xc
xor ecx, ecx
test edi, edi
mov dword [ebp - 4], eax
jle 0x42e8ae
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 4]
mov dword [ebp + 0xc], ebx
mov dword [ebp - 8], edi
sub dword [ebp + 0xc], eax
sub edx, eax
mov ecx, edi
mov edi, dword [ebp + 0xc]
mov edi, dword [edi + eax]
xor edi, dword [eax]
mov dword [edx + eax], edi
add eax, 4
dec dword [ebp - 8]
jne 0x42e89b
cmp ecx, esi
jge 0x42e8cf
mov edx, dword [ebp - 4]
lea eax, [ebx + ecx*4]
sub edx, ebx
sub esi, ecx
cmp byte [ebp + 0xb], 0
mov ecx, dword [eax]
jne 0x42e8c6
not ecx
mov dword [edx + eax], ecx
add eax, 4
dec esi
jne 0x42e8bc
mov eax, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
cmp byte [eax + 8], 0
jne 0x42e8e2
push eax
call fcn.0042c3ff
pop ecx
push dword [ebp - 0xc]
call fcn.0042c47c
pop ecx
leave
ret
Function at 0x430fc4
Capabilities:
Terminate process

Disassembly:
push esi
mov esi, dword [esp + 0xc]
push edi
mov edi, dword [esp + 0xc]
mov dword [0x4952fc], edi
mov dword [0x4952f8], esi
push dword [esi]
call sym.ruby187c.exc_ruby_script
mov eax, dword [sym.ruby187c.exc_rb_progname]
push esi
push edi
mov dword [sym.ruby187c.exc_rb_argv0], eax
call fcn.0043007a
xor esi, esi
add esp, 0xc
cmp dword [0x49531c], esi
je 0x43101a
cmp dword [sym.ruby187c.exc_ruby_nerrs], esi
jne 0x43101a
push str.Syntax_OK_n
call dword [sym.imp.MSVCRT.dll_printf]
pop ecx
push esi
call dword [sym.imp.MSVCRT.dll_exit]
cmp dword [0x495318], esi
je 0x431027
call sym.ruby187c.exc_rb_parser_append_print
cmp dword [0x495314], esi
je 0x431042
push dword [0x495324]
push dword [0x495320]
call sym.ruby187c.exc_rb_parser_while_loop
pop ecx
pop ecx
pop edi
pop esi
ret

Function at 0x4312f6
Capabilities:
Accept command line arguments
Initialize winsock library

Disassembly:
push dword [esp + 8]
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
push eax
call sym.ruby187c.exc_rb_w32_cmdvector
pop ecx
pop ecx
mov ecx, dword [esp + 4]
mov dword [ecx], eax
call dword [sym.imp.MSVCRT.dll__tzset]
call fcn.00431372
call fcn.00432aaa
push 0x4955d8
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x431339
call fcn.00467a7a
pop ecx
jmp fcn.00433304
Function at 0x431372
Capabilities:
Get common file path
Get session user name
Query environment variable
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x110
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
push edi
mov edi, 0x104
lea eax, [ebp - 0x110]
push edi
push eax
push str.HOME
call esi
test eax, eax
jne 0x43149b
lea eax, [ebp - 0x110]
push edi
push eax
push str.HOMEDRIVE
call esi
test eax, eax
je 0x4313c2
lea eax, [ebp - 0x110]
push eax
call sub.MSVCRT.dll_strlen
pop ecx
jmp 0x4313c4
xor eax, eax
mov ecx, edi
mov dword [ebp - 4], eax
sub ecx, eax
lea eax, [ebp + eax - 0x110]
push ecx
push eax
push str.HOMEPATH
call esi
test eax, eax
jne 0x431440
cmp dword [ebp - 4], eax
jne 0x431440
lea eax, [ebp - 0x110]
push edi
push eax
push str.USERPROFILE
call esi
test eax, eax
jne 0x431447
lea eax, [ebp - 8]
push eax
push 5
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderLocation]
test eax, eax
jne 0x43149b
lea eax, [ebp - 0x110]
push eax
push dword [ebp - 8]
call dword [sym.imp.SHELL32.dll_SHGetPathFromIDListA]
mov ebx, eax
lea eax, [ebp - 0xc]
push eax
call dword [sym.imp.SHELL32.dll_SHGetMalloc]
mov eax, dword [ebp - 0xc]
push dword [ebp - 8]
mov ecx, dword [eax]
push eax
call dword [ecx + 0x14]
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [eax]
call dword [ecx + 8]
jmp 0x431443
push 1
pop ebx
test ebx, ebx
je 0x43149b
cmp byte [ebp - 0x110], 0
lea eax, [ebp - 0x110]
je 0x43146a
cmp byte [eax], 0x5c
jne 0x43145e
mov byte [eax], 0x2f
push eax
call dword [sym.imp.USER32.dll_CharNextA]
cmp byte [eax], 0
jne 0x431456
mov ecx, eax
lea edx, [ebp - 0x110]
sub ecx, edx
cmp ecx, 2
jne 0x431489
cmp byte [ebp - 0x10f], 0x3a
jne 0x431489
mov byte [eax], 0x2f
and byte [eax + 1], 0
lea eax, [ebp - 0x110]
push eax
push str.HOME
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
lea eax, [ebp - 0x110]
push edi
mov ebx, str.USER
push eax
push ebx
call esi
test eax, eax
jne 0x4314f4
lea eax, [ebp - 0x110]
push edi
push eax
push str.USERNAME
call esi
test eax, eax
jne 0x4314e6
lea eax, [ebp - 4]
mov dword [ebp - 4], edi
push eax
lea eax, [ebp - 0x110]
push eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
test eax, eax
jne 0x4314e6
mov dword [0x495e18], str._Unknown_
jmp 0x431507
lea eax, [ebp - 0x110]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
lea eax, [ebp - 0x110]
push eax
call dword [sym.imp.MSVCRT.dll__strdup]
pop ecx
mov dword [0x495e18], eax
pop edi
pop esi
pop ebx
leave
ret
Function at 0x43323e
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
xor edi, edi
cmp dword [ebp + 8], edi
jne 0x433273
mov ecx, dword [ebp + 0x18]
cmp ecx, edi
je 0x43326f
mov eax, dword [ecx + 4]
mov esi, 0x3e8
cdq
idiv esi
mov ecx, dword [ecx]
imul ecx, ecx, 0x3e8
add eax, ecx
push eax
call sym.ruby187c.exc_rb_w32_sleep
pop ecx
jmp 0x4332c5
push 0xffffffffffffffff
jmp 0x433267
call sym.ruby187c.exc_rb_w32_enter_critical
mov esi, 0x4955d8
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_select]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp edi, 0xffffffff
jne 0x4332c0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call sym.ruby187c.exc_rb_w32_map_errno
pop ecx
mov esi, eax
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], esi
or edi, edi
call sym.ruby187c.exc_rb_w32_leave_critical
mov eax, edi
pop edi
pop esi
pop ebp
ret

Function at 0x433304
Capabilities:
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x190
lea eax, [ebp - 0x190]
push edi
push eax
push 2
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x43332b
push str.Unable_to_locate_winsock_library__n
call sym.ruby187c.exc_rb_fatal
cmp byte [ebp - 0x190], 2
je 0x43333e
push str.could_not_find_version_2_of_winsock_dll_n
call sym.ruby187c.exc_rb_fatal
push 1
pop edi
mov dword [0x495538], edi
call sym.ruby187c.exc_GetCurrentThreadHandle
mov dword [0x495530], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push 0
push 0
push 0
push 0
mov dword [0x495534], eax
call dword [sym.imp.KERNEL32.dll_CreateEventA]
test eax, eax
mov dword [0x4955f0], eax
jne 0x43337d
push str.Unable_to_create_interrupt_event__n
call sym.ruby187c.exc_rb_fatal
mov dword [0x495e28], edi
pop edi
leave
ret

Function at 0x4334cf
Capabilities:
Connect socket

Disassembly:
cmp dword [0x495e28], 0
jne 0x4334dd
call fcn.00433304
push esi
call sym.ruby187c.exc_rb_w32_enter_critical
push dword [esp + 0x10]
push dword [esp + 0x10]
push dword [esp + 0x10]
call dword [sym.imp.MSVCRT.dll__get_osfhandle]
pop ecx
push eax
call dword [sym.imp.WS2_32.dll_connect]
mov esi, eax
cmp esi, 0xffffffff
jne 0x433532
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x433526
push edi
push eax
call sym.ruby187c.exc_rb_w32_map_errno
pop ecx
mov edi, eax
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], edi
pop edi
jmp 0x433532
call dword [sym.imp.MSVCRT.dll__errno]
mov dword [eax], 0x2734
call sym.ruby187c.exc_rb_w32_leave_critical
mov eax, esi
pop esi
ret