joyce8/EMBER2024-capa huggingface dataset:
Function at 0x40ece0
Capabilities:
Write file on windows

Disassembly:
mov edx, dword [esp + 4]
sub esp, 0x418
cmp dword [0x4189b4], edx
push ebx
push esi
push edi
push ebp
jbe 0x40eee7
mov eax, edx
and eax, 0xffffffe7
sar eax, 3
add eax, 0x4189c0
mov dword [esp + 0x18], eax
mov eax, edx
and eax, 0x1f
mov ecx, dword [esp + 0x18]
shl eax, 3
mov ebx, dword [ecx]
mov ebp, eax
mov dword [esp + 0x1c], eax
mov al, byte [ebx + ebp + 4]
test al, 1
je 0x40eee7
xor esi, esi
mov ebp, dword [esp + 0x434]
mov dword [esp + 0x20], esi
cmp ebp, esi
jne 0x40ed49
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x418
ret
test al, 0x20
je 0x40ed5a
push 2
push 0
push edx
call fcn.0040cb50
add esp, 0xc
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
add ecx, dword [eax]
test byte [ecx + 4], 0x80
je 0x40edf6
mov dword [esp + 0x10], 0
mov edi, dword [esp + 0x430]
mov eax, edi
sub eax, dword [esp + 0x430]
cmp eax, ebp
jae 0x40ee2f
lea ebx, [esp + 0x24]
mov eax, edi
sub eax, dword [esp + 0x430]
cmp eax, ebp
jae 0x40edbd
mov al, byte [edi]
inc edi
cmp al, 0xa
jne 0x40edab
mov byte [ebx], 0xd
inc esi
inc ebx
mov byte [ebx], al
inc ebx
mov eax, ebx
lea ecx, [esp + 0x24]
sub eax, ecx
cmp eax, 0x400
jl 0x40ed92
lea eax, [esp + 0x24]
push 0
sub ebx, eax
lea ecx, [esp + 0x28]
lea eax, [esp + 0x18]
mov edx, dword [esp + 0x1c]
push eax
push ebx
push ecx
mov eax, dword [edx]
mov ecx, dword [esp + 0x2c]
mov edx, dword [eax + ecx]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40ee25
mov eax, dword [esp + 0x14]
add dword [esp + 0x20], eax
cmp eax, ebx
jge 0x40ed7d
jmp 0x40ee2f
lea eax, [esp + 0x14]
push 0
mov edx, dword [esp + 0x434]
push eax
push ebp
mov ecx, dword [ecx]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40ee25
mov dword [esp + 0x10], 0
mov eax, dword [esp + 0x14]
mov dword [esp + 0x20], eax
jmp 0x40ee2f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x10], eax
cmp dword [esp + 0x20], 0
jne 0x40eed6
cmp dword [esp + 0x10], 0
je 0x40ee88
cmp dword [esp + 0x10], 5
jne 0x40ee6b
mov dword [0x415168], 9
mov eax, dword [esp + 0x10]
pop ebp
pop edi
mov dword [0x41516c], eax
mov eax, 0xffffffff
pop esi
pop ebx
add esp, 0x418
ret
mov eax, dword [esp + 0x10]
push eax
call fcn.0040ebe0
add esp, 4
mov eax, 0xffffffff
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x418
ret
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov edx, dword [eax]
test byte [edx + ecx + 4], 0x40
je 0x40eeb2
mov eax, dword [esp + 0x430]
cmp byte [eax], 0x1a
jne 0x40eeb2
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x418
ret
mov eax, 0xffffffff
pop ebp
mov dword [0x415168], 0x1c
mov dword [0x41516c], 0
pop edi
pop esi
pop ebx
add esp, 0x418
ret
mov eax, dword [esp + 0x20]
pop ebp
sub eax, esi
pop edi
pop esi
pop ebx
add esp, 0x418
ret
mov eax, 0xffffffff
pop ebp
mov dword [0x415168], 9
mov dword [0x41516c], 0
pop edi
pop esi
pop ebx
add esp, 0x418
ret
Function at 0x40f1e0
Capabilities:
Clear file content

