joyce8/EMBER2024-capa huggingface dataset:
Function at 0x40a620
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xc
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, ecx
mov ecx, dword [ebp + 0xc]
push esi
push edi
mov edi, dword [ebp + 8]
mov dword [esp + 0xc], edi
test eax, eax
jg 0x40a652
jl 0x40a645
test ecx, ecx
jne 0x40a652
xor eax, eax
xor edx, edx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp dword [ebx + 0x38], 0
je 0x40a712
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], eax
mov ecx, ebx
call fcn.0040d150
mov esi, eax
mov eax, edx
mov dword [esp + 0x14], eax
test eax, eax
jl 0x40a6be
jg 0x40a67d
test esi, esi
je 0x40a6be
mov ecx, dword [esp + 0xc]
cmp ecx, eax
jg 0x40a695
mov eax, dword [esp + 0x10]
jl 0x40a68f
cmp eax, esi
jae 0x40a695
mov esi, eax
mov dword [esp + 0x14], ecx
mov eax, dword [ebx + 0x1c]
push esi
push dword [eax]
push edi
call fcn.0041fbf0
mov eax, dword [ebx + 0x2c]
add esp, 0xc
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0xc]
sub ecx, esi
sbb edx, dword [esp + 0x14]
sub dword [eax], esi
mov eax, dword [ebx + 0x1c]
add dword [eax], esi
jmp 0x40a6df
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x1c]
mov edx, dword [esp + 0xc]
cmp eax, 0xffffffff
je 0x40a6fb
mov ecx, dword [esp + 0x10]
mov esi, 1
add ecx, 0xffffffff
mov byte [edi], al
adc edx, 0xffffffff
add edi, esi
mov dword [esp + 0xc], edx
mov dword [esp + 0x10], ecx
test edx, edx
jg 0x40a664
jl 0x40a6fb
test ecx, ecx
jne 0x40a664
mov eax, dword [ebp + 0xc]
sub eax, dword [esp + 0x10]
mov esi, dword [ebp + 0x10]
sbb esi, edx
mov edx, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebx + 0x1c]
lea esi, [ebx + 0x2c]
mov edi, ecx
mov edx, dword [eax]
test edx, edx
je 0x40a750
mov eax, dword [esi]
mov eax, dword [eax]
test eax, eax
je 0x40a750
cmp eax, ecx
mov esi, ecx
cmovb esi, eax
push esi
push edx
push dword [esp + 0x14]
call fcn.0041fbf0
mov eax, dword [ebx + 0x2c]
sub edi, esi
add dword [esp + 0x18], esi
add esp, 0xc
sub dword [eax], esi
mov eax, dword [ebx + 0x1c]
add dword [eax], esi
lea esi, [ebx + 0x2c]
cmp dword [ebx + 0x4c], 0
je 0x40a7b9
mov ecx, dword [ebx + 0xc]
lea eax, [ebx + 0x3c]
cmp dword [ecx], eax
jne 0x40a776
mov eax, dword [ebx + 0xc]
mov edx, dword [ebx + 0x54]
mov ecx, dword [ebx + 0x50]
sub edx, ecx
mov dword [eax], ecx
mov eax, dword [ebx + 0x1c]
mov dword [eax], ecx
mov eax, dword [esi]
mov dword [eax], edx
mov esi, dword [esp + 0xc]
cmp edi, 0xfff
jbe 0x40a7a4
push dword [ebx + 0x4c]
push 0xfff
push 1
push esi
call fcn.00425f18
add esp, 0x10
add esi, eax
sub edi, eax
cmp eax, 0xfff
jne 0x40a7b9
cmp edi, eax
ja 0x40a782
test edi, edi
je 0x40a7b9
push dword [ebx + 0x4c]
push edi
push 1
push esi
call fcn.00425f18
add esp, 0x10
sub edi, eax
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
sub eax, edi
pop edi
pop esi
sbb edx, 0
pop ebx
mov esp, ebp
pop ebp
ret 0xc
Function at 0x41c699
Capabilities:
Parse pe header

