joyce8/EMBER2024-capa huggingface dataset:
Function at 0x449280
Capabilities:
Encode data using add xor sub operations
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
fldz
mov edx, dword [0x7b13a4]
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
lea ecx, [eax + eax*2]
mov dword [ebp - 0x14], edx
xor esi, esi
mov dword [ebp - 0x10], ecx
fst dword [ebx + 8]
fst dword [ebx + 4]
fst dword [ebx]
mov eax, dword [edx + ecx*8 + 8]
mov dword [ebp + 8], esi
mov dword [ebp + 0xc], eax
fst dword [ebp - 4]
fst dword [ebp - 8]
fstp dword [ebp - 0xc]
test eax, eax
jle 0x4493b4
push edi
mov ecx, dword [edx + ecx*8 + 0xc]
mov eax, dword [0x7b139c]
add ecx, esi
mov esi, dword [0x7b1394]
mov eax, dword [eax + ecx*4]
cdq
mov edi, eax
xor edi, edx
sub edi, edx
mov ecx, dword [esi + edi*8]
lea edx, [ecx + ecx*2]
mov ecx, dword [0x7b1384]
fld dword [ecx + edx*4]
fadd dword [ebx]
mov edx, dword [ebp - 0x14]
fstp dword [ebp + 0xc]
fld dword [ebp + 0xc]
fst dword [ebx]
mov eax, dword [esi + edi*8]
lea ecx, [eax + eax*2]
mov eax, dword [0x7b1384]
fld dword [eax + ecx*4 + 4]
fadd dword [ebx + 4]
fstp dword [ebp + 0xc]
fld dword [ebp + 0xc]
fst dword [ebx + 4]
mov eax, dword [esi + edi*8]
lea ecx, [eax + eax*2]
mov eax, dword [0x7b1384]
fld dword [eax + ecx*4 + 8]
fadd dword [ebx + 8]
fstp dword [ebp + 0xc]
fld dword [ebp + 0xc]
fst dword [ebx + 8]
mov eax, dword [esi + edi*8 + 4]
lea ecx, [eax + eax*2]
mov eax, dword [0x7b1384]
fld dword [eax + ecx*4]
faddp st(3)
fxch st(2)
fstp dword [ebp + 0xc]
fld dword [ebp + 0xc]
fst dword [ebp - 0xc]
fstp dword [ebx]
mov eax, dword [esi + edi*8 + 4]
lea ecx, [eax + eax*2]
mov eax, dword [0x7b1384]
fadd dword [eax + ecx*4 + 4]
fstp dword [ebp + 0xc]
fld dword [ebp + 0xc]
fst dword [ebp - 8]
fstp dword [ebx + 4]
mov eax, dword [esi + edi*8 + 4]
mov esi, dword [ebp + 8]
inc esi
mov dword [ebp + 8], esi
lea ecx, [eax + eax*2]
mov eax, dword [0x7b1384]
fadd dword [eax + ecx*4 + 8]
mov ecx, dword [ebp - 0x10]
fstp dword [ebp + 0xc]
fld dword [ebp + 0xc]
fst dword [ebp - 0x18]
fstp dword [ebx + 8]
mov eax, dword [edx + ecx*8 + 8]
cmp esi, eax
jl 0x4492c5
fld dword [ebp - 0xc]
fstp dword [ebp - 4]
fld dword [ebp - 8]
fstp dword [ebp - 8]
fld dword [ebp - 0x18]
fstp dword [ebp - 0xc]
mov dword [ebp + 0xc], eax
pop edi
fild dword [ebp + 0xc]
pop esi
fstp qword [ebp - 0x1c]
fld qword [ebp - 0x1c]
fdivr qword [0x48bab8]
fstp dword [ebp + 8]
fld dword [ebp + 8]
fld dword [ebp - 4]
fmul st(1)
fstp dword [ebx]
fld dword [ebp - 8]
fmul st(1)
fstp dword [ebx + 4]
fmul dword [ebp - 0xc]
fstp dword [ebx + 8]
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x480d8f
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
pop ebp
jmp fcn.00480c0e

Function at 0x4855dd
Capabilities:
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
pop ebp
jmp fcn.0048529d
Function at 0x40aed0
Capabilities:
Hash data using sha256