Disassembly:
mov eax, 0x1004
call fcn.0040c6b0
push ebx
push esi
push edi
xor ebx, ebx
mov esi, dword [esp + 0x1014]
push ebp
cmp dword [0x4189b4], esi
jbe 0x40f32d
mov eax, esi
mov ecx, esi
and eax, 0xffffffe7
and ecx, 0x1f
sar eax, 3
mov edx, dword [eax + 0x4189c0]
test byte [edx + ecx*8 + 4], 1
je 0x40f32d
push 1
push ebx
push esi
call fcn.0040cb50
mov dword [esp + 0x1c], eax
add esp, 0xc
cmp eax, 0xffffffff
je 0x40f31d
push 2
push ebx
push esi
call fcn.0040cb50
add esp, 0xc
cmp eax, 0xffffffff
je 0x40f31d
mov ecx, dword [esp + 0x101c]
mov ebp, ecx
sub ebp, eax
test ebp, ebp
jle 0x40f2c3
lea edi, [esp + 0x14]
xor eax, eax
mov ecx, 0x400
push 0x8000
rep stosd dword es:[edi], eax
push esi
call fcn.00410c40
add esp, 8
mov edi, eax
mov eax, 0x1000
cmp ebp, eax
jge 0x40f286
mov eax, ebp
push eax
lea eax, [esp + 0x18]
push eax
push esi
call fcn.0040ece0
add esp, 0xc
cmp eax, 0xffffffff
je 0x40f2a2
sub ebp, eax
test ebp, ebp
jg 0x40f27b
jmp 0x40f2b7
cmp dword [0x41516c], 5
jne 0x40f2b5
mov dword [0x415168], 0xd
mov ebx, eax
push edi
push esi
call fcn.00410c40
add esp, 8
jmp 0x40f300
jge 0x40f300
push 0
push ecx
push esi
call fcn.0040cb50
add esp, 0xc
push esi
call fcn.0040d710
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
cmp eax, 1
sbb ebx, ebx
cmp ebx, 0xffffffff
jne 0x40f300
mov dword [0x415168], 0xd
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x41516c], eax
mov eax, dword [esp + 0x10]
push 0
push eax
push esi
call fcn.0040cb50
add esp, 0xc
mov eax, ebx
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x1004
ret
mov eax, 0xffffffff
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x1004
ret
mov eax, 0xffffffff
pop ebp
mov dword [0x415168], 9
pop edi
pop esi
pop ebx
add esp, 0x1004
ret
Function at 0x40fc60
Capabilities:
Query environment variable

