joyce8/EMBER2024-capa huggingface dataset:
Function at 0x5912d8
Capabilities:
Access peb ldr_data
Get kernel32 base address

Disassembly:
push ebp
mov ebp, esp
mov ecx, 8
push 0
push 0
dec ecx
jne 0x5912e0
push ecx
push ebx
push esi
push edi
mov ebx, eax
xor eax, eax
push ebp
push 0x5914d2
push dword fs:[eax]
mov dword fs:[eax], esp
mov esi, dword [ebx + 8]
lea ecx, [ebp - 0xc]
mov edx, 0x5914e8
mov eax, esi
call fcn.0058f068
mov edx, dword [ebp - 0xc]
lea eax, [ebx + 0xc]
call fcn.0040489c
lea ecx, [ebp - 0x10]
mov edx, 0x5914fc
mov eax, esi
call fcn.0058f068
mov edx, dword [ebp - 0x10]
lea eax, [ebx + 0x28]
call fcn.0040489c
lea ecx, [ebp - 0x14]
mov edx, 0x591514
mov eax, esi
call fcn.0058f068
mov edx, dword [ebp - 0x14]
lea eax, [ebx + 0x10]
call fcn.0040489c
lea ecx, [ebp - 0x18]
mov edx, 0x591530
mov eax, esi
call fcn.0058f068
mov edx, dword [ebp - 0x18]
lea eax, [ebx + 0x14]
call fcn.0040489c
lea ecx, [ebp - 0x1c]
mov edx, 0x59154c
mov eax, esi
call fcn.0058f068
mov edx, dword [ebp - 0x1c]
lea eax, [ebx + 0x24]
call fcn.0040489c
lea ecx, [ebp - 0x24]
mov edx, 0x591564
mov eax, esi
call fcn.0058f068
mov eax, dword [ebp - 0x24]
lea edx, [ebp - 0x20]
call fcn.0040954c
mov eax, dword [ebp - 0x20]
or edx, 0xffffffff
call fcn.00409ccc
mov edi, eax
mov dword [ebx + 0x18], edi
test edi, edi
setge al
mov byte [ebx + 0x4c], al
lea ecx, [ebp - 0x28]
mov edx, 0x59157c
mov eax, esi
call fcn.0058f068
mov eax, dword [ebp - 0x28]
call fcn.0058e180
fstp qword [ebx + 0x30]
wait
lea ecx, [ebp - 0x2c]
mov edx, 0x59158c
mov eax, esi
call fcn.0058f068
mov eax, dword [ebp - 0x2c]
call fcn.0058e180
fstp qword [ebx + 0x40]
wait
lea ecx, [ebp - 0x30]
mov edx, 0x5915a4
mov eax, esi
call fcn.0058f068
mov eax, dword [ebp - 0x30]
or edx, 0xffffffff
call fcn.00409ccc
inc eax
je 0x591475
lea ecx, [ebp - 0x34]
mov edx, 0x5915a4
mov eax, esi
call fcn.0058f068
mov eax, dword [ebp - 0x34]
call fcn.00409c90
mov edi, eax
mov eax, edi
mov ecx, 0xe10
cdq
idiv ecx
mov dword [ebp - 8], eax
mov eax, edi
mov ecx, 0xe10
cdq
idiv ecx
mov ecx, edx
mov eax, ecx
push ecx
mov ecx, 0x3c
cdq
idiv ecx
pop ecx
mov dword [ebp - 4], eax
mov eax, ecx
mov ecx, 0x3c
cdq
idiv ecx
mov edi, edx
push 0
mov ecx, edi
mov dx, word [ebp - 4]
mov ax, word [ebp - 8]
call fcn.0040b84c
fstp qword [ebp - 0x3c]
wait
call fcn.0040bccc
fadd qword [ebp - 0x3c]
fstp qword [ebx + 0x38]
wait
jmp 0x591490
lea ecx, [ebp - 0x40]
mov edx, 0x5915a4
mov eax, esi
call fcn.0058f068
mov eax, dword [ebp - 0x40]
call fcn.0058e180
fstp qword [ebx + 0x38]
wait
lea ecx, [ebp - 0x44]
mov edx, 0x5915b4
mov eax, esi
call fcn.0058f068
mov edx, dword [ebp - 0x44]
lea eax, [ebx + 0x48]
call fcn.0040489c
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5914d9
lea eax, [ebp - 0x44]
mov edx, 2
call fcn.0040486c
lea eax, [ebp - 0x34]
mov edx, 0xb
call fcn.0040486c
ret
Function at 0x59d770
Capabilities:
Access peb ldr_data