Disassembly:
sub esp, 0x80
push ebx
mov ebx, ecx
mov ecx, dword [ebx]
cmp ecx, 0x3f
jne 0x40af4d
xor eax, eax
cmp dword [ebx + 4], eax
jbe 0x40af00
jmp 0x40aef0
mov cl, byte [ebx + eax + 8]
mov byte [ebx + eax + 0x24], cl
add eax, 1
cmp eax, dword [ebx + 4]
jb 0x40aef0
xor ecx, ecx
cmp dword [ebx + 0x1c], ecx
jbe 0x40af25
cmp eax, 0x20
jae 0x40b0a3
mov edx, dword [ebx + 0x20]
mov dl, byte [ecx + edx]
mov byte [eax + ebx + 0x24], dl
add ecx, 1
add eax, 1
cmp ecx, dword [ebx + 0x1c]
jb 0x40af07
cmp eax, 0x20
jae 0x40b0a3
mov ecx, 0x20
sub ecx, eax
push ecx
lea ebx, [eax + ebx + 0x24]
push 0
push ebx
call sub.MSVCRT.dll_memset
add esp, 0xc
pop ebx
add esp, 0x80
ret
push esi
xor esi, esi
lea eax, [esi + 1]
xor edx, edx
mov dword [esp + 0x20], 0x6a09e667
mov dword [esp + 0x24], 0xbb67ae85
mov dword [esp + 0x28], 0x3c6ef372
mov dword [esp + 0x2c], 0xa54ff53a
mov dword [esp + 0x30], 0x510e527f
mov dword [esp + 0x34], 0x9b05688c
mov dword [esp + 0x38], 0x1f83d9ab
mov dword [esp + 0x3c], 0x5be0cd19
mov dword [esp + 0x40], esi
mov dword [esp + 0x44], esi
call fcn.004193c0
cmp edx, esi
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edx
mov byte [esp + 8], 0
mov byte [esp + 9], 0
mov byte [esp + 0xa], 0
mov byte [esp + 0xb], 0
mov byte [esp + 0xc], 0
mov byte [esp + 0xd], 0
mov byte [esp + 0xe], 0
mov byte [esp + 0xf], 0
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], esi
jb 0x40b091
ja 0x40afec
cmp eax, esi
jbe 0x40b091
push ebp
push edi
mov edi, edi
mov eax, dword [ebx + 4]
push eax
lea eax, [ebx + 8]
push eax
lea edx, [esp + 0x30]
push edx
call fcn.0040abc0
mov eax, dword [ebx + 0x1c]
push eax
mov eax, dword [ebx + 0x20]
push eax
lea eax, [esp + 0x3c]
push eax
call fcn.0040abc0
mov esi, dword [esp + 0x60]
add esp, 0x18
mov ebp, 8
lea edi, [esp + 0x10]
and esi, 0x3f
mov cl, byte [edi]
mov byte [esp + esi + 0x50], cl
add esi, 1
add edi, 1
add dword [esp + 0x48], 1
adc dword [esp + 0x4c], 0
sub ebp, 1
cmp esi, 0x40
jne 0x40b050
lea edx, [esp + 0x28]
xor esi, esi
call fcn.0040ab00
test ebp, ebp
ja 0x40b027
xor eax, eax
add byte [esp + eax + 0x10], 1
jne 0x40b065
add eax, 1
cmp eax, 8
jl 0x40b056
add dword [esp + 0x18], 1
mov eax, dword [esp + 0x1c]
adc eax, 0
cmp eax, dword [esp + 0x24]
mov dword [esp + 0x1c], eax
jb 0x40aff0
ja 0x40b08f
mov edx, dword [esp + 0x20]
cmp dword [esp + 0x18], edx
jb 0x40aff0
pop edi
pop ebp
add ebx, 0x24
lea eax, [esp + 0x20]
push ebx
push eax
call fcn.0040ac10
add esp, 8
pop esi
pop ebx
add esp, 0x80
ret
Function at 0x411020
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sbb al, 0x18
je 0x411026
xchg esi, eax
lodsd eax, dword [esi]
mov eax, dword [eax + 8]
push eax
call fcn.0040ee62
sbb eax, 0x8bb2d674
clc
mov eax, dword [edi + 0x3c]
mov edx, dword [edi + eax + 0x78]
add edx, edi
mov ecx, dword [edx + 0x18]
mov ebx, dword [edx + 0x20]
add ebx, edi
call fcn.0040ee62
adc al, 0xbe
mov edx, dword [esi + 0x49]
dec ecx
mov esi, dword [ebx + ecx*4]
add esi, edi
mov eax, 0x50746547
cmp dword [esi], eax
jne 0x41104f
mov eax, 0x41636f72
cmp dword [esi + 4], eax
jne 0x41104f
call fcn.0040ee62
fucomp st(6)
fild word [ebx + ecx*4 - 0x20fcdba6]
mov cx, word [ebx + ecx*2]
mov ebx, dword [edx + 0x1c]
add ebx, edi
mov eax, dword [ebx + ecx*4]
add eax, edi
push eax
call fcn.0040ee62
ret

