joyce8/EMBER2024-capa huggingface dataset:
Function at 0xa26880
Capabilities:
Get hostname

Disassembly:
push ebp
mov ebp, esp
push esi
mov esi, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 8]
push esi
push edi
mov byte [edi], 0
call dword [sym.imp.WS2_32.dll_gethostname]
mov byte [edi + esi - 1], 0
test eax, eax
jne 0xa268b3
push 0x2e
push edi
call fcn.00a2c990
add esp, 8
test eax, eax
je 0xa268b1
mov byte [eax], 0
xor eax, eax
pop edi
pop esi
pop ebp
ret

Function at 0xa27a20
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using des via winapi
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0xa8d06c]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 0xc]
lea eax, [ebp - 0x1c]
push edi
mov edi, dword [ebp + 0x10]
push 0xf0000040
push 1
push 0
push 0
push eax
mov dword [ebp - 0x20], 8
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0xa27ab2
lea eax, [ebp - 0xc]
mov dword [ebp - 0x18], 0x208
push eax
xorps xmm0, xmm0
mov dword [ebp - 0x14], 0x6601
push edi
movlpd qword [ebp - 0xc], xmm0
mov dword [ebp - 0x10], 8
call fcn.00a27b10
lea eax, [ebp - 0xc]
push 8
push eax
call fcn.00a2a1d0
add esp, 0x10
lea eax, [ebp - 0x24]
push eax
push 0
push 0
push 0x14
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0xa27ac4
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
pop edi
xor al, al
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.009d8d1d
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 8]
push dword [ebp - 0x20]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [esi + 4], eax
lea eax, [ebp - 0x20]
push eax
push esi
push 0
push 0
push 0
push dword [ebp - 0x24]
mov dword [esi], ecx
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push 0
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov ecx, dword [ebp - 4]
mov al, 1
pop edi
xor ecx, ebp
pop esi
call fcn.009d8d1d
mov esp, ebp
pop ebp
ret
Function at 0xa289d0
Capabilities:
Authenticate hmac
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push esi
mov esi, dword [ebp + 8]
push edi
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 0x14]
lea eax, [eax + ecx*2]
add eax, 0xc
push eax
call dword [0xa8d098]
mov edi, eax
add esp, 4
test edi, edi
jne 0xa289fd
pop edi
pop esi
mov esp, ebp
pop ebp
ret
lea ecx, [edi + 0xc]
mov dword [edi], esi
mov dword [edi + 4], ecx
mov eax, dword [esi + 0xc]
add eax, ecx
push ebx
mov ebx, dword [ebp + 0x10]
mov dword [edi + 8], eax
mov dword [ebp - 4], ebx
cmp ebx, dword [esi + 0x10]
jbe 0xa28a4f
lfence
push dword [edi + 4]
mov eax, dword [esi]
call eax
mov eax, dword [esi + 4]
push ebx
push dword [ebp + 0xc]
push dword [edi + 4]
call eax
mov eax, dword [edi + 8]
add eax, dword [esi + 0xc]
push dword [edi + 4]
mov dword [ebp - 8], eax
push eax
mov eax, dword [esi + 8]
call eax
mov eax, dword [esi + 0x14]
add esp, 0x18
mov ecx, dword [edi + 4]
mov dword [ebp - 4], eax
jmp 0xa28a55
mov eax, dword [ebp + 0xc]
mov dword [ebp - 8], eax
mov eax, dword [esi]
push ecx
call eax
push dword [edi + 8]
mov eax, dword [esi]
call eax
mov eax, dword [ebp - 4]
add esp, 8
xor ebx, ebx
test eax, eax
je 0xa28aae
mov ebx, dword [ebp - 8]
mov dword [ebp - 0xc], eax
movzx eax, byte [ebx]
xor al, 0x36
mov byte [ebp + 0xb], al
lea eax, [ebp + 0xb]
push 1
push eax
push dword [edi + 4]
mov eax, dword [esi + 4]
call eax
movzx eax, byte [ebx]
lea ebx, [ebx + 1]
xor al, 0x5c
mov byte [ebp + 0xb], al
lea eax, [ebp + 0xb]
push 1
push eax
push dword [edi + 8]
mov eax, dword [esi + 4]
call eax
add esp, 0x18
sub dword [ebp - 4], 1
jne 0xa28a73
mov ebx, dword [ebp - 0xc]
cmp ebx, dword [esi + 0x10]
jae 0xa28ada
mov eax, dword [esi + 4]
push 1
push 0xa76885
push dword [edi + 4]
call eax
mov eax, dword [esi + 4]
push 1
push 0xa76886
push dword [edi + 8]
call eax
inc ebx
add esp, 0x18
cmp ebx, dword [esi + 0x10]
jb 0xa28ab3
pop ebx
mov eax, edi
pop edi
pop esi
mov esp, ebp
pop ebp
ret