Disassembly:
sub esp, 4
cmp dword [0x415680], 0
push ebx
push esi
push edi
push ebp
jne 0x40fcb0
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
call esi
mov edi, eax
test edi, edi
je 0x40fc8e
mov dword [0x415680], 1
mov ebx, dword [esp + 0x10]
jmp 0x40fcbe
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov ebx, eax
test ebx, ebx
je 0x40fca6
mov dword [0x415680], 2
jmp 0x40fcbe
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
cmp dword [0x415680], 1
jne 0x40fd6d
test edi, edi
jne 0x40fce1
call esi
mov edi, eax
test edi, edi
jne 0x40fce1
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
cmp word [edi], 0
mov esi, edi
je 0x40fcfb
add esi, 2
cmp word [esi], 0
jne 0x40fce9
add esi, 2
cmp word [esi], 0
jne 0x40fce9
sub esi, edi
push 0
sar esi, 1
push 0
inc esi
push 0
push 0
push esi
push edi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ebp, eax
test ebp, ebp
je 0x40fd5c
push ebp
call fcn.0040c840
add esp, 4
mov ebx, eax
test ebx, ebx
je 0x40fd5c
push 0
push 0
push ebp
push ebx
push esi
push edi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
jne 0x40fd4b
push ebx
call fcn.0040c8c0
add esp, 4
xor ebx, ebx
push edi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, ebx
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
push edi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
cmp dword [0x415680], 2
jne 0x40fdf1
test ebx, ebx
jne 0x40fd90
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov ebx, eax
test ebx, ebx
jne 0x40fd90
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov ebp, ebx
cmp byte [ebx], 0
je 0x40fda5
inc ebp
cmp byte [ebp], 0
jne 0x40fd97
inc ebp
cmp byte [ebp], 0
jne 0x40fd97
sub ebp, ebx
inc ebp
push ebp
call fcn.0040c840
mov dword [esp + 0x14], eax
add esp, 4
test eax, eax
jne 0x40fdca
push ebx
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
mov edi, dword [esp + 0x10]
mov esi, ebx
mov ecx, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsA]
mov eax, dword [esp + 0x10]
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 4
ret
Function at 0x4101f0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x1a8
xor eax, eax
mov ecx, 0x415b08
push ebx
mov edx, dword [esp + 0x1b0]
push esi
push edi
push ebp
cmp dword [ecx], edx
je 0x410218
add ecx, 8
inc eax
cmp ecx, 0x415b90
jb 0x410208
cmp dword [eax*8 + 0x415b08], edx
lea ebx, [eax*8]
jne 0x4103d3
cmp dword [0x4151bc], 1
je 0x410398
cmp dword [0x4151bc], 0
jne 0x41024f
cmp dword [0x4151c0], 1
je 0x410398
cmp edx, 0xfc
je 0x4103d3
lea eax, [esp + 0xb4]
push 0x104
push eax
mov ebp, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0
call ebp
test eax, eax
jne 0x41028c
mov esi, str._program_name_unknown_
lea edi, [esp + 0xb4]
mov ecx, 5
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
lea ebp, [esp + 0xb4]
lea edi, [esp + 0xb4]
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
cmp ecx, 0x3c
jbe 0x4102d0
lea edi, [esp + 0xb4]
mov ecx, 0xffffffff
sub eax, eax
push 3
repne scasb al, byte es:[edi]
not ecx
lea ebp, [esp + ecx + 0x7c]
push 0x415bdc
push ebp
call fcn.0040c6e0
add esp, 0xc
mov esi, str.Runtime_Error__n_nProgram:
lea edi, [esp + 0x14]
mov ecx, 6
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov edi, ebp
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov ecx, 0xffffffff
lea edi, [esp + 0x14]
sub eax, eax
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x415bbc
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov ecx, 0xffffffff
lea edi, [esp + 0x14]
sub eax, eax
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebx + 0x415b0c]
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edx, ecx
lea edi, [esp + 0x14]
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push 0x12010
and ecx, 3
push str.Microsoft_Visual_C_Runtime_Library
rep movsb byte es:[edi], byte [esi]
lea eax, [esp + 0x1c]
push eax
call fcn.00411310
add esp, 0xc
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x1a8
ret
mov eax, dword [0x4189c0]
mov esi, dword [eax + 0x10]
cmp esi, 0xffffffff
jne 0x4103af
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov esi, eax
mov edx, dword [ebx + 0x415b0c]
push 0
lea eax, [esp + 0x14]
mov edi, edx
push eax
mov ecx, 0xffffffff
sub eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x1a8
ret
Function at 0x411800
Capabilities:
Check if file exists
Get file attributes

Disassembly:
mov eax, dword [esp + 4]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x411825
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0040ebe0
add esp, 4
mov eax, 0xffffffff
ret
test al, 1
je 0x41184a
test byte [esp + 8], 2
je 0x41184a
mov dword [0x415168], 0xd
mov dword [0x41516c], 5
mov eax, 0xffffffff
ret
xor eax, eax
ret
Function at 0x401280
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push ebx
mov ebx, dword [esp + 8]
push edi
mov edi, dword [esp + 0x10]
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
test eax, eax
jne 0x401299
pop edi
pop ebx
ret
push esi
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov esi, eax
test esi, esi
jne 0x4012ad
pop esi
pop edi
xor eax, eax
pop ebx
ret
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ecx, dword [esp + 0x18]
add eax, esi
and ecx, 0xf
jbe 0x4012ce
cmp esi, eax
jae 0x4012a7
dec ecx
movzx edx, word [esi]
lea esi, [esi + edx*2 + 2]
jne 0x4012c0
cmp esi, eax
jae 0x4012a7
mov ax, word [esi]
neg ax
sbb eax, eax
and eax, esi
pop esi
pop edi
pop ebx
ret

