joyce8/EMBER2024-capa huggingface dataset:
Function at 0x45f180
Capabilities:
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4a55f8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
push ebx
push esi
push edi
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x10], esp
mov al, byte [ecx + 0x14]
mov dword [ebp - 4], 0
test al, al
jne 0x45f220
lea ebx, [ecx + 4]
mov edi, 0x4f2360
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
mov esi, ecx
mov ecx, ebx
push esi
mov dword [ebp - 0x18], esi
call fcn.0045f6e0
test al, al
je 0x45f1fa
mov edi, dword [ebx + 4]
mov ecx, esi
mov eax, ecx
mov esi, 0x4f2360
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebx + 8], eax
mov ebx, dword [ebx + 4]
add ebx, eax
mov byte [ebx], 0
push 1
lea ecx, [ebp + 8]
mov dword [ebp - 4], 0xffffffff
call fcn.004668c0
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [ebp + 0xc]
mov bl, 1
test eax, eax
mov byte [ebp - 4], bl
jne 0x45f231
mov eax, 0x4d19b4
mov edx, dword [ebp + 0x10]
push 0
push edx
push eax
mov eax, dword [ecx + 0x58]
push eax
call sub.WS2_32.dll_send
cmp eax, 0xffffffff
jne 0x45f375
lea ecx, [ebp - 0x1c]
push 0x4dbb40
push ecx
mov dword [ebp - 0x1c], 1
call fcn.00475832
mov eax, dword [ebp - 0x20]
mov byte [ebp - 0x11], 0
dec eax
jne 0x45f2b4
mov edi, 0x4f2374
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [ebp - 0x18]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea ebx, [edx + 4]
mov esi, ecx
push 1
push esi
mov ecx, ebx
mov dword [ebp - 0x18], esi
call fcn.0045f6e0
test al, al
je 0x45f2b4
mov edi, dword [ebx + 4]
mov ecx, esi
mov eax, ecx
mov esi, 0x4f2374
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebx + 8], eax
mov ebx, dword [ebx + 4]
add ebx, eax
mov byte [ebx], 0
mov eax, 0x45f372
ret
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x45f398
mov al, byte [ecx - 1]
test al, al
je 0x45f38e
cmp al, 0xff
je 0x45f38e
dec al
mov byte [ecx - 1], al
jmp 0x45f398
dec ecx
push ecx
call fcn.00495f7b
add esp, 4
mov ecx, dword [ebp - 0xc]
pop edi
mov al, bl
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 0x10

Function at 0x45f3b0
Capabilities:
Get socket status

Disassembly:
sub esp, 0x10c
push ebx
push esi
mov esi, ecx
mov eax, 0x10624dd3
mov ecx, dword [esp + 0x118]
xor bl, bl
imul ecx
sar edx, 6
mov eax, edx
mov dword [esp + 0xc], ecx
shr eax, 0x1f
add edx, eax
mov eax, dword [esi + 0x58]
lea ecx, [esp + 8]
mov dword [esp + 8], edx
push ecx
mov dword [esp + 0x18], eax
push 0
lea edx, [esp + 0x18]
push 0
inc eax
push edx
push eax
mov dword [esp + 0x24], 1
call sub.WS2_32.dll_select
cmp eax, 0xffffffff
jne 0x45f412
pop esi
xor al, al
pop ebx
add esp, 0x10c
ret 4
test eax, eax
jle 0x45f42a
mov ecx, dword [esi + 0x58]
lea eax, [esp + 0x10]
push eax
push ecx
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
mov al, 1
jne 0x45f42c
mov al, bl
pop esi
pop ebx
add esp, 0x10c
ret 4
Function at 0x467230
Capabilities:
Connect socket
Resolve dns

Disassembly:
sub esp, 0x10
push esi
mov esi, ecx
mov word [esp + 4], 2
mov ax, word [esi + 0x18]
push eax
call sub.WS2_32.dll_htons
mov word [esp + 6], ax
mov eax, dword [esi + 0xc]
test eax, eax
jne 0x467258
mov eax, 0x4d1b64
push eax
call sub.WS2_32.dll_inet_addr
cmp eax, 0xffffffff
mov dword [esp + 8], eax
jne 0x467288
mov esi, dword [esi + 0xc]
test esi, esi
jne 0x467273
mov esi, 0x4d1b64
push esi
call sub.WS2_32.dll_gethostbyname
test eax, eax
je 0x4672aa
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
mov eax, dword [edx]
mov dword [esp + 8], eax
mov edx, dword [esp + 0x18]
lea ecx, [esp + 4]
push 0x10
push ecx
push edx
call sub.WS2_32.dll_connect
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov eax, ecx
pop esi
add esp, 0x10
ret 4
xor eax, eax
pop esi
add esp, 0x10
ret 4
Function at 0x46de50
Capabilities:
Access peb ldr_data
Get ntdll base address