Function at 0xa28b40
Capabilities:
Create new key via cryptacquirecontext
Initialize hashing via wincrypt

Disassembly:
push ebp
mov ebp, esp
push esi
mov esi, dword [ebp + 8]
push 0xf0000040
push 0x18
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0xa28b72
lea eax, [esi + 4]
push eax
push 0
push 0
push 0x800c
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
xor eax, eax
pop esi
pop ebp
ret

Function at 0xa2a1d0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
mov edi, dword [ebp + 0xc]
xor esi, esi
test edi, edi
je 0xa2a21d
push ebx
mov ebx, dword [ebp + 8]
mov cl, byte [esi + ebx]
mov dl, cl
mov al, cl
shr dl, 1
and al, 0xfe
not dl
movzx eax, al
xor dl, cl
shr dl, 1
xor dl, cl
shr dl, 1
xor dl, cl
shr dl, 1
xor dl, cl
shr dl, 1
xor dl, cl
shr dl, 1
xor dl, cl
or cl, 1
and dl, 2
movzx ecx, cl
cmove ecx, eax
mov byte [esi + ebx], cl
inc esi
cmp esi, edi
jb 0xa2a1e2
pop ebx
pop edi
pop esi
pop ebp
ret
Function at 0xa2a270
Capabilities:
Hash data using md4
Initialize hashing via wincrypt

Disassembly:
push ebp
mov ebp, esp
push esi
mov esi, dword [ebp + 8]
push edi
push 0xf0000040
push 1
push 0
push 0
lea edi, [esi + 4]
mov dword [esi], 0
push esi
mov dword [edi], 0
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0xa2a2af
push edi
push 0
push 0
push 0x8002
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
pop edi
pop esi
pop ebp
ret

Function at 0xa42821
Capabilities:
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
pop ebp
jmp fcn.00a4249e

Function at 0xa48ec5
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
pop ebp
jmp fcn.00a48d3b
Function at 0x411bc9
Capabilities:
Query environment variable

Disassembly:
push esi
shr edx, 3
xor esi, esi
cmp edx, esi
jbe 0x411c17
push ebx
push edi
mov edi, ecx
mov ebx, edx
cmp dword [0x2b7d3c4], 0x319
jne 0x411c04
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
push esi
call dword [sym.imp.KERNEL32.dll_ZombifyActCtx]
push esi
push esi
push esi
push esi
push esi
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
push esi
call dword [sym.imp.KERNEL32.dll_GetConsoleAliasesLengthW]
mov edx, dword [esp + 0x10]
mov ecx, edi
call fcn.004112ab
add edi, 8
dec ebx
jne 0x411bd9
pop edi
pop ebx
pop esi
ret 4

Function at 0x411c1b
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Get geographical location

Disassembly:
push ecx
push esi
push edi
push 0x401384
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push 0x4013a0
push eax
mov dword [0x2b7d3b0], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push dword [0x2b7d3c4]
xor edi, edi
push edi
mov dword [0x2b7d3a8], eax
call eax
lea ecx, [esp + 8]
push ecx
push 0x40
push dword [0x2b7d3c4]
mov dword [0x2b5e028], eax
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
xor esi, esi
push edi
push edi
push edi
push edi
push edi
call dword [sym.imp.KERNEL32.dll_GetGeoInfoA]
cmp esi, 0x11c825e
jg 0x411c8a
inc esi
mov eax, esi
cdq
cmp edx, 0x6d
jl 0x411c65
jg 0x411c8a
cmp eax, 0xd69e5f85
jb 0x411c65
mov eax, dword [0x422734]
mov edx, dword [0x2b7d3c4]
mov dword [0x2be5054], eax
xor eax, eax
cmp edx, edi
pop edi
pop esi
jbe 0x411cc3
mov ecx, dword [0x2be5054]
mov cl, byte [ecx + eax + 0xb2d3b]
mov edx, dword [0x2b5e028]
mov byte [edx + eax], cl
mov edx, dword [0x2b7d3c4]
inc eax
cmp eax, edx
jb 0x411ca2
mov ecx, dword [0x2b5e028]
push 0x422008
call fcn.00411bc9
mov eax, dword [0x2b5e028]
mov dword [0x2b7d3b8], eax
call eax
pop ecx
ret