Function at 0x402090
Capabilities:
Encode data using xor
Hash data with crc32

Disassembly:
mov edx, dword [esp + 8]
or eax, 0xffffffff
test edx, edx
je 0x4020c0
mov ecx, dword [esp + 4]
push esi
push edi
movzx edi, byte [ecx]
mov esi, eax
and esi, 0xff
xor esi, edi
mov edi, dword [esi*4 + 0x44e0e8]
shr eax, 8
xor eax, edi
inc ecx
dec edx
jne 0x4020a1
pop edi
pop esi
not eax
ret

Function at 0x402940
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x43b530
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
push ebx
push esi
mov esi, dword [esp + 0x2c]
xor ebx, ebx
push ebx
push esi
lea ecx, [esp + 0x14]
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x10], ebx
call fcn.00432efe
push ebx
push ebx
push 4
lea ecx, [esp + 0x18]
mov byte [esp + 0x30], 1
call fcn.00432871
push 4
lea eax, [esp + 0xc]
push eax
lea ecx, [esp + 0x14]
call fcn.004327e6
mov eax, dword [esp + 8]
xor ecx, ecx
cmp eax, 0xaa550130
sete cl
xor edx, edx
cmp eax, 0xaa552161
sete dl
or ecx, edx
je 0x402a0c
lea ecx, [esp + 0xc]
call fcn.004329cb
cmp edx, ebx
ja 0x4029c5
cmp eax, 0x10000
jbe 0x402a0c
lea ecx, [esp + 0xc]
mov byte [esp + 0x24], bl
call fcn.00432b12
lea eax, [esi - 0x10]
mov dword [esp + 0x24], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4029f4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
pop esi
mov eax, 1
pop ebx
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
add esp, 0x20
ret 4
lea ecx, [esp + 0xc]
mov byte [esp + 0x24], bl
call fcn.00432b12
lea eax, [esi - 0x10]
mov dword [esp + 0x24], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402a3b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov ecx, dword [esp + 0x1c]
pop esi
xor eax, eax
pop ebx
mov dword fs:[0], ecx
add esp, 0x20
ret 4
Function at 0x402e30
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x43b568
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push esi
mov esi, dword [esp + 0x1c]
mov eax, dword [esi]
mov ecx, dword [eax - 0x10]
mov edx, dword [ecx]
push edi
xor edi, edi
mov dword [esp + 8], edi
call dword [edx + 0x10]
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x24]
mov eax, dword [eax]
mov edx, dword [eax - 0xc]
mov ecx, dword [esi]
mov esi, dword [ecx - 0xc]
push edx
push eax
push esi
push ecx
lea ecx, [esp + 0x30]
push ecx
mov dword [esp + 0x28], edi
call fcn.00402d10
mov esi, dword [esp + 0x34]
add esi, 0xfffffff0
push esi
call fcn.004028a0
mov edi, dword [esp + 0x34]
add eax, 0x10
mov dword [edi], eax
add esp, 0x18
mov dword [esp + 0x14], 0xffffffff
lea edx, [esi + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x402ec2
mov ecx, dword [esi]
mov edx, dword [ecx]
push esi
call dword [edx + 4]
mov ecx, dword [esp + 0xc]
mov eax, edi
pop edi
pop esi
mov dword fs:[0], ecx
add esp, 0x10
ret
Function at 0x403070
Capabilities:
Read .ini file

Disassembly:
push 0xffffffffffffffff
push 0x43b5ab
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x10c
mov eax, dword [0x459c10]
push ebp
push esi
push edi
mov dword [esp + 0x114], eax
mov esi, ecx
call fcn.004319e4
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [esp + 0xc], eax
mov eax, dword [esi + 0x5dc]
push eax
xor ebp, ebp
push ebp
push str.SegNumber
push str.Main
mov dword [esp + 0x130], ebp
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
mov edi, eax
imul eax, eax, 0x108
push eax
mov dword [esp + 0x14], edi
call fcn.00431c37
add esp, 4
cmp edi, ebp
mov dword [esi + 0x5e0], eax
jbe 0x4031e1
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
xor edi, edi
lea esp, [esp]
push ebp
lea ecx, [esp + 0x14]
push str.Seg_d
push ecx
call fcn.00402e10
mov eax, dword [esi + 0x5dc]
mov edx, dword [esi + 0x5e0]
add esp, 0xc
push eax
mov eax, dword [esp + 0x14]
push 0xff
add edx, edi
push edx
push 0x43f12e
push eax
push str.Main
call ebx
mov eax, dword [esi + 0x5dc]
mov edx, dword [esi + 0x5e0]
push eax
push 0xff
lea ecx, [esp + 0x20]
push ecx
push 0x43f12e
push str.StartAddr
add edx, edi
push edx
call ebx
push 0x10
lea eax, [esp + 0x1c]
push 0
push eax
mov byte [esp + 0x25], 0x30
call fcn.0041ce39
mov ecx, dword [esi + 0x5e0]
add esp, 0xc
mov dword [ecx + edi + 0x100], eax
mov eax, dword [esi + 0x5dc]
push eax
mov eax, dword [esi + 0x5e0]
push 0xff
lea edx, [esp + 0x20]
push edx
push 0x43f12e
push str.SegSize
add eax, edi
push eax
call ebx
push 0x10
lea ecx, [esp + 0x1c]
push 0
push ecx
mov byte [esp + 0x25], 0x30
call fcn.0041ce39
mov edx, dword [esi + 0x5e0]
add esp, 0xc
mov dword [edx + edi + 0x104], eax
mov eax, dword [esp + 0x14]
inc ebp
add edi, 0x108
cmp ebp, eax
jb 0x403100
mov edi, eax
pop ebx
mov eax, dword [esp + 0xc]
add eax, 0xfffffff0
mov dword [esp + 0x120], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40320a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov ecx, dword [esp + 0x118]
mov eax, edi
pop edi
pop esi
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x10c]
pop ebp
call fcn.0041c5be
add esp, 0x118
ret
Function at 0x406643
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x14
push esi
mov esi, ecx
cmp dword [esi + 8], 0xffffffff
je 0x406678
mov edx, dword [esi + 8]
lea eax, [esp + 0xc]
push eax
lea ecx, [esp + 0xc]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x406681
mov eax, dword [esp + 8]
test eax, eax
jbe 0x406681
mov eax, dword [esi + 8]
push 0xa
push eax
call dword [sym.imp.KERNEL32.dll_PurgeComm]
xor eax, eax
pop esi
add esp, 0x14
ret 0xc
mov ecx, dword [esp + 0x10]
test ecx, ecx
je 0x406678
mov eax, dword [esp + 0x20]
cmp eax, ecx
mov dword [esp + 4], 0
jbe 0x40669b
mov eax, ecx
mov edx, dword [esp + 0x1c]
push ebx
push edi
lea edi, [esi + 0x54]
push edi
lea ecx, [esp + 0x10]
push ecx
push eax
mov eax, dword [esi + 8]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x406702
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0x3e5
jne 0x4066f7
mov ecx, dword [esp + 0x2c]
mov edx, dword [esi + 0x64]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [esi + 8]
push 0
lea eax, [esp + 0x10]
push eax
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x406702
call ebx
cmp eax, 0x3e4
je 0x406702
pop edi
pop ebx
xor eax, eax
pop esi
add esp, 0x14
ret 0xc
mov eax, dword [esp + 0xc]
pop edi
pop ebx
pop esi
add esp, 0x14
ret 0xc