Disassembly:
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
je 0x41c6d8
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x41c6d8
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x41c6d8
mov eax, 0x10b
cmp word [ecx + 0x18], ax
jne 0x41c6d8
cmp dword [ecx + 0x74], 0xe
jbe 0x41c6d8
cmp dword [ecx + 0xe8], 0
setne al
ret
xor al, al
ret

Function at 0x41ca50
Capabilities:
Get geographical location

Disassembly:
push ebp
mov ebp, esp
push ecx
push esi
push 2
lea eax, [ebp - 4]
push eax
push 0x20000001
push str._x_sys_default_locale
call dword [sym.imp.KERNEL32.dll_GetLocaleInfoEx]
mov esi, dword [ebp + 0xc]
neg eax
sbb eax, eax
xor ecx, ecx
and eax, dword [ebp - 4]
push ecx
push ecx
push esi
push eax
push dword [ebp + 8]
mov dword [ebp - 4], eax
push ecx
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
push eax
push dword [esi]
call fcn.0041ca2c
pop esi
leave
ret 8
Function at 0x425ac5
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x101c
call fcn.0043f910
mov eax, dword [0x450008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
push ebx
push dword [ebp + 8]
mov dword [ebp - 0x100c], eax
call fcn.00430aa2
pop ecx
mov ecx, dword [ebp + 8]
mov ebx, eax
cmp dword [ecx + 8], 0
jne 0x425b07
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
jmp 0x425c63
mov eax, dword [ecx]
sub eax, dword [ecx + 4]
push esi
push edi
push 0
cdq
push 2
push edx
push eax
call fcn.0043f860
push dword [ebp - 0x100c]
mov ecx, ebx
mov dword [ebp - 0x1008], eax
mov esi, ebx
mov dword [ebp - 0x1018], edx
and ecx, 0x3f
sar esi, 6
imul edi, ecx, 0x38
push 0
mov eax, dword [esi*4 + 0x451f58]
push dword [edi + eax + 0x24]
push dword [edi + eax + 0x20]
push ebx
call fcn.00433c76
mov ecx, dword [esi*4 + 0x451f58]
add esp, 0x14
mov dword [ebp - 0x1010], eax
mov eax, edx
mov edx, dword [ebp - 0x1010]
mov dword [ebp - 0x101c], eax
cmp edx, dword [edi + ecx + 0x20]
jne 0x425c5c
cmp eax, dword [edi + ecx + 0x24]
jne 0x425c5c
push 0
lea eax, [ebp - 0x1014]
push eax
push 0x1000
lea eax, [ebp - 0x1004]
push eax
push dword [edi + ecx + 0x18]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x425c5c
push dword [ebp - 0x100c]
push 0
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push ebx
call fcn.00433c76
add esp, 0x14
test edx, edx
jl 0x425c5c
jg 0x425bd2
test eax, eax
jb 0x425c5c
mov ebx, dword [ebp - 0x1018]
mov eax, dword [ebp - 0x1014]
test ebx, ebx
jg 0x425c5c
jl 0x425bec
cmp dword [ebp - 0x1008], eax
ja 0x425c5c
lea edi, [ebp - 0x1004]
xor edx, edx
add edi, eax
lea ecx, [ebp - 0x1004]
xor esi, esi
cmp dword [ebp - 0x1008], edx
jne 0x425c0a
test ebx, ebx
je 0x425c43
cmp ecx, edi
jae 0x425c43
mov al, byte [ecx]
cmp al, 0xd
jne 0x425c24
lea eax, [edi - 1]
cmp ecx, eax
jae 0x425c30
cmp byte [ecx + 1], 0xa
jne 0x425c30
inc ecx
jmp 0x425c30
movzx eax, al
movsx eax, byte [eax + 0x4502e0]
add ecx, eax
add esi, 1
adc edx, 0
inc ecx
cmp esi, dword [ebp - 0x1008]
jne 0x425c0a
cmp edx, ebx
jne 0x425c0a
lea eax, [ebp - 0x1004]
sub ecx, eax
mov eax, ecx
cdq
add eax, dword [ebp - 0x1010]
adc edx, dword [ebp - 0x101c]
jmp 0x425c61
or edx, 0xffffffff
mov eax, edx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.0041badb
leave
ret

Function at 0x43046f
Capabilities:
Allocate thread local storage

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push esi
push 0x445ff0
push 0x445fe8
push str.FlsAlloc
push 0x1e
call fcn.004302dc
mov esi, eax
add esp, 0x10
test esi, esi
je 0x4304a3
push dword [ebp + 8]
mov ecx, esi
call dword [0x44217c]
call esi
jmp 0x4304a9
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
pop esi
pop ebp
ret 4

Function at 0x4304ed
Capabilities:
Get thread local storage value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push esi
push 0x446000
push 0x445ff8
push str.FlsGetValue
push 0x20
call fcn.004302dc
mov esi, eax
add esp, 0x10
test esi, esi
je 0x430524
push dword [ebp + 8]
mov ecx, esi
call dword [0x44217c]
call esi
pop esi
pop ebp
ret 4
pop esi
pop ebp
jmp dword [sym.imp.KERNEL32.dll_TlsGetValue]
Function at 0x433cf2
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x14
mov eax, dword [ebp + 8]
mov ecx, eax
push ebx
mov ebx, dword [ebp + 0xc]
and eax, 0x3f
sar ecx, 6
push esi
push edi
imul edi, eax, 0x38
mov eax, dword [ecx*4 + 0x451f58]
mov dword [ebp - 0x10], ecx
mov ecx, dword [eax + edi + 0x18]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x433d32
cmp byte [ebx], 0xa
jne 0x433d32
or byte [eax + edi + 0x28], 4
jmp 0x433d37
and byte [eax + edi + 0x28], 0xfb
add ecx, ebx
mov edx, ebx
mov dword [ebp - 0xc], ecx
mov esi, ebx
cmp ebx, ecx
jae 0x433e35
mov al, byte [edx]
cmp al, 0x1a
je 0x433e17
lea ecx, [edx + 1]
mov dword [ebp - 8], ecx
mov ecx, dword [ebp - 0xc]
cmp al, 0xd
je 0x433d66
mov edx, dword [ebp - 8]
mov byte [esi], al
jmp 0x433d8b
mov eax, dword [ebp - 8]
cmp eax, ecx
jae 0x433d95
mov cl, byte [eax]
xor eax, eax
cmp cl, 0xa
sete al
inc eax
add edx, eax
cmp cl, 0xa
sete al
dec al
and al, 3
add al, 0xa
mov byte [esi], al
mov ecx, dword [ebp - 0xc]
inc esi
cmp edx, ecx
jb 0x433d48
jmp 0x433e35
push 0
lea eax, [ebp - 0xc]
push eax
push 1
lea eax, [ebp - 1]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x433e12
cmp dword [ebp - 0xc], 0
je 0x433e12
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx*4 + 0x451f58]
test byte [eax + edi + 0x28], 0x48
je 0x433dec
mov dl, byte [ebp - 1]
lea eax, [esi + 1]
mov dword [ebp - 0x14], eax
cmp dl, 0xa
jne 0x433dd7
mov byte [esi], dl
jmp 0x433de8
mov byte [esi], 0xd
mov eax, dword [ecx*4 + 0x451f58]
mov byte [eax + edi + 0x2a], dl
mov eax, dword [ebp - 0x14]
mov esi, eax
jmp 0x433e35
cmp byte [ebp - 1], 0xa
jne 0x433dfb
cmp esi, ebx
jne 0x433dfb
mov byte [esi], 0xa
jmp 0x433e34
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.00433c94
add esp, 0x10
cmp byte [ebp - 1], 0xa
je 0x433e35
mov byte [esi], 0xd
jmp 0x433e34
mov ecx, dword [ebp - 0x10]
mov ecx, dword [ecx*4 + 0x451f58]
mov al, byte [ecx + edi + 0x28]
test al, 0x40
jne 0x433e31
or al, 2
mov byte [ecx + edi + 0x28], al
jmp 0x433e35
mov byte [esi], 0x1a
inc esi
sub esi, ebx
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret
Function at 0x433e3e
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov ebx, eax
and eax, 0x3f
sar ebx, 6
push edi
imul edi, eax, 0x38
push 0xa
mov eax, dword [ebx*4 + 0x451f58]
pop edx
mov dword [ebp - 0x14], edx
mov ecx, dword [edi + eax + 0x18]
mov dword [ebp - 0x18], ecx
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x433e81
cmp word [esi], dx
jne 0x433e81
or byte [edi + eax + 0x28], 4
jmp 0x433e86
and byte [edi + eax + 0x28], 0xfb
lea edx, [esi + ecx*2]
mov eax, esi
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
cmp eax, edx
jae 0x433fbf
mov dword [ebp - 0xc], 0xd
movzx ecx, word [eax]
mov edx, ecx
mov dword [ebp - 0x10], edx
push 0x1a
pop edx
cmp cx, dx
mov edx, dword [ebp - 8]
je 0x433f9f
add eax, 2
cmp cx, word [ebp - 0xc]
je 0x433ec8
mov dword [ebp - 4], eax
mov word [esi], cx
jmp 0x433efe
cmp eax, edx
jae 0x433f0a
movzx eax, word [eax]
xor ecx, ecx
cmp ax, word [ebp - 0x14]
mov edx, eax
push 0xa
sete cl
xor eax, eax
lea ecx, [ecx*2 + 2]
add dword [ebp - 4], ecx
pop ecx
cmp dx, cx
mov edx, dword [ebp - 8]
sete al
dec eax
and eax, 3
add eax, ecx
mov word [esi], ax
mov eax, dword [ebp - 4]
add esi, 2
cmp eax, edx
jb 0x433ea0
jmp 0x433fbf
push 0
lea eax, [ebp - 0x14]
push eax
push 2
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x433f9b
cmp dword [ebp - 0x14], 0
je 0x433f9b
mov eax, dword [ebx*4 + 0x451f58]
push 0xa
test byte [edi + eax + 0x28], 0x48
je 0x433f73
mov cx, word [ebp - 4]
pop eax
cmp cx, ax
je 0x433fb9
push 0xd
pop eax
mov word [esi], ax
mov eax, dword [ebx*4 + 0x451f58]
push 0xa
mov byte [edi + eax + 0x2a], cl
mov eax, dword [ebx*4 + 0x451f58]
shr cx, 8
mov byte [edi + eax + 0x2b], cl
mov eax, dword [ebx*4 + 0x451f58]
pop ecx
mov byte [edi + eax + 0x2c], cl
jmp 0x433fbc
pop ebx
cmp word [ebp - 4], bx
jne 0x433f84
cmp esi, dword [ebp + 0xc]
jne 0x433f84
mov word [esi], bx
jmp 0x433fbc
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [ebp + 8]
call fcn.00433c94
add esp, 0x10
cmp word [ebp - 4], bx
je 0x433fbf
push 0xd
jmp 0x433fb8
mov ecx, dword [ebx*4 + 0x451f58]
mov al, byte [ecx + edi + 0x28]
test al, 0x40
jne 0x433fb6
or al, 2
mov byte [ecx + edi + 0x28], al
jmp 0x433fbf
push 0x1a
pop eax
mov word [esi], ax
add esi, 2
sub esi, dword [ebp + 0xc]
and esi, 0xfffffffe
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret
Function at 0x4349b6
Capabilities:
Read file on windows

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