Function at 0x41885f
Capabilities:
Terminate process

Disassembly:
cmp ecx, dword [0x424c80]
jne 0x418869
repz ret
jmp fcn.0041f1e6
Function at 0x41c3f7
Capabilities:
Link many functions at runtime

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
call fcn.004153f8
and dword [ebp - 4], 0
cmp dword [0x2be57cc], 0
mov ebx, eax
jne 0x41c4a8
push 0x401e78
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
test edi, edi
je 0x41c559
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x401e6c
push edi
call esi
test eax, eax
je 0x41c559
push eax
call fcn.00415386
mov dword [esp], 0x401e5c
push edi
mov dword [0x2be57cc], eax
call esi
push eax
call fcn.00415386
mov dword [esp], 0x401e48
push edi
mov dword [0x2be57d0], eax
call esi
push eax
call fcn.00415386
mov dword [esp], 0x401e2c
push edi
mov dword [0x2be57d4], eax
call esi
push eax
call fcn.00415386
pop ecx
mov dword [0x2be57dc], eax
test eax, eax
je 0x41c4a8
push 0x401e14
push edi
call esi
push eax
call fcn.00415386
pop ecx
mov dword [0x2be57d8], eax
mov eax, dword [0x2be57d8]
cmp eax, ebx
je 0x41c500
cmp dword [0x2be57dc], ebx
je 0x41c500
push eax
call fcn.00415401
push dword [0x2be57dc]
mov esi, eax
call fcn.00415401
pop ecx
pop ecx
mov edi, eax
test esi, esi
je 0x41c500
test edi, edi
je 0x41c500
call esi
test eax, eax
je 0x41c4f7
lea ecx, [ebp - 8]
push ecx
push 0xc
lea ecx, [ebp - 0x14]
push ecx
push 1
push eax
call edi
test eax, eax
je 0x41c4f7
test byte [ebp - 0xc], 1
jne 0x41c500
or dword [ebp + 0x10], 0x200000
jmp 0x41c539
mov eax, dword [0x2be57d0]
cmp eax, ebx
je 0x41c539
push eax
call fcn.00415401
pop ecx
test eax, eax
je 0x41c539
call eax
mov dword [ebp - 4], eax
test eax, eax
je 0x41c539
mov eax, dword [0x2be57d4]
cmp eax, ebx
je 0x41c539
push eax
call fcn.00415401
pop ecx
test eax, eax
je 0x41c539
push dword [ebp - 4]
call eax
mov dword [ebp - 4], eax
push dword [0x2be57cc]
call fcn.00415401
pop ecx
test eax, eax
je 0x41c559
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp - 4]
call eax
jmp 0x41c55b
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
Function at 0x401a60
Capabilities:
Access peb ldr_data
Get ntdll base address

Disassembly:
push 0xffffffffffffffff
push 0x414506
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
mov eax, dword [esp + 0x18]
push esi
mov esi, ecx
push edi
mov ecx, dword [esp + 0x1c]
push 2
push eax
push ecx
mov ecx, esi
mov dword [esp + 0x14], esi
call fcn.004039e0
lea edi, [esi + 0x94]
mov dword [esp + 0x14], 0
mov ecx, edi
call fcn.004044c0
push 0x9b
push 0x11a
push 0xffffff65
push 0xfffffee6
mov ecx, esi
mov byte [esp + 0x24], 1
mov dword [esi], 0x415408
mov dword [esi + 0x78], 0
mov dword [esi + 0x7c], 0
call fcn.00403650
mov edx, dword [esi + 0x74]
push 0x43
add edx, 0x30
push 0x9b
push edx
mov ecx, edi
call fcn.00404990
mov eax, dword [esp + 0x24]
mov ecx, esi
push eax
call fcn.00401be0
mov ecx, dword [esp + 0xc]
mov eax, esi
pop edi
pop esi
mov dword fs:[0], ecx
add esp, 0x10
ret 0xc

Function at 0x402690
Capabilities:
Access peb ldr_data
Get ntdll base address