Disassembly:
push 0xffffffffffffffff
push 0x4a6108
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2c
mov eax, dword [esp + 0x40]
push ebx
push esi
lea ecx, [esp + 8]
push eax
push ecx
mov ecx, dword [esp + 0x4c]
call fcn.0046e240
mov esi, eax
lea edx, [esp + 0x48]
xor ebx, ebx
push edx
lea ecx, [esp + 0x1c]
mov dword [esp + 0x40], ebx
mov dword [esp + 0x4c], 0x54da94
call fcn.00475788
mov ecx, dword [0x4d1c40]
mov al, byte [esi]
push ecx
push ebx
push esi
lea ecx, [esp + 0x30]
mov byte [esp + 0x48], 1
mov byte [esp + 0x30], al
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], ebx
call fcn.0046b630
mov esi, 0x4d1c98
mov dword [esp + 0x18], esi
mov eax, dword [esp + 0xc]
mov byte [esp + 0x3c], 3
cmp eax, ebx
je 0x46def7
lea ecx, [eax - 1]
mov al, byte [eax - 1]
cmp al, bl
je 0x46deee
cmp al, 0xff
je 0x46deee
dec al
mov byte [ecx], al
jmp 0x46def7
push ecx
call fcn.00495f7b
add esp, 4
lea ecx, [esp + 0x18]
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], ebx
call fcn.00492230
mov eax, dword [esp + 0x28]
mov dword [esp + 0x3c], 0xffffffff
cmp eax, ebx
mov dword [esp + 0x18], esi
je 0x46df3d
lea ecx, [eax - 1]
mov al, byte [eax - 1]
cmp al, bl
je 0x46df34
cmp al, 0xff
je 0x46df34
dec al
mov byte [ecx], al
jmp 0x46df3d
push ecx
call fcn.00495f7b
add esp, 4
lea ecx, [esp + 0x18]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
call fcn.0047580f
mov ecx, dword [esp + 0x34]
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x38
ret
Function at 0x48c8c0
Capabilities:
Access peb ldr_data
Get kernel32 base address

Disassembly:
push 0xffffffffffffffff
push 0x4a7150
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2c
mov al, byte [esp + 0x3c]
push ebx
xor ebx, ebx
push esi
mov esi, ecx
mov byte [esp + 0x10], al
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], ebx
mov ecx, dword [esp + 0x44]
push ebx
mov dword [esp + 0x40], ebx
mov byte [esp + 0x28], al
mov edx, dword [ecx]
lea ecx, [esp + 0x28]
mov dword [esp + 0x24], edx
call fcn.00481596
mov eax, dword [0x4d49a0]
lea ecx, [esp + 0x10]
push eax
push ebx
push ecx
lea ecx, [esp + 0x30]
call fcn.004814c8
lea edx, [esp + 0x20]
lea eax, [esp + 8]
push edx
push eax
mov ecx, esi
mov byte [esp + 0x44], 1
call fcn.0048d380
mov esi, dword [eax]
mov ecx, dword [eax + 4]
mov eax, dword [esp + 0x28]
cmp eax, ebx
mov dword [esp + 0xc], ecx
je 0x48c967
lea ecx, [eax - 1]
mov al, byte [eax - 1]
cmp al, bl
je 0x48c95e
cmp al, 0xff
je 0x48c95e
dec al
mov byte [ecx], al
jmp 0x48c967
push ecx
call fcn.00495f7b
add esp, 4
mov eax, dword [esp + 0x14]
mov dword [esp + 0x28], ebx
cmp eax, ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
je 0x48c998
lea ecx, [eax - 1]
mov al, byte [eax - 1]
cmp al, bl
je 0x48c98f
cmp al, 0xff
je 0x48c98f
dec al
mov byte [ecx], al
jmp 0x48c998
push ecx
call fcn.00495f7b
add esp, 4
mov ecx, dword [esp + 0x34]
lea eax, [esi + 0x10]
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x38
ret 4
Function at 0x4985b5
Capabilities:
Get graphical window text