Function at 0x4122aa
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
push ecx
push esi
lea eax, [ebp - 4]
push eax
push dword [ecx]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4122d0
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4122d0
xor al, al
jmp 0x4122f0
push 1
push 0
push 0
push dword [ebp - 4]
call fcn.00419380
mov ecx, eax
xor eax, eax
add ecx, esi
adc edx, eax
mov eax, dword [ebp + 8]
mov dword [eax], ecx
mov dword [eax + 4], edx
mov al, 1
pop esi
leave
ret 4
Function at 0x401030
Capabilities:
Create process on windows
Get comspec environment variable
Query environment variable
Resume thread
Self delete

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x360
push ebx
push esi
push edi
lea eax, [ebp - 0x25c]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameA]
test eax, eax
je 0x40119c
lea ecx, [ebp - 0x25c]
push 0x104
lea edx, [ebp - 0x25c]
push ecx
push edx
call dword [sym.imp.KERNEL32.DLL_GetShortPathNameA]
test eax, eax
je 0x40119c
lea eax, [ebp - 0x360]
push 0x104
push eax
push str.COMSPEC
call dword [sym.imp.KERNEL32.DLL_GetEnvironmentVariableA]
test eax, eax
je 0x40119c
pushal
popal
lea ecx, [ebp - 0x158]
push str.__c__del
push ecx
call dword [sym.imp.KERNEL32.DLL_lstrcpyA]
pushal
popal
lea edx, [ebp - 0x25c]
lea eax, [ebp - 0x158]
push edx
push eax
call dword [sym.imp.KERNEL32.DLL_lstrcatA]
pushal
popal
mov esi, dword [sym.imp.KERNEL32.DLL_lstrcatA]
lea ecx, [ebp - 0x158]
push str.___nul
push ecx
call esi
lea edx, [ebp - 0x158]
lea eax, [ebp - 0x360]
push edx
push eax
call esi
pushal
popal
mov ecx, 0x10
xor eax, eax
lea edi, [ebp - 0x50]
mov ebx, dword [sym.imp.KERNEL32.DLL_GetCurrentProcess]
rep stosd dword es:[edi], eax
xor ecx, ecx
push 0x100
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x10], eax
mov dword [ebp - 8], ecx
mov dword [ebp - 0x54], 0x44
mov dword [ebp - 4], ecx
mov dword [ebp - 0x28], 1
mov word [ebp - 0x24], ax
call ebx
mov esi, dword [sym.imp.KERNEL32.DLL_SetPriorityClass]
push eax
call esi
push 0xf
call dword [sym.imp.KERNEL32.DLL_GetCurrentThread]
mov edi, dword [sym.imp.KERNEL32.DLL_SetThreadPriority]
push eax
call edi
lea edx, [ebp - 0x10]
lea eax, [ebp - 0x54]
push edx
push eax
push 0
push 0
push 0xc
push 0
push 0
lea ecx, [ebp - 0x360]
push 0
push ecx
push 0
call dword [sym.imp.KERNEL32.DLL_CreateProcessA]
test eax, eax
je 0x40118a
mov edx, dword [ebp - 0x10]
push pe_nt_image_headers32
push edx
call esi
mov eax, dword [ebp - 0xc]
push 0xfffffffffffffff1
push eax
call edi
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.KERNEL32.DLL_ResumeThread]
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x20
call ebx
push eax
call esi
push 0
call dword [sym.imp.KERNEL32.DLL_GetCurrentThread]
push eax
call edi
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x401200
Capabilities:
Extract resource via kernel32 functions
Write file on windows