Disassembly:
push 0xffffffffffffffff
push 0x4145f6
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
mov eax, dword [esp + 0x18]
push esi
mov esi, ecx
push edi
mov ecx, dword [esp + 0x1c]
push 0xb
push eax
push ecx
mov ecx, esi
mov dword [esp + 0x14], esi
call fcn.004039e0
lea edi, [esi + 0x94]
mov dword [esp + 0x14], 0
mov ecx, edi
call fcn.004044c0
mov edx, dword [esi + 0x74]
push 0x43
add edx, 0x30
push 0x9b
push edx
mov ecx, edi
mov byte [esp + 0x20], 1
mov dword [esi], 0x4154d8
call fcn.00404990
push 2
mov ecx, esi
call fcn.00403a90
push 0x135
push 0xc9
push 0xf6
push 0
push 0
push 0
mov ecx, esi
call fcn.00403ac0
push 0x15e
push 0x82
push 0x125
push 0
push 0
push 1
mov ecx, esi
call fcn.00403ac0
mov eax, dword [esp + 0x24]
mov ecx, esi
push eax
call fcn.004027e0
mov ecx, dword [esp + 0xc]
mov eax, esi
pop edi
pop esi
mov dword fs:[0], ecx
add esp, 0x10
ret 0xc

Function at 0x404bb0
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push ecx
push ebx
push ebp
mov ebp, ecx
push esi
push edi
push str.MSGTEXT
mov eax, dword [ebp + 4]
lea edi, [ebp + 0x30]
push 0x65
push eax
mov byte [edi], 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
test esi, esi
je 0x404c5b
mov eax, dword [ebp + 4]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov ebx, eax
mov eax, dword [ebp + 4]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov esi, eax
test esi, esi
mov dword [esp + 0x10], esi
je 0x404c5b
push esi
call dword [sym.imp.KERNEL32.dll_LockResource]
mov cl, byte [eax + ebx - 1]
test cl, cl
je 0x404c3e
mov ecx, ebx
mov esi, eax
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
cmp ebx, 0xff
rep movsb byte es:[edi], byte [esi]
jl 0x404c28
mov ebx, 0xff
mov esi, dword [esp + 0x10]
mov byte [ebx + ebp + 0x30], 0
push esi
call dword [sym.imp.KERNEL32.dll_FreeResource]
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
push 0x100
push eax
push edi
call fcn.0040e5d0
add esp, 0xc
mov byte [ebp + 0x12f], 0
push esi
call dword [sym.imp.KERNEL32.dll_FreeResource]
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
Function at 0x404ec0
Capabilities:
Find taskbar

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x10
mov edx, dword [esp + 0x20]
push ebx
push ebp
push esi
mov esi, ecx
mov ecx, dword [esp + 0x28]
xor ebp, ebp
mov dword [esi + 4], eax
mov eax, dword [esp + 0x24]
push edi
mov dword [esi + 8], ecx
mov dword [esi + 0xc], edx
mov dword [esi + 0x18], eax
mov dword [esi + 0x20], ebp
mov dword [esi + 0x24], ebp
mov dword [esi + 0x28], ebp
mov dword [esi + 0x2c], ebp
mov dword [esi], 0x4156a8
call dword [sym.imp.KERNEL32.dll_GetTickCount]
movsx ecx, ax
push ecx
call fcn.0040e32b
add esp, 4
push ebp
push str.Shell_TrayWnd
call dword [sym.imp.USER32.dll_FindWindowA]
mov ebx, eax
push ebp
cmp ebx, ebp
je 0x404f80
call dword [sym.imp.USER32.dll_GetDC]
mov ebp, dword [sym.imp.GDI32.dll_GetDeviceCaps]
mov edi, eax
push 8
push edi
call ebp
push 0xa
push edi
mov dword [esi + 0x10], eax
call ebp
push edi
push 0
mov dword [esi + 0x14], eax
call dword [sym.imp.USER32.dll_ReleaseDC]
lea edx, [esp + 0x10]
push edx
push ebx
call dword [sym.imp.USER32.dll_GetWindowRect]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
mov ecx, dword [esi + 0x10]
sub eax, edx
cmp eax, ecx
jl 0x404fa6
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
mov eax, dword [esi + 0x14]
sub ecx, edx
add eax, ecx
pop edi
mov dword [esi + 0x14], eax
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 0x10
call dword [sym.imp.USER32.dll_GetDC]
mov ebx, dword [sym.imp.GDI32.dll_GetDeviceCaps]
mov edi, eax
push 8
push edi
call ebx
push 0xa
push edi
mov dword [esi + 0x10], eax
call ebx
push edi
push ebp
mov dword [esi + 0x14], eax
call dword [sym.imp.USER32.dll_ReleaseDC]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 0x10