Disassembly:
push esi
mov esi, ecx
mov ecx, dword [esi + 0x38]
test ecx, ecx
jne 0x4985ed
push dword [esi + 0x1c]
call dword [sym.imp.USER32.dll_GetWindowTextLengthA]
lea ecx, [eax + 1]
push ecx
mov ecx, dword [esp + 0xc]
push eax
call fcn.0049666c
push eax
push dword [esi + 0x1c]
call dword [sym.imp.USER32.dll_GetWindowTextA]
mov ecx, dword [esp + 8]
push 0xffffffffffffffff
call fcn.00496644
jmp 0x4985f9
mov eax, dword [ecx]
push dword [esp + 8]
call dword [eax + 0x88]
pop esi
ret 4

Function at 0x499ca7
Capabilities:
Extract resource via kernel32 functions

Disassembly:
push ebx
push esi
push edi
xor edi, edi
cmp dword [esp + 0x10], edi
mov ebx, ecx
je 0x499ce9
call fcn.0049f9aa
mov esi, dword [eax + 0xc]
push 0xf0
push dword [esp + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_FindResourceA]
cmp eax, edi
je 0x499ce9
push eax
push esi
call dword [sym.imp.KERNEL32.dll_LoadResource]
cmp eax, edi
jne 0x499ce0
xor eax, eax
jmp 0x499cf1
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov edi, eax
push edi
mov ecx, ebx
call fcn.00499cf7
pop edi
pop esi
pop ebx
ret 4

Function at 0x49feda
Capabilities:
Get thread local storage value

Disassembly:
push ebx
push esi
mov esi, ecx
lea ebx, [esi + 0x1c]
push ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [esp + 0x10], 0
jne 0x49ff08
push dword [esi]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x49ff26
push dword [esp + 0xc]
mov ecx, esi
push eax
call fcn.0049fe40
jmp 0x49ff26
mov eax, dword [esi + 0x14]
test eax, eax
je 0x49ff26
push edi
push dword [esp + 0x10]
mov edi, dword [eax + 4]
mov ecx, esi
push eax
call fcn.0049fe40
test edi, edi
mov eax, edi
jne 0x49ff10
pop edi
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
pop esi
pop ebx
ret 8
Function at 0x406de0
Capabilities:
Hide graphical window

Disassembly:
push 0
mov eax, dword [0x40a930]
push eax
call sub.user32.dll_ShowWindow
push 0xffffffffffffffec
mov eax, dword [0x40a930]
push eax
call sub.user32.dll_GetWindowLongA
or eax, 0x80
push eax
push 0xffffffffffffffec
mov eax, dword [0x40a930]
push eax
call sub.user32.dll_SetWindowLongA
push 5
mov eax, dword [0x40a930]
push eax
call sub.user32.dll_ShowWindow
ret

Function at 0x499c76
Capabilities:
Encode data using xor

Disassembly:
inc esi
insd dword es:[edi], dx
jae 0x499c85
lahf
push eax
sub ecx, esi
sub byte [esi - 0x73], dh
dec esp
mov sp, word [eax - 5]
lea ecx, [esi - 0x75]
pushal
sti
and ecx, ebp
xor dword [ebx], eax
sal byte [ecx], 0x39
or byte [edx + 0x22], dh
lahf
stosd dword es:[edi], eax
mov byte [edx + 0x1c], 0xeb
sbb ebx, dword [eax + 0x2b]
dec ebx
cmp eax, 0x25e00e11
or dl, byte [eax + 0x10]
cmp ecx, dword [ebp + ecx + 0x3272f2c4]
add dword [ebx + 0x5f], esi
jecxz 0x499c80
sub dword [ecx + 0x2e118c48], 0x2814d179
push ss
daa
sub ch, byte [edx + 0x2a]
and dword ds:[ebx - 0x28], edx
pushal
dec eax
je 0x499ccb
jge 0x499cd5
sub al, 0x6c
xor byte ss:[eax], ch
xor byte [eax], ch
ja 0x499cfa
enter 0xffffffffffffabf3, 0x60
xlatb
loopne 0x499cf3
sbb eax, 0xa1430167
add dword [bp + di - 0x5f], eax
hlt
cmp dl, byte [eax - 0x697ca61f]
push eax
aam 0x4c
xor al, 0xa5
cmp eax, ebx
push eax
imul edx, eax, 0xe28bd15e
movsd dword es:[edi], dword [esi]
xor dword [eax], edx
and bh, byte [eax]
sub al, 0x40
hlt

Function at 0x49e204
Capabilities:
Encode data using xor

