Function at 0x408330
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x436da8
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
push esi
push edi
mov eax, dword [0x446414]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [ebx + 0x20]
cmp dword [ecx - 0xc], 0
mov esi, dword [ecx - 0x10]
lea edi, [ebx + 0x20]
lea eax, [ecx - 0x10]
mov dword [ebp - 0x2c], edi
je 0x4083b9
cmp dword [eax + 0xc], 0
lea edx, [eax + 0xc]
jge 0x408395
cmp dword [ecx - 8], 0
jge 0x408385
push 0x80070057
call fcn.00402dc0
mov dword [ecx - 0xc], 0
mov eax, dword [edi]
xor ecx, ecx
mov word [eax], cx
jmp 0x4083b9
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4083ab
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [esi]
mov eax, dword [edx + 0xc]
mov ecx, esi
call eax
add eax, 0x10
mov dword [edi], eax
mov eax, dword [ebx + 4]
mov ecx, 0x43b37c
test al, 0x40
je 0x4083cc
mov ecx, 0x43fd30
jmp 0x4083d5
test al, 0x20
je 0x4083d5
mov ecx, 0x43fd38
push ecx
mov ecx, dword [ebp + 8]
push ecx
mov dword [ebx], 0
call fcn.00420aa2
add esp, 8
mov dword [ebx], eax
test eax, eax
jne 0x408407
push ebx
call fcn.00408140
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [ebx + 4]
xor esi, esi
mov byte [ebp - 0x11], 1
mov dword [ebp - 0x18], esi
mov dword [ebx + 0x18], 1
test cl, 0x10
je 0x408608
push 2
push esi
push eax
call fcn.00420c6b
mov edx, dword [ebx]
add esp, 0xc
push edx
call fcn.00420e7b
add esp, 4
push esi
mov dword [ebx + 0x10], eax
mov eax, dword [ebx]
push esi
push eax
call fcn.00420c6b
mov eax, dword [ebx + 0x10]
mov edi, 0x400
add esp, 0xc
mov dword [ebp - 0x24], edi
cmp eax, edi
jge 0x408466
mov dword [ebp - 0x24], eax
test eax, eax
je 0x4086be
mov edi, eax
push edi
call fcn.0041f33f
mov ecx, dword [ebx]
add esp, 4
push ecx
push 1
push edi
push eax
mov dword [ebp - 0x20], eax
call fcn.004212fb
add esp, 0x10
cmp eax, 1
sete al
mov byte [ebp - 0x11], al
test al, al
je 0x4085f7
and dword [ebx + 4], 0xfffffffa
mov dword [ebp - 0x1c], esi
cmp dword [0x447568], esi
je 0x408528
xor eax, eax
jmp 0x4084b0
mov ecx, dword [eax + 0x44756c]
test ecx, ecx
jle 0x4084dd
cmp esi, edi
jge 0x4084da
mov ecx, dword [ebp - 0x20]
mov cl, byte [ecx + esi]
mov edx, dword [eax + 0x447568]
cmp cl, byte [esi + edx]
mov ecx, dword [eax + 0x44756c]
jne 0x4084da
inc esi
cmp esi, ecx
jl 0x4084ba
mov dword [ebp - 0x18], esi
mov eax, dword [ebp - 0x1c]
cmp esi, ecx
je 0x408500
inc eax
mov dword [ebp - 0x1c], eax
shl eax, 4
cmp dword [eax + 0x447568], 0
mov dword [ebp - 0x18], 0
mov esi, dword [ebp - 0x18]
jne 0x4084b0
jmp 0x408528
shl eax, 4
mov edx, dword [eax + 0x447574]
or edx, dword [ebx + 4]
mov dword [ebx + 4], edx
cmp esi, 2
jne 0x408517
mov dword [ebx + 0x18], esi
mov edx, dword [eax + 0x447570]
lea edi, [ebx + 0x24]
call fcn.00401ce0
mov edi, dword [ebp - 0x24]
cmp edi, esi
jle 0x40853a
mov eax, dword [ebx]
push 0
push esi
push eax
call fcn.00420c6b
add esp, 0xc
test esi, esi
jne 0x4085d9
lea esi, [ebp - 0x1c]
call fcn.00401bb0
mov ecx, dword [ebp - 0x20]
push edi
push ecx
push ecx
mov dword [ebp - 4], 0
mov eax, esp
lea edx, [ebp - 0x44]
mov dword [ebp - 0x28], esp
push edx
mov dword [eax], str.UTF_8
call fcn.00406770
mov eax, edi
mov byte [ebp - 4], 1
call fcn.00401e80
push ecx
mov ecx, esp
mov dword [ebp - 0x28], esp
push eax
lea eax, [ebp - 0x44]
mov dword [ebp - 0x34], edi
push eax
mov dword [ecx], str.UTF_16
call fcn.00406a30
call fcn.0040d850
push ecx
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x28], esp
mov eax, esp
lea edx, [ebp - 0x28]
push edx
mov dword [eax], ecx
call fcn.0040adc0
add esp, 8
lea edi, [ebx + 0x24]
mov byte [ebp - 4], 2
call fcn.00401c70
lea ecx, [ebp - 0x28]
call fcn.00409750
lea esi, [ebp - 0x44]
call fcn.00408720
lea ecx, [ebp - 0x1c]
mov dword [ebp - 4], 0xffffffff
call fcn.00409750
mov esi, dword [ebp - 0x18]
mov eax, dword [ebx + 0x24]
cmp dword [eax - 0xc], 0
lea edi, [ebx + 0x24]
jne 0x4085f7
mov ecx, dword [ebp - 0x20]
cmp byte [ecx], 0x3c
jne 0x4085f7
mov edx, str.UTF_8
call fcn.00401ce0
mov edx, dword [ebp - 0x20]
push edx
call fcn.00420378
add esp, 4
jmp 0x4086b4
test cl, 0x20
je 0x4086c1
test cl, 0x40
je 0x408631
push 2
push 0
push eax
call fcn.00420c6b
mov eax, dword [ebx]
add esp, 0xc
push eax
call fcn.00420e7b
add esp, 4
mov dword [ebx + 0x10], eax
xor ecx, ecx
cmp dword [0x447568], ecx
je 0x4086c1
mov edx, dword [ebx + 4]
xor eax, eax
test dword [eax + 0x447574], edx
jne 0x40865c
inc ecx
mov eax, ecx
shl eax, 4
cmp dword [eax + 0x447568], esi
jne 0x408644
jmp 0x4086c1
shl ecx, 4
mov esi, ecx
mov eax, dword [esi + 0x44756c]
mov dword [ebp - 0x18], eax
cmp eax, 2
jne 0x408672
mov dword [ebx + 0x18], eax
mov edx, dword [esi + 0x447570]
lea edi, [ebx + 0x24]
call fcn.00401ce0
cmp dword [ebx + 0x10], 0
je 0x408692
mov dword [ebp - 0x18], 0
mov esi, dword [ebp - 0x18]
jmp 0x4086be
mov ecx, dword [ebx]
mov edx, dword [ebp - 0x18]
mov eax, dword [esi + 0x447568]
push ecx
push 1
push edx
push eax
call fcn.00421037
mov esi, dword [ebp - 0x18]
add esp, 0x10
cmp eax, 1
sete byte [ebp - 0x11]
cmp byte [ebp - 0x11], 0
je 0x4083ee
mov edi, dword [ebp - 0x2c]
test byte [ebx + 4], 0x40
je 0x4086cf
mov ecx, dword [ebx + 0x10]
mov dword [ebx + 0x14], ecx
jmp 0x4086d2
mov dword [ebx + 0x14], esi
test esi, esi
je 0x4086fd
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0
push ecx
mov eax, esp
mov dword [ebp - 0x2c], esp
push ecx
mov dword [eax], 0
mov eax, esp
mov dword [ebp - 0x2c], esp
push edi
mov dword [eax], 0x43fd40
call fcn.00406570
add esp, 0x18
mov al, byte [ebp - 0x11]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4