Function at 0x4349c1
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
pop ebp
jmp fcn.004347e0
Function at 0x43616e
Capabilities:
Query environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
mov esi, eax
test esi, esi
je 0x43620b
push ebx
push esi
call fcn.00436137
xor ebx, ebx
sub eax, esi
push ebx
push ebx
push ebx
push ebx
sar eax, 1
push eax
push esi
push ebx
push ebx
mov dword [ebp - 8], eax
call fcn.00436080
add esp, 0x24
mov dword [ebp - 4], eax
test eax, eax
jne 0x4361b8
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
jmp 0x43620a
push edi
push eax
call fcn.0042ff90
mov edi, eax
pop ecx
push ebx
test edi, edi
jne 0x4361d8
call fcn.0042ff56
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
jmp 0x436209
push ebx
push dword [ebp - 4]
push edi
push dword [ebp - 8]
push esi
push ebx
push ebx
call fcn.00436080
add esp, 0x20
test eax, eax
jne 0x4361f7
push edi
call fcn.0042ff56
jmp 0x4361ff
push ebx
call fcn.0042ff56
mov ebx, edi
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, ebx
pop edi
pop ebx
pop esi
leave
ret
Function at 0x43e135
Capabilities:
Clear file content

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
mov ebx, dword [ebp + 8]
lea ecx, [ebp - 0x2c]
push esi
push edi
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push ebx
call fcn.0043e0b1
mov eax, dword [ebp - 0x2c]
and eax, dword [ebp - 0x28]
cmp eax, 0xffffffff
je 0x43e2ad
mov eax, dword [ebp - 0x24]
and eax, dword [ebp - 0x20]
cmp eax, 0xffffffff
je 0x43e2ad
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 8], ecx
mov dword [ebp - 4], eax
test ecx, ecx
jl 0x43e25c
jg 0x43e18e
test eax, eax
je 0x43e252
push 1
push 0x1000
call fcn.0042ffde
mov esi, eax
pop ecx
pop ecx
test esi, esi
jne 0x43e1b4
mov eax, dword [ebp + 0x14]
push 0xc
pop edi
mov byte [eax + 0x1c], 1
mov dword [eax + 0x18], edi
jmp 0x43e249
push 0x8000
push ebx
call fcn.0042c54f
mov edi, dword [ebp + 0x14]
pop ecx
pop ecx
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x18]
test eax, eax
jl 0x43e1e0
jg 0x43e1db
cmp ecx, 0x1000
jb 0x43e1e0
mov ecx, 0x1000
push edi
push ecx
push esi
push ebx
call fcn.00432d97
add esp, 0x10
cmp eax, 0xffffffff
je 0x43e225
mov ecx, dword [ebp - 4]
cdq
sub ecx, eax
mov eax, dword [ebp - 8]
mov dword [ebp - 4], ecx
sbb eax, edx
mov dword [ebp - 8], eax
test eax, eax
jg 0x43e1db
jl 0x43e20c
test ecx, ecx
jne 0x43e1cd
push dword [ebp - 0xc]
push ebx
call fcn.0042c54f
push esi
call fcn.0042ff56
add esp, 0xc
xor edi, edi
jmp 0x43e2be
cmp byte [edi + 0x24], 0
je 0x43e23c
cmp dword [edi + 0x20], 5
jne 0x43e23c
mov byte [edi + 0x1c], 1
mov dword [edi + 0x18], 0xd
cmp byte [edi + 0x1c], 0
je 0x43e247
mov edi, dword [edi + 0x18]
jmp 0x43e249
xor edi, edi
push esi
call fcn.0042ff56
pop ecx
jmp 0x43e2be
test ecx, ecx
jg 0x43e21e
jl 0x43e25c
test eax, eax
jae 0x43e21e
push 0
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push ebx
call fcn.00433c94
and eax, edx
add esp, 0x10
cmp eax, 0xffffffff
jne 0x43e27f
mov edi, dword [ebp + 0x14]
cmp byte [edi + 0x1c], 0
je 0x43e21e
jmp 0x43e2b6
push ebx
call fcn.00436ee3
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x43e21e
mov esi, dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0xd
mov byte [esi + 0x24], 1
mov dword [esi + 0x20], eax
pop edi
mov byte [esi + 0x1c], 1
mov dword [esi + 0x18], edi
jmp 0x43e2be
mov edi, dword [ebp + 0x14]
cmp byte [edi + 0x1c], 0
je 0x43e2bb
mov edi, dword [edi + 0x18]
jmp 0x43e2be
push 0x16
pop edi
push 0
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push dword [ebp - 0x14]
call fcn.00433c94
add esp, 0x10
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret

Function at 0x43f780
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x43f7ad
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x43f7ad
mov edx, 0x10b
xor eax, eax
cmp word [ecx + 0x18], dx
sete al
pop ebp
ret
xor eax, eax
pop ebp
ret
Function at 0x402b8c
Capabilities:
Generate random numbers using the delphi lcg

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

Function at 0x403008
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff4
movzx eax, word [0x4e4024]
mov dword [ebp - 8], eax
lea eax, [ebp - 4]
push eax
push 1
push 0
push 0x4030a0
push 0x80000002
call sub.advapi32.dll_RegOpenKeyExA
test eax, eax
jne 0x403080
xor eax, eax
push ebp
push 0x403079
push dword fs:[eax]
mov dword fs:[eax], esp
mov dword [ebp - 0xc], 4
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 8]
push eax
push 0
push 0
push 0x4030bc
mov eax, dword [ebp - 4]
push eax
call sub.advapi32.dll_RegQueryValueExA
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x403080
mov eax, dword [ebp - 4]
push eax
call sub.advapi32.dll_RegCloseKey
ret
mov ax, word [0x4e4024]
and ax, 0xffc0
mov dx, word [ebp - 8]
and dx, 0x3f
or ax, dx
mov word [0x4e4024], ax
mov esp, ebp
pop ebp
ret

