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

Disassembly:
push 0x90
mov eax, 0x100d20fb
call fcn.10022400
mov eax, dword [ebp + 8]
and dword [ebp - 0x28], 0
push eax
mov dword [ebp - 0x2c], eax
call fcn.1004a2d9
mov edi, dword [ebp + 0x18]
mov ebx, dword [ebp + 0x1c]
mov ecx, edi
and ecx, ebx
mov esi, eax
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x3c], ebx
cmp ecx, 0xffffffff
jne 0x1004af7d
mov edi, esi
sub edi, dword [ebp + 0x10]
mov ebx, edx
sbb ebx, dword [ebp + 0x14]
mov dword [ebp - 0x38], edi
mov dword [ebp - 0x3c], ebx
mov ecx, edi
add ecx, dword [ebp + 0x10]
mov eax, ebx
adc eax, dword [ebp + 0x14]
cmp eax, edx
jb 0x1004afa0
ja 0x1004af91
cmp ecx, esi
jbe 0x1004afa0
push 0x80070057
push 0x2e6e7432
call fcn.1003d69d
mov eax, edi
or eax, ebx
je 0x1004b3e2
cmp dword [ebp + 0xc], 1
jne 0x1004afc3
test ebx, ebx
jne 0x1004afbd
cmp edi, 0xffffffff
ja 0x1004afbd
mov esi, edi
jmp 0x1004b001
call dword [sym.imp.MSVCR100.dll__invalid_parameter_noinfo_noreturn]
test ebx, ebx
jne 0x1004affc
cmp edi, 0xc0000
ja 0x1004affc
test ebx, ebx
jne 0x1004aff5
cmp edi, 0x30000
ja 0x1004aff5
test ebx, ebx
jne 0x1004afee
cmp edi, 0x6000
ja 0x1004afee
mov esi, 0x180
jmp 0x1004b001
mov esi, 0xc00
jmp 0x1004b001
mov esi, 0x6000
jmp 0x1004b001
mov esi, 0x30000
and dword [ebp - 0x14], 0
push 0
push esi
push 0x11
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x18], esi
call fcn.1003fee1
mov eax, dword [ebp + 0xc]
and dword [ebp - 4], 0
sub eax, 0
je 0x1004b3d6
dec eax
je 0x1004b130
dec eax
je 0x1004b04a
dec eax
je 0x1004b15d
push 0x80070057
push 0x2e6e7433
call fcn.1003d69d
jmp 0x1004b15d
lea eax, [ebp - 0x50]
push eax
lea ecx, [ebp - 0x14]
call fcn.1003ff8b
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x28]
mov byte [ecx], al
lea ecx, [ebp - 0x50]
call fcn.1003fcfe
lea eax, [ebp - 0x94]
push eax
lea ecx, [ebp - 0x14]
call fcn.1003ff8b
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x2c]
mov byte [ecx + 1], al
lea ecx, [ebp - 0x94]
call fcn.1003fcfe
lea eax, [ebp - 0x84]
push eax
lea ecx, [ebp - 0x14]
call fcn.1003ff8b
mov ecx, dword [eax + 4]
mov al, byte [ebp + 0x30]
mov byte [ecx + 2], al
lea ecx, [ebp - 0x84]
call fcn.1003fcfe
mov esi, dword [ebp - 0x18]
push 3
pop ecx
mov dword [ebp - 0x34], ecx
cmp esi, ecx
jbe 0x1004b11e
lea eax, [ebp - 0x5c]
push eax
lea ecx, [ebp - 0x14]
call fcn.1003ff8b
mov edi, eax
lea eax, [ebp - 0x74]
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 1
call fcn.1003ff8b
mov edx, dword [edi + 4]
mov edi, dword [ebp - 0x34]
cmp edi, esi
ja 0x1004afbd
mov eax, dword [eax + 4]
push edi
mov ecx, esi
sub ecx, edi
push edx
push ecx
add eax, edi
push eax
mov dword [ebp - 0x40], ecx
call dword [sym.imp.MSVCR100.dll_memcpy_s]
add esp, 0x10
lea ecx, [ebp - 0x74]
call fcn.1003fcfe
lea ecx, [ebp - 0x5c]
mov byte [ebp - 4], 0
call fcn.1003fcfe
add edi, edi
mov dword [ebp - 0x34], edi
cmp esi, edi
ja 0x1004b0b9
mov edi, dword [ebp - 0x38]
mov byte [ebp + 0x30], 0
mov al, byte [ebp + 0x30]
mov byte [ebp + 0x2c], al
mov al, byte [ebp + 0x2c]
mov byte [ebp + 0x28], al
jmp 0x1004b15a
lea eax, [ebp - 0x64]
push eax
lea ecx, [ebp - 0x14]
call fcn.1003ff8b
mov ecx, dword [eax + 4]
movzx eax, byte [ebp + 0x28]
push esi
push eax
push ecx
call sub.MSVCR100.dll_memset
add esp, 0xc
lea ecx, [ebp - 0x64]
call fcn.1003fcfe
mov byte [ebp + 0x28], 0
mov esi, dword [ebp - 0x18]
and dword [ebp - 0x30], 0
cmp byte [ebp + 0x20], 0
mov byte [ebp - 4], 2
je 0x1004b178
push 0
push esi
push 0x11
lea ecx, [ebp - 0x30]
call fcn.1003fee1
push 0
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp - 0x2c]
call fcn.1004a335
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x44], ebx
push esi
push ebx
push edi
call fcn.10055b28
test al, al
je 0x1004b19f
lea edi, [ebp - 0x18]
jmp 0x1004b1b8
test ebx, ebx
ja 0x1004afbd
jb 0x1004b1b2
cmp edi, 0xffffffff
ja 0x1004afbd
mov dword [ebp - 0x54], edi
lea edi, [ebp - 0x54]
cmp dword [ebp + 0xc], 3
mov edi, dword [edi]
jne 0x1004b1cb
push 0
lea eax, [ebp - 0x14]
push eax
call fcn.1004d2f4
cmp byte [ebp + 0x20], 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x50], xmm0
je 0x1004b1ec
push 1
push 0
push 0
push dword [ebp - 0x2c]
call fcn.1004a335
mov dword [ebp - 0x34], edx
jmp 0x1004b1f5
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x50]
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0x6c]
push eax
lea ecx, [ebp - 0x14]
call fcn.1003ff8b
or dword [ebp - 0x28], 1
push 0
lea ecx, [ebp - 0x1c]
push ecx
push edi
push dword [eax + 4]
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1004b228
mov byte [ebp - 0x21], 0
cmp edi, dword [ebp - 0x1c]
je 0x1004b22c
mov byte [ebp - 0x21], 1
mov eax, dword [ebp - 0x28]
test al, 1
je 0x1004b241
and eax, 0xfffffffe
lea ecx, [ebp - 0x6c]
mov dword [ebp - 0x28], eax
call fcn.1003fcfe
cmp byte [ebp - 0x21], 0
je 0x1004b266
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1004b25b
and eax, 0xffff
or eax, 0x80070000
push eax
push 0x2e6e7434
call fcn.1003d69d
cmp byte [ebp + 0x20], 0
je 0x1004b359
push 0
push dword [ebp - 0x34]
push dword [ebp - 0x40]
push dword [ebp - 0x2c]
call fcn.1004a335
lea eax, [ebp - 0x7c]
push eax
lea ecx, [ebp - 0x30]
call fcn.1003ff8b
mov ebx, dword [ebp - 0x28]
push 0
lea ecx, [ebp - 0x20]
push ecx
push edi
push dword [eax + 4]
or ebx, 2
push dword [ebp - 0x2c]
mov dword [ebp - 0x28], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1004b2b5
mov byte [ebp - 0x21], 0
cmp edi, dword [ebp - 0x20]
je 0x1004b2b9
mov byte [ebp - 0x21], 1
test bl, 2
je 0x1004b2cc
and ebx, 0xfffffffd
lea ecx, [ebp - 0x7c]
mov dword [ebp - 0x28], ebx
call fcn.1003fcfe
cmp byte [ebp - 0x21], 0
je 0x1004b2f1
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1004b2e6
and eax, 0xffff
or eax, 0x80070000
push eax
push 0x2e6e7435
call fcn.1003d69d
lea eax, [ebp - 0x9c]
push eax
lea ecx, [ebp - 0x30]
call fcn.1003ff8b
mov ebx, eax
lea eax, [ebp - 0x8c]
push eax
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 3
call fcn.1003ff8b
push edi
push dword [ebx + 4]
push dword [eax + 4]
call sub.MSVCR100.dll_memcmp
add esp, 0xc
test eax, eax
lea ecx, [ebp - 0x8c]
sete bl
call fcn.1003fcfe
lea ecx, [ebp - 0x9c]
mov byte [ebp - 4], 2
call fcn.1003fcfe
test bl, bl
jne 0x1004b356
push 0x80004005
push 0x2e6e7436
call fcn.1003d69d
mov ebx, dword [ebp - 0x3c]
push esi
push ebx
push dword [ebp - 0x38]
call fcn.10055b43
test al, al
jne 0x1004b382
push esi
lea eax, [ebp - 0x48]
push eax
call fcn.10055af9
mov ebx, dword [ebp - 0x44]
mov edi, dword [ebp - 0x48]
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x38], edi
jmp 0x1004b18e
cmp byte [ebp + 0x20], 0
je 0x1004b390
lea ecx, [ebp - 0x30]
call fcn.1004004e
lea ecx, [ebp - 0x14]
call fcn.1004004e
cmp byte [ebp + 0x24], 0
je 0x1004b3ca
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x1004b3ca
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1004b3bf
and eax, 0xffff
or eax, 0x80070000
push eax
push 0x2e6e7437
call fcn.1003d69d
lea ecx, [ebp - 0x30]
mov byte [ebp - 4], 0
call fcn.1004008e
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x14]
call fcn.1004008e
call fcn.10022631
ret 0x2c