Function at 0x4055d0
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push esi
push edi
push 1
call fcn.00405350
mov edi, dword [esp + 0x10]
add esp, 4
mov esi, eax
mov eax, dword [esp + 0x10]
push 0x4182c4
push eax
push edi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
test eax, eax
jne 0x405605
push esi
call fcn.00405920
add esp, 4
xor eax, eax
pop edi
pop esi
ret
push eax
push edi
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov edi, eax
test edi, edi
jne 0x405621
push esi
call fcn.00405920
add esp, 4
xor eax, eax
pop edi
pop esi
ret
push edi
call dword [sym.imp.KERNEL32.dll_LockResource]
push esi
mov dword [esi + 8], eax
mov dword [esi + 4], eax
mov dword [esi + 0xc], edi
call fcn.00405380
add esp, 4
test eax, eax
jne 0x40564c
push esi
call fcn.00405920
add esp, 4
xor eax, eax
pop edi
pop esi
ret
mov eax, esi
pop edi
pop esi
ret
Function at 0x405a10
Capabilities:
Extract resource via kernel32 functions

Disassembly:
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 8]
push ebx
mov ebx, dword [esp + 8]
push ebp
push esi
push edi
push eax
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov esi, eax
test esi, esi
jne 0x405a34
pop edi
pop esi
pop ebp
pop ebx
ret
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov edi, eax
test edi, edi
jne 0x405a47
pop edi
pop esi
pop ebp
pop ebx
ret
push edi
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ebp, eax
push esi
push ebx
mov dword [esp + 0x24], ebp
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push eax
push ebp
call fcn.00405bc0
add esp, 8
mov esi, eax
push edi
call dword [sym.imp.KERNEL32.dll_FreeResource]
test esi, esi
jne 0x405a7a
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret
push esi
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ecx, dword [eax + 0x14]
test ecx, ecx
jne 0x405aa0
mov cx, word [eax + 0xe]
imul ecx, dword [eax + 4]
add ecx, 0x1f
shr ecx, 3
and ecx, 0x1ffffffc
imul ecx, dword [eax + 8]
mov edx, dword [eax + 0x20]
mov ebp, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
lea edi, [ecx + edx*4]
mov ecx, dword [eax]
add edi, ecx
call ebp
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GlobalReAlloc]
mov ebx, eax
test ebx, ebx
jne 0x405ad1
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
ret
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov edx, dword [0x41a760]
mov esi, dword [esp + 0x1c]
mov ecx, dword [eax + 0x14]
add esi, edx
mov edx, dword [eax + 0x20]
push ebx
lea edi, [eax + edx*4]
mov edx, dword [eax]
mov eax, ecx
add edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call ebp
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
ret

Function at 0x405fa0
Capabilities:
Extract resource via kernel32 functions

Disassembly:
mov eax, dword [esp + 4]
push esi
push edi
mov edi, dword [esp + 0x10]
and eax, 0xffff
push str.CONFIG
mov byte [edi], 0
mov ecx, dword [0x41a764]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FindResourceA]
test eax, eax
jne 0x405fcc
pop edi
pop esi
ret
mov edx, dword [0x41a764]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov esi, eax
test esi, esi
jne 0x405fe3
pop edi
pop esi
ret
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ebx, dword [esp + 0x18]
push ebx
push eax
push edi
call fcn.0040e5d0
add esp, 0xc
mov byte [edi + ebx - 1], 0
push esi
call dword [sym.imp.KERNEL32.dll_FreeResource]
pop ebx
pop edi
mov eax, 1
pop esi
ret
Function at 0x407660
Capabilities:
Extract resource via kernel32 functions
Get common file path

