Function at 0x403840
Capabilities:
Read file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x4310]
mov eax, 0x4310
call fcn.0040fca0
push 0xffffffffffffffff
push 0x41105f
mov eax, dword fs:[0]
push eax
sub esp, 0x80
mov eax, dword [0x4171a4]
xor eax, ebp
mov dword [ebp + 0x430c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov ecx, dword [ebp + 0x4318]
cmp ecx, 2
mov eax, dword [ebp + 0x431c]
mov dword [ebp - 0x14], eax
jl 0x4041f3
jne 0x4038f4
mov eax, dword [eax + 4]
mov edi, 0x4137e4
mov esi, eax
mov ecx, 3
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x4041f3
mov edi, 0x4137e0
mov esi, eax
mov ecx, 3
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
je 0x4038da
mov esi, eax
mov edi, 0x4137dc
mov ecx, 3
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x4038f4
push str.WI_V2.5.2.26540_Firebird_2.5
push str.Firebird_services_manager_version__s_n
call dword [sym.imp.MSVCR80.dll_printf]
add esp, 8
xor eax, eax
jmp 0x4041fd
push 0x401470
push 2
call dword [sym.imp.MSVCR80.dll_signal]
add esp, 8
xor edi, edi
push edi
push 1
push 0x401490
push edi
mov dword [0x4171e0], eax
call sub.fbclient.dll_fb_shutdown_callback
mov eax, dword [ebp - 0x14]
add eax, 4
mov dword [ebp - 0x14], eax
mov eax, dword [eax]
cmp eax, edi
mov dword [ebp - 4], edi
mov dword [ebp - 0x1c], eax
je 0x403932
add dword [ebp - 0x14], 4
push 2
push 0x4000
push 2
lea ecx, [ebp + 0xc0]
call fcn.0040bc50
mov byte [ebp - 4], 1
lea ebx, [ebx]
push edi
push 0x412c28
lea ecx, [ebp + 0xc0]
push ecx
lea edx, [ebp - 0x14]
push edx
call fcn.00402450
add esp, 0x10
test al, al
jne 0x403950
push edi
push 0x4000
push 3
lea ecx, [ebp + 0x220]
call fcn.0040bc50
push edi
push 0x100
push 7
lea ecx, [ebp + 0x170]
mov byte [ebp - 4], 2
call fcn.0040bc50
lea eax, [ebp + 0x170]
push eax
push 0x4134e8
lea ecx, [ebp + 0x220]
push ecx
lea edx, [ebp - 0x14]
push edx
mov byte [ebp - 4], 3
call fcn.00402450
mov eax, dword [ebp + 0x220]
mov edx, dword [eax + 8]
add esp, 0x10
lea ecx, [ebp + 0x220]
call edx
mov esi, eax
mov eax, dword [ebp + 0x220]
mov edx, dword [eax + 4]
lea ecx, [ebp + 0x220]
call edx
sub esi, eax
cmp esi, 1
jne 0x403a00
mov eax, dword [ebp + 0x22c]
cmp eax, esi
je 0x403a21
cmp eax, 3
je 0x403a21
cmp eax, 6
je 0x403a21
cmp eax, 7
je 0x403a21
jmp 0x403a04
cmp esi, edi
jne 0x403a21
push edi
push 0x412ca0
lea eax, [ebp + 0x170]
push eax
lea ecx, [ebp - 0x14]
push ecx
call fcn.00402450
add esp, 0x10
test al, al
jne 0x403a04
mov eax, dword [ebp - 0x14]
cmp dword [eax], edi
je 0x403acf
mov edx, dword [eax]
mov edi, 0x4137e0
mov esi, edx
mov ecx, 3
xor ebx, ebx
repe cmpsb byte [esi], byte es:[edi]
je 0x403a52
mov esi, edx
mov edi, 0x4137dc
mov ecx, 3
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x403a6e
push str.WI_V2.5.2.26540_Firebird_2.5
push str.Firebird_services_manager_version__s_n
call dword [sym.imp.MSVCR80.dll_printf]
mov eax, dword [ebp - 0x14]
add esp, 8
add eax, 4
mov dword [ebp - 0x14], eax
xor edi, edi
cmp dword [eax], edi
je 0x403acf
mov eax, dword [eax]
push eax
lea ecx, [ebp - 0x18]
call fcn.0040e110
mov ebx, eax
push 0x14160006
lea ecx, [ebp - 0x24]
call fcn.0040e530
mov esi, eax
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 0x2c]
push ebx
mov byte [ebp - 4], 5
call eax
push esi
call fcn.0040cea0
mov ecx, dword [ebp - 0x24]
add esp, 4
cmp ecx, edi
mov byte [ebp - 4], 4
je 0x403abb
mov edx, dword [ecx]
mov eax, dword [edx + 0x34]
push 1
call eax
mov ecx, dword [ebp - 0x18]
cmp ecx, edi
mov byte [ebp - 4], 3
je 0x403acf
mov edx, dword [ecx]
mov eax, dword [edx + 0x34]
push 1
call eax
push 0x6f
lea ecx, [ebp + 0xc0]
call fcn.004093d0
test al, al
jne 0x403bb1
call fcn.00405540
lea ecx, [ebp + 0x2d4]
mov dword [ebp + 0x2d0], eax
mov dword [ebp + 0x2f4], ecx
mov word [ebp + 0x2f8], di
mov word [ebp + 0x2fa], 0x20
mov byte [ebp + 0x2d4], 0
push 0x1c
lea ecx, [ebp + 0xc0]
mov byte [ebp - 4], 6
call fcn.004093d0
test al, al
jne 0x403b53
lea edx, [ebp + 0x2d0]
push edx
push str.ISC_USER
call fcn.00409c60
add esp, 8
test al, al
je 0x403b53
lea eax, [ebp + 0x2d0]
push eax
push 0x1c
lea ecx, [ebp + 0xc0]
call fcn.0040bda0
push 0x1d
lea ecx, [ebp + 0xc0]
call fcn.004093d0
test al, al
jne 0x403b90
lea ecx, [ebp + 0x2d0]
push ecx
push str.ISC_PASSWORD
call fcn.00409c60
add esp, 8
test al, al
je 0x403b90
lea edx, [ebp + 0x2d0]
push edx
push 0x1d
lea ecx, [ebp + 0xc0]
call fcn.0040bda0
mov eax, dword [ebp + 0x2f4]
lea ecx, [ebp + 0x2d4]
cmp eax, ecx
mov byte [ebp - 4], 3
je 0x403bb1
cmp eax, edi
je 0x403bb1
mov ecx, dword [eax - 4]
push eax
call fcn.004077c0
mov edx, dword [ebp + 0xc0]
mov eax, dword [edx + 8]
lea ecx, [ebp + 0xc0]
mov dword [ebp - 0x20], edi
call eax
mov edx, dword [ebp + 0xc0]
mov esi, eax
mov eax, dword [edx + 4]
lea ecx, [ebp + 0xc0]
call eax
sub esi, eax
cmp esi, 1
jne 0x403bfa
mov eax, dword [ebp + 0xcc]
cmp eax, esi
je 0x403bfa
cmp eax, 3
je 0x403bfa
cmp eax, 6
je 0x403bfa
cmp eax, 7
je 0x403bfa
xor esi, esi
lea ecx, [ebp + 0xc0]
call fcn.0040b0b0
mov edx, dword [ebp - 0x1c]
push eax
push esi
lea ecx, [ebp - 0x20]
push ecx
push edx
push edi
lea eax, [ebp - 0x8c]
push eax
call sub.fbclient.dll_Ordinal_225
cmp eax, edi
je 0x403c5e
lea ecx, [ebp - 0x8c]
push ecx
call sub.fbclient.dll_Ordinal_151
lea ecx, [ebp + 0x170]
mov byte [ebp - 4], 2
call fcn.004037e0
lea ecx, [ebp + 0x220]
mov byte [ebp - 4], 1
call fcn.004037e0
lea ecx, [ebp + 0xc0]
mov byte [ebp - 4], 0
call fcn.004037e0
jmp 0x4041f8
mov edx, dword [ebp + 0x220]
mov eax, dword [edx + 8]
lea ecx, [ebp + 0x220]
call eax
mov edx, dword [ebp + 0x220]
mov esi, eax
mov eax, dword [edx + 4]
lea ecx, [ebp + 0x220]
call eax
sub esi, eax
cmp esi, 1
jne 0x403cff
mov eax, dword [ebp + 0x22c]
cmp eax, esi
je 0x403d03
cmp eax, 3
je 0x403d03
cmp eax, 6
je 0x403d03
cmp eax, 7
je 0x403d03
mov eax, dword [ebp + 0x170]
mov edx, dword [eax + 8]
lea ecx, [ebp + 0x170]
call edx
mov esi, eax
mov eax, dword [ebp + 0x170]
mov edx, dword [eax + 4]
lea ecx, [ebp + 0x170]
call edx
sub esi, eax
cmp esi, 1
jne 0x403d90
mov eax, dword [ebp + 0x17c]
cmp eax, esi
je 0x403d98
cmp eax, 3
je 0x403d98
cmp eax, 6
je 0x403d98
cmp eax, 7
je 0x403d98
jmp 0x4040b6
cmp esi, edi
jbe 0x403ca2
mov edx, dword [ebp + 0x220]
mov eax, dword [edx + 8]
lea ecx, [ebp + 0x220]
call eax
mov edx, dword [ebp + 0x220]
mov esi, eax
mov eax, dword [edx + 4]
lea ecx, [ebp + 0x220]
call eax
sub esi, eax
cmp esi, 1
jne 0x403d49
mov eax, dword [ebp + 0x22c]
cmp eax, esi
je 0x403d49
cmp eax, 3
je 0x403d49
cmp eax, 6
je 0x403d49
cmp eax, 7
je 0x403d49
xor esi, esi
lea ecx, [ebp + 0x220]
call fcn.0040b0b0
push eax
push esi
push edi
lea ecx, [ebp - 0x20]
push ecx
lea edx, [ebp - 0x8c]
push edx
call sub.fbclient.dll_Ordinal_228
cmp eax, edi
je 0x403ca2
lea eax, [ebp - 0x8c]
push eax
call sub.fbclient.dll_Ordinal_151
lea ecx, [ebp - 0x20]
push ecx
lea edx, [ebp - 0x8c]
push edx
call sub.fbclient.dll_Ordinal_226
jmp 0x403c2c
cmp esi, edi
jbe 0x4040b6
push 0x4e
lea ecx, [ebp + 0x170]
call fcn.0040b750
lea ecx, [ebp]
mov byte [ebp + 0x42fc], 0x40
mov byte [ebp + 0x42fd], 4
mov byte [ebp + 0x42fe], 0
mov byte [ebp + 0x42ff], 1
mov byte [ebp + 0x4300], 0
mov byte [ebp + 0x4301], 0
mov byte [ebp + 0x4302], 0
mov byte [ebp + 0x4303], 1
call fcn.00402870
mov byte [ebp - 4], 7
mov dword [ebp - 0x18], edi
call fcn.00405540
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x28], edi
mov byte [ebp - 4], 8
jmp 0x403e13
mov edi, dword [ebp - 0x18]
lea ebx, [ebp + 0x42fc]
lea eax, [ebp + 0x4304]
mov ecx, ebx
sub ax, cx
test edi, edi
movzx edx, ax
mov dword [ebp - 0x1c], edx
je 0x403f33
mov eax, edx
add eax, 0xffff
movzx esi, ax
mov dword [ebp - 0x1c], eax
lea eax, [esi + edi + 3]
cmp eax, 0xfffe
jbe 0x403e56
mov edi, 0xfffb
mov eax, 0xfffe
sub edi, esi
lea ebx, [eax + 1]
mov eax, dword [ebp - 0x2c]
cmp ebx, eax
mov dword [ebp - 0x18], ebx
jbe 0x403eaa
add eax, eax
cmp ebx, eax
jae 0x403e6c
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x34]
push eax
call fcn.004050f0
mov ecx, dword [ebp - 0x30]
mov edx, dword [ebp - 0x28]
push ecx
push edx
push eax
mov dword [ebp - 0x24], eax
call sub.MSVCR80.dll_memcpy
add esp, 0xc
cmp dword [ebp - 0x28], 0
je 0x403e9e
mov ecx, dword [ebp - 0x28]
push ecx
mov ecx, dword [ebp - 0x34]
call fcn.004077c0
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x28]
push esi
lea ecx, [ebp + 0x42fc]
push ecx
push eax
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x24], eax
call sub.MSVCR80.dll_memcpy
mov eax, dword [0x41702c]
add esp, 0xc
cmp eax, 0xffffffff
jne 0x403edb
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [0x41702c], eax
mov ebx, dword [ebp - 0x28]
push 0
lea edx, [ebp - 0x38]
push edx
add esi, ebx
push edi
lea ecx, [esi + 3]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x403f09
push str.stdin
call dword [sym.imp.MSVCR80.dll_perror]
add esp, 4
jmp 0x404097
mov eax, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x24]
mov edx, eax
shr edx, 8
mov byte [esi + 2], dl
lea edx, [ecx + eax + 4]
mov byte [esi], 0x3e
mov byte [esi + 1], al
mov byte [esi + eax + 3], 1
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x18], 0
mov eax, dword [ebp + 0x170]
mov edx, dword [eax + 8]
lea ecx, [ebp + 0x170]
call edx
mov esi, eax
mov eax, dword [ebp + 0x170]
mov edx, dword [eax + 4]
lea ecx, [ebp + 0x170]
call edx
sub esi, eax
cmp esi, 1
jne 0x403f79
mov eax, dword [ebp + 0x17c]
cmp eax, esi
je 0x403f79
cmp eax, 3
je 0x403f79
cmp eax, 6
je 0x403f79
cmp eax, 7
je 0x403f79
xor esi, esi
lea ecx, [ebp + 0x170]
call fcn.0040b0b0
mov edx, dword [ebp - 0x1c]
lea ecx, [ebp + 0x2fc]
push ecx
push 0x4000
push eax
push esi
push ebx
push edx
push 0
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x8c]
push ecx
call sub.fbclient.dll_Ordinal_227
test eax, eax
je 0x404067
lea edx, [ebp - 0x8c]
push edx
call sub.fbclient.dll_Ordinal_151
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x8c]
push ecx
call sub.fbclient.dll_Ordinal_226
mov eax, dword [ebp - 0x28]
test eax, eax
mov byte [ebp - 4], 7
je 0x403fe1
mov ecx, dword [ebp - 0x34]
push eax
call fcn.004077c0
lea ecx, [ebp]
mov byte [ebp - 4], 3
call fcn.00403720
mov eax, dword [ebp + 0x21c]
lea edx, [ebp + 0x194]
cmp eax, edx
mov byte [ebp - 4], 9
je 0x40400d
mov ecx, dword [ebp + 0x190]
push eax
call fcn.004077c0
mov esi, 0x4136a4
mov dword [ebp + 0x170], esi
mov eax, dword [ebp + 0x2cc]
lea ecx, [ebp + 0x244]
cmp eax, ecx
mov byte [ebp - 4], 0xa
je 0x404038
mov ecx, dword [ebp + 0x240]
push eax
call fcn.004077c0
mov dword [ebp + 0x220], esi
mov eax, dword [ebp + 0x16c]
lea edx, [ebp + 0xe4]
cmp eax, edx
mov byte [ebp - 4], 0xb
je 0x4041f8
mov ecx, dword [ebp + 0xe0]
push eax
call fcn.004077c0
jmp 0x4041f8
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp]
push ecx
lea edx, [ebp + 0x2fc]
push 0x4000
push edx
call fcn.00402b30
add esp, 0x10
test al, al
je 0x404094
cmp byte [0x4171e4], 0
je 0x403e10
mov ebx, dword [ebp - 0x28]
test ebx, ebx
mov byte [ebp - 4], 7
je 0x4040a8
mov ecx, dword [ebp - 0x34]
push ebx
call fcn.004077c0
lea ecx, [ebp]
mov byte [ebp - 4], 3
call fcn.00403720
xor edi, edi
lea eax, [ebp - 0x20]
push eax
lea ecx, [ebp - 0x8c]
push ecx
call sub.fbclient.dll_Ordinal_226
cmp eax, edi
je 0x404154
lea edx, [ebp - 0x8c]
push edx
call sub.fbclient.dll_Ordinal_151
mov eax, dword [ebp + 0x21c]
lea ecx, [ebp + 0x194]
cmp eax, ecx
mov byte [ebp - 4], 0xc
je 0x4040fa
mov ecx, dword [ebp + 0x190]
push eax
call fcn.004077c0
mov esi, 0x4136a4
mov dword [ebp + 0x170], esi
mov eax, dword [ebp + 0x2cc]
lea edx, [ebp + 0x244]
cmp eax, edx
mov byte [ebp - 4], 0xd
je 0x404125
mov ecx, dword [ebp + 0x240]
push eax
call fcn.004077c0
mov dword [ebp + 0x220], esi
mov eax, dword [ebp + 0x16c]
lea ecx, [ebp + 0xe4]
cmp eax, ecx
mov byte [ebp - 4], 0xe
je 0x4041f8
mov ecx, dword [ebp + 0xe0]
push eax
call fcn.004077c0
jmp 0x4041f8
mov eax, dword [ebp + 0x21c]
lea edx, [ebp + 0x194]
cmp eax, edx
mov byte [ebp - 4], 0xf
je 0x404174
mov ecx, dword [ebp + 0x190]
push eax
call fcn.004077c0
mov esi, 0x4136a4
mov dword [ebp + 0x170], esi
mov eax, dword [ebp + 0x2cc]
lea ecx, [ebp + 0x244]
cmp eax, ecx
mov byte [ebp - 4], 0x10
je 0x40419f
mov ecx, dword [ebp + 0x240]
push eax
call fcn.004077c0
mov dword [ebp + 0x220], esi
mov eax, dword [ebp + 0x16c]
lea edx, [ebp + 0xe4]
cmp eax, edx
mov byte [ebp - 4], 0x11
je 0x4041c5
mov ecx, dword [ebp + 0xe0]
push eax
call fcn.004077c0
xor eax, eax
jmp 0x4041fd
call fcn.00401fb0
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x430c]
xor ecx, ebp
call fcn.0040fc46
add ebp, 0x4310
mov esp, ebp
pop ebp
ret