Disassembly:
mov ecx, dword [esp + 4]
mov eax, dword [esp + 8]
push esi
and ecx, 0xffff
push eax
push ecx
push 0
call dword [sym.imp.KERNEL32.DLL_FindResourceA]
mov esi, eax
test esi, esi
je 0x40127a
push ebp
push esi
push 0
call dword [sym.imp.KERNEL32.DLL_SizeofResource]
push esi
push 0
mov ebp, eax
call dword [sym.imp.KERNEL32.DLL_LoadResource]
mov esi, eax
test esi, esi
je 0x40126b
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.DLL_LockResource]
mov edx, dword [esp + 0x1c]
push 0x40301c
push edx
mov ebx, eax
call sub.MSVCRT.dll_fopen
mov edi, eax
push edi
push ebp
push 1
push ebx
call sub.MSVCRT.dll_fwrite
push edi
call sub.MSVCRT.dll_fclose
add esp, 0x1c
pop edi
pop ebx
push esi
call dword [sym.imp.KERNEL32.DLL_FreeResource]
pop ebp
mov eax, 1
pop esi
ret
xor eax, eax
pop esi
ret

Function at 0x401280
Capabilities:
Enumerate processes
Terminate process

Disassembly:
sub esp, 0x128
push ebp
push edi
xor eax, eax
mov ecx, 0x49
lea edi, [esp + 0xc]
mov dword [esp + 8], 0
push eax
push 2
rep stosd dword es:[edi], eax
call sub.KERNEL32.DLL_CreateToolhelp32Snapshot
mov ebp, eax
lea eax, [esp + 8]
push eax
push ebp
mov dword [esp + 0x10], 0x128
call sub.KERNEL32.DLL_Process32First
test eax, eax
je 0x40131d
mov edi, dword [sym.imp.KERNEL32.DLL_OpenProcess]
push ebx
mov ebx, dword [sym.imp.KERNEL32.DLL_TerminateProcess]
push esi
lea ecx, [esp + 0x34]
push ecx
call sub.MSVCRT.dll__strlwr
lea edx, [esp + 0x38]
push 0x403020
push edx
call sub.MSVCRT.dll_strstr
add esp, 0xc
test eax, eax
je 0x40130c
mov eax, dword [esp + 0x18]
push eax
push 0
push 0x1f0fff
call edi
mov esi, eax
test esi, esi
je 0x401305
push 0
push esi
call ebx
push esi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
lea ecx, [esp + 0x10]
push ecx
push ebp
call sub.KERNEL32.DLL_Process32Next
test eax, eax
jne 0x4012cc
pop esi
pop ebx
push ebp
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
pop edi
xor eax, eax
pop ebp
add esp, 0x128
ret
Function at 0x401848
Capabilities:
Create process on windows

Disassembly:
push ebp
mov ebp, esp
xor edx, edx
push ebp
push 0x4018fe
push dword fs:[edx]
mov dword fs:[edx], esp
push 0x40a5c4
call sub.KERNEL32.DLL_GetVersionExA
cmp byte [0x40a045], 0
je 0x401876
push 0x40a5c4
call sub.KERNEL32.DLL_VirtualQuery
mov eax, 0x40a5e4
call fcn.0040120c
mov eax, 0x40a5f4
call fcn.0040120c
mov eax, 0x40a620
call fcn.0040120c
push 0xff8
push 0
call sub.KERNEL32.DLL_GetProcAddress
mov dword [0x40a61c], eax
cmp dword [0x40a61c], 0
je 0x4018dd
mov eax, 3
mov edx, dword [0x40a61c]
xor ecx, ecx
mov dword [edx + eax*4 - 0xc], ecx
inc eax
cmp eax, 0x401
jne 0x4018b3
mov eax, 0x40a604
mov dword [eax + 4], eax
mov dword [eax], eax
mov dword [0x40a610], eax
mov byte [0x40a5bc], 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x401905
cmp byte [0x40a045], 0
je 0x4018fd
push 0x40a5c4
call sub.KERNEL32.DLL_WinExec
ret