Function at 0x403d64
Capabilities:
Write file on windows

Disassembly:
push ecx
cmp byte [0x4e7048], 0
je 0x403dc5
cmp word [0x4e721c], 0xd7b2
jne 0x403d8d
cmp dword [0x4e7224], 0
jbe 0x403d8d
mov eax, 0x4e7218
call dword [0x4e7234]
push 0
lea eax, [esp + 4]
push eax
push 0x1e
push 0x4e4070
push 0xfffffffffffffff5
call sub.kernel32.dll_GetStdHandle
push eax
call sub.kernel32.dll_WriteFile
push 0
lea eax, [esp + 4]
push eax
push 2
push 0x403dec
push 0xfffffffffffffff5
call sub.kernel32.dll_GetStdHandle
push eax
call sub.kernel32.dll_WriteFile
pop edx
ret
cmp byte [0x4e4034], 0
jne 0x403de1
push 0
push 0x4e4068
push 0x4e4070
push 0
call sub.user32.dll_MessageBoxA
pop edx
ret
Function at 0x405488
Capabilities:
Get geographical location
Query or enumerate registry 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_GetModuleFileNameA
mov byte [ebp - 0x12], 0
lea eax, [ebp - 8]
push eax
push 0xf0019
push 0
push 0x4056b8
push 0x80000001
call sub.advapi32.dll_RegOpenKeyExA
test eax, eax
je 0x40550b
lea eax, [ebp - 8]
push eax
push 0xf0019
push 0
push 0x4056b8
push 0x80000002
call sub.advapi32.dll_RegOpenKeyExA
test eax, eax
je 0x40550b
lea eax, [ebp - 8]
push eax
push 0xf0019
push 0
push 0x4056d4
push 0x80000001
call sub.advapi32.dll_RegOpenKeyExA
test eax, eax
jne 0x405594
xor eax, eax
push ebp
push 0x40558d
push dword fs:[eax]
mov dword fs:[eax], esp
mov dword [ebp - 0x18], 5
lea eax, [ebp - 0x11d]
mov edx, 0x105
call fcn.004052d0
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.advapi32.dll_RegQueryValueExA
test eax, eax
je 0x405572
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x12]
push eax
push 0
push 0
push 0x4056f4
mov eax, dword [ebp - 8]
push eax
call sub.advapi32.dll_RegQueryValueExA
test eax, eax
je 0x405572
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 0x405594
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_lstrcpynA
push 5
lea eax, [ebp - 0xd]
push eax
push 3
call sub.kernel32.dll_GetThreadLocale
push eax
call sub.kernel32.dll_GetLocaleInfoA
xor esi, esi
cmp byte [ebp - 0x11d], 0
je 0x4056ae
cmp byte [ebp - 0xd], 0
jne 0x4055db
cmp byte [ebp - 0x12], 0
je 0x4056ae
lea eax, [ebp - 0x11d]
push eax
call sub.kernel32.dll_lstrlenA
mov ebx, eax
lea eax, [ebp - 0x11d]
add ebx, eax
jmp 0x4055f4
dec ebx
cmp byte [ebx], 0x2e
je 0x405603
lea eax, [ebp - 0x11d]
cmp ebx, eax
jne 0x4055f3
lea eax, [ebp - 0x11d]
cmp ebx, eax
je 0x4056ae
inc ebx
cmp byte [ebp - 0x12], 0
je 0x405640
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_lstrcpynA
push 2
push 0
lea eax, [ebp - 0x11d]
push eax
call sub.kernel32.dll_LoadLibraryExA
mov esi, eax
test esi, esi
jne 0x4056ae
cmp byte [ebp - 0xd], 0
je 0x4056ae
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_lstrcpynA
push 2
push 0
lea eax, [ebp - 0x11d]
push eax
call sub.kernel32.dll_LoadLibraryExA
mov esi, eax
test esi, esi
jne 0x4056ae
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_lstrcpynA
push 2
push 0
lea eax, [ebp - 0x11d]
push eax
call sub.kernel32.dll_LoadLibraryExA
mov esi, eax
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x405d80
Capabilities:
Get geographical location

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 0x405de6
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_GetLocaleInfoA
lea eax, [ebp - 0x10]
lea edx, [ebp - 0xb]
mov ecx, 7
call fcn.00404170
mov eax, dword [ebp - 0x10]
lea edx, [ebp - 4]
call fcn.00402ba8
mov ebx, eax
cmp dword [ebp - 4], 0
je 0x405dd0
xor ebx, ebx
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x405ded
lea eax, [ebp - 0x10]
call fcn.00403f00
ret