Disassembly:
push ebp
mov ebp, esp
push 0
push ebx
push esi
push edi
mov edi, ecx
mov esi, edx
xor edx, edx
push ebp
push 0x59d7ca
push dword fs:[edx]
mov dword fs:[edx], esp
mov eax, dword [eax + 0x30]
call fcn.0059d760
mov ebx, eax
lea edx, [ebp - 4]
mov eax, edi
call fcn.0058ccf0
mov edx, dword [ebp - 4]
mov eax, dword [ebx + 0xc]
call fcn.0058c8f0
mov edx, dword [esi + 8]
mov eax, dword [ebx + 0x10]
mov ecx, dword [eax]
call dword [ecx + 8]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x59d7d1
lea eax, [ebp - 4]
call fcn.00404848
ret
Function at 0x402d81
Capabilities:
Create process on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x158
mov eax, dword [0x4140f8]
push ebx
push esi
push edi
push 0x11
mov dword [ebp - 4], eax
mov ebx, ecx
pop ecx
xor eax, eax
lea edi, [ebp - 0x158]
rep stosd dword es:[edi], eax
push 0x401340
lea eax, [ebp - 0x104]
push eax
mov dword [ebp - 0x158], 0x44
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
lea eax, [ebp - 0x114]
push eax
xor esi, esi
lea eax, [ebp - 0x158]
push eax
push esi
push esi
push esi
push esi
push esi
push esi
lea eax, [ebp - 0x104]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
jne 0x402e07
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push 0x1e
push 0x1d
push dword [ebx + 0xc]
push dword [ebx + 0x56c]
call fcn.00407d3a
add esp, 0x18
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.004077b8
leave
ret

Function at 0x402e19
Capabilities:
Log keystrokes via polling

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push edi
xor edi, edi
test byte [0x414bcc], 1
jne 0x402e3e
or dword [0x414bcc], 1
push 0x17
call dword [sym.imp.USER32.dll_GetSystemMetrics]
mov dword [0x414bc8], eax
push esi
mov esi, dword [sym.imp.USER32.dll_GetAsyncKeyState]
push 0x11
call esi
test ax, ax
je 0x402e51
push 8
pop edi
push 1
call esi
test ax, ax
je 0x402e68
xor eax, eax
cmp dword [0x414bc8], eax
setne al
inc eax
or edi, eax
push 2
call esi
test ax, ax
pop esi
je 0x402e80
xor eax, eax
cmp dword [0x414bc8], eax
sete al
inc eax
or edi, eax
mov eax, dword [ebp + 0x10]
movzx ecx, word [eax + 4]
movzx eax, word [eax]
shl ecx, 0x10
or ecx, eax
mov eax, dword [ebp + 0xc]
imul eax, eax, 0x78
push ecx
movzx eax, ax
movzx ecx, di
shl eax, 0x10
or eax, ecx
push eax
push 0x20a
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_SendMessageW]
pop edi
pop ebp
ret 0xc
Function at 0x403b60
Capabilities:
Check mutex on windows
Get session user name

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x580
mov eax, dword [0x4140f8]
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 4], eax
lea eax, [ebp - 0x580]
push eax
push 0x414b40
mov dword [ebp - 0x580], 0x40
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
push 0x4012f8
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [0x414bc0], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x403bbc
xor eax, eax
inc eax
jmp 0x403c48
push edi
push 0
call fcn.00407d26
call fcn.00408a54
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
jne 0x403bdb
push 2
pop eax
jmp 0x403c47
push edi
push esi
lea ecx, [ebp - 0x57c]
call fcn.00403728
lea ecx, [ebp - 0x57c]
call fcn.0040847d
test eax, eax
jne 0x403c08
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
call fcn.00407d31
push 3
pop esi
jmp 0x403c2f
call fcn.00407e5c
cmp dword [0x414bc4], 0
je 0x403c2d
lea ecx, [ebp - 0x57c]
call fcn.004039ef
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
call fcn.00407d31
xor esi, esi
lea ecx, [ebp - 0x534]
call fcn.00407b10
lea ecx, [ebp - 0x57c]
call fcn.00407e0a
mov eax, esi
pop edi
mov ecx, dword [ebp - 4]
pop esi
call fcn.004077b8
leave
ret 0x10
Function at 0x40568c
Capabilities:
Hide graphical window