Function at 0x40190c
Capabilities:
Create process on windows
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
cmp byte [0x40a5bc], 0
je 0x4019e9
xor edx, edx
push ebp
push 0x4019e2
push dword fs:[edx]
mov dword fs:[edx], esp
cmp byte [0x40a045], 0
je 0x40193e
push 0x40a5c4
call sub.KERNEL32.DLL_VirtualQuery
mov byte [0x40a5bc], 0
mov eax, dword [0x40a61c]
push eax
call sub.KERNEL32.DLL_GetStdHandle
xor eax, eax
mov dword [0x40a61c], eax
mov ebx, dword [0x40a5e4]
jmp 0x401971
push 0x8000
push 0
mov eax, dword [ebx + 8]
push eax
call sub.KERNEL32.DLL_GetThreadLocale
mov ebx, dword [ebx]
cmp ebx, 0x40a5e4
jne 0x40195f
mov eax, 0x40a5e4
call fcn.0040120c
mov eax, 0x40a5f4
call fcn.0040120c
mov eax, 0x40a620
call fcn.0040120c
mov eax, dword [0x40a5dc]
test eax, eax
je 0x4019b7
mov edx, dword [eax]
mov dword [0x40a5dc], edx
push eax
call sub.KERNEL32.DLL_GetStdHandle
mov eax, dword [0x40a5dc]
test eax, eax
jne 0x4019a0
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4019e9
cmp byte [0x40a045], 0
je 0x4019d7
push 0x40a5c4
call sub.KERNEL32.DLL_WinExec
push 0x40a5c4
call sub.KERNEL32.DLL_WriteFile
ret
pop ebx
pop ebp
ret
Function at 0x401f34
Capabilities:
Create process on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff8
push ebx
push esi
push edi
mov ebx, eax
cmp byte [0x40a5bc], 0
jne 0x401f51
call fcn.00401848
test al, al
je 0x401f59
cmp ebx, 0x7ffffff8
jle 0x401f63
xor eax, eax
mov dword [ebp - 4], eax
jmp 0x4020b7
xor ecx, ecx
push ebp
push 0x4020b0
push dword fs:[ecx]
mov dword fs:[ecx], esp
cmp byte [0x40a045], 0
je 0x401f84
push 0x40a5c4
call sub.KERNEL32.DLL_VirtualQuery
add ebx, 7
and ebx, 0xfffffffc
cmp ebx, 0xc
jge 0x401f94
mov ebx, 0xc
cmp ebx, 0x1000
jg 0x402033
mov eax, ebx
test eax, eax
jns 0x401fa9
add eax, 3
sar eax, 2
mov edx, dword [0x40a61c]
mov edx, dword [edx + eax*4 - 0xc]
test edx, edx
je 0x402033
mov esi, edx
mov eax, esi
add eax, ebx
and dword [eax], 0xfffffffe
mov eax, dword [edx + 4]
cmp edx, eax
jne 0x401fe4
mov eax, ebx
test eax, eax
jns 0x401fd3
add eax, 3
sar eax, 2
mov ecx, dword [0x40a61c]
xor edi, edi
mov dword [ecx + eax*4 - 0xc], edi
jmp 0x40200a
mov ecx, ebx
test ecx, ecx
jns 0x401fed
add ecx, 3
sar ecx, 2
mov edi, dword [0x40a61c]
mov dword [edi + ecx*4 - 0xc], eax
mov ecx, dword [edx]
mov dword [ebp - 8], ecx
mov ecx, dword [ebp - 8]
mov dword [ecx + 4], eax
mov ecx, dword [ebp - 8]
mov dword [eax], ecx
mov eax, esi
mov edx, dword [edx + 8]
or edx, 2
mov dword [eax], edx
add eax, 4
mov dword [ebp - 4], eax
inc dword [0x40a5ac]
sub ebx, 4
add dword [0x40a5b0], ebx
call fcn.00403154
jmp 0x4020b7
cmp ebx, dword [0x40a614]
jg 0x402085
sub dword [0x40a614], ebx
cmp dword [0x40a614], 0xc
jge 0x402057
add ebx, dword [0x40a614]
xor eax, eax
mov dword [0x40a614], eax
mov eax, dword [0x40a618]
add dword [0x40a618], ebx
mov edx, ebx
or edx, 2
mov dword [eax], edx
add eax, 4
mov dword [ebp - 4], eax
inc dword [0x40a5ac]
sub ebx, 4
add dword [0x40a5b0], ebx
call fcn.00403154
jmp 0x4020b7
mov eax, ebx
call fcn.00401e40
mov dword [ebp - 4], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4020b7
cmp byte [0x40a045], 0
je 0x4020af
push 0x40a5c4
call sub.KERNEL32.DLL_WinExec
ret
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
pop ecx
pop ecx
pop ebp
ret
Function at 0x4020c4
Capabilities:
Create process on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
push edi
mov ebx, eax
xor eax, eax
mov dword [0x40a5c0], eax
cmp byte [0x40a5bc], 0
jne 0x4020fc
call fcn.00401848
test al, al
jne 0x4020fc
mov dword [0x40a5c0], 8
mov dword [ebp - 4], 8
jmp 0x40225d
xor ecx, ecx
push ebp
push 0x402256
push dword fs:[ecx]
mov dword fs:[ecx], esp
cmp byte [0x40a045], 0
je 0x40211d
push 0x40a5c4
call sub.KERNEL32.DLL_VirtualQuery
mov esi, ebx
sub esi, 4
mov ebx, dword [esi]
test bl, 2
jne 0x402138
mov dword [0x40a5c0], 9
jmp 0x40222d
dec dword [0x40a5ac]
mov eax, ebx
and eax, 0x7ffffffc
sub eax, 4
sub dword [0x40a5b0], eax
test bl, 1
je 0x402198
mov eax, esi
sub eax, 0xc
mov edx, dword [eax + 8]
cmp edx, 0xc
jl 0x402168
test edx, 0x80000003
je 0x402177
mov dword [0x40a5c0], 0xa
jmp 0x40222d
mov eax, esi
sub eax, edx
cmp edx, dword [eax + 8]
je 0x40218f
mov dword [0x40a5c0], 0xa
jmp 0x40222d
add ebx, edx
mov esi, eax
call fcn.004019ec
and ebx, 0x7ffffffc
mov eax, esi
add eax, ebx
mov edi, eax
cmp edi, dword [0x40a618]
jne 0x4021d8
sub dword [0x40a618], ebx
add dword [0x40a614], ebx
cmp dword [0x40a614], 0x3c00
jle 0x4021c9
call fcn.00401cdc
xor eax, eax
mov dword [ebp - 4], eax
call fcn.00403154
jmp 0x40225d
mov edx, dword [eax]
test dl, 2
je 0x4021fb
and edx, 0x7ffffffc
cmp edx, 4
jge 0x4021f6
mov dword [0x40a5c0], 0xb
jmp 0x40222d
or dword [eax], 1
jmp 0x402224
mov eax, edi
cmp dword [eax + 4], 0
je 0x40220e
cmp dword [eax], 0
je 0x40220e
cmp dword [eax + 8], 0xc
jge 0x40221a
mov dword [0x40a5c0], 0xb
jmp 0x40222d
mov edx, dword [eax + 8]
add ebx, edx
call fcn.004019ec
mov edx, ebx
mov eax, esi
call fcn.00401c54
mov eax, dword [0x40a5c0]
mov dword [ebp - 4], eax
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x40225d
cmp byte [0x40a045], 0
je 0x402255
push 0x40a5c4
call sub.KERNEL32.DLL_WinExec
ret
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
pop ecx
pop ebp
ret