Function at 0x40b2ec
Capabilities:
Get geographical location

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff00
push ebx
push esi
mov esi, ecx
mov ebx, dword [ebp + 8]
push pe_nt_image_headers32
lea ecx, [ebp - 0x100]
push ecx
push edx
push eax
call sub.kernel32.dll_GetLocaleInfoA_1
test eax, eax
jle 0x40b325
mov ecx, eax
dec ecx
lea edx, [ebp - 0x100]
mov eax, ebx
call fcn.00403ff0
jmp 0x40b32e
mov eax, ebx
mov edx, esi
call fcn.00403f54
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4

Function at 0x40b338
Capabilities:
Get geographical location

Disassembly:
push ebx
push esi
push edi
push ecx
mov ebx, ecx
mov esi, edx
mov edi, eax
push 2
lea eax, [esp + 4]
push eax
push esi
push edi
call sub.kernel32.dll_GetLocaleInfoA_1
test eax, eax
jle 0x40b359
mov al, byte [esp]
jmp 0x40b35b
mov eax, ebx
pop edx
pop edi
pop esi
pop ebx
ret

Function at 0x40b9e0
Capabilities:
Write file on windows

Disassembly:
add esp, 0xfffffbbc
push 0x400
lea ecx, [esp + 0x48]
call 0x40b858
mov eax, dword [0x4e6b40]
cmp byte [eax], 0
je 0x40ba5c
mov eax, dword [0x4e6924]
call fcn.004029bc
call fcn.00402824
lea eax, [esp + 0x44]
push eax
lea eax, [esp + 0x48]
push eax
call sub.user32.dll_CharToOemA
push 0
lea eax, [esp + 4]
push eax
lea eax, [esp + 0x4c]
call fcn.00408a10
push eax
lea eax, [esp + 0x50]
push eax
push 0xfffffffffffffff4
call sub.kernel32.dll_GetStdHandle_1
push eax
call sub.kernel32.dll_WriteFile_1
push 0
lea eax, [esp + 4]
push eax
push 2
push 0x40baa4
push 0xfffffffffffffff4
call sub.kernel32.dll_GetStdHandle_1
push eax
call sub.kernel32.dll_WriteFile_1
jmp 0x40ba92
push 0x40
lea eax, [esp + 8]
push eax
mov eax, dword [0x4e68c4]
mov eax, dword [eax + 4]
push eax
mov eax, dword [0x4e7664]
call fcn.00405294
push eax
call sub.user32.dll_LoadStringA_1
push 0x2010
lea eax, [esp + 8]
push eax
lea eax, [esp + 0x4c]
push eax
push 0
call sub.user32.dll_MessageBoxA_1
add esp, 0x444
ret