Disassembly:
push 0
push dword [ecx + 0x6c]
call dword [sym.imp.USER32.dll_ShowWindow]
ret

Function at 0x405d58
Capabilities:
Hide graphical window

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ecx
push ebx
push esi
push edi
mov esi, ecx
push 0
push dword [esi + 0x6c]
call dword [sym.imp.USER32.dll_ShowWindow]
movsx eax, word [esi + 8]
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x10]
cdq
sub eax, edx
sar eax, 1
sub edi, eax
movsx eax, word [esi + 0xa]
cdq
sub eax, edx
sar eax, 1
sub ebx, eax
lea eax, [ebp - 8]
push eax
call dword [sym.imp.USER32.dll_GetCursorPos]
movsx eax, word [esi + 0xc]
mov dword [ebp + 0x10], eax
fild dword [ebp + 0x10]
fsqrt
call fcn.0040a090
mov ecx, eax
mov eax, edi
cdq
idiv ecx
mov edi, eax
mov eax, ebx
cdq
idiv ecx
add edi, dword [esi + 0x10]
add eax, dword [esi + 0x14]
push eax
push edi
mov edi, dword [sym.imp.USER32.dll_SetCursorPos]
call edi
mov ebx, dword [sym.imp.USER32.dll_mouse_event]
xor eax, eax
push eax
push eax
push eax
push eax
push 2
call ebx
xor eax, eax
push eax
push eax
push eax
push eax
push 4
call ebx
push dword [ebp - 4]
push dword [ebp - 8]
call edi
push 0x12c
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edi, dword [sym.imp.USER32.dll_GetDesktopWindow]
call edi
push eax
call dword [sym.imp.USER32.dll_GetDC]
mov ebx, eax
push ebx
mov ecx, esi
call fcn.00405c31
push 8
push dword [esi + 0x6c]
call dword [sym.imp.USER32.dll_ShowWindow]
push ebx
call edi
push eax
call dword [sym.imp.USER32.dll_ReleaseDC]
pop edi
pop esi
pop ebx
leave
ret 0xc

Function at 0x405e2b
Capabilities:
Hide graphical window

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ecx
push ebx
push esi
push edi
mov esi, ecx
push 0
push dword [esi + 0x6c]
call dword [sym.imp.USER32.dll_ShowWindow]
movsx eax, word [esi + 8]
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x10]
cdq
sub eax, edx
sar eax, 1
sub edi, eax
movsx eax, word [esi + 0xa]
cdq
sub eax, edx
sar eax, 1
sub ebx, eax
lea eax, [ebp - 8]
push eax
call dword [sym.imp.USER32.dll_GetCursorPos]
movsx eax, word [esi + 0xc]
mov dword [ebp + 0x10], eax
fild dword [ebp + 0x10]
fsqrt
call fcn.0040a090
mov ecx, eax
mov eax, edi
cdq
idiv ecx
mov edi, eax
mov eax, ebx
cdq
idiv ecx
add edi, dword [esi + 0x10]
add eax, dword [esi + 0x14]
push eax
push edi
mov edi, dword [sym.imp.USER32.dll_SetCursorPos]
call edi
mov ebx, dword [sym.imp.USER32.dll_mouse_event]
xor eax, eax
push eax
push eax
push eax
push eax
push 8
call ebx
xor eax, eax
push eax
push eax
push eax
push eax
push 0x10
call ebx
push dword [ebp - 4]
push dword [ebp - 8]
call edi
mov edi, dword [sym.imp.USER32.dll_GetDesktopWindow]
call edi
push eax
call dword [sym.imp.USER32.dll_GetDC]
mov ebx, eax
push ebx
mov ecx, esi
call fcn.00405c31
push 8
push dword [esi + 0x6c]
call dword [sym.imp.USER32.dll_ShowWindow]
push ebx
call edi
push eax
call dword [sym.imp.USER32.dll_ReleaseDC]
pop edi
pop esi
pop ebx
leave
ret 0xc
Function at 0x406260
Capabilities:
Delete registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, dword [ebp + 0xc]
cmp word [eax], 0
jne 0x406272
xor eax, eax
jmp 0x40629f
lea ecx, [ebp + 0xc]
push ecx
push eax
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
jne 0x40629f
push esi
push dword [ebp + 0x10]
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
push dword [ebp + 0xc]
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, esi
pop esi
pop ebp
ret 0xc