Disassembly:
sahf
or ecx, dword [eax*8 + 0x588dc6f3]
fimul word [ebp + eax - 0x28]
and byte [ebx], bh
invalid
Function at 0x40c730
Capabilities:
Get disk information

Disassembly:
push 0xffffffffffffffff
push 0x46e221
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
mov eax, dword [0x48e820]
xor eax, esp
mov dword [esp + 0x44], eax
push ebp
push esi
push edi
mov eax, dword [0x48e820]
xor eax, esp
push eax
lea eax, [esp + 0x5c]
mov dword fs:[0], eax
mov eax, dword [esp + 0x6c]
xor esi, esi
mov dword [esp + 0x64], esi
lea ecx, [esp + 0x20]
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], esi
call fcn.00430f0c
mov ebp, 1
mov dword [esp + 0x64], ebp
call fcn.0043adc8
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x40c79f
push 0x80004005
call fcn.0040fef0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov byte [esp + 0x64], 2
mov edi, 2
call fcn.0043adc8
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
je 0x40c795
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
lea ecx, [edi + 0x41]
push ecx
lea edx, [esp + 0x18]
push 0x47b238
push edx
mov byte [esp + 0x70], 3
call fcn.00410070
mov esi, dword [esp + 0x20]
lea edx, [esp + 0x50]
add esp, 0xc
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, ebp
test cl, cl
jne 0x40c800
lea eax, [esp + 0x44]
push eax
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
cmp eax, 3
jne 0x40c82e
mov edx, dword [esp + 0x28]
lea ecx, [esp + 0x44]
push ecx
push edx
lea ecx, [esp + 0x28]
call fcn.004313be
lea eax, [esi - 0x10]
mov byte [esp + 0x64], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c84f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
add edi, ebp
cmp edi, 0x19
jle 0x40c7b9
mov ecx, dword [esp + 0x10]
push 0x47b240
call fcn.00410560
mov eax, dword [esp + 0x28]
xor edi, edi
xor esi, esi
test eax, eax
mov dword [esp + 0x1c], ebp
jle 0x40c8dd
mov ebp, dword [sym.imp.SHELL32.dll_SHGetDiskFreeSpaceExA]
mov edi, edi
test esi, esi
jl 0x40c932
cmp esi, eax
jge 0x40c932
mov ecx, dword [esp + 0x24]
mov eax, dword [ecx + esi*4]
lea edx, [esp + 0x34]
push edx
lea ecx, [esp + 0x40]
push ecx
push 0
push eax
call ebp
mov eax, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
shrd eax, edx, 0xa
shr edx, 0xa
cmp eax, edi
jbe 0x40c8d2
cmp esi, dword [esp + 0x28]
mov edi, eax
jge 0x40c932
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x10]
lea eax, [eax + esi*4]
push eax
call fcn.004104e0
mov eax, dword [esp + 0x28]
add esi, 1
cmp esi, eax
jl 0x40c880
mov byte [esp + 0x64], 1
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c902
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x20]
mov byte [esp + 0x64], 0
call fcn.00430ffe
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x5c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
mov ecx, dword [esp + 0x44]
xor ecx, esp
call fcn.004540ed
add esp, 0x58
ret
jmp fcn.0043af6a
Function at 0x401f10
Capabilities:
Get disk information
Inspect load icon resource
Read file on windows

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x148
push ebx
push esi
push edi
push 0x65
push eax
call dword [sym.imp.USER32.dll_LoadIconA]
lea ecx, [esp + 0xc]
call fcn.00401000
lea ecx, [esp + 0x50]
push 0x104
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edx, [esp + 0x50]
lea ecx, [esp + 0xc]
push edx
call fcn.004012b0
test eax, eax
je 0x402021
lea eax, [esp + 0x50]
push 0x404030
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
test esi, esi
je 0x402084
lea ecx, [esp + 0x50]
push ecx
lea ecx, [esp + 0x10]
call fcn.00401290
mov edi, dword [sym.imp.MSVCRT.dll_fseek]
sub eax, 8
push 0
push eax
push esi
call edi
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
push esi
push 1
lea edx, [esp + 0x24]
push 8
push edx
call ebx
mov eax, dword [esp + 0x2c]
push 0
push eax
push esi
call edi
push esi
push 1
lea ecx, [esp + 0x48]
push 0x38
push ecx
call ebx
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x88]
mov edx, dword [esp + 0x50]
add esp, 0x3c
test eax, eax
mov eax, dword [esp + 0x10]
push edx
push eax
jne 0x401ffe
sub esp, 0x38
mov ecx, 0xe
lea esi, [esp + 0x58]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x90]
push ecx
lea ecx, [esp + 0x50]
call fcn.00401800
jmp 0x402084
sub esp, 0x38
mov ecx, 0xe
lea esi, [esp + 0x58]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
lea ecx, [esp + 0x90]
push ecx
lea ecx, [esp + 0x50]
call fcn.00401a90
jmp 0x402084
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString_1
call dword [sym.imp.KERNEL32.dll_GetLogicalDrives]
mov edi, eax
mov esi, 1
xor ebx, ebx
test edi, esi
je 0x40206a
mov dl, bl
lea ecx, [esp + 0x10]
add dl, 0x41
push edx
call sub.MFC42.DLL_CString::operator_1
push 0x40412c
lea ecx, [esp + 0x14]
call fcn.004020e2
lea ecx, [esp + 0xc]
mov eax, dword [esp + 0x10]
push eax
push 0
call fcn.00401cf0
add esi, esi
inc ebx
cmp ebx, 0x1a
jl 0x402039
lea ecx, [esp + 0xc]
call fcn.00401040
lea ecx, [esp + 0x10]
call sub.MFC42.DLL_CString::CString
lea ecx, [esp + 0xc]
call fcn.00401030
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x148
ret 0x10