Function at 0x406710
Capabilities:
Write file on windows

Disassembly:
sub esp, 8
push esi
mov esi, ecx
cmp dword [esi + 8], 0xffffffff
je 0x40677b
mov ecx, dword [esi + 8]
push 0
lea eax, [esp + 0xc]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_ClearCommError]
test eax, eax
je 0x406745
mov eax, dword [esp + 8]
test eax, eax
jbe 0x406745
mov edx, dword [esi + 8]
push 5
push edx
call dword [sym.imp.KERNEL32.dll_PurgeComm]
mov edx, dword [esp + 0x14]
lea eax, [esi + 0x68]
push eax
mov eax, dword [esp + 0x14]
lea ecx, [esp + 8]
push ecx
mov ecx, dword [esi + 8]
push edx
push eax
push ecx
mov dword [esp + 0x18], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x406784
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x406784
xor eax, eax
pop esi
add esp, 8
ret 8
mov eax, dword [esp + 4]
pop esi
add esp, 8
ret 8

Function at 0x406790
Capabilities:
Terminate thread

Disassembly:
push esi
mov esi, ecx
mov eax, dword [esi + 0x7c]
test eax, eax
je 0x406801
mov byte [esi + 0x90], 0
mov eax, dword [esi + 8]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetCommMask]
mov ecx, dword [esi + 0xa4]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [esp + 8]
mov eax, dword [esi + 0x7c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x4067dd
mov ecx, dword [esi + 0x7c]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_TerminateThread]
test eax, eax
je 0x406801
mov edx, dword [esi + 0x7c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0xa4]
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov dword [esi + 0x7c], 0
mov al, 1
pop esi
ret 4
xor al, al
pop esi
ret 4
Function at 0x4080e0
Capabilities:
Delete directory
Delete file