Function at 0x40665e
Capabilities:
Create thread
Persist via run registry key

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x118
mov eax, dword [0x4140f8]
push ebx
push esi
mov dword [ebp - 4], eax
push edi
mov esi, ecx
or dword [esi + 0x3c], 0xffffffff
lea eax, [ebp - 0x118]
xor edi, edi
push eax
mov dword [esi + 0x48], edi
mov dword [0x41542c], edi
mov dword [ebp - 0x118], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
xor ebx, ebx
inc ebx
test eax, eax
je 0x4066ba
mov eax, dword [ebp - 0x108]
cmp eax, 2
mov ecx, dword [ebp - 0x114]
mov dword [esi + 0x74], eax
mov dword [esi + 0x78], ecx
je 0x4066bd
mov dword [esi + 0x48], ebx
cmp dword [esi + 0x48], edi
jne 0x4066fc
push edi
push 0x40000000
push 3
push edi
push edi
push 0xc0000000
call fcn.00408a49
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esi + 0x3c], eax
jne 0x406700
push 0x401874
push 0x401818
push 0x80000002
call fcn.00406260
mov dword [esi + 0x48], ebx
xor eax, eax
jmp 0x406718
lea eax, [esi + 0x54]
push eax
push edi
push esi
push 0x406378
push edi
push edi
mov dword [esi + 0x5c], edi
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov eax, ebx
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.004077b8
leave
ret
Function at 0x409e5a
Capabilities:
Accept command line arguments
Parse pe header