Disassembly:
sub esp, 0x10c
push ebx
push ebp
push esi
mov esi, ecx
mov cl, byte [esi + 0x14]
push edi
lea edi, [esi + 0x14]
xor ebx, ebx
test cl, cl
mov ecx, esi
setne bl
call fcn.00407600
test ebx, ebx
je 0x40768a
inc dword [esi + 0x11c]
mov eax, dword [esp + 0x120]
test eax, eax
jne 0x40769a
mov eax, str.IDM_MUSIC
push str.MIDI
push eax
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_FindResourceA]
mov ebx, eax
test ebx, ebx
je 0x40773a
mov ecx, dword [esi]
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov ebp, eax
test ebp, ebp
je 0x40773a
push ebp
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edx, dword [esi]
push ebx
push edx
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_SizeofResource]
mov dword [esp + 0x14], eax
lea eax, [esp + 0x18]
push eax
push 0x103
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
push edi
push 0
lea ecx, [esp + 0x20]
push 0x41a7a0
push ecx
call dword [sym.imp.KERNEL32.dll_GetTempFileNameA]
push 0x418934
push edi
call fcn.0040e959
mov edx, dword [esp + 0x1c]
mov ebx, eax
mov eax, dword [esp + 0x18]
push ebx
push edx
push 1
push eax
call fcn.0040ec21
push ebx
call fcn.0040eaa8
add esp, 0x1c
push ebp
call dword [sym.imp.KERNEL32.dll_FreeResource]
mov ecx, dword [esi + 8]
push edi
push ecx
mov ecx, esi
call fcn.00407750
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10c
ret 4
Function at 0x4080a0
Capabilities:
Get file size
Read file via mapping

Disassembly:
push ebx
mov ebx, ecx
mov eax, dword [ebx + 0xc]
test eax, eax
je 0x4080b3
push eax
call fcn.0040e312
add esp, 4
push ebp
mov ebp, dword [esp + 0xc]
push esi
push edi
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
call fcn.0040e31d
mov edx, eax
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
add esp, 4
mov dword [ebx + 0xc], edx
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0
mov eax, ecx
mov esi, edi
mov edi, edx
push 0x80
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 3
push 0
and ecx, 3
push 1
push 0x80000000
rep movsb byte es:[edi], byte [esi]
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
pop edi
pop esi
cmp eax, 0xffffffff
mov dword [ebx], eax
pop ebp
jne 0x408121
mov dword [ebx], 0
xor eax, eax
pop ebx
ret 8
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [ebx]
push 0
push 0
push 0
push 2
push 0
push ecx
mov dword [ebx + 0x18], eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
test eax, eax
mov dword [ebx + 4], eax
je 0x40811b
push 0
push 0
push 0
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
test eax, eax
mov dword [ebx + 8], eax
je 0x40811b
mov ecx, ebx
call fcn.00408660
pop ebx
ret 8

Function at 0x4081c0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0xe4
lea eax, [esp + 4]
push eax
call fcn.00408290
mov eax, dword [esp + 0xe8]
lea ecx, [esp]
push 0
push ecx
lea edx, [esp + 0xc]
push 0xe0
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp]
xor eax, eax
cmp ecx, 0xe0
sete al
add esp, 0xe4
ret 4

Function at 0x408310
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x34
push ebx
push ebp
mov ebx, ecx
push 2
call fcn.00408570
mov dword [esp + 0xc], eax
mov eax, dword [ebx + 8]
mov ecx, dword [eax + 0x3c]
lea ebp, [ecx + eax + 0xf8]
mov ecx, ebx
call fcn.00408560
test eax, eax
jle 0x4083c1
push esi
push edi
mov dword [esp + 0x10], eax
mov eax, dword [ebx + 0x14]
mov ecx, 0xa
mov esi, ebp
lea edi, [esp + 0x1c]
test eax, eax
rep movsd dword es:[edi], dword [esi]
je 0x40838b
mov ecx, dword [esp + 0x14]
cmp ebp, ecx
jne 0x408379
mov edx, dword [ebx + 0x10]
mov esi, dword [esp + 0x2c]
mov ecx, dword [esp + 0x24]
add esi, edx
add ecx, eax
mov dword [esp + 0x2c], esi
mov dword [esp + 0x24], ecx
jmp 0x40838b
mov eax, dword [esp + 0x30]
mov edx, dword [ecx + 0x14]
cmp eax, edx
jbe 0x40838b
add eax, dword [ebx + 0x10]
mov dword [esp + 0x30], eax
mov edx, dword [esp + 0x48]
lea eax, [esp + 0x18]
push 0
push eax
lea ecx, [esp + 0x24]
push 0x28
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x10]
add ebp, 0x28
dec eax
mov dword [esp + 0x10], eax
jne 0x408344
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x34
ret 4
pop ebp
mov eax, 1
pop ebx
add esp, 0x34
ret 4