Function at 0x40894d
Capabilities:
Encode data using xor

Disassembly:
sub esp, 4
mov dword [esp], 0x4085d8
pop ebx
sub esi, 0x39fb6517
call fcn.00408979
xor dword [edx], ebx
add esi, esi
add edx, 1
inc esi
add esi, 1
cmp edx, edi
jne fcn.0040894d
ret
Function at 0x404654
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
push 0x40
lea eax, [ebp - 0x40]
push eax
push str.username
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
jne 0x40467d
mov byte [0x41e960], 0
jmp 0x40468e
lea ecx, [ebp - 0x40]
push ecx
push 0x41e960
call fcn.00407c70
add esp, 8
mov esp, ebp
pop ebp
ret

Function at 0x404692
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov dword [ebp - 0x10], str.OSQLUSER
mov dword [ebp - 0xc], str.OSQLPASSWORD
mov dword [ebp - 8], str.OSQLSERVER
mov eax, dword [ebp + 8]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x4046c7
cmp dword [ebp - 0x18], 1
je 0x4046d7
cmp dword [ebp - 0x18], 2
je 0x4046e7
jmp 0x4046f5
mov dword [ebp - 4], 0x41f780
mov dword [ebp - 0x14], 0x80
jmp 0x4046f5
mov dword [ebp - 4], 0x41f620
mov dword [ebp - 0x14], 0x80
jmp 0x4046f5
mov dword [ebp - 4], 0x41f940
mov dword [ebp - 0x14], 0x3d
mov ecx, dword [ebp - 4]
mov byte [ecx], 0
mov edx, dword [ebp - 0x14]
push edx
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + ecx*4 - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x40471e
xor eax, eax
jmp 0x404744
cmp dword [ebp + 8], 1
jne 0x40473f
push 0x41a968
mov eax, dword [ebp - 4]
push eax
call fcn.0040a7f0
add esp, 8
test eax, eax
jne 0x40473f
mov ecx, dword [ebp - 4]
mov byte [ecx], 0
mov eax, 1
mov esp, ebp
pop ebp
ret