Disassembly:
push 0x60
push 0x401fe0
call fcn.0040c640
mov edi, 0x94
mov eax, edi
call fcn.0040c7a0
mov dword [ebp - 0x18], esp
mov esi, esp
mov dword [esi], edi
push esi
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
mov ecx, dword [esi + 0x10]
mov dword [0x416d60], ecx
mov eax, dword [esi + 4]
mov dword [0x416d6c], eax
mov edx, dword [esi + 8]
mov dword [0x416d70], edx
mov esi, dword [esi + 0xc]
and esi, 0x7fff
mov dword [0x416d64], esi
cmp ecx, 2
je 0x409eba
or esi, 0x8000
mov dword [0x416d64], esi
shl eax, 8
add eax, edx
mov dword [0x416d68], eax
cmp word [0x400000], 0x5a4d
jne 0x409ef6
mov eax, dword [0x40003c]
lea eax, [eax + 0x400000]
cmp dword [eax], 0x4550
jne 0x409ef6
movzx ecx, word [eax + 0x18]
cmp ecx, 0x10b
je 0x409f0f
cmp ecx, 0x20b
je 0x409efc
and dword [ebp - 0x1c], 0
jmp 0x409f23
cmp dword [eax + 0x84], 0xe
jbe 0x409ef6
xor ecx, ecx
cmp dword [eax + 0xf8], ecx
jmp 0x409f1d
cmp dword [eax + 0x74], 0xe
jbe 0x409ef6
xor ecx, ecx
cmp dword [eax + 0xe8], ecx
setne cl
mov dword [ebp - 0x1c], ecx
push 0
call fcn.0040c5e2
pop ecx
test eax, eax
jne 0x409f50
cmp dword [0x416d48], 1
jne 0x409f3d
call fcn.0040bf6f
push 0x1c
call fcn.0040bd82
push 0xff
call fcn.0040a0e4
pop ecx
pop ecx
and dword [ebp - 4], 0
call fcn.0040b7be
test eax, eax
jge 0x409f65
push 0x1b
call fcn.00409e2b
pop ecx
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [0x418374], eax
call fcn.0040c496
mov dword [0x416d40], eax
call fcn.0040c3ed
test eax, eax
jge 0x409f8b
push 8
call fcn.00409e2b
pop ecx
call fcn.0040c193
test eax, eax
jge 0x409f9c
push 9
call fcn.00409e2b
pop ecx
call fcn.0040a13e
mov dword [ebp - 0x28], eax
test eax, eax
je 0x409faf
push eax
call fcn.00409e2b
pop ecx
and dword [ebp - 0x44], 0
lea eax, [ebp - 0x70]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
call fcn.0040c125
mov dword [ebp - 0x20], eax
test byte [ebp - 0x44], 1
je 0x409fd1
movzx eax, word [ebp - 0x40]
jmp 0x409fd4
push 0xa
pop eax
push eax
push dword [ebp - 0x20]
push 0
push 0x400000
call fcn.00403b60
mov esi, eax
mov dword [ebp - 0x2c], esi
cmp dword [ebp - 0x1c], 0
jne 0x409ff5
push esi
call fcn.0040a21e
call fcn.0040a256
jmp 0x40a027
or dword [ebp - 4], 0xffffffff
mov eax, esi
lea esp, [ebp - 0x7c]
call fcn.0040c67b
ret
Function at 0x40b96f
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x424
mov ecx, dword [ebp + 8]
cmp ecx, dword [0x417224]
mov eax, dword [0x4140f8]
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 4], eax
mov dword [ebp - 0x41c], edi
jae 0x40bb55
mov eax, ecx
sar eax, 5
lea ebx, [eax*4 + 0x417240]
mov eax, dword [ebx]
mov esi, ecx
and esi, 0x1f
shl esi, 3
mov al, byte [eax + esi + 4]
test al, 1
mov dword [ebp - 0x424], ebx
je 0x40bb55
and dword [ebp - 0x414], 0
and dword [ebp - 0x420], 0
cmp dword [ebp + 0x10], 0
jne 0x40b9e0
xor eax, eax
jmp 0x40bb69
test al, 0x20
je 0x40b9f3
push 2
push 0
push 0
push ecx
call fcn.0040f8ba
add esp, 0x10
mov eax, dword [ebx]
add eax, esi
test byte [eax + 4], 0x80
je 0x40bab3
and dword [ebp - 0x40c], 0
cmp dword [ebp + 0x10], 0
mov dword [ebp - 0x410], edi
jbe 0x40bb2f
mov ecx, dword [ebp - 0x410]
xor edi, edi
sub ecx, dword [ebp - 0x41c]
lea eax, [ebp - 0x408]
cmp ecx, dword [ebp + 0x10]
jae 0x40ba62
mov edx, dword [ebp - 0x410]
inc dword [ebp - 0x410]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x40ba50
inc dword [ebp - 0x420]
mov byte [eax], 0xd
inc eax
inc edi
mov ebx, dword [ebp - 0x424]
mov byte [eax], dl
inc eax
inc edi
cmp edi, 0x400
jl 0x40ba2c
mov edi, eax
lea eax, [ebp - 0x408]
sub edi, eax
push 0
lea eax, [ebp - 0x418]
push eax
push edi
lea eax, [ebp - 0x408]
push eax
mov eax, dword [ebx]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40bae1
mov eax, dword [ebp - 0x418]
add dword [ebp - 0x414], eax
cmp eax, edi
jl 0x40baed
mov eax, dword [ebp - 0x410]
sub eax, dword [ebp - 0x41c]
cmp eax, dword [ebp + 0x10]
jb 0x40ba18
jmp 0x40baed
push 0
lea ecx, [ebp - 0x418]
push ecx
push dword [ebp + 0x10]
push edi
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40bae1
mov eax, dword [ebp - 0x418]
and dword [ebp - 0x40c], 0
mov dword [ebp - 0x414], eax
jmp 0x40baed
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x40c], eax
mov eax, dword [ebp - 0x414]
test eax, eax
jne 0x40bb4d
cmp dword [ebp - 0x40c], eax
je 0x40bb29
push 5
pop eax
cmp dword [ebp - 0x40c], eax
jne 0x40bb1b
mov dword [0x416d54], 9
mov dword [0x416d58], eax
jmp 0x40bb66
push dword [ebp - 0x40c]
call fcn.0040f659
pop ecx
jmp 0x40bb66
mov edi, dword [ebp - 0x41c]
mov eax, dword [ebx]
test byte [eax + esi + 4], 0x40
je 0x40bb41
cmp byte [edi], 0x1a
je 0x40b9d9
mov dword [0x416d54], 0x1c
jmp 0x40bb5f
sub eax, dword [ebp - 0x420]
jmp 0x40bb69
mov dword [0x416d54], 9
and dword [0x416d58], 0
or eax, 0xffffffff
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.004077b8
leave
ret
Function at 0x40bb7b
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
mov esi, dword [ebp + 8]
cmp esi, dword [0x417224]
push edi
jae 0x40bd54
mov eax, esi
sar eax, 5
lea edi, [eax*4 + 0x417240]
mov eax, dword [edi]
and esi, 0x1f
shl esi, 3
add eax, esi
mov dl, byte [eax + 4]
test dl, 1
je 0x40bd54
and dword [ebp - 0xc], 0
cmp dword [ebp + 0x10], 0
mov ebx, dword [ebp + 0xc]
mov ecx, ebx
je 0x40bc28
test dl, 2
jne 0x40bc28
test dl, 0x48
je 0x40bbf2
cmp byte [eax + 5], 0xa
je 0x40bbf2
mov eax, dword [edi]
mov al, byte [eax + esi + 5]
dec dword [ebp + 0x10]
mov byte [ebx], al
mov eax, dword [edi]
lea ecx, [ebx + 1]
mov dword [ebp - 0xc], 1
mov byte [eax + esi + 5], 0xa
push 0
lea eax, [ebp - 0x10]
push eax
push dword [ebp + 0x10]
mov eax, dword [edi]
push ecx
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40bc3b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop ecx
cmp eax, ecx
jne 0x40bc23
mov dword [0x416d58], ecx
jmp 0x40bd5b
cmp eax, 0x6d
jne 0x40bc2f
xor eax, eax
jmp 0x40bd68
push eax
call fcn.0040f659
pop ecx
jmp 0x40bd65
mov eax, dword [ebp - 0x10]
mov ecx, dword [edi]
add dword [ebp - 0xc], eax
test byte [ecx + esi + 4], 0x80
je 0x40bd4f
test eax, eax
je 0x40bc62
cmp byte [ebx], 0xa
jne 0x40bc62
mov eax, ecx
lea eax, [eax + esi + 4]
or byte [eax], 4
jmp 0x40bc6b
mov eax, dword [edi]
lea eax, [eax + esi + 4]
and byte [eax], 0xfb
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0xc]
add ecx, eax
cmp eax, ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], ecx
jae 0x40bd49
mov eax, dword [ebp - 8]
mov al, byte [eax]
cmp al, 0x1a
je 0x40bd39
cmp al, 0xd
je 0x40bc9d
mov byte [ebx], al
inc ebx
inc dword [ebp - 8]
jmp 0x40bd2b
dec ecx
cmp dword [ebp - 8], ecx
jae 0x40bcb7
mov eax, dword [ebp - 8]
inc eax
cmp byte [eax], 0xa
jne 0x40bcb2
add dword [ebp - 8], 2
jmp 0x40bd0b
mov dword [ebp - 8], eax
jmp 0x40bd27
inc dword [ebp - 8]
push 0
lea eax, [ebp - 0x10]
push eax
push 1
lea eax, [ebp - 1]
push eax
mov eax, dword [edi]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40bcdf
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40bd27
cmp dword [ebp - 0x10], 0
je 0x40bd27
mov eax, dword [edi]
test byte [eax + esi + 4], 0x48
je 0x40bd00
mov al, byte [ebp - 1]
cmp al, 0xa
je 0x40bd0b
mov byte [ebx], 0xd
mov ecx, dword [edi]
mov byte [ecx + esi + 5], al
jmp 0x40bd2a
cmp ebx, dword [ebp + 0xc]
jne 0x40bd10
cmp byte [ebp - 1], 0xa
jne 0x40bd10
mov byte [ebx], 0xa
jmp 0x40bd2a
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.0040f8ba
add esp, 0x10
cmp byte [ebp - 1], 0xa
je 0x40bd2b
mov byte [ebx], 0xd
inc ebx
mov ecx, dword [ebp - 0xc]
cmp dword [ebp - 8], ecx
jb 0x40bc81
jmp 0x40bd49
mov eax, dword [edi]
test byte [eax + esi + 4], 0x40
jne 0x40bd49
lea esi, [eax + esi + 4]
or byte [esi], 2
sub ebx, dword [ebp + 0xc]
mov dword [ebp - 0xc], ebx
mov eax, dword [ebp - 0xc]
jmp 0x40bd68
and dword [0x416d58], 0
mov dword [0x416d54], 9
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret
Function at 0x40bd82
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x114
mov eax, dword [0x4140f8]
mov ecx, dword [ebp + 8]
push ebx
push esi
mov dword [ebp - 4], eax
push edi
xor eax, eax
cmp ecx, dword [eax*8 + 0x414458]
je 0x40bdac
inc eax
cmp eax, 0x12
jb 0x40bd9d
mov esi, eax
shl esi, 3
cmp ecx, dword [esi + 0x414458]
mov dword [ebp - 0x110], esi
jne 0x40bf57
mov eax, dword [0x416d48]
cmp eax, 1
je 0x40bf25
test eax, eax
jne 0x40bde2
cmp dword [0x41419c], 1
je 0x40bf25
cmp ecx, 0xfc
je 0x40bf57
push 0x104
lea eax, [ebp - 0x10c]
push eax
push 0
mov byte [ebp - 8], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x40be1d
push 5
pop ecx
mov esi, 0x40235c
lea edi, [ebp - 0x10c]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
lea ebx, [ebp - 0x10c]
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40be28
sub eax, edx
inc eax
cmp eax, 0x3c
jbe 0x40be60
lea eax, [ebp - 0x10c]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40be40
sub eax, edx
push 3
lea ebx, [ebp + eax - 0x147]
push 0x402358
push ebx
call fcn.0040fa60
add esp, 0xc
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40be65
sub eax, edx
mov ecx, eax
mov eax, dword [ebp - 0x110]
mov eax, dword [eax + 0x41445c]
lea esi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x40be7f
sub eax, esi
lea eax, [eax + ecx + 0x1c]
add eax, 3
and eax, 0xfffffffc
call fcn.0040c7a0
mov edx, esp
push 6
pop ecx
mov esi, 0x40233c
mov edi, edx
rep movsd dword es:[edi], dword [esi]
mov eax, ebx
movsw word es:[edi], word [esi]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40beab
mov edi, edx
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40beb7
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, edx
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40bed0
mov eax, dword [ebp - 0x110]
mov esi, 0x402338
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov eax, dword [eax + 0x41445c]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40beee
mov edi, edx
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40befa
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push 0x12010
mov ecx, eax
and ecx, 3
push 0x402310
push edx
rep movsb byte es:[edi], byte [esi]
call fcn.0040f960
add esp, 0xc
jmp 0x40bf57
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
test eax, eax
je 0x40bf57
mov esi, dword [esi + 0x41445c]
mov ecx, esi
lea edx, [ecx + 1]
mov bl, byte [ecx]
inc ecx
test bl, bl
jne 0x40bf3c
push 0
sub ecx, edx
lea edx, [ebp - 0x114]
push edx
push ecx
push esi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea esp, [ebp - 0x120]
mov ecx, dword [ebp - 4]
call fcn.004077b8
pop edi
pop esi
pop ebx
leave
ret