Function at 0x402760
Capabilities:
Generate random numbers using the delphi lcg

Disassembly:
push ebx
xor ebx, ebx
imul edx, dword [ebx + 0x409008], 0x8088405
inc edx
mov dword [ebx + 0x409008], edx
mul edx
mov eax, edx
pop ebx
ret

Function at 0x403d48
Capabilities:
Create directory

Disassembly:
push ebx
push esi
add esp, 0xfffffef8
mov ebx, eax
cmp dword [ebx + 0x10], 0
jne 0x403d83
push 0x105
lea eax, [esp + 4]
push eax
mov eax, dword [ebx + 4]
push eax
call sub.KERNEL32.DLL_CreateDirectoryA
mov eax, esp
mov dl, 1
call fcn.00403f84
mov esi, eax
mov dword [ebx + 0x10], esi
test esi, esi
jne 0x403d83
mov eax, dword [ebx + 4]
mov dword [ebx + 0x10], eax
mov eax, dword [ebx + 0x10]
add esp, 0x108
pop esi
pop ebx
ret
Function at 0x403f84
Capabilities:
Create directory
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffee0
push ebx
push esi
mov dword [ebp - 4], eax
push 0x105
lea eax, [ebp - 0x11d]
push eax
push 0
call sub.KERNEL32.DLL_CreateDirectoryA
mov byte [ebp - 0x12], 0
lea eax, [ebp - 8]
push eax
push 0xf0019
push 0
push 0x4041b4
push 0x80000001
call sub.advapi32.dll_RegOpenKeyExA
test eax, eax
je 0x404007
lea eax, [ebp - 8]
push eax
push 0xf0019
push 0
push 0x4041b4
push 0x80000002
call sub.advapi32.dll_RegOpenKeyExA
test eax, eax
je 0x404007
lea eax, [ebp - 8]
push eax
push 0xf0019
push 0
push 0x4041d0
push 0x80000001
call sub.advapi32.dll_RegOpenKeyExA
test eax, eax
jne 0x404090
xor eax, eax
push ebp
push 0x404089
push dword fs:[eax]
mov dword fs:[eax], esp
mov dword [ebp - 0x18], 5
lea eax, [ebp - 0x11d]
mov edx, 0x105
call fcn.00403dcc
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x12]
push eax
push 0
push 0
lea eax, [ebp - 0x11d]
push eax
mov eax, dword [ebp - 8]
push eax
call sub.user32.dll_GetKeyboardType
test eax, eax
je 0x40406e
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x12]
push eax
push 0
push 0
push 0x4041f0
mov eax, dword [ebp - 8]
push eax
call sub.user32.dll_GetKeyboardType
test eax, eax
je 0x40406e
mov byte [ebp - 0x12], 0
mov byte [ebp - 0xe], 0
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x404090
mov eax, dword [ebp - 8]
push eax
call sub.advapi32.dll_RegCloseKey
ret
push 0x105
mov eax, dword [ebp - 4]
push eax
lea eax, [ebp - 0x11d]
push eax
call sub.KERNEL32.DLL_GetACP
push 5
lea eax, [ebp - 0xd]
push eax
push 3
call sub.KERNEL32.DLL_FindClose
push eax
call sub.KERNEL32.DLL_TlsSetValue
xor esi, esi
cmp byte [ebp - 0x11d], 0
je 0x4041aa
cmp byte [ebp - 0xd], 0
jne 0x4040d7
cmp byte [ebp - 0x12], 0
je 0x4041aa
lea eax, [ebp - 0x11d]
push eax
call sub.KERNEL32.DLL_GetCPInfo
mov ebx, eax
lea eax, [ebp - 0x11d]
add ebx, eax
jmp 0x4040f0
dec ebx
cmp byte [ebx], 0x2e
je 0x4040ff
lea eax, [ebp - 0x11d]
cmp ebx, eax
jne 0x4040ef
lea eax, [ebp - 0x11d]
cmp ebx, eax
je 0x4041aa
inc ebx
cmp byte [ebp - 0x12], 0
je 0x40413c
mov edx, ebx
sub edx, eax
mov eax, 0x105
sub eax, edx
push eax
lea eax, [ebp - 0x12]
push eax
push ebx
call sub.KERNEL32.DLL_GetACP
push 2
push 0
lea eax, [ebp - 0x11d]
push eax
call sub.KERNEL32.DLL_FindFirstFileA
mov esi, eax
test esi, esi
jne 0x4041aa
cmp byte [ebp - 0xd], 0
je 0x4041aa
lea eax, [ebp - 0x11d]
mov edx, ebx
sub edx, eax
mov eax, 0x105
sub eax, edx
push eax
lea eax, [ebp - 0xd]
push eax
push ebx
call sub.KERNEL32.DLL_GetACP
push 2
push 0
lea eax, [ebp - 0x11d]
push eax
call sub.KERNEL32.DLL_FindFirstFileA
mov esi, eax
test esi, esi
jne 0x4041aa
mov byte [ebp - 0xb], 0
lea eax, [ebp - 0x11d]
mov edx, ebx
sub edx, eax
mov eax, 0x105
sub eax, edx
push eax
lea eax, [ebp - 0xd]
push eax
push ebx
call sub.KERNEL32.DLL_GetACP
push 2
push 0
lea eax, [ebp - 0x11d]
push eax
call sub.KERNEL32.DLL_FindFirstFileA
mov esi, eax
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x404340
Capabilities:
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff0
push ebx
xor edx, edx
mov dword [ebp - 0x10], edx
xor edx, edx
push ebp
push 0x4043a6
push dword fs:[edx]
mov dword fs:[edx], esp
push 7
lea edx, [ebp - 0xb]
push edx
push 0x1004
push eax
call sub.KERNEL32.DLL_TlsSetValue
lea eax, [ebp - 0x10]
lea edx, [ebp - 0xb]
mov ecx, 7
call fcn.00403890
mov eax, dword [ebp - 0x10]
lea edx, [ebp - 4]
call fcn.0040277c
mov ebx, eax
cmp dword [ebp - 4], 0
je 0x404390
xor ebx, ebx
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4043ad
lea eax, [ebp - 0x10]
call fcn.00403648
ret