Disassembly:
push 0xffffffffffffffff
push 0x43bd76
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x344
mov eax, dword [0x459c10]
push ebp
mov ebp, ecx
push edi
lea ecx, [esp + 0x10]
mov dword [esp + 0x348], eax
call fcn.00413d99
mov edi, dword [esp + 0x35c]
push edi
lea eax, [esp + 0x1bc]
push str._s.
push eax
mov dword [esp + 0x360], 0
call fcn.0041d195
add esp, 0xc
push 0
lea ecx, [esp + 0x1bc]
push ecx
lea ecx, [esp + 0x18]
call fcn.00413e2c
test eax, eax
je 0x40825a
push esi
jmp 0x408160
lea ecx, [esp + 0x14]
call fcn.00413b7a
lea ecx, [esp + 0x14]
mov dword [esp + 0xc], eax
call fcn.00413d60
test eax, eax
jne 0x40824d
lea edx, [esp + 0x10]
push edx
lea ecx, [esp + 0x18]
call fcn.00414054
mov esi, eax
mov eax, dword [esi]
mov edx, dword [eax - 4]
sub eax, 0x10
mov eax, dword [eax + 8]
mov ecx, 1
sub ecx, edx
sub eax, 0xc8
or eax, ecx
mov byte [esp + 0x358], 1
jge 0x4081bd
push 0xc8
mov ecx, esi
call fcn.00401630
mov ecx, dword [esi]
lea edx, [esp + 0x2c]
mov al, byte [ecx]
inc ecx
mov byte [edx], al
inc edx
test al, al
jne 0x4081c3
mov byte [esp + 0x358], al
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4081f2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, dword [esp + 0x14]
push 0x10
lea ecx, [esp + 0x18]
call dword [eax + 0x38]
test eax, eax
lea ecx, [esp + 0x2c]
push ecx
push edi
push str._s_s
je 0x40822f
lea edx, [esp + 0x100]
push edx
call fcn.0041d195
add esp, 0x10
lea eax, [esp + 0xf4]
push eax
mov ecx, ebp
call fcn.004080e0
jmp 0x40824d
lea edx, [esp + 0x290]
push edx
call fcn.0041d195
add esp, 0x10
lea eax, [esp + 0x284]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov eax, dword [esp + 0xc]
test eax, eax
jne 0x408160
pop esi
lea ecx, [esp + 0x10]
call fcn.00413aaa
push edi
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
test eax, eax
pop edi
pop ebp
lea ecx, [esp + 8]
mov dword [esp + 0x34c], 0xffffffff
jne 0x408288
call fcn.00413dbd
xor eax, eax
jmp 0x408292
call fcn.00413dbd
mov eax, 1
mov ecx, dword [esp + 0x344]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x340]
call fcn.0041c5be
add esp, 0x350
ret 4