Function at 0x404fcf
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
push 0x41acb0
call fcn.00407d60
add esp, 4
push 0x41acd0
call fcn.00407d60
add esp, 4
push 0
push 0x404f29
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
cmp dword [0x41e400], 0
jne 0x40501a
cmp dword [ebp + 8], 0xffffffff
jne 0x40501a
cmp dword [0x41e438], 0x7f
je 0x40501a
mov dword [ebp + 8], 1
jmp 0x405045
cmp dword [0x41e400], 0
jne 0x405045
cmp dword [0x41e438], 0x7f
jne 0x405045
cmp dword [0x41e43c], 0
jl 0x405045
cmp dword [0x41e43c], 0xa
jg 0x405045
mov dword [ebp + 8], 0
cmp dword [0x41e454], 0
je 0x405067
mov eax, dword [0x41e454]
push eax
call sub.ODBC32.dll_SQLDisconnect
mov ecx, dword [0x41e454]
push ecx
push 2
call sub.ODBC32.dll_SQLFreeHandle
cmp dword [0x41e450], 0
je 0x40507e
mov edx, dword [0x41e450]
push edx
push 1
call sub.ODBC32.dll_SQLFreeHandle
cmp dword [0x41e46c], 0
je 0x40509d
mov eax, dword [0x41e470]
cmp eax, dword [0x41e46c]
jl 0x40509d
mov ecx, dword [0x41e470]
mov dword [ebp + 8], ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_ExitProcess]
Function at 0x405b30
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0x41acd0
call fcn.00407d60
add esp, 4
push 0x41acb0
call fcn.00407d60
add esp, 4
cmp dword [0x41f6a4], 0
jne 0x405b6d
push 0xb9
push 0x41abc4
push str.NULL___hConsoleOutput
call fcn.00409740
add esp, 0xc
call fcn.0040582f
test eax, eax
je 0x405b9e
push 0
push 0x41e478
mov ecx, dword [ebp + 8]
push ecx
call fcn.004085d0
add esp, 4
shl eax, 1
push eax
mov edx, dword [ebp + 8]
push edx
mov eax, dword [0x41f6a4]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x405bba
push 0x41e478
mov ecx, dword [0x41f6a4]
push ecx
push 0xffffffffffffffff
mov edx, dword [ebp + 8]
push edx
push 1
call fcn.00405bbc
add esp, 0x14
pop ebp
ret

Function at 0x405bbc
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10c
mov dword [ebp - 8], 0x100
mov dword [ebp - 0xc], 0
cmp dword [ebp + 0x10], 0xffffffff
jne 0x405be8
mov eax, dword [ebp + 0xc]
push eax
call fcn.004085d0
add esp, 4
mov dword [ebp + 0x10], eax
mov ecx, dword [ebp + 0x10]
shl ecx, 1
cmp ecx, dword [ebp - 8]
jle 0x405c12
mov edx, dword [ebp + 0x10]
shl edx, 1
mov dword [ebp - 8], edx
mov eax, dword [ebp - 8]
push eax
call fcn.00407820
add esp, 4
mov dword [ebp - 4], eax
mov dword [ebp - 0xc], 1
jmp 0x405c1b
lea ecx, [ebp - 0x10c]
mov dword [ebp - 4], ecx
push 0
push 0
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
push 0
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 8], eax
push 0
mov ecx, dword [ebp + 0x18]
push ecx
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [ebp - 0xc], 0
je 0x405c68
mov edx, dword [ebp - 4]
push edx
call fcn.004078d0
add esp, 4
mov eax, 1
mov esp, ebp
pop ebp
ret

Function at 0x405f22
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0x41acd0
call fcn.00407d60
add esp, 4
push 0x41acb0
call fcn.00407d60
add esp, 4
call fcn.0040582f
test eax, eax
je 0x405f68
push 0
push 0x41e474
mov eax, dword [ebp + 0xc]
shl eax, 1
push eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [0x41f6a4]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x405f85
push 0x41e474
mov eax, dword [0x41f6a4]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
push 1
call fcn.00405bbc
add esp, 0x14
pop ebp
ret
Function at 0x4091a0
Capabilities:
Terminate process

Disassembly:
mov eax, dword [0x41e624]
push ebx
push ebp
mov ebp, dword [esp + 0xc]
cmp eax, 1
push esi
jne 0x4091bf
push ebp
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov eax, dword [esp + 0x14]
mov ebx, dword [esp + 0x18]
test eax, eax
mov dword [0x41e620], 1
mov byte [0x41e61c], bl
jne 0x409219
mov ecx, dword [0x41fcc8]
test ecx, ecx
je 0x409207
mov esi, dword [0x41fcc4]
sub esi, 4
cmp esi, ecx
jb 0x409207
mov eax, dword [esi]
test eax, eax
je 0x409200
call eax
mov ecx, dword [0x41fcc8]
sub esi, 4
cmp esi, ecx
jae 0x4091f2
push 0x41a020
push 0x41a018
call fcn.00409250
add esp, 8
push 0x41a028
push 0x41a024
call fcn.00409250
add esp, 8
test ebx, ebx
jne 0x409240
push ebp
mov dword [0x41e624], 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]
pop esi
pop ebp
pop ebx
ret

Function at 0x40a960
Capabilities:
Delete file

Disassembly:
mov eax, dword [esp + 4]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x40a977
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40a979
xor eax, eax
test eax, eax
je 0x40a98a
push eax
call fcn.0040c770
add esp, 4
or eax, 0xffffffff
ret
xor